diff --git a/.eslintrc.js b/.eslintrc.js index a4ce657d523d95..22d0270a5b066b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1370,7 +1370,7 @@ module.exports = { { // Source files only - allow `any` in test/mock files files: ['x-pack/plugins/enterprise_search/**/*.{ts,tsx}'], - excludedFiles: ['x-pack/plugins/enterprise_search/**/*.{test,mock}.{ts,tsx}'], + excludedFiles: ['x-pack/plugins/enterprise_search/**/*.{test,mock,test_helper}.{ts,tsx}'], rules: { '@typescript-eslint/no-explicit-any': 'error', }, diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 68fadd4958cbab..a017c79309a56c 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -89,7 +89,7 @@ # Client Side Monitoring / Uptime (lives in APM directories but owned by Uptime) /x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm @elastic/uptime /x-pack/plugins/apm/e2e/cypress/integration/csm_dashboard.feature @elastic/uptime -/x-pack/plugins/apm/public/application/csmApp.tsx @elastic/uptime +/x-pack/plugins/apm/public/application/uxApp.tsx @elastic/uptime /x-pack/plugins/apm/public/components/app/RumDashboard @elastic/uptime /x-pack/plugins/apm/server/lib/rum_client @elastic/uptime /x-pack/plugins/apm/server/routes/rum_client.ts @elastic/uptime @@ -128,8 +128,10 @@ /x-pack/test/functional_basic/apps/ml/ @elastic/ml-ui /x-pack/test/functional_with_es_ssl/apps/ml/ @elastic/ml-ui -# ML team owns and maintains the transform plugin despite it living in the Elasticsearch management section. +# ML team owns and maintains the transform plugin despite it living in the Data management section. /x-pack/plugins/transform/ @elastic/ml-ui +/x-pack/plugins/data_visualizer/ @elastic/ml-ui +/x-pack/plugins/file_upload/ @elastic/ml-ui /x-pack/test/accessibility/apps/transform.ts @elastic/ml-ui /x-pack/test/api_integration/apis/transform/ @elastic/ml-ui /x-pack/test/api_integration_basic/apis/transform/ @elastic/ml-ui @@ -305,29 +307,29 @@ /x-pack/plugins/enterprise_search/server/collectors/workplace_search/ @elastic/workplace-search-frontend /x-pack/plugins/enterprise_search/server/saved_objects/workplace_search/ @elastic/workplace-search-frontend -# Elasticsearch UI -/src/plugins/dev_tools/ @elastic/es-ui -/src/plugins/console/ @elastic/es-ui -/src/plugins/es_ui_shared/ @elastic/es-ui -/x-pack/plugins/cross_cluster_replication/ @elastic/es-ui -/x-pack/plugins/index_lifecycle_management/ @elastic/es-ui -/x-pack/plugins/console_extensions/ @elastic/es-ui -/x-pack/plugins/grokdebugger/ @elastic/es-ui -/x-pack/plugins/index_management/ @elastic/es-ui -/x-pack/plugins/license_api_guard/ @elastic/es-ui -/x-pack/plugins/license_management/ @elastic/es-ui -/x-pack/plugins/painless_lab/ @elastic/es-ui -/x-pack/plugins/remote_clusters/ @elastic/es-ui -/x-pack/plugins/rollup/ @elastic/es-ui -/x-pack/plugins/searchprofiler/ @elastic/es-ui -/x-pack/plugins/snapshot_restore/ @elastic/es-ui -/x-pack/plugins/upgrade_assistant/ @elastic/es-ui -/x-pack/plugins/watcher/ @elastic/es-ui -/x-pack/plugins/ingest_pipelines/ @elastic/es-ui -/packages/kbn-ace/ @elastic/es-ui -/packages/kbn-monaco/ @elastic/es-ui -#CC# /x-pack/plugins/console_extensions/ @elastic/es-ui -#CC# /x-pack/plugins/cross_cluster_replication/ @elastic/es-ui +# Stack Management +/src/plugins/dev_tools/ @elastic/kibana-stack-management +/src/plugins/console/ @elastic/kibana-stack-management +/src/plugins/es_ui_shared/ @elastic/kibana-stack-management +/x-pack/plugins/cross_cluster_replication/ @elastic/kibana-stack-management +/x-pack/plugins/index_lifecycle_management/ @elastic/kibana-stack-management +/x-pack/plugins/console_extensions/ @elastic/kibana-stack-management +/x-pack/plugins/grokdebugger/ @elastic/kibana-stack-management +/x-pack/plugins/index_management/ @elastic/kibana-stack-management +/x-pack/plugins/license_api_guard/ @elastic/kibana-stack-management +/x-pack/plugins/license_management/ @elastic/kibana-stack-management +/x-pack/plugins/painless_lab/ @elastic/kibana-stack-management +/x-pack/plugins/remote_clusters/ @elastic/kibana-stack-management +/x-pack/plugins/rollup/ @elastic/kibana-stack-management +/x-pack/plugins/searchprofiler/ @elastic/kibana-stack-management +/x-pack/plugins/snapshot_restore/ @elastic/kibana-stack-management +/x-pack/plugins/upgrade_assistant/ @elastic/kibana-stack-management +/x-pack/plugins/watcher/ @elastic/kibana-stack-management +/x-pack/plugins/ingest_pipelines/ @elastic/kibana-stack-management +/packages/kbn-ace/ @elastic/kibana-stack-management +/packages/kbn-monaco/ @elastic/kibana-stack-management +#CC# /x-pack/plugins/console_extensions/ @elastic/kibana-stack-management +#CC# /x-pack/plugins/cross_cluster_replication/ @elastic/kibana-stack-management # Security Solution /x-pack/test/endpoint_api_integration_no_ingest/ @elastic/security-solution diff --git a/.gitignore b/.gitignore index f9855520cb1103..d5a51049540787 100644 --- a/.gitignore +++ b/.gitignore @@ -63,7 +63,7 @@ npm-debug.log* .vagrant ## @cypress/snapshot from apm plugin -snapshots.js +/snapshots.js # release notes script output report.csv diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index d80ad948cbb553..acb62043a15ca7 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -10,15 +10,15 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # Fetch Node.js rules http_archive( name = "build_bazel_rules_nodejs", - sha256 = "10f534e1c80f795cffe1f2822becd4897754d18564612510c59b3c73544ae7c6", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.5.0/rules_nodejs-3.5.0.tar.gz"], + sha256 = "4a5d654a4ccd4a4c24eca5d319d85a88a650edf119601550c95bf400c8cc897e", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.5.1/rules_nodejs-3.5.1.tar.gz"], ) # Now that we have the rules let's import from them to complete the work load("@build_bazel_rules_nodejs//:index.bzl", "check_rules_nodejs_version", "node_repositories", "yarn_install") # Assure we have at least a given rules_nodejs version -check_rules_nodejs_version(minimum_version_string = "3.5.0") +check_rules_nodejs_version(minimum_version_string = "3.5.1") # Setup the Node.js toolchain for the architectures we want to support # diff --git a/api_docs/actions.json b/api_docs/actions.json index 8bd644be376d76..d7c5e63434c078 100644 --- a/api_docs/actions.json +++ b/api_docs/actions.json @@ -1054,7 +1054,7 @@ ], "source": { "path": "x-pack/plugins/actions/server/builtin_action_types/pagerduty.ts", - "lineNumber": 121 + "lineNumber": 129 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/actions.mdx b/api_docs/actions.mdx index a5b27c67eaca15..0131bca3e6c507 100644 --- a/api_docs/actions.mdx +++ b/api_docs/actions.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import actionsObj from './actions.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 116 | 0 | 116 | 7 | + ## Server ### Setup diff --git a/api_docs/advanced_settings.mdx b/api_docs/advanced_settings.mdx index 5b0e69c14f58b0..241b6b82598c3f 100644 --- a/api_docs/advanced_settings.mdx +++ b/api_docs/advanced_settings.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import advancedSettingsObj from './advanced_settings.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 23 | 0 | 22 | 1 | + ## Client ### Setup diff --git a/api_docs/alerting.mdx b/api_docs/alerting.mdx index a0294a02d9f109..5dce4a9a2c7b17 100644 --- a/api_docs/alerting.mdx +++ b/api_docs/alerting.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import alertingObj from './alerting.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 213 | 0 | 213 | 15 | + ## Client ### Setup diff --git a/api_docs/apm.json b/api_docs/apm.json index 7eee0349fa349e..84f5a87f404ae9 100644 --- a/api_docs/apm.json +++ b/api_docs/apm.json @@ -78,7 +78,7 @@ ], "source": { "path": "x-pack/plugins/apm/public/plugin.ts", - "lineNumber": 45 + "lineNumber": 47 }, "deprecated": false, "lifecycle": "setup", @@ -96,7 +96,7 @@ ], "source": { "path": "x-pack/plugins/apm/public/plugin.ts", - "lineNumber": 47 + "lineNumber": 49 }, "deprecated": false, "lifecycle": "start", @@ -144,7 +144,7 @@ ], "source": { "path": "x-pack/plugins/apm/server/plugin.ts", - "lineNumber": 55 + "lineNumber": 54 }, "deprecated": false, "children": [ @@ -160,7 +160,7 @@ ], "source": { "path": "x-pack/plugins/apm/server/plugin.ts", - "lineNumber": 65 + "lineNumber": 64 }, "deprecated": false, "children": [ @@ -183,7 +183,7 @@ ], "source": { "path": "x-pack/plugins/apm/server/plugin.ts", - "lineNumber": 65 + "lineNumber": 64 }, "deprecated": false, "isRequired": true @@ -237,7 +237,7 @@ ], "source": { "path": "x-pack/plugins/apm/server/plugin.ts", - "lineNumber": 69 + "lineNumber": 68 }, "deprecated": false, "children": [ @@ -262,7 +262,7 @@ ], "source": { "path": "x-pack/plugins/apm/server/plugin.ts", - "lineNumber": 70 + "lineNumber": 69 }, "deprecated": false, "isRequired": true @@ -281,7 +281,7 @@ ], "source": { "path": "x-pack/plugins/apm/server/plugin.ts", - "lineNumber": 71 + "lineNumber": 70 }, "deprecated": false, "isRequired": true @@ -309,7 +309,7 @@ ], "source": { "path": "x-pack/plugins/apm/server/plugin.ts", - "lineNumber": 269 + "lineNumber": 260 }, "deprecated": false, "children": [ @@ -331,7 +331,7 @@ ], "source": { "path": "x-pack/plugins/apm/server/plugin.ts", - "lineNumber": 269 + "lineNumber": 260 }, "deprecated": false, "isRequired": true @@ -351,7 +351,7 @@ ], "source": { "path": "x-pack/plugins/apm/server/plugin.ts", - "lineNumber": 288 + "lineNumber": 279 }, "deprecated": false, "children": [], diff --git a/api_docs/apm.mdx b/api_docs/apm.mdx index d037dc99e1a542..e2a4ee9e7ea7ab 100644 --- a/api_docs/apm.mdx +++ b/api_docs/apm.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import apmObj from './apm.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 37 | 0 | 37 | 30 | + ## Client ### Setup diff --git a/api_docs/apm_oss.json b/api_docs/apm_oss.json index 75cb60610335b5..c09f772ea0a553 100644 --- a/api_docs/apm_oss.json +++ b/api_docs/apm_oss.json @@ -5,606 +5,15 @@ "functions": [], "interfaces": [], "enums": [], - "misc": [ - { - "parentPluginId": "apmOss", - "id": "def-public.APM_STATIC_INDEX_PATTERN_ID", - "type": "string", - "tags": [], - "label": "APM_STATIC_INDEX_PATTERN_ID", - "description": [], - "signature": [ - "\"apm_static_index_pattern_id\"" - ], - "source": { - "path": "src/plugins/apm_oss/common/index_pattern_constants.ts", - "lineNumber": 9 - }, - "deprecated": false, - "initialIsOpen": false - } - ], - "objects": [], - "setup": { - "parentPluginId": "apmOss", - "id": "def-public.ApmOssPluginSetup", - "type": "Interface", - "tags": [], - "label": "ApmOssPluginSetup", - "description": [], - "source": { - "path": "src/plugins/apm_oss/public/types.ts", - "lineNumber": 10 - }, - "deprecated": false, - "children": [], - "lifecycle": "setup", - "initialIsOpen": true - }, - "start": { - "parentPluginId": "apmOss", - "id": "def-public.ApmOssPluginStart", - "type": "Interface", - "tags": [], - "label": "ApmOssPluginStart", - "description": [], - "source": { - "path": "src/plugins/apm_oss/public/types.ts", - "lineNumber": 13 - }, - "deprecated": false, - "children": [], - "lifecycle": "start", - "initialIsOpen": true - } + "misc": [], + "objects": [] }, "server": { "classes": [], - "functions": [ - { - "parentPluginId": "apmOss", - "id": "def-server.createDjangoAgentInstructions", - "type": "Function", - "tags": [], - "label": "createDjangoAgentInstructions", - "description": [], - "signature": [ - "(apmServerUrl?: string, secretToken?: string) => ({ title: string; textPre: string; commands: string[]; textPost?: undefined; } | { title: string; textPre: string; commands: string[]; textPost: string; })[]" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 88 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "apmOss", - "id": "def-server.createDjangoAgentInstructions.$1", - "type": "string", - "tags": [], - "label": "apmServerUrl", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 88 - }, - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createDjangoAgentInstructions.$2", - "type": "string", - "tags": [], - "label": "secretToken", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 88 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createDotNetAgentInstructions", - "type": "Function", - "tags": [], - "label": "createDotNetAgentInstructions", - "description": [], - "signature": [ - "(apmServerUrl?: string, secretToken?: string) => ({ title: string; textPre: string; commands?: undefined; textPost?: undefined; } | { title: string; textPre: string; commands: string[]; textPost: string; } | { title: string; commands: string[]; textPost: string; textPre?: undefined; })[]" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 631 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "apmOss", - "id": "def-server.createDotNetAgentInstructions.$1", - "type": "string", - "tags": [], - "label": "apmServerUrl", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 631 - }, - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createDotNetAgentInstructions.$2", - "type": "string", - "tags": [], - "label": "secretToken", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 631 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createFlaskAgentInstructions", - "type": "Function", - "tags": [], - "label": "createFlaskAgentInstructions", - "description": [], - "signature": [ - "(apmServerUrl?: string, secretToken?: string) => ({ title: string; textPre: string; commands: string[]; textPost?: undefined; } | { title: string; textPre: string; commands: string[]; textPost: string; })[]" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 173 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "apmOss", - "id": "def-server.createFlaskAgentInstructions.$1", - "type": "string", - "tags": [], - "label": "apmServerUrl", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 173 - }, - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createFlaskAgentInstructions.$2", - "type": "string", - "tags": [], - "label": "secretToken", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 173 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createGoAgentInstructions", - "type": "Function", - "tags": [], - "label": "createGoAgentInstructions", - "description": [], - "signature": [ - "(apmServerUrl?: string, secretToken?: string) => ({ title: string; textPre: string; commands: string[]; textPost?: undefined; } | { title: string; textPre: string; commands: string[]; textPost: string; })[]" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 492 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "apmOss", - "id": "def-server.createGoAgentInstructions.$1", - "type": "string", - "tags": [], - "label": "apmServerUrl", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 492 - }, - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createGoAgentInstructions.$2", - "type": "string", - "tags": [], - "label": "secretToken", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 492 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createJavaAgentInstructions", - "type": "Function", - "tags": [], - "label": "createJavaAgentInstructions", - "description": [], - "signature": [ - "(apmServerUrl?: string, secretToken?: string) => ({ title: string; textPre: string; commands?: undefined; textPost?: undefined; } | { title: string; textPre: string; commands: string[]; textPost: string; })[]" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 585 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "apmOss", - "id": "def-server.createJavaAgentInstructions.$1", - "type": "string", - "tags": [], - "label": "apmServerUrl", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 585 - }, - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createJavaAgentInstructions.$2", - "type": "string", - "tags": [], - "label": "secretToken", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 585 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createJsAgentInstructions", - "type": "Function", - "tags": [], - "label": "createJsAgentInstructions", - "description": [], - "signature": [ - "(apmServerUrl?: string) => ({ title: string; textPre: string; commands?: undefined; textPost?: undefined; } | { title: string; textPre: string; commands: string[]; textPost: string; } | { title: string; textPre: string; commands: string[]; textPost?: undefined; })[]" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 393 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "apmOss", - "id": "def-server.createJsAgentInstructions.$1", - "type": "string", - "tags": [], - "label": "apmServerUrl", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 393 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createNodeAgentInstructions", - "type": "Function", - "tags": [], - "label": "createNodeAgentInstructions", - "description": [], - "signature": [ - "(apmServerUrl?: string, secretToken?: string) => ({ title: string; textPre: string; commands: string[]; textPost?: undefined; } | { title: string; textPre: string; commands: string[]; textPost: string; })[]" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 11 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "apmOss", - "id": "def-server.createNodeAgentInstructions.$1", - "type": "string", - "tags": [], - "label": "apmServerUrl", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 11 - }, - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createNodeAgentInstructions.$2", - "type": "string", - "tags": [], - "label": "secretToken", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 11 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createPhpAgentInstructions", - "type": "Function", - "tags": [], - "label": "createPhpAgentInstructions", - "description": [], - "signature": [ - "(apmServerUrl?: string, secretToken?: string) => ({ title: string; textPre: string; commands?: undefined; textPost?: undefined; } | { title: string; textPre: string; commands: string[]; textPost: string; })[]" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 705 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "apmOss", - "id": "def-server.createPhpAgentInstructions.$1", - "type": "string", - "tags": [], - "label": "apmServerUrl", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 705 - }, - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createPhpAgentInstructions.$2", - "type": "string", - "tags": [], - "label": "secretToken", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 705 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createRackAgentInstructions", - "type": "Function", - "tags": [], - "label": "createRackAgentInstructions", - "description": [], - "signature": [ - "(apmServerUrl?: string, secretToken?: string) => ({ title: string; textPre: string; commands: string[]; textPost?: undefined; } | { title: string; textPre: string; commands: string[]; textPost: string; })[]" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 298 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "apmOss", - "id": "def-server.createRackAgentInstructions.$1", - "type": "string", - "tags": [], - "label": "apmServerUrl", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 298 - }, - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createRackAgentInstructions.$2", - "type": "string", - "tags": [], - "label": "secretToken", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 298 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createRailsAgentInstructions", - "type": "Function", - "tags": [], - "label": "createRailsAgentInstructions", - "description": [], - "signature": [ - "(apmServerUrl?: string, secretToken?: string) => ({ title: string; textPre: string; commands: string[]; textPost?: undefined; } | { title: string; textPre: string; commands: string[]; textPost: string; })[]" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 255 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "apmOss", - "id": "def-server.createRailsAgentInstructions.$1", - "type": "string", - "tags": [], - "label": "apmServerUrl", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 255 - }, - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createRailsAgentInstructions.$2", - "type": "string", - "tags": [], - "label": "secretToken", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 255 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - } - ], + "functions": [], "interfaces": [], "enums": [], "misc": [ - { - "parentPluginId": "apmOss", - "id": "def-server.APM_STATIC_INDEX_PATTERN_ID", - "type": "string", - "tags": [], - "label": "APM_STATIC_INDEX_PATTERN_ID", - "description": [], - "signature": [ - "\"apm_static_index_pattern_id\"" - ], - "source": { - "path": "src/plugins/apm_oss/common/index_pattern_constants.ts", - "lineNumber": 9 - }, - "deprecated": false, - "initialIsOpen": false - }, { "parentPluginId": "apmOss", "id": "def-server.APMOSSConfig", @@ -617,7 +26,7 @@ ], "source": { "path": "src/plugins/apm_oss/server/index.ts", - "lineNumber": 32 + "lineNumber": 31 }, "deprecated": false, "initialIsOpen": false @@ -633,7 +42,7 @@ "description": [], "source": { "path": "src/plugins/apm_oss/server/plugin.ts", - "lineNumber": 47 + "lineNumber": 27 }, "deprecated": false, "children": [ @@ -649,7 +58,7 @@ ], "source": { "path": "src/plugins/apm_oss/server/plugin.ts", - "lineNumber": 48 + "lineNumber": 28 }, "deprecated": false }, @@ -666,34 +75,9 @@ ], "source": { "path": "src/plugins/apm_oss/server/plugin.ts", - "lineNumber": 49 + "lineNumber": 29 }, "deprecated": false - }, - { - "parentPluginId": "apmOss", - "id": "def-server.APMOSSPluginSetup.getRegisteredTutorialProvider", - "type": "Function", - "tags": [], - "label": "getRegisteredTutorialProvider", - "description": [], - "signature": [ - "() => ", - { - "pluginId": "home", - "scope": "server", - "docId": "kibHomePluginApi", - "section": "def-server.TutorialProvider", - "text": "TutorialProvider" - } - ], - "source": { - "path": "src/plugins/apm_oss/server/plugin.ts", - "lineNumber": 50 - }, - "deprecated": false, - "children": [], - "returnComment": [] } ], "lifecycle": "setup", diff --git a/api_docs/apm_oss.mdx b/api_docs/apm_oss.mdx index c4facc4e390b65..2a03249734f9c9 100644 --- a/api_docs/apm_oss.mdx +++ b/api_docs/apm_oss.mdx @@ -11,25 +11,21 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import apmOssObj from './apm_oss.json'; -## Client -### Setup - -### Start - -### Consts, variables and types - + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 4 | 0 | 4 | 0 | ## Server ### Setup -### Functions - - ### Consts, variables and types diff --git a/api_docs/banners.mdx b/api_docs/banners.mdx index e6b648e38cdc34..d9727cb817e26a 100644 --- a/api_docs/banners.mdx +++ b/api_docs/banners.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import bannersObj from './banners.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 9 | 0 | 9 | 0 | + ## Common ### Interfaces diff --git a/api_docs/bfetch.json b/api_docs/bfetch.json index 76b2118282b2e5..ce294077f9499c 100644 --- a/api_docs/bfetch.json +++ b/api_docs/bfetch.json @@ -78,7 +78,7 @@ "description": [], "source": { "path": "src/plugins/bfetch/public/plugin.ts", - "lineNumber": 24 + "lineNumber": 23 }, "deprecated": false, "children": [ @@ -98,7 +98,7 @@ ], "source": { "path": "src/plugins/bfetch/public/plugin.ts", - "lineNumber": 25 + "lineNumber": 24 }, "deprecated": false, "returnComment": [], @@ -115,7 +115,7 @@ ], "source": { "path": "src/plugins/bfetch/public/plugin.ts", - "lineNumber": 25 + "lineNumber": 24 }, "deprecated": false } @@ -143,7 +143,7 @@ ], "source": { "path": "src/plugins/bfetch/public/plugin.ts", - "lineNumber": 26 + "lineNumber": 25 }, "deprecated": false, "returnComment": [], @@ -161,7 +161,7 @@ ], "source": { "path": "src/plugins/bfetch/public/plugin.ts", - "lineNumber": 27 + "lineNumber": 26 }, "deprecated": false } @@ -195,7 +195,7 @@ ], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 39 + "lineNumber": 41 }, "deprecated": false, "children": [ @@ -211,7 +211,7 @@ ], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 40 + "lineNumber": 42 }, "deprecated": false, "returnComment": [], @@ -228,7 +228,7 @@ ], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 40 + "lineNumber": 42 }, "deprecated": false } @@ -290,7 +290,7 @@ "description": [], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 44 + "lineNumber": 46 }, "deprecated": false, "children": [ @@ -322,7 +322,7 @@ ], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 45 + "lineNumber": 47 }, "deprecated": false, "returnComment": [], @@ -336,7 +336,7 @@ "description": [], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 46 + "lineNumber": 48 }, "deprecated": false }, @@ -368,7 +368,7 @@ ], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 47 + "lineNumber": 49 }, "deprecated": false } @@ -402,7 +402,7 @@ ], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 49 + "lineNumber": 51 }, "deprecated": false, "returnComment": [], @@ -416,7 +416,7 @@ "description": [], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 50 + "lineNumber": 52 }, "deprecated": false }, @@ -448,7 +448,7 @@ ], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 51 + "lineNumber": 53 }, "deprecated": false } @@ -682,7 +682,7 @@ ], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 81 + "lineNumber": 83 }, "deprecated": false, "returnComment": [], @@ -719,7 +719,7 @@ ], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 89 + "lineNumber": 91 }, "deprecated": false } @@ -738,7 +738,7 @@ "description": [], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 94 + "lineNumber": 96 }, "deprecated": false, "children": [], @@ -1343,6 +1343,48 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "bfetch", + "id": "def-common.BatchItemWrapper", + "type": "Interface", + "tags": [], + "label": "BatchItemWrapper", + "description": [], + "source": { + "path": "src/plugins/bfetch/common/batch.ts", + "lineNumber": 23 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "bfetch", + "id": "def-common.BatchItemWrapper.compressed", + "type": "boolean", + "tags": [], + "label": "compressed", + "description": [], + "source": { + "path": "src/plugins/bfetch/common/batch.ts", + "lineNumber": 24 + }, + "deprecated": false + }, + { + "parentPluginId": "bfetch", + "id": "def-common.BatchItemWrapper.payload", + "type": "string", + "tags": [], + "label": "payload", + "description": [], + "source": { + "path": "src/plugins/bfetch/common/batch.ts", + "lineNumber": 25 + }, + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "bfetch", "id": "def-common.BatchRequestData", @@ -1684,7 +1726,25 @@ } ], "enums": [], - "misc": [], + "misc": [ + { + "parentPluginId": "bfetch", + "id": "def-common.DISABLE_BFETCH_COMPRESSION", + "type": "string", + "tags": [], + "label": "DISABLE_BFETCH_COMPRESSION", + "description": [], + "signature": [ + "\"bfetch:disableCompression\"" + ], + "source": { + "path": "src/plugins/bfetch/common/constants.ts", + "lineNumber": 9 + }, + "deprecated": false, + "initialIsOpen": false + } + ], "objects": [] } } \ No newline at end of file diff --git a/api_docs/bfetch.mdx b/api_docs/bfetch.mdx index 0e9a9e79dbea60..217e190831313b 100644 --- a/api_docs/bfetch.mdx +++ b/api_docs/bfetch.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import bfetchObj from './bfetch.json'; +Considering using bfetch capabilities when fetching large amounts of data. This services supports batching HTTP requests and streaming responses back. + +Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 73 | 1 | 62 | 2 | + ## Client ### Start @@ -47,3 +57,6 @@ import bfetchObj from './bfetch.json'; ### Interfaces +### Consts, variables and types + + diff --git a/api_docs/canvas.mdx b/api_docs/canvas.mdx index 75ac78d571bc99..9d8707ab778e6b 100644 --- a/api_docs/canvas.mdx +++ b/api_docs/canvas.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import canvasObj from './canvas.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 6 | 0 | 5 | 3 | + ## Client ### Setup diff --git a/api_docs/cases.json b/api_docs/cases.json index 3d77ada0c336b4..cccf5de2710e28 100644 --- a/api_docs/cases.json +++ b/api_docs/cases.json @@ -34,21 +34,9 @@ "text": "CasesUiStart" }, ", ", - { - "pluginId": "cases", - "scope": "public", - "docId": "kibCasesPluginApi", - "section": "def-public.SetupPlugins", - "text": "SetupPlugins" - }, + "SetupPlugins", ", ", - { - "pluginId": "cases", - "scope": "public", - "docId": "kibCasesPluginApi", - "section": "def-public.StartPlugins", - "text": "StartPlugins" - }, + "StartPlugins", ">" ], "source": { @@ -117,13 +105,7 @@ "text": "CoreSetup" }, ", plugins: ", - { - "pluginId": "cases", - "scope": "public", - "docId": "kibCasesPluginApi", - "section": "def-public.SetupPlugins", - "text": "SetupPlugins" - }, + "SetupPlugins", ") => void" ], "source": { @@ -164,13 +146,7 @@ "label": "plugins", "description": [], "signature": [ - { - "pluginId": "cases", - "scope": "public", - "docId": "kibCasesPluginApi", - "section": "def-public.SetupPlugins", - "text": "SetupPlugins" - } + "SetupPlugins" ], "source": { "path": "x-pack/plugins/cases/public/plugin.ts", @@ -199,13 +175,7 @@ "text": "CoreStart" }, ", plugins: ", - { - "pluginId": "cases", - "scope": "public", - "docId": "kibCasesPluginApi", - "section": "def-public.StartPlugins", - "text": "StartPlugins" - }, + "StartPlugins", ") => ", { "pluginId": "cases", @@ -252,13 +222,7 @@ "label": "plugins", "description": [], "signature": [ - { - "pluginId": "cases", - "scope": "public", - "docId": "kibCasesPluginApi", - "section": "def-public.StartPlugins", - "text": "StartPlugins" - } + "StartPlugins" ], "source": { "path": "x-pack/plugins/cases/public/plugin.ts", @@ -296,62 +260,91 @@ "interfaces": [ { "parentPluginId": "cases", - "id": "def-public.SetupPlugins", + "id": "def-public.AllCasesProps", "type": "Interface", "tags": [], - "label": "SetupPlugins", + "label": "AllCasesProps", "description": [], + "signature": [ + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.AllCasesProps", + "text": "AllCasesProps" + }, + " extends ", + "Owner" + ], "source": { - "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 22 + "path": "x-pack/plugins/cases/public/components/all_cases/index.tsx", + "lineNumber": 13 }, "deprecated": false, "children": [ { "parentPluginId": "cases", - "id": "def-public.SetupPlugins.security", + "id": "def-public.AllCasesProps.caseDetailsNavigation", "type": "Object", "tags": [], - "label": "security", + "label": "caseDetailsNavigation", "description": [], "signature": [ - "{ authc: ", - "AuthenticationServiceSetup", - "; sessionTimeout: ", - "SessionTimeout", - "; license: Readonly<{ isLicenseAvailable: () => boolean; isEnabled: () => boolean; getType: () => \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; getFeatures: () => ", - "SecurityLicenseFeatures", - "; features$: ", - "Observable", + "CasesNavigation", "<", - "SecurityLicenseFeatures", - ">; }>; __legacyCompat: { logoutUrl: string; tenant: string; }; }" + "CaseDetailsHrefSchema", + ", \"configurable\">" ], "source": { - "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 23 + "path": "x-pack/plugins/cases/public/components/all_cases/index.tsx", + "lineNumber": 14 }, "deprecated": false }, { "parentPluginId": "cases", - "id": "def-public.SetupPlugins.triggersActionsUi", + "id": "def-public.AllCasesProps.configureCasesNavigation", "type": "Object", "tags": [], - "label": "triggersActionsUi", + "label": "configureCasesNavigation", "description": [], "signature": [ - { - "pluginId": "triggersActionsUi", - "scope": "public", - "docId": "kibTriggersActionsUiPluginApi", - "section": "def-public.TriggersAndActionsUIPublicPluginSetup", - "text": "TriggersAndActionsUIPublicPluginSetup" - } + "CasesNavigation", + ", null>" ], "source": { - "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 24 + "path": "x-pack/plugins/cases/public/components/all_cases/index.tsx", + "lineNumber": 15 + }, + "deprecated": false + }, + { + "parentPluginId": "cases", + "id": "def-public.AllCasesProps.createCaseNavigation", + "type": "Object", + "tags": [], + "label": "createCaseNavigation", + "description": [], + "signature": [ + "CasesNavigation", + ", null>" + ], + "source": { + "path": "x-pack/plugins/cases/public/components/all_cases/index.tsx", + "lineNumber": 16 + }, + "deprecated": false + }, + { + "parentPluginId": "cases", + "id": "def-public.AllCasesProps.userCanCrud", + "type": "boolean", + "tags": [], + "label": "userCanCrud", + "description": [], + "source": { + "path": "x-pack/plugins/cases/public/components/all_cases/index.tsx", + "lineNumber": 17 }, "deprecated": false } @@ -360,1664 +353,1043 @@ }, { "parentPluginId": "cases", - "id": "def-public.StartPlugins", + "id": "def-public.AllCasesSelectorModalProps", "type": "Interface", "tags": [], - "label": "StartPlugins", + "label": "AllCasesSelectorModalProps", "description": [], + "signature": [ + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.AllCasesSelectorModalProps", + "text": "AllCasesSelectorModalProps" + }, + " extends ", + "Owner" + ], "source": { - "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 27 + "path": "x-pack/plugins/cases/public/components/all_cases/selector_modal/index.tsx", + "lineNumber": 23 }, "deprecated": false, "children": [ { "parentPluginId": "cases", - "id": "def-public.StartPlugins.triggersActionsUi", + "id": "def-public.AllCasesSelectorModalProps.alertData", "type": "Object", "tags": [], - "label": "triggersActionsUi", + "label": "alertData", "description": [], "signature": [ + "Pick<{ type: ", { - "pluginId": "triggersActionsUi", - "scope": "public", - "docId": "kibTriggersActionsUiPluginApi", - "section": "def-public.TriggersAndActionsUIPublicPluginStart", - "text": "TriggersAndActionsUIPublicPluginStart" + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CommentType", + "text": "CommentType" + }, + ".alert | ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CommentType", + "text": "CommentType" + }, + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; }, \"index\" | \"rule\" | \"alertId\" | \"owner\"> | undefined" + ], + "source": { + "path": "x-pack/plugins/cases/public/components/all_cases/selector_modal/index.tsx", + "lineNumber": 24 + }, + "deprecated": false + }, + { + "parentPluginId": "cases", + "id": "def-public.AllCasesSelectorModalProps.createCaseNavigation", + "type": "Object", + "tags": [], + "label": "createCaseNavigation", + "description": [], + "signature": [ + "CasesNavigation", + ", null>" + ], + "source": { + "path": "x-pack/plugins/cases/public/components/all_cases/selector_modal/index.tsx", + "lineNumber": 25 + }, + "deprecated": false + }, + { + "parentPluginId": "cases", + "id": "def-public.AllCasesSelectorModalProps.hiddenStatuses", + "type": "Array", + "tags": [], + "label": "hiddenStatuses", + "description": [], + "signature": [ + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CaseStatusWithAllStatus", + "text": "CaseStatusWithAllStatus" + }, + "[] | undefined" + ], + "source": { + "path": "x-pack/plugins/cases/public/components/all_cases/selector_modal/index.tsx", + "lineNumber": 26 + }, + "deprecated": false + }, + { + "parentPluginId": "cases", + "id": "def-public.AllCasesSelectorModalProps.onRowClick", + "type": "Function", + "tags": [], + "label": "onRowClick", + "description": [], + "signature": [ + "(theCase?: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.Case", + "text": "Case" + }, + " | ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.SubCase", + "text": "SubCase" + }, + " | undefined) => void" + ], + "source": { + "path": "x-pack/plugins/cases/public/components/all_cases/selector_modal/index.tsx", + "lineNumber": 27 + }, + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "cases", + "id": "def-public.theCase", + "type": "CompoundType", + "tags": [], + "label": "theCase", + "description": [], + "signature": [ + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.Case", + "text": "Case" + }, + " | ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.SubCase", + "text": "SubCase" + }, + " | undefined" + ], + "source": { + "path": "x-pack/plugins/cases/public/components/all_cases/selector_modal/index.tsx", + "lineNumber": 27 + }, + "deprecated": false } + ] + }, + { + "parentPluginId": "cases", + "id": "def-public.AllCasesSelectorModalProps.updateCase", + "type": "Function", + "tags": [], + "label": "updateCase", + "description": [], + "signature": [ + "((newCase: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.Case", + "text": "Case" + }, + ") => void) | undefined" ], "source": { - "path": "x-pack/plugins/cases/public/types.ts", + "path": "x-pack/plugins/cases/public/components/all_cases/selector_modal/index.tsx", "lineNumber": 28 }, "deprecated": false + }, + { + "parentPluginId": "cases", + "id": "def-public.AllCasesSelectorModalProps.userCanCrud", + "type": "boolean", + "tags": [], + "label": "userCanCrud", + "description": [], + "source": { + "path": "x-pack/plugins/cases/public/components/all_cases/selector_modal/index.tsx", + "lineNumber": 29 + }, + "deprecated": false } ], "initialIsOpen": false - } - ], - "enums": [], - "misc": [ + }, { "parentPluginId": "cases", - "id": "def-public.StartServices", - "type": "Type", + "id": "def-public.CaseViewProps", + "type": "Interface", "tags": [], - "label": "StartServices", - "description": [ - "\nTODO: The extra security service is one that should be implemented in the kibana context of the consuming application.\nSecurity is needed for access to authc for the `useCurrentUser` hook. Security_Solution currently passes it via renderApp in public/plugin.tsx\nLeaving it out currently in lieu of RBAC changes" - ], + "label": "CaseViewProps", + "description": [], "signature": [ - { - "pluginId": "core", - "scope": "public", - "docId": "kibCorePluginApi", - "section": "def-public.CoreStart", - "text": "CoreStart" - }, - " & ", { "pluginId": "cases", "scope": "public", "docId": "kibCasesPluginApi", - "section": "def-public.StartPlugins", - "text": "StartPlugins" + "section": "def-public.CaseViewProps", + "text": "CaseViewProps" }, - " & { security: { authc: ", - "AuthenticationServiceSetup", - "; sessionTimeout: ", - "SessionTimeout", - "; license: Readonly<{ isLicenseAvailable: () => boolean; isEnabled: () => boolean; getType: () => \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; getFeatures: () => ", - "SecurityLicenseFeatures", - "; features$: ", - "Observable", - "<", - "SecurityLicenseFeatures", - ">; }>; __legacyCompat: { logoutUrl: string; tenant: string; }; }; }" + " extends ", + "CaseViewComponentProps" ], "source": { - "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 37 + "path": "x-pack/plugins/cases/public/components/case_view/index.tsx", + "lineNumber": 63 }, "deprecated": false, + "children": [ + { + "parentPluginId": "cases", + "id": "def-public.CaseViewProps.onCaseDataSuccess", + "type": "Function", + "tags": [], + "label": "onCaseDataSuccess", + "description": [], + "signature": [ + "((data: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.Case", + "text": "Case" + }, + ") => void) | undefined" + ], + "source": { + "path": "x-pack/plugins/cases/public/components/case_view/index.tsx", + "lineNumber": 64 + }, + "deprecated": false + }, + { + "parentPluginId": "cases", + "id": "def-public.CaseViewProps.timelineIntegration", + "type": "Object", + "tags": [], + "label": "timelineIntegration", + "description": [], + "signature": [ + "CasesTimelineIntegration", + " | undefined" + ], + "source": { + "path": "x-pack/plugins/cases/public/components/case_view/index.tsx", + "lineNumber": 65 + }, + "deprecated": false + } + ], "initialIsOpen": false - } - ], - "objects": [], - "start": { - "parentPluginId": "cases", - "id": "def-public.CasesUiStart", - "type": "Interface", - "tags": [], - "label": "CasesUiStart", - "description": [], - "source": { - "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 42 }, - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-public.CasesUiStart.getAllCases", - "type": "Function", - "tags": [], - "label": "getAllCases", - "description": [], - "signature": [ - "(props: ", - "AllCasesProps", - ") => React.ReactElement<", - "AllCasesProps", - ">" - ], - "source": { - "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 43 - }, - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "cases", - "id": "def-public.props", - "type": "Object", - "tags": [], - "label": "props", - "description": [], - "signature": [ - "AllCasesProps" - ], - "source": { - "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 43 - }, - "deprecated": false - } - ] - }, - { - "parentPluginId": "cases", - "id": "def-public.CasesUiStart.getAllCasesSelectorModal", - "type": "Function", - "tags": [], - "label": "getAllCasesSelectorModal", - "description": [], - "signature": [ - "(props: ", - "AllCasesSelectorModalProps", - ") => React.ReactElement<", - "AllCasesSelectorModalProps", - ">" - ], - "source": { - "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 44 - }, - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "cases", - "id": "def-public.props", - "type": "Object", - "tags": [], - "label": "props", - "description": [], - "signature": [ - "AllCasesSelectorModalProps" - ], - "source": { - "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 45 - }, - "deprecated": false - } - ] - }, - { - "parentPluginId": "cases", - "id": "def-public.CasesUiStart.getCaseView", - "type": "Function", - "tags": [], - "label": "getCaseView", - "description": [], - "signature": [ - "(props: ", - "CaseViewProps", - ") => React.ReactElement<", - "CaseViewProps", - ">" - ], - "source": { - "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 47 - }, - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "cases", - "id": "def-public.props", - "type": "Object", - "tags": [], - "label": "props", - "description": [], - "signature": [ - "CaseViewProps" - ], - "source": { - "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 47 - }, - "deprecated": false - } - ] - }, - { - "parentPluginId": "cases", - "id": "def-public.CasesUiStart.getConfigureCases", - "type": "Function", - "tags": [], - "label": "getConfigureCases", - "description": [], - "signature": [ - "(props: ", - "ConfigureCasesProps", - ") => React.ReactElement<", - "ConfigureCasesProps", - ">" - ], - "source": { - "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 48 - }, - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "cases", - "id": "def-public.props", - "type": "Object", - "tags": [], - "label": "props", - "description": [], - "signature": [ - "ConfigureCasesProps" - ], - "source": { - "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 48 - }, - "deprecated": false - } - ] - }, - { - "parentPluginId": "cases", - "id": "def-public.CasesUiStart.getCreateCase", - "type": "Function", - "tags": [], - "label": "getCreateCase", - "description": [], - "signature": [ - "(props: ", - "CreateCaseProps", - ") => React.ReactElement<", - "CreateCaseProps", - ">" - ], - "source": { - "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 49 - }, - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "cases", - "id": "def-public.props", - "type": "Object", - "tags": [], - "label": "props", - "description": [], - "signature": [ - "CreateCaseProps" - ], - "source": { - "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 49 - }, - "deprecated": false - } - ] - }, - { - "parentPluginId": "cases", - "id": "def-public.CasesUiStart.getRecentCases", - "type": "Function", - "tags": [], - "label": "getRecentCases", - "description": [], - "signature": [ - "(props: ", - "RecentCasesProps", - ") => React.ReactElement<", - "RecentCasesProps", - ">" - ], - "source": { - "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 50 - }, - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "cases", - "id": "def-public.props", - "type": "Object", - "tags": [], - "label": "props", - "description": [], - "signature": [ - "RecentCasesProps" - ], - "source": { - "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 50 - }, - "deprecated": false - } - ] - } - ], - "lifecycle": "start", - "initialIsOpen": true - } - }, - "server": { - "classes": [], - "functions": [], - "interfaces": [ { "parentPluginId": "cases", - "id": "def-server.CaseRequestContext", + "id": "def-public.ConfigureCasesProps", "type": "Interface", "tags": [], - "label": "CaseRequestContext", + "label": "ConfigureCasesProps", "description": [], + "signature": [ + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.ConfigureCasesProps", + "text": "ConfigureCasesProps" + }, + " extends ", + "Owner" + ], "source": { - "path": "x-pack/plugins/cases/server/types.ts", - "lineNumber": 12 + "path": "x-pack/plugins/cases/public/components/configure_cases/index.tsx", + "lineNumber": 55 }, "deprecated": false, "children": [ { "parentPluginId": "cases", - "id": "def-server.CaseRequestContext.getCasesClient", - "type": "Function", + "id": "def-public.ConfigureCasesProps.userCanCrud", + "type": "boolean", "tags": [], - "label": "getCasesClient", + "label": "userCanCrud", "description": [], - "signature": [ - "() => ", - { - "pluginId": "cases", - "scope": "server", - "docId": "kibCasesPluginApi", - "section": "def-server.CasesClient", - "text": "CasesClient" - } - ], "source": { - "path": "x-pack/plugins/cases/server/types.ts", - "lineNumber": 13 + "path": "x-pack/plugins/cases/public/components/configure_cases/index.tsx", + "lineNumber": 56 }, - "deprecated": false, - "returnComment": [], - "children": [] + "deprecated": false } ], "initialIsOpen": false }, { "parentPluginId": "cases", - "id": "def-server.CasesClient", + "id": "def-public.CreateCaseProps", "type": "Interface", "tags": [], - "label": "CasesClient", - "description": [ - "\nThis represents the interface that other plugins can access." + "label": "CreateCaseProps", + "description": [], + "signature": [ + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.CreateCaseProps", + "text": "CreateCaseProps" + }, + " extends ", + "Owner" ], "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 102 + "path": "x-pack/plugins/cases/public/components/create/index.tsx", + "lineNumber": 34 }, "deprecated": false, "children": [ { "parentPluginId": "cases", - "id": "def-server.CasesClient.addComment", + "id": "def-public.CreateCaseProps.afterCaseCreated", "type": "Function", "tags": [], - "label": "addComment", + "label": "afterCaseCreated", "description": [], "signature": [ - "(args: ", - "CasesClientAddComment", - ") => Promise<{ description: string; status: ", + "((theCase: ", { "pluginId": "cases", "scope": "common", "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" + "section": "def-common.Case", + "text": "Case" }, - "; tags: string[]; title: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - "; connector: ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".jira; fields: { issueType: string | null; priority: string | null; parent: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".resilient; fields: { incidentTypes: string[] | null; severityCode: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowITSM; fields: { impact: string | null; severity: string | null; urgency: string | null; category: string | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowSIR; fields: { category: string | null; destIp: boolean | null; malwareHash: boolean | null; malwareUrl: boolean | null; priority: string | null; sourceIp: boolean | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { subCaseIds?: string[] | undefined; subCases?: ({ status: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".user; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".alert | ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[] | undefined; comments?: (({ comment: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".user; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".alert | ", + ", postComment: (args: PostComment) => Promise) => Promise) | undefined" + ], + "source": { + "path": "x-pack/plugins/cases/public/components/create/index.tsx", + "lineNumber": 35 + }, + "deprecated": false + }, + { + "parentPluginId": "cases", + "id": "def-public.CreateCaseProps.caseType", + "type": "CompoundType", + "tags": [], + "label": "caseType", + "description": [], + "signature": [ { "pluginId": "cases", "scope": "common", "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" + "section": "def-common.CaseType", + "text": "CaseType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + " | undefined" + ], + "source": { + "path": "x-pack/plugins/cases/public/components/create/index.tsx", + "lineNumber": 36 + }, + "deprecated": false + }, + { + "parentPluginId": "cases", + "id": "def-public.CreateCaseProps.hideConnectorServiceNowSir", + "type": "CompoundType", + "tags": [], + "label": "hideConnectorServiceNowSir", + "description": [], + "signature": [ + "boolean | undefined" + ], + "source": { + "path": "x-pack/plugins/cases/public/components/create/index.tsx", + "lineNumber": 37 + }, + "deprecated": false + }, + { + "parentPluginId": "cases", + "id": "def-public.CreateCaseProps.onCancel", + "type": "Function", + "tags": [], + "label": "onCancel", + "description": [], + "signature": [ + "() => void" + ], + "source": { + "path": "x-pack/plugins/cases/public/components/create/index.tsx", + "lineNumber": 38 + }, + "deprecated": false, + "returnComment": [], + "children": [] + }, + { + "parentPluginId": "cases", + "id": "def-public.CreateCaseProps.onSuccess", + "type": "Function", + "tags": [], + "label": "onSuccess", + "description": [], + "signature": [ + "(theCase: ", { "pluginId": "cases", "scope": "common", "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" + "section": "def-common.Case", + "text": "Case" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; }>" + ") => Promise" ], "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 103 + "path": "x-pack/plugins/cases/public/components/create/index.tsx", + "lineNumber": 39 }, "deprecated": false, + "returnComment": [], "children": [ { "parentPluginId": "cases", - "id": "def-server.CasesClient.addComment.$1", + "id": "def-public.theCase", "type": "Object", "tags": [], - "label": "args", + "label": "theCase", "description": [], "signature": [ - "CasesClientAddComment" + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.Case", + "text": "Case" + } ], "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 103 + "path": "x-pack/plugins/cases/public/components/create/index.tsx", + "lineNumber": 39 }, - "deprecated": false, - "isRequired": true + "deprecated": false } + ] + }, + { + "parentPluginId": "cases", + "id": "def-public.CreateCaseProps.timelineIntegration", + "type": "Object", + "tags": [], + "label": "timelineIntegration", + "description": [], + "signature": [ + "CasesTimelineIntegration", + " | undefined" ], - "returnComment": [] + "source": { + "path": "x-pack/plugins/cases/public/components/create/index.tsx", + "lineNumber": 40 + }, + "deprecated": false }, { "parentPluginId": "cases", - "id": "def-server.CasesClient.create", - "type": "Function", + "id": "def-public.CreateCaseProps.withSteps", + "type": "CompoundType", "tags": [], - "label": "create", + "label": "withSteps", "description": [], "signature": [ - "(theCase: { type?: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - " | undefined; } & { description: string; tags: string[]; title: string; connector: ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".jira; fields: { issueType: string | null; priority: string | null; parent: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".resilient; fields: { incidentTypes: string[] | null; severityCode: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowITSM; fields: { impact: string | null; severity: string | null; urgency: string | null; category: string | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowSIR; fields: { category: string | null; destIp: boolean | null; malwareHash: boolean | null; malwareUrl: boolean | null; priority: string | null; sourceIp: boolean | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; }) => Promise<{ description: string; status: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - "; tags: string[]; title: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - "; connector: ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".jira; fields: { issueType: string | null; priority: string | null; parent: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".resilient; fields: { incidentTypes: string[] | null; severityCode: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowITSM; fields: { impact: string | null; severity: string | null; urgency: string | null; category: string | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowSIR; fields: { category: string | null; destIp: boolean | null; malwareHash: boolean | null; malwareUrl: boolean | null; priority: string | null; sourceIp: boolean | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { subCaseIds?: string[] | undefined; subCases?: ({ status: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".user; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".alert | ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[] | undefined; comments?: (({ comment: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".user; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".alert | ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; }>" + "boolean | undefined" ], "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 104 + "path": "x-pack/plugins/cases/public/components/create/index.tsx", + "lineNumber": 41 }, - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.create.$1", - "type": "CompoundType", - "tags": [], - "label": "theCase", - "description": [], - "signature": [ - "{ type?: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - " | undefined; } & { description: string; tags: string[]; title: string; connector: ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".jira; fields: { issueType: string | null; priority: string | null; parent: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".resilient; fields: { incidentTypes: string[] | null; severityCode: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowITSM; fields: { impact: string | null; severity: string | null; urgency: string | null; category: string | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowSIR; fields: { category: string | null; destIp: boolean | null; malwareHash: boolean | null; malwareUrl: boolean | null; priority: string | null; sourceIp: boolean | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; }" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 104 - }, - "deprecated": false, - "isRequired": true - } + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-public.RecentCasesProps", + "type": "Interface", + "tags": [], + "label": "RecentCasesProps", + "description": [], + "signature": [ + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.RecentCasesProps", + "text": "RecentCasesProps" + }, + " extends ", + "Owner" + ], + "source": { + "path": "x-pack/plugins/cases/public/components/recent_cases/index.tsx", + "lineNumber": 20 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "cases", + "id": "def-public.RecentCasesProps.allCasesNavigation", + "type": "Object", + "tags": [], + "label": "allCasesNavigation", + "description": [], + "signature": [ + "CasesNavigation", + ", null>" ], - "returnComment": [] + "source": { + "path": "x-pack/plugins/cases/public/components/recent_cases/index.tsx", + "lineNumber": 21 + }, + "deprecated": false }, { "parentPluginId": "cases", - "id": "def-server.CasesClient.get", - "type": "Function", + "id": "def-public.RecentCasesProps.caseDetailsNavigation", + "type": "Object", "tags": [], - "label": "get", + "label": "caseDetailsNavigation", "description": [], "signature": [ - "(args: ", - "CasesClientGet", - ") => Promise<{ description: string; status: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - "; tags: string[]; title: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - "; connector: ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".jira; fields: { issueType: string | null; priority: string | null; parent: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".resilient; fields: { incidentTypes: string[] | null; severityCode: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowITSM; fields: { impact: string | null; severity: string | null; urgency: string | null; category: string | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowSIR; fields: { category: string | null; destIp: boolean | null; malwareHash: boolean | null; malwareUrl: boolean | null; priority: string | null; sourceIp: boolean | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { subCaseIds?: string[] | undefined; subCases?: ({ status: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".user; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".alert | ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[] | undefined; comments?: (({ comment: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".user; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".alert | ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; }>" + "CasesNavigation", + "<", + "CaseDetailsHrefSchema", + ", \"configurable\">" ], "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 105 + "path": "x-pack/plugins/cases/public/components/recent_cases/index.tsx", + "lineNumber": 22 }, - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.get.$1", - "type": "Object", - "tags": [], - "label": "args", - "description": [], - "signature": [ - "CasesClientGet" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 105 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "deprecated": false }, { "parentPluginId": "cases", - "id": "def-server.CasesClient.getAlerts", - "type": "Function", + "id": "def-public.RecentCasesProps.createCaseNavigation", + "type": "Object", "tags": [], - "label": "getAlerts", + "label": "createCaseNavigation", "description": [], "signature": [ - "(args: ", - "CasesClientGetAlerts", - ") => Promise<", - "CasesClientGetAlertsResponse", - ">" + "CasesNavigation", + ", null>" ], "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 106 + "path": "x-pack/plugins/cases/public/components/recent_cases/index.tsx", + "lineNumber": 23 }, - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.getAlerts.$1", - "type": "Object", - "tags": [], - "label": "args", - "description": [], - "signature": [ - "CasesClientGetAlerts" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 106 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "deprecated": false }, { "parentPluginId": "cases", - "id": "def-server.CasesClient.getFields", - "type": "Function", + "id": "def-public.RecentCasesProps.maxCasesToShow", + "type": "number", "tags": [], - "label": "getFields", + "label": "maxCasesToShow", "description": [], - "signature": [ - "(args: ", - "ConfigureFields", - ") => Promise<{ defaultMappings: { action_type: \"append\" | \"overwrite\" | \"nothing\"; source: \"description\" | \"title\" | \"comments\"; target: string; }[]; fields: { id: string; name: string; required: boolean; type: \"text\" | \"textarea\"; }[]; }>" - ], "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 107 + "path": "x-pack/plugins/cases/public/components/recent_cases/index.tsx", + "lineNumber": 24 }, - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.getFields.$1", - "type": "Object", - "tags": [], - "label": "args", - "description": [], - "signature": [ - "ConfigureFields" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 107 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.getMappings", - "type": "Function", - "tags": [], - "label": "getMappings", - "description": [], - "signature": [ - "(args: ", - "MappingsClient", - ") => Promise<{ action_type: \"append\" | \"overwrite\" | \"nothing\"; source: \"description\" | \"title\" | \"comments\"; target: string; }[]>" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 108 + "deprecated": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [], + "objects": [], + "start": { + "parentPluginId": "cases", + "id": "def-public.CasesUiStart", + "type": "Interface", + "tags": [], + "label": "CasesUiStart", + "description": [], + "source": { + "path": "x-pack/plugins/cases/public/types.ts", + "lineNumber": 46 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "cases", + "id": "def-public.CasesUiStart.getAllCases", + "type": "Function", + "tags": [], + "label": "getAllCases", + "description": [ + "\nGet the all cases table" + ], + "signature": [ + "(props: ", + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.AllCasesProps", + "text": "AllCasesProps" }, - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.getMappings.$1", - "type": "Object", - "tags": [], - "label": "args", - "description": [], - "signature": [ - "MappingsClient" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 108 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.getUserActions", - "type": "Function", - "tags": [], - "label": "getUserActions", - "description": [], - "signature": [ - "(args: ", - "CasesClientGetUserActions", - ") => Promise<({ action_field: (\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"connector\" | \"pushed\" | \"sub_case\")[]; action: \"add\" | \"delete\" | \"create\" | \"update\" | \"push-to-service\"; action_at: string; action_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; new_value: string | null; old_value: string | null; } & { action_id: string; case_id: string; comment_id: string | null; } & { sub_case_id?: string | undefined; })[]>" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 109 + ") => React.ReactElement<", + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.AllCasesProps", + "text": "AllCasesProps" }, - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.getUserActions.$1", - "type": "Object", - "tags": [], - "label": "args", - "description": [], - "signature": [ - "CasesClientGetUserActions" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 109 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + ">" + ], + "source": { + "path": "x-pack/plugins/cases/public/types.ts", + "lineNumber": 52 }, - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.push", - "type": "Function", - "tags": [], - "label": "push", - "description": [], - "signature": [ - "(args: ", - "CasesClientPush", - ") => Promise<{ description: string; status: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - "; tags: string[]; title: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - "; connector: ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".jira; fields: { issueType: string | null; priority: string | null; parent: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".resilient; fields: { incidentTypes: string[] | null; severityCode: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowITSM; fields: { impact: string | null; severity: string | null; urgency: string | null; category: string | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowSIR; fields: { category: string | null; destIp: boolean | null; malwareHash: boolean | null; malwareUrl: boolean | null; priority: string | null; sourceIp: boolean | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { subCaseIds?: string[] | undefined; subCases?: ({ status: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".user; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".alert | ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[] | undefined; comments?: (({ comment: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".user; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".alert | ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; }>" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 110 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.push.$1", - "type": "Object", - "tags": [], - "label": "args", - "description": [], - "signature": [ - "CasesClientPush" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 110 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.update", - "type": "Function", - "tags": [], - "label": "update", - "description": [], - "signature": [ - "(args: { cases: ({ description?: string | undefined; status?: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - " | undefined; tags?: string[] | undefined; title?: string | undefined; type?: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - " | undefined; connector?: ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".jira; fields: { issueType: string | null; priority: string | null; parent: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".resilient; fields: { incidentTypes: string[] | null; severityCode: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowITSM; fields: { impact: string | null; severity: string | null; urgency: string | null; category: string | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowSIR; fields: { category: string | null; destIp: boolean | null; malwareHash: boolean | null; malwareUrl: boolean | null; priority: string | null; sourceIp: boolean | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".none; fields: null; }) | undefined; settings?: { syncAlerts: boolean; } | undefined; } & { id: string; version: string; })[]; }) => Promise<({ description: string; status: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - "; tags: string[]; title: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - "; connector: ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".jira; fields: { issueType: string | null; priority: string | null; parent: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".resilient; fields: { incidentTypes: string[] | null; severityCode: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowITSM; fields: { impact: string | null; severity: string | null; urgency: string | null; category: string | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowSIR; fields: { category: string | null; destIp: boolean | null; malwareHash: boolean | null; malwareUrl: boolean | null; priority: string | null; sourceIp: boolean | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { subCaseIds?: string[] | undefined; subCases?: ({ status: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".user; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".alert | ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" + "deprecated": false, + "returnComment": [ + "A react component that displays all cases" + ], + "children": [ + { + "parentPluginId": "cases", + "id": "def-public.props", + "type": "Object", + "tags": [], + "label": "props", + "description": [ + "AllCasesProps" + ], + "signature": [ + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.AllCasesProps", + "text": "AllCasesProps" + } + ], + "source": { + "path": "x-pack/plugins/cases/public/types.ts", + "lineNumber": 52 }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[] | undefined; comments?: (({ comment: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" + "deprecated": false + } + ] + }, + { + "parentPluginId": "cases", + "id": "def-public.CasesUiStart.getAllCasesSelectorModal", + "type": "Function", + "tags": [], + "label": "getAllCasesSelectorModal", + "description": [ + "\nuse Modal hook for all cases selector" + ], + "signature": [ + "(props: ", + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.AllCasesSelectorModalProps", + "text": "AllCasesSelectorModalProps" + }, + ") => React.ReactElement<", + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.AllCasesSelectorModalProps", + "text": "AllCasesSelectorModalProps" + }, + ">" + ], + "source": { + "path": "x-pack/plugins/cases/public/types.ts", + "lineNumber": 58 + }, + "deprecated": false, + "returnComment": [ + "A react component that is a modal for selecting a case" + ], + "children": [ + { + "parentPluginId": "cases", + "id": "def-public.props", + "type": "Object", + "tags": [], + "label": "props", + "description": [ + "UseAllCasesSelectorModalProps" + ], + "signature": [ + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.AllCasesSelectorModalProps", + "text": "AllCasesSelectorModalProps" + } + ], + "source": { + "path": "x-pack/plugins/cases/public/types.ts", + "lineNumber": 59 }, - ".user; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" + "deprecated": false + } + ] + }, + { + "parentPluginId": "cases", + "id": "def-public.CasesUiStart.getCaseView", + "type": "Function", + "tags": [], + "label": "getCaseView", + "description": [ + "\nGet the case view component" + ], + "signature": [ + "(props: ", + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.CaseViewProps", + "text": "CaseViewProps" + }, + ") => React.ReactElement<", + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.CaseViewProps", + "text": "CaseViewProps" + }, + ">" + ], + "source": { + "path": "x-pack/plugins/cases/public/types.ts", + "lineNumber": 66 + }, + "deprecated": false, + "returnComment": [ + "A react component for viewing a specific case" + ], + "children": [ + { + "parentPluginId": "cases", + "id": "def-public.props", + "type": "Object", + "tags": [], + "label": "props", + "description": [ + "CaseViewProps" + ], + "signature": [ + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.CaseViewProps", + "text": "CaseViewProps" + } + ], + "source": { + "path": "x-pack/plugins/cases/public/types.ts", + "lineNumber": 66 }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" + "deprecated": false + } + ] + }, + { + "parentPluginId": "cases", + "id": "def-public.CasesUiStart.getConfigureCases", + "type": "Function", + "tags": [], + "label": "getConfigureCases", + "description": [ + "\nGet the configure case component" + ], + "signature": [ + "(props: ", + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.ConfigureCasesProps", + "text": "ConfigureCasesProps" + }, + ") => React.ReactElement<", + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.ConfigureCasesProps", + "text": "ConfigureCasesProps" + }, + ">" + ], + "source": { + "path": "x-pack/plugins/cases/public/types.ts", + "lineNumber": 72 + }, + "deprecated": false, + "returnComment": [ + "A react component for configuring a specific case" + ], + "children": [ + { + "parentPluginId": "cases", + "id": "def-public.props", + "type": "Object", + "tags": [], + "label": "props", + "description": [ + "ConfigureCasesProps" + ], + "signature": [ + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.ConfigureCasesProps", + "text": "ConfigureCasesProps" + } + ], + "source": { + "path": "x-pack/plugins/cases/public/types.ts", + "lineNumber": 72 }, - ".alert | ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" + "deprecated": false + } + ] + }, + { + "parentPluginId": "cases", + "id": "def-public.CasesUiStart.getCreateCase", + "type": "Function", + "tags": [], + "label": "getCreateCase", + "description": [ + "\nGet the create case form" + ], + "signature": [ + "(props: ", + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.CreateCaseProps", + "text": "CreateCaseProps" + }, + ") => React.ReactElement<", + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.CreateCaseProps", + "text": "CreateCaseProps" + }, + ">" + ], + "source": { + "path": "x-pack/plugins/cases/public/types.ts", + "lineNumber": 78 + }, + "deprecated": false, + "returnComment": [ + "A react component for creating a new case" + ], + "children": [ + { + "parentPluginId": "cases", + "id": "def-public.props", + "type": "Object", + "tags": [], + "label": "props", + "description": [ + "CreateCaseProps" + ], + "signature": [ + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.CreateCaseProps", + "text": "CreateCaseProps" + } + ], + "source": { + "path": "x-pack/plugins/cases/public/types.ts", + "lineNumber": 78 }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" + "deprecated": false + } + ] + }, + { + "parentPluginId": "cases", + "id": "def-public.CasesUiStart.getRecentCases", + "type": "Function", + "tags": [], + "label": "getRecentCases", + "description": [ + "\nGet the recent cases component" + ], + "signature": [ + "(props: ", + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.RecentCasesProps", + "text": "RecentCasesProps" + }, + ") => React.ReactElement<", + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.RecentCasesProps", + "text": "RecentCasesProps" + }, + ">" + ], + "source": { + "path": "x-pack/plugins/cases/public/types.ts", + "lineNumber": 84 + }, + "deprecated": false, + "returnComment": [ + "A react component for showing recent cases" + ], + "children": [ + { + "parentPluginId": "cases", + "id": "def-public.props", + "type": "Object", + "tags": [], + "label": "props", + "description": [ + "RecentCasesProps" + ], + "signature": [ + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.RecentCasesProps", + "text": "RecentCasesProps" + } + ], + "source": { + "path": "x-pack/plugins/cases/public/types.ts", + "lineNumber": 84 }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[]>" + "deprecated": false + } + ] + } + ], + "lifecycle": "start", + "initialIsOpen": true + } + }, + "server": { + "classes": [ + { + "parentPluginId": "cases", + "id": "def-server.CasesClient", + "type": "Class", + "tags": [], + "label": "CasesClient", + "description": [ + "\nClient wrapper that contains accessor methods for individual entities within the cases system." + ], + "source": { + "path": "x-pack/plugins/cases/server/client/client.ts", + "lineNumber": 21 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "cases", + "id": "def-server.CasesClient.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" ], "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 111 + "path": "x-pack/plugins/cases/server/client/client.ts", + "lineNumber": 30 }, "deprecated": false, "children": [ { "parentPluginId": "cases", - "id": "def-server.CasesClient.update.$1", + "id": "def-server.CasesClient.Unnamed.$1", "type": "Object", "tags": [], "label": "args", "description": [], "signature": [ - "{ cases: ({ description?: string | undefined; status?: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - " | undefined; tags?: string[] | undefined; title?: string | undefined; type?: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - " | undefined; connector?: ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".jira; fields: { issueType: string | null; priority: string | null; parent: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".resilient; fields: { incidentTypes: string[] | null; severityCode: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowITSM; fields: { impact: string | null; severity: string | null; urgency: string | null; category: string | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowSIR; fields: { category: string | null; destIp: boolean | null; malwareHash: boolean | null; malwareUrl: boolean | null; priority: string | null; sourceIp: boolean | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".none; fields: null; }) | undefined; settings?: { syncAlerts: boolean; } | undefined; } & { id: string; version: string; })[]; }" + "CasesClientArgs" ], "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 111 + "path": "x-pack/plugins/cases/server/client/client.ts", + "lineNumber": 30 }, "deprecated": false, "isRequired": true @@ -2027,113 +1399,186 @@ }, { "parentPluginId": "cases", - "id": "def-server.CasesClient.updateAlertsStatus", - "type": "Function", + "id": "def-server.CasesClient.cases", + "type": "Object", "tags": [], - "label": "updateAlertsStatus", - "description": [], + "label": "cases", + "description": [ + "\nRetrieves an interface for interacting with cases entities." + ], "signature": [ - "(args: ", - "CasesClientUpdateAlertsStatus", - ") => Promise" + "CasesSubClient" ], "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 112 + "path": "x-pack/plugins/cases/server/client/client.ts", + "lineNumber": 43 }, - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.updateAlertsStatus.$1", - "type": "Object", - "tags": [], - "label": "args", - "description": [], - "signature": [ - "CasesClientUpdateAlertsStatus" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 112 - }, - "deprecated": false, - "isRequired": true - } + "deprecated": false + }, + { + "parentPluginId": "cases", + "id": "def-server.CasesClient.attachments", + "type": "Object", + "tags": [], + "label": "attachments", + "description": [ + "\nRetrieves an interface for interacting with attachments (comments) entities." ], - "returnComment": [] + "signature": [ + "AttachmentsSubClient" + ], + "source": { + "path": "x-pack/plugins/cases/server/client/client.ts", + "lineNumber": 50 + }, + "deprecated": false }, { "parentPluginId": "cases", - "id": "def-server.CasesClient.getCaseIdsByAlertId", - "type": "Function", + "id": "def-server.CasesClient.userActions", + "type": "Object", "tags": [], - "label": "getCaseIdsByAlertId", - "description": [], + "label": "userActions", + "description": [ + "\nRetrieves an interface for interacting with the user actions associated with the plugin entities." + ], "signature": [ - "(args: ", - "CasesClientGetCasesByAlert", - ") => Promise" + "UserActionsSubClient" ], "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 113 + "path": "x-pack/plugins/cases/server/client/client.ts", + "lineNumber": 57 }, - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.getCaseIdsByAlertId.$1", - "type": "Object", - "tags": [], - "label": "args", - "description": [], - "signature": [ - "CasesClientGetCasesByAlert" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 113 - }, - "deprecated": false, - "isRequired": true - } + "deprecated": false + }, + { + "parentPluginId": "cases", + "id": "def-server.CasesClient.subCases", + "type": "Object", + "tags": [], + "label": "subCases", + "description": [ + "\nRetrieves an interface for interacting with the case as a connector entities.\n\nCurrently this functionality is disabled and will throw an error if this function is called." ], - "returnComment": [] + "signature": [ + "SubCasesClient" + ], + "source": { + "path": "x-pack/plugins/cases/server/client/client.ts", + "lineNumber": 66 + }, + "deprecated": false + }, + { + "parentPluginId": "cases", + "id": "def-server.CasesClient.configure", + "type": "Object", + "tags": [], + "label": "configure", + "description": [ + "\nRetrieves an interface for interacting with the configuration of external connectors for the plugin entities." + ], + "signature": [ + "ConfigureSubClient" + ], + "source": { + "path": "x-pack/plugins/cases/server/client/client.ts", + "lineNumber": 76 + }, + "deprecated": false + }, + { + "parentPluginId": "cases", + "id": "def-server.CasesClient.stats", + "type": "Object", + "tags": [], + "label": "stats", + "description": [ + "\nRetrieves an interface for retrieving statistics related to the cases entities." + ], + "signature": [ + "StatsSubClient" + ], + "source": { + "path": "x-pack/plugins/cases/server/client/client.ts", + "lineNumber": 83 + }, + "deprecated": false } ], "initialIsOpen": false - }, + } + ], + "functions": [], + "interfaces": [ { "parentPluginId": "cases", - "id": "def-server.PluginStartContract", + "id": "def-server.CaseRequestContext", "type": "Interface", "tags": [], - "label": "PluginStartContract", + "label": "CaseRequestContext", "description": [], "source": { - "path": "x-pack/plugins/cases/server/index.ts", - "lineNumber": 29 + "path": "x-pack/plugins/cases/server/types.ts", + "lineNumber": 18 }, "deprecated": false, "children": [ { "parentPluginId": "cases", - "id": "def-server.PluginStartContract.getCasesClientWithRequestAndContext", + "id": "def-server.CaseRequestContext.getCasesClient", "type": "Function", "tags": [], - "label": "getCasesClientWithRequestAndContext", + "label": "getCasesClient", "description": [], "signature": [ - "(context: ", + "() => Promise<", { - "pluginId": "core", + "pluginId": "cases", "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.RequestHandlerContext", - "text": "RequestHandlerContext" + "docId": "kibCasesPluginApi", + "section": "def-server.CasesClient", + "text": "CasesClient" }, - ", request: ", + ">" + ], + "source": { + "path": "x-pack/plugins/cases/server/types.ts", + "lineNumber": 19 + }, + "deprecated": false, + "returnComment": [], + "children": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-server.PluginStartContract", + "type": "Interface", + "tags": [], + "label": "PluginStartContract", + "description": [ + "\nCases server exposed contract for interacting with cases entities." + ], + "source": { + "path": "x-pack/plugins/cases/server/plugin.ts", + "lineNumber": 55 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "cases", + "id": "def-server.PluginStartContract.getCasesClientWithRequest", + "type": "Function", + "tags": [], + "label": "getCasesClientWithRequest", + "description": [ + "\nReturns a client which can be used to interact with the cases backend entities.\n" + ], + "signature": [ + "(request: ", { "pluginId": "core", "scope": "server", @@ -2141,51 +1586,31 @@ "section": "def-server.KibanaRequest", "text": "KibanaRequest" }, - ") => ", + ") => Promise<", { "pluginId": "cases", "scope": "server", "docId": "kibCasesPluginApi", "section": "def-server.CasesClient", "text": "CasesClient" - } + }, + ">" ], "source": { - "path": "x-pack/plugins/cases/server/index.ts", - "lineNumber": 30 + "path": "x-pack/plugins/cases/server/plugin.ts", + "lineNumber": 62 }, "deprecated": false, "children": [ { "parentPluginId": "cases", - "id": "def-server.PluginStartContract.getCasesClientWithRequestAndContext.$1", - "type": "Object", - "tags": [], - "label": "context", - "description": [], - "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.RequestHandlerContext", - "text": "RequestHandlerContext" - } - ], - "source": { - "path": "x-pack/plugins/cases/server/index.ts", - "lineNumber": 31 - }, - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "cases", - "id": "def-server.PluginStartContract.getCasesClientWithRequestAndContext.$2", + "id": "def-server.PluginStartContract.getCasesClientWithRequest.$1", "type": "Object", "tags": [], "label": "request", - "description": [], + "description": [ + "a KibanaRequest" + ], "signature": [ { "pluginId": "core", @@ -2197,14 +1622,16 @@ "" ], "source": { - "path": "x-pack/plugins/cases/server/index.ts", - "lineNumber": 32 + "path": "x-pack/plugins/cases/server/plugin.ts", + "lineNumber": 62 }, "deprecated": false, "isRequired": true } ], - "returnComment": [] + "returnComment": [ + "a {@link CasesClient}" + ] } ], "initialIsOpen": false @@ -2339,7 +1766,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/runtime_types.ts", - "lineNumber": 71 + "lineNumber": 72 }, "deprecated": false, "isRequired": true @@ -2402,7 +1829,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 36 + "lineNumber": 37 }, "deprecated": false, "children": [ @@ -2418,7 +1845,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 36 + "lineNumber": 37 }, "deprecated": false, "isRequired": true @@ -2435,7 +1862,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 36 + "lineNumber": 37 }, "deprecated": false, "isRequired": true @@ -2456,7 +1883,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 32 + "lineNumber": 33 }, "deprecated": false, "children": [ @@ -2472,7 +1899,44 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 32 + "lineNumber": 33 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.getCaseConfigurationDetailsUrl", + "type": "Function", + "tags": [], + "label": "getCaseConfigurationDetailsUrl", + "description": [], + "signature": [ + "(configureID: string) => string" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/helpers.ts", + "lineNumber": 53 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "cases", + "id": "def-common.getCaseConfigurationDetailsUrl.$1", + "type": "string", + "tags": [], + "label": "configureID", + "description": [], + "signature": [ + "string" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/helpers.ts", + "lineNumber": 53 }, "deprecated": false, "isRequired": true @@ -2493,7 +1957,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 20 + "lineNumber": 21 }, "deprecated": false, "children": [ @@ -2509,7 +1973,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 20 + "lineNumber": 21 }, "deprecated": false, "isRequired": true @@ -2530,7 +1994,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 48 + "lineNumber": 49 }, "deprecated": false, "children": [ @@ -2546,7 +2010,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 48 + "lineNumber": 49 }, "deprecated": false, "isRequired": true @@ -2563,7 +2027,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 48 + "lineNumber": 49 }, "deprecated": false, "isRequired": true @@ -2584,7 +2048,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 52 + "lineNumber": 57 }, "deprecated": false, "children": [ @@ -2600,7 +2064,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 52 + "lineNumber": 57 }, "deprecated": false, "isRequired": true @@ -2621,7 +2085,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 40 + "lineNumber": 41 }, "deprecated": false, "children": [ @@ -2637,7 +2101,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 40 + "lineNumber": 41 }, "deprecated": false, "isRequired": true @@ -2658,7 +2122,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 28 + "lineNumber": 29 }, "deprecated": false, "children": [ @@ -2674,7 +2138,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 28 + "lineNumber": 29 }, "deprecated": false, "isRequired": true @@ -2691,7 +2155,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 28 + "lineNumber": 29 }, "deprecated": false, "isRequired": true @@ -2712,7 +2176,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 24 + "lineNumber": 25 }, "deprecated": false, "children": [ @@ -2728,7 +2192,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 24 + "lineNumber": 25 }, "deprecated": false, "isRequired": true @@ -2749,7 +2213,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 44 + "lineNumber": 45 }, "deprecated": false, "children": [ @@ -2765,7 +2229,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 44 + "lineNumber": 45 }, "deprecated": false, "isRequired": true @@ -2782,7 +2246,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 44 + "lineNumber": 45 }, "deprecated": false, "isRequired": true @@ -2841,7 +2305,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 144 + "lineNumber": 145 }, "deprecated": false, "children": [ @@ -2854,7 +2318,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 145 + "lineNumber": 146 }, "deprecated": false }, @@ -2867,7 +2331,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 146 + "lineNumber": 147 }, "deprecated": false }, @@ -2880,7 +2344,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 147 + "lineNumber": 148 }, "deprecated": false }, @@ -2893,7 +2357,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 148 + "lineNumber": 149 }, "deprecated": false }, @@ -2906,7 +2370,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 149 + "lineNumber": 150 }, "deprecated": false } @@ -2939,7 +2403,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 112 + "lineNumber": 113 }, "deprecated": false, "children": [ @@ -2962,7 +2426,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 113 + "lineNumber": 114 }, "deprecated": false }, @@ -2975,7 +2439,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 114 + "lineNumber": 115 }, "deprecated": false }, @@ -2988,7 +2452,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 115 + "lineNumber": 116 }, "deprecated": false }, @@ -3001,7 +2465,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 116 + "lineNumber": 117 }, "deprecated": false } @@ -3017,7 +2481,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 135 + "lineNumber": 136 }, "deprecated": false, "children": [ @@ -3033,7 +2497,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 136 + "lineNumber": 137 }, "deprecated": false } @@ -3049,7 +2513,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 139 + "lineNumber": 140 }, "deprecated": false, "children": [ @@ -3062,7 +2526,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 140 + "lineNumber": 141 }, "deprecated": false }, @@ -3075,7 +2539,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 141 + "lineNumber": 142 }, "deprecated": false }, @@ -3088,7 +2552,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 142 + "lineNumber": 143 }, "deprecated": false } @@ -3114,7 +2578,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 80 + "lineNumber": 81 }, "deprecated": false, "children": [ @@ -3170,7 +2634,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 81 + "lineNumber": 82 }, "deprecated": false }, @@ -3183,7 +2647,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 82 + "lineNumber": 83 }, "deprecated": false }, @@ -3206,7 +2670,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 83 + "lineNumber": 84 }, "deprecated": false }, @@ -3229,7 +2693,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 84 + "lineNumber": 85 }, "deprecated": false }, @@ -3245,7 +2709,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 85 + "lineNumber": 86 }, "deprecated": false }, @@ -3261,7 +2725,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 86 + "lineNumber": 87 }, "deprecated": false }, @@ -3277,7 +2741,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 87 + "lineNumber": 88 }, "deprecated": false }, @@ -3299,7 +2763,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 88 + "lineNumber": 89 }, "deprecated": false } @@ -3431,7 +2895,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 106 + "lineNumber": 107 }, "deprecated": false, "children": [ @@ -3447,7 +2911,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 107 + "lineNumber": 108 }, "deprecated": false }, @@ -3463,7 +2927,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 108 + "lineNumber": 109 }, "deprecated": false }, @@ -3479,7 +2943,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 109 + "lineNumber": 110 }, "deprecated": false } @@ -3520,7 +2984,7 @@ "label": "actionField", "description": [], "signature": [ - "(\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"connector\" | \"pushed\" | \"sub_case\")[]" + "(\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\")[]" ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", @@ -3652,7 +3116,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 152 + "lineNumber": 153 }, "deprecated": false, "children": [ @@ -3665,7 +3129,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 153 + "lineNumber": 154 }, "deprecated": false }, @@ -3688,7 +3152,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 154 + "lineNumber": 155 }, "deprecated": false }, @@ -3704,7 +3168,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 155 + "lineNumber": 156 }, "deprecated": false } @@ -3720,7 +3184,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 225 + "lineNumber": 226 }, "deprecated": false, "children": [ @@ -3733,7 +3197,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 226 + "lineNumber": 227 }, "deprecated": false }, @@ -3749,7 +3213,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 227 + "lineNumber": 228 }, "deprecated": false }, @@ -3772,7 +3236,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 228 + "lineNumber": 229 }, "deprecated": false } @@ -3788,7 +3252,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 124 + "lineNumber": 125 }, "deprecated": false, "children": [ @@ -3804,7 +3268,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 125 + "lineNumber": 126 }, "deprecated": false }, @@ -3820,7 +3284,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 126 + "lineNumber": 127 }, "deprecated": false }, @@ -3836,7 +3300,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 127 + "lineNumber": 128 }, "deprecated": false } @@ -3956,7 +3420,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 130 + "lineNumber": 131 }, "deprecated": false, "children": [ @@ -3979,18 +3443,19 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 131 + "lineNumber": 132 }, "deprecated": false }, { "parentPluginId": "cases", "id": "def-common.FetchCasesProps.filterOptions", - "type": "Object", + "type": "CompoundType", "tags": [], "label": "filterOptions", "description": [], "signature": [ + "(", { "pluginId": "cases", "scope": "common", @@ -3998,11 +3463,11 @@ "section": "def-common.FilterOptions", "text": "FilterOptions" }, - " | undefined" + " & { owner: string[]; }) | undefined" ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 132 + "lineNumber": 133 }, "deprecated": false } @@ -4018,7 +3483,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 158 + "lineNumber": 159 }, "deprecated": false, "children": [ @@ -4031,7 +3496,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 159 + "lineNumber": 160 }, "deprecated": false }, @@ -4047,7 +3512,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 160 + "lineNumber": 161 }, "deprecated": false } @@ -4063,7 +3528,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 98 + "lineNumber": 99 }, "deprecated": false, "children": [ @@ -4076,7 +3541,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 99 + "lineNumber": 100 }, "deprecated": false }, @@ -4099,7 +3564,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 100 + "lineNumber": 101 }, "deprecated": false }, @@ -4115,7 +3580,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 101 + "lineNumber": 102 }, "deprecated": false }, @@ -4131,7 +3596,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 102 + "lineNumber": 103 }, "deprecated": false }, @@ -4147,7 +3612,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 103 + "lineNumber": 104 }, "deprecated": false } @@ -4163,7 +3628,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 91 + "lineNumber": 92 }, "deprecated": false, "children": [ @@ -4176,7 +3641,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 92 + "lineNumber": 93 }, "deprecated": false }, @@ -4189,7 +3654,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 93 + "lineNumber": 94 }, "deprecated": false }, @@ -4211,7 +3676,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 94 + "lineNumber": 95 }, "deprecated": false }, @@ -4227,7 +3692,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 95 + "lineNumber": 96 }, "deprecated": false } @@ -4243,7 +3708,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 178 + "lineNumber": 179 }, "deprecated": false, "children": [ @@ -4259,7 +3724,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 179 + "lineNumber": 180 }, "deprecated": false }, @@ -4275,7 +3740,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 180 + "lineNumber": 181 }, "deprecated": false }, @@ -4291,7 +3756,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 181 + "lineNumber": 182 }, "deprecated": false }, @@ -4307,7 +3772,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 182 + "lineNumber": 183 }, "deprecated": false }, @@ -4323,7 +3788,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 183 + "lineNumber": 184 }, "deprecated": false }, @@ -4339,7 +3804,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 184 + "lineNumber": 185 }, "deprecated": false }, @@ -4355,7 +3820,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 185 + "lineNumber": 186 }, "deprecated": false }, @@ -4371,7 +3836,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 186 + "lineNumber": 187 }, "deprecated": false }, @@ -4387,7 +3852,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 187 + "lineNumber": 188 }, "deprecated": false }, @@ -4403,7 +3868,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 188 + "lineNumber": 189 }, "deprecated": false }, @@ -4419,7 +3884,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 189 + "lineNumber": 190 }, "deprecated": false }, @@ -4435,7 +3900,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 190 + "lineNumber": 191 }, "deprecated": false }, @@ -4451,7 +3916,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 191 + "lineNumber": 192 }, "deprecated": false }, @@ -4467,7 +3932,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 192 + "lineNumber": 193 }, "deprecated": false }, @@ -4483,7 +3948,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 193 + "lineNumber": 194 }, "deprecated": false }, @@ -4499,7 +3964,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 194 + "lineNumber": 195 }, "deprecated": false }, @@ -4515,7 +3980,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 195 + "lineNumber": 196 }, "deprecated": false }, @@ -4531,7 +3996,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 196 + "lineNumber": 197 }, "deprecated": false }, @@ -4547,7 +4012,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 197 + "lineNumber": 198 }, "deprecated": false }, @@ -4563,7 +4028,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 198 + "lineNumber": 199 }, "deprecated": false }, @@ -4579,7 +4044,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 199 + "lineNumber": 200 }, "deprecated": false }, @@ -4595,7 +4060,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 200 + "lineNumber": 201 }, "deprecated": false }, @@ -4611,7 +4076,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 201 + "lineNumber": 202 }, "deprecated": false }, @@ -4627,7 +4092,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 202 + "lineNumber": 203 }, "deprecated": false }, @@ -4643,7 +4108,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 203 + "lineNumber": 204 }, "deprecated": false }, @@ -4659,7 +4124,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 204 + "lineNumber": 205 }, "deprecated": false }, @@ -4675,7 +4140,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 205 + "lineNumber": 206 }, "deprecated": false }, @@ -4691,7 +4156,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 206 + "lineNumber": 207 }, "deprecated": false }, @@ -4707,7 +4172,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 207 + "lineNumber": 208 }, "deprecated": false }, @@ -4723,7 +4188,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 208 + "lineNumber": 209 }, "deprecated": false }, @@ -4739,7 +4204,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 209 + "lineNumber": 210 }, "deprecated": false }, @@ -4755,7 +4220,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 210 + "lineNumber": 211 }, "deprecated": false }, @@ -4771,7 +4236,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 211 + "lineNumber": 212 }, "deprecated": false }, @@ -4787,7 +4252,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 212 + "lineNumber": 213 }, "deprecated": false } @@ -4803,7 +4268,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 215 + "lineNumber": 216 }, "deprecated": false, "children": [ @@ -4826,7 +4291,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 216 + "lineNumber": 217 }, "deprecated": false }, @@ -4842,7 +4307,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 217 + "lineNumber": 218 }, "deprecated": false }, @@ -4858,7 +4323,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 218 + "lineNumber": 219 }, "deprecated": false }, @@ -4874,7 +4339,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 219 + "lineNumber": 220 }, "deprecated": false }, @@ -4890,7 +4355,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 222 + "lineNumber": 223 }, "deprecated": false } @@ -4916,7 +4381,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 75 + "lineNumber": 76 }, "deprecated": false, "children": [ @@ -4938,7 +4403,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 76 + "lineNumber": 77 }, "deprecated": false }, @@ -4951,7 +4416,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 77 + "lineNumber": 78 }, "deprecated": false } @@ -4967,7 +4432,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 168 + "lineNumber": 169 }, "deprecated": false, "children": [ @@ -4983,7 +4448,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 169 + "lineNumber": 170 }, "deprecated": false }, @@ -5039,7 +4504,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 170 + "lineNumber": 171 }, "deprecated": false }, @@ -5055,7 +4520,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 171 + "lineNumber": 172 }, "deprecated": false }, @@ -5079,7 +4544,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 172 + "lineNumber": 173 }, "deprecated": false }, @@ -5101,7 +4566,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 173 + "lineNumber": 174 }, "deprecated": false }, @@ -5117,7 +4582,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 174 + "lineNumber": 175 }, "deprecated": false }, @@ -5133,7 +4598,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 175 + "lineNumber": 176 }, "deprecated": false } @@ -5153,7 +4618,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 33 + "lineNumber": 34 }, "deprecated": false, "initialIsOpen": false @@ -5195,7 +4660,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 51 + "lineNumber": 53 }, "deprecated": false, "initialIsOpen": false @@ -5223,7 +4688,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 119 + "lineNumber": 120 }, "deprecated": false, "initialIsOpen": false @@ -5242,7 +4707,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 41 + "lineNumber": 60 }, "deprecated": false, "initialIsOpen": false @@ -5261,7 +4726,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 40 + "lineNumber": 59 }, "deprecated": false, "initialIsOpen": false @@ -5345,7 +4810,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -5353,7 +4818,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -5369,7 +4834,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -5377,11 +4842,45 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[]" + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[]" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 135 + "lineNumber": 149 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.AllReportersFindRequest", + "type": "Type", + "tags": [], + "label": "AllReportersFindRequest", + "description": [], + "signature": [ + "{ owner?: string | string[] | undefined; }" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/case.ts", + "lineNumber": 313 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.AllTagsFindRequest", + "type": "Type", + "tags": [], + "label": "AllTagsFindRequest", + "description": [], + "signature": [ + "{ owner?: string | string[] | undefined; }" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/case.ts", + "lineNumber": 312 }, "deprecated": false, "initialIsOpen": false @@ -5427,7 +4926,40 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.AssociationType", + "text": "AssociationType" + }, + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/comment.ts", + "lineNumber": 143 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.AttributesTypeUser", + "type": "Type", + "tags": [], + "label": "AttributesTypeUser", + "description": [], + "signature": [ + "{ comment: string; type: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CommentType", + "text": "CommentType" + }, + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -5435,11 +4967,11 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }" + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 130 + "lineNumber": 144 }, "deprecated": false, "initialIsOpen": false @@ -5453,7 +4985,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 34 + "lineNumber": 53 }, "deprecated": false, "initialIsOpen": false @@ -5467,7 +4999,24 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 27 + "lineNumber": 46 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CASE_COMMENT_SAVED_OBJECT", + "type": "string", + "tags": [], + "label": "CASE_COMMENT_SAVED_OBJECT", + "description": [], + "signature": [ + "\"cases-comments\"" + ], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 16 }, "deprecated": false, "initialIsOpen": false @@ -5481,7 +5030,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 26 + "lineNumber": 45 }, "deprecated": false, "initialIsOpen": false @@ -5495,7 +5044,38 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 19 + "lineNumber": 38 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CASE_CONFIGURE_DETAILS_URL", + "type": "string", + "tags": [], + "label": "CASE_CONFIGURE_DETAILS_URL", + "description": [], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 37 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CASE_CONFIGURE_SAVED_OBJECT", + "type": "string", + "tags": [], + "label": "CASE_CONFIGURE_SAVED_OBJECT", + "description": [], + "signature": [ + "\"cases-configure\"" + ], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 17 }, "deprecated": false, "initialIsOpen": false @@ -5509,7 +5089,24 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 18 + "lineNumber": 36 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CASE_CONNECTOR_MAPPINGS_SAVED_OBJECT", + "type": "string", + "tags": [], + "label": "CASE_CONNECTOR_MAPPINGS_SAVED_OBJECT", + "description": [], + "signature": [ + "\"cases-connector-mappings\"" + ], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 13 }, "deprecated": false, "initialIsOpen": false @@ -5523,7 +5120,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 17 + "lineNumber": 35 }, "deprecated": false, "initialIsOpen": false @@ -5537,7 +5134,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 28 + "lineNumber": 47 }, "deprecated": false, "initialIsOpen": false @@ -5551,7 +5148,24 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 29 + "lineNumber": 48 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CASE_SAVED_OBJECT", + "type": "string", + "tags": [], + "label": "CASE_SAVED_OBJECT", + "description": [], + "signature": [ + "\"cases\"" + ], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 12 }, "deprecated": false, "initialIsOpen": false @@ -5565,7 +5179,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 30 + "lineNumber": 49 }, "deprecated": false, "initialIsOpen": false @@ -5579,7 +5193,24 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 31 + "lineNumber": 50 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CASE_USER_ACTION_SAVED_OBJECT", + "type": "string", + "tags": [], + "label": "CASE_USER_ACTION_SAVED_OBJECT", + "description": [], + "signature": [ + "\"cases-user-actions\"" + ], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 15 }, "deprecated": false, "initialIsOpen": false @@ -5593,7 +5224,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 32 + "lineNumber": 51 }, "deprecated": false, "initialIsOpen": false @@ -5662,11 +5293,11 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }" + ".none; fields: null; }); settings: { syncAlerts: boolean; }; owner: string; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 175 + "lineNumber": 288 }, "deprecated": false, "initialIsOpen": false @@ -5757,7 +5388,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 189 + "lineNumber": 303 }, "deprecated": false, "initialIsOpen": false @@ -5826,11 +5457,11 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }) | undefined; settings?: { syncAlerts: boolean; } | undefined; } & { id: string; version: string; }" + ".none; fields: null; }) | undefined; settings?: { syncAlerts: boolean; } | undefined; owner?: string | undefined; } & { id: string; version: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 187 + "lineNumber": 301 }, "deprecated": false, "initialIsOpen": false @@ -5891,11 +5522,11 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; }" + ".none; fields: null; }); settings: { syncAlerts: boolean; }; owner: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 182 + "lineNumber": 295 }, "deprecated": false, "initialIsOpen": false @@ -5964,7 +5595,7 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { subCaseIds?: string[] | undefined; subCases?: ({ status: ", + ".none; fields: null; }); settings: { syncAlerts: boolean; }; owner: string; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { subCaseIds?: string[] | undefined; subCases?: ({ status: ", { "pluginId": "cases", "scope": "common", @@ -5972,7 +5603,7 @@ "section": "def-common.CaseStatuses", "text": "CaseStatuses" }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", + "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; owner: string; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", { "pluginId": "cases", "scope": "common", @@ -5980,7 +5611,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -5988,7 +5619,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -6004,7 +5635,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -6012,7 +5643,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[] | undefined; comments?: (({ comment: string; type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[] | undefined; comments?: (({ comment: string; type: ", { "pluginId": "cases", "scope": "common", @@ -6020,7 +5651,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -6028,7 +5659,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -6044,7 +5675,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -6052,11 +5683,11 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; }" + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 183 + "lineNumber": 296 }, "deprecated": false, "initialIsOpen": false @@ -6075,7 +5706,24 @@ ], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 16 + "lineNumber": 34 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CasesByAlertIDRequest", + "type": "Type", + "tags": [], + "label": "CasesByAlertIDRequest", + "description": [], + "signature": [ + "{ owner?: string | string[] | undefined; }" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/case.ts", + "lineNumber": 299 }, "deprecated": false, "initialIsOpen": false @@ -6138,11 +5786,68 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; }" + ".none; fields: null; }); settings: { syncAlerts: boolean; }; owner: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 181 + "lineNumber": 294 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CasesConfigurationsResponse", + "type": "Type", + "tags": [], + "label": "CasesConfigurationsResponse", + "description": [], + "signature": [ + "({ connector: ({ id: string; name: string; } & { type: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.ConnectorTypes", + "text": "ConnectorTypes" + }, + ".jira; fields: { issueType: string | null; priority: string | null; parent: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.ConnectorTypes", + "text": "ConnectorTypes" + }, + ".resilient; fields: { incidentTypes: string[] | null; severityCode: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.ConnectorTypes", + "text": "ConnectorTypes" + }, + ".serviceNowITSM; fields: { impact: string | null; severity: string | null; urgency: string | null; category: string | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.ConnectorTypes", + "text": "ConnectorTypes" + }, + ".serviceNowSIR; fields: { category: string | null; destIp: boolean | null; malwareHash: boolean | null; malwareUrl: boolean | null; priority: string | null; sourceIp: boolean | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.ConnectorTypes", + "text": "ConnectorTypes" + }, + ".none; fields: null; }); closure_type: \"close-by-user\" | \"close-by-pushing\"; } & { owner: string; } & { created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { mappings: { action_type: \"append\" | \"overwrite\" | \"nothing\"; source: \"description\" | \"title\" | \"comments\"; target: string; }[]; owner: string; } & { id: string; version: string; error: string | null; owner: string; })[]" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/configure.ts", + "lineNumber": 84 }, "deprecated": false, "initialIsOpen": false @@ -6195,11 +5900,11 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); closure_type: \"close-by-user\" | \"close-by-pushing\"; }" + ".none; fields: null; }); closure_type: \"close-by-user\" | \"close-by-pushing\"; } & { owner: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/configure.ts", - "lineNumber": 47 + "lineNumber": 79 }, "deprecated": false, "initialIsOpen": false @@ -6252,11 +5957,11 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); closure_type: \"close-by-user\" | \"close-by-pushing\"; } & { created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }" + ".none; fields: null; }); closure_type: \"close-by-user\" | \"close-by-pushing\"; } & { owner: string; } & { created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/configure.ts", - "lineNumber": 50 + "lineNumber": 82 }, "deprecated": false, "initialIsOpen": false @@ -6313,7 +6018,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/configure.ts", - "lineNumber": 49 + "lineNumber": 81 }, "deprecated": false, "initialIsOpen": false @@ -6366,11 +6071,11 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); closure_type: \"close-by-user\" | \"close-by-pushing\"; }" + ".none; fields: null; }); closure_type: \"close-by-user\" | \"close-by-pushing\"; } & { owner: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/configure.ts", - "lineNumber": 48 + "lineNumber": 80 }, "deprecated": false, "initialIsOpen": false @@ -6423,11 +6128,11 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); closure_type: \"close-by-user\" | \"close-by-pushing\"; } & { created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { mappings: { action_type: \"append\" | \"overwrite\" | \"nothing\"; source: \"description\" | \"title\" | \"comments\"; target: string; }[]; } & { version: string; error: string | null; }" + ".none; fields: null; }); closure_type: \"close-by-user\" | \"close-by-pushing\"; } & { owner: string; } & { created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { mappings: { action_type: \"append\" | \"overwrite\" | \"nothing\"; source: \"description\" | \"title\" | \"comments\"; target: string; }[]; owner: string; } & { id: string; version: string; error: string | null; owner: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/configure.ts", - "lineNumber": 51 + "lineNumber": 83 }, "deprecated": false, "initialIsOpen": false @@ -6444,7 +6149,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 190 + "lineNumber": 304 }, "deprecated": false, "initialIsOpen": false @@ -6473,11 +6178,11 @@ "section": "def-common.CaseStatuses", "text": "CaseStatuses" }, - " | undefined; reporters?: string | string[] | undefined; defaultSearchOperator?: \"AND\" | \"OR\" | undefined; fields?: string[] | undefined; page?: number | undefined; perPage?: number | undefined; search?: string | undefined; searchFields?: string[] | undefined; sortField?: string | undefined; sortOrder?: \"asc\" | \"desc\" | undefined; }" + " | undefined; reporters?: string | string[] | undefined; defaultSearchOperator?: \"AND\" | \"OR\" | undefined; fields?: string[] | undefined; page?: number | undefined; perPage?: number | undefined; search?: string | undefined; searchFields?: string | string[] | undefined; sortField?: string | undefined; sortOrder?: \"asc\" | \"desc\" | undefined; owner?: string | string[] | undefined; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 185 + "lineNumber": 298 }, "deprecated": false, "initialIsOpen": false @@ -6546,7 +6251,7 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { subCaseIds?: string[] | undefined; subCases?: ({ status: ", + ".none; fields: null; }); settings: { syncAlerts: boolean; }; owner: string; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { subCaseIds?: string[] | undefined; subCases?: ({ status: ", { "pluginId": "cases", "scope": "common", @@ -6554,7 +6259,7 @@ "section": "def-common.CaseStatuses", "text": "CaseStatuses" }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", + "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; owner: string; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", { "pluginId": "cases", "scope": "common", @@ -6562,7 +6267,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -6570,7 +6275,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -6586,7 +6291,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -6594,7 +6299,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[] | undefined; comments?: (({ comment: string; type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[] | undefined; comments?: (({ comment: string; type: ", { "pluginId": "cases", "scope": "common", @@ -6602,7 +6307,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -6610,7 +6315,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -6626,7 +6331,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -6634,11 +6339,11 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[]; page: number; per_page: number; total: number; } & { count_open_cases: number; count_in_progress_cases: number; count_closed_cases: number; }" + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[]; page: number; per_page: number; total: number; } & { count_open_cases: number; count_in_progress_cases: number; count_closed_cases: number; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 186 + "lineNumber": 300 }, "deprecated": false, "initialIsOpen": false @@ -6707,11 +6412,11 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }) | undefined; settings?: { syncAlerts: boolean; } | undefined; } & { id: string; version: string; })[]; }" + ".none; fields: null; }) | undefined; settings?: { syncAlerts: boolean; } | undefined; owner?: string | undefined; } & { id: string; version: string; })[]; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 188 + "lineNumber": 302 }, "deprecated": false, "initialIsOpen": false @@ -6780,7 +6485,7 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { subCaseIds?: string[] | undefined; subCases?: ({ status: ", + ".none; fields: null; }); settings: { syncAlerts: boolean; }; owner: string; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { subCaseIds?: string[] | undefined; subCases?: ({ status: ", { "pluginId": "cases", "scope": "common", @@ -6788,7 +6493,7 @@ "section": "def-common.CaseStatuses", "text": "CaseStatuses" }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", + "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; owner: string; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", { "pluginId": "cases", "scope": "common", @@ -6796,7 +6501,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -6804,7 +6509,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -6820,7 +6525,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -6828,7 +6533,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[] | undefined; comments?: (({ comment: string; type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[] | undefined; comments?: (({ comment: string; type: ", { "pluginId": "cases", "scope": "common", @@ -6836,7 +6541,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -6844,7 +6549,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -6860,7 +6565,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -6868,11 +6573,28 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[]" + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[]" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 184 + "lineNumber": 297 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CasesStatusRequest", + "type": "Type", + "tags": [], + "label": "CasesStatusRequest", + "description": [], + "signature": [ + "{ owner?: string | string[] | undefined; }" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/status.ts", + "lineNumber": 39 }, "deprecated": false, "initialIsOpen": false @@ -6889,7 +6611,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/status.ts", - "lineNumber": 30 + "lineNumber": 38 }, "deprecated": false, "initialIsOpen": false @@ -6969,11 +6691,28 @@ "label": "CaseUserActionAttributes", "description": [], "signature": [ - "{ action_field: (\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"connector\" | \"pushed\" | \"sub_case\")[]; action: \"add\" | \"delete\" | \"create\" | \"update\" | \"push-to-service\"; action_at: string; action_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; new_value: string | null; old_value: string | null; }" + "{ action_field: (\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\")[]; action: \"add\" | \"delete\" | \"create\" | \"update\" | \"push-to-service\"; action_at: string; action_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; new_value: string | null; old_value: string | null; owner: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", - "lineNumber": 59 + "lineNumber": 62 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CaseUserActionResponse", + "type": "Type", + "tags": [], + "label": "CaseUserActionResponse", + "description": [], + "signature": [ + "{ action_field: (\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\")[]; action: \"add\" | \"delete\" | \"create\" | \"update\" | \"push-to-service\"; action_at: string; action_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; new_value: string | null; old_value: string | null; owner: string; } & { action_id: string; case_id: string; comment_id: string | null; } & { sub_case_id?: string | undefined; }" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", + "lineNumber": 64 }, "deprecated": false, "initialIsOpen": false @@ -6986,11 +6725,11 @@ "label": "CaseUserActionsResponse", "description": [], "signature": [ - "({ action_field: (\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"connector\" | \"pushed\" | \"sub_case\")[]; action: \"add\" | \"delete\" | \"create\" | \"update\" | \"push-to-service\"; action_at: string; action_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; new_value: string | null; old_value: string | null; } & { action_id: string; case_id: string; comment_id: string | null; } & { sub_case_id?: string | undefined; })[]" + "({ action_field: (\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\")[]; action: \"add\" | \"delete\" | \"create\" | \"update\" | \"push-to-service\"; action_at: string; action_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; new_value: string | null; old_value: string | null; owner: string; } & { action_id: string; case_id: string; comment_id: string | null; } & { sub_case_id?: string | undefined; })[]" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", - "lineNumber": 60 + "lineNumber": 63 }, "deprecated": false, "initialIsOpen": false @@ -7007,7 +6746,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/configure.ts", - "lineNumber": 46 + "lineNumber": 78 }, "deprecated": false, "initialIsOpen": false @@ -7020,7 +6759,15 @@ "label": "Comment", "description": [], "signature": [ - "({ comment: string; type: ", + "({ type: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CommentType", + "text": "CommentType" + }, + ".alert | ", { "pluginId": "cases", "scope": "common", @@ -7028,7 +6775,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -7052,15 +6799,7 @@ "section": "def-common.ElasticUser", "text": "ElasticUser" }, - " | null; version: string; }) | ({ type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".alert | ", + " | null; version: string; }) | ({ comment: string; type: ", { "pluginId": "cases", "scope": "common", @@ -7068,7 +6807,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -7117,7 +6856,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -7125,7 +6864,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -7141,7 +6880,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -7149,11 +6888,11 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; })" + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; })" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 131 + "lineNumber": 145 }, "deprecated": false, "initialIsOpen": false @@ -7174,7 +6913,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - " | undefined; created_at?: string | undefined; created_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | undefined; pushed_at?: string | null | undefined; pushed_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null | undefined; updated_at?: string | null | undefined; updated_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null | undefined; } | ({ type?: ", + " | undefined; created_at?: string | undefined; created_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | undefined; owner?: string | undefined; pushed_at?: string | null | undefined; pushed_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null | undefined; updated_at?: string | null | undefined; updated_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null | undefined; } | ({ type?: ", { "pluginId": "cases", "scope": "common", @@ -7190,7 +6929,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert | undefined; alertId?: string | string[] | undefined; index?: string | string[] | undefined; rule?: { id: string | null; name: string | null; } | undefined; } & { associationType?: ", + ".generatedAlert | undefined; alertId?: string | string[] | undefined; index?: string | string[] | undefined; rule?: { id: string | null; name: string | null; } | undefined; owner?: string | undefined; } & { associationType?: ", { "pluginId": "cases", "scope": "common", @@ -7198,11 +6937,11 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - " | undefined; created_at?: string | undefined; created_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | undefined; pushed_at?: string | null | undefined; pushed_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null | undefined; updated_at?: string | null | undefined; updated_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null | undefined; })" + " | undefined; created_at?: string | undefined; created_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | undefined; owner?: string | undefined; pushed_at?: string | null | undefined; pushed_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null | undefined; updated_at?: string | null | undefined; updated_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null | undefined; })" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 138 + "lineNumber": 152 }, "deprecated": false, "initialIsOpen": false @@ -7215,7 +6954,7 @@ "label": "CommentPatchRequest", "description": [], "signature": [ - "({ comment: string; type: ", + "({ type: ", { "pluginId": "cases", "scope": "common", @@ -7223,7 +6962,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { id: string; version: string; }) | ({ type: ", + ".alert | ", { "pluginId": "cases", "scope": "common", @@ -7231,7 +6970,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".alert | ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { id: string; version: string; }) | ({ comment: string; type: ", { "pluginId": "cases", "scope": "common", @@ -7239,11 +6978,11 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { id: string; version: string; })" + ".user; owner: string; } & { id: string; version: string; })" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 137 + "lineNumber": 151 }, "deprecated": false, "initialIsOpen": false @@ -7256,7 +6995,7 @@ "label": "CommentRequest", "description": [], "signature": [ - "{ comment: string; type: ", + "{ type: ", { "pluginId": "cases", "scope": "common", @@ -7264,7 +7003,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } | { type: ", + ".alert | ", { "pluginId": "cases", "scope": "common", @@ -7272,7 +7011,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".alert | ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } | { comment: string; type: ", { "pluginId": "cases", "scope": "common", @@ -7280,11 +7019,11 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; }" + ".user; owner: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 132 + "lineNumber": 146 }, "deprecated": false, "initialIsOpen": false @@ -7313,11 +7052,11 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; }" + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 140 + "lineNumber": 154 }, "deprecated": false, "initialIsOpen": false @@ -7338,11 +7077,11 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; }" + ".user; owner: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 139 + "lineNumber": 153 }, "deprecated": false, "initialIsOpen": false @@ -7363,7 +7102,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -7371,7 +7110,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -7387,7 +7126,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -7395,11 +7134,11 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; })" + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; })" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 133 + "lineNumber": 147 }, "deprecated": false, "initialIsOpen": false @@ -7428,7 +7167,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -7436,11 +7175,11 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }" + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 134 + "lineNumber": 148 }, "deprecated": false, "initialIsOpen": false @@ -7461,7 +7200,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -7469,7 +7208,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -7485,7 +7224,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -7493,11 +7232,11 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[]; page: number; per_page: number; total: number; }" + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[]; page: number; per_page: number; total: number; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 136 + "lineNumber": 150 }, "deprecated": false, "initialIsOpen": false @@ -7514,7 +7253,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/connectors/mappings.ts", - "lineNumber": 48 + "lineNumber": 49 }, "deprecated": false, "initialIsOpen": false @@ -7569,11 +7308,11 @@ "label": "ConnectorMappings", "description": [], "signature": [ - "{ mappings: { action_type: \"append\" | \"overwrite\" | \"nothing\"; source: \"description\" | \"title\" | \"comments\"; target: string; }[]; }" + "{ mappings: { action_type: \"append\" | \"overwrite\" | \"nothing\"; source: \"description\" | \"title\" | \"comments\"; target: string; }[]; owner: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/connectors/mappings.ts", - "lineNumber": 37 + "lineNumber": 38 }, "deprecated": false, "initialIsOpen": false @@ -7590,7 +7329,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/connectors/mappings.ts", - "lineNumber": 36 + "lineNumber": 37 }, "deprecated": false, "initialIsOpen": false @@ -7775,7 +7514,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 63 + "lineNumber": 90 }, "deprecated": false, "initialIsOpen": false @@ -7844,7 +7583,7 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }, \"type\" | \"status\" | \"description\" | \"title\" | \"updated_at\" | \"tags\" | \"settings\" | \"created_at\" | \"created_by\" | \"updated_by\" | \"closed_at\" | \"closed_by\" | \"external_service\"> & { connector: ", + ".none; fields: null; }); settings: { syncAlerts: boolean; }; owner: string; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }, \"type\" | \"status\" | \"description\" | \"title\" | \"updated_at\" | \"tags\" | \"settings\" | \"owner\" | \"created_at\" | \"created_by\" | \"updated_by\" | \"closed_at\" | \"closed_by\" | \"external_service\"> & { connector: ", { "pluginId": "cases", "scope": "common", @@ -7856,7 +7595,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 193 + "lineNumber": 307 }, "deprecated": false, "initialIsOpen": false @@ -7948,7 +7687,7 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }) | undefined; settings?: { syncAlerts: boolean; } | undefined; } & { id: string; version: string; }, \"type\" | \"status\" | \"description\" | \"title\" | \"id\" | \"version\" | \"tags\" | \"settings\"> & { connector?: ", + ".none; fields: null; }) | undefined; settings?: { syncAlerts: boolean; } | undefined; owner?: string | undefined; } & { id: string; version: string; }, \"type\" | \"status\" | \"description\" | \"title\" | \"id\" | \"version\" | \"tags\" | \"settings\" | \"owner\"> & { connector?: ", { "pluginId": "cases", "scope": "common", @@ -7960,7 +7699,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 194 + "lineNumber": 308 }, "deprecated": false, "initialIsOpen": false @@ -8013,7 +7752,7 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); closure_type: \"close-by-user\" | \"close-by-pushing\"; } & { created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }, \"updated_at\" | \"created_at\" | \"created_by\" | \"updated_by\" | \"closure_type\"> & { connector: ", + ".none; fields: null; }); closure_type: \"close-by-user\" | \"close-by-pushing\"; } & { owner: string; } & { created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }, \"updated_at\" | \"owner\" | \"created_at\" | \"created_by\" | \"updated_by\" | \"closure_type\"> & { connector: ", { "pluginId": "cases", "scope": "common", @@ -8025,7 +7764,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/configure.ts", - "lineNumber": 53 + "lineNumber": 86 }, "deprecated": false, "initialIsOpen": false @@ -8059,7 +7798,24 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 191 + "lineNumber": 305 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.FindQueryParams", + "type": "Type", + "tags": [], + "label": "FindQueryParams", + "description": [], + "signature": [ + "{ subCaseId?: string | undefined; defaultSearchOperator?: \"AND\" | \"OR\" | undefined; hasReferenceOperator?: \"AND\" | \"OR\" | undefined; hasReference?: { id: string; type: string; } | { id: string; type: string; }[] | undefined; fields?: string[] | undefined; filter?: string | undefined; page?: number | undefined; perPage?: number | undefined; search?: string | undefined; searchFields?: string[] | undefined; sortField?: string | undefined; sortOrder?: \"asc\" | \"desc\" | undefined; }" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/comment.ts", + "lineNumber": 142 }, "deprecated": false, "initialIsOpen": false @@ -8076,7 +7832,24 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 141 + "lineNumber": 155 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.GetConfigureFindRequest", + "type": "Type", + "tags": [], + "label": "GetConfigureFindRequest", + "description": [], + "signature": [ + "{ owner?: string | string[] | undefined; }" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/configure.ts", + "lineNumber": 90 }, "deprecated": false, "initialIsOpen": false @@ -8093,7 +7866,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/connectors/mappings.ts", - "lineNumber": 55 + "lineNumber": 56 }, "deprecated": false, "initialIsOpen": false @@ -8110,7 +7883,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 44 + "lineNumber": 63 }, "deprecated": false, "initialIsOpen": false @@ -8146,7 +7919,41 @@ ], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 57 + "lineNumber": 76 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.MAX_CONCURRENT_SEARCHES", + "type": "number", + "tags": [], + "label": "MAX_CONCURRENT_SEARCHES", + "description": [], + "signature": [ + "10" + ], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 97 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.MAX_DOCS_PER_PAGE", + "type": "number", + "tags": [], + "label": "MAX_DOCS_PER_PAGE", + "description": [], + "signature": [ + "10000" + ], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 96 }, "deprecated": false, "initialIsOpen": false @@ -8163,7 +7970,26 @@ ], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 58 + "lineNumber": 77 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.OWNER_FIELD", + "type": "string", + "tags": [], + "label": "OWNER_FIELD", + "description": [ + "\nThis field is used for authorization of the entities within the cases plugin. Each entity within Cases will have the owner field\nset to a string that represents the plugin that \"owns\" (i.e. the plugin that originally issued the POST request to\ncreate the entity) the entity.\n\nThe Authorization class constructs a string composed of the operation being performed (createCase, getComment, etc),\nand the owner of the entity being acted upon or created. This string is then given to the Security plugin which\nchecks to see if the user making the request has that particular string stored within it's privileges. If it does,\nthen the operation succeeds, otherwise the operation fails.\n\nAPIs that create/update an entity require that the owner field be passed in the body of the request.\nAPIs that search for entities typically require that the owner be passed as a query parameter.\nAPIs that specify an ID of an entity directly generally don't need to specify the owner field.\n\nFor APIs that create/update an entity, the RBAC implementation checks to see if the user making the request has the\ncorrect privileges for performing that action (a create/update) for the specified owner.\nThis check is done through the Security plugin's API.\n\nFor APIs that search for entities, the RBAC implementation creates a filter for the saved objects query that limits\nthe search to only owners that the user has access to. We also check that the objects returned by the saved objects\nAPI have the limited owner scope. If we find one that the user does not have permissions for, we throw a 403 error.\nThe owner field that is passed in as a query parameter can be used to further limit the results. If a user attempts\nto pass an owner that they do not have access to, the owner is ignored.\n\nFor APIs that retrieve/delete entities directly using their ID, the RBAC implementation requests the object first,\nand then checks to see if the user making the request has access to that operation and owner. If the user does, the\noperation continues, otherwise we throw a 403." + ], + "signature": [ + "\"owner\"" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/constants.ts", + "lineNumber": 36 }, "deprecated": false, "initialIsOpen": false @@ -8180,7 +8006,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 45 + "lineNumber": 64 }, "deprecated": false, "initialIsOpen": false @@ -8202,6 +8028,25 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "cases", + "id": "def-common.SAVED_OBJECT_TYPES", + "type": "Array", + "tags": [], + "label": "SAVED_OBJECT_TYPES", + "description": [ + "\nIf more values are added here please also add them here: x-pack/test/case_api_integration/common/fixtures/plugins" + ], + "signature": [ + "string[]" + ], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 22 + }, + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "cases", "id": "def-common.SavedObjectFindOptions", @@ -8214,7 +8059,26 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/saved_object.ts", - "lineNumber": 39 + "lineNumber": 72 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.SECURITY_SOLUTION_OWNER", + "type": "string", + "tags": [], + "label": "SECURITY_SOLUTION_OWNER", + "description": [ + "\nThis must be the same value that the security solution plugin uses to define the case kind when it registers the\nfeature for the 7.13 migration only.\n\nThis variable is being also used by test files and mocks." + ], + "signature": [ + "\"securitySolution\"" + ], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 85 }, "deprecated": false, "initialIsOpen": false @@ -8231,7 +8095,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 42 + "lineNumber": 61 }, "deprecated": false, "initialIsOpen": false @@ -8248,7 +8112,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 43 + "lineNumber": 62 }, "deprecated": false, "initialIsOpen": false @@ -8330,7 +8194,24 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 23 + "lineNumber": 42 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.SUB_CASE_SAVED_OBJECT", + "type": "string", + "tags": [], + "label": "SUB_CASE_SAVED_OBJECT", + "description": [], + "signature": [ + "\"cases-sub-case\"" + ], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 14 }, "deprecated": false, "initialIsOpen": false @@ -8344,7 +8225,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 24 + "lineNumber": 43 }, "deprecated": false, "initialIsOpen": false @@ -8358,7 +8239,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 21 + "lineNumber": 40 }, "deprecated": false, "initialIsOpen": false @@ -8372,7 +8253,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 22 + "lineNumber": 41 }, "deprecated": false, "initialIsOpen": false @@ -8393,11 +8274,11 @@ "section": "def-common.CaseStatuses", "text": "CaseStatuses" }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }" + "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; owner: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 75 + "lineNumber": 107 }, "deprecated": false, "initialIsOpen": false @@ -8422,7 +8303,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 79 + "lineNumber": 111 }, "deprecated": false, "initialIsOpen": false @@ -8443,7 +8324,7 @@ "section": "def-common.CaseStatuses", "text": "CaseStatuses" }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", + "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; owner: string; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", { "pluginId": "cases", "scope": "common", @@ -8451,7 +8332,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -8459,7 +8340,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -8475,7 +8356,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -8483,11 +8364,36 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; }" + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 76 + "lineNumber": 108 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.SubCasesFindRequest", + "type": "Type", + "tags": [], + "label": "SubCasesFindRequest", + "description": [], + "signature": [ + "{ status?: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CaseStatuses", + "text": "CaseStatuses" + }, + " | undefined; defaultSearchOperator?: \"AND\" | \"OR\" | undefined; fields?: string[] | undefined; page?: number | undefined; perPage?: number | undefined; search?: string | undefined; searchFields?: string[] | undefined; sortField?: string | undefined; sortOrder?: \"asc\" | \"desc\" | undefined; owner?: string | undefined; }" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", + "lineNumber": 113 }, "deprecated": false, "initialIsOpen": false @@ -8508,7 +8414,7 @@ "section": "def-common.CaseStatuses", "text": "CaseStatuses" }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", + "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; owner: string; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", { "pluginId": "cases", "scope": "common", @@ -8516,7 +8422,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -8524,7 +8430,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -8540,7 +8446,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -8548,11 +8454,11 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[]; page: number; per_page: number; total: number; } & { count_open_cases: number; count_in_progress_cases: number; count_closed_cases: number; }" + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[]; page: number; per_page: number; total: number; } & { count_open_cases: number; count_in_progress_cases: number; count_closed_cases: number; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 78 + "lineNumber": 110 }, "deprecated": false, "initialIsOpen": false @@ -8577,7 +8483,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 80 + "lineNumber": 112 }, "deprecated": false, "initialIsOpen": false @@ -8598,7 +8504,7 @@ "section": "def-common.CaseStatuses", "text": "CaseStatuses" }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", + "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; owner: string; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", { "pluginId": "cases", "scope": "common", @@ -8606,7 +8512,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -8614,7 +8520,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -8630,7 +8536,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -8638,11 +8544,11 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[]" + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[]" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 77 + "lineNumber": 109 }, "deprecated": false, "initialIsOpen": false @@ -8659,7 +8565,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 47 + "lineNumber": 66 }, "deprecated": false, "initialIsOpen": false @@ -8693,7 +8599,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 163 + "lineNumber": 164 }, "deprecated": false, "initialIsOpen": false @@ -8727,7 +8633,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", - "lineNumber": 62 + "lineNumber": 66 }, "deprecated": false, "initialIsOpen": false @@ -8740,11 +8646,11 @@ "label": "UserActionField", "description": [], "signature": [ - "(\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"connector\" | \"pushed\" | \"sub_case\")[]" + "(\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\")[]" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", - "lineNumber": 63 + "lineNumber": 67 }, "deprecated": false, "initialIsOpen": false @@ -8757,11 +8663,11 @@ "label": "UserActionFieldType", "description": [], "signature": [ - "\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"connector\" | \"pushed\" | \"sub_case\"" + "\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\"" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", - "lineNumber": 64 + "lineNumber": 68 }, "deprecated": false, "initialIsOpen": false @@ -8828,24 +8734,382 @@ "]>; name: ", "UnionC", "<[", - "StringC", + "StringC", + ", ", + "NullC", + "]>; }>; owner: ", + "StringC", + "; }>" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/comment.ts", + "lineNumber": 70 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.AllCommentsResponseRt", + "type": "Object", + "tags": [], + "label": "AllCommentsResponseRt", + "description": [], + "signature": [ + "ArrayC", + "<", + "IntersectionC", + "<[", + "UnionC", + "<[", + "IntersectionC", + "<[", + "TypeC", + "<{ comment: ", + "StringC", + "; type: ", + "LiteralC", + "<", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CommentType", + "text": "CommentType" + }, + ".user>; owner: ", + "StringC", + "; }>, ", + "TypeC", + "<{ associationType: ", + "UnionC", + "<[", + "LiteralC", + "<", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.AssociationType", + "text": "AssociationType" + }, + ".case>, ", + "LiteralC", + "<", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.AssociationType", + "text": "AssociationType" + }, + ".subCase>]>; created_at: ", + "StringC", + "; created_by: ", + "TypeC", + "<{ email: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; full_name: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; username: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; pushed_by: ", + "UnionC", + "<[", + "TypeC", + "<{ email: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; full_name: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; username: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; }>, ", + "NullC", + "]>; updated_at: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; updated_by: ", + "UnionC", + "<[", + "TypeC", + "<{ email: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; full_name: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; username: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; }>, ", + "NullC", + "]>; }>]>, ", + "IntersectionC", + "<[", + "TypeC", + "<{ type: ", + "UnionC", + "<[", + "LiteralC", + "<", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CommentType", + "text": "CommentType" + }, + ".generatedAlert>, ", + "LiteralC", + "<", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CommentType", + "text": "CommentType" + }, + ".alert>]>; alertId: ", + "UnionC", + "<[", + "ArrayC", + "<", + "StringC", + ">, ", + "StringC", + "]>; index: ", + "UnionC", + "<[", + "ArrayC", + "<", + "StringC", + ">, ", + "StringC", + "]>; rule: ", + "TypeC", + "<{ id: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; name: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; }>; owner: ", + "StringC", + "; }>, ", + "TypeC", + "<{ associationType: ", + "UnionC", + "<[", + "LiteralC", + "<", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.AssociationType", + "text": "AssociationType" + }, + ".case>, ", + "LiteralC", + "<", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.AssociationType", + "text": "AssociationType" + }, + ".subCase>]>; created_at: ", + "StringC", + "; created_by: ", + "TypeC", + "<{ email: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; full_name: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; username: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; pushed_by: ", + "UnionC", + "<[", + "TypeC", + "<{ email: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; full_name: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; username: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; }>, ", + "NullC", + "]>; updated_at: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; updated_by: ", + "UnionC", + "<[", + "TypeC", + "<{ email: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; full_name: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; username: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", ", ", + "StringC", + "]>; }>, ", "NullC", - "]>; }>; }>" + "]>; }>]>]>, ", + "TypeC", + "<{ id: ", + "StringC", + "; version: ", + "StringC", + "; }>]>>" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 67 + "lineNumber": 132 }, "deprecated": false, "initialIsOpen": false }, { "parentPluginId": "cases", - "id": "def-common.AllCommentsResponseRt", + "id": "def-common.AllCommentsResponseRT", "type": "Object", "tags": [], - "label": "AllCommentsResponseRt", + "label": "AllCommentsResponseRT", "description": [], "signature": [ "ArrayC", @@ -8869,7 +9133,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -8921,7 +9187,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -9049,7 +9317,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -9101,7 +9371,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -9183,135 +9455,351 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 128 + "lineNumber": 103 }, "deprecated": false, "initialIsOpen": false }, { "parentPluginId": "cases", - "id": "def-common.AllCommentsResponseRT", + "id": "def-common.AllReportersFindRequestRt", "type": "Object", "tags": [], - "label": "AllCommentsResponseRT", + "label": "AllReportersFindRequestRt", + "description": [], + "signature": [ + "PartialC", + "<{ owner: ", + "UnionC", + "<[", + "ArrayC", + "<", + "StringC", + ">, ", + "StringC", + "]>; }>" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/case.ts", + "lineNumber": 286 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.AllTagsFindRequestRt", + "type": "Object", + "tags": [], + "label": "AllTagsFindRequestRt", "description": [], "signature": [ + "PartialC", + "<{ owner: ", + "UnionC", + "<[", "ArrayC", "<", + "StringC", + ">, ", + "StringC", + "]>; }>" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/case.ts", + "lineNumber": 278 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CaseAttributesRt", + "type": "Object", + "tags": [], + "label": "CaseAttributesRt", + "description": [], + "signature": [ "IntersectionC", "<[", + "TypeC", + "<{ description: ", + "StringC", + "; status: ", + "UnionC", + "<[", + "LiteralC", + "<", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CaseStatuses", + "text": "CaseStatuses" + }, + ".open>, ", + "LiteralC", + ", ", + "LiteralC", + "<", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CaseStatuses", + "text": "CaseStatuses" + }, + ".closed>]>; tags: ", + "ArrayC", + "<", + "StringC", + ">; title: ", + "StringC", + "; type: ", "UnionC", "<[", + "LiteralC", + "<", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CaseType", + "text": "CaseType" + }, + ".collection>, ", + "LiteralC", + "<", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CaseType", + "text": "CaseType" + }, + ".individual>]>; connector: ", "IntersectionC", "<[", "TypeC", - "<{ comment: ", + "<{ id: ", "StringC", - "; type: ", + "; name: ", + "StringC", + "; }>, ", + "UnionC", + "<[", + "TypeC", + "<{ type: ", "LiteralC", "<", { "pluginId": "cases", "scope": "common", "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" + "section": "def-common.ConnectorTypes", + "text": "ConnectorTypes" }, - ".user>; }>, ", + ".jira>; fields: ", + "UnionC", + "<[", "TypeC", - "<{ associationType: ", + "<{ issueType: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; priority: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; parent: ", "UnionC", "<[", + "StringC", + ", ", + "NullC", + "]>; }>, ", + "NullC", + "]>; }>, ", + "TypeC", + "<{ type: ", "LiteralC", "<", { "pluginId": "cases", "scope": "common", "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" + "section": "def-common.ConnectorTypes", + "text": "ConnectorTypes" }, - ".case>, ", + ".resilient>; fields: ", + "UnionC", + "<[", + "TypeC", + "<{ incidentTypes: ", + "UnionC", + "<[", + "ArrayC", + "<", + "StringC", + ">, ", + "NullC", + "]>; severityCode: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; }>, ", + "NullC", + "]>; }>, ", + "TypeC", + "<{ type: ", "LiteralC", "<", { "pluginId": "cases", "scope": "common", "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" + "section": "def-common.ConnectorTypes", + "text": "ConnectorTypes" }, - ".subCase>]>; created_at: ", + ".serviceNowITSM>; fields: ", + "UnionC", + "<[", + "TypeC", + "<{ impact: ", + "UnionC", + "<[", "StringC", - "; created_by: ", + ", ", + "NullC", + "]>; severity: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; urgency: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; category: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; subcategory: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; }>, ", + "NullC", + "]>; }>, ", + "TypeC", + "<{ type: ", + "LiteralC", + "<", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.ConnectorTypes", + "text": "ConnectorTypes" + }, + ".serviceNowSIR>; fields: ", + "UnionC", + "<[", "TypeC", - "<{ email: ", + "<{ category: ", "UnionC", "<[", - "UndefinedC", + "StringC", ", ", "NullC", - ", ", - "StringC", - "]>; full_name: ", + "]>; destIp: ", "UnionC", "<[", - "UndefinedC", + "BooleanC", ", ", "NullC", - ", ", - "StringC", - "]>; username: ", + "]>; malwareHash: ", "UnionC", "<[", - "UndefinedC", + "BooleanC", ", ", "NullC", - ", ", - "StringC", - "]>; }>; pushed_at: ", + "]>; malwareUrl: ", "UnionC", "<[", - "StringC", + "BooleanC", ", ", "NullC", - "]>; pushed_by: ", - "UnionC", - "<[", - "TypeC", - "<{ email: ", + "]>; priority: ", "UnionC", "<[", - "UndefinedC", + "StringC", ", ", "NullC", - ", ", - "StringC", - "]>; full_name: ", + "]>; sourceIp: ", "UnionC", "<[", - "UndefinedC", + "BooleanC", ", ", "NullC", - ", ", - "StringC", - "]>; username: ", + "]>; subcategory: ", "UnionC", "<[", - "UndefinedC", + "StringC", ", ", "NullC", - ", ", - "StringC", "]>; }>, ", "NullC", - "]>; updated_at: ", + "]>; }>, ", + "TypeC", + "<{ type: ", + "LiteralC", + "<", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.ConnectorTypes", + "text": "ConnectorTypes" + }, + ".none>; fields: ", + "NullC", + "; }>]>]>; settings: ", + "TypeC", + "<{ syncAlerts: ", + "BooleanC", + "; }>; owner: ", + "StringC", + "; }>, ", + "TypeC", + "<{ closed_at: ", "UnionC", "<[", "StringC", ", ", "NullC", - "]>; updated_by: ", + "]>; closed_by: ", "UnionC", "<[", "TypeC", @@ -9341,87 +9829,7 @@ "StringC", "]>; }>, ", "NullC", - "]>; }>]>, ", - "IntersectionC", - "<[", - "TypeC", - "<{ type: ", - "UnionC", - "<[", - "LiteralC", - "<", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".generatedAlert>, ", - "LiteralC", - "<", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".alert>]>; alertId: ", - "UnionC", - "<[", - "ArrayC", - "<", - "StringC", - ">, ", - "StringC", - "]>; index: ", - "UnionC", - "<[", - "ArrayC", - "<", - "StringC", - ">, ", - "StringC", - "]>; rule: ", - "TypeC", - "<{ id: ", - "UnionC", - "<[", - "StringC", - ", ", - "NullC", - "]>; name: ", - "UnionC", - "<[", - "StringC", - ", ", - "NullC", - "]>; }>; }>, ", - "TypeC", - "<{ associationType: ", - "UnionC", - "<[", - "LiteralC", - "<", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - ".case>, ", - "LiteralC", - "<", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - ".subCase>]>; created_at: ", + "]>; created_at: ", "StringC", "; created_by: ", "TypeC", @@ -9449,16 +9857,28 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; external_service: ", "UnionC", "<[", - "StringC", - ", ", - "NullC", - "]>; pushed_by: ", - "UnionC", + "IntersectionC", "<[", "TypeC", + "<{ connector_id: ", + "StringC", + "; connector_name: ", + "StringC", + "; external_id: ", + "StringC", + "; external_title: ", + "StringC", + "; external_url: ", + "StringC", + "; }>, ", + "TypeC", + "<{ pushed_at: ", + "StringC", + "; pushed_by: ", + "TypeC", "<{ email: ", "UnionC", "<[", @@ -9483,7 +9903,7 @@ "NullC", ", ", "StringC", - "]>; }>, ", + "]>; }>; }>]>, ", "NullC", "]>; updated_at: ", "UnionC", @@ -9521,95 +9941,33 @@ "StringC", "]>; }>, ", "NullC", - "]>; }>]>]>, ", - "TypeC", - "<{ id: ", - "StringC", - "; version: ", - "StringC", - "; }>]>>" - ], - "source": { - "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 99 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "cases", - "id": "def-common.CaseAttributesRt", - "type": "Object", - "tags": [], - "label": "CaseAttributesRt", - "description": [], - "signature": [ - "IntersectionC", - "<[", - "TypeC", - "<{ description: ", - "StringC", - "; status: ", - "UnionC", - "<[", - "LiteralC", - "<", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - ".open>, ", - "LiteralC", - ", ", - "LiteralC", - "<", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - ".closed>]>; tags: ", - "ArrayC", - "<", - "StringC", - ">; title: ", - "StringC", - "; type: ", - "UnionC", - "<[", - "LiteralC", - "<", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - ".collection>, ", - "LiteralC", + "]>; }>]>" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/case.ts", + "lineNumber": 87 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CaseConfigurationsResponseRt", + "type": "Object", + "tags": [], + "label": "CaseConfigurationsResponseRt", + "description": [], + "signature": [ + "ArrayC", "<", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - ".individual>]>; connector: ", + "IntersectionC", + "<[", + "IntersectionC", + "<[", + "IntersectionC", + "<[", + "TypeC", + "<{ connector: ", "IntersectionC", "<[", "TypeC", @@ -9809,21 +10167,21 @@ }, ".none>; fields: ", "NullC", - "; }>]>]>; settings: ", - "TypeC", - "<{ syncAlerts: ", - "BooleanC", - "; }>; }>, ", - "TypeC", - "<{ closed_at: ", + "; }>]>]>; closure_type: ", "UnionC", "<[", + "LiteralC", + "<\"close-by-user\">, ", + "LiteralC", + "<\"close-by-pushing\">]>; }>, ", + "TypeC", + "<{ owner: ", "StringC", - ", ", - "NullC", - "]>; closed_by: ", - "UnionC", - "<[", + "; }>]>, ", + "TypeC", + "<{ created_at: ", + "StringC", + "; created_by: ", "TypeC", "<{ email: ", "UnionC", @@ -9849,57 +10207,15 @@ "NullC", ", ", "StringC", - "]>; }>, ", - "NullC", - "]>; created_at: ", - "StringC", - "; created_by: ", - "TypeC", - "<{ email: ", - "UnionC", - "<[", - "UndefinedC", - ", ", - "NullC", - ", ", - "StringC", - "]>; full_name: ", + "]>; }>; updated_at: ", "UnionC", "<[", - "UndefinedC", - ", ", - "NullC", - ", ", "StringC", - "]>; username: ", - "UnionC", - "<[", - "UndefinedC", ", ", "NullC", - ", ", - "StringC", - "]>; }>; external_service: ", + "]>; updated_by: ", "UnionC", "<[", - "IntersectionC", - "<[", - "TypeC", - "<{ connector_id: ", - "StringC", - "; connector_name: ", - "StringC", - "; external_id: ", - "StringC", - "; external_title: ", - "StringC", - "; external_url: ", - "StringC", - "; }>, ", - "TypeC", - "<{ pushed_at: ", - "StringC", - "; pushed_by: ", "TypeC", "<{ email: ", "UnionC", @@ -9925,49 +10241,57 @@ "NullC", ", ", "StringC", - "]>; }>; }>]>, ", + "]>; }>, ", "NullC", - "]>; updated_at: ", + "]>; }>]>, ", + "TypeC", + "<{ mappings: ", + "ArrayC", + "<", + "TypeC", + "<{ action_type: ", "UnionC", "<[", - "StringC", - ", ", - "NullC", - "]>; updated_by: ", + "LiteralC", + "<\"append\">, ", + "LiteralC", + "<\"nothing\">, ", + "LiteralC", + "<\"overwrite\">]>; source: ", "UnionC", "<[", - "TypeC", - "<{ email: ", + "LiteralC", + "<\"title\">, ", + "LiteralC", + "<\"description\">, ", + "LiteralC", + "<\"comments\">]>; target: ", "UnionC", "<[", - "UndefinedC", - ", ", - "NullC", - ", ", "StringC", - "]>; full_name: ", - "UnionC", - "<[", - "UndefinedC", - ", ", - "NullC", ", ", + "LiteralC", + "<\"not_mapped\">]>; }>>; owner: ", "StringC", - "]>; username: ", + "; }>, ", + "TypeC", + "<{ id: ", + "StringC", + "; version: ", + "StringC", + "; error: ", "UnionC", "<[", - "UndefinedC", + "StringC", ", ", "NullC", - ", ", + "]>; owner: ", "StringC", - "]>; }>, ", - "NullC", - "]>; }>]>" + "; }>]>>" ], "source": { - "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 62 + "path": "x-pack/plugins/cases/common/api/cases/configure.ts", + "lineNumber": 76 }, "deprecated": false, "initialIsOpen": false @@ -9980,6 +10304,8 @@ "label": "CaseConfigureAttributesRt", "description": [], "signature": [ + "IntersectionC", + "<[", "IntersectionC", "<[", "TypeC", @@ -10191,6 +10517,10 @@ "LiteralC", "<\"close-by-pushing\">]>; }>, ", "TypeC", + "<{ owner: ", + "StringC", + "; }>]>, ", + "TypeC", "<{ created_at: ", "StringC", "; created_by: ", @@ -10259,7 +10589,27 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/configure.ts", - "lineNumber": 27 + "lineNumber": 43 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CaseConfigureRequestParamsRt", + "type": "Object", + "tags": [], + "label": "CaseConfigureRequestParamsRt", + "description": [], + "signature": [ + "TypeC", + "<{ configuration_id: ", + "StringC", + "; }>" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/configure.ts", + "lineNumber": 72 }, "deprecated": false, "initialIsOpen": false @@ -10276,6 +10626,8 @@ "<[", "IntersectionC", "<[", + "IntersectionC", + "<[", "TypeC", "<{ connector: ", "IntersectionC", @@ -10485,6 +10837,10 @@ "LiteralC", "<\"close-by-pushing\">]>; }>, ", "TypeC", + "<{ owner: ", + "StringC", + "; }>]>, ", + "TypeC", "<{ created_at: ", "StringC", "; created_by: ", @@ -10577,9 +10933,13 @@ "StringC", ", ", "LiteralC", - "<\"not_mapped\">]>; }>>; }>, ", + "<\"not_mapped\">]>; }>>; owner: ", + "StringC", + "; }>, ", "TypeC", - "<{ version: ", + "<{ id: ", + "StringC", + "; version: ", "StringC", "; error: ", "UnionC", @@ -10587,11 +10947,13 @@ "StringC", ", ", "NullC", - "]>; }>]>" + "]>; owner: ", + "StringC", + "; }>]>" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/configure.ts", - "lineNumber": 37 + "lineNumber": 53 }, "deprecated": false, "initialIsOpen": false @@ -11089,7 +11451,9 @@ "TypeC", "<{ syncAlerts: ", "BooleanC", - "; }>; }>, ", + "; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ id: ", "StringC", @@ -11099,7 +11463,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 142 + "lineNumber": 242 }, "deprecated": false, "initialIsOpen": false @@ -11353,11 +11717,13 @@ "TypeC", "<{ syncAlerts: ", "BooleanC", - "; }>; }>]>" + "; }>; owner: ", + "StringC", + "; }>]>" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 97 + "lineNumber": 142 }, "deprecated": false, "initialIsOpen": false @@ -11379,7 +11745,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 150 + "lineNumber": 253 }, "deprecated": false, "initialIsOpen": false @@ -11663,7 +12029,9 @@ "TypeC", "<{ syncAlerts: ", "BooleanC", - "; }>; }>, ", + "; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ closed_at: ", "UnionC", @@ -11975,7 +12343,9 @@ "StringC", "]>; }>, ", "NullC", - "]>; }>]>, ", + "]>; owner: ", + "StringC", + "; }>]>, ", "TypeC", "<{ id: ", "StringC", @@ -12009,7 +12379,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -12061,7 +12433,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -12189,7 +12563,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -12241,7 +12617,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -12341,7 +12719,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -12393,7 +12773,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -12521,7 +12903,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -12573,7 +12957,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -12655,7 +13041,33 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 117 + "lineNumber": 217 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CasesByAlertIDRequestRt", + "type": "Object", + "tags": [], + "label": "CasesByAlertIDRequestRt", + "description": [], + "signature": [ + "PartialC", + "<{ owner: ", + "UnionC", + "<[", + "ArrayC", + "<", + "StringC", + ">, ", + "StringC", + "]>; }>" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/case.ts", + "lineNumber": 209 }, "deprecated": false, "initialIsOpen": false @@ -12905,11 +13317,13 @@ "TypeC", "<{ syncAlerts: ", "BooleanC", - "; }>; }>" + "; }>; owner: ", + "StringC", + "; }>" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 86 + "lineNumber": 131 }, "deprecated": false, "initialIsOpen": false @@ -13139,7 +13553,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/configure.ts", - "lineNumber": 22 + "lineNumber": 38 }, "deprecated": false, "initialIsOpen": false @@ -13152,6 +13566,8 @@ "label": "CasesConfigureRequestRt", "description": [], "signature": [ + "IntersectionC", + "<[", "TypeC", "<{ connector: ", "IntersectionC", @@ -13359,11 +13775,15 @@ "LiteralC", "<\"close-by-user\">, ", "LiteralC", - "<\"close-by-pushing\">]>; }>" + "<\"close-by-pushing\">]>; }>, ", + "TypeC", + "<{ owner: ", + "StringC", + "; }>]>" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/configure.ts", - "lineNumber": 21 + "lineNumber": 37 }, "deprecated": false, "initialIsOpen": false @@ -13464,10 +13884,14 @@ "; search: ", "StringC", "; searchFields: ", + "UnionC", + "<[", "ArrayC", "<", "StringC", - ">; sortField: ", + ">, ", + "StringC", + "]>; sortField: ", "StringC", "; sortOrder: ", "UnionC", @@ -13475,11 +13899,19 @@ "LiteralC", "<\"desc\">, ", "LiteralC", - "<\"asc\">]>; }>" + "<\"asc\">]>; owner: ", + "UnionC", + "<[", + "ArrayC", + "<", + "StringC", + ">, ", + "StringC", + "]>; }>" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 102 + "lineNumber": 150 }, "deprecated": false, "initialIsOpen": false @@ -13769,7 +14201,9 @@ "TypeC", "<{ syncAlerts: ", "BooleanC", - "; }>; }>, ", + "; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ closed_at: ", "UnionC", @@ -14081,7 +14515,9 @@ "StringC", "]>; }>, ", "NullC", - "]>; }>]>, ", + "]>; owner: ", + "StringC", + "; }>]>, ", "TypeC", "<{ id: ", "StringC", @@ -14115,7 +14551,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -14167,7 +14605,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -14295,7 +14735,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -14347,7 +14789,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -14447,7 +14891,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -14499,7 +14945,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -14627,7 +15075,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -14679,7 +15129,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -14775,7 +15227,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 132 + "lineNumber": 232 }, "deprecated": false, "initialIsOpen": false @@ -15061,7 +15513,9 @@ "TypeC", "<{ syncAlerts: ", "BooleanC", - "; }>; }>, ", + "; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ id: ", "StringC", @@ -15071,7 +15525,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 147 + "lineNumber": 250 }, "deprecated": false, "initialIsOpen": false @@ -15357,7 +15811,9 @@ "TypeC", "<{ syncAlerts: ", "BooleanC", - "; }>; }>, ", + "; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ closed_at: ", "UnionC", @@ -15669,7 +16125,9 @@ "StringC", "]>; }>, ", "NullC", - "]>; }>]>, ", + "]>; owner: ", + "StringC", + "; }>]>, ", "TypeC", "<{ id: ", "StringC", @@ -15703,7 +16161,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -15755,7 +16215,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -15883,7 +16345,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -15935,7 +16399,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -16035,7 +16501,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -16087,7 +16555,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -16215,7 +16685,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -16267,7 +16739,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -16349,7 +16823,33 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 148 + "lineNumber": 251 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CasesStatusRequestRt", + "type": "Object", + "tags": [], + "label": "CasesStatusRequestRt", + "description": [], + "signature": [ + "PartialC", + "<{ owner: ", + "UnionC", + "<[", + "ArrayC", + "<", + "StringC", + ">, ", + "StringC", + "]>; }>" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/status.ts", + "lineNumber": 30 }, "deprecated": false, "initialIsOpen": false @@ -16457,7 +16957,9 @@ "LiteralC", "<\"settings\">, ", "LiteralC", - "<\"sub_case\">]>>; action: ", + "<\"sub_case\">, ", + "LiteralC", + "<\"owner\">]>>; action: ", "UnionC", "<[", "LiteralC", @@ -16509,11 +17011,13 @@ "StringC", ", ", "NullC", - "]>; }>" + "]>; owner: ", + "StringC", + "; }>" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", - "lineNumber": 55 + "lineNumber": 58 }, "deprecated": false, "initialIsOpen": false @@ -16553,7 +17057,9 @@ "LiteralC", "<\"settings\">, ", "LiteralC", - "<\"sub_case\">]>>; action: ", + "<\"sub_case\">, ", + "LiteralC", + "<\"owner\">]>>; action: ", "UnionC", "<[", "LiteralC", @@ -16605,7 +17111,9 @@ "StringC", ", ", "NullC", - "]>; }>, ", + "]>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ action_id: ", "StringC", @@ -16625,7 +17133,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", - "lineNumber": 57 + "lineNumber": 60 }, "deprecated": false, "initialIsOpen": false @@ -16689,7 +17197,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -16765,7 +17275,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 38 + "lineNumber": 39 }, "deprecated": false, "initialIsOpen": false @@ -16835,7 +17345,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -16961,7 +17473,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>]>, ", + "]>; }>; owner: ", + "StringC", + "; }>]>, ", "PartialC", "<{ associationType: ", "UnionC", @@ -17013,7 +17527,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -17089,7 +17605,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 116 + "lineNumber": 120 }, "deprecated": false, "initialIsOpen": false @@ -17119,7 +17635,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ type: ", "UnionC", @@ -17173,7 +17691,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>]>, ", + "]>; }>; owner: ", + "StringC", + "; }>]>, ", "TypeC", "<{ id: ", "StringC", @@ -17183,7 +17703,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 101 + "lineNumber": 105 }, "deprecated": false, "initialIsOpen": false @@ -17211,7 +17731,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ type: ", "UnionC", @@ -17265,11 +17787,13 @@ "StringC", ", ", "NullC", - "]>; }>; }>]>" + "]>; }>; owner: ", + "StringC", + "; }>]>" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 81 + "lineNumber": 85 }, "deprecated": false, "initialIsOpen": false @@ -17301,7 +17825,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -17353,7 +17879,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -17481,7 +18009,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -17533,7 +18063,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -17615,7 +18147,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 83 + "lineNumber": 87 }, "deprecated": false, "initialIsOpen": false @@ -17685,7 +18217,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -17737,7 +18271,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -17819,7 +18355,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 91 + "lineNumber": 95 }, "deprecated": false, "initialIsOpen": false @@ -17855,7 +18391,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -17907,7 +18445,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -18035,7 +18575,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -18087,7 +18629,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -18175,7 +18719,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 121 + "lineNumber": 125 }, "deprecated": false, "initialIsOpen": false @@ -18387,7 +18931,9 @@ "StringC", ", ", "LiteralC", - "<\"not_mapped\">]>; }>>; }>" + "<\"not_mapped\">]>; }>>; owner: ", + "StringC", + "; }>" ], "source": { "path": "x-pack/plugins/cases/common/api/connectors/mappings.ts", @@ -18625,11 +19171,13 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>" + ".user>; owner: ", + "StringC", + "; }>" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 57 + "lineNumber": 59 }, "deprecated": false, "initialIsOpen": false @@ -18673,7 +19221,79 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 155 + "lineNumber": 258 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.FindQueryParamsRt", + "type": "Object", + "tags": [], + "label": "FindQueryParamsRt", + "description": [], + "signature": [ + "PartialC", + "<{ subCaseId: ", + "StringC", + "; defaultSearchOperator: ", + "UnionC", + "<[", + "LiteralC", + "<\"AND\">, ", + "LiteralC", + "<\"OR\">]>; hasReferenceOperator: ", + "UnionC", + "<[", + "LiteralC", + "<\"AND\">, ", + "LiteralC", + "<\"OR\">]>; hasReference: ", + "UnionC", + "<[", + "ArrayC", + "<", + "TypeC", + "<{ id: ", + "StringC", + "; type: ", + "StringC", + "; }>>, ", + "TypeC", + "<{ id: ", + "StringC", + "; type: ", + "StringC", + "; }>]>; fields: ", + "ArrayC", + "<", + "StringC", + ">; filter: ", + "StringC", + "; page: ", + "Type", + "; perPage: ", + "Type", + "; search: ", + "StringC", + "; searchFields: ", + "ArrayC", + "<", + "StringC", + ">; sortField: ", + "StringC", + "; sortOrder: ", + "UnionC", + "<[", + "LiteralC", + "<\"desc\">, ", + "LiteralC", + "<\"asc\">]>; }>" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/comment.ts", + "lineNumber": 134 }, "deprecated": false, "initialIsOpen": false @@ -18703,7 +19323,33 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 18 + "lineNumber": 19 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.GetConfigureFindRequestRt", + "type": "Object", + "tags": [], + "label": "GetConfigureFindRequestRt", + "description": [], + "signature": [ + "PartialC", + "<{ owner: ", + "UnionC", + "<[", + "ArrayC", + "<", + "StringC", + ">, ", + "StringC", + "]>; }>" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/configure.ts", + "lineNumber": 64 }, "deprecated": false, "initialIsOpen": false @@ -19121,11 +19767,13 @@ "StringC", "]>; }>, ", "NullC", - "]>; }>]>" + "]>; owner: ", + "StringC", + "; }>]>" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 20 + "lineNumber": 23 }, "deprecated": false, "initialIsOpen": false @@ -19183,7 +19831,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 67 + "lineNumber": 99 }, "deprecated": false, "initialIsOpen": false @@ -19339,7 +19987,9 @@ "StringC", "]>; }>, ", "NullC", - "]>; }>]>, ", + "]>; owner: ", + "StringC", + "; }>]>, ", "TypeC", "<{ id: ", "StringC", @@ -19373,7 +20023,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -19425,7 +20077,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -19553,7 +20207,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -19605,7 +20261,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -19687,7 +20345,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 44 + "lineNumber": 76 }, "deprecated": false, "initialIsOpen": false @@ -19761,11 +20419,13 @@ "LiteralC", "<\"desc\">, ", "LiteralC", - "<\"asc\">]>; }>" + "<\"asc\">]>; owner: ", + "StringC", + "; }>" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 32 + "lineNumber": 36 }, "deprecated": false, "initialIsOpen": false @@ -19927,7 +20587,9 @@ "StringC", "]>; }>, ", "NullC", - "]>; }>]>, ", + "]>; owner: ", + "StringC", + "; }>]>, ", "TypeC", "<{ id: ", "StringC", @@ -19961,7 +20623,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -20013,7 +20677,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -20141,7 +20807,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -20193,7 +20861,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -20289,7 +20959,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 57 + "lineNumber": 89 }, "deprecated": false, "initialIsOpen": false @@ -20351,7 +21021,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 72 + "lineNumber": 104 }, "deprecated": false, "initialIsOpen": false @@ -20509,7 +21179,9 @@ "StringC", "]>; }>, ", "NullC", - "]>; }>]>, ", + "]>; owner: ", + "StringC", + "; }>]>, ", "TypeC", "<{ id: ", "StringC", @@ -20543,7 +21215,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -20595,7 +21269,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -20723,7 +21399,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -20775,7 +21453,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -20857,7 +21537,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 73 + "lineNumber": 105 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/cases.mdx b/api_docs/cases.mdx index 892e3e02e75222..00714b3217fca8 100644 --- a/api_docs/cases.mdx +++ b/api_docs/cases.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import casesObj from './cases.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 406 | 0 | 381 | 13 | + ## Client ### Start @@ -22,11 +32,11 @@ import casesObj from './cases.json'; ### Interfaces -### Consts, variables and types - - ## Server +### Classes + + ### Interfaces diff --git a/api_docs/charts.json b/api_docs/charts.json index 29c1c163d19a03..f42832e5d1e95f 100644 --- a/api_docs/charts.json +++ b/api_docs/charts.json @@ -11,11 +11,11 @@ "label": "ColorPicker", "description": [], "signature": [ - "({ onChange, color: selectedColor, label, useLegacyColors, colorIsOverwritten, onKeyDown, }: ColorPickerProps) => JSX.Element" + "({ onChange, color: selectedColor, label, useLegacyColors, colorIsOverwritten, onKeyDown, maxDepth, layerIndex, }: ColorPickerProps) => JSX.Element" ], "source": { "path": "src/plugins/charts/public/static/components/color_picker.tsx", - "lineNumber": 111 + "lineNumber": 119 }, "deprecated": false, "children": [ @@ -24,14 +24,14 @@ "id": "def-public.ColorPicker.$1", "type": "Object", "tags": [], - "label": "{\n onChange,\n color: selectedColor,\n label,\n useLegacyColors = true,\n colorIsOverwritten = true,\n onKeyDown,\n}", + "label": "{\n onChange,\n color: selectedColor,\n label,\n useLegacyColors = true,\n colorIsOverwritten = true,\n onKeyDown,\n maxDepth,\n layerIndex,\n}", "description": [], "signature": [ "ColorPickerProps" ], "source": { "path": "src/plugins/charts/public/static/components/color_picker.tsx", - "lineNumber": 111 + "lineNumber": 119 }, "deprecated": false, "isRequired": true @@ -630,6 +630,77 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "charts", + "id": "def-public.lightenColor", + "type": "Function", + "tags": [], + "label": "lightenColor", + "description": [], + "signature": [ + "(baseColor: string, step: number, totalSteps: number) => string" + ], + "source": { + "path": "src/plugins/charts/public/services/palettes/lighten_color.ts", + "lineNumber": 14 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "charts", + "id": "def-public.lightenColor.$1", + "type": "string", + "tags": [], + "label": "baseColor", + "description": [], + "signature": [ + "string" + ], + "source": { + "path": "src/plugins/charts/public/services/palettes/lighten_color.ts", + "lineNumber": 14 + }, + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "charts", + "id": "def-public.lightenColor.$2", + "type": "number", + "tags": [], + "label": "step", + "description": [], + "signature": [ + "number" + ], + "source": { + "path": "src/plugins/charts/public/services/palettes/lighten_color.ts", + "lineNumber": 14 + }, + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "charts", + "id": "def-public.lightenColor.$3", + "type": "number", + "tags": [], + "label": "totalSteps", + "description": [], + "signature": [ + "number" + ], + "source": { + "path": "src/plugins/charts/public/services/palettes/lighten_color.ts", + "lineNumber": 14 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "charts", "id": "def-public.renderEndzoneTooltip", @@ -1132,6 +1203,86 @@ "lineNumber": 16 }, "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-public.CustomPaletteArguments.stop", + "type": "Array", + "tags": [], + "label": "stop", + "description": [], + "signature": [ + "number[] | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 17 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-public.CustomPaletteArguments.range", + "type": "CompoundType", + "tags": [], + "label": "range", + "description": [], + "signature": [ + "\"number\" | \"percent\" | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 18 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-public.CustomPaletteArguments.rangeMin", + "type": "number", + "tags": [], + "label": "rangeMin", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 19 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-public.CustomPaletteArguments.rangeMax", + "type": "number", + "tags": [], + "label": "rangeMax", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 20 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-public.CustomPaletteArguments.continuity", + "type": "CompoundType", + "tags": [], + "label": "continuity", + "description": [], + "signature": [ + "\"above\" | \"below\" | \"all\" | \"none\" | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 21 + }, + "deprecated": false } ], "initialIsOpen": false @@ -1145,7 +1296,7 @@ "description": [], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 19 + "lineNumber": 24 }, "deprecated": false, "children": [ @@ -1161,7 +1312,7 @@ ], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 20 + "lineNumber": 25 }, "deprecated": false }, @@ -1174,7 +1325,81 @@ "description": [], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 21 + "lineNumber": 26 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-public.CustomPaletteState.stops", + "type": "Array", + "tags": [], + "label": "stops", + "description": [], + "signature": [ + "number[]" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 27 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-public.CustomPaletteState.range", + "type": "CompoundType", + "tags": [], + "label": "range", + "description": [], + "signature": [ + "\"number\" | \"percent\"" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 28 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-public.CustomPaletteState.rangeMin", + "type": "number", + "tags": [], + "label": "rangeMin", + "description": [], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 29 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-public.CustomPaletteState.rangeMax", + "type": "number", + "tags": [], + "label": "rangeMax", + "description": [], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 30 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-public.CustomPaletteState.continuity", + "type": "CompoundType", + "tags": [], + "label": "continuity", + "description": [], + "signature": [ + "\"above\" | \"below\" | \"all\" | \"none\" | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 31 }, "deprecated": false } @@ -1408,28 +1633,10 @@ }, { "parentPluginId": "charts", - "id": "def-public.PaletteDefinition.renderEditor", + "id": "def-public.PaletteDefinition.getCategoricalColor", "type": "Function", "tags": [], - "label": "renderEditor", - "description": [ - "\nRenders the UI for editing the internal state of the palette.\nNot each palette has to feature an internal state, so this is an optional property." - ], - "signature": [ - "((domElement: Element, props: { state?: T | undefined; setState: (updater: (oldState: T) => T) => void; }) => void) | undefined" - ], - "source": { - "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 88 - }, - "deprecated": false - }, - { - "parentPluginId": "charts", - "id": "def-public.PaletteDefinition.getColor", - "type": "Function", - "tags": [], - "label": "getColor", + "label": "getCategoricalColor", "description": [ "\nColor a series according to the internal rules of the palette." ], @@ -1454,7 +1661,7 @@ ], "source": { "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 97 + "lineNumber": 87 }, "deprecated": false, "returnComment": [], @@ -1480,7 +1687,7 @@ ], "source": { "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 98 + "lineNumber": 88 }, "deprecated": false }, @@ -1503,7 +1710,7 @@ ], "source": { "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 99 + "lineNumber": 89 }, "deprecated": false }, @@ -1521,7 +1728,7 @@ ], "source": { "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 100 + "lineNumber": 90 }, "deprecated": false } @@ -1529,10 +1736,10 @@ }, { "parentPluginId": "charts", - "id": "def-public.PaletteDefinition.getColors", + "id": "def-public.PaletteDefinition.getCategoricalColors", "type": "Function", "tags": [], - "label": "getColors", + "label": "getCategoricalColors", "description": [ "\nGet a spectrum of colors of the current palette.\nThis can be used if the chart wants to control color assignment locally." ], @@ -1541,7 +1748,7 @@ ], "source": { "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 106 + "lineNumber": 96 }, "deprecated": false, "returnComment": [], @@ -1555,7 +1762,7 @@ "description": [], "source": { "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 106 + "lineNumber": 96 }, "deprecated": false }, @@ -1571,11 +1778,47 @@ ], "source": { "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 106 + "lineNumber": 96 }, "deprecated": false } ] + }, + { + "parentPluginId": "charts", + "id": "def-public.PaletteDefinition.canDynamicColoring", + "type": "CompoundType", + "tags": [], + "label": "canDynamicColoring", + "description": [ + "\nDefine whether a palette supports dynamic coloring (i.e. gradient colors mapped to number values)" + ], + "signature": [ + "boolean | undefined" + ], + "source": { + "path": "src/plugins/charts/public/services/palettes/types.ts", + "lineNumber": 100 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-public.PaletteDefinition.getColorForValue", + "type": "Function", + "tags": [], + "label": "getColorForValue", + "description": [ + "\nGet the assigned color for the given value based on its data domain and state settings.\nThis can be used for dynamic coloring based on uniform color distribution or custom stops." + ], + "signature": [ + "((value: number | undefined, state: T, { min, max }: { min: number; max: number; }) => string | undefined) | undefined" + ], + "source": { + "path": "src/plugins/charts/public/services/palettes/types.ts", + "lineNumber": 105 + }, + "deprecated": false } ], "initialIsOpen": false @@ -1599,7 +1842,7 @@ ], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 28 + "lineNumber": 38 }, "deprecated": false, "children": [ @@ -1615,7 +1858,7 @@ ], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 29 + "lineNumber": 39 }, "deprecated": false }, @@ -1628,7 +1871,7 @@ "description": [], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 30 + "lineNumber": 40 }, "deprecated": false }, @@ -1644,7 +1887,7 @@ ], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 31 + "lineNumber": 41 }, "deprecated": false } @@ -1660,7 +1903,7 @@ "description": [], "source": { "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 109 + "lineNumber": 112 }, "deprecated": false, "children": [ @@ -1684,7 +1927,7 @@ ], "source": { "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 110 + "lineNumber": 113 }, "deprecated": false, "returnComment": [], @@ -1698,7 +1941,7 @@ "description": [], "source": { "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 110 + "lineNumber": 113 }, "deprecated": false } @@ -1724,7 +1967,7 @@ ], "source": { "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 111 + "lineNumber": 114 }, "deprecated": false, "returnComment": [], @@ -1953,7 +2196,7 @@ "description": [], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 24 + "lineNumber": 34 }, "deprecated": false, "children": [ @@ -1966,7 +2209,7 @@ "description": [], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 25 + "lineNumber": 35 }, "deprecated": false } @@ -2693,7 +2936,7 @@ ], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 53 + "lineNumber": 63 }, "deprecated": false, "children": [], @@ -2754,7 +2997,7 @@ ], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 119 + "lineNumber": 175 }, "deprecated": false, "children": [], @@ -2820,6 +3063,86 @@ "lineNumber": 16 }, "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-common.CustomPaletteArguments.stop", + "type": "Array", + "tags": [], + "label": "stop", + "description": [], + "signature": [ + "number[] | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 17 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-common.CustomPaletteArguments.range", + "type": "CompoundType", + "tags": [], + "label": "range", + "description": [], + "signature": [ + "\"number\" | \"percent\" | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 18 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-common.CustomPaletteArguments.rangeMin", + "type": "number", + "tags": [], + "label": "rangeMin", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 19 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-common.CustomPaletteArguments.rangeMax", + "type": "number", + "tags": [], + "label": "rangeMax", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 20 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-common.CustomPaletteArguments.continuity", + "type": "CompoundType", + "tags": [], + "label": "continuity", + "description": [], + "signature": [ + "\"above\" | \"below\" | \"all\" | \"none\" | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 21 + }, + "deprecated": false } ], "initialIsOpen": false @@ -2833,7 +3156,7 @@ "description": [], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 19 + "lineNumber": 24 }, "deprecated": false, "children": [ @@ -2849,7 +3172,7 @@ ], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 20 + "lineNumber": 25 }, "deprecated": false }, @@ -2862,7 +3185,81 @@ "description": [], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 21 + "lineNumber": 26 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-common.CustomPaletteState.stops", + "type": "Array", + "tags": [], + "label": "stops", + "description": [], + "signature": [ + "number[]" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 27 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-common.CustomPaletteState.range", + "type": "CompoundType", + "tags": [], + "label": "range", + "description": [], + "signature": [ + "\"number\" | \"percent\"" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 28 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-common.CustomPaletteState.rangeMin", + "type": "number", + "tags": [], + "label": "rangeMin", + "description": [], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 29 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-common.CustomPaletteState.rangeMax", + "type": "number", + "tags": [], + "label": "rangeMax", + "description": [], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 30 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-common.CustomPaletteState.continuity", + "type": "CompoundType", + "tags": [], + "label": "continuity", + "description": [], + "signature": [ + "\"above\" | \"below\" | \"all\" | \"none\" | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 31 }, "deprecated": false } @@ -2888,7 +3285,7 @@ ], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 28 + "lineNumber": 38 }, "deprecated": false, "children": [ @@ -2904,7 +3301,7 @@ ], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 29 + "lineNumber": 39 }, "deprecated": false }, @@ -2917,7 +3314,7 @@ "description": [], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 30 + "lineNumber": 40 }, "deprecated": false }, @@ -2933,7 +3330,7 @@ ], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 31 + "lineNumber": 41 }, "deprecated": false } @@ -2949,7 +3346,7 @@ "description": [], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 24 + "lineNumber": 34 }, "deprecated": false, "children": [ @@ -2962,7 +3359,7 @@ "description": [], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 25 + "lineNumber": 35 }, "deprecated": false } @@ -3001,7 +3398,7 @@ ], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 33 + "lineNumber": 43 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/charts.mdx b/api_docs/charts.mdx index 1cbdb2f19a6fbb..95d0bd527e631b 100644 --- a/api_docs/charts.mdx +++ b/api_docs/charts.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import chartsObj from './charts.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 190 | 2 | 159 | 1 | + ## Client ### Start diff --git a/api_docs/cloud.mdx b/api_docs/cloud.mdx index 4a61ce885f1548..f9d44f9c8d08ba 100644 --- a/api_docs/cloud.mdx +++ b/api_docs/cloud.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import cloudObj from './cloud.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 20 | 0 | 20 | 0 | + ## Client ### Setup diff --git a/api_docs/console.mdx b/api_docs/console.mdx index 3514fa2697aaa0..74a7fadf7a5c37 100644 --- a/api_docs/console.mdx +++ b/api_docs/console.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import consoleObj from './console.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 2 | 0 | 2 | 0 | + ## Server ### Setup diff --git a/api_docs/core.json b/api_docs/core.json index 4fedef842a1c4c..a5466960dbd36f 100644 --- a/api_docs/core.json +++ b/api_docs/core.json @@ -1112,7 +1112,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 203 + "lineNumber": 204 }, "deprecated": false, "children": [ @@ -1136,7 +1136,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 205 + "lineNumber": 206 }, "deprecated": false }, @@ -1160,7 +1160,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 207 + "lineNumber": 208 }, "deprecated": false }, @@ -1184,7 +1184,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 209 + "lineNumber": 210 }, "deprecated": false }, @@ -1208,7 +1208,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 211 + "lineNumber": 212 }, "deprecated": false }, @@ -1232,7 +1232,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 213 + "lineNumber": 214 }, "deprecated": false }, @@ -1252,7 +1252,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 220 + "lineNumber": 221 }, "deprecated": true, "references": [] @@ -1279,7 +1279,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 224 + "lineNumber": 225 }, "deprecated": false, "returnComment": [], @@ -1299,7 +1299,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 248 + "lineNumber": 249 }, "deprecated": false, "children": [ @@ -1323,7 +1323,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 250 + "lineNumber": 251 }, "deprecated": false }, @@ -1347,7 +1347,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 252 + "lineNumber": 253 }, "deprecated": false }, @@ -1371,7 +1371,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 254 + "lineNumber": 255 }, "deprecated": false }, @@ -1395,7 +1395,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 256 + "lineNumber": 257 }, "deprecated": false }, @@ -1419,7 +1419,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 258 + "lineNumber": 259 }, "deprecated": false }, @@ -1443,7 +1443,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 260 + "lineNumber": 261 }, "deprecated": false }, @@ -1467,7 +1467,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 262 + "lineNumber": 263 }, "deprecated": false }, @@ -1491,7 +1491,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 264 + "lineNumber": 265 }, "deprecated": false }, @@ -1515,7 +1515,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 266 + "lineNumber": 267 }, "deprecated": false }, @@ -1539,7 +1539,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 268 + "lineNumber": 269 }, "deprecated": false }, @@ -1563,7 +1563,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 270 + "lineNumber": 271 }, "deprecated": false }, @@ -1583,7 +1583,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 277 + "lineNumber": 278 }, "deprecated": true, "references": [ @@ -5501,7 +5501,7 @@ ], "signature": [ "Record | undefined" ], "source": { @@ -7427,7 +7427,7 @@ ], "source": { "path": "src/core/public/index.ts", - "lineNumber": 234 + "lineNumber": 235 }, "deprecated": false, "initialIsOpen": false @@ -8058,7 +8058,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 188 + "lineNumber": 210 }, "deprecated": false, "children": [ @@ -8076,7 +8076,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 192 + "lineNumber": 214 }, "deprecated": false }, @@ -8091,7 +8091,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 197 + "lineNumber": 219 }, "deprecated": false }, @@ -8106,7 +8106,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 202 + "lineNumber": 224 }, "deprecated": false }, @@ -8124,7 +8124,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 208 + "lineNumber": 230 }, "deprecated": false }, @@ -8142,7 +8142,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 215 + "lineNumber": 237 }, "deprecated": false }, @@ -8160,7 +8160,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 220 + "lineNumber": 242 }, "deprecated": false }, @@ -8178,7 +8178,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 225 + "lineNumber": 247 }, "deprecated": false }, @@ -8196,7 +8196,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 230 + "lineNumber": 252 }, "deprecated": false }, @@ -8211,7 +8211,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 236 + "lineNumber": 258 }, "deprecated": false }, @@ -8229,7 +8229,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 242 + "lineNumber": 264 }, "deprecated": false }, @@ -8244,7 +8244,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 248 + "lineNumber": 270 }, "deprecated": false }, @@ -8262,7 +8262,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 254 + "lineNumber": 276 }, "deprecated": false }, @@ -8280,7 +8280,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 260 + "lineNumber": 282 }, "deprecated": false }, @@ -8298,7 +8298,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 267 + "lineNumber": 289 }, "deprecated": false }, @@ -8316,7 +8316,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 277 + "lineNumber": 299 }, "deprecated": false }, @@ -8332,7 +8332,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 279 + "lineNumber": 301 }, "deprecated": false, "children": [ @@ -8348,7 +8348,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 279 + "lineNumber": 301 }, "deprecated": false, "isRequired": true @@ -9095,7 +9095,7 @@ "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/types.ts", - "lineNumber": 40 + "lineNumber": 39 } }, { @@ -9109,7 +9109,7 @@ "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/target/types/server/types.d.ts", - "lineNumber": 25 + "lineNumber": 24 } } ], @@ -9383,7 +9383,7 @@ "plugin": "data", "link": { "path": "src/plugins/data/server/autocomplete/value_suggestions_route.ts", - "lineNumber": 67 + "lineNumber": 65 } }, { @@ -9439,7 +9439,7 @@ "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/routes/api/indices/register_list_route.ts", - "lineNumber": 18 + "lineNumber": 16 } }, { @@ -9460,7 +9460,7 @@ "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/routes/api/indices/register_reload_route.ts", - "lineNumber": 33 + "lineNumber": 28 } }, { @@ -9488,14 +9488,14 @@ "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/routes/api/templates/register_get_routes.ts", - "lineNumber": 24 + "lineNumber": 22 } }, { "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/routes/api/templates/register_get_routes.ts", - "lineNumber": 65 + "lineNumber": 62 } }, { @@ -9572,14 +9572,14 @@ "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/routes/api/component_templates/create.ts", - "lineNumber": 28 + "lineNumber": 24 } }, { "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/routes/api/component_templates/update.ts", - "lineNumber": 32 + "lineNumber": 28 } }, { @@ -9596,181 +9596,6 @@ "lineNumber": 48 } }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/auto_follow_pattern/register_create_route.ts", - "lineNumber": 45 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/auto_follow_pattern/register_create_route.ts", - "lineNumber": 64 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/auto_follow_pattern/register_delete_route.ts", - "lineNumber": 50 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/auto_follow_pattern/register_fetch_route.ts", - "lineNumber": 27 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/auto_follow_pattern/register_get_route.ts", - "lineNumber": 37 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/auto_follow_pattern/register_pause_route.ts", - "lineNumber": 49 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/auto_follow_pattern/register_resume_route.ts", - "lineNumber": 49 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/auto_follow_pattern/register_update_route.ts", - "lineNumber": 47 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_create_route.ts", - "lineNumber": 52 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_fetch_route.ts", - "lineNumber": 29 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_fetch_route.ts", - "lineNumber": 35 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_get_route.ts", - "lineNumber": 38 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_get_route.ts", - "lineNumber": 58 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_pause_route.ts", - "lineNumber": 47 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_resume_route.ts", - "lineNumber": 47 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_unfollow_route.ts", - "lineNumber": 50 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_unfollow_route.ts", - "lineNumber": 59 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_unfollow_route.ts", - "lineNumber": 64 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_unfollow_route.ts", - "lineNumber": 72 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_update_route.ts", - "lineNumber": 53 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_update_route.ts", - "lineNumber": 66 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_update_route.ts", - "lineNumber": 80 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/cross_cluster_replication/register_permissions_route.ts", - "lineNumber": 40 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/cross_cluster_replication/register_stats_route.ts", - "lineNumber": 29 - } - }, - { - "plugin": "infra", - "link": { - "path": "x-pack/plugins/infra/server/lib/log_analysis/log_entry_categories_analysis.ts", - "lineNumber": 420 - } - }, { "plugin": "lists", "link": { @@ -9803,7 +9628,7 @@ "plugin": "monitoring", "link": { "path": "x-pack/plugins/monitoring/server/plugin.ts", - "lineNumber": 356 + "lineNumber": 361 } }, { @@ -9817,7 +9642,7 @@ "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/query_signals_route.ts", - "lineNumber": 52 + "lineNumber": 60 } }, { @@ -10303,7 +10128,7 @@ "plugin": "fleet", "link": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 189 + "lineNumber": 190 } }, { @@ -11156,7 +10981,7 @@ ], "source": { "path": "src/core/server/index.ts", - "lineNumber": 472 + "lineNumber": 470 }, "deprecated": false, "children": [ @@ -11180,7 +11005,7 @@ ], "source": { "path": "src/core/server/index.ts", - "lineNumber": 474 + "lineNumber": 472 }, "deprecated": false }, @@ -11204,7 +11029,7 @@ ], "source": { "path": "src/core/server/index.ts", - "lineNumber": 476 + "lineNumber": 474 }, "deprecated": false }, @@ -11228,7 +11053,7 @@ ], "source": { "path": "src/core/server/index.ts", - "lineNumber": 478 + "lineNumber": 476 }, "deprecated": false }, @@ -11261,7 +11086,7 @@ ], "source": { "path": "src/core/server/index.ts", - "lineNumber": 480 + "lineNumber": 478 }, "deprecated": false }, @@ -11285,7 +11110,7 @@ ], "source": { "path": "src/core/server/index.ts", - "lineNumber": 485 + "lineNumber": 483 }, "deprecated": false }, @@ -11309,7 +11134,7 @@ ], "source": { "path": "src/core/server/index.ts", - "lineNumber": 487 + "lineNumber": 485 }, "deprecated": false }, @@ -11333,7 +11158,7 @@ ], "source": { "path": "src/core/server/index.ts", - "lineNumber": 489 + "lineNumber": 487 }, "deprecated": false }, @@ -11357,7 +11182,7 @@ ], "source": { "path": "src/core/server/index.ts", - "lineNumber": 491 + "lineNumber": 489 }, "deprecated": false }, @@ -11381,7 +11206,7 @@ ], "source": { "path": "src/core/server/index.ts", - "lineNumber": 493 + "lineNumber": 491 }, "deprecated": false }, @@ -11405,7 +11230,7 @@ ], "source": { "path": "src/core/server/index.ts", - "lineNumber": 495 + "lineNumber": 493 }, "deprecated": false }, @@ -11429,7 +11254,7 @@ ], "source": { "path": "src/core/server/index.ts", - "lineNumber": 497 + "lineNumber": 495 }, "deprecated": false }, @@ -11455,7 +11280,7 @@ ], "source": { "path": "src/core/server/index.ts", - "lineNumber": 499 + "lineNumber": 497 }, "deprecated": false, "returnComment": [], @@ -11475,7 +11300,7 @@ ], "source": { "path": "src/core/server/index.ts", - "lineNumber": 520 + "lineNumber": 518 }, "deprecated": false, "children": [ @@ -11499,7 +11324,7 @@ ], "source": { "path": "src/core/server/index.ts", - "lineNumber": 522 + "lineNumber": 520 }, "deprecated": false }, @@ -11523,7 +11348,7 @@ ], "source": { "path": "src/core/server/index.ts", - "lineNumber": 524 + "lineNumber": 522 }, "deprecated": false }, @@ -11547,7 +11372,7 @@ ], "source": { "path": "src/core/server/index.ts", - "lineNumber": 526 + "lineNumber": 524 }, "deprecated": false }, @@ -11571,7 +11396,7 @@ ], "source": { "path": "src/core/server/index.ts", - "lineNumber": 528 + "lineNumber": 526 }, "deprecated": false }, @@ -11595,7 +11420,7 @@ ], "source": { "path": "src/core/server/index.ts", - "lineNumber": 530 + "lineNumber": 528 }, "deprecated": false }, @@ -11619,7 +11444,7 @@ ], "source": { "path": "src/core/server/index.ts", - "lineNumber": 532 + "lineNumber": 530 }, "deprecated": false } @@ -12169,6 +11994,24 @@ }, "deprecated": false }, + { + "parentPluginId": "core", + "id": "def-server.DeprecationsDetails.deprecationType", + "type": "CompoundType", + "tags": [], + "label": "deprecationType", + "description": [ + "\n(optional) Used to identify between different deprecation types.\nExample use case: in Upgrade Assistant, we may want to allow the user to sort by\ndeprecation type or show each type in a separate tab.\n\nFeel free to add new types if necessary.\nPredefined types are necessary to reduce having similar definitions with different keywords\nacross kibana deprecations." + ], + "signature": [ + "\"config\" | \"feature\" | undefined" + ], + "source": { + "path": "src/core/server/deprecations/types.ts", + "lineNumber": 37 + }, + "deprecated": false + }, { "parentPluginId": "core", "id": "def-server.DeprecationsDetails.documentationUrl", @@ -12181,7 +12024,7 @@ ], "source": { "path": "src/core/server/deprecations/types.ts", - "lineNumber": 29 + "lineNumber": 39 }, "deprecated": false }, @@ -12193,11 +12036,11 @@ "label": "correctiveActions", "description": [], "signature": [ - "{ api?: { path: string; method: \"PUT\" | \"POST\"; body?: { [key: string]: any; } | undefined; } | undefined; manualSteps?: string[] | undefined; }" + "{ api?: { path: string; method: \"PUT\" | \"POST\"; body?: { [key: string]: any; } | undefined; } | undefined; manualSteps: string[]; }" ], "source": { "path": "src/core/server/deprecations/types.ts", - "lineNumber": 31 + "lineNumber": 41 }, "deprecated": false } @@ -12265,7 +12108,7 @@ ], "source": { "path": "src/core/server/deprecations/deprecations_service.ts", - "lineNumber": 103 + "lineNumber": 101 }, "deprecated": false, "children": [ @@ -12289,7 +12132,7 @@ ], "source": { "path": "src/core/server/deprecations/deprecations_service.ts", - "lineNumber": 104 + "lineNumber": 102 }, "deprecated": false, "returnComment": [], @@ -12312,7 +12155,7 @@ ], "source": { "path": "src/core/server/deprecations/deprecations_service.ts", - "lineNumber": 104 + "lineNumber": 102 }, "deprecated": false } @@ -12708,14 +12551,7 @@ "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/plugin.ts", - "lineNumber": 34 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/plugin.ts", - "lineNumber": 33 + "lineNumber": 32 } }, { @@ -12949,7 +12785,7 @@ "description": [], "source": { "path": "src/core/server/deprecations/types.ts", - "lineNumber": 60 + "lineNumber": 70 }, "deprecated": false, "children": [ @@ -12971,7 +12807,7 @@ ], "source": { "path": "src/core/server/deprecations/types.ts", - "lineNumber": 61 + "lineNumber": 71 }, "deprecated": false }, @@ -13287,7 +13123,7 @@ ], "source": { "path": "src/core/server/deprecations/types.ts", - "lineNumber": 62 + "lineNumber": 72 }, "deprecated": false } @@ -14316,7 +14152,7 @@ "signature": [ "Pick<", "KibanaClient", - ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"helpers\" | \"count\" | \"search\" | \"security\" | \"eql\" | \"on\" | \"off\" | \"transform\" | \"emit\" | \"once\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", + ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"helpers\" | \"count\" | \"search\" | \"security\" | \"eql\" | \"on\" | \"off\" | \"transform\" | \"emit\" | \"once\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", "TransportRequestParams", ", options?: ", "TransportRequestOptions", @@ -15520,7 +15356,7 @@ "signature": [ "Pick<", "KibanaClient", - ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"helpers\" | \"count\" | \"search\" | \"security\" | \"eql\" | \"on\" | \"off\" | \"transform\" | \"emit\" | \"once\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", + ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"helpers\" | \"count\" | \"search\" | \"security\" | \"eql\" | \"on\" | \"off\" | \"transform\" | \"emit\" | \"once\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", "TransportRequestParams", ", options?: ", "TransportRequestOptions", @@ -15548,7 +15384,7 @@ "signature": [ "Pick<", "KibanaClient", - ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"helpers\" | \"count\" | \"search\" | \"security\" | \"eql\" | \"on\" | \"off\" | \"transform\" | \"emit\" | \"once\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", + ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"helpers\" | \"count\" | \"search\" | \"security\" | \"eql\" | \"on\" | \"off\" | \"transform\" | \"emit\" | \"once\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", "TransportRequestParams", ", options?: ", "TransportRequestOptions", @@ -15957,14 +15793,14 @@ "plugin": "crossClusterReplication", "link": { "path": "x-pack/plugins/cross_cluster_replication/server/plugin.ts", - "lineNumber": 17 + "lineNumber": 16 } }, { "plugin": "crossClusterReplication", "link": { "path": "x-pack/plugins/cross_cluster_replication/server/plugin.ts", - "lineNumber": 36 + "lineNumber": 27 } }, { @@ -16223,14 +16059,14 @@ "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender.ts", - "lineNumber": 447 + "lineNumber": 457 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender.ts", - "lineNumber": 466 + "lineNumber": 476 } }, { @@ -20314,13 +20150,13 @@ "signature": [ "{ legacy: { globalConfig$: ", "Observable", - " moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly autocompleteTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; elasticsearch: Readonly<{ readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; path: Readonly<{ readonly data: string; }>; savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", + "; elasticsearch: Readonly<{ readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; path: Readonly<{ readonly data: string; }>; savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", "ByteSizeValue", ") => boolean; isLessThan: (other: ", "ByteSizeValue", ") => boolean; isEqualTo: (other: ", "ByteSizeValue", - ") => boolean; getValueInBytes: () => number; toString: (returnUnit?: \"b\" | \"kb\" | \"mb\" | \"gb\" | undefined) => string; }>; }>; }>>; get: () => Readonly<{ kibana: Readonly<{ readonly index: string; readonly autocompleteTerminateAfter: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly autocompleteTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; elasticsearch: Readonly<{ readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; path: Readonly<{ readonly data: string; }>; savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", + ") => boolean; getValueInBytes: () => number; toString: (returnUnit?: \"b\" | \"kb\" | \"mb\" | \"gb\" | undefined) => string; }>; }>; }>>; get: () => Readonly<{ kibana: Readonly<{ readonly index: string; }>; elasticsearch: Readonly<{ readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; path: Readonly<{ readonly data: string; }>; savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", "ByteSizeValue", ") => boolean; isLessThan: (other: ", "ByteSizeValue", @@ -20552,7 +20388,7 @@ "description": [], "source": { "path": "src/core/server/deprecations/types.ts", - "lineNumber": 56 + "lineNumber": 66 }, "deprecated": false, "children": [ @@ -20584,7 +20420,7 @@ ], "source": { "path": "src/core/server/deprecations/types.ts", - "lineNumber": 57 + "lineNumber": 67 }, "deprecated": false, "returnComment": [], @@ -20607,7 +20443,7 @@ ], "source": { "path": "src/core/server/deprecations/types.ts", - "lineNumber": 57 + "lineNumber": 67 }, "deprecated": false } @@ -20627,7 +20463,7 @@ ], "source": { "path": "src/core/server/index.ts", - "lineNumber": 439 + "lineNumber": 437 }, "deprecated": false, "children": [ @@ -20731,7 +20567,7 @@ ], "source": { "path": "src/core/server/index.ts", - "lineNumber": 440 + "lineNumber": 438 }, "deprecated": false } @@ -22507,7 +22343,7 @@ "signature": [ "Pick<", "KibanaClient", - ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"helpers\" | \"count\" | \"search\" | \"security\" | \"eql\" | \"on\" | \"off\" | \"transform\" | \"emit\" | \"once\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", + ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"helpers\" | \"count\" | \"search\" | \"security\" | \"eql\" | \"on\" | \"off\" | \"transform\" | \"emit\" | \"once\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", "TransportRequestParams", ", options?: ", "TransportRequestOptions", @@ -23394,28 +23230,14 @@ "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/plugin.ts", - "lineNumber": 14 + "lineNumber": 12 } }, { "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/plugin.ts", - "lineNumber": 42 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/plugin.ts", - "lineNumber": 13 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/plugin.ts", - "lineNumber": 69 + "lineNumber": 38 } }, { @@ -23499,7 +23321,7 @@ "plugin": "monitoring", "link": { "path": "x-pack/plugins/monitoring/server/plugin.ts", - "lineNumber": 279 + "lineNumber": 284 } }, { @@ -23672,28 +23494,14 @@ "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/types.ts", - "lineNumber": 43 + "lineNumber": 42 } }, { "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/types.ts", - "lineNumber": 50 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/types.ts", - "lineNumber": 8 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/types.ts", - "lineNumber": 41 + "lineNumber": 49 } }, { @@ -23710,41 +23518,6 @@ "lineNumber": 73 } }, - { - "plugin": "infra", - "link": { - "path": "x-pack/plugins/infra/server/lib/log_analysis/log_entry_categories_analysis.ts", - "lineNumber": 9 - } - }, - { - "plugin": "infra", - "link": { - "path": "x-pack/plugins/infra/server/lib/log_analysis/log_entry_categories_analysis.ts", - "lineNumber": 139 - } - }, - { - "plugin": "infra", - "link": { - "path": "x-pack/plugins/infra/server/lib/log_analysis/log_entry_categories_analysis.ts", - "lineNumber": 405 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/target/types/server/types.d.ts", - "lineNumber": 1 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/target/types/server/types.d.ts", - "lineNumber": 30 - } - }, { "plugin": "globalSearch", "link": { @@ -23770,28 +23543,14 @@ "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/target/types/server/types.d.ts", - "lineNumber": 27 + "lineNumber": 26 } }, { "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/target/types/server/types.d.ts", - "lineNumber": 33 - } - }, - { - "plugin": "infra", - "link": { - "path": "x-pack/plugins/infra/target/types/server/lib/log_analysis/log_entry_categories_analysis.d.ts", - "lineNumber": 1 - } - }, - { - "plugin": "infra", - "link": { - "path": "x-pack/plugins/infra/target/types/server/lib/log_analysis/log_entry_categories_analysis.d.ts", - "lineNumber": 58 + "lineNumber": 32 } } ], @@ -24260,7 +24019,7 @@ "label": "SharedGlobalConfig", "description": [], "signature": [ - "{ readonly kibana: Readonly<{ readonly index: string; readonly autocompleteTerminateAfter: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly autocompleteTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; readonly elasticsearch: Readonly<{ readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; readonly path: Readonly<{ readonly data: string; }>; readonly savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", + "{ readonly kibana: Readonly<{ readonly index: string; }>; readonly elasticsearch: Readonly<{ readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; readonly path: Readonly<{ readonly data: string; }>; readonly savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", "ByteSizeValue", ") => boolean; isLessThan: (other: ", "ByteSizeValue", @@ -24297,7 +24056,7 @@ ], "source": { "path": "src/core/server/index.ts", - "lineNumber": 510 + "lineNumber": 508 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/core.mdx b/api_docs/core.mdx index 77050dd72894a8..31889ec1042b84 100644 --- a/api_docs/core.mdx +++ b/api_docs/core.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import coreObj from './core.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 2273 | 148 | 1052 | 26 | + ## Client ### Classes diff --git a/api_docs/core_application.json b/api_docs/core_application.json index e890b6f92a2ad6..ab5fbe560172be 100644 --- a/api_docs/core_application.json +++ b/api_docs/core_application.json @@ -572,11 +572,18 @@ "section": "def-public.App", "text": "App" }, - "" + " extends ", + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreApplicationPluginApi", + "section": "def-public.AppNavOptions", + "text": "AppNavOptions" + } ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 79 + "lineNumber": 107 }, "deprecated": false, "children": [ @@ -591,7 +598,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 83 + "lineNumber": 111 }, "deprecated": false }, @@ -606,7 +613,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 88 + "lineNumber": 116 }, "deprecated": false }, @@ -625,7 +632,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 95 + "lineNumber": 123 }, "deprecated": false }, @@ -650,7 +657,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 101 + "lineNumber": 129 }, "deprecated": false }, @@ -675,7 +682,25 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 108 + "lineNumber": 136 + }, + "deprecated": false + }, + { + "parentPluginId": "core", + "id": "def-public.App.searchable", + "type": "CompoundType", + "tags": [], + "label": "searchable", + "description": [ + "\nThe initial flag to determine if the application is searchable in the global search.\nDefaulting to `true` if `navLinkStatus` is `visible` or omitted." + ], + "signature": [ + "boolean | undefined" + ], + "source": { + "path": "src/core/public/application/types.ts", + "lineNumber": 142 }, "deprecated": false }, @@ -693,7 +718,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 115 + "lineNumber": 149 }, "deprecated": false }, @@ -720,79 +745,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 149 - }, - "deprecated": false - }, - { - "parentPluginId": "core", - "id": "def-public.App.order", - "type": "number", - "tags": [], - "label": "order", - "description": [ - "\nAn ordinal used to sort nav links relative to one another for display." - ], - "signature": [ - "number | undefined" - ], - "source": { - "path": "src/core/public/application/types.ts", - "lineNumber": 154 - }, - "deprecated": false - }, - { - "parentPluginId": "core", - "id": "def-public.App.tooltip", - "type": "string", - "tags": [], - "label": "tooltip", - "description": [ - "\nA tooltip shown when hovering over app link." - ], - "signature": [ - "string | undefined" - ], - "source": { - "path": "src/core/public/application/types.ts", - "lineNumber": 159 - }, - "deprecated": false - }, - { - "parentPluginId": "core", - "id": "def-public.App.euiIconType", - "type": "string", - "tags": [], - "label": "euiIconType", - "description": [ - "\nA EUI iconType that will be used for the app's icon. This icon\ntakes precendence over the `icon` property." - ], - "signature": [ - "string | undefined" - ], - "source": { - "path": "src/core/public/application/types.ts", - "lineNumber": 165 - }, - "deprecated": false - }, - { - "parentPluginId": "core", - "id": "def-public.App.icon", - "type": "string", - "tags": [], - "label": "icon", - "description": [ - "\nA URL to an image file used as an icon. Used as a fallback\nif `euiIconType` is not provided." - ], - "signature": [ - "string | undefined" - ], - "source": { - "path": "src/core/public/application/types.ts", - "lineNumber": 171 + "lineNumber": 183 }, "deprecated": false }, @@ -812,7 +765,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 176 + "lineNumber": 188 }, "deprecated": false }, @@ -830,7 +783,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 182 + "lineNumber": 194 }, "deprecated": false }, @@ -872,7 +825,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 187 + "lineNumber": 199 }, "deprecated": false, "returnComment": [], @@ -896,7 +849,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 326 + "lineNumber": 346 }, "deprecated": false } @@ -916,7 +869,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 194 + "lineNumber": 206 }, "deprecated": false }, @@ -934,7 +887,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 212 + "lineNumber": 224 }, "deprecated": false }, @@ -952,7 +905,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 215 + "lineNumber": 227 }, "deprecated": false }, @@ -977,7 +930,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 254 + "lineNumber": 266 }, "deprecated": false } @@ -995,7 +948,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 552 + "lineNumber": 572 }, "deprecated": false, "children": [ @@ -1018,7 +971,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 553 + "lineNumber": 573 }, "deprecated": false }, @@ -1031,7 +984,7 @@ "description": [], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 554 + "lineNumber": 574 }, "deprecated": false }, @@ -1047,7 +1000,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 555 + "lineNumber": 575 }, "deprecated": false }, @@ -1063,7 +1016,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 556 + "lineNumber": 576 }, "deprecated": false } @@ -1081,7 +1034,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 540 + "lineNumber": 560 }, "deprecated": false, "children": [ @@ -1104,7 +1057,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 541 + "lineNumber": 561 }, "deprecated": false } @@ -1120,7 +1073,7 @@ "description": [], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 607 + "lineNumber": 628 }, "deprecated": false, "children": [ @@ -1146,7 +1099,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 613 + "lineNumber": 634 }, "deprecated": false, "children": [ @@ -1171,7 +1124,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 613 + "lineNumber": 634 }, "deprecated": false, "isRequired": true @@ -1203,7 +1156,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 642 + "lineNumber": 663 }, "deprecated": false, "children": [ @@ -1228,7 +1181,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 642 + "lineNumber": 663 }, "deprecated": false, "isRequired": true @@ -1248,7 +1201,7 @@ "description": [], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 683 + "lineNumber": 710 }, "deprecated": false, "children": [ @@ -1266,7 +1219,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 687 + "lineNumber": 714 }, "deprecated": false }, @@ -1293,7 +1246,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 696 + "lineNumber": 723 }, "deprecated": false }, @@ -1319,7 +1272,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 704 + "lineNumber": 731 }, "deprecated": false, "children": [ @@ -1335,7 +1288,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 704 + "lineNumber": 731 }, "deprecated": false, "isRequired": true @@ -1361,7 +1314,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 704 + "lineNumber": 731 }, "deprecated": false, "isRequired": false @@ -1383,7 +1336,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 742 + "lineNumber": 769 }, "deprecated": false, "children": [ @@ -1401,7 +1354,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 742 + "lineNumber": 769 }, "deprecated": false, "isRequired": true @@ -1423,7 +1376,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 756 + "lineNumber": 783 }, "deprecated": false, "children": [ @@ -1439,7 +1392,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 756 + "lineNumber": 783 }, "deprecated": false, "isRequired": true @@ -1453,7 +1406,7 @@ "description": [], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 756 + "lineNumber": 783 }, "deprecated": false, "children": [ @@ -1469,7 +1422,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 756 + "lineNumber": 783 }, "deprecated": false }, @@ -1485,7 +1438,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 756 + "lineNumber": 783 }, "deprecated": false } @@ -1509,7 +1462,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 761 + "lineNumber": 788 }, "deprecated": false } @@ -1535,7 +1488,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 336 + "lineNumber": 356 }, "deprecated": false, "children": [ @@ -1553,7 +1506,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 340 + "lineNumber": 360 }, "deprecated": false }, @@ -1578,7 +1531,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 386 + "lineNumber": 406 }, "deprecated": false }, @@ -1595,7 +1548,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 436 + "lineNumber": 456 }, "deprecated": true, "references": [ @@ -1606,6 +1559,13 @@ "lineNumber": 16 } }, + { + "plugin": "fleet", + "link": { + "path": "x-pack/plugins/fleet/public/applications/integrations/index.tsx", + "lineNumber": 67 + } + }, { "plugin": "fleet", "link": { @@ -1661,6 +1621,13 @@ "path": "x-pack/plugins/fleet/target/types/public/applications/fleet/index.d.ts", "lineNumber": 11 } + }, + { + "plugin": "fleet", + "link": { + "path": "x-pack/plugins/fleet/target/types/public/applications/integrations/index.d.ts", + "lineNumber": 11 + } } ] }, @@ -1688,29 +1655,29 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 471 + "lineNumber": 491 }, "deprecated": true, "references": [ { "plugin": "dashboard", "link": { - "path": "src/plugins/dashboard/public/application/types.ts", - "lineNumber": 82 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 194 } }, { "plugin": "dashboard", "link": { "path": "src/plugins/dashboard/public/application/dashboard_router.tsx", - "lineNumber": 56 + "lineNumber": 57 } }, { "plugin": "dashboard", "link": { "path": "src/plugins/dashboard/public/plugin.tsx", - "lineNumber": 298 + "lineNumber": 299 } }, { @@ -1724,7 +1691,7 @@ "plugin": "maps", "link": { "path": "x-pack/plugins/maps/public/routes/map_page/map_app/map_app.tsx", - "lineNumber": 59 + "lineNumber": 67 } }, { @@ -1738,14 +1705,21 @@ "plugin": "lens", "link": { "path": "x-pack/plugins/lens/public/app_plugin/types.ts", - "lineNumber": 71 + "lineNumber": 44 + } + }, + { + "plugin": "lens", + "link": { + "path": "x-pack/plugins/lens/public/app_plugin/types.ts", + "lineNumber": 72 } }, { "plugin": "lens", "link": { "path": "x-pack/plugins/lens/public/app_plugin/mounter.tsx", - "lineNumber": 171 + "lineNumber": 219 } }, { @@ -1822,7 +1796,7 @@ "plugin": "maps", "link": { "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts", - "lineNumber": 13 + "lineNumber": 17 } } ], @@ -1849,7 +1823,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 471 + "lineNumber": 491 }, "deprecated": false } @@ -1877,7 +1851,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 502 + "lineNumber": 522 }, "deprecated": false, "returnComment": [], @@ -1901,7 +1875,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 502 + "lineNumber": 522 }, "deprecated": false } @@ -1910,6 +1884,96 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "core", + "id": "def-public.AppNavOptions", + "type": "Interface", + "tags": [], + "label": "AppNavOptions", + "description": [ + "\nApp navigation menu options" + ], + "source": { + "path": "src/core/public/application/types.ts", + "lineNumber": 73 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-public.AppNavOptions.order", + "type": "number", + "tags": [], + "label": "order", + "description": [ + "\nAn ordinal used to sort nav links relative to one another for display." + ], + "signature": [ + "number | undefined" + ], + "source": { + "path": "src/core/public/application/types.ts", + "lineNumber": 77 + }, + "deprecated": false + }, + { + "parentPluginId": "core", + "id": "def-public.AppNavOptions.tooltip", + "type": "string", + "tags": [], + "label": "tooltip", + "description": [ + "\nA tooltip shown when hovering over app link." + ], + "signature": [ + "string | undefined" + ], + "source": { + "path": "src/core/public/application/types.ts", + "lineNumber": 82 + }, + "deprecated": false + }, + { + "parentPluginId": "core", + "id": "def-public.AppNavOptions.euiIconType", + "type": "string", + "tags": [], + "label": "euiIconType", + "description": [ + "\nA EUI iconType that will be used for the app's icon. This icon\ntakes precendence over the `icon` property." + ], + "signature": [ + "string | undefined" + ], + "source": { + "path": "src/core/public/application/types.ts", + "lineNumber": 88 + }, + "deprecated": false + }, + { + "parentPluginId": "core", + "id": "def-public.AppNavOptions.icon", + "type": "string", + "tags": [], + "label": "icon", + "description": [ + "\nA URL to an image file used as an icon. Used as a fallback\nif `euiIconType` is not provided." + ], + "signature": [ + "string | undefined" + ], + "source": { + "path": "src/core/public/application/types.ts", + "lineNumber": 94 + }, + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "core", "id": "def-public.NavigateToAppOptions", @@ -1921,10 +1985,28 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 661 + "lineNumber": 683 }, "deprecated": false, "children": [ + { + "parentPluginId": "core", + "id": "def-public.NavigateToAppOptions.deepLinkId", + "type": "string", + "tags": [], + "label": "deepLinkId", + "description": [ + "\noptional {@link App.deepLinks | deep link} id inside the application to navigate to.\nIf an additional {@link NavigateToAppOptions.path | path} is defined it will be appended to the deep link path." + ], + "signature": [ + "string | undefined" + ], + "source": { + "path": "src/core/public/application/types.ts", + "lineNumber": 688 + }, + "deprecated": false + }, { "parentPluginId": "core", "id": "def-public.NavigateToAppOptions.path", @@ -1932,14 +2014,14 @@ "tags": [], "label": "path", "description": [ - "\noptional path inside application to deep link to.\nIf undefined, will use {@link App.defaultPath | the app's default path}` as default." + "\noptional path inside application to deep link to.\nIf undefined, will use {@link App.defaultPath | the app's default path} as default." ], "signature": [ "string | undefined" ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 666 + "lineNumber": 693 }, "deprecated": false }, @@ -1957,7 +2039,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 670 + "lineNumber": 697 }, "deprecated": false }, @@ -1975,7 +2057,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 674 + "lineNumber": 701 }, "deprecated": false }, @@ -1993,7 +2075,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 679 + "lineNumber": 706 }, "deprecated": false } @@ -2013,7 +2095,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 527 + "lineNumber": 547 }, "deprecated": false, "initialIsOpen": false @@ -2070,7 +2152,15 @@ "section": "def-public.AppNavLinkStatus", "text": "AppNavLinkStatus" }, - " | undefined; } & { path: string; deepLinks?: ", + " | undefined; searchable?: boolean | undefined; } & ", + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreApplicationPluginApi", + "section": "def-public.AppNavOptions", + "text": "AppNavOptions" + }, + " & { path: string; deepLinks?: ", { "pluginId": "core", "scope": "public", @@ -2086,7 +2176,15 @@ "section": "def-public.AppNavLinkStatus", "text": "AppNavLinkStatus" }, - " | undefined; } & { path?: string | undefined; deepLinks: ", + " | undefined; searchable?: boolean | undefined; } & ", + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreApplicationPluginApi", + "section": "def-public.AppNavOptions", + "text": "AppNavOptions" + }, + " & { path?: string | undefined; deepLinks: ", { "pluginId": "core", "scope": "public", @@ -2098,7 +2196,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 279 + "lineNumber": 292 }, "deprecated": false, "initialIsOpen": false @@ -2131,7 +2229,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 566 + "lineNumber": 586 }, "deprecated": false, "initialIsOpen": false @@ -2161,7 +2259,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 517 + "lineNumber": 537 }, "deprecated": true, "references": [ @@ -2269,7 +2367,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 325 + "lineNumber": 345 }, "deprecated": false, "initialIsOpen": false @@ -2288,7 +2386,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 333 + "lineNumber": 353 }, "deprecated": false, "initialIsOpen": false @@ -2319,7 +2417,7 @@ "section": "def-public.AppDeepLink", "text": "AppDeepLink" }, - "[] | undefined; navLinkStatus?: ", + "[] | undefined; searchable?: boolean | undefined; navLinkStatus?: ", { "pluginId": "core", "scope": "public", @@ -2362,11 +2460,11 @@ "section": "def-public.App", "text": "App" }, - ", \"status\" | \"deepLinks\" | \"navLinkStatus\" | \"defaultPath\" | \"tooltip\">> | undefined" + ", \"status\" | \"deepLinks\" | \"searchable\" | \"navLinkStatus\" | \"defaultPath\" | \"tooltip\">> | undefined" ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 74 + "lineNumber": 102 }, "deprecated": false, "initialIsOpen": false @@ -2389,7 +2487,7 @@ "section": "def-public.AppDeepLink", "text": "AppDeepLink" }, - ", \"title\" | \"id\" | \"path\"> & { deepLinks: ", + ", \"title\" | \"id\" | \"order\" | \"path\" | \"tooltip\" | \"euiIconType\" | \"icon\"> & { deepLinks: ", { "pluginId": "core", "scope": "public", @@ -2405,11 +2503,11 @@ "section": "def-public.AppNavLinkStatus", "text": "AppNavLinkStatus" }, - "; }" + "; searchable: boolean; }" ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 262 + "lineNumber": 274 }, "deprecated": false, "initialIsOpen": false @@ -2432,7 +2530,7 @@ "section": "def-public.App", "text": "App" }, - ", \"status\" | \"title\" | \"id\" | \"order\" | \"category\" | \"navLinkStatus\" | \"defaultPath\" | \"tooltip\" | \"euiIconType\" | \"icon\" | \"capabilities\" | \"chromeless\" | \"appRoute\" | \"exactRoute\"> & { status: ", + ", \"status\" | \"title\" | \"id\" | \"order\" | \"category\" | \"navLinkStatus\" | \"defaultPath\" | \"capabilities\" | \"chromeless\" | \"appRoute\" | \"exactRoute\" | \"tooltip\" | \"euiIconType\" | \"icon\"> & { status: ", { "pluginId": "core", "scope": "public", @@ -2456,11 +2554,11 @@ "section": "def-public.PublicAppDeepLinkInfo", "text": "PublicAppDeepLinkInfo" }, - "[]; }" + "[]; searchable: boolean; }" ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 308 + "lineNumber": 324 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/core_application.mdx b/api_docs/core_application.mdx index 76d2d95f21e05f..ce165343346322 100644 --- a/api_docs/core_application.mdx +++ b/api_docs/core_application.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import coreApplicationObj from './core_application.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 2273 | 148 | 1052 | 26 | + ## Client ### Classes diff --git a/api_docs/core_chrome.json b/api_docs/core_chrome.json index fae65ff62c9714..c84b06c235b489 100644 --- a/api_docs/core_chrome.json +++ b/api_docs/core_chrome.json @@ -965,14 +965,11 @@ "tags": [], "label": "url", "description": [ - "\nThe route used to open the {@link AppBase.defaultPath | default path } of an application.\nIf unset, `baseUrl` will be used instead." - ], - "signature": [ - "string | undefined" + "\nThe route used to open the default path and the deep links of an application." ], "source": { "path": "src/core/public/chrome/nav_links/nav_link.ts", - "lineNumber": 39 + "lineNumber": 38 }, "deprecated": false }, @@ -990,7 +987,7 @@ ], "source": { "path": "src/core/public/chrome/nav_links/nav_link.ts", - "lineNumber": 44 + "lineNumber": 43 }, "deprecated": false }, @@ -1008,7 +1005,7 @@ ], "source": { "path": "src/core/public/chrome/nav_links/nav_link.ts", - "lineNumber": 49 + "lineNumber": 48 }, "deprecated": false }, @@ -1026,7 +1023,7 @@ ], "source": { "path": "src/core/public/chrome/nav_links/nav_link.ts", - "lineNumber": 55 + "lineNumber": 54 }, "deprecated": false }, @@ -1044,7 +1041,7 @@ ], "source": { "path": "src/core/public/chrome/nav_links/nav_link.ts", - "lineNumber": 61 + "lineNumber": 60 }, "deprecated": false }, @@ -1059,7 +1056,7 @@ ], "source": { "path": "src/core/public/chrome/nav_links/nav_link.ts", - "lineNumber": 66 + "lineNumber": 65 }, "deprecated": false }, @@ -1077,7 +1074,7 @@ ], "source": { "path": "src/core/public/chrome/nav_links/nav_link.ts", - "lineNumber": 75 + "lineNumber": 74 }, "deprecated": false }, @@ -1095,7 +1092,7 @@ ], "source": { "path": "src/core/public/chrome/nav_links/nav_link.ts", - "lineNumber": 80 + "lineNumber": 79 }, "deprecated": false } diff --git a/api_docs/core_chrome.mdx b/api_docs/core_chrome.mdx index a9e100b79a91ec..3fbc87ad30fffc 100644 --- a/api_docs/core_chrome.mdx +++ b/api_docs/core_chrome.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import coreChromeObj from './core_chrome.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 2273 | 148 | 1052 | 26 | + ## Client ### Interfaces diff --git a/api_docs/core_http.mdx b/api_docs/core_http.mdx index ea545eb6d70def..4f15e1a1ce90c5 100644 --- a/api_docs/core_http.mdx +++ b/api_docs/core_http.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import coreHttpObj from './core_http.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 2273 | 148 | 1052 | 26 | + ## Client ### Interfaces diff --git a/api_docs/core_saved_objects.json b/api_docs/core_saved_objects.json index adf0612a28faf8..bd7a9cb1ccb08b 100644 --- a/api_docs/core_saved_objects.json +++ b/api_docs/core_saved_objects.json @@ -4759,7 +4759,7 @@ "description": [], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 36 + "lineNumber": 35 }, "deprecated": false, "children": [ @@ -5075,7 +5075,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 37 + "lineNumber": 36 }, "deprecated": false }, @@ -5099,7 +5099,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 38 + "lineNumber": 37 }, "deprecated": false }, @@ -5112,7 +5112,7 @@ "description": [], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 39 + "lineNumber": 38 }, "deprecated": false }, @@ -5128,7 +5128,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 40 + "lineNumber": 39 }, "deprecated": false }, @@ -5144,7 +5144,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 42 + "lineNumber": 41 }, "deprecated": false, "children": [ @@ -5157,7 +5157,7 @@ "description": [], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 47 + "lineNumber": 46 }, "deprecated": false, "children": [ @@ -5473,7 +5473,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 48 + "lineNumber": 47 }, "deprecated": false }, @@ -5521,7 +5521,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 49 + "lineNumber": 48 }, "deprecated": false }, @@ -5534,7 +5534,7 @@ "description": [], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 50 + "lineNumber": 49 }, "deprecated": false }, @@ -5550,7 +5550,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 51 + "lineNumber": 50 }, "deprecated": false } @@ -5585,7 +5585,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 74 + "lineNumber": 73 }, "deprecated": false, "children": [ @@ -5607,7 +5607,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 74 + "lineNumber": 73 }, "deprecated": false, "isRequired": true @@ -5641,7 +5641,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 93 + "lineNumber": 92 }, "deprecated": false, "children": [ @@ -5663,7 +5663,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 93 + "lineNumber": 92 }, "deprecated": false, "isRequired": true @@ -7575,7 +7575,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 697 + "lineNumber": 696 }, "deprecated": false, "children": [ @@ -7591,7 +7591,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 698 + "lineNumber": 697 }, "deprecated": false, "isRequired": true @@ -7614,7 +7614,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 699 + "lineNumber": 698 }, "deprecated": false, "isRequired": true @@ -7667,7 +7667,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 759 + "lineNumber": 758 }, "deprecated": false, "children": [ @@ -7689,7 +7689,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 760 + "lineNumber": 759 }, "deprecated": false, "isRequired": true @@ -7739,7 +7739,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 926 + "lineNumber": 925 }, "deprecated": false, "children": [ @@ -7764,7 +7764,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 927 + "lineNumber": 926 }, "deprecated": false, "isRequired": true @@ -7787,7 +7787,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 928 + "lineNumber": 927 }, "deprecated": false, "isRequired": true @@ -7823,7 +7823,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1013 + "lineNumber": 1012 }, "deprecated": false, "children": [ @@ -7839,7 +7839,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1014 + "lineNumber": 1013 }, "deprecated": false, "isRequired": true @@ -7856,7 +7856,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1015 + "lineNumber": 1014 }, "deprecated": false, "isRequired": true @@ -7879,7 +7879,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1016 + "lineNumber": 1015 }, "deprecated": false, "isRequired": true @@ -7921,7 +7921,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1055 + "lineNumber": 1054 }, "deprecated": false, "children": [ @@ -7937,7 +7937,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1056 + "lineNumber": 1055 }, "deprecated": false, "isRequired": true @@ -7954,7 +7954,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1057 + "lineNumber": 1056 }, "deprecated": false, "isRequired": true @@ -7977,7 +7977,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1058 + "lineNumber": 1057 }, "deprecated": false, "isRequired": true @@ -8021,7 +8021,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1185 + "lineNumber": 1184 }, "deprecated": false, "children": [ @@ -8037,7 +8037,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1186 + "lineNumber": 1185 }, "deprecated": false, "isRequired": true @@ -8054,7 +8054,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1187 + "lineNumber": 1186 }, "deprecated": false, "isRequired": true @@ -8071,7 +8071,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1188 + "lineNumber": 1187 }, "deprecated": false, "isRequired": true @@ -8095,7 +8095,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1189 + "lineNumber": 1188 }, "deprecated": false, "isRequired": true @@ -8141,7 +8141,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1283 + "lineNumber": 1282 }, "deprecated": false, "children": [ @@ -8166,7 +8166,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1284 + "lineNumber": 1283 }, "deprecated": false, "isRequired": true @@ -8190,7 +8190,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1285 + "lineNumber": 1284 }, "deprecated": false, "isRequired": false @@ -8236,7 +8236,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1307 + "lineNumber": 1306 }, "deprecated": false, "children": [ @@ -8259,7 +8259,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1308 + "lineNumber": 1307 }, "deprecated": false, "isRequired": true @@ -8276,7 +8276,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1309 + "lineNumber": 1308 }, "deprecated": false, "isRequired": true @@ -8293,7 +8293,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1310 + "lineNumber": 1309 }, "deprecated": false, "isRequired": true @@ -8317,7 +8317,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1311 + "lineNumber": 1310 }, "deprecated": false, "isRequired": false @@ -8366,7 +8366,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1334 + "lineNumber": 1333 }, "deprecated": false, "children": [ @@ -8391,7 +8391,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1335 + "lineNumber": 1334 }, "deprecated": false, "isRequired": true @@ -8414,7 +8414,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1336 + "lineNumber": 1335 }, "deprecated": false, "isRequired": true @@ -8454,7 +8454,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1551 + "lineNumber": 1550 }, "deprecated": false, "children": [ @@ -8470,7 +8470,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1552 + "lineNumber": 1551 }, "deprecated": false, "isRequired": true @@ -8487,7 +8487,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1553 + "lineNumber": 1552 }, "deprecated": false, "isRequired": true @@ -8510,7 +8510,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1554 + "lineNumber": 1553 }, "deprecated": false, "isRequired": true @@ -8550,7 +8550,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1662 + "lineNumber": 1661 }, "deprecated": false, "children": [ @@ -8568,7 +8568,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1663 + "lineNumber": 1662 }, "deprecated": false, "isRequired": true @@ -8587,7 +8587,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1664 + "lineNumber": 1663 }, "deprecated": false, "isRequired": true @@ -8614,7 +8614,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1665 + "lineNumber": 1664 }, "deprecated": false, "isRequired": true @@ -8640,7 +8640,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1666 + "lineNumber": 1665 }, "deprecated": false, "isRequired": true @@ -8683,7 +8683,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1822 + "lineNumber": 1821 }, "deprecated": false, "children": [ @@ -8699,7 +8699,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1823 + "lineNumber": 1822 }, "deprecated": false, "isRequired": true @@ -8722,7 +8722,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1824 + "lineNumber": 1823 }, "deprecated": false, "isRequired": true @@ -8762,7 +8762,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1895 + "lineNumber": 1890 }, "deprecated": false, "children": [ @@ -8778,7 +8778,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1896 + "lineNumber": 1891 }, "deprecated": false, "isRequired": true @@ -8804,7 +8804,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1897 + "lineNumber": 1892 }, "deprecated": false, "isRequired": false @@ -8852,7 +8852,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1951 + "lineNumber": 1946 }, "deprecated": false, "children": [ @@ -8876,7 +8876,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1952 + "lineNumber": 1947 }, "deprecated": false, "isRequired": true @@ -8900,7 +8900,7 @@ ], "source": { "path": "src/core/server/saved_objects/service/lib/repository.ts", - "lineNumber": 1953 + "lineNumber": 1948 }, "deprecated": false, "isRequired": false @@ -11724,207 +11724,6 @@ ], "initialIsOpen": false }, - { - "parentPluginId": "core", - "id": "def-server.SavedObjectsComplexFieldMapping", - "type": "Interface", - "tags": [], - "label": "SavedObjectsComplexFieldMapping", - "description": [ - "\nSee {@link SavedObjectsFieldMapping} for documentation.\n" - ], - "source": { - "path": "src/core/server/saved_objects/mappings/types.ts", - "lineNumber": 141 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "core", - "id": "def-server.SavedObjectsComplexFieldMapping.dynamic", - "type": "CompoundType", - "tags": [], - "label": "dynamic", - "description": [ - "\nThe dynamic property of the mapping, either `false` or `'strict'`. If\nunspecified `dynamic: 'strict'` will be inherited from the top-level\nindex mappings.\n\nNote: To limit the number of mapping fields Saved Object types should\n*never* use `dynamic: true`." - ], - "signature": [ - "false | \"strict\" | undefined" - ], - "source": { - "path": "src/core/server/saved_objects/mappings/types.ts", - "lineNumber": 150 - }, - "deprecated": false - }, - { - "parentPluginId": "core", - "id": "def-server.SavedObjectsComplexFieldMapping.enabled", - "type": "CompoundType", - "tags": [], - "label": "enabled", - "description": [], - "signature": [ - "boolean | undefined" - ], - "source": { - "path": "src/core/server/saved_objects/mappings/types.ts", - "lineNumber": 151 - }, - "deprecated": false - }, - { - "parentPluginId": "core", - "id": "def-server.SavedObjectsComplexFieldMapping.doc_values", - "type": "CompoundType", - "tags": [], - "label": "doc_values", - "description": [], - "signature": [ - "boolean | undefined" - ], - "source": { - "path": "src/core/server/saved_objects/mappings/types.ts", - "lineNumber": 152 - }, - "deprecated": false - }, - { - "parentPluginId": "core", - "id": "def-server.SavedObjectsComplexFieldMapping.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string | undefined" - ], - "source": { - "path": "src/core/server/saved_objects/mappings/types.ts", - "lineNumber": 153 - }, - "deprecated": false - }, - { - "parentPluginId": "core", - "id": "def-server.SavedObjectsComplexFieldMapping.properties", - "type": "Object", - "tags": [], - "label": "properties", - "description": [], - "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreSavedObjectsPluginApi", - "section": "def-server.SavedObjectsMappingProperties", - "text": "SavedObjectsMappingProperties" - } - ], - "source": { - "path": "src/core/server/saved_objects/mappings/types.ts", - "lineNumber": 154 - }, - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "core", - "id": "def-server.SavedObjectsCoreFieldMapping", - "type": "Interface", - "tags": [], - "label": "SavedObjectsCoreFieldMapping", - "description": [ - "\nSee {@link SavedObjectsFieldMapping} for documentation.\n" - ], - "source": { - "path": "src/core/server/saved_objects/mappings/types.ts", - "lineNumber": 123 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "core", - "id": "def-server.SavedObjectsCoreFieldMapping.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "source": { - "path": "src/core/server/saved_objects/mappings/types.ts", - "lineNumber": 124 - }, - "deprecated": false - }, - { - "parentPluginId": "core", - "id": "def-server.SavedObjectsCoreFieldMapping.null_value", - "type": "CompoundType", - "tags": [], - "label": "null_value", - "description": [], - "signature": [ - "string | number | boolean | undefined" - ], - "source": { - "path": "src/core/server/saved_objects/mappings/types.ts", - "lineNumber": 125 - }, - "deprecated": false - }, - { - "parentPluginId": "core", - "id": "def-server.SavedObjectsCoreFieldMapping.index", - "type": "CompoundType", - "tags": [], - "label": "index", - "description": [], - "signature": [ - "boolean | undefined" - ], - "source": { - "path": "src/core/server/saved_objects/mappings/types.ts", - "lineNumber": 126 - }, - "deprecated": false - }, - { - "parentPluginId": "core", - "id": "def-server.SavedObjectsCoreFieldMapping.doc_values", - "type": "CompoundType", - "tags": [], - "label": "doc_values", - "description": [], - "signature": [ - "boolean | undefined" - ], - "source": { - "path": "src/core/server/saved_objects/mappings/types.ts", - "lineNumber": 127 - }, - "deprecated": false - }, - { - "parentPluginId": "core", - "id": "def-server.SavedObjectsCoreFieldMapping.fields", - "type": "Object", - "tags": [], - "label": "fields", - "description": [], - "signature": [ - "{ [subfield: string]: { type: string; ignore_above?: number | undefined; }; } | undefined" - ], - "source": { - "path": "src/core/server/saved_objects/mappings/types.ts", - "lineNumber": 128 - }, - "deprecated": false - } - ], - "initialIsOpen": false - }, { "parentPluginId": "core", "id": "def-server.SavedObjectsCreateOptions", @@ -12867,7 +12666,7 @@ ], "signature": [ "Record | undefined" ], "source": { @@ -14372,7 +14171,7 @@ ], "source": { "path": "src/core/server/saved_objects/mappings/types.ts", - "lineNumber": 87 + "lineNumber": 88 }, "deprecated": false, "children": [ @@ -14388,7 +14187,7 @@ ], "source": { "path": "src/core/server/saved_objects/mappings/types.ts", - "lineNumber": 88 + "lineNumber": 89 }, "deprecated": false } @@ -14507,15 +14306,15 @@ { "plugin": "lens", "link": { - "path": "x-pack/plugins/lens/server/migrations.ts", - "lineNumber": 245 + "path": "x-pack/plugins/lens/server/migrations/saved_object_migrations.ts", + "lineNumber": 167 } }, { "plugin": "lens", "link": { - "path": "x-pack/plugins/lens/server/migrations.ts", - "lineNumber": 312 + "path": "x-pack/plugins/lens/server/migrations/saved_object_migrations.ts", + "lineNumber": 234 } } ], @@ -16944,7 +16743,7 @@ ], "source": { "path": "src/core/server/saved_objects/mappings/types.ts", - "lineNumber": 36 + "lineNumber": 37 }, "deprecated": false, "children": [ @@ -16962,7 +16761,7 @@ ], "source": { "path": "src/core/server/saved_objects/mappings/types.ts", - "lineNumber": 40 + "lineNumber": 41 }, "deprecated": false }, @@ -16986,7 +16785,7 @@ ], "source": { "path": "src/core/server/saved_objects/mappings/types.ts", - "lineNumber": 42 + "lineNumber": 43 }, "deprecated": false } @@ -17426,7 +17225,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 31 + "lineNumber": 30 }, "deprecated": false, "initialIsOpen": false @@ -18404,7 +18203,7 @@ "description": [], "signature": [ "{ type: string | string[]; filter?: any; aggs?: Record | undefined; fields?: string[] | undefined; perPage?: number | undefined; sortField?: string | undefined; sortOrder?: \"asc\" | \"desc\" | \"_doc\" | undefined; search?: string | undefined; searchFields?: string[] | undefined; rootSearchFields?: string[] | undefined; hasReference?: ", { "pluginId": "core", @@ -18473,25 +18272,81 @@ "\nDescribe a {@link SavedObjectsTypeMappingDefinition | saved object type mapping} field.\n\nPlease refer to {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html | elasticsearch documentation}\nFor the mapping documentation\n" ], "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreSavedObjectsPluginApi", - "section": "def-server.SavedObjectsComplexFieldMapping", - "text": "SavedObjectsComplexFieldMapping" - }, - " | ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreSavedObjectsPluginApi", - "section": "def-server.SavedObjectsCoreFieldMapping", - "text": "SavedObjectsCoreFieldMapping" - } + "(", + "MappingFlattenedProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingJoinProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingPercolatorProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingRankFeatureProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingRankFeaturesProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingConstantKeywordProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingFieldAliasProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingHistogramProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingObjectProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingNestedProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingSearchAsYouTypeProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingTextProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingBinaryProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingBooleanProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingDateProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingDateNanosProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingKeywordProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingNumberProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingLongRangeProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingIpRangeProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingIntegerRangeProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingFloatRangeProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingDoubleRangeProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingDateRangeProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingGeoPointProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingGeoShapeProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingCompletionProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingGenericProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingIpProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingMurmur3HashProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingShapeProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingTokenCountProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingVersionProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingWildcardProperty", + " & { dynamic?: false | \"strict\" | undefined; }) | (", + "MappingPointProperty", + " & { dynamic?: false | \"strict\" | undefined; })" ], "source": { "path": "src/core/server/saved_objects/mappings/types.ts", - "lineNumber": 99 + "lineNumber": 100 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/core_saved_objects.mdx b/api_docs/core_saved_objects.mdx index d534853f7f29db..fd3f96e081c9e3 100644 --- a/api_docs/core_saved_objects.mdx +++ b/api_docs/core_saved_objects.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import coreSavedObjectsObj from './core_saved_objects.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 2273 | 148 | 1052 | 26 | + ## Client ### Classes diff --git a/api_docs/dashboard.json b/api_docs/dashboard.json index 9c3dccb95bc07c..821d298ea1309e 100644 --- a/api_docs/dashboard.json +++ b/api_docs/dashboard.json @@ -47,7 +47,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 105 + "lineNumber": 87 }, "deprecated": false, "children": [ @@ -63,31 +63,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 106 - }, - "deprecated": false - }, - { - "parentPluginId": "dashboard", - "id": "def-public.DashboardContainer.switchViewMode", - "type": "Function", - "tags": [], - "label": "switchViewMode", - "description": [], - "signature": [ - "((newViewMode: ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.ViewMode", - "text": "ViewMode" - }, - ") => void) | undefined" - ], - "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 107 + "lineNumber": 88 }, "deprecated": false }, @@ -103,7 +79,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 109 + "lineNumber": 90 }, "deprecated": false, "children": [], @@ -121,7 +97,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 113 + "lineNumber": 94 }, "deprecated": false, "children": [ @@ -143,7 +119,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 114 + "lineNumber": 95 }, "deprecated": false, "isRequired": true @@ -160,7 +136,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 115 + "lineNumber": 96 }, "deprecated": false, "isRequired": true @@ -200,7 +176,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 116 + "lineNumber": 97 }, "deprecated": false, "isRequired": false @@ -248,7 +224,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 129 + "lineNumber": 110 }, "deprecated": false, "children": [ @@ -273,7 +249,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 133 + "lineNumber": 114 }, "deprecated": false, "isRequired": true @@ -290,7 +266,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 134 + "lineNumber": 115 }, "deprecated": false, "isRequired": true @@ -322,7 +298,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 140 + "lineNumber": 122 }, "deprecated": false, "children": [ @@ -346,7 +322,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 141 + "lineNumber": 123 }, "deprecated": false, "isRequired": true @@ -364,7 +340,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 142 + "lineNumber": 124 }, "deprecated": false, "isRequired": false @@ -381,7 +357,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 143 + "lineNumber": 125 }, "deprecated": false, "isRequired": false @@ -419,7 +395,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 181 + "lineNumber": 164 }, "deprecated": false, "children": [ @@ -444,7 +420,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 182 + "lineNumber": 165 }, "deprecated": false, "isRequired": true @@ -469,7 +445,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 183 + "lineNumber": 166 }, "deprecated": false, "isRequired": true @@ -486,7 +462,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 184 + "lineNumber": 167 }, "deprecated": false, "isRequired": false @@ -562,7 +538,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 228 + "lineNumber": 211 }, "deprecated": false, "children": [ @@ -578,7 +554,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 232 + "lineNumber": 215 }, "deprecated": false, "isRequired": true @@ -595,7 +571,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 232 + "lineNumber": 215 }, "deprecated": false, "isRequired": true @@ -612,7 +588,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 232 + "lineNumber": 215 }, "deprecated": false, "isRequired": false @@ -632,7 +608,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 246 + "lineNumber": 229 }, "deprecated": false, "children": [ @@ -648,7 +624,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 246 + "lineNumber": 229 }, "deprecated": false, "isRequired": true @@ -669,7 +645,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 259 + "lineNumber": 242 }, "deprecated": false, "children": [ @@ -685,7 +661,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 259 + "lineNumber": 242 }, "deprecated": false, "isRequired": true @@ -749,7 +725,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 34 + "lineNumber": 32 }, "deprecated": false, "children": [ @@ -765,7 +741,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 37 + "lineNumber": 35 }, "deprecated": false }, @@ -781,7 +757,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 38 + "lineNumber": 36 }, "deprecated": false }, @@ -797,7 +773,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 40 + "lineNumber": 38 }, "deprecated": false, "children": [ @@ -815,7 +791,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 41 + "lineNumber": 39 }, "deprecated": false, "isRequired": true @@ -838,7 +814,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 42 + "lineNumber": 40 }, "deprecated": false, "isRequired": true @@ -858,7 +834,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 45 + "lineNumber": 43 }, "deprecated": false, "children": [], @@ -876,7 +852,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 50 + "lineNumber": 48 }, "deprecated": false, "children": [], @@ -902,7 +878,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 56 + "lineNumber": 54 }, "deprecated": false, "children": [], @@ -968,7 +944,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 66 + "lineNumber": 64 }, "deprecated": false, "children": [ @@ -990,7 +966,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 67 + "lineNumber": 65 }, "deprecated": false, "isRequired": true @@ -1030,7 +1006,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 68 + "lineNumber": 66 }, "deprecated": false, "isRequired": false @@ -1067,7 +1043,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 74 + "lineNumber": 72 }, "deprecated": false, "returnComment": [], @@ -1137,7 +1113,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 76 + "lineNumber": 74 }, "deprecated": false, "returnComment": [], @@ -1177,7 +1153,7 @@ ], "source": { "path": "src/plugins/dashboard/public/dashboard_constants.ts", - "lineNumber": 22 + "lineNumber": 24 }, "deprecated": false, "children": [ @@ -1193,7 +1169,7 @@ ], "source": { "path": "src/plugins/dashboard/public/dashboard_constants.ts", - "lineNumber": 22 + "lineNumber": 24 }, "deprecated": false, "isRequired": false @@ -1210,7 +1186,7 @@ ], "source": { "path": "src/plugins/dashboard/public/dashboard_constants.ts", - "lineNumber": 22 + "lineNumber": 24 }, "deprecated": false, "isRequired": false @@ -1308,8 +1284,8 @@ "<{}>" ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 43 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 72 }, "deprecated": false, "children": [ @@ -1321,12 +1297,12 @@ "label": "dashboardCapabilities", "description": [], "signature": [ - "DashboardCapabilities", + "DashboardAppCapabilities", " | undefined" ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 44 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 73 }, "deprecated": false }, @@ -1348,8 +1324,8 @@ " | undefined" ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 45 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 74 }, "deprecated": false }, @@ -1364,8 +1340,8 @@ "boolean | undefined" ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 46 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 75 }, "deprecated": false }, @@ -1377,8 +1353,8 @@ "label": "isFullScreenMode", "description": [], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 47 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 76 }, "deprecated": false }, @@ -1393,8 +1369,8 @@ "string | undefined" ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 48 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 77 }, "deprecated": false }, @@ -1409,8 +1385,8 @@ "{ from: string; to: string; mode?: \"absolute\" | \"relative\" | undefined; }" ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 49 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 78 }, "deprecated": false }, @@ -1425,8 +1401,8 @@ "string | undefined" ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 50 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 79 }, "deprecated": false }, @@ -1438,8 +1414,8 @@ "label": "useMargins", "description": [], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 51 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 80 }, "deprecated": false }, @@ -1454,8 +1430,8 @@ "boolean | undefined" ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 52 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 81 }, "deprecated": false }, @@ -1476,8 +1452,8 @@ } ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 53 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 82 }, "deprecated": false }, @@ -1499,8 +1475,8 @@ "[]" ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 54 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 83 }, "deprecated": false }, @@ -1512,8 +1488,8 @@ "label": "title", "description": [], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 55 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 84 }, "deprecated": false }, @@ -1528,8 +1504,8 @@ "{ query: string | { [key: string]: any; }; language: string; }" ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 56 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 85 }, "deprecated": false }, @@ -1554,8 +1530,8 @@ " & { [k: string]: unknown; }>; }" ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 57 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 86 }, "deprecated": false } @@ -1571,7 +1547,7 @@ "description": [], "source": { "path": "src/plugins/dashboard/public/plugin.tsx", - "lineNumber": 91 + "lineNumber": 92 }, "deprecated": false, "children": [ @@ -1584,7 +1560,7 @@ "description": [], "source": { "path": "src/plugins/dashboard/public/plugin.tsx", - "lineNumber": 92 + "lineNumber": 93 }, "deprecated": false } @@ -1617,7 +1593,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 18 + "lineNumber": 19 }, "deprecated": false, "children": [ @@ -1633,7 +1609,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 19 + "lineNumber": 20 }, "deprecated": false }, @@ -1646,7 +1622,7 @@ "description": [], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 20 + "lineNumber": 21 }, "deprecated": false }, @@ -1662,7 +1638,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 21 + "lineNumber": 22 }, "deprecated": false }, @@ -1678,7 +1654,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 22 + "lineNumber": 23 }, "deprecated": false }, @@ -1694,7 +1670,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 23 + "lineNumber": 24 }, "deprecated": false }, @@ -1707,7 +1683,7 @@ "description": [], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 24 + "lineNumber": 25 }, "deprecated": false }, @@ -1723,7 +1699,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 25 + "lineNumber": 26 }, "deprecated": false }, @@ -1739,7 +1715,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 27 + "lineNumber": 28 }, "deprecated": false }, @@ -1752,7 +1728,7 @@ "description": [], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 28 + "lineNumber": 29 }, "deprecated": false }, @@ -1775,7 +1751,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 29 + "lineNumber": 30 }, "deprecated": false }, @@ -1967,7 +1943,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 30 + "lineNumber": 31 }, "deprecated": false }, @@ -1990,7 +1966,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 31 + "lineNumber": 32 }, "deprecated": false, "children": [], @@ -2016,7 +1992,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 32 + "lineNumber": 33 }, "deprecated": false, "children": [], @@ -2034,7 +2010,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 33 + "lineNumber": 34 }, "deprecated": false, "returnComment": [], @@ -2051,7 +2027,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 33 + "lineNumber": 34 }, "deprecated": false } @@ -2372,7 +2348,7 @@ ], "source": { "path": "src/plugins/dashboard/public/plugin.tsx", - "lineNumber": 89 + "lineNumber": 90 }, "deprecated": false, "initialIsOpen": false @@ -2399,7 +2375,7 @@ ], "source": { "path": "src/plugins/dashboard/common/types.ts", - "lineNumber": 38 + "lineNumber": 46 }, "deprecated": false, "initialIsOpen": false @@ -2522,6 +2498,32 @@ "lineNumber": 19 }, "deprecated": false + }, + { + "parentPluginId": "dashboard", + "id": "def-public.DashboardConstants.CHANGE_CHECK_DEBOUNCE", + "type": "number", + "tags": [], + "label": "CHANGE_CHECK_DEBOUNCE", + "description": [], + "source": { + "path": "src/plugins/dashboard/public/dashboard_constants.ts", + "lineNumber": 20 + }, + "deprecated": false + }, + { + "parentPluginId": "dashboard", + "id": "def-public.DashboardConstants.CHANGE_APPLY_DEBOUNCE", + "type": "number", + "tags": [], + "label": "CHANGE_APPLY_DEBOUNCE", + "description": [], + "source": { + "path": "src/plugins/dashboard/public/dashboard_constants.ts", + "lineNumber": 21 + }, + "deprecated": false } ], "initialIsOpen": false @@ -2539,7 +2541,7 @@ ], "source": { "path": "src/plugins/dashboard/public/plugin.tsx", - "lineNumber": 123 + "lineNumber": 124 }, "deprecated": false, "lifecycle": "setup", @@ -2554,7 +2556,7 @@ "description": [], "source": { "path": "src/plugins/dashboard/public/plugin.tsx", - "lineNumber": 125 + "lineNumber": 126 }, "deprecated": false, "children": [ @@ -2577,7 +2579,7 @@ ], "source": { "path": "src/plugins/dashboard/public/plugin.tsx", - "lineNumber": 126 + "lineNumber": 127 }, "deprecated": false, "returnComment": [], @@ -2595,7 +2597,7 @@ ], "source": { "path": "src/plugins/dashboard/public/plugin.tsx", - "lineNumber": 127 + "lineNumber": 128 }, "deprecated": false, "returnComment": [], @@ -2620,7 +2622,7 @@ ], "source": { "path": "src/plugins/dashboard/public/plugin.tsx", - "lineNumber": 130 + "lineNumber": 131 }, "deprecated": false }, @@ -2642,7 +2644,7 @@ ], "source": { "path": "src/plugins/dashboard/public/plugin.tsx", - "lineNumber": 131 + "lineNumber": 132 }, "deprecated": false } @@ -2983,7 +2985,7 @@ ], "source": { "path": "src/plugins/dashboard/common/types.ts", - "lineNumber": 91 + "lineNumber": 99 }, "deprecated": false, "children": [ @@ -3009,7 +3011,7 @@ ], "source": { "path": "src/plugins/dashboard/common/types.ts", - "lineNumber": 92 + "lineNumber": 100 }, "deprecated": false } @@ -3184,7 +3186,7 @@ ], "source": { "path": "src/plugins/dashboard/common/types.ts", - "lineNumber": 64 + "lineNumber": 72 }, "deprecated": false, "initialIsOpen": false @@ -3203,7 +3205,7 @@ ], "source": { "path": "src/plugins/dashboard/common/types.ts", - "lineNumber": 56 + "lineNumber": 64 }, "deprecated": false, "initialIsOpen": false @@ -3222,7 +3224,7 @@ ], "source": { "path": "src/plugins/dashboard/common/types.ts", - "lineNumber": 48 + "lineNumber": 56 }, "deprecated": false, "initialIsOpen": false @@ -3241,7 +3243,7 @@ ], "source": { "path": "src/plugins/dashboard/common/types.ts", - "lineNumber": 40 + "lineNumber": 48 }, "deprecated": false, "initialIsOpen": false @@ -3266,7 +3268,7 @@ ], "source": { "path": "src/plugins/dashboard/common/types.ts", - "lineNumber": 81 + "lineNumber": 89 }, "deprecated": false, "initialIsOpen": false @@ -3285,7 +3287,7 @@ ], "source": { "path": "src/plugins/dashboard/common/types.ts", - "lineNumber": 72 + "lineNumber": 80 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/dashboard.mdx b/api_docs/dashboard.mdx index bddd6f91796fc7..de34ce88a77be5 100644 --- a/api_docs/dashboard.mdx +++ b/api_docs/dashboard.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import dashboardObj from './dashboard.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 145 | 1 | 133 | 9 | + ## Client ### Setup diff --git a/api_docs/dashboard_enhanced.json b/api_docs/dashboard_enhanced.json index 30daac1b263957..b1ce19250a597d 100644 --- a/api_docs/dashboard_enhanced.json +++ b/api_docs/dashboard_enhanced.json @@ -684,6 +684,8 @@ }, ") => void; } & { urlGenerators: ", "UrlGeneratorsSetup", + "; url: ", + "UrlService", "; }" ], "source": { @@ -792,6 +794,8 @@ }, ") => void; } & { urlGenerators: ", "UrlGeneratorsStart", + "; url: ", + "UrlService", "; }" ], "source": { diff --git a/api_docs/dashboard_enhanced.mdx b/api_docs/dashboard_enhanced.mdx index 1ef8820befc41c..4af7f6f96cf23c 100644 --- a/api_docs/dashboard_enhanced.mdx +++ b/api_docs/dashboard_enhanced.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import dashboardEnhancedObj from './dashboard_enhanced.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 51 | 0 | 50 | 0 | + ## Client ### Setup diff --git a/api_docs/dashboard_mode.mdx b/api_docs/dashboard_mode.mdx index 2108754adbd5db..28b68e29bd5f26 100644 --- a/api_docs/dashboard_mode.mdx +++ b/api_docs/dashboard_mode.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import dashboardModeObj from './dashboard_mode.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 11 | 0 | 11 | 0 | + ## Server ### Classes diff --git a/api_docs/data.json b/api_docs/data.json index 1ba62ea9946549..993dcec522d5e8 100644 --- a/api_docs/data.json +++ b/api_docs/data.json @@ -11,7 +11,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 55 + "lineNumber": 57 }, "deprecated": false, "children": [ @@ -31,7 +31,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 63 + "lineNumber": 65 }, "deprecated": false, "children": [ @@ -49,7 +49,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 63 + "lineNumber": 65 }, "deprecated": false, "isRequired": true @@ -83,7 +83,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 83 + "lineNumber": 85 }, "deprecated": false, "children": [ @@ -106,7 +106,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 83 + "lineNumber": 85 }, "deprecated": false, "isRequired": true @@ -134,7 +134,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 92 + "lineNumber": 94 }, "deprecated": false }, @@ -147,7 +147,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 93 + "lineNumber": 95 }, "deprecated": false }, @@ -160,7 +160,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 94 + "lineNumber": 96 }, "deprecated": false }, @@ -176,7 +176,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 95 + "lineNumber": 97 }, "deprecated": false }, @@ -199,7 +199,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 96 + "lineNumber": 98 }, "deprecated": false }, @@ -215,7 +215,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 97 + "lineNumber": 99 }, "deprecated": false }, @@ -231,7 +231,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 98 + "lineNumber": 100 }, "deprecated": false }, @@ -247,7 +247,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 104 + "lineNumber": 106 }, "deprecated": false, "children": [ @@ -269,7 +269,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 104 + "lineNumber": 106 }, "deprecated": false, "isRequired": true @@ -304,7 +304,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 104 + "lineNumber": 106 }, "deprecated": false, "isRequired": true @@ -328,7 +328,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 134 + "lineNumber": 136 }, "deprecated": false, "children": [ @@ -346,7 +346,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 134 + "lineNumber": 136 }, "deprecated": false, "isRequired": true @@ -366,7 +366,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 171 + "lineNumber": 173 }, "deprecated": false, "children": [ @@ -382,7 +382,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 171 + "lineNumber": 173 }, "deprecated": false, "isRequired": true @@ -390,6 +390,42 @@ ], "returnComment": [] }, + { + "parentPluginId": "data", + "id": "def-public.AggConfig.hasTimeShift", + "type": "Function", + "tags": [], + "label": "hasTimeShift", + "description": [], + "signature": [ + "() => boolean" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_config.ts", + "lineNumber": 177 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-public.AggConfig.getTimeShift", + "type": "Function", + "tags": [], + "label": "getTimeShift", + "description": [], + "signature": [ + "() => moment.Duration | undefined" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_config.ts", + "lineNumber": 181 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, { "parentPluginId": "data", "id": "def-public.AggConfig.write", @@ -410,7 +446,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 175 + "lineNumber": 202 }, "deprecated": false, "children": [ @@ -433,7 +469,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 175 + "lineNumber": 202 }, "deprecated": false, "isRequired": false @@ -453,7 +489,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 179 + "lineNumber": 206 }, "deprecated": false, "children": [], @@ -471,7 +507,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 183 + "lineNumber": 210 }, "deprecated": false, "children": [ @@ -487,7 +523,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 183 + "lineNumber": 210 }, "deprecated": false, "isRequired": true @@ -504,7 +540,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 183 + "lineNumber": 210 }, "deprecated": false, "isRequired": true @@ -544,7 +580,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 209 + "lineNumber": 236 }, "deprecated": false, "children": [ @@ -568,7 +604,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 209 + "lineNumber": 236 }, "deprecated": false, "isRequired": true @@ -592,7 +628,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 209 + "lineNumber": 236 }, "deprecated": false, "isRequired": false @@ -624,7 +660,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 230 + "lineNumber": 257 }, "deprecated": false, "children": [ @@ -649,7 +685,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 230 + "lineNumber": 257 }, "deprecated": false, "isRequired": false @@ -673,7 +709,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 265 + "lineNumber": 292 }, "deprecated": false, "children": [], @@ -697,7 +733,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 296 + "lineNumber": 323 }, "deprecated": true, "references": [ @@ -726,7 +762,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 307 + "lineNumber": 334 }, "deprecated": false, "children": [], @@ -752,7 +788,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 316 + "lineNumber": 343 }, "deprecated": false, "children": [], @@ -788,7 +824,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 371 + "lineNumber": 398 }, "deprecated": false, "children": [], @@ -814,7 +850,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 375 + "lineNumber": 402 }, "deprecated": false, "children": [], @@ -840,7 +876,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 379 + "lineNumber": 406 }, "deprecated": false, "children": [], @@ -858,7 +894,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 383 + "lineNumber": 410 }, "deprecated": false, "children": [ @@ -874,7 +910,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 383 + "lineNumber": 410 }, "deprecated": false, "isRequired": true @@ -894,7 +930,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 387 + "lineNumber": 414 }, "deprecated": false, "children": [ @@ -910,7 +946,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 387 + "lineNumber": 414 }, "deprecated": false, "isRequired": true @@ -927,7 +963,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 387 + "lineNumber": 414 }, "deprecated": false, "isRequired": false @@ -947,7 +983,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 395 + "lineNumber": 422 }, "deprecated": false, "children": [], @@ -965,7 +1001,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 401 + "lineNumber": 428 }, "deprecated": false, "children": [], @@ -985,7 +1021,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 410 + "lineNumber": 437 }, "deprecated": false, "children": [], @@ -1003,7 +1039,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 414 + "lineNumber": 441 }, "deprecated": false, "children": [ @@ -1019,7 +1055,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 414 + "lineNumber": 441 }, "deprecated": false, "isRequired": true @@ -1046,7 +1082,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 428 + "lineNumber": 455 }, "deprecated": false, "children": [], @@ -1072,7 +1108,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 432 + "lineNumber": 459 }, "deprecated": false, "children": [], @@ -1090,7 +1126,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 436 + "lineNumber": 463 }, "deprecated": false, "children": [], @@ -1108,7 +1144,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 441 + "lineNumber": 468 }, "deprecated": false, "children": [], @@ -1157,7 +1193,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 452 + "lineNumber": 479 }, "deprecated": false }, @@ -1204,7 +1240,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 456 + "lineNumber": 483 }, "deprecated": false }, @@ -1228,7 +1264,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 486 + "lineNumber": 513 }, "deprecated": false, "children": [ @@ -1250,7 +1286,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 486 + "lineNumber": 513 }, "deprecated": false, "isRequired": true @@ -1270,7 +1306,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 65 + "lineNumber": 78 }, "deprecated": false, "children": [ @@ -1292,7 +1328,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 66 + "lineNumber": 79 }, "deprecated": false }, @@ -1315,7 +1351,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 67 + "lineNumber": 80 }, "deprecated": false }, @@ -1331,7 +1367,23 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 68 + "lineNumber": 81 + }, + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.AggConfigs.forceNow", + "type": "Object", + "tags": [], + "label": "forceNow", + "description": [], + "signature": [ + "Date | undefined" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 82 }, "deprecated": false }, @@ -1347,7 +1399,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 69 + "lineNumber": 83 }, "deprecated": false }, @@ -1370,7 +1422,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 73 + "lineNumber": 87 }, "deprecated": false }, @@ -1386,7 +1438,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 75 + "lineNumber": 89 }, "deprecated": false, "children": [ @@ -1408,7 +1460,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 76 + "lineNumber": 90 }, "deprecated": false, "isRequired": true @@ -1443,7 +1495,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 77 + "lineNumber": 91 }, "deprecated": false, "isRequired": true @@ -1466,7 +1518,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 78 + "lineNumber": 92 }, "deprecated": false, "isRequired": true @@ -1486,7 +1538,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 91 + "lineNumber": 105 }, "deprecated": false, "children": [ @@ -1502,7 +1554,43 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 91 + "lineNumber": 105 + }, + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-public.AggConfigs.setForceNow", + "type": "Function", + "tags": [], + "label": "setForceNow", + "description": [], + "signature": [ + "(now: Date | undefined) => void" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 109 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.AggConfigs.setForceNow.$1", + "type": "Object", + "tags": [], + "label": "now", + "description": [], + "signature": [ + "Date | undefined" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 109 }, "deprecated": false, "isRequired": false @@ -1530,7 +1618,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 95 + "lineNumber": 113 }, "deprecated": false, "children": [ @@ -1552,7 +1640,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 95 + "lineNumber": 113 }, "deprecated": false, "isRequired": true @@ -1579,7 +1667,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 113 + "lineNumber": 131 }, "deprecated": false, "children": [ @@ -1595,7 +1683,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 113 + "lineNumber": 131 }, "deprecated": false, "isRequired": true @@ -1649,7 +1737,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 126 + "lineNumber": 144 }, "deprecated": false, "children": [ @@ -1683,7 +1771,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 127 + "lineNumber": 145 }, "deprecated": false, "isRequired": true @@ -1700,7 +1788,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 128 + "lineNumber": 146 }, "deprecated": false, "isRequired": true @@ -1730,7 +1818,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 169 + "lineNumber": 187 }, "deprecated": false, "children": [ @@ -1755,7 +1843,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 169 + "lineNumber": 187 }, "deprecated": false, "isRequired": true @@ -1775,7 +1863,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 181 + "lineNumber": 199 }, "deprecated": false, "children": [], @@ -1801,7 +1889,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 250 + "lineNumber": 289 }, "deprecated": false, "children": [], @@ -1826,7 +1914,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 254 + "lineNumber": 293 }, "deprecated": false, "children": [ @@ -1842,7 +1930,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 254 + "lineNumber": 293 }, "deprecated": false, "isRequired": true @@ -1870,7 +1958,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 258 + "lineNumber": 297 }, "deprecated": false, "children": [ @@ -1886,7 +1974,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 258 + "lineNumber": 297 }, "deprecated": false, "isRequired": true @@ -1914,7 +2002,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 262 + "lineNumber": 301 }, "deprecated": false, "children": [ @@ -1930,7 +2018,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 262 + "lineNumber": 301 }, "deprecated": false, "isRequired": true @@ -1958,7 +2046,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 266 + "lineNumber": 305 }, "deprecated": false, "children": [ @@ -1974,7 +2062,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 266 + "lineNumber": 305 }, "deprecated": false, "isRequired": true @@ -2002,7 +2090,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 270 + "lineNumber": 309 }, "deprecated": false, "children": [ @@ -2018,7 +2106,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 270 + "lineNumber": 309 }, "deprecated": false, "isRequired": true @@ -2046,7 +2134,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 274 + "lineNumber": 313 }, "deprecated": false, "children": [ @@ -2062,7 +2150,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 274 + "lineNumber": 313 }, "deprecated": false, "isRequired": true @@ -2090,12 +2178,169 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 278 + "lineNumber": 317 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-public.AggConfigs.getTimeShifts", + "type": "Function", + "tags": [], + "label": "getTimeShifts", + "description": [], + "signature": [ + "() => Record" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 331 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-public.AggConfigs.getTimeShiftInterval", + "type": "Function", + "tags": [], + "label": "getTimeShiftInterval", + "description": [], + "signature": [ + "() => moment.Duration | undefined" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 346 }, "deprecated": false, "children": [], "returnComment": [] }, + { + "parentPluginId": "data", + "id": "def-public.AggConfigs.hasTimeShifts", + "type": "Function", + "tags": [], + "label": "hasTimeShifts", + "description": [], + "signature": [ + "() => boolean" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 353 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-public.AggConfigs.getSearchSourceTimeFilter", + "type": "Function", + "tags": [], + "label": "getSearchSourceTimeFilter", + "description": [], + "signature": [ + "(forceNow?: Date | undefined) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.RangeFilter", + "text": "RangeFilter" + }, + "[] | { meta: { index: string | undefined; params: {}; alias: string; disabled: boolean; negate: boolean; }; query: { bool: { should: { bool: { filter: { range: { [x: string]: { gte: string; lte: string; }; }; }[]; }; }[]; minimum_should_match: number; }; }; }[]" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 357 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.AggConfigs.getSearchSourceTimeFilter.$1", + "type": "Object", + "tags": [], + "label": "forceNow", + "description": [], + "signature": [ + "Date | undefined" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 357 + }, + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-public.AggConfigs.postFlightTransform", + "type": "Function", + "tags": [], + "label": "postFlightTransform", + "description": [], + "signature": [ + "(response: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IEsSearchResponse", + "text": "IEsSearchResponse" + }, + ") => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IEsSearchResponse", + "text": "IEsSearchResponse" + }, + "" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 410 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.AggConfigs.postFlightTransform.$1", + "type": "Object", + "tags": [], + "label": "response", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IEsSearchResponse", + "text": "IEsSearchResponse" + }, + "" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 410 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "data", "id": "def-public.AggConfigs.getRequestAggById", @@ -2116,7 +2361,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 292 + "lineNumber": 429 }, "deprecated": false, "children": [ @@ -2132,7 +2377,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 292 + "lineNumber": 429 }, "deprecated": false, "isRequired": true @@ -2164,7 +2409,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 307 + "lineNumber": 444 }, "deprecated": false, "children": [], @@ -2194,7 +2439,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 321 + "lineNumber": 458 }, "deprecated": false, "children": [ @@ -2212,7 +2457,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 321 + "lineNumber": 458 }, "deprecated": false, "isRequired": true @@ -2248,7 +2493,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 330 + "lineNumber": 467 }, "deprecated": false, "children": [ @@ -2272,7 +2517,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 330 + "lineNumber": 467 }, "deprecated": false, "isRequired": true @@ -2296,7 +2541,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 330 + "lineNumber": 467 }, "deprecated": false, "isRequired": false @@ -2530,7 +2775,7 @@ "section": "def-public.PluginInitializerContext", "text": "PluginInitializerContext" }, - "; }>; }>; autocomplete: Readonly<{} & { querySuggestions: Readonly<{} & { enabled: boolean; }>; valueSuggestions: Readonly<{} & { enabled: boolean; }>; }>; }>>" + "; }>; }>; autocomplete: Readonly<{} & { querySuggestions: Readonly<{} & { enabled: boolean; }>; valueSuggestions: Readonly<{} & { enabled: boolean; timeout: moment.Duration; terminateAfter: moment.Duration; }>; }>; }>>" ], "source": { "path": "src/plugins/data/public/plugin.ts", @@ -4008,7 +4253,9 @@ "parentPluginId": "data", "id": "def-public.IndexPattern.addScriptedField", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "addScriptedField", "description": [ "\nAdd scripted field to field list\n" @@ -4018,9 +4265,10 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, - "deprecated": false, + "deprecated": true, + "references": [], "children": [ { "parentPluginId": "data", @@ -4036,7 +4284,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, "deprecated": false, "isRequired": true @@ -4055,7 +4303,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, "deprecated": false, "isRequired": true @@ -4072,7 +4320,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, "deprecated": false, "isRequired": true @@ -4084,7 +4332,9 @@ "parentPluginId": "data", "id": "def-public.IndexPattern.removeScriptedField", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "removeScriptedField", "description": [ "\nRemove scripted field from field list" @@ -4094,9 +4344,25 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 270 + "lineNumber": 272 }, - "deprecated": false, + "deprecated": true, + "references": [ + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx", + "lineNumber": 117 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx", + "lineNumber": 778 + } + } + ], "children": [ { "parentPluginId": "data", @@ -4110,7 +4376,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 270 + "lineNumber": 272 }, "deprecated": false, "isRequired": true @@ -4122,9 +4388,13 @@ "parentPluginId": "data", "id": "def-public.IndexPattern.getNonScriptedFields", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "getNonScriptedFields", - "description": [], + "description": [ + "\n" + ], "signature": [ "() => ", { @@ -4138,9 +4408,74 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 277 + "lineNumber": 283 }, - "deprecated": false, + "deprecated": true, + "references": [ + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx", + "lineNumber": 152 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx", + "lineNumber": 66 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx", + "lineNumber": 74 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx", + "lineNumber": 204 + } + }, + { + "plugin": "visTypeTimeseries", + "link": { + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts", + "lineNumber": 65 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts", + "lineNumber": 106 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/state_management/datasource.test.ts", + "lineNumber": 29 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts", + "lineNumber": 122 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts", + "lineNumber": 244 + } + } + ], "children": [], "returnComment": [] }, @@ -4148,9 +4483,13 @@ "parentPluginId": "data", "id": "def-public.IndexPattern.getScriptedFields", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "getScriptedFields", - "description": [], + "description": [ + "\n" + ], "signature": [ "() => ", { @@ -4164,9 +4503,18 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 281 + "lineNumber": 291 }, - "deprecated": false, + "deprecated": true, + "references": [ + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx", + "lineNumber": 61 + } + } + ], "children": [], "returnComment": [] }, @@ -4182,7 +4530,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 285 + "lineNumber": 295 }, "deprecated": false, "children": [], @@ -4200,7 +4548,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 289 + "lineNumber": 299 }, "deprecated": false, "children": [], @@ -4226,7 +4574,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 294 + "lineNumber": 304 }, "deprecated": false, "children": [], @@ -4252,7 +4600,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 299 + "lineNumber": 309 }, "deprecated": false, "children": [ @@ -4268,7 +4616,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 299 + "lineNumber": 309 }, "deprecated": false, "isRequired": true @@ -4288,7 +4636,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 304 + "lineNumber": 314 }, "deprecated": false, "children": [], @@ -4304,11 +4652,18 @@ "\nReturns index pattern as saved object body for saving" ], "signature": [ - "() => { fieldAttrs: string | undefined; title: string; timeFieldName: string | undefined; intervalName: string | undefined; sourceFilters: string | undefined; fields: string | undefined; fieldFormatMap: string | undefined; type: string | undefined; typeMeta: string | undefined; allowNoIndex: true | undefined; runtimeFieldMap: string | undefined; }" + "() => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IndexPatternAttributes", + "text": "IndexPatternAttributes" + } ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 311 + "lineNumber": 321 }, "deprecated": false, "children": [], @@ -4359,7 +4714,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 339 + "lineNumber": 347 }, "deprecated": false, "children": [ @@ -4397,7 +4752,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 340 + "lineNumber": 348 }, "deprecated": false, "isRequired": true @@ -4427,7 +4782,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 360 + "lineNumber": 368 }, "deprecated": false, "children": [ @@ -4445,7 +4800,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 360 + "lineNumber": 368 }, "deprecated": false, "isRequired": true @@ -4470,7 +4825,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 360 + "lineNumber": 368 }, "deprecated": false, "isRequired": true @@ -4492,7 +4847,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 384 + "lineNumber": 392 }, "deprecated": false, "children": [ @@ -4510,7 +4865,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 384 + "lineNumber": 392 }, "deprecated": false, "isRequired": true @@ -4540,7 +4895,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 404 + "lineNumber": 412 }, "deprecated": false, "children": [ @@ -4556,7 +4911,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 404 + "lineNumber": 412 }, "deprecated": false, "isRequired": true @@ -4584,7 +4939,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 411 + "lineNumber": 419 }, "deprecated": false, "children": [ @@ -4600,7 +4955,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 412 + "lineNumber": 420 }, "deprecated": false, "isRequired": true @@ -4617,7 +4972,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 413 + "lineNumber": 421 }, "deprecated": false, "isRequired": true @@ -4641,7 +4996,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 414 + "lineNumber": 422 }, "deprecated": false, "isRequired": true @@ -4661,7 +5016,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 422 + "lineNumber": 430 }, "deprecated": false, "children": [ @@ -4677,7 +5032,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 422 + "lineNumber": 430 }, "deprecated": false, "isRequired": true @@ -4694,7 +5049,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 422 + "lineNumber": 430 }, "deprecated": false, "isRequired": false @@ -4714,7 +5069,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 433 + "lineNumber": 441 }, "deprecated": false, "children": [ @@ -4730,7 +5085,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 433 + "lineNumber": 441 }, "deprecated": false, "isRequired": true @@ -4747,7 +5102,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 433 + "lineNumber": 441 }, "deprecated": false, "isRequired": false @@ -4775,7 +5130,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 446 + "lineNumber": 454 }, "deprecated": false, "children": [ @@ -4791,7 +5146,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 446 + "lineNumber": 454 }, "deprecated": false, "isRequired": true @@ -4815,7 +5170,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 446 + "lineNumber": 454 }, "deprecated": false, "isRequired": true @@ -4835,7 +5190,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 450 + "lineNumber": 458 }, "deprecated": false, "children": [ @@ -4851,7 +5206,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 450 + "lineNumber": 458 }, "deprecated": false, "isRequired": true @@ -5067,14 +5422,14 @@ { "parentPluginId": "data", "id": "def-public.IndexPatternField.lang", - "type": "string", + "type": "CompoundType", "tags": [], "label": "lang", "description": [ "\nScript field language" ], "signature": [ - "string | undefined" + "\"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined" ], "source": { "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", @@ -5085,12 +5440,12 @@ { "parentPluginId": "data", "id": "def-public.IndexPatternField.lang", - "type": "string", + "type": "CompoundType", "tags": [], "label": "lang", "description": [], "signature": [ - "string | undefined" + "\"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined" ], "source": { "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", @@ -5377,7 +5732,7 @@ "label": "toJSON", "description": [], "signature": [ - "() => { count: number; script: string | undefined; lang: string | undefined; conflictDescriptions: Record | undefined; name: string; type: string; esTypes: string[] | undefined; scripted: boolean; searchable: boolean; aggregatable: boolean; readFromDocValues: boolean; subType: ", + "() => { count: number; script: string | undefined; lang: \"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined; conflictDescriptions: Record | undefined; name: string; type: string; esTypes: string[] | undefined; scripted: boolean; searchable: boolean; aggregatable: boolean; readFromDocValues: boolean; subType: ", { "pluginId": "data", "scope": "common", @@ -6331,7 +6686,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 473 + "lineNumber": 480 }, "deprecated": false, "children": [ @@ -6347,7 +6702,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 473 + "lineNumber": 480 }, "deprecated": false, "isRequired": true @@ -6385,7 +6740,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "children": [ @@ -6407,7 +6762,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "isRequired": true @@ -6424,7 +6779,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "isRequired": true @@ -6464,7 +6819,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "children": [ @@ -6486,7 +6841,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -6505,7 +6860,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -6524,7 +6879,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -6562,7 +6917,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "children": [ @@ -6584,7 +6939,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "isRequired": true @@ -6603,7 +6958,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "isRequired": true @@ -6633,7 +6988,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 558 + "lineNumber": 570 }, "deprecated": false, "children": [ @@ -6655,7 +7010,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 559 + "lineNumber": 571 }, "deprecated": false, "isRequired": true @@ -6672,7 +7027,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 560 + "lineNumber": 572 }, "deprecated": false, "isRequired": true @@ -6689,7 +7044,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 561 + "lineNumber": 573 }, "deprecated": false, "isRequired": true @@ -6711,7 +7066,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 644 + "lineNumber": 656 }, "deprecated": false, "children": [ @@ -6729,7 +7084,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 644 + "lineNumber": 656 }, "deprecated": false, "isRequired": true @@ -6850,7 +7205,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 121 + "lineNumber": 127 }, "deprecated": false, "children": [ @@ -6866,7 +7221,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 129 + "lineNumber": 135 }, "deprecated": false }, @@ -6882,7 +7237,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 133 + "lineNumber": 139 }, "deprecated": false, "children": [ @@ -6904,7 +7259,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 133 + "lineNumber": 139 }, "deprecated": false, "isRequired": true @@ -6927,7 +7282,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 133 + "lineNumber": 139 }, "deprecated": false, "isRequired": true @@ -6949,7 +7304,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 151 + "lineNumber": 157 }, "deprecated": false, "children": [ @@ -6965,7 +7320,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 151 + "lineNumber": 157 }, "deprecated": false, "isRequired": true @@ -6995,7 +7350,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 160 + "lineNumber": 166 }, "deprecated": false, "children": [ @@ -7013,7 +7368,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 160 + "lineNumber": 166 }, "deprecated": false, "isRequired": true @@ -7039,7 +7394,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 160 + "lineNumber": 166 }, "deprecated": false, "isRequired": true @@ -7061,7 +7416,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 172 + "lineNumber": 178 }, "deprecated": false, "children": [ @@ -7079,7 +7434,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 172 + "lineNumber": 178 }, "deprecated": false, "isRequired": true @@ -7111,7 +7466,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 183 + "lineNumber": 189 }, "deprecated": false, "children": [ @@ -7135,7 +7490,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 183 + "lineNumber": 189 }, "deprecated": false, "isRequired": true @@ -7157,7 +7512,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 191 + "lineNumber": 197 }, "deprecated": false, "children": [], @@ -7184,7 +7539,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 198 + "lineNumber": 204 }, "deprecated": false, "children": [], @@ -7212,7 +7567,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 205 + "lineNumber": 211 }, "deprecated": false, "children": [ @@ -7228,7 +7583,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 205 + "lineNumber": 211 }, "deprecated": false, "isRequired": true @@ -7245,7 +7600,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 205 + "lineNumber": 211 }, "deprecated": false, "isRequired": true @@ -7275,7 +7630,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 216 + "lineNumber": 222 }, "deprecated": false, "children": [ @@ -7291,7 +7646,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 216 + "lineNumber": 222 }, "deprecated": false, "isRequired": true @@ -7320,7 +7675,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 223 + "lineNumber": 229 }, "deprecated": true, "references": [ @@ -7328,14 +7683,14 @@ "plugin": "discover", "link": { "path": "src/plugins/discover/public/application/embeddable/search_embeddable.ts", - "lineNumber": 206 + "lineNumber": 207 } }, { "plugin": "discover", "link": { "path": "src/plugins/discover/public/application/embeddable/search_embeddable.ts", - "lineNumber": 212 + "lineNumber": 213 } } ], @@ -7363,7 +7718,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 230 + "lineNumber": 236 }, "deprecated": false, "children": [], @@ -7390,7 +7745,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 244 + "lineNumber": 250 }, "deprecated": false, "children": [ @@ -7406,7 +7761,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 244 + "lineNumber": 250 }, "deprecated": false, "isRequired": true @@ -7446,7 +7801,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 256 + "lineNumber": 262 }, "deprecated": false, "children": [ @@ -7472,7 +7827,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 256 + "lineNumber": 262 }, "deprecated": false, "isRequired": false @@ -7497,7 +7852,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 256 + "lineNumber": 262 }, "deprecated": false, "isRequired": true @@ -7531,7 +7886,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 266 + "lineNumber": 272 }, "deprecated": false, "children": [], @@ -7571,7 +7926,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 274 + "lineNumber": 280 }, "deprecated": false, "children": [ @@ -7593,7 +7948,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 275 + "lineNumber": 281 }, "deprecated": false, "isRequired": true @@ -7627,7 +7982,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 312 + "lineNumber": 318 }, "deprecated": true, "references": [ @@ -7638,13 +7993,6 @@ "lineNumber": 77 } }, - { - "plugin": "discover", - "link": { - "path": "src/plugins/discover/public/application/angular/context/api/anchor.ts", - "lineNumber": 57 - } - }, { "plugin": "maps", "link": { @@ -7686,7 +8034,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 312 + "lineNumber": 318 }, "deprecated": false, "isRequired": true @@ -7726,7 +8074,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 325 + "lineNumber": 331 }, "deprecated": false, "children": [ @@ -7758,7 +8106,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 326 + "lineNumber": 332 }, "deprecated": false, "isRequired": true @@ -7780,7 +8128,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 334 + "lineNumber": 340 }, "deprecated": false, "children": [], @@ -7802,7 +8150,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 342 + "lineNumber": 348 }, "deprecated": false, "children": [], @@ -7829,7 +8177,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 831 + "lineNumber": 848 }, "deprecated": false, "children": [ @@ -7845,7 +8193,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 831 + "lineNumber": 848 }, "deprecated": false, "isRequired": true @@ -7869,7 +8217,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 860 + "lineNumber": 877 }, "deprecated": false, "children": [], @@ -8816,7 +9164,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 195 + "lineNumber": 196 }, "deprecated": false, "children": [ @@ -8845,7 +9193,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".FILTER>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"geo_bounding_box\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"filter\">, \"enabled\" | \"id\" | \"filter\" | \"customLabel\" | \"schema\" | \"geo_bounding_box\" | \"json\">, ", + ".FILTER>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"geo_bounding_box\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"filter\">, \"enabled\" | \"id\" | \"filter\" | \"customLabel\" | \"schema\" | \"geo_bounding_box\" | \"json\" | \"timeShift\">, ", "AggExpressionType", ", ", { @@ -8869,7 +9217,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 196 + "lineNumber": 197 }, "deprecated": false }, @@ -8898,7 +9246,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".FILTERS>, \"enabled\" | \"id\" | \"schema\" | \"json\"> & Pick<{ filters?: string | undefined; }, \"filters\"> & Pick<{ filters?: string | undefined; }, never>, \"enabled\" | \"filters\" | \"id\" | \"schema\" | \"json\">, ", + ".FILTERS>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ filters?: string | undefined; }, \"filters\"> & Pick<{ filters?: string | undefined; }, never>, \"enabled\" | \"filters\" | \"id\" | \"schema\" | \"json\" | \"timeShift\">, ", "AggExpressionType", ", ", { @@ -8922,7 +9270,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 197 + "lineNumber": 198 }, "deprecated": false }, @@ -8975,7 +9323,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 198 + "lineNumber": 199 }, "deprecated": false }, @@ -9004,7 +9352,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".IP_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, \"ipRangeType\" | \"ranges\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"ipRangeType\" | \"ranges\">, ", + ".IP_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, \"ipRangeType\" | \"ranges\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ipRangeType\" | \"ranges\">, ", "AggExpressionType", ", ", { @@ -9028,7 +9376,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 199 + "lineNumber": 200 }, "deprecated": false }, @@ -9057,7 +9405,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".DATE_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"time_zone\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"ranges\" | \"time_zone\">, ", + ".DATE_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ranges\" | \"time_zone\">, ", "AggExpressionType", ", ", { @@ -9081,7 +9429,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 200 + "lineNumber": 201 }, "deprecated": false }, @@ -9110,7 +9458,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"ranges\">, ", + ".RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ranges\">, ", "AggExpressionType", ", ", { @@ -9134,7 +9482,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 201 + "lineNumber": 202 }, "deprecated": false }, @@ -9187,7 +9535,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 202 + "lineNumber": 203 }, "deprecated": false }, @@ -9216,7 +9564,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".GEOHASH_GRID>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\"> & Pick<{ boundingBox?: string | undefined; }, \"boundingBox\"> & Pick<{ boundingBox?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\" | \"boundingBox\">, ", + ".GEOHASH_GRID>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\"> & Pick<{ boundingBox?: string | undefined; }, \"boundingBox\"> & Pick<{ boundingBox?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\" | \"boundingBox\">, ", "AggExpressionType", ", ", { @@ -9240,7 +9588,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 203 + "lineNumber": 204 }, "deprecated": false }, @@ -9269,7 +9617,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, \"extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\" | \"extended_bounds\">, ", + ".HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, \"extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\" | \"extended_bounds\">, ", "AggExpressionType", ", ", { @@ -9293,7 +9641,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 204 + "lineNumber": 205 }, "deprecated": false }, @@ -9322,7 +9670,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".DATE_HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, \"timeRange\" | \"extended_bounds\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"timeRange\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"extended_bounds\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\">, ", + ".DATE_HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, \"timeRange\" | \"extended_bounds\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"timeRange\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"extended_bounds\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\">, ", "AggExpressionType", ", ", { @@ -9346,7 +9694,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 205 + "lineNumber": 206 }, "deprecated": false }, @@ -9375,11 +9723,11 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".TERMS>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"orderBy\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\"> & Pick<{ orderAgg?: ", + ".TERMS>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"orderBy\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\"> & Pick<{ orderAgg?: ", "AggExpressionType", " | undefined; }, \"orderAgg\"> & Pick<{ orderAgg?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"orderBy\" | \"orderAgg\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"orderBy\" | \"orderAgg\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\">, ", "AggExpressionType", ", ", { @@ -9403,7 +9751,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 206 + "lineNumber": 207 }, "deprecated": false }, @@ -9456,7 +9804,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 207 + "lineNumber": 208 }, "deprecated": false }, @@ -9485,7 +9833,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".AVG_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".AVG_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -9493,7 +9841,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -9517,7 +9865,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 208 + "lineNumber": 209 }, "deprecated": false }, @@ -9546,7 +9894,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".MAX_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".MAX_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -9554,7 +9902,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -9578,7 +9926,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 209 + "lineNumber": 210 }, "deprecated": false }, @@ -9607,7 +9955,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".MIN_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".MIN_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -9615,7 +9963,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -9639,7 +9987,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 210 + "lineNumber": 211 }, "deprecated": false }, @@ -9668,7 +10016,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".SUM_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".SUM_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -9676,7 +10024,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -9700,7 +10048,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 211 + "lineNumber": 212 }, "deprecated": false }, @@ -9729,7 +10077,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".FILTERED_METRIC>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".FILTERED_METRIC>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -9737,7 +10085,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -9761,7 +10109,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 212 + "lineNumber": 213 }, "deprecated": false }, @@ -9814,7 +10162,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 213 + "lineNumber": 214 }, "deprecated": false }, @@ -9867,7 +10215,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 214 + "lineNumber": 215 }, "deprecated": false }, @@ -9896,11 +10244,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".CUMULATIVE_SUM>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + ".CUMULATIVE_SUM>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", "AggExpressionType", ", ", { @@ -9924,7 +10272,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 215 + "lineNumber": 216 }, "deprecated": false }, @@ -9953,11 +10301,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".DERIVATIVE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + ".DERIVATIVE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", "AggExpressionType", ", ", { @@ -9981,7 +10329,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 216 + "lineNumber": 217 }, "deprecated": false }, @@ -10034,7 +10382,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 217 + "lineNumber": 218 }, "deprecated": false }, @@ -10087,7 +10435,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 218 + "lineNumber": 219 }, "deprecated": false }, @@ -10140,7 +10488,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 219 + "lineNumber": 220 }, "deprecated": false }, @@ -10193,7 +10541,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 220 + "lineNumber": 221 }, "deprecated": false }, @@ -10246,7 +10594,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 221 + "lineNumber": 222 }, "deprecated": false }, @@ -10299,7 +10647,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 222 + "lineNumber": 223 }, "deprecated": false }, @@ -10328,11 +10676,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".MOVING_FN>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\"> & Pick<{ customMetric?: ", + ".MOVING_FN>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\">, ", "AggExpressionType", ", ", { @@ -10356,7 +10704,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 223 + "lineNumber": 224 }, "deprecated": false }, @@ -10409,7 +10757,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 224 + "lineNumber": 225 }, "deprecated": false }, @@ -10462,7 +10810,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 225 + "lineNumber": 226 }, "deprecated": false }, @@ -10491,11 +10839,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".SERIAL_DIFF>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + ".SERIAL_DIFF>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", "AggExpressionType", ", ", { @@ -10519,7 +10867,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 226 + "lineNumber": 227 }, "deprecated": false }, @@ -10572,7 +10920,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 227 + "lineNumber": 228 }, "deprecated": false }, @@ -10625,7 +10973,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 228 + "lineNumber": 229 }, "deprecated": false }, @@ -10678,7 +11026,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 229 + "lineNumber": 230 }, "deprecated": false } @@ -11531,7 +11879,7 @@ "plugin": "discover", "link": { "path": "src/plugins/discover/public/application/embeddable/search_embeddable.ts", - "lineNumber": 58 + "lineNumber": 59 } }, { @@ -11996,34 +12344,6 @@ "lineNumber": 222 } }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/util/field_types_utils.ts", - "lineNumber": 11 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/util/field_types_utils.ts", - "lineNumber": 16 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/page.tsx", - "lineNumber": 25 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/page.tsx", - "lineNumber": 162 - } - }, { "plugin": "infra", "link": { @@ -12500,6 +12820,20 @@ "lineNumber": 11 } }, + { + "plugin": "ml", + "link": { + "path": "x-pack/plugins/ml/public/application/util/field_types_utils.ts", + "lineNumber": 11 + } + }, + { + "plugin": "ml", + "link": { + "path": "x-pack/plugins/ml/public/application/util/field_types_utils.ts", + "lineNumber": 16 + } + }, { "plugin": "ml", "link": { @@ -12882,28 +13216,28 @@ "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 139 + "lineNumber": 141 } }, { "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 248 + "lineNumber": 250 } }, { "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 287 + "lineNumber": 290 } }, { "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 329 + "lineNumber": 332 } }, { @@ -13807,12 +14141,12 @@ { "parentPluginId": "data", "id": "def-public.IFieldType.lang", - "type": "string", + "type": "CompoundType", "tags": [], "label": "lang", "description": [], "signature": [ - "string | undefined" + "\"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined" ], "source": { "path": "src/plugins/data/common/index_patterns/fields/types.ts", @@ -14340,6 +14674,20 @@ "lineNumber": 85 } }, + { + "plugin": "lens", + "link": { + "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx", + "lineNumber": 25 + } + }, + { + "plugin": "lens", + "link": { + "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx", + "lineNumber": 102 + } + }, { "plugin": "lens", "link": { @@ -14445,20 +14793,6 @@ "lineNumber": 30 } }, - { - "plugin": "apm", - "link": { - "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", - "lineNumber": 14 - } - }, - { - "plugin": "apm", - "link": { - "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", - "lineNumber": 31 - } - }, { "plugin": "infra", "link": { @@ -14627,6 +14961,20 @@ "lineNumber": 23 } }, + { + "plugin": "apm", + "link": { + "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", + "lineNumber": 14 + } + }, + { + "plugin": "apm", + "link": { + "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", + "lineNumber": 31 + } + }, { "plugin": "lists", "link": { @@ -14659,21 +15007,21 @@ "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts", - "lineNumber": 21 + "lineNumber": 22 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts", - "lineNumber": 66 + "lineNumber": 72 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts", - "lineNumber": 19 + "lineNumber": 20 } }, { @@ -14932,21 +15280,21 @@ "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts", - "lineNumber": 44 + "lineNumber": 48 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts", - "lineNumber": 60 + "lineNumber": 64 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts", - "lineNumber": 65 + "lineNumber": 69 } }, { @@ -15397,20 +15745,6 @@ "lineNumber": 11 } }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/actions_panel/actions_panel.tsx", - "lineNumber": 25 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/actions_panel/actions_panel.tsx", - "lineNumber": 28 - } - }, { "plugin": "infra", "link": { @@ -15733,6 +16067,20 @@ "lineNumber": 30 } }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/reference_rules/query.ts", + "lineNumber": 13 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/reference_rules/query.ts", + "lineNumber": 52 + } + }, { "plugin": "stackAlerts", "link": { @@ -15936,20 +16284,6 @@ "lineNumber": 1352 } }, - { - "plugin": "discover", - "link": { - "path": "src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx", - "lineNumber": 17 - } - }, - { - "plugin": "discover", - "link": { - "path": "src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx", - "lineNumber": 26 - } - }, { "plugin": "maps", "link": { @@ -15961,7 +16295,7 @@ "plugin": "maps", "link": { "path": "x-pack/plugins/maps/public/embeddable/types.ts", - "lineNumber": 45 + "lineNumber": 44 } }, { @@ -16020,60 +16354,18 @@ "lineNumber": 57 } }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts", - "lineNumber": 14 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts", - "lineNumber": 27 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts", - "lineNumber": 213 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts", - "lineNumber": 234 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/actions.ts", - "lineNumber": 12 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/actions.ts", - "lineNumber": 17 - } - }, { "plugin": "observability", "link": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 18 + "lineNumber": 19 } }, { "plugin": "observability", "link": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 95 + "lineNumber": 104 } }, { @@ -16115,7 +16407,7 @@ "plugin": "observability", "link": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts", - "lineNumber": 24 + "lineNumber": 25 } }, { @@ -16283,14 +16575,14 @@ "plugin": "transform", "link": { "path": "x-pack/plugins/transform/server/routes/api/transforms.ts", - "lineNumber": 62 + "lineNumber": 63 } }, { "plugin": "transform", "link": { "path": "x-pack/plugins/transform/server/routes/api/transforms.ts", - "lineNumber": 404 + "lineNumber": 405 } }, { @@ -19028,7 +19320,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 43 + "lineNumber": 45 }, "deprecated": false, "initialIsOpen": false @@ -19041,7 +19333,7 @@ "label": "AggGroupName", "description": [], "signature": [ - "\"buckets\" | \"metrics\" | \"none\"" + "\"none\" | \"buckets\" | \"metrics\"" ], "source": { "path": "src/plugins/data/common/search/aggs/agg_groups.ts", @@ -19773,7 +20065,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 53 + "lineNumber": 55 }, "deprecated": false, "initialIsOpen": false @@ -20132,7 +20424,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 35 + "lineNumber": 36 }, "deprecated": false, "initialIsOpen": false @@ -20359,7 +20651,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 650 + "lineNumber": 662 }, "deprecated": false, "initialIsOpen": false @@ -20716,7 +21008,7 @@ "section": "def-common.PhraseFilterMeta", "text": "PhraseFilterMeta" }, - "; script?: { script: { source?: any; lang?: string | undefined; params: any; }; } | undefined; }" + "; script?: { script: { source?: any; lang?: \"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined; params: any; }; } | undefined; }" ], "source": { "path": "src/plugins/data/common/es_query/filters/phrase_filter.ts", @@ -20805,7 +21097,9 @@ "section": "def-common.RangeFilterMeta", "text": "RangeFilterMeta" }, - "; script?: { script: { params: any; lang: string; source: any; }; } | undefined; match_all?: any; }" + "; script?: { script: { params: any; lang: ", + "ScriptLanguage", + "; source: any; }; } | undefined; match_all?: any; }" ], "source": { "path": "src/plugins/data/common/es_query/filters/range_filter.ts", @@ -22149,7 +22443,7 @@ "section": "def-common.PhraseFilterMeta", "text": "PhraseFilterMeta" }, - "; script?: { script: { source?: any; lang?: string | undefined; params: any; }; } | undefined; }" + "; script?: { script: { source?: any; lang?: \"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined; params: any; }; } | undefined; }" ], "source": { "path": "src/plugins/data/common/es_query/filters/phrase_filter.ts", @@ -22207,7 +22501,7 @@ "section": "def-common.PhraseFilterMeta", "text": "PhraseFilterMeta" }, - "; script?: { script: { source?: any; lang?: string | undefined; params: any; }; } | undefined; }" + "; script?: { script: { source?: any; lang?: \"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined; params: any; }; } | undefined; }" ], "source": { "path": "src/plugins/data/common/es_query/filters/phrase_filter.ts", @@ -22887,7 +23181,9 @@ "section": "def-common.RangeFilterMeta", "text": "RangeFilterMeta" }, - "; script?: { script: { params: any; lang: string; source: any; }; } | undefined; match_all?: any; }" + "; script?: { script: { params: any; lang: ", + "ScriptLanguage", + "; source: any; }; } | undefined; match_all?: any; }" ], "source": { "path": "src/plugins/data/public/query/timefilter/lib/change_time_filter.ts", @@ -22960,7 +23256,9 @@ "section": "def-common.RangeFilterMeta", "text": "RangeFilterMeta" }, - "; script?: { script: { params: any; lang: string; source: any; }; } | undefined; match_all?: any; }" + "; script?: { script: { params: any; lang: ", + "ScriptLanguage", + "; source: any; }; } | undefined; match_all?: any; }" ], "source": { "path": "src/plugins/data/public/query/timefilter/lib/change_time_filter.ts", @@ -23530,7 +23828,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 33 + "lineNumber": 39 }, "deprecated": false }, @@ -23561,7 +23859,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 34 + "lineNumber": 40 }, "deprecated": false }, @@ -23592,7 +23890,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 35 + "lineNumber": 41 }, "deprecated": false }, @@ -23614,7 +23912,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 36 + "lineNumber": 42 }, "deprecated": false } @@ -25922,7 +26220,7 @@ "section": "def-public.QuerySuggestionGetFn", "text": "QuerySuggestionGetFn" }, - "; }" + "; getAutocompleteSettings: () => { terminateAfter: number; timeout: number; }; }" ], "source": { "path": "src/plugins/data/public/types.ts", @@ -26699,7 +26997,7 @@ "section": "def-server.PluginInitializerContext", "text": "PluginInitializerContext" }, - "; }>; }>; autocomplete: Readonly<{} & { querySuggestions: Readonly<{} & { enabled: boolean; }>; valueSuggestions: Readonly<{} & { enabled: boolean; }>; }>; }>>" + "; }>; }>; autocomplete: Readonly<{} & { querySuggestions: Readonly<{} & { enabled: boolean; }>; valueSuggestions: Readonly<{} & { enabled: boolean; timeout: moment.Duration; terminateAfter: moment.Duration; }>; }>; }>>" ], "source": { "path": "src/plugins/data/server/plugin.ts", @@ -27533,7 +27831,9 @@ "parentPluginId": "data", "id": "def-server.IndexPattern.addScriptedField", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "addScriptedField", "description": [ "\nAdd scripted field to field list\n" @@ -27543,9 +27843,10 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, - "deprecated": false, + "deprecated": true, + "references": [], "children": [ { "parentPluginId": "data", @@ -27561,7 +27862,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, "deprecated": false, "isRequired": true @@ -27580,7 +27881,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, "deprecated": false, "isRequired": true @@ -27597,7 +27898,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, "deprecated": false, "isRequired": true @@ -27609,7 +27910,9 @@ "parentPluginId": "data", "id": "def-server.IndexPattern.removeScriptedField", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "removeScriptedField", "description": [ "\nRemove scripted field from field list" @@ -27619,9 +27922,25 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 270 + "lineNumber": 272 }, - "deprecated": false, + "deprecated": true, + "references": [ + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx", + "lineNumber": 117 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx", + "lineNumber": 778 + } + } + ], "children": [ { "parentPluginId": "data", @@ -27635,7 +27954,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 270 + "lineNumber": 272 }, "deprecated": false, "isRequired": true @@ -27647,9 +27966,13 @@ "parentPluginId": "data", "id": "def-server.IndexPattern.getNonScriptedFields", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "getNonScriptedFields", - "description": [], + "description": [ + "\n" + ], "signature": [ "() => ", { @@ -27663,9 +27986,74 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 277 + "lineNumber": 283 }, - "deprecated": false, + "deprecated": true, + "references": [ + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx", + "lineNumber": 152 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx", + "lineNumber": 66 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx", + "lineNumber": 74 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx", + "lineNumber": 204 + } + }, + { + "plugin": "visTypeTimeseries", + "link": { + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts", + "lineNumber": 65 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts", + "lineNumber": 106 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/state_management/datasource.test.ts", + "lineNumber": 29 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts", + "lineNumber": 122 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts", + "lineNumber": 244 + } + } + ], "children": [], "returnComment": [] }, @@ -27673,9 +28061,13 @@ "parentPluginId": "data", "id": "def-server.IndexPattern.getScriptedFields", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "getScriptedFields", - "description": [], + "description": [ + "\n" + ], "signature": [ "() => ", { @@ -27689,9 +28081,18 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 281 + "lineNumber": 291 }, - "deprecated": false, + "deprecated": true, + "references": [ + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx", + "lineNumber": 61 + } + } + ], "children": [], "returnComment": [] }, @@ -27707,7 +28108,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 285 + "lineNumber": 295 }, "deprecated": false, "children": [], @@ -27725,7 +28126,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 289 + "lineNumber": 299 }, "deprecated": false, "children": [], @@ -27751,7 +28152,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 294 + "lineNumber": 304 }, "deprecated": false, "children": [], @@ -27777,7 +28178,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 299 + "lineNumber": 309 }, "deprecated": false, "children": [ @@ -27793,7 +28194,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 299 + "lineNumber": 309 }, "deprecated": false, "isRequired": true @@ -27813,7 +28214,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 304 + "lineNumber": 314 }, "deprecated": false, "children": [], @@ -27829,11 +28230,18 @@ "\nReturns index pattern as saved object body for saving" ], "signature": [ - "() => { fieldAttrs: string | undefined; title: string; timeFieldName: string | undefined; intervalName: string | undefined; sourceFilters: string | undefined; fields: string | undefined; fieldFormatMap: string | undefined; type: string | undefined; typeMeta: string | undefined; allowNoIndex: true | undefined; runtimeFieldMap: string | undefined; }" + "() => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IndexPatternAttributes", + "text": "IndexPatternAttributes" + } ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 311 + "lineNumber": 321 }, "deprecated": false, "children": [], @@ -27884,7 +28292,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 339 + "lineNumber": 347 }, "deprecated": false, "children": [ @@ -27922,7 +28330,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 340 + "lineNumber": 348 }, "deprecated": false, "isRequired": true @@ -27952,7 +28360,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 360 + "lineNumber": 368 }, "deprecated": false, "children": [ @@ -27970,7 +28378,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 360 + "lineNumber": 368 }, "deprecated": false, "isRequired": true @@ -27995,7 +28403,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 360 + "lineNumber": 368 }, "deprecated": false, "isRequired": true @@ -28017,7 +28425,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 384 + "lineNumber": 392 }, "deprecated": false, "children": [ @@ -28035,7 +28443,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 384 + "lineNumber": 392 }, "deprecated": false, "isRequired": true @@ -28065,7 +28473,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 404 + "lineNumber": 412 }, "deprecated": false, "children": [ @@ -28081,7 +28489,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 404 + "lineNumber": 412 }, "deprecated": false, "isRequired": true @@ -28109,7 +28517,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 411 + "lineNumber": 419 }, "deprecated": false, "children": [ @@ -28125,7 +28533,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 412 + "lineNumber": 420 }, "deprecated": false, "isRequired": true @@ -28142,7 +28550,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 413 + "lineNumber": 421 }, "deprecated": false, "isRequired": true @@ -28166,7 +28574,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 414 + "lineNumber": 422 }, "deprecated": false, "isRequired": true @@ -28186,7 +28594,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 422 + "lineNumber": 430 }, "deprecated": false, "children": [ @@ -28202,7 +28610,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 422 + "lineNumber": 430 }, "deprecated": false, "isRequired": true @@ -28219,7 +28627,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 422 + "lineNumber": 430 }, "deprecated": false, "isRequired": false @@ -28239,7 +28647,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 433 + "lineNumber": 441 }, "deprecated": false, "children": [ @@ -28255,7 +28663,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 433 + "lineNumber": 441 }, "deprecated": false, "isRequired": true @@ -28272,7 +28680,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 433 + "lineNumber": 441 }, "deprecated": false, "isRequired": false @@ -28300,7 +28708,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 446 + "lineNumber": 454 }, "deprecated": false, "children": [ @@ -28316,7 +28724,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 446 + "lineNumber": 454 }, "deprecated": false, "isRequired": true @@ -28340,7 +28748,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 446 + "lineNumber": 454 }, "deprecated": false, "isRequired": true @@ -28360,7 +28768,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 450 + "lineNumber": 458 }, "deprecated": false, "children": [ @@ -28376,7 +28784,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 450 + "lineNumber": 458 }, "deprecated": false, "isRequired": true @@ -29199,7 +29607,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 473 + "lineNumber": 480 }, "deprecated": false, "children": [ @@ -29215,7 +29623,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 473 + "lineNumber": 480 }, "deprecated": false, "isRequired": true @@ -29253,7 +29661,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "children": [ @@ -29275,7 +29683,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "isRequired": true @@ -29292,7 +29700,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "isRequired": true @@ -29332,7 +29740,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "children": [ @@ -29354,7 +29762,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -29373,7 +29781,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -29392,7 +29800,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -29430,7 +29838,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "children": [ @@ -29452,7 +29860,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "isRequired": true @@ -29471,7 +29879,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "isRequired": true @@ -29501,7 +29909,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 558 + "lineNumber": 570 }, "deprecated": false, "children": [ @@ -29523,7 +29931,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 559 + "lineNumber": 571 }, "deprecated": false, "isRequired": true @@ -29540,7 +29948,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 560 + "lineNumber": 572 }, "deprecated": false, "isRequired": true @@ -29557,7 +29965,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 561 + "lineNumber": 573 }, "deprecated": false, "isRequired": true @@ -29579,7 +29987,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 644 + "lineNumber": 656 }, "deprecated": false, "children": [ @@ -29597,7 +30005,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 644 + "lineNumber": 656 }, "deprecated": false, "isRequired": true @@ -30420,7 +30828,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 473 + "lineNumber": 480 }, "deprecated": false, "children": [ @@ -30436,7 +30844,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 473 + "lineNumber": 480 }, "deprecated": false, "isRequired": true @@ -30474,7 +30882,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "children": [ @@ -30496,7 +30904,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "isRequired": true @@ -30513,7 +30921,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "isRequired": true @@ -30553,7 +30961,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "children": [ @@ -30575,7 +30983,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -30594,7 +31002,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -30613,7 +31021,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -30651,7 +31059,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "children": [ @@ -30673,7 +31081,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "isRequired": true @@ -30692,7 +31100,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "isRequired": true @@ -30722,7 +31130,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 558 + "lineNumber": 570 }, "deprecated": false, "children": [ @@ -30744,7 +31152,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 559 + "lineNumber": 571 }, "deprecated": false, "isRequired": true @@ -30761,7 +31169,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 560 + "lineNumber": 572 }, "deprecated": false, "isRequired": true @@ -30778,7 +31186,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 561 + "lineNumber": 573 }, "deprecated": false, "isRequired": true @@ -30800,7 +31208,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 644 + "lineNumber": 656 }, "deprecated": false, "children": [ @@ -30818,7 +31226,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 644 + "lineNumber": 656 }, "deprecated": false, "isRequired": true @@ -31168,7 +31576,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 195 + "lineNumber": 196 }, "deprecated": false, "children": [ @@ -31197,7 +31605,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".FILTER>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"geo_bounding_box\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"filter\">, \"enabled\" | \"id\" | \"filter\" | \"customLabel\" | \"schema\" | \"geo_bounding_box\" | \"json\">, ", + ".FILTER>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"geo_bounding_box\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"filter\">, \"enabled\" | \"id\" | \"filter\" | \"customLabel\" | \"schema\" | \"geo_bounding_box\" | \"json\" | \"timeShift\">, ", "AggExpressionType", ", ", { @@ -31221,7 +31629,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 196 + "lineNumber": 197 }, "deprecated": false }, @@ -31250,7 +31658,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".FILTERS>, \"enabled\" | \"id\" | \"schema\" | \"json\"> & Pick<{ filters?: string | undefined; }, \"filters\"> & Pick<{ filters?: string | undefined; }, never>, \"enabled\" | \"filters\" | \"id\" | \"schema\" | \"json\">, ", + ".FILTERS>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ filters?: string | undefined; }, \"filters\"> & Pick<{ filters?: string | undefined; }, never>, \"enabled\" | \"filters\" | \"id\" | \"schema\" | \"json\" | \"timeShift\">, ", "AggExpressionType", ", ", { @@ -31274,7 +31682,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 197 + "lineNumber": 198 }, "deprecated": false }, @@ -31327,7 +31735,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 198 + "lineNumber": 199 }, "deprecated": false }, @@ -31356,7 +31764,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".IP_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, \"ipRangeType\" | \"ranges\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"ipRangeType\" | \"ranges\">, ", + ".IP_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, \"ipRangeType\" | \"ranges\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ipRangeType\" | \"ranges\">, ", "AggExpressionType", ", ", { @@ -31380,7 +31788,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 199 + "lineNumber": 200 }, "deprecated": false }, @@ -31409,7 +31817,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".DATE_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"time_zone\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"ranges\" | \"time_zone\">, ", + ".DATE_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ranges\" | \"time_zone\">, ", "AggExpressionType", ", ", { @@ -31433,7 +31841,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 200 + "lineNumber": 201 }, "deprecated": false }, @@ -31462,7 +31870,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"ranges\">, ", + ".RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ranges\">, ", "AggExpressionType", ", ", { @@ -31486,7 +31894,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 201 + "lineNumber": 202 }, "deprecated": false }, @@ -31539,7 +31947,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 202 + "lineNumber": 203 }, "deprecated": false }, @@ -31568,7 +31976,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".GEOHASH_GRID>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\"> & Pick<{ boundingBox?: string | undefined; }, \"boundingBox\"> & Pick<{ boundingBox?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\" | \"boundingBox\">, ", + ".GEOHASH_GRID>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\"> & Pick<{ boundingBox?: string | undefined; }, \"boundingBox\"> & Pick<{ boundingBox?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\" | \"boundingBox\">, ", "AggExpressionType", ", ", { @@ -31592,7 +32000,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 203 + "lineNumber": 204 }, "deprecated": false }, @@ -31621,7 +32029,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, \"extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\" | \"extended_bounds\">, ", + ".HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, \"extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\" | \"extended_bounds\">, ", "AggExpressionType", ", ", { @@ -31645,7 +32053,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 204 + "lineNumber": 205 }, "deprecated": false }, @@ -31674,7 +32082,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".DATE_HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, \"timeRange\" | \"extended_bounds\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"timeRange\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"extended_bounds\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\">, ", + ".DATE_HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, \"timeRange\" | \"extended_bounds\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"timeRange\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"extended_bounds\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\">, ", "AggExpressionType", ", ", { @@ -31698,7 +32106,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 205 + "lineNumber": 206 }, "deprecated": false }, @@ -31727,11 +32135,11 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".TERMS>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"orderBy\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\"> & Pick<{ orderAgg?: ", + ".TERMS>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"orderBy\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\"> & Pick<{ orderAgg?: ", "AggExpressionType", " | undefined; }, \"orderAgg\"> & Pick<{ orderAgg?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"orderBy\" | \"orderAgg\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"orderBy\" | \"orderAgg\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\">, ", "AggExpressionType", ", ", { @@ -31755,7 +32163,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 206 + "lineNumber": 207 }, "deprecated": false }, @@ -31808,7 +32216,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 207 + "lineNumber": 208 }, "deprecated": false }, @@ -31837,7 +32245,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".AVG_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".AVG_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -31845,7 +32253,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -31869,7 +32277,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 208 + "lineNumber": 209 }, "deprecated": false }, @@ -31898,7 +32306,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".MAX_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".MAX_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -31906,7 +32314,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -31930,7 +32338,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 209 + "lineNumber": 210 }, "deprecated": false }, @@ -31959,7 +32367,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".MIN_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".MIN_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -31967,7 +32375,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -31991,7 +32399,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 210 + "lineNumber": 211 }, "deprecated": false }, @@ -32020,7 +32428,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".SUM_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".SUM_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -32028,7 +32436,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -32052,7 +32460,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 211 + "lineNumber": 212 }, "deprecated": false }, @@ -32081,7 +32489,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".FILTERED_METRIC>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".FILTERED_METRIC>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -32089,7 +32497,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -32113,7 +32521,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 212 + "lineNumber": 213 }, "deprecated": false }, @@ -32166,7 +32574,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 213 + "lineNumber": 214 }, "deprecated": false }, @@ -32219,7 +32627,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 214 + "lineNumber": 215 }, "deprecated": false }, @@ -32248,11 +32656,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".CUMULATIVE_SUM>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + ".CUMULATIVE_SUM>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", "AggExpressionType", ", ", { @@ -32276,7 +32684,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 215 + "lineNumber": 216 }, "deprecated": false }, @@ -32305,11 +32713,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".DERIVATIVE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + ".DERIVATIVE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", "AggExpressionType", ", ", { @@ -32333,7 +32741,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 216 + "lineNumber": 217 }, "deprecated": false }, @@ -32386,7 +32794,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 217 + "lineNumber": 218 }, "deprecated": false }, @@ -32439,7 +32847,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 218 + "lineNumber": 219 }, "deprecated": false }, @@ -32492,7 +32900,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 219 + "lineNumber": 220 }, "deprecated": false }, @@ -32545,7 +32953,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 220 + "lineNumber": 221 }, "deprecated": false }, @@ -32598,7 +33006,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 221 + "lineNumber": 222 }, "deprecated": false }, @@ -32651,7 +33059,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 222 + "lineNumber": 223 }, "deprecated": false }, @@ -32680,11 +33088,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".MOVING_FN>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\"> & Pick<{ customMetric?: ", + ".MOVING_FN>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\">, ", "AggExpressionType", ", ", { @@ -32708,7 +33116,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 223 + "lineNumber": 224 }, "deprecated": false }, @@ -32761,7 +33169,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 224 + "lineNumber": 225 }, "deprecated": false }, @@ -32814,7 +33222,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 225 + "lineNumber": 226 }, "deprecated": false }, @@ -32843,11 +33251,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".SERIAL_DIFF>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + ".SERIAL_DIFF>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", "AggExpressionType", ", ", { @@ -32871,7 +33279,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 226 + "lineNumber": 227 }, "deprecated": false }, @@ -32924,7 +33332,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 227 + "lineNumber": 228 }, "deprecated": false }, @@ -32977,7 +33385,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 228 + "lineNumber": 229 }, "deprecated": false }, @@ -33030,7 +33438,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 229 + "lineNumber": 230 }, "deprecated": false } @@ -33403,7 +33811,7 @@ "plugin": "discover", "link": { "path": "src/plugins/discover/public/application/embeddable/search_embeddable.ts", - "lineNumber": 58 + "lineNumber": 59 } }, { @@ -33868,34 +34276,6 @@ "lineNumber": 222 } }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/util/field_types_utils.ts", - "lineNumber": 11 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/util/field_types_utils.ts", - "lineNumber": 16 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/page.tsx", - "lineNumber": 25 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/page.tsx", - "lineNumber": 162 - } - }, { "plugin": "infra", "link": { @@ -34372,6 +34752,20 @@ "lineNumber": 11 } }, + { + "plugin": "ml", + "link": { + "path": "x-pack/plugins/ml/public/application/util/field_types_utils.ts", + "lineNumber": 11 + } + }, + { + "plugin": "ml", + "link": { + "path": "x-pack/plugins/ml/public/application/util/field_types_utils.ts", + "lineNumber": 16 + } + }, { "plugin": "ml", "link": { @@ -34754,28 +35148,28 @@ "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 139 + "lineNumber": 141 } }, { "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 248 + "lineNumber": 250 } }, { "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 287 + "lineNumber": 290 } }, { "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 329 + "lineNumber": 332 } }, { @@ -35679,12 +36073,12 @@ { "parentPluginId": "data", "id": "def-server.IFieldType.lang", - "type": "string", + "type": "CompoundType", "tags": [], "label": "lang", "description": [], "signature": [ - "string | undefined" + "\"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined" ], "source": { "path": "src/plugins/data/common/index_patterns/fields/types.ts", @@ -36603,7 +36997,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 43 + "lineNumber": 45 }, "deprecated": false, "initialIsOpen": false @@ -36616,7 +37010,7 @@ "label": "AggGroupName", "description": [], "signature": [ - "\"buckets\" | \"metrics\" | \"none\"" + "\"none\" | \"buckets\" | \"metrics\"" ], "source": { "path": "src/plugins/data/common/search/aggs/agg_groups.ts", @@ -36988,7 +37382,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 53 + "lineNumber": 55 }, "deprecated": false, "initialIsOpen": false @@ -37324,7 +37718,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 35 + "lineNumber": 36 }, "deprecated": false, "initialIsOpen": false @@ -38964,7 +39358,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 33 + "lineNumber": 39 }, "deprecated": false }, @@ -38995,7 +39389,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 34 + "lineNumber": 40 }, "deprecated": false }, @@ -39026,7 +39420,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 35 + "lineNumber": 41 }, "deprecated": false }, @@ -39048,7 +39442,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 36 + "lineNumber": 42 }, "deprecated": false } @@ -39658,7 +40052,7 @@ "description": [], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 243 + "lineNumber": 244 }, "deprecated": false, "children": [ @@ -39671,7 +40065,7 @@ "description": [], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 244 + "lineNumber": 245 }, "deprecated": false, "children": [ @@ -39694,7 +40088,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 245 + "lineNumber": 246 }, "deprecated": false }, @@ -39710,7 +40104,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 246 + "lineNumber": 247 }, "deprecated": false, "returnComment": [], @@ -39750,7 +40144,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 247 + "lineNumber": 248 }, "deprecated": false }, @@ -39773,7 +40167,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 248 + "lineNumber": 249 }, "deprecated": false }, @@ -39796,7 +40190,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 249 + "lineNumber": 250 }, "deprecated": false }, @@ -39819,7 +40213,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 250 + "lineNumber": 251 }, "deprecated": false }, @@ -39843,7 +40237,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 251 + "lineNumber": 252 }, "deprecated": false, "returnComment": [], @@ -39892,7 +40286,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 252 + "lineNumber": 253 }, "deprecated": false, "returnComment": [], @@ -39941,7 +40335,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 253 + "lineNumber": 254 }, "deprecated": false, "returnComment": [], @@ -39976,7 +40370,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 254 + "lineNumber": 255 }, "deprecated": false, "returnComment": [], @@ -40008,7 +40402,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 255 + "lineNumber": 256 }, "deprecated": false, "returnComment": [], @@ -40053,7 +40447,7 @@ "description": [], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 256 + "lineNumber": 257 }, "deprecated": false }, @@ -40071,7 +40465,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 257 + "lineNumber": 258 }, "deprecated": false, "returnComment": [], @@ -40103,7 +40497,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 258 + "lineNumber": 259 }, "deprecated": false, "returnComment": [], @@ -40135,7 +40529,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 259 + "lineNumber": 260 }, "deprecated": false, "returnComment": [], @@ -40167,7 +40561,7 @@ "description": [], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 260 + "lineNumber": 261 }, "deprecated": false }, @@ -40183,7 +40577,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 261 + "lineNumber": 262 }, "deprecated": false }, @@ -40207,7 +40601,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 262 + "lineNumber": 263 }, "deprecated": false, "returnComment": [], @@ -40242,7 +40636,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 263 + "lineNumber": 264 }, "deprecated": false, "returnComment": [], @@ -40306,7 +40700,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 265 + "lineNumber": 266 }, "deprecated": false, "returnComment": [], @@ -40391,7 +40785,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 266 + "lineNumber": 267 }, "deprecated": false, "returnComment": [], @@ -41124,7 +41518,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 32 + "lineNumber": 38 }, "deprecated": false, "children": [ @@ -41147,7 +41541,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 33 + "lineNumber": 39 }, "deprecated": false, "isRequired": false @@ -41181,7 +41575,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 34 + "lineNumber": 40 }, "deprecated": false, "isRequired": true @@ -41215,7 +41609,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 35 + "lineNumber": 41 }, "deprecated": false, "isRequired": true @@ -41240,7 +41634,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 36 + "lineNumber": 42 }, "deprecated": false, "isRequired": true @@ -43386,7 +43780,7 @@ "section": "def-common.IFieldType", "text": "IFieldType" }, - ", value: string) => { script: { source: string; lang: string | undefined; params: { value: any; }; }; }" + ", value: string) => { script: { source: string; lang: \"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined; params: { value: any; }; }; }" ], "source": { "path": "src/plugins/data/common/es_query/filters/phrase_filter.ts", @@ -43564,7 +43958,7 @@ "section": "def-common.RangeFilterParams", "text": "RangeFilterParams" }, - ") => { script: { source: string; params: { from?: string | number | undefined; to?: string | number | undefined; gt?: string | number | undefined; lt?: string | number | undefined; gte?: string | number | undefined; lte?: string | number | undefined; format?: string | number | undefined; }; lang: string | undefined; }; }" + ") => { script: { source: string; params: { from?: string | number | undefined; to?: string | number | undefined; gt?: string | number | undefined; lt?: string | number | undefined; gte?: string | number | undefined; lte?: string | number | undefined; format?: string | number | undefined; }; lang: \"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined; }; }" ], "source": { "path": "src/plugins/data/common/es_query/filters/range_filter.ts", @@ -46324,7 +46718,7 @@ "section": "def-common.PhraseFilterMeta", "text": "PhraseFilterMeta" }, - "; script?: { script: { source?: any; lang?: string | undefined; params: any; }; } | undefined; }" + "; script?: { script: { source?: any; lang?: \"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined; params: any; }; } | undefined; }" ], "source": { "path": "src/plugins/data/common/es_query/filters/phrase_filter.ts", @@ -46493,7 +46887,9 @@ "section": "def-common.RangeFilterMeta", "text": "RangeFilterMeta" }, - "; script?: { script: { params: any; lang: string; source: any; }; } | undefined; match_all?: any; }" + "; script?: { script: { params: any; lang: ", + "ScriptLanguage", + "; source: any; }; } | undefined; match_all?: any; }" ], "source": { "path": "src/plugins/data/common/es_query/filters/range_filter.ts", diff --git a/api_docs/data.mdx b/api_docs/data.mdx index f585b23a16a0c6..bd48fb09df8b30 100644 --- a/api_docs/data.mdx +++ b/api_docs/data.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import dataObj from './data.json'; +Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. + +Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 3809 | 107 | 3257 | 75 | + ## Client ### Setup diff --git a/api_docs/data_autocomplete.json b/api_docs/data_autocomplete.json index 38e27d4df6e2d8..25bda08157358d 100644 --- a/api_docs/data_autocomplete.json +++ b/api_docs/data_autocomplete.json @@ -370,7 +370,7 @@ ], "source": { "path": "src/plugins/data/public/autocomplete/autocomplete_service.ts", - "lineNumber": 96 + "lineNumber": 103 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/data_autocomplete.mdx b/api_docs/data_autocomplete.mdx index c2231648ac905d..7d18feb2140dd4 100644 --- a/api_docs/data_autocomplete.mdx +++ b/api_docs/data_autocomplete.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import dataAutocompleteObj from './data_autocomplete.json'; +Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. + +Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 3809 | 107 | 3257 | 75 | + ## Client ### Interfaces diff --git a/api_docs/data_enhanced.mdx b/api_docs/data_enhanced.mdx index 07a00b908e7b26..1e6709794d3c49 100644 --- a/api_docs/data_enhanced.mdx +++ b/api_docs/data_enhanced.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import dataEnhancedObj from './data_enhanced.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 16 | 0 | 16 | 2 | + ## Client ### Start diff --git a/api_docs/data_field_formats.json b/api_docs/data_field_formats.json index 1807c32a18389d..a5fba87c20169b 100644 --- a/api_docs/data_field_formats.json +++ b/api_docs/data_field_formats.json @@ -513,7 +513,7 @@ ], "source": { "path": "src/plugins/data/common/field_formats/converters/duration.ts", - "lineNumber": 157 + "lineNumber": 211 }, "deprecated": false, "children": [ @@ -535,7 +535,7 @@ ], "source": { "path": "src/plugins/data/common/field_formats/converters/duration.ts", - "lineNumber": 158 + "lineNumber": 212 }, "deprecated": false }, @@ -548,7 +548,7 @@ "description": [], "source": { "path": "src/plugins/data/common/field_formats/converters/duration.ts", - "lineNumber": 159 + "lineNumber": 213 }, "deprecated": false }, @@ -570,7 +570,7 @@ ], "source": { "path": "src/plugins/data/common/field_formats/converters/duration.ts", - "lineNumber": 162 + "lineNumber": 216 }, "deprecated": false }, @@ -586,7 +586,7 @@ ], "source": { "path": "src/plugins/data/common/field_formats/converters/duration.ts", - "lineNumber": 163 + "lineNumber": 217 }, "deprecated": false }, @@ -598,11 +598,11 @@ "label": "outputFormats", "description": [], "signature": [ - "{ text: string; method: string; }[]" + "({ text: string; method: string; shortText?: undefined; } | { text: string; shortText: string; method: string; })[]" ], "source": { "path": "src/plugins/data/common/field_formats/converters/duration.ts", - "lineNumber": 164 + "lineNumber": 218 }, "deprecated": false }, @@ -615,7 +615,7 @@ "description": [], "source": { "path": "src/plugins/data/common/field_formats/converters/duration.ts", - "lineNumber": 165 + "lineNumber": 219 }, "deprecated": false }, @@ -631,7 +631,25 @@ ], "source": { "path": "src/plugins/data/common/field_formats/converters/duration.ts", - "lineNumber": 167 + "lineNumber": 221 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.DurationFormat.isHumanPrecise", + "type": "Function", + "tags": [], + "label": "isHumanPrecise", + "description": [], + "signature": [ + "() => boolean" + ], + "source": { + "path": "src/plugins/data/common/field_formats/converters/duration.ts", + "lineNumber": 225 }, "deprecated": false, "children": [], @@ -645,11 +663,11 @@ "label": "getParamDefaults", "description": [], "signature": [ - "() => { inputFormat: string; outputFormat: string; outputPrecision: number; }" + "() => { inputFormat: string; outputFormat: string; outputPrecision: number; includeSpaceWithSuffix: boolean; }" ], "source": { "path": "src/plugins/data/common/field_formats/converters/duration.ts", - "lineNumber": 170 + "lineNumber": 229 }, "deprecated": false, "children": [], @@ -663,11 +681,11 @@ "label": "textConvert", "description": [], "signature": [ - "(val: any) => string" + "(val: any) => any" ], "source": { "path": "src/plugins/data/common/field_formats/converters/duration.ts", - "lineNumber": 178 + "lineNumber": 238 }, "deprecated": false, "children": [ @@ -683,7 +701,7 @@ ], "source": { "path": "src/plugins/data/common/field_formats/converters/duration.ts", - "lineNumber": 178 + "lineNumber": 238 }, "deprecated": false, "isRequired": true diff --git a/api_docs/data_field_formats.mdx b/api_docs/data_field_formats.mdx index faeba4ac56454d..c13562eba142df 100644 --- a/api_docs/data_field_formats.mdx +++ b/api_docs/data_field_formats.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import dataFieldFormatsObj from './data_field_formats.json'; +Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. + +Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 3809 | 107 | 3257 | 75 | + ## Client ### Consts, variables and types diff --git a/api_docs/data_index_patterns.json b/api_docs/data_index_patterns.json index 676ded76cb331b..056442ee29d668 100644 --- a/api_docs/data_index_patterns.json +++ b/api_docs/data_index_patterns.json @@ -1689,7 +1689,9 @@ "parentPluginId": "data", "id": "def-common.IndexPattern.addScriptedField", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "addScriptedField", "description": [ "\nAdd scripted field to field list\n" @@ -1699,9 +1701,10 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, - "deprecated": false, + "deprecated": true, + "references": [], "children": [ { "parentPluginId": "data", @@ -1717,7 +1720,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, "deprecated": false, "isRequired": true @@ -1736,7 +1739,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, "deprecated": false, "isRequired": true @@ -1753,7 +1756,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, "deprecated": false, "isRequired": true @@ -1765,7 +1768,9 @@ "parentPluginId": "data", "id": "def-common.IndexPattern.removeScriptedField", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "removeScriptedField", "description": [ "\nRemove scripted field from field list" @@ -1775,9 +1780,25 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 270 + "lineNumber": 272 }, - "deprecated": false, + "deprecated": true, + "references": [ + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx", + "lineNumber": 117 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx", + "lineNumber": 778 + } + } + ], "children": [ { "parentPluginId": "data", @@ -1791,7 +1812,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 270 + "lineNumber": 272 }, "deprecated": false, "isRequired": true @@ -1803,9 +1824,13 @@ "parentPluginId": "data", "id": "def-common.IndexPattern.getNonScriptedFields", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "getNonScriptedFields", - "description": [], + "description": [ + "\n" + ], "signature": [ "() => ", { @@ -1819,9 +1844,74 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 277 + "lineNumber": 283 }, - "deprecated": false, + "deprecated": true, + "references": [ + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx", + "lineNumber": 152 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx", + "lineNumber": 66 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx", + "lineNumber": 74 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx", + "lineNumber": 204 + } + }, + { + "plugin": "visTypeTimeseries", + "link": { + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts", + "lineNumber": 65 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts", + "lineNumber": 106 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/state_management/datasource.test.ts", + "lineNumber": 29 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts", + "lineNumber": 122 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts", + "lineNumber": 244 + } + } + ], "children": [], "returnComment": [] }, @@ -1829,9 +1919,13 @@ "parentPluginId": "data", "id": "def-common.IndexPattern.getScriptedFields", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "getScriptedFields", - "description": [], + "description": [ + "\n" + ], "signature": [ "() => ", { @@ -1845,9 +1939,18 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 281 + "lineNumber": 291 }, - "deprecated": false, + "deprecated": true, + "references": [ + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx", + "lineNumber": 61 + } + } + ], "children": [], "returnComment": [] }, @@ -1863,7 +1966,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 285 + "lineNumber": 295 }, "deprecated": false, "children": [], @@ -1881,7 +1984,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 289 + "lineNumber": 299 }, "deprecated": false, "children": [], @@ -1907,7 +2010,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 294 + "lineNumber": 304 }, "deprecated": false, "children": [], @@ -1933,7 +2036,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 299 + "lineNumber": 309 }, "deprecated": false, "children": [ @@ -1949,7 +2052,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 299 + "lineNumber": 309 }, "deprecated": false, "isRequired": true @@ -1969,7 +2072,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 304 + "lineNumber": 314 }, "deprecated": false, "children": [], @@ -1985,11 +2088,18 @@ "\nReturns index pattern as saved object body for saving" ], "signature": [ - "() => { fieldAttrs: string | undefined; title: string; timeFieldName: string | undefined; intervalName: string | undefined; sourceFilters: string | undefined; fields: string | undefined; fieldFormatMap: string | undefined; type: string | undefined; typeMeta: string | undefined; allowNoIndex: true | undefined; runtimeFieldMap: string | undefined; }" + "() => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IndexPatternAttributes", + "text": "IndexPatternAttributes" + } ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 311 + "lineNumber": 321 }, "deprecated": false, "children": [], @@ -2040,7 +2150,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 339 + "lineNumber": 347 }, "deprecated": false, "children": [ @@ -2078,7 +2188,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 340 + "lineNumber": 348 }, "deprecated": false, "isRequired": true @@ -2108,7 +2218,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 360 + "lineNumber": 368 }, "deprecated": false, "children": [ @@ -2126,7 +2236,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 360 + "lineNumber": 368 }, "deprecated": false, "isRequired": true @@ -2151,7 +2261,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 360 + "lineNumber": 368 }, "deprecated": false, "isRequired": true @@ -2173,7 +2283,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 384 + "lineNumber": 392 }, "deprecated": false, "children": [ @@ -2191,7 +2301,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 384 + "lineNumber": 392 }, "deprecated": false, "isRequired": true @@ -2221,7 +2331,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 404 + "lineNumber": 412 }, "deprecated": false, "children": [ @@ -2237,7 +2347,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 404 + "lineNumber": 412 }, "deprecated": false, "isRequired": true @@ -2265,7 +2375,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 411 + "lineNumber": 419 }, "deprecated": false, "children": [ @@ -2281,7 +2391,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 412 + "lineNumber": 420 }, "deprecated": false, "isRequired": true @@ -2298,7 +2408,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 413 + "lineNumber": 421 }, "deprecated": false, "isRequired": true @@ -2322,7 +2432,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 414 + "lineNumber": 422 }, "deprecated": false, "isRequired": true @@ -2342,7 +2452,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 422 + "lineNumber": 430 }, "deprecated": false, "children": [ @@ -2358,7 +2468,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 422 + "lineNumber": 430 }, "deprecated": false, "isRequired": true @@ -2375,7 +2485,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 422 + "lineNumber": 430 }, "deprecated": false, "isRequired": false @@ -2395,7 +2505,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 433 + "lineNumber": 441 }, "deprecated": false, "children": [ @@ -2411,7 +2521,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 433 + "lineNumber": 441 }, "deprecated": false, "isRequired": true @@ -2428,7 +2538,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 433 + "lineNumber": 441 }, "deprecated": false, "isRequired": false @@ -2456,7 +2566,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 446 + "lineNumber": 454 }, "deprecated": false, "children": [ @@ -2472,7 +2582,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 446 + "lineNumber": 454 }, "deprecated": false, "isRequired": true @@ -2496,7 +2606,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 446 + "lineNumber": 454 }, "deprecated": false, "isRequired": true @@ -2516,7 +2626,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 450 + "lineNumber": 458 }, "deprecated": false, "children": [ @@ -2532,7 +2642,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 450 + "lineNumber": 458 }, "deprecated": false, "isRequired": true @@ -2748,14 +2858,14 @@ { "parentPluginId": "data", "id": "def-common.IndexPatternField.lang", - "type": "string", + "type": "CompoundType", "tags": [], "label": "lang", "description": [ "\nScript field language" ], "signature": [ - "string | undefined" + "\"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined" ], "source": { "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", @@ -2766,12 +2876,12 @@ { "parentPluginId": "data", "id": "def-common.IndexPatternField.lang", - "type": "string", + "type": "CompoundType", "tags": [], "label": "lang", "description": [], "signature": [ - "string | undefined" + "\"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined" ], "source": { "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", @@ -3058,7 +3168,7 @@ "label": "toJSON", "description": [], "signature": [ - "() => { count: number; script: string | undefined; lang: string | undefined; conflictDescriptions: Record | undefined; name: string; type: string; esTypes: string[] | undefined; scripted: boolean; searchable: boolean; aggregatable: boolean; readFromDocValues: boolean; subType: ", + "() => { count: number; script: string | undefined; lang: \"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined; conflictDescriptions: Record | undefined; name: string; type: string; esTypes: string[] | undefined; scripted: boolean; searchable: boolean; aggregatable: boolean; readFromDocValues: boolean; subType: ", { "pluginId": "data", "scope": "common", @@ -4012,7 +4122,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 473 + "lineNumber": 480 }, "deprecated": false, "children": [ @@ -4028,7 +4138,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 473 + "lineNumber": 480 }, "deprecated": false, "isRequired": true @@ -4066,7 +4176,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "children": [ @@ -4088,7 +4198,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "isRequired": true @@ -4105,7 +4215,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "isRequired": true @@ -4145,7 +4255,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "children": [ @@ -4167,7 +4277,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -4186,7 +4296,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -4205,7 +4315,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -4243,7 +4353,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "children": [ @@ -4265,7 +4375,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "isRequired": true @@ -4284,7 +4394,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "isRequired": true @@ -4314,7 +4424,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 558 + "lineNumber": 570 }, "deprecated": false, "children": [ @@ -4336,7 +4446,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 559 + "lineNumber": 571 }, "deprecated": false, "isRequired": true @@ -4353,7 +4463,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 560 + "lineNumber": 572 }, "deprecated": false, "isRequired": true @@ -4370,7 +4480,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 561 + "lineNumber": 573 }, "deprecated": false, "isRequired": true @@ -4392,7 +4502,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 644 + "lineNumber": 656 }, "deprecated": false, "children": [ @@ -4410,7 +4520,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 644 + "lineNumber": 656 }, "deprecated": false, "isRequired": true @@ -4766,14 +4876,14 @@ { "parentPluginId": "data", "id": "def-common.FieldSpec.lang", - "type": "string", + "type": "CompoundType", "tags": [], "label": "lang", "description": [ "\nScripted field langauge\nPainless is the only valid scripted field language" ], "signature": [ - "string | undefined" + "\"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined" ], "source": { "path": "src/plugins/data/common/index_patterns/types.ts", @@ -5081,12 +5191,12 @@ { "parentPluginId": "data", "id": "def-common.FieldSpecExportFmt.lang", - "type": "string", + "type": "CompoundType", "tags": [], "label": "lang", "description": [], "signature": [ - "string | undefined" + "\"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined" ], "source": { "path": "src/plugins/data/common/index_patterns/types.ts", @@ -5542,7 +5652,7 @@ "plugin": "discover", "link": { "path": "src/plugins/discover/public/application/embeddable/search_embeddable.ts", - "lineNumber": 58 + "lineNumber": 59 } }, { @@ -6007,34 +6117,6 @@ "lineNumber": 222 } }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/util/field_types_utils.ts", - "lineNumber": 11 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/util/field_types_utils.ts", - "lineNumber": 16 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/page.tsx", - "lineNumber": 25 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/page.tsx", - "lineNumber": 162 - } - }, { "plugin": "infra", "link": { @@ -6511,6 +6593,20 @@ "lineNumber": 11 } }, + { + "plugin": "ml", + "link": { + "path": "x-pack/plugins/ml/public/application/util/field_types_utils.ts", + "lineNumber": 11 + } + }, + { + "plugin": "ml", + "link": { + "path": "x-pack/plugins/ml/public/application/util/field_types_utils.ts", + "lineNumber": 16 + } + }, { "plugin": "ml", "link": { @@ -6893,28 +6989,28 @@ "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 139 + "lineNumber": 141 } }, { "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 248 + "lineNumber": 250 } }, { "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 287 + "lineNumber": 290 } }, { "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 329 + "lineNumber": 332 } }, { @@ -7818,12 +7914,12 @@ { "parentPluginId": "data", "id": "def-common.IFieldType.lang", - "type": "string", + "type": "CompoundType", "tags": [], "label": "lang", "description": [], "signature": [ - "string | undefined" + "\"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined" ], "source": { "path": "src/plugins/data/common/index_patterns/fields/types.ts", @@ -8351,6 +8447,20 @@ "lineNumber": 85 } }, + { + "plugin": "lens", + "link": { + "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx", + "lineNumber": 25 + } + }, + { + "plugin": "lens", + "link": { + "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx", + "lineNumber": 102 + } + }, { "plugin": "lens", "link": { @@ -8456,20 +8566,6 @@ "lineNumber": 30 } }, - { - "plugin": "apm", - "link": { - "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", - "lineNumber": 14 - } - }, - { - "plugin": "apm", - "link": { - "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", - "lineNumber": 31 - } - }, { "plugin": "infra", "link": { @@ -8638,6 +8734,20 @@ "lineNumber": 23 } }, + { + "plugin": "apm", + "link": { + "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", + "lineNumber": 14 + } + }, + { + "plugin": "apm", + "link": { + "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", + "lineNumber": 31 + } + }, { "plugin": "lists", "link": { @@ -8670,21 +8780,21 @@ "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts", - "lineNumber": 21 + "lineNumber": 22 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts", - "lineNumber": 66 + "lineNumber": 72 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts", - "lineNumber": 19 + "lineNumber": 20 } }, { @@ -8943,21 +9053,21 @@ "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts", - "lineNumber": 44 + "lineNumber": 48 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts", - "lineNumber": 60 + "lineNumber": 64 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts", - "lineNumber": 65 + "lineNumber": 69 } }, { @@ -9408,20 +9518,6 @@ "lineNumber": 11 } }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/actions_panel/actions_panel.tsx", - "lineNumber": 25 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/actions_panel/actions_panel.tsx", - "lineNumber": 28 - } - }, { "plugin": "infra", "link": { @@ -9744,6 +9840,20 @@ "lineNumber": 30 } }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/reference_rules/query.ts", + "lineNumber": 13 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/reference_rules/query.ts", + "lineNumber": 52 + } + }, { "plugin": "stackAlerts", "link": { @@ -9947,20 +10057,6 @@ "lineNumber": 1352 } }, - { - "plugin": "discover", - "link": { - "path": "src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx", - "lineNumber": 17 - } - }, - { - "plugin": "discover", - "link": { - "path": "src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx", - "lineNumber": 26 - } - }, { "plugin": "maps", "link": { @@ -9972,7 +10068,7 @@ "plugin": "maps", "link": { "path": "x-pack/plugins/maps/public/embeddable/types.ts", - "lineNumber": 45 + "lineNumber": 44 } }, { @@ -10031,60 +10127,18 @@ "lineNumber": 57 } }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts", - "lineNumber": 14 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts", - "lineNumber": 27 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts", - "lineNumber": 213 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts", - "lineNumber": 234 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/actions.ts", - "lineNumber": 12 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/actions.ts", - "lineNumber": 17 - } - }, { "plugin": "observability", "link": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 18 + "lineNumber": 19 } }, { "plugin": "observability", "link": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 95 + "lineNumber": 104 } }, { @@ -10126,7 +10180,7 @@ "plugin": "observability", "link": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts", - "lineNumber": 24 + "lineNumber": 25 } }, { @@ -10294,14 +10348,14 @@ "plugin": "transform", "link": { "path": "x-pack/plugins/transform/server/routes/api/transforms.ts", - "lineNumber": 62 + "lineNumber": 63 } }, { "plugin": "transform", "link": { "path": "x-pack/plugins/transform/server/routes/api/transforms.ts", - "lineNumber": 404 + "lineNumber": 405 } }, { @@ -12657,7 +12711,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 650 + "lineNumber": 662 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/data_index_patterns.mdx b/api_docs/data_index_patterns.mdx index df226467aefdce..8313619594a753 100644 --- a/api_docs/data_index_patterns.mdx +++ b/api_docs/data_index_patterns.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import dataIndexPatternsObj from './data_index_patterns.json'; +Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. + +Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 3809 | 107 | 3257 | 75 | + ## Server ### Functions diff --git a/api_docs/data_query.mdx b/api_docs/data_query.mdx index ae804971a43194..751cd14dc7c5be 100644 --- a/api_docs/data_query.mdx +++ b/api_docs/data_query.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import dataQueryObj from './data_query.json'; +Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. + +Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 3809 | 107 | 3257 | 75 | + ## Client ### Functions diff --git a/api_docs/data_search.json b/api_docs/data_search.json index d72ae79e79bd87..99c04298c27cbd 100644 --- a/api_docs/data_search.json +++ b/api_docs/data_search.json @@ -1447,12 +1447,12 @@ { "parentPluginId": "data", "id": "def-public.Reason.lang", - "type": "string", + "type": "CompoundType", "tags": [], "label": "lang", "description": [], "signature": [ - "string | undefined" + "\"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined" ], "source": { "path": "src/plugins/data/public/search/errors/types.ts", @@ -2272,7 +2272,7 @@ "label": "getShardTimeout", "description": [], "signature": [ - "(config: Readonly<{ kibana: Readonly<{ readonly index: string; readonly autocompleteTerminateAfter: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly autocompleteTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; elasticsearch: Readonly<{ readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; path: Readonly<{ readonly data: string; }>; savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", + "(config: Readonly<{ kibana: Readonly<{ readonly index: string; }>; elasticsearch: Readonly<{ readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; path: Readonly<{ readonly data: string; }>; savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", "ByteSizeValue", ") => boolean; isLessThan: (other: ", "ByteSizeValue", @@ -2298,7 +2298,7 @@ "label": "config", "description": [], "signature": [ - "Readonly<{ kibana: Readonly<{ readonly index: string; readonly autocompleteTerminateAfter: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly autocompleteTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; elasticsearch: Readonly<{ readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; path: Readonly<{ readonly data: string; }>; savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", + "Readonly<{ kibana: Readonly<{ readonly index: string; }>; elasticsearch: Readonly<{ readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; path: Readonly<{ readonly data: string; }>; savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", "ByteSizeValue", ") => boolean; isLessThan: (other: ", "ByteSizeValue", @@ -2820,7 +2820,7 @@ "description": [], "signature": [ "{ filter?: any; aggs?: Record | undefined; fields?: string[] | undefined; searchAfter?: string[] | undefined; page?: number | undefined; perPage?: number | undefined; sortField?: string | undefined; sortOrder?: \"asc\" | \"desc\" | \"_doc\" | undefined; search?: string | undefined; searchFields?: string[] | undefined; rootSearchFields?: string[] | undefined; hasReference?: ", { "pluginId": "core", @@ -4164,7 +4164,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 55 + "lineNumber": 57 }, "deprecated": false, "children": [ @@ -4184,7 +4184,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 63 + "lineNumber": 65 }, "deprecated": false, "children": [ @@ -4202,7 +4202,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 63 + "lineNumber": 65 }, "deprecated": false, "isRequired": true @@ -4236,7 +4236,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 83 + "lineNumber": 85 }, "deprecated": false, "children": [ @@ -4259,7 +4259,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 83 + "lineNumber": 85 }, "deprecated": false, "isRequired": true @@ -4287,7 +4287,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 92 + "lineNumber": 94 }, "deprecated": false }, @@ -4300,7 +4300,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 93 + "lineNumber": 95 }, "deprecated": false }, @@ -4313,7 +4313,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 94 + "lineNumber": 96 }, "deprecated": false }, @@ -4329,7 +4329,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 95 + "lineNumber": 97 }, "deprecated": false }, @@ -4352,7 +4352,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 96 + "lineNumber": 98 }, "deprecated": false }, @@ -4368,7 +4368,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 97 + "lineNumber": 99 }, "deprecated": false }, @@ -4384,7 +4384,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 98 + "lineNumber": 100 }, "deprecated": false }, @@ -4400,7 +4400,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 104 + "lineNumber": 106 }, "deprecated": false, "children": [ @@ -4422,7 +4422,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 104 + "lineNumber": 106 }, "deprecated": false, "isRequired": true @@ -4457,7 +4457,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 104 + "lineNumber": 106 }, "deprecated": false, "isRequired": true @@ -4481,7 +4481,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 134 + "lineNumber": 136 }, "deprecated": false, "children": [ @@ -4499,7 +4499,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 134 + "lineNumber": 136 }, "deprecated": false, "isRequired": true @@ -4519,7 +4519,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 171 + "lineNumber": 173 }, "deprecated": false, "children": [ @@ -4535,7 +4535,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 171 + "lineNumber": 173 }, "deprecated": false, "isRequired": true @@ -4543,6 +4543,42 @@ ], "returnComment": [] }, + { + "parentPluginId": "data", + "id": "def-common.AggConfig.hasTimeShift", + "type": "Function", + "tags": [], + "label": "hasTimeShift", + "description": [], + "signature": [ + "() => boolean" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_config.ts", + "lineNumber": 177 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.AggConfig.getTimeShift", + "type": "Function", + "tags": [], + "label": "getTimeShift", + "description": [], + "signature": [ + "() => moment.Duration | undefined" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_config.ts", + "lineNumber": 181 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, { "parentPluginId": "data", "id": "def-common.AggConfig.write", @@ -4563,7 +4599,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 175 + "lineNumber": 202 }, "deprecated": false, "children": [ @@ -4586,7 +4622,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 175 + "lineNumber": 202 }, "deprecated": false, "isRequired": false @@ -4606,7 +4642,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 179 + "lineNumber": 206 }, "deprecated": false, "children": [], @@ -4624,7 +4660,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 183 + "lineNumber": 210 }, "deprecated": false, "children": [ @@ -4640,7 +4676,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 183 + "lineNumber": 210 }, "deprecated": false, "isRequired": true @@ -4657,7 +4693,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 183 + "lineNumber": 210 }, "deprecated": false, "isRequired": true @@ -4697,7 +4733,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 209 + "lineNumber": 236 }, "deprecated": false, "children": [ @@ -4721,7 +4757,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 209 + "lineNumber": 236 }, "deprecated": false, "isRequired": true @@ -4745,7 +4781,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 209 + "lineNumber": 236 }, "deprecated": false, "isRequired": false @@ -4777,7 +4813,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 230 + "lineNumber": 257 }, "deprecated": false, "children": [ @@ -4802,7 +4838,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 230 + "lineNumber": 257 }, "deprecated": false, "isRequired": false @@ -4826,7 +4862,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 265 + "lineNumber": 292 }, "deprecated": false, "children": [], @@ -4850,7 +4886,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 296 + "lineNumber": 323 }, "deprecated": true, "references": [ @@ -4879,7 +4915,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 307 + "lineNumber": 334 }, "deprecated": false, "children": [], @@ -4905,7 +4941,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 316 + "lineNumber": 343 }, "deprecated": false, "children": [], @@ -4941,7 +4977,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 371 + "lineNumber": 398 }, "deprecated": false, "children": [], @@ -4967,7 +5003,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 375 + "lineNumber": 402 }, "deprecated": false, "children": [], @@ -4993,7 +5029,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 379 + "lineNumber": 406 }, "deprecated": false, "children": [], @@ -5011,7 +5047,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 383 + "lineNumber": 410 }, "deprecated": false, "children": [ @@ -5027,7 +5063,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 383 + "lineNumber": 410 }, "deprecated": false, "isRequired": true @@ -5047,7 +5083,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 387 + "lineNumber": 414 }, "deprecated": false, "children": [ @@ -5063,7 +5099,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 387 + "lineNumber": 414 }, "deprecated": false, "isRequired": true @@ -5080,7 +5116,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 387 + "lineNumber": 414 }, "deprecated": false, "isRequired": false @@ -5100,7 +5136,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 395 + "lineNumber": 422 }, "deprecated": false, "children": [], @@ -5118,7 +5154,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 401 + "lineNumber": 428 }, "deprecated": false, "children": [], @@ -5138,7 +5174,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 410 + "lineNumber": 437 }, "deprecated": false, "children": [], @@ -5156,7 +5192,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 414 + "lineNumber": 441 }, "deprecated": false, "children": [ @@ -5172,7 +5208,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 414 + "lineNumber": 441 }, "deprecated": false, "isRequired": true @@ -5199,7 +5235,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 428 + "lineNumber": 455 }, "deprecated": false, "children": [], @@ -5225,7 +5261,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 432 + "lineNumber": 459 }, "deprecated": false, "children": [], @@ -5243,7 +5279,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 436 + "lineNumber": 463 }, "deprecated": false, "children": [], @@ -5261,7 +5297,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 441 + "lineNumber": 468 }, "deprecated": false, "children": [], @@ -5310,7 +5346,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 452 + "lineNumber": 479 }, "deprecated": false }, @@ -5357,7 +5393,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 456 + "lineNumber": 483 }, "deprecated": false }, @@ -5381,7 +5417,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 486 + "lineNumber": 513 }, "deprecated": false, "children": [ @@ -5403,7 +5439,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 486 + "lineNumber": 513 }, "deprecated": false, "isRequired": true @@ -5423,7 +5459,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 65 + "lineNumber": 78 }, "deprecated": false, "children": [ @@ -5445,7 +5481,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 66 + "lineNumber": 79 }, "deprecated": false }, @@ -5468,7 +5504,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 67 + "lineNumber": 80 }, "deprecated": false }, @@ -5484,7 +5520,23 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 68 + "lineNumber": 81 + }, + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.AggConfigs.forceNow", + "type": "Object", + "tags": [], + "label": "forceNow", + "description": [], + "signature": [ + "Date | undefined" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 82 }, "deprecated": false }, @@ -5500,7 +5552,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 69 + "lineNumber": 83 }, "deprecated": false }, @@ -5523,7 +5575,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 73 + "lineNumber": 87 }, "deprecated": false }, @@ -5539,7 +5591,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 75 + "lineNumber": 89 }, "deprecated": false, "children": [ @@ -5561,7 +5613,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 76 + "lineNumber": 90 }, "deprecated": false, "isRequired": true @@ -5596,7 +5648,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 77 + "lineNumber": 91 }, "deprecated": false, "isRequired": true @@ -5619,7 +5671,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 78 + "lineNumber": 92 }, "deprecated": false, "isRequired": true @@ -5639,7 +5691,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 91 + "lineNumber": 105 }, "deprecated": false, "children": [ @@ -5655,7 +5707,43 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 91 + "lineNumber": 105 + }, + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.AggConfigs.setForceNow", + "type": "Function", + "tags": [], + "label": "setForceNow", + "description": [], + "signature": [ + "(now: Date | undefined) => void" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 109 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.AggConfigs.setForceNow.$1", + "type": "Object", + "tags": [], + "label": "now", + "description": [], + "signature": [ + "Date | undefined" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 109 }, "deprecated": false, "isRequired": false @@ -5683,7 +5771,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 95 + "lineNumber": 113 }, "deprecated": false, "children": [ @@ -5705,7 +5793,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 95 + "lineNumber": 113 }, "deprecated": false, "isRequired": true @@ -5732,7 +5820,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 113 + "lineNumber": 131 }, "deprecated": false, "children": [ @@ -5748,7 +5836,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 113 + "lineNumber": 131 }, "deprecated": false, "isRequired": true @@ -5802,7 +5890,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 126 + "lineNumber": 144 }, "deprecated": false, "children": [ @@ -5836,7 +5924,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 127 + "lineNumber": 145 }, "deprecated": false, "isRequired": true @@ -5853,7 +5941,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 128 + "lineNumber": 146 }, "deprecated": false, "isRequired": true @@ -5883,7 +5971,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 169 + "lineNumber": 187 }, "deprecated": false, "children": [ @@ -5908,7 +5996,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 169 + "lineNumber": 187 }, "deprecated": false, "isRequired": true @@ -5928,7 +6016,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 181 + "lineNumber": 199 }, "deprecated": false, "children": [], @@ -5954,7 +6042,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 250 + "lineNumber": 289 }, "deprecated": false, "children": [], @@ -5979,7 +6067,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 254 + "lineNumber": 293 }, "deprecated": false, "children": [ @@ -5995,7 +6083,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 254 + "lineNumber": 293 }, "deprecated": false, "isRequired": true @@ -6023,7 +6111,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 258 + "lineNumber": 297 }, "deprecated": false, "children": [ @@ -6039,7 +6127,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 258 + "lineNumber": 297 }, "deprecated": false, "isRequired": true @@ -6067,7 +6155,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 262 + "lineNumber": 301 }, "deprecated": false, "children": [ @@ -6083,7 +6171,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 262 + "lineNumber": 301 }, "deprecated": false, "isRequired": true @@ -6111,7 +6199,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 266 + "lineNumber": 305 }, "deprecated": false, "children": [ @@ -6127,7 +6215,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 266 + "lineNumber": 305 }, "deprecated": false, "isRequired": true @@ -6155,7 +6243,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 270 + "lineNumber": 309 }, "deprecated": false, "children": [ @@ -6171,7 +6259,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 270 + "lineNumber": 309 }, "deprecated": false, "isRequired": true @@ -6199,7 +6287,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 274 + "lineNumber": 313 }, "deprecated": false, "children": [ @@ -6215,7 +6303,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 274 + "lineNumber": 313 }, "deprecated": false, "isRequired": true @@ -6243,7 +6331,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 278 + "lineNumber": 317 }, "deprecated": false, "children": [], @@ -6251,73 +6339,35 @@ }, { "parentPluginId": "data", - "id": "def-common.AggConfigs.getRequestAggById", + "id": "def-common.AggConfigs.getTimeShifts", "type": "Function", "tags": [], - "label": "getRequestAggById", + "label": "getTimeShifts", "description": [], "signature": [ - "(id: string) => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfig", - "text": "AggConfig" - }, - " | undefined" + "() => Record" ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 292 + "lineNumber": 331 }, "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.AggConfigs.getRequestAggById.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 292 - }, - "deprecated": false, - "isRequired": true - } - ], + "children": [], "returnComment": [] }, { "parentPluginId": "data", - "id": "def-common.AggConfigs.getResponseAggs", + "id": "def-common.AggConfigs.getTimeShiftInterval", "type": "Function", - "tags": [ - "return" - ], - "label": "getResponseAggs", - "description": [ - "\nGets the AggConfigs (and possibly ResponseAggConfigs) that\nrepresent the values that will be produced when all aggs\nare run.\n\nWith multi-value metric aggs it is possible for a single agg\nrequest to result in multiple agg values, which is why the length\nof a vis' responseValuesAggs may be different than the vis' aggs\n" - ], + "tags": [], + "label": "getTimeShiftInterval", + "description": [], "signature": [ - "() => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfig", - "text": "AggConfig" - }, - "[]" + "() => moment.Duration | undefined" ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 307 + "lineNumber": 346 }, "deprecated": false, "children": [], @@ -6325,83 +6375,278 @@ }, { "parentPluginId": "data", - "id": "def-common.AggConfigs.getResponseAggById", + "id": "def-common.AggConfigs.hasTimeShifts", "type": "Function", - "tags": [ - "return" - ], - "label": "getResponseAggById", - "description": [ - "\nFind a response agg by it's id. This may be an agg in the aggConfigs, or one\ncreated specifically for a response value\n" + "tags": [], + "label": "hasTimeShifts", + "description": [], + "signature": [ + "() => boolean" ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 353 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.AggConfigs.getSearchSourceTimeFilter", + "type": "Function", + "tags": [], + "label": "getSearchSourceTimeFilter", + "description": [], "signature": [ - "(id: string) => ", + "(forceNow?: Date | undefined) => ", { "pluginId": "data", "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfig", - "text": "AggConfig" + "docId": "kibDataPluginApi", + "section": "def-common.RangeFilter", + "text": "RangeFilter" }, - " | undefined" + "[] | { meta: { index: string | undefined; params: {}; alias: string; disabled: boolean; negate: boolean; }; query: { bool: { should: { bool: { filter: { range: { [x: string]: { gte: string; lte: string; }; }; }[]; }; }[]; minimum_should_match: number; }; }; }[]" ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 321 + "lineNumber": 357 }, "deprecated": false, "children": [ { "parentPluginId": "data", - "id": "def-common.AggConfigs.getResponseAggById.$1", - "type": "string", + "id": "def-common.AggConfigs.getSearchSourceTimeFilter.$1", + "type": "Object", "tags": [], - "label": "id", - "description": [ - "- the id of the agg to find" - ], + "label": "forceNow", + "description": [], "signature": [ - "string" + "Date | undefined" ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 321 + "lineNumber": 357 }, "deprecated": false, - "isRequired": true + "isRequired": false } ], "returnComment": [] }, { "parentPluginId": "data", - "id": "def-common.AggConfigs.onSearchRequestStart", + "id": "def-common.AggConfigs.postFlightTransform", "type": "Function", "tags": [], - "label": "onSearchRequestStart", + "label": "postFlightTransform", "description": [], "signature": [ - "(searchSource: Pick<", + "(response: ", { "pluginId": "data", "scope": "common", "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSource", - "text": "SearchSource" + "section": "def-common.IEsSearchResponse", + "text": "IEsSearchResponse" }, - ", \"create\" | \"history\" | \"setPreferredSearchStrategyId\" | \"setField\" | \"removeField\" | \"setFields\" | \"getId\" | \"getFields\" | \"getField\" | \"getOwnField\" | \"createCopy\" | \"createChild\" | \"setParent\" | \"getParent\" | \"fetch$\" | \"fetch\" | \"onRequestStart\" | \"getSearchRequestBody\" | \"destroy\" | \"getSerializedFields\" | \"serialize\">, options?: ", + ") => ", { "pluginId": "data", "scope": "common", "docId": "kibDataSearchPluginApi", - "section": "def-common.ISearchOptions", - "text": "ISearchOptions" + "section": "def-common.IEsSearchResponse", + "text": "IEsSearchResponse" }, - " | undefined) => Promise<[unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown]>" + "" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 410 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.AggConfigs.postFlightTransform.$1", + "type": "Object", + "tags": [], + "label": "response", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IEsSearchResponse", + "text": "IEsSearchResponse" + }, + "" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 410 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.AggConfigs.getRequestAggById", + "type": "Function", + "tags": [], + "label": "getRequestAggById", + "description": [], + "signature": [ + "(id: string) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfig", + "text": "AggConfig" + }, + " | undefined" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 429 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.AggConfigs.getRequestAggById.$1", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "signature": [ + "string" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 429 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.AggConfigs.getResponseAggs", + "type": "Function", + "tags": [ + "return" + ], + "label": "getResponseAggs", + "description": [ + "\nGets the AggConfigs (and possibly ResponseAggConfigs) that\nrepresent the values that will be produced when all aggs\nare run.\n\nWith multi-value metric aggs it is possible for a single agg\nrequest to result in multiple agg values, which is why the length\nof a vis' responseValuesAggs may be different than the vis' aggs\n" + ], + "signature": [ + "() => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfig", + "text": "AggConfig" + }, + "[]" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 444 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.AggConfigs.getResponseAggById", + "type": "Function", + "tags": [ + "return" + ], + "label": "getResponseAggById", + "description": [ + "\nFind a response agg by it's id. This may be an agg in the aggConfigs, or one\ncreated specifically for a response value\n" + ], + "signature": [ + "(id: string) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfig", + "text": "AggConfig" + }, + " | undefined" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 458 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.AggConfigs.getResponseAggById.$1", + "type": "string", + "tags": [], + "label": "id", + "description": [ + "- the id of the agg to find" + ], + "signature": [ + "string" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 458 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.AggConfigs.onSearchRequestStart", + "type": "Function", + "tags": [], + "label": "onSearchRequestStart", + "description": [], + "signature": [ + "(searchSource: Pick<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSource", + "text": "SearchSource" + }, + ", \"create\" | \"history\" | \"setPreferredSearchStrategyId\" | \"setField\" | \"removeField\" | \"setFields\" | \"getId\" | \"getFields\" | \"getField\" | \"getOwnField\" | \"createCopy\" | \"createChild\" | \"setParent\" | \"getParent\" | \"fetch$\" | \"fetch\" | \"onRequestStart\" | \"getSearchRequestBody\" | \"destroy\" | \"getSerializedFields\" | \"serialize\">, options?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ISearchOptions", + "text": "ISearchOptions" + }, + " | undefined) => Promise<[unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown]>" ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 330 + "lineNumber": 467 }, "deprecated": false, "children": [ @@ -6425,7 +6670,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 330 + "lineNumber": 467 }, "deprecated": false, "isRequired": true @@ -6449,7 +6694,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 330 + "lineNumber": 467 }, "deprecated": false, "isRequired": false @@ -7629,6 +7874,73 @@ ], "returnComment": [] }, + { + "parentPluginId": "data", + "id": "def-common.AggType.splitForTimeShift", + "type": "Function", + "tags": [], + "label": "splitForTimeShift", + "description": [], + "signature": [ + "(agg: TAggConfig, aggs: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfigs", + "text": "AggConfigs" + }, + ") => boolean" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_type.ts", + "lineNumber": 218 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.AggType.splitForTimeShift.$1", + "type": "Uncategorized", + "tags": [], + "label": "agg", + "description": [], + "signature": [ + "TAggConfig" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_type.ts", + "lineNumber": 218 + }, + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "data", + "id": "def-common.AggType.splitForTimeShift.$2", + "type": "Object", + "tags": [], + "label": "aggs", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfigs", + "text": "AggConfigs" + } + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_type.ts", + "lineNumber": 218 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "data", "id": "def-common.AggType.Unnamed", @@ -7646,7 +7958,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 227 + "lineNumber": 231 }, "deprecated": false, "children": [ @@ -7679,7 +7991,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 227 + "lineNumber": 231 }, "deprecated": false, "isRequired": true @@ -8296,7 +8608,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 31 + "lineNumber": 40 }, "deprecated": false, "children": [ @@ -8312,7 +8624,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 35 + "lineNumber": 44 }, "deprecated": false, "returnComment": [], @@ -8329,7 +8641,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 35 + "lineNumber": 44 }, "deprecated": false }, @@ -8345,40 +8657,244 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 35 + "lineNumber": 44 + }, + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.agg", + "type": "Uncategorized", + "tags": [], + "label": "agg", + "description": [], + "signature": [ + "TBucketAggConfig" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", + "lineNumber": 44 }, "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-common.BucketAggType.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", + "lineNumber": 45 + }, + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.BucketAggType.getShiftedKey", + "type": "Function", + "tags": [], + "label": "getShiftedKey", + "description": [], + "signature": [ + "(agg: TBucketAggConfig, key: React.ReactText, timeShift: moment.Duration) => React.ReactText" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", + "lineNumber": 47 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.BucketAggType.getShiftedKey.$1", + "type": "Uncategorized", + "tags": [], + "label": "agg", + "description": [], + "signature": [ + "TBucketAggConfig" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", + "lineNumber": 48 + }, + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "data", + "id": "def-common.BucketAggType.getShiftedKey.$2", + "type": "CompoundType", + "tags": [], + "label": "key", + "description": [], + "signature": [ + "React.ReactText" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", + "lineNumber": 49 + }, + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "data", + "id": "def-common.BucketAggType.getShiftedKey.$3", + "type": "Object", + "tags": [], + "label": "timeShift", + "description": [], + "signature": [ + "moment.Duration" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", + "lineNumber": 50 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.BucketAggType.getTimeShiftInterval", + "type": "Function", + "tags": [], + "label": "getTimeShiftInterval", + "description": [], + "signature": [ + "(agg: TBucketAggConfig) => moment.Duration | undefined" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", + "lineNumber": 55 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.BucketAggType.getTimeShiftInterval.$1", + "type": "Uncategorized", + "tags": [], + "label": "agg", + "description": [], + "signature": [ + "TBucketAggConfig" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", + "lineNumber": 55 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.BucketAggType.orderBuckets", + "type": "Function", + "tags": [], + "label": "orderBuckets", + "description": [], + "signature": [ + "(agg: TBucketAggConfig, a: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GenericBucket", + "text": "GenericBucket" + }, + ", b: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GenericBucket", + "text": "GenericBucket" + }, + ") => number" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", + "lineNumber": 59 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.BucketAggType.orderBuckets.$1", + "type": "Uncategorized", + "tags": [], + "label": "agg", + "description": [], + "signature": [ + "TBucketAggConfig" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", + "lineNumber": 59 + }, + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "data", + "id": "def-common.BucketAggType.orderBuckets.$2", + "type": "CompoundType", + "tags": [], + "label": "a", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GenericBucket", + "text": "GenericBucket" + } + ], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", + "lineNumber": 59 + }, + "deprecated": false, + "isRequired": true }, { "parentPluginId": "data", - "id": "def-common.agg", - "type": "Uncategorized", + "id": "def-common.BucketAggType.orderBuckets.$3", + "type": "CompoundType", "tags": [], - "label": "agg", + "label": "b", "description": [], "signature": [ - "TBucketAggConfig" + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GenericBucket", + "text": "GenericBucket" + } ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 35 + "lineNumber": 59 }, - "deprecated": false + "deprecated": false, + "isRequired": true } - ] - }, - { - "parentPluginId": "data", - "id": "def-common.BucketAggType.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "source": { - "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 36 - }, - "deprecated": false + ], + "returnComment": [] }, { "parentPluginId": "data", @@ -8392,7 +8908,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 38 + "lineNumber": 63 }, "deprecated": false, "children": [ @@ -8408,7 +8924,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 38 + "lineNumber": 63 }, "deprecated": false, "isRequired": true @@ -9091,7 +9607,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 37 + "lineNumber": 38 }, "deprecated": false, "children": [ @@ -9104,7 +9620,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 41 + "lineNumber": 42 }, "deprecated": false }, @@ -9120,7 +9636,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 42 + "lineNumber": 43 }, "deprecated": false, "returnComment": [], @@ -9135,7 +9651,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 43 + "lineNumber": 44 }, "deprecated": false }, @@ -9151,7 +9667,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 45 + "lineNumber": 46 }, "deprecated": false, "children": [], @@ -9169,7 +9685,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 47 + "lineNumber": 48 }, "deprecated": false, "children": [ @@ -9185,7 +9701,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 47 + "lineNumber": 48 }, "deprecated": false, "isRequired": true @@ -9431,7 +9947,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 121 + "lineNumber": 127 }, "deprecated": false, "children": [ @@ -9447,7 +9963,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 129 + "lineNumber": 135 }, "deprecated": false }, @@ -9463,7 +9979,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 133 + "lineNumber": 139 }, "deprecated": false, "children": [ @@ -9485,7 +10001,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 133 + "lineNumber": 139 }, "deprecated": false, "isRequired": true @@ -9508,7 +10024,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 133 + "lineNumber": 139 }, "deprecated": false, "isRequired": true @@ -9530,7 +10046,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 151 + "lineNumber": 157 }, "deprecated": false, "children": [ @@ -9546,7 +10062,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 151 + "lineNumber": 157 }, "deprecated": false, "isRequired": true @@ -9576,7 +10092,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 160 + "lineNumber": 166 }, "deprecated": false, "children": [ @@ -9594,7 +10110,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 160 + "lineNumber": 166 }, "deprecated": false, "isRequired": true @@ -9620,7 +10136,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 160 + "lineNumber": 166 }, "deprecated": false, "isRequired": true @@ -9642,7 +10158,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 172 + "lineNumber": 178 }, "deprecated": false, "children": [ @@ -9660,7 +10176,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 172 + "lineNumber": 178 }, "deprecated": false, "isRequired": true @@ -9692,7 +10208,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 183 + "lineNumber": 189 }, "deprecated": false, "children": [ @@ -9716,7 +10232,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 183 + "lineNumber": 189 }, "deprecated": false, "isRequired": true @@ -9738,7 +10254,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 191 + "lineNumber": 197 }, "deprecated": false, "children": [], @@ -9765,7 +10281,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 198 + "lineNumber": 204 }, "deprecated": false, "children": [], @@ -9793,7 +10309,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 205 + "lineNumber": 211 }, "deprecated": false, "children": [ @@ -9809,7 +10325,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 205 + "lineNumber": 211 }, "deprecated": false, "isRequired": true @@ -9826,7 +10342,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 205 + "lineNumber": 211 }, "deprecated": false, "isRequired": true @@ -9856,7 +10372,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 216 + "lineNumber": 222 }, "deprecated": false, "children": [ @@ -9872,7 +10388,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 216 + "lineNumber": 222 }, "deprecated": false, "isRequired": true @@ -9901,7 +10417,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 223 + "lineNumber": 229 }, "deprecated": true, "references": [ @@ -9909,14 +10425,14 @@ "plugin": "discover", "link": { "path": "src/plugins/discover/public/application/embeddable/search_embeddable.ts", - "lineNumber": 206 + "lineNumber": 207 } }, { "plugin": "discover", "link": { "path": "src/plugins/discover/public/application/embeddable/search_embeddable.ts", - "lineNumber": 212 + "lineNumber": 213 } } ], @@ -9944,7 +10460,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 230 + "lineNumber": 236 }, "deprecated": false, "children": [], @@ -9971,7 +10487,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 244 + "lineNumber": 250 }, "deprecated": false, "children": [ @@ -9987,7 +10503,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 244 + "lineNumber": 250 }, "deprecated": false, "isRequired": true @@ -10027,7 +10543,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 256 + "lineNumber": 262 }, "deprecated": false, "children": [ @@ -10053,7 +10569,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 256 + "lineNumber": 262 }, "deprecated": false, "isRequired": false @@ -10078,7 +10594,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 256 + "lineNumber": 262 }, "deprecated": false, "isRequired": true @@ -10112,7 +10628,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 266 + "lineNumber": 272 }, "deprecated": false, "children": [], @@ -10152,7 +10668,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 274 + "lineNumber": 280 }, "deprecated": false, "children": [ @@ -10174,7 +10690,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 275 + "lineNumber": 281 }, "deprecated": false, "isRequired": true @@ -10208,7 +10724,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 312 + "lineNumber": 318 }, "deprecated": true, "references": [ @@ -10219,13 +10735,6 @@ "lineNumber": 77 } }, - { - "plugin": "discover", - "link": { - "path": "src/plugins/discover/public/application/angular/context/api/anchor.ts", - "lineNumber": 57 - } - }, { "plugin": "maps", "link": { @@ -10267,7 +10776,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 312 + "lineNumber": 318 }, "deprecated": false, "isRequired": true @@ -10307,7 +10816,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 325 + "lineNumber": 331 }, "deprecated": false, "children": [ @@ -10339,7 +10848,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 326 + "lineNumber": 332 }, "deprecated": false, "isRequired": true @@ -10361,7 +10870,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 334 + "lineNumber": 340 }, "deprecated": false, "children": [], @@ -10383,7 +10892,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 342 + "lineNumber": 348 }, "deprecated": false, "children": [], @@ -10410,7 +10919,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 831 + "lineNumber": 848 }, "deprecated": false, "children": [ @@ -10426,7 +10935,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 831 + "lineNumber": 848 }, "deprecated": false, "isRequired": true @@ -10450,7 +10959,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 860 + "lineNumber": 877 }, "deprecated": false, "children": [], @@ -13926,7 +14435,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 63 + "lineNumber": 64 }, "deprecated": false, "children": [], @@ -13982,7 +14491,7 @@ ], "source": { "path": "src/plugins/data/common/search/expressions/esaggs/request_handler.ts", - "lineNumber": 43 + "lineNumber": 35 }, "deprecated": false, "children": [ @@ -13998,7 +14507,7 @@ ], "source": { "path": "src/plugins/data/common/search/expressions/esaggs/request_handler.ts", - "lineNumber": 43 + "lineNumber": 35 }, "deprecated": false, "isRequired": true @@ -14251,7 +14760,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 49 + "lineNumber": 90 }, "deprecated": false, "children": [ @@ -14267,7 +14776,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 49 + "lineNumber": 90 }, "deprecated": false, "isRequired": true @@ -14433,7 +14942,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 75 + "lineNumber": 92 }, "deprecated": false, "children": [ @@ -14449,7 +14958,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 75 + "lineNumber": 92 }, "deprecated": false, "isRequired": true @@ -14926,6 +15435,45 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "data", + "id": "def-common.parseTimeShift", + "type": "Function", + "tags": [], + "label": "parseTimeShift", + "description": [ + "\nThis method parses a string into a time shift duration.\nIf parsing fails, 'invalid' is returned.\nAllowed values are the string 'previous' and an integer followed by the units s,m,h,d,w,M,y" + ], + "signature": [ + "(val: string) => moment.Duration | \"previous\" | \"invalid\"" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/utils/parse_time_shift.ts", + "lineNumber": 18 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.parseTimeShift.$1", + "type": "string", + "tags": [], + "label": "val", + "description": [], + "signature": [ + "string" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/utils/parse_time_shift.ts", + "lineNumber": 18 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "data", "id": "def-common.pollSearch", @@ -15561,7 +16109,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 44 + "lineNumber": 53 }, "deprecated": false, "children": [ @@ -15577,7 +16125,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 45 + "lineNumber": 54 }, "deprecated": false }, @@ -15593,7 +16141,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 46 + "lineNumber": 55 }, "deprecated": false } @@ -15611,7 +16159,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 195 + "lineNumber": 196 }, "deprecated": false, "children": [ @@ -15640,7 +16188,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".FILTER>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"geo_bounding_box\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"filter\">, \"enabled\" | \"id\" | \"filter\" | \"customLabel\" | \"schema\" | \"geo_bounding_box\" | \"json\">, ", + ".FILTER>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"geo_bounding_box\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"filter\">, \"enabled\" | \"id\" | \"filter\" | \"customLabel\" | \"schema\" | \"geo_bounding_box\" | \"json\" | \"timeShift\">, ", "AggExpressionType", ", ", { @@ -15664,7 +16212,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 196 + "lineNumber": 197 }, "deprecated": false }, @@ -15693,7 +16241,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".FILTERS>, \"enabled\" | \"id\" | \"schema\" | \"json\"> & Pick<{ filters?: string | undefined; }, \"filters\"> & Pick<{ filters?: string | undefined; }, never>, \"enabled\" | \"filters\" | \"id\" | \"schema\" | \"json\">, ", + ".FILTERS>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ filters?: string | undefined; }, \"filters\"> & Pick<{ filters?: string | undefined; }, never>, \"enabled\" | \"filters\" | \"id\" | \"schema\" | \"json\" | \"timeShift\">, ", "AggExpressionType", ", ", { @@ -15717,7 +16265,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 197 + "lineNumber": 198 }, "deprecated": false }, @@ -15770,7 +16318,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 198 + "lineNumber": 199 }, "deprecated": false }, @@ -15799,7 +16347,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".IP_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, \"ipRangeType\" | \"ranges\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"ipRangeType\" | \"ranges\">, ", + ".IP_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, \"ipRangeType\" | \"ranges\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ipRangeType\" | \"ranges\">, ", "AggExpressionType", ", ", { @@ -15823,7 +16371,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 199 + "lineNumber": 200 }, "deprecated": false }, @@ -15852,7 +16400,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".DATE_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"time_zone\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"ranges\" | \"time_zone\">, ", + ".DATE_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ranges\" | \"time_zone\">, ", "AggExpressionType", ", ", { @@ -15876,7 +16424,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 200 + "lineNumber": 201 }, "deprecated": false }, @@ -15905,7 +16453,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"ranges\">, ", + ".RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ranges\">, ", "AggExpressionType", ", ", { @@ -15929,7 +16477,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 201 + "lineNumber": 202 }, "deprecated": false }, @@ -15982,7 +16530,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 202 + "lineNumber": 203 }, "deprecated": false }, @@ -16011,7 +16559,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".GEOHASH_GRID>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\"> & Pick<{ boundingBox?: string | undefined; }, \"boundingBox\"> & Pick<{ boundingBox?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\" | \"boundingBox\">, ", + ".GEOHASH_GRID>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\"> & Pick<{ boundingBox?: string | undefined; }, \"boundingBox\"> & Pick<{ boundingBox?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\" | \"boundingBox\">, ", "AggExpressionType", ", ", { @@ -16035,7 +16583,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 203 + "lineNumber": 204 }, "deprecated": false }, @@ -16064,7 +16612,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, \"extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\" | \"extended_bounds\">, ", + ".HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, \"extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\" | \"extended_bounds\">, ", "AggExpressionType", ", ", { @@ -16088,7 +16636,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 204 + "lineNumber": 205 }, "deprecated": false }, @@ -16117,7 +16665,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".DATE_HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, \"timeRange\" | \"extended_bounds\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"timeRange\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"extended_bounds\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\">, ", + ".DATE_HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, \"timeRange\" | \"extended_bounds\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"timeRange\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"extended_bounds\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\">, ", "AggExpressionType", ", ", { @@ -16141,7 +16689,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 205 + "lineNumber": 206 }, "deprecated": false }, @@ -16170,11 +16718,11 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".TERMS>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"orderBy\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\"> & Pick<{ orderAgg?: ", + ".TERMS>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"orderBy\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\"> & Pick<{ orderAgg?: ", "AggExpressionType", " | undefined; }, \"orderAgg\"> & Pick<{ orderAgg?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"orderBy\" | \"orderAgg\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"orderBy\" | \"orderAgg\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\">, ", "AggExpressionType", ", ", { @@ -16198,7 +16746,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 206 + "lineNumber": 207 }, "deprecated": false }, @@ -16251,7 +16799,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 207 + "lineNumber": 208 }, "deprecated": false }, @@ -16280,7 +16828,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".AVG_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".AVG_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -16288,7 +16836,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -16312,7 +16860,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 208 + "lineNumber": 209 }, "deprecated": false }, @@ -16341,7 +16889,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".MAX_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".MAX_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -16349,7 +16897,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -16373,7 +16921,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 209 + "lineNumber": 210 }, "deprecated": false }, @@ -16402,7 +16950,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".MIN_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".MIN_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -16410,7 +16958,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -16434,7 +16982,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 210 + "lineNumber": 211 }, "deprecated": false }, @@ -16463,7 +17011,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".SUM_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".SUM_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -16471,7 +17019,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -16495,7 +17043,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 211 + "lineNumber": 212 }, "deprecated": false }, @@ -16524,7 +17072,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".FILTERED_METRIC>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".FILTERED_METRIC>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -16532,7 +17080,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -16556,7 +17104,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 212 + "lineNumber": 213 }, "deprecated": false }, @@ -16609,7 +17157,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 213 + "lineNumber": 214 }, "deprecated": false }, @@ -16662,7 +17210,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 214 + "lineNumber": 215 }, "deprecated": false }, @@ -16691,11 +17239,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".CUMULATIVE_SUM>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + ".CUMULATIVE_SUM>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", "AggExpressionType", ", ", { @@ -16719,7 +17267,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 215 + "lineNumber": 216 }, "deprecated": false }, @@ -16748,11 +17296,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".DERIVATIVE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + ".DERIVATIVE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", "AggExpressionType", ", ", { @@ -16776,7 +17324,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 216 + "lineNumber": 217 }, "deprecated": false }, @@ -16829,7 +17377,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 217 + "lineNumber": 218 }, "deprecated": false }, @@ -16882,7 +17430,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 218 + "lineNumber": 219 }, "deprecated": false }, @@ -16935,7 +17483,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 219 + "lineNumber": 220 }, "deprecated": false }, @@ -16988,7 +17536,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 220 + "lineNumber": 221 }, "deprecated": false }, @@ -17041,7 +17589,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 221 + "lineNumber": 222 }, "deprecated": false }, @@ -17094,7 +17642,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 222 + "lineNumber": 223 }, "deprecated": false }, @@ -17123,11 +17671,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".MOVING_FN>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\"> & Pick<{ customMetric?: ", + ".MOVING_FN>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\">, ", "AggExpressionType", ", ", { @@ -17151,7 +17699,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 223 + "lineNumber": 224 }, "deprecated": false }, @@ -17204,7 +17752,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 224 + "lineNumber": 225 }, "deprecated": false }, @@ -17257,7 +17805,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 225 + "lineNumber": 226 }, "deprecated": false }, @@ -17286,11 +17834,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".SERIAL_DIFF>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + ".SERIAL_DIFF>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", "AggExpressionType", ", ", { @@ -17314,7 +17862,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 226 + "lineNumber": 227 }, "deprecated": false }, @@ -17367,7 +17915,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 227 + "lineNumber": 228 }, "deprecated": false }, @@ -17420,7 +17968,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 228 + "lineNumber": 229 }, "deprecated": false }, @@ -17473,7 +18021,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 229 + "lineNumber": 230 }, "deprecated": false } @@ -18498,7 +19046,7 @@ }, " extends Pick<", "BaseAggParams", - ", \"json\">" + ", \"json\" | \"timeShift\">" ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/filters.ts", @@ -19768,7 +20316,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 48 + "lineNumber": 49 }, "deprecated": false, "children": [ @@ -19781,7 +20329,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 49 + "lineNumber": 50 }, "deprecated": false }, @@ -19794,7 +20342,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 50 + "lineNumber": 51 }, "deprecated": false }, @@ -19812,7 +20360,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 51 + "lineNumber": 52 }, "deprecated": false }, @@ -19828,7 +20376,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 52 + "lineNumber": 53 }, "deprecated": false }, @@ -19844,7 +20392,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 53 + "lineNumber": 54 }, "deprecated": false }, @@ -19860,7 +20408,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 54 + "lineNumber": 55 }, "deprecated": false }, @@ -19876,7 +20424,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 55 + "lineNumber": 56 }, "deprecated": false }, @@ -19892,7 +20440,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 56 + "lineNumber": 57 }, "deprecated": false }, @@ -19908,7 +20456,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 57 + "lineNumber": 58 }, "deprecated": false }, @@ -19924,7 +20472,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 59 + "lineNumber": 60 }, "deprecated": false }, @@ -19940,7 +20488,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 60 + "lineNumber": 61 }, "deprecated": false } @@ -20497,7 +21045,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 18 + "lineNumber": 19 }, "deprecated": false, "children": [ @@ -20513,7 +21061,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 20 + "lineNumber": 21 }, "deprecated": false }, @@ -20544,7 +21092,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 21 + "lineNumber": 22 }, "deprecated": false } @@ -21283,7 +21831,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 14 + "lineNumber": 15 }, "deprecated": false, "children": [ @@ -21314,7 +21862,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 15 + "lineNumber": 16 }, "deprecated": false } @@ -21839,7 +22387,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 16 + "lineNumber": 17 }, "deprecated": false, "children": [ @@ -21870,7 +22418,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 17 + "lineNumber": 18 }, "deprecated": false } @@ -22536,7 +23084,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 20 + "lineNumber": 21 }, "deprecated": false, "children": [ @@ -22567,7 +23115,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 22 + "lineNumber": 23 }, "deprecated": false }, @@ -22583,7 +23131,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 23 + "lineNumber": 24 }, "deprecated": false } @@ -23650,7 +24198,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 116 + "lineNumber": 122 }, "deprecated": false, "children": [ @@ -23708,7 +24256,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 117 + "lineNumber": 123 }, "deprecated": false, "returnComment": [], @@ -24312,7 +24860,7 @@ "label": "reason", "description": [], "signature": [ - "{ caused_by: { reason: string; type: string; }; reason: string; lang?: string | undefined; script?: string | undefined; script_stack?: string[] | undefined; type: string; }" + "{ caused_by: { reason: string; type: string; }; reason: string; lang?: \"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined; script?: string | undefined; script_stack?: string[] | undefined; type: string; }" ], "source": { "path": "src/plugins/data/common/search/search_source/types.ts", @@ -24786,7 +25334,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 43 + "lineNumber": 45 }, "deprecated": false, "initialIsOpen": false @@ -25003,7 +25551,7 @@ "label": "AggGroupName", "description": [], "signature": [ - "\"buckets\" | \"metrics\" | \"none\"" + "\"none\" | \"buckets\" | \"metrics\"" ], "source": { "path": "src/plugins/data/common/search/aggs/agg_groups.ts", @@ -25512,7 +26060,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 49 + "lineNumber": 58 }, "deprecated": false, "initialIsOpen": false @@ -26549,6 +27097,87 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "data", + "id": "def-common.GenericBucket", + "type": "Type", + "tags": [], + "label": "GenericBucket", + "description": [], + "signature": [ + "(", + "AggregationsCompositeBucketKeys", + " & { [property: string]: ", + "AggregationsAggregate", + "; }) | ({ [property: string]: ", + "AggregationsAggregate", + "; } & { [property: string]: ", + "AggregationsAggregate", + "; }) | (", + "AggregationsDateHistogramBucketKeys", + " & { [property: string]: ", + "AggregationsAggregate", + "; }) | ({ [property: string]: ", + "AggregationsAggregate", + "; } & { [property: string]: ", + "AggregationsAggregate", + "; }) | (", + "AggregationsFiltersBucketItemKeys", + " & { [property: string]: ", + "AggregationsAggregate", + "; }) | ({ [property: string]: ", + "AggregationsAggregate", + "; } & { [property: string]: ", + "AggregationsAggregate", + "; }) | (", + "AggregationsIpRangeBucketKeys", + " & { [property: string]: ", + "AggregationsAggregate", + "; }) | ({ [property: string]: ", + "AggregationsAggregate", + "; } & { [property: string]: ", + "AggregationsAggregate", + "; }) | (", + "AggregationsRangeBucketKeys", + " & { [property: string]: ", + "AggregationsAggregate", + "; }) | ({ [property: string]: ", + "AggregationsAggregate", + "; } & { [property: string]: ", + "AggregationsAggregate", + "; }) | ({ [property: string]: ", + "AggregationsAggregate", + "; } & { [property: string]: ", + "AggregationsAggregate", + "; }) | (", + "AggregationsRareTermsBucketKeys", + " & { [property: string]: ", + "AggregationsAggregate", + "; }) | ({ [property: string]: ", + "AggregationsAggregate", + "; } & { [property: string]: ", + "AggregationsAggregate", + "; }) | (", + "AggregationsSignificantTermsBucketKeys", + " & { [property: string]: ", + "AggregationsAggregate", + "; }) | ({ [property: string]: ", + "AggregationsAggregate", + "; } & { [property: string]: ", + "AggregationsAggregate", + "; }) | (", + "AggregationsKeyedBucketKeys", + " & { [property: string]: ", + "AggregationsAggregate", + "; })" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 60 + }, + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "data", "id": "def-common.IAggConfig", @@ -26570,7 +27199,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 53 + "lineNumber": 55 }, "deprecated": false, "initialIsOpen": false @@ -26699,7 +27328,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 35 + "lineNumber": 36 }, "deprecated": false, "initialIsOpen": false @@ -27399,7 +28028,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 30 + "lineNumber": 31 }, "deprecated": false, "initialIsOpen": false @@ -30613,7 +31242,7 @@ "label": "types", "description": [], "signature": [ - "(\"string\" | \"number\")[]" + "(\"number\" | \"string\")[]" ], "source": { "path": "src/plugins/data/common/search/expressions/range.ts", @@ -30657,7 +31286,7 @@ "label": "types", "description": [], "signature": [ - "(\"string\" | \"number\")[]" + "(\"number\" | \"string\")[]" ], "source": { "path": "src/plugins/data/common/search/expressions/range.ts", @@ -30701,7 +31330,7 @@ "label": "types", "description": [], "signature": [ - "(\"string\" | \"number\")[]" + "(\"number\" | \"string\")[]" ], "source": { "path": "src/plugins/data/common/search/expressions/range.ts", @@ -30745,7 +31374,7 @@ "label": "types", "description": [], "signature": [ - "(\"string\" | \"number\")[]" + "(\"number\" | \"string\")[]" ], "source": { "path": "src/plugins/data/common/search/expressions/range.ts", diff --git a/api_docs/data_search.mdx b/api_docs/data_search.mdx index 370bd2ffd101e8..d07be7dfc62aa2 100644 --- a/api_docs/data_search.mdx +++ b/api_docs/data_search.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import dataSearchObj from './data_search.json'; +Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. + +Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 3809 | 107 | 3257 | 75 | + ## Client ### Functions diff --git a/api_docs/data_ui.json b/api_docs/data_ui.json index 5b4f11ee0cd9fa..4a532af99a115f 100644 --- a/api_docs/data_ui.json +++ b/api_docs/data_ui.json @@ -510,9 +510,9 @@ "signature": [ "Pick, \"children\" | \"onClick\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"isClearable\" | \"async\" | \"compressed\" | \"fullWidth\" | \"singleSelection\" | \"prepend\" | \"append\" | \"sortMatchesBy\" | \"customOptionText\" | \"onCreateOption\" | \"renderOption\" | \"inputRef\" | \"isDisabled\" | \"isInvalid\" | \"noSuggestions\" | \"rowHeight\" | \"delimiter\">, \"children\" | \"onClick\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"isClearable\" | \"async\" | \"compressed\" | \"fullWidth\" | \"singleSelection\" | \"prepend\" | \"append\" | \"sortMatchesBy\" | \"customOptionText\" | \"onCreateOption\" | \"renderOption\" | \"inputRef\" | \"isDisabled\" | \"isInvalid\" | \"noSuggestions\" | \"rowHeight\" | \"delimiter\"> & Required, \"children\" | \"onClick\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"isClearable\" | \"async\" | \"compressed\" | \"fullWidth\" | \"singleSelection\" | \"prepend\" | \"append\" | \"sortMatchesBy\" | \"autoFocus\" | \"customOptionText\" | \"onCreateOption\" | \"renderOption\" | \"inputRef\" | \"isDisabled\" | \"isInvalid\" | \"noSuggestions\" | \"rowHeight\" | \"delimiter\">, \"children\" | \"onClick\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"isClearable\" | \"async\" | \"compressed\" | \"fullWidth\" | \"singleSelection\" | \"prepend\" | \"append\" | \"sortMatchesBy\" | \"autoFocus\" | \"customOptionText\" | \"onCreateOption\" | \"renderOption\" | \"inputRef\" | \"isDisabled\" | \"isInvalid\" | \"noSuggestions\" | \"rowHeight\" | \"delimiter\"> & Required, \"children\" | \"onClick\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"isClearable\" | \"async\" | \"compressed\" | \"fullWidth\" | \"singleSelection\" | \"prepend\" | \"append\" | \"sortMatchesBy\" | \"customOptionText\" | \"onCreateOption\" | \"renderOption\" | \"inputRef\" | \"isDisabled\" | \"isInvalid\" | \"noSuggestions\" | \"rowHeight\" | \"delimiter\">, \"placeholder\">> & { onChange: (indexPatternId?: string | undefined) => void; indexPatternId: string; onNoIndexPatterns?: (() => void) | undefined; }" + ", \"children\" | \"onClick\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"isClearable\" | \"async\" | \"compressed\" | \"fullWidth\" | \"singleSelection\" | \"prepend\" | \"append\" | \"sortMatchesBy\" | \"autoFocus\" | \"customOptionText\" | \"onCreateOption\" | \"renderOption\" | \"inputRef\" | \"isDisabled\" | \"isInvalid\" | \"noSuggestions\" | \"rowHeight\" | \"delimiter\">, \"placeholder\">> & { onChange: (indexPatternId?: string | undefined) => void; indexPatternId: string; onNoIndexPatterns?: (() => void) | undefined; }" ], "source": { "path": "src/plugins/data/public/ui/index_pattern_select/index_pattern_select.tsx", diff --git a/api_docs/data_ui.mdx b/api_docs/data_ui.mdx index 9eedffdce76f61..c31b561bd4c803 100644 --- a/api_docs/data_ui.mdx +++ b/api_docs/data_ui.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import dataUiObj from './data_ui.json'; +Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. + +Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 3809 | 107 | 3257 | 75 | + ## Client ### Functions diff --git a/api_docs/data_visualizer.json b/api_docs/data_visualizer.json new file mode 100644 index 00000000000000..c965a0a5923ac4 --- /dev/null +++ b/api_docs/data_visualizer.json @@ -0,0 +1,1002 @@ +{ + "id": "dataVisualizer", + "client": { + "classes": [], + "functions": [], + "interfaces": [ + { + "parentPluginId": "dataVisualizer", + "id": "def-public.IndexDataVisualizerViewProps", + "type": "Interface", + "tags": [], + "label": "IndexDataVisualizerViewProps", + "description": [], + "source": { + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx", + "lineNumber": 119 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "dataVisualizer", + "id": "def-public.IndexDataVisualizerViewProps.currentIndexPattern", + "type": "Object", + "tags": [], + "label": "currentIndexPattern", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IndexPattern", + "text": "IndexPattern" + } + ], + "source": { + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx", + "lineNumber": 120 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-public.IndexDataVisualizerViewProps.currentSavedSearch", + "type": "CompoundType", + "tags": [], + "label": "currentSavedSearch", + "description": [], + "signature": [ + { + "pluginId": "dataVisualizer", + "scope": "common", + "docId": "kibDataVisualizerPluginApi", + "section": "def-common.SavedSearchSavedObject", + "text": "SavedSearchSavedObject" + }, + " | null" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx", + "lineNumber": 121 + }, + "deprecated": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [], + "objects": [], + "start": { + "parentPluginId": "dataVisualizer", + "id": "def-public.DataVisualizerPluginStart", + "type": "Type", + "tags": [], + "label": "DataVisualizerPluginStart", + "description": [], + "signature": [ + "{ getFileDataVisualizerComponent: () => Promise>; getIndexDataVisualizerComponent: () => Promise>; getMaxBytesFormatted: () => string; }" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/public/plugin.ts", + "lineNumber": 38 + }, + "deprecated": false, + "lifecycle": "start", + "initialIsOpen": true + } + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [ + { + "parentPluginId": "dataVisualizer", + "id": "def-common.DataVisualizerTableState", + "type": "Interface", + "tags": [], + "label": "DataVisualizerTableState", + "description": [], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/index.ts", + "lineNumber": 19 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "dataVisualizer", + "id": "def-common.DataVisualizerTableState.pageSize", + "type": "number", + "tags": [], + "label": "pageSize", + "description": [], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/index.ts", + "lineNumber": 20 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.DataVisualizerTableState.pageIndex", + "type": "number", + "tags": [], + "label": "pageIndex", + "description": [], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/index.ts", + "lineNumber": 21 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.DataVisualizerTableState.sortField", + "type": "string", + "tags": [], + "label": "sortField", + "description": [], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/index.ts", + "lineNumber": 22 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.DataVisualizerTableState.sortDirection", + "type": "string", + "tags": [], + "label": "sortDirection", + "description": [], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/index.ts", + "lineNumber": 23 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.DataVisualizerTableState.visibleFieldTypes", + "type": "Array", + "tags": [], + "label": "visibleFieldTypes", + "description": [], + "signature": [ + "string[]" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/index.ts", + "lineNumber": 24 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.DataVisualizerTableState.visibleFieldNames", + "type": "Array", + "tags": [], + "label": "visibleFieldNames", + "description": [], + "signature": [ + "string[]" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/index.ts", + "lineNumber": 25 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.DataVisualizerTableState.showDistributions", + "type": "boolean", + "tags": [], + "label": "showDistributions", + "description": [], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/index.ts", + "lineNumber": 26 + }, + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.DocumentCountBuckets", + "type": "Interface", + "tags": [], + "label": "DocumentCountBuckets", + "description": [], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 22 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "dataVisualizer", + "id": "def-common.DocumentCountBuckets.Unnamed", + "type": "Any", + "tags": [], + "label": "Unnamed", + "description": [], + "signature": [ + "any" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 23 + }, + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.DocumentCounts", + "type": "Interface", + "tags": [], + "label": "DocumentCounts", + "description": [], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 26 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "dataVisualizer", + "id": "def-common.DocumentCounts.buckets", + "type": "Object", + "tags": [], + "label": "buckets", + "description": [], + "signature": [ + { + "pluginId": "dataVisualizer", + "scope": "common", + "docId": "kibDataVisualizerPluginApi", + "section": "def-common.DocumentCountBuckets", + "text": "DocumentCountBuckets" + }, + " | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 27 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.DocumentCounts.interval", + "type": "number", + "tags": [], + "label": "interval", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 28 + }, + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldRequestConfig", + "type": "Interface", + "tags": [], + "label": "FieldRequestConfig", + "description": [], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 16 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldRequestConfig.fieldName", + "type": "string", + "tags": [], + "label": "fieldName", + "description": [], + "signature": [ + "string | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 17 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldRequestConfig.type", + "type": "CompoundType", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"number\" | \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"unknown\"" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 18 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldRequestConfig.cardinality", + "type": "number", + "tags": [], + "label": "cardinality", + "description": [], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 19 + }, + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldVisStats", + "type": "Interface", + "tags": [], + "label": "FieldVisStats", + "description": [], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 31 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldVisStats.cardinality", + "type": "number", + "tags": [], + "label": "cardinality", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 32 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldVisStats.count", + "type": "number", + "tags": [], + "label": "count", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 33 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldVisStats.sampleCount", + "type": "number", + "tags": [], + "label": "sampleCount", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 34 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldVisStats.trueCount", + "type": "number", + "tags": [], + "label": "trueCount", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 35 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldVisStats.falseCount", + "type": "number", + "tags": [], + "label": "falseCount", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 36 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldVisStats.earliest", + "type": "number", + "tags": [], + "label": "earliest", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 37 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldVisStats.latest", + "type": "number", + "tags": [], + "label": "latest", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 38 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldVisStats.documentCounts", + "type": "Object", + "tags": [], + "label": "documentCounts", + "description": [], + "signature": [ + "{ buckets?: ", + { + "pluginId": "dataVisualizer", + "scope": "common", + "docId": "kibDataVisualizerPluginApi", + "section": "def-common.DocumentCountBuckets", + "text": "DocumentCountBuckets" + }, + " | undefined; interval?: number | undefined; } | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 39 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldVisStats.avg", + "type": "number", + "tags": [], + "label": "avg", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 43 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldVisStats.distribution", + "type": "Object", + "tags": [], + "label": "distribution", + "description": [], + "signature": [ + "{ percentiles: ", + { + "pluginId": "dataVisualizer", + "scope": "common", + "docId": "kibDataVisualizerPluginApi", + "section": "def-common.Percentile", + "text": "Percentile" + }, + "[]; maxPercentile: number; minPercentile: 0; } | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 44 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldVisStats.fieldName", + "type": "string", + "tags": [], + "label": "fieldName", + "description": [], + "signature": [ + "string | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 49 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldVisStats.isTopValuesSampled", + "type": "CompoundType", + "tags": [], + "label": "isTopValuesSampled", + "description": [], + "signature": [ + "boolean | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 50 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldVisStats.max", + "type": "number", + "tags": [], + "label": "max", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 51 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldVisStats.median", + "type": "number", + "tags": [], + "label": "median", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 52 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldVisStats.min", + "type": "number", + "tags": [], + "label": "min", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 53 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldVisStats.topValues", + "type": "Array", + "tags": [], + "label": "topValues", + "description": [], + "signature": [ + "{ key: React.ReactText; doc_count: number; }[] | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 54 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldVisStats.topValuesSampleSize", + "type": "number", + "tags": [], + "label": "topValuesSampleSize", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 55 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldVisStats.topValuesSamplerShardSize", + "type": "number", + "tags": [], + "label": "topValuesSamplerShardSize", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 56 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldVisStats.examples", + "type": "Array", + "tags": [], + "label": "examples", + "description": [], + "signature": [ + "(string | object)[] | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 57 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldVisStats.timeRangeEarliest", + "type": "number", + "tags": [], + "label": "timeRangeEarliest", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 58 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FieldVisStats.timeRangeLatest", + "type": "number", + "tags": [], + "label": "timeRangeLatest", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 59 + }, + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.Percentile", + "type": "Interface", + "tags": [], + "label": "Percentile", + "description": [], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 10 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "dataVisualizer", + "id": "def-common.Percentile.percent", + "type": "number", + "tags": [], + "label": "percent", + "description": [], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 11 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.Percentile.minValue", + "type": "number", + "tags": [], + "label": "minValue", + "description": [], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 12 + }, + "deprecated": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.Percentile.maxValue", + "type": "number", + "tags": [], + "label": "maxValue", + "description": [], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", + "lineNumber": 13 + }, + "deprecated": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [ + { + "parentPluginId": "dataVisualizer", + "id": "def-common.ABSOLUTE_MAX_FILE_SIZE_BYTES", + "type": "number", + "tags": [], + "label": "ABSOLUTE_MAX_FILE_SIZE_BYTES", + "description": [], + "signature": [ + "1073741274" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/constants.ts", + "lineNumber": 14 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.FILE_SIZE_DISPLAY_FORMAT", + "type": "string", + "tags": [], + "label": "FILE_SIZE_DISPLAY_FORMAT", + "description": [], + "signature": [ + "\"0,0.[0] b\"" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/constants.ts", + "lineNumber": 15 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.INDEX_META_DATA_CREATED_BY", + "type": "string", + "tags": [], + "label": "INDEX_META_DATA_CREATED_BY", + "description": [], + "signature": [ + "\"file-data-visualizer\"" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/constants.ts", + "lineNumber": 19 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.InputData", + "type": "Type", + "tags": [], + "label": "InputData", + "description": [], + "signature": [ + "any[]" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/index.ts", + "lineNumber": 17 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.JobFieldType", + "type": "Type", + "tags": [], + "label": "JobFieldType", + "description": [], + "signature": [ + "\"number\" | \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"unknown\"" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/job_field_type.ts", + "lineNumber": 9 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.MAX_FILE_SIZE", + "type": "string", + "tags": [], + "label": "MAX_FILE_SIZE", + "description": [], + "signature": [ + "\"100MB\"" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/constants.ts", + "lineNumber": 11 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.MAX_FILE_SIZE_BYTES", + "type": "number", + "tags": [], + "label": "MAX_FILE_SIZE_BYTES", + "description": [], + "signature": [ + "104857600" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/constants.ts", + "lineNumber": 12 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.MB", + "type": "number", + "tags": [], + "label": "MB", + "description": [], + "source": { + "path": "x-pack/plugins/data_visualizer/common/constants.ts", + "lineNumber": 10 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.OMIT_FIELDS", + "type": "Array", + "tags": [], + "label": "OMIT_FIELDS", + "description": [], + "signature": [ + "string[]" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/constants.ts", + "lineNumber": 33 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.SavedSearchSavedObject", + "type": "Type", + "tags": [], + "label": "SavedSearchSavedObject", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-public.SimpleSavedObject", + "text": "SimpleSavedObject" + }, + "" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/types/index.ts", + "lineNumber": 29 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "dataVisualizer", + "id": "def-common.UI_SETTING_MAX_FILE_SIZE", + "type": "string", + "tags": [], + "label": "UI_SETTING_MAX_FILE_SIZE", + "description": [], + "signature": [ + "\"fileUpload:maxFileSize\"" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/constants.ts", + "lineNumber": 8 + }, + "deprecated": false, + "initialIsOpen": false + } + ], + "objects": [ + { + "parentPluginId": "dataVisualizer", + "id": "def-common.JOB_FIELD_TYPES", + "type": "Object", + "tags": [], + "label": "JOB_FIELD_TYPES", + "description": [], + "signature": [ + "{ readonly BOOLEAN: \"boolean\"; readonly DATE: \"date\"; readonly GEO_POINT: \"geo_point\"; readonly GEO_SHAPE: \"geo_shape\"; readonly IP: \"ip\"; readonly KEYWORD: \"keyword\"; readonly NUMBER: \"number\"; readonly TEXT: \"text\"; readonly UNKNOWN: \"unknown\"; }" + ], + "source": { + "path": "x-pack/plugins/data_visualizer/common/constants.ts", + "lineNumber": 21 + }, + "deprecated": false, + "initialIsOpen": false + } + ] + } +} \ No newline at end of file diff --git a/api_docs/data_visualizer.mdx b/api_docs/data_visualizer.mdx new file mode 100644 index 00000000000000..384fd07bd11762 --- /dev/null +++ b/api_docs/data_visualizer.mdx @@ -0,0 +1,42 @@ +--- +id: kibDataVisualizerPluginApi +slug: /kibana-dev-docs/dataVisualizerPluginApi +title: dataVisualizer +image: https://source.unsplash.com/400x175/?github +summary: API docs for the dataVisualizer plugin +date: 2020-11-16 +tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataVisualizer'] +warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. +--- + +import dataVisualizerObj from './data_visualizer.json'; + + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 59 | 1 | 59 | 0 | + +## Client + +### Start + + +### Interfaces + + +## Common + +### Objects + + +### Interfaces + + +### Consts, variables and types + + diff --git a/api_docs/deprecations.mdx b/api_docs/deprecations.mdx index 99edad62075bce..d9261b943d1708 100644 --- a/api_docs/deprecations.mdx +++ b/api_docs/deprecations.mdx @@ -82,14 +82,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location | Remove By | | ---------------|-----------|-----------| -| | [plugin.ts#L13](https://github.com/elastic/kibana/tree/master/x-pack/plugins/cross_cluster_replication/server/plugin.ts#L13) | 7.16 | -| | [plugin.ts#L69](https://github.com/elastic/kibana/tree/master/x-pack/plugins/cross_cluster_replication/server/plugin.ts#L69) | 7.16 | -| | [types.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/cross_cluster_replication/server/types.ts#L8) | 7.16 | -| | [types.ts#L41](https://github.com/elastic/kibana/tree/master/x-pack/plugins/cross_cluster_replication/server/types.ts#L41) | 7.16 | -| | [types.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/cross_cluster_replication/target/types/server/types.d.ts#L1) | 7.16 | -| | [types.d.ts#L30](https://github.com/elastic/kibana/tree/master/x-pack/plugins/cross_cluster_replication/target/types/server/types.d.ts#L30) | 7.16 | -| | [plugin.ts#L17](https://github.com/elastic/kibana/tree/master/x-pack/plugins/cross_cluster_replication/server/plugin.ts#L17) | 7.16 | -| | [plugin.ts#L36](https://github.com/elastic/kibana/tree/master/x-pack/plugins/cross_cluster_replication/server/plugin.ts#L36) | 7.16 | +| | [plugin.ts#L16](https://github.com/elastic/kibana/tree/master/x-pack/plugins/cross_cluster_replication/server/plugin.ts#L16) | 7.16 | +| | [plugin.ts#L27](https://github.com/elastic/kibana/tree/master/x-pack/plugins/cross_cluster_replication/server/plugin.ts#L27) | 7.16 | @@ -103,20 +97,20 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [saved_objects.ts#L13](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/services/saved_objects.ts#L13) | - | | | [saved_dashboards.ts#L12](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboards.ts#L12) | - | | | [saved_dashboards.ts#L31](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboards.ts#L31) | - | -| | [types.ts#L25](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/types.ts#L25) | - | -| | [types.ts#L74](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/types.ts#L74) | - | +| | [types.ts#L33](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/types.ts#L33) | - | +| | [types.ts#L186](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/types.ts#L186) | - | | | [plugin.tsx#L42](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/plugin.tsx#L42) | - | -| | [plugin.tsx#L126](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/plugin.tsx#L126) | - | +| | [plugin.tsx#L127](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/plugin.tsx#L127) | - | | | [url_generator.ts#L19](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/url_generator.ts#L19) | - | | | [url_generator.ts#L95](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/url_generator.ts#L95) | - | | | [saved_objects.ts#L11](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/services/saved_objects.ts#L11) | - | | | [saved_dashboard.ts#L10](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#L10) | - | -| | [saved_dashboard.ts#L18](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#L18) | - | +| | [saved_dashboard.ts#L19](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#L19) | - | +| | [dashboard_tagging.ts#L10](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/dashboard_tagging.ts#L10) | - | +| | [dashboard_tagging.ts#L15](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/dashboard_tagging.ts#L15) | - | | | [clone_panel_action.tsx#L14](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/actions/clone_panel_action.tsx#L14) | - | | | [clone_panel_action.tsx#L98](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/actions/clone_panel_action.tsx#L98) | - | | | [clone_panel_action.tsx#L126](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/actions/clone_panel_action.tsx#L126) | - | -| | [use_dashboard_state_manager.ts#L23](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/hooks/use_dashboard_state_manager.ts#L23) | - | -| | [use_dashboard_state_manager.ts#L35](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/hooks/use_dashboard_state_manager.ts#L35) | - | @@ -129,26 +123,22 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [create_doc_table_react.tsx#L25](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/angular/doc_table/create_doc_table_react.tsx#L25) | - | | | [types.ts#L16](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#L16) | - | | | [types.ts#L30](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#L30) | - | -| | [context_app_legacy.tsx#L17](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx#L17) | - | -| | [context_app_legacy.tsx#L26](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx#L26) | - | | | [kibana_services.ts#L104](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/kibana_services.ts#L104) | - | | | [search_embeddable.ts#L23](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable.ts#L23) | - | -| | [search_embeddable.ts#L58](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable.ts#L58) | - | +| | [search_embeddable.ts#L59](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable.ts#L59) | - | | | [kibana_services.ts#L104](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/kibana_services.ts#L104) | - | | | [search_embeddable.ts#L23](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable.ts#L23) | - | -| | [search_embeddable.ts#L58](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable.ts#L58) | - | +| | [search_embeddable.ts#L59](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable.ts#L59) | - | | | [kibana_services.ts#L101](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/kibana_services.ts#L101) | - | | | [create_doc_table_react.tsx#L15](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/angular/doc_table/create_doc_table_react.tsx#L15) | - | | | [create_doc_table_react.tsx#L25](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/angular/doc_table/create_doc_table_react.tsx#L25) | - | | | [types.ts#L16](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#L16) | - | | | [types.ts#L30](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#L30) | - | -| | [context_app_legacy.tsx#L17](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx#L17) | - | -| | [context_app_legacy.tsx#L26](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx#L26) | - | | | [kibana_services.ts#L104](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/kibana_services.ts#L104) | - | | | [search_embeddable.ts#L23](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable.ts#L23) | - | -| | [search_embeddable.ts#L58](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable.ts#L58) | - | -| | [on_save_search.tsx#L11](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/top_nav/on_save_search.tsx#L11) | - | -| | [on_save_search.tsx#L133](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/top_nav/on_save_search.tsx#L133) | - | +| | [search_embeddable.ts#L59](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable.ts#L59) | - | +| | [on_save_search.tsx#L11](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx#L11) | - | +| | [on_save_search.tsx#L133](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx#L133) | - | | | [saved_searches.ts#L10](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/saved_searches/saved_searches.ts#L10) | - | | | [saved_searches.ts#L20](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/saved_searches/saved_searches.ts#L20) | - | | | [plugin.tsx#L33](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/plugin.tsx#L33) | - | @@ -163,7 +153,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location | Remove By | | ---------------|-----------|-----------| | | [attribute_service.tsx#L13](https://github.com/elastic/kibana/tree/master/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx#L13) | - | -| | [attribute_service.tsx#L167](https://github.com/elastic/kibana/tree/master/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx#L167) | - | +| | [attribute_service.tsx#L165](https://github.com/elastic/kibana/tree/master/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx#L165) | - | @@ -199,7 +189,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [query_bar.tsx#L30](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#L30) | - | | | [query_bar.tsx#L38](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#L38) | - | | | [plugin.ts#L14](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/server/plugin.ts#L14) | - | -| | [plugin.ts#L189](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/server/plugin.ts#L189) | - | +| | [plugin.ts#L190](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/server/plugin.ts#L190) | - | | | [plugin.d.ts#L2](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/target/types/server/plugin.d.ts#L2) | - | | | [plugin.d.ts#L84](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/target/types/server/plugin.d.ts#L84) | - | @@ -238,18 +228,18 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location | Remove By | | ---------------|-----------|-----------| -| | [plugin.ts#L14](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/plugin.ts#L14) | 7.16 | -| | [plugin.ts#L42](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/plugin.ts#L42) | 7.16 | +| | [plugin.ts#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/plugin.ts#L12) | 7.16 | +| | [plugin.ts#L38](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/plugin.ts#L38) | 7.16 | | | [types.ts#L9](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L9) | 7.16 | -| | [types.ts#L40](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L40) | 7.16 | +| | [types.ts#L39](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L39) | 7.16 | | | [types.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L1) | 7.16 | -| | [types.d.ts#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L25) | 7.16 | +| | [types.d.ts#L24](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L24) | 7.16 | | | [types.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L10) | 7.16 | -| | [types.ts#L43](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L43) | 7.16 | -| | [types.ts#L50](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L50) | 7.16 | +| | [types.ts#L42](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L42) | 7.16 | +| | [types.ts#L49](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L49) | 7.16 | | | [types.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L1) | 7.16 | -| | [types.d.ts#L27](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L27) | 7.16 | -| | [types.d.ts#L33](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L33) | 7.16 | +| | [types.d.ts#L26](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L26) | 7.16 | +| | [types.d.ts#L32](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L32) | 7.16 | @@ -588,11 +578,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [custom_metric_form.d.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.d.ts#L8) | - | | | [index.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/index.d.ts#L1) | - | | | [index.d.ts#L9](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/index.d.ts#L9) | - | -| | [log_entry_categories_analysis.ts#L9](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/lib/log_analysis/log_entry_categories_analysis.ts#L9) | 7.16 | -| | [log_entry_categories_analysis.ts#L139](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/lib/log_analysis/log_entry_categories_analysis.ts#L139) | 7.16 | -| | [log_entry_categories_analysis.ts#L405](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/lib/log_analysis/log_entry_categories_analysis.ts#L405) | 7.16 | -| | [log_entry_categories_analysis.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/target/types/server/lib/log_analysis/log_entry_categories_analysis.d.ts#L1) | 7.16 | -| | [log_entry_categories_analysis.d.ts#L58](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/target/types/server/lib/log_analysis/log_entry_categories_analysis.d.ts#L58) | 7.16 | @@ -602,6 +587,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | ---------------|-----------|-----------| | | [embeddable.tsx#L14](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/editor_frame_service/embeddable/embeddable.tsx#L14) | - | | | [embeddable.tsx#L85](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/editor_frame_service/embeddable/embeddable.tsx#L85) | - | +| | [index.tsx#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx#L25) | - | +| | [index.tsx#L102](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx#L102) | - | | | [field_item.tsx#L47](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#L47) | - | | | [field_item.tsx#L172](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#L172) | - | | | [datapanel.tsx#L42](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx#L42) | - | @@ -616,10 +603,10 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [types.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#L8) | - | | | [types.ts#L57](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#L57) | - | | | [field_stats.ts#L11](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L11) | - | -| | [field_stats.ts#L139](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L139) | - | -| | [field_stats.ts#L248](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L248) | - | -| | [field_stats.ts#L287](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L287) | - | -| | [field_stats.ts#L329](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L329) | - | +| | [field_stats.ts#L141](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L141) | - | +| | [field_stats.ts#L250](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L250) | - | +| | [field_stats.ts#L290](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L290) | - | +| | [field_stats.ts#L332](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L332) | - | | | [types.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#L1) | - | | | [types.d.ts#L22](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#L22) | - | | | [field_stats.d.ts#L3](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#L3) | - | @@ -631,10 +618,10 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [types.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#L8) | - | | | [types.ts#L57](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#L57) | - | | | [field_stats.ts#L11](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L11) | - | -| | [field_stats.ts#L139](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L139) | - | -| | [field_stats.ts#L248](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L248) | - | -| | [field_stats.ts#L287](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L287) | - | -| | [field_stats.ts#L329](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L329) | - | +| | [field_stats.ts#L141](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L141) | - | +| | [field_stats.ts#L250](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L250) | - | +| | [field_stats.ts#L290](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L290) | - | +| | [field_stats.ts#L332](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L332) | - | | | [types.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#L1) | - | | | [types.d.ts#L22](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#L22) | - | | | [field_stats.d.ts#L3](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#L3) | - | @@ -643,6 +630,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [field_stats.d.ts#L9](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#L9) | - | | | [embeddable.tsx#L14](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/editor_frame_service/embeddable/embeddable.tsx#L14) | - | | | [embeddable.tsx#L85](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/editor_frame_service/embeddable/embeddable.tsx#L85) | - | +| | [index.tsx#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx#L25) | - | +| | [index.tsx#L102](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx#L102) | - | | | [field_item.tsx#L47](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#L47) | - | | | [field_item.tsx#L172](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#L172) | - | | | [datapanel.tsx#L42](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx#L42) | - | @@ -657,10 +646,10 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [types.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#L8) | - | | | [types.ts#L57](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#L57) | - | | | [field_stats.ts#L11](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L11) | - | -| | [field_stats.ts#L139](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L139) | - | -| | [field_stats.ts#L248](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L248) | - | -| | [field_stats.ts#L287](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L287) | - | -| | [field_stats.ts#L329](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L329) | - | +| | [field_stats.ts#L141](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L141) | - | +| | [field_stats.ts#L250](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L250) | - | +| | [field_stats.ts#L290](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L290) | - | +| | [field_stats.ts#L332](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L332) | - | | | [types.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#L1) | - | | | [types.d.ts#L22](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#L22) | - | | | [field_stats.d.ts#L3](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#L3) | - | @@ -946,7 +935,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location | Remove By | | ---------------|-----------|-----------| | | [types.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#L8) | - | -| | [types.ts#L45](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#L45) | - | +| | [types.ts#L44](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#L44) | - | | | [es_doc_field.ts#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#L12) | - | | | [es_doc_field.ts#L45](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#L45) | - | | | [es_source.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#L10) | - | @@ -1136,7 +1125,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [get_docvalue_source_fields.test.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/get_docvalue_source_fields.test.ts#L10) | - | | | [get_docvalue_source_fields.test.ts#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/get_docvalue_source_fields.test.ts#L12) | - | | | [types.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#L8) | - | -| | [types.ts#L45](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#L45) | - | +| | [types.ts#L44](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#L44) | - | | | [es_doc_field.ts#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#L12) | - | | | [es_doc_field.ts#L45](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#L45) | - | | | [es_source.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#L10) | - | @@ -1261,8 +1250,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [utils.d.ts#L37](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/utils.d.ts#L37) | - | | | [edit_utils.d.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.d.ts#L8) | - | | | [edit_utils.d.ts#L11](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.d.ts#L11) | - | -| | [actions_panel.tsx#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/index_based/components/actions_panel/actions_panel.tsx#L25) | - | -| | [actions_panel.tsx#L28](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/index_based/components/actions_panel/actions_panel.tsx#L28) | - | | | [new_job_utils.ts#L11](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/new_job/utils/new_job_utils.ts#L11) | - | | | [new_job_utils.ts#L34](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/new_job/utils/new_job_utils.ts#L34) | - | | | [exploration_query_bar.tsx#L14](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_query_bar/exploration_query_bar.tsx#L14) | - | @@ -1271,12 +1258,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [editor.tsx#L62](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/editor.tsx#L62) | - | | | [custom_urls.tsx#L40](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/custom_urls.tsx#L40) | - | | | [custom_urls.tsx#L57](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/custom_urls.tsx#L57) | - | -| | [lens_utils.ts#L14](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts#L14) | - | -| | [lens_utils.ts#L27](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts#L27) | - | -| | [lens_utils.ts#L213](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts#L213) | - | -| | [lens_utils.ts#L234](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts#L234) | - | -| | [actions.ts#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/actions.ts#L12) | - | -| | [actions.ts#L17](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/actions.ts#L17) | - | | | [explorer_query_bar.tsx#L17](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/explorer/components/explorer_query_bar/explorer_query_bar.tsx#L17) | - | | | [explorer_query_bar.tsx#L31](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/explorer/components/explorer_query_bar/explorer_query_bar.tsx#L31) | - | | | [explorer_query_bar.tsx#L100](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/explorer/components/explorer_query_bar/explorer_query_bar.tsx#L100) | - | @@ -1286,8 +1267,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [common.ts#L222](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/components/data_grid/common.ts#L222) | - | | | [field_types_utils.ts#L11](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.ts#L11) | - | | | [field_types_utils.ts#L16](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.ts#L16) | - | -| | [page.tsx#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/index_based/page.tsx#L25) | - | -| | [page.tsx#L162](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/index_based/page.tsx#L162) | - | | | [field_types_utils.test.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#L8) | - | | | [field_types_utils.test.ts#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#L19) | - | | | [field_types_utils.test.ts#L40](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#L40) | - | @@ -1297,8 +1276,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [common.ts#L222](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/components/data_grid/common.ts#L222) | - | | | [field_types_utils.ts#L11](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.ts#L11) | - | | | [field_types_utils.ts#L16](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.ts#L16) | - | -| | [page.tsx#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/index_based/page.tsx#L25) | - | -| | [page.tsx#L162](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/index_based/page.tsx#L162) | - | | | [field_types_utils.test.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#L8) | - | | | [field_types_utils.test.ts#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#L19) | - | | | [field_types_utils.test.ts#L40](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#L40) | - | @@ -1327,8 +1304,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [utils.d.ts#L37](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/utils.d.ts#L37) | - | | | [edit_utils.d.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.d.ts#L8) | - | | | [edit_utils.d.ts#L11](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.d.ts#L11) | - | -| | [actions_panel.tsx#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/index_based/components/actions_panel/actions_panel.tsx#L25) | - | -| | [actions_panel.tsx#L28](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/index_based/components/actions_panel/actions_panel.tsx#L28) | - | | | [new_job_utils.ts#L11](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/new_job/utils/new_job_utils.ts#L11) | - | | | [new_job_utils.ts#L34](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/new_job/utils/new_job_utils.ts#L34) | - | | | [exploration_query_bar.tsx#L14](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_query_bar/exploration_query_bar.tsx#L14) | - | @@ -1337,12 +1312,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [editor.tsx#L62](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/editor.tsx#L62) | - | | | [custom_urls.tsx#L40](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/custom_urls.tsx#L40) | - | | | [custom_urls.tsx#L57](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/custom_urls.tsx#L57) | - | -| | [lens_utils.ts#L14](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts#L14) | - | -| | [lens_utils.ts#L27](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts#L27) | - | -| | [lens_utils.ts#L213](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts#L213) | - | -| | [lens_utils.ts#L234](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/lens_utils.ts#L234) | - | -| | [actions.ts#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/actions.ts#L12) | - | -| | [actions.ts#L17](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/index_based/components/field_data_row/action_menu/actions.ts#L17) | - | | | [explorer_query_bar.tsx#L17](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/explorer/components/explorer_query_bar/explorer_query_bar.tsx#L17) | - | | | [explorer_query_bar.tsx#L31](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/explorer/components/explorer_query_bar/explorer_query_bar.tsx#L31) | - | | | [explorer_query_bar.tsx#L100](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/explorer/components/explorer_query_bar/explorer_query_bar.tsx#L100) | - | @@ -1352,8 +1321,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [common.ts#L222](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/components/data_grid/common.ts#L222) | - | | | [field_types_utils.ts#L11](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.ts#L11) | - | | | [field_types_utils.ts#L16](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.ts#L16) | - | -| | [page.tsx#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/index_based/page.tsx#L25) | - | -| | [page.tsx#L162](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/index_based/page.tsx#L162) | - | | | [field_types_utils.test.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#L8) | - | | | [field_types_utils.test.ts#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#L19) | - | | | [field_types_utils.test.ts#L40](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#L40) | - | @@ -1393,7 +1360,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [static_globals.ts#L43](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/server/static_globals.ts#L43) | 7.16 | | | [plugin.ts#L18](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/server/plugin.ts#L18) | 7.16 | | | [plugin.ts#L74](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/server/plugin.ts#L74) | 7.16 | -| | [plugin.ts#L279](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/server/plugin.ts#L279) | 7.16 | +| | [plugin.ts#L284](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/server/plugin.ts#L284) | 7.16 | | | [types.d.ts#L2](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/target/types/server/types.d.ts#L2) | 7.16 | | | [types.d.ts#L47](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/target/types/server/types.d.ts#L47) | 7.16 | | | [plugin.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/target/types/server/plugin.d.ts#L1) | 7.16 | @@ -1482,22 +1449,22 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location | Remove By | | ---------------|-----------|-----------| -| | [types.ts#L18](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L18) | - | -| | [types.ts#L95](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L95) | - | +| | [types.ts#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L19) | - | +| | [types.ts#L104](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L104) | - | | | [utils.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L10) | - | | | [utils.ts#L53](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L53) | - | | | [utils.ts#L61](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L61) | - | | | [utils.ts#L69](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L69) | - | | | [default_configs.ts#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#L19) | - | -| | [default_configs.ts#L24](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#L24) | - | -| | [types.ts#L18](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L18) | - | -| | [types.ts#L95](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L95) | - | +| | [default_configs.ts#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#L25) | - | +| | [types.ts#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L19) | - | +| | [types.ts#L104](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L104) | - | | | [utils.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L10) | - | | | [utils.ts#L53](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L53) | - | | | [utils.ts#L61](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L61) | - | | | [utils.ts#L69](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L69) | - | | | [default_configs.ts#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#L19) | - | -| | [default_configs.ts#L24](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#L24) | - | +| | [default_configs.ts#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#L25) | - | @@ -1573,9 +1540,9 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location | Remove By | | ---------------|-----------|-----------| -| | [types.ts#L21](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L21) | - | -| | [types.ts#L66](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L66) | - | -| | [action.ts#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L19) | - | +| | [types.ts#L22](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L22) | - | +| | [types.ts#L72](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L72) | - | +| | [action.ts#L20](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L20) | - | | | [action.ts#L100](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L100) | - | | | [index.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#L8) | - | | | [index.ts#L86](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#L86) | - | @@ -1612,9 +1579,9 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [types.ts#L41](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/pages/details/types.ts#L41) | - | | | [index.tsx#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx#L12) | - | | | [index.tsx#L34](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx#L34) | - | -| | [middleware.ts#L44](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L44) | - | -| | [middleware.ts#L60](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L60) | - | -| | [middleware.ts#L65](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L65) | - | +| | [middleware.ts#L48](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L48) | - | +| | [middleware.ts#L64](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L64) | - | +| | [middleware.ts#L69](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L69) | - | | | [types.ts#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts#L12) | - | | | [types.ts#L28](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts#L28) | - | | | [index.tsx#L15](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx#L15) | - | @@ -1669,6 +1636,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [use_field_value_autocomplete.ts#L31](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/hooks/use_field_value_autocomplete.ts#L31) | - | | | [field_value_match.tsx#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx#L19) | - | | | [field_value_match.tsx#L30](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx#L30) | - | +| | [query.ts#L13](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/reference_rules/query.ts#L13) | - | +| | [query.ts#L52](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/reference_rules/query.ts#L52) | - | | | [model.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts#L8) | - | | | [model.ts#L30](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts#L30) | - | | | [index.tsx#L33](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx#L33) | - | @@ -1785,9 +1754,9 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [index.tsx#L242](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/risk_score_mapping/index.tsx#L242) | - | | | [index.tsx#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/autocomplete_field/index.tsx#L12) | - | | | [index.tsx#L35](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/autocomplete_field/index.tsx#L35) | - | -| | [types.ts#L21](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L21) | - | -| | [types.ts#L66](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L66) | - | -| | [action.ts#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L19) | - | +| | [types.ts#L22](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L22) | - | +| | [types.ts#L72](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L72) | - | +| | [action.ts#L20](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L20) | - | | | [action.ts#L100](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L100) | - | | | [index.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#L8) | - | | | [index.ts#L86](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#L86) | - | @@ -1824,9 +1793,9 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [types.ts#L41](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/pages/details/types.ts#L41) | - | | | [index.tsx#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx#L12) | - | | | [index.tsx#L34](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx#L34) | - | -| | [middleware.ts#L44](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L44) | - | -| | [middleware.ts#L60](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L60) | - | -| | [middleware.ts#L65](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L65) | - | +| | [middleware.ts#L48](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L48) | - | +| | [middleware.ts#L64](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L64) | - | +| | [middleware.ts#L69](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L69) | - | | | [types.ts#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts#L12) | - | | | [types.ts#L28](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts#L28) | - | | | [index.tsx#L15](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx#L15) | - | @@ -1881,6 +1850,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [use_field_value_autocomplete.ts#L31](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/hooks/use_field_value_autocomplete.ts#L31) | - | | | [field_value_match.tsx#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx#L19) | - | | | [field_value_match.tsx#L30](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx#L30) | - | +| | [query.ts#L13](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/reference_rules/query.ts#L13) | - | +| | [query.ts#L52](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/reference_rules/query.ts#L52) | - | | | [model.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts#L8) | - | | | [model.ts#L30](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts#L30) | - | | | [index.tsx#L33](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx#L33) | - | @@ -1955,8 +1926,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [app.tsx#L33](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/app/app.tsx#L33) | - | | | [app.tsx#L73](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/app/app.tsx#L73) | - | | | [sender.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts#L10) | 7.16 | -| | [sender.ts#L447](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts#L447) | 7.16 | -| | [sender.ts#L466](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts#L466) | 7.16 | +| | [sender.ts#L457](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts#L457) | 7.16 | +| | [sender.ts#L476](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts#L476) | 7.16 | | | [types.ts#L55](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/types.ts#L55) | 7.16 | | | [types.ts#L111](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/types.ts#L111) | 7.16 | @@ -2076,12 +2047,12 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | ---------------|-----------|-----------| | | [es_index_service.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/services/es_index_service.ts#L10) | - | | | [es_index_service.ts#L22](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/services/es_index_service.ts#L22) | - | -| | [transforms.ts#L62](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/server/routes/api/transforms.ts#L62) | - | -| | [transforms.ts#L404](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/server/routes/api/transforms.ts#L404) | - | +| | [transforms.ts#L63](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/server/routes/api/transforms.ts#L63) | - | +| | [transforms.ts#L405](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/server/routes/api/transforms.ts#L405) | - | | | [es_index_service.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/services/es_index_service.ts#L10) | - | | | [es_index_service.ts#L22](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/services/es_index_service.ts#L22) | - | -| | [transforms.ts#L62](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/server/routes/api/transforms.ts#L62) | - | -| | [transforms.ts#L404](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/server/routes/api/transforms.ts#L404) | - | +| | [transforms.ts#L63](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/server/routes/api/transforms.ts#L63) | - | +| | [transforms.ts#L405](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/server/routes/api/transforms.ts#L405) | - | diff --git a/api_docs/dev_tools.mdx b/api_docs/dev_tools.mdx index 63abb581b1d3ec..89d67f54866f23 100644 --- a/api_docs/dev_tools.mdx +++ b/api_docs/dev_tools.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import devToolsObj from './dev_tools.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 10 | 0 | 8 | 2 | + ## Client ### Setup diff --git a/api_docs/discover.json b/api_docs/discover.json index 1824b5a3e3d5d0..48ed4d51abc67b 100644 --- a/api_docs/discover.json +++ b/api_docs/discover.json @@ -56,7 +56,7 @@ "description": [], "signature": [ "() => Promise" ], "source": { @@ -79,7 +79,7 @@ "description": [], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 22 + "lineNumber": 16 }, "deprecated": false, "children": [ @@ -97,7 +97,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 26 + "lineNumber": 20 }, "deprecated": false }, @@ -115,7 +115,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 31 + "lineNumber": 25 }, "deprecated": false }, @@ -140,7 +140,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 36 + "lineNumber": 30 }, "deprecated": false }, @@ -165,7 +165,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 41 + "lineNumber": 35 }, "deprecated": false }, @@ -190,7 +190,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 46 + "lineNumber": 40 }, "deprecated": false }, @@ -215,7 +215,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 52 + "lineNumber": 46 }, "deprecated": false }, @@ -233,7 +233,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 58 + "lineNumber": 52 }, "deprecated": false }, @@ -251,7 +251,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 63 + "lineNumber": 57 }, "deprecated": false }, @@ -269,7 +269,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 68 + "lineNumber": 62 }, "deprecated": false }, @@ -287,7 +287,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 73 + "lineNumber": 67 }, "deprecated": false }, @@ -305,7 +305,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 77 + "lineNumber": 72 }, "deprecated": false }, @@ -323,7 +323,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 81 + "lineNumber": 77 }, "deprecated": false } @@ -890,7 +890,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 20 + "lineNumber": 14 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/discover.mdx b/api_docs/discover.mdx index b5f6cefde7cc42..d4720530b58487 100644 --- a/api_docs/discover.mdx +++ b/api_docs/discover.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import discoverObj from './discover.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 64 | 0 | 51 | 6 | + ## Client ### Setup diff --git a/api_docs/discover_enhanced.mdx b/api_docs/discover_enhanced.mdx index 06037e1190c0d8..fb8842cd56bfed 100644 --- a/api_docs/discover_enhanced.mdx +++ b/api_docs/discover_enhanced.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import discoverEnhancedObj from './discover_enhanced.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 39 | 0 | 37 | 2 | + ## Client ### Classes diff --git a/api_docs/embeddable.mdx b/api_docs/embeddable.mdx index eafc8543b7ce13..46a877be6ac243 100644 --- a/api_docs/embeddable.mdx +++ b/api_docs/embeddable.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import embeddableObj from './embeddable.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 449 | 4 | 379 | 3 | + ## Client ### Setup diff --git a/api_docs/embeddable_enhanced.mdx b/api_docs/embeddable_enhanced.mdx index 58800f0e7d3435..8680c6807bbcaa 100644 --- a/api_docs/embeddable_enhanced.mdx +++ b/api_docs/embeddable_enhanced.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import embeddableEnhancedObj from './embeddable_enhanced.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 14 | 0 | 14 | 0 | + ## Client ### Setup diff --git a/api_docs/encrypted_saved_objects.mdx b/api_docs/encrypted_saved_objects.mdx index 654427d83c3598..e152ec4aec9a85 100644 --- a/api_docs/encrypted_saved_objects.mdx +++ b/api_docs/encrypted_saved_objects.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import encryptedSavedObjectsObj from './encrypted_saved_objects.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 30 | 0 | 28 | 3 | + ## Server ### Setup diff --git a/api_docs/enterprise_search.json b/api_docs/enterprise_search.json index 6ea7bfe1c50f1f..e2b6184c9d36f9 100644 --- a/api_docs/enterprise_search.json +++ b/api_docs/enterprise_search.json @@ -22,11 +22,11 @@ "label": "ConfigType", "description": [], "signature": [ - "{ readonly host?: string | undefined; readonly enabled: boolean; readonly accessCheckTimeout: number; readonly accessCheckTimeoutWarning: number; }" + "{ readonly host?: string | undefined; readonly enabled: boolean; readonly ssl: Readonly<{ certificateAuthorities?: string | string[] | undefined; } & { verificationMode: \"none\" | \"certificate\" | \"full\"; }>; readonly accessCheckTimeout: number; readonly accessCheckTimeoutWarning: number; }" ], "source": { "path": "x-pack/plugins/enterprise_search/server/index.ts", - "lineNumber": 24 + "lineNumber": 33 }, "deprecated": false, "initialIsOpen": false @@ -50,7 +50,13 @@ "Type", "; accessCheckTimeoutWarning: ", "Type", - "; }>" + "; ssl: ", + "ObjectType", + "<{ certificateAuthorities: ", + "Type", + "; verificationMode: ", + "Type", + "<\"none\" | \"certificate\" | \"full\">; }>; }>" ], "source": { "path": "x-pack/plugins/enterprise_search/server/index.ts", diff --git a/api_docs/enterprise_search.mdx b/api_docs/enterprise_search.mdx index 1f9dfaae078f40..8156918dcefe49 100644 --- a/api_docs/enterprise_search.mdx +++ b/api_docs/enterprise_search.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import enterpriseSearchObj from './enterprise_search.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 2 | 0 | 2 | 0 | + ## Server ### Objects diff --git a/api_docs/es_ui_shared.mdx b/api_docs/es_ui_shared.mdx index 2fd04e135e3fd3..e317299f0b48aa 100644 --- a/api_docs/es_ui_shared.mdx +++ b/api_docs/es_ui_shared.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import esUiSharedObj from './es_ui_shared.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 88 | 4 | 86 | 1 | + ## Client ### Objects diff --git a/api_docs/event_log.json b/api_docs/event_log.json index 1eb19bf6310de4..1d5605105c7c1a 100644 --- a/api_docs/event_log.json +++ b/api_docs/event_log.json @@ -687,7 +687,7 @@ "label": "logEvent", "description": [], "signature": [ - "(properties: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => void" + "(properties: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => void" ], "source": { "path": "x-pack/plugins/event_log/server/types.ts", @@ -703,7 +703,7 @@ "label": "properties", "description": [], "signature": [ - "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" + "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" ], "source": { "path": "x-pack/plugins/event_log/server/types.ts", @@ -723,7 +723,7 @@ "label": "startTiming", "description": [], "signature": [ - "(event: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => void" + "(event: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => void" ], "source": { "path": "x-pack/plugins/event_log/server/types.ts", @@ -739,7 +739,7 @@ "label": "event", "description": [], "signature": [ - "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" + "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" ], "source": { "path": "x-pack/plugins/event_log/server/types.ts", @@ -759,7 +759,7 @@ "label": "stopTiming", "description": [], "signature": [ - "(event: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => void" + "(event: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => void" ], "source": { "path": "x-pack/plugins/event_log/server/types.ts", @@ -775,7 +775,7 @@ "label": "event", "description": [], "signature": [ - "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" + "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" ], "source": { "path": "x-pack/plugins/event_log/server/types.ts", @@ -850,7 +850,7 @@ "label": "data", "description": [], "signature": [ - "(Readonly<{ '@timestamp'?: string | undefined; kibana?: Readonly<{ saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; rel?: string | undefined; namespace?: string | undefined; } & {}>[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}> | undefined)[]" + "(Readonly<{ kibana?: Readonly<{ saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; rel?: string | undefined; namespace?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}> | undefined)[]" ], "source": { "path": "x-pack/plugins/event_log/server/es/cluster_client_adapter.ts", @@ -872,7 +872,7 @@ "label": "IEvent", "description": [], "signature": [ - "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" + "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" ], "source": { "path": "x-pack/plugins/event_log/generated/schemas.ts", @@ -889,7 +889,7 @@ "label": "IValidatedEvent", "description": [], "signature": [ - "Readonly<{ '@timestamp'?: string | undefined; kibana?: Readonly<{ saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; rel?: string | undefined; namespace?: string | undefined; } & {}>[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}> | undefined" + "Readonly<{ kibana?: Readonly<{ saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; rel?: string | undefined; namespace?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}> | undefined" ], "source": { "path": "x-pack/plugins/event_log/generated/schemas.ts", @@ -1171,7 +1171,7 @@ "label": "getLogger", "description": [], "signature": [ - "(properties: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => ", + "(properties: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => ", { "pluginId": "eventLog", "scope": "server", @@ -1194,7 +1194,7 @@ "label": "properties", "description": [], "signature": [ - "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" + "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" ], "source": { "path": "x-pack/plugins/event_log/server/types.ts", diff --git a/api_docs/event_log.mdx b/api_docs/event_log.mdx index 6948a63cf85c93..409d6ad6d21c29 100644 --- a/api_docs/event_log.mdx +++ b/api_docs/event_log.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import eventLogObj from './event_log.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 70 | 0 | 70 | 4 | + ## Server ### Setup diff --git a/api_docs/expressions.json b/api_docs/expressions.json index e981414fe7bda9..79a9d016df0710 100644 --- a/api_docs/expressions.json +++ b/api_docs/expressions.json @@ -39151,7 +39151,7 @@ "label": "types", "description": [], "signature": [ - "(\"boolean\" | \"string\" | \"number\" | \"null\")[]" + "(\"number\" | \"boolean\" | \"string\" | \"null\")[]" ], "source": { "path": "src/plugins/expressions/common/expression_functions/specs/map_column.ts", diff --git a/api_docs/expressions.mdx b/api_docs/expressions.mdx index a57e91bf2a333b..e0544d866766ed 100644 --- a/api_docs/expressions.mdx +++ b/api_docs/expressions.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import expressionsObj from './expressions.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 1871 | 57 | 1444 | 5 | + ## Client ### Setup diff --git a/api_docs/features.json b/api_docs/features.json index 63c3ebe3a92dec..7392fcf6a17f76 100644 --- a/api_docs/features.json +++ b/api_docs/features.json @@ -11,7 +11,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 137 + "lineNumber": 142 }, "deprecated": false, "children": [ @@ -34,7 +34,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 138 + "lineNumber": 143 }, "deprecated": false }, @@ -50,7 +50,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 140 + "lineNumber": 145 }, "deprecated": false, "children": [ @@ -62,7 +62,7 @@ "label": "config", "description": [], "signature": [ - "Readonly<{ id: string; name: string; category: Readonly<{ id: string; label: string; ariaLabel?: string | undefined; order?: number | undefined; euiIconType?: string | undefined; }>; order?: number | undefined; excludeFromBasePrivileges?: boolean | undefined; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; app: readonly string[]; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: readonly string[] | undefined; privileges: Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null; subFeatures?: readonly Readonly<{ name: string; privilegeGroups: readonly Readonly<{ groupType: ", + "Readonly<{ id: string; name: string; category: Readonly<{ id: string; label: string; ariaLabel?: string | undefined; order?: number | undefined; euiIconType?: string | undefined; }>; order?: number | undefined; excludeFromBasePrivileges?: boolean | undefined; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; app: readonly string[]; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: readonly string[] | undefined; cases?: readonly string[] | undefined; privileges: Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null; subFeatures?: readonly Readonly<{ name: string; privilegeGroups: readonly Readonly<{ groupType: ", { "pluginId": "features", "scope": "common", @@ -70,11 +70,11 @@ "section": "def-common.SubFeaturePrivilegeGroupType", "text": "SubFeaturePrivilegeGroupType" }, - "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"none\" | \"all\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; ui: readonly string[]; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]; }>[] | undefined; privilegesTooltip?: string | undefined; reserved?: Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined; }>" + "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"all\" | \"none\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; ui: readonly string[]; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]; }>[] | undefined; privilegesTooltip?: string | undefined; reserved?: Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined; }>" ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 140 + "lineNumber": 145 }, "deprecated": false, "isRequired": true @@ -91,7 +91,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 146 + "lineNumber": 151 }, "deprecated": false }, @@ -104,7 +104,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 150 + "lineNumber": 155 }, "deprecated": false }, @@ -120,7 +120,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 154 + "lineNumber": 159 }, "deprecated": false }, @@ -136,7 +136,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 158 + "lineNumber": 163 }, "deprecated": false }, @@ -152,7 +152,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 162 + "lineNumber": 167 }, "deprecated": false }, @@ -168,7 +168,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 166 + "lineNumber": 171 }, "deprecated": false }, @@ -184,7 +184,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 170 + "lineNumber": 175 }, "deprecated": false }, @@ -200,7 +200,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 174 + "lineNumber": 179 }, "deprecated": false }, @@ -212,11 +212,11 @@ "label": "privileges", "description": [], "signature": [ - "Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null" + "Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null" ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 178 + "lineNumber": 183 }, "deprecated": false }, @@ -232,7 +232,23 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 182 + "lineNumber": 187 + }, + "deprecated": false + }, + { + "parentPluginId": "features", + "id": "def-public.KibanaFeature.cases", + "type": "Object", + "tags": [], + "label": "cases", + "description": [], + "signature": [ + "readonly string[] | undefined" + ], + "source": { + "path": "x-pack/plugins/features/common/kibana_feature.ts", + "lineNumber": 191 }, "deprecated": false }, @@ -245,7 +261,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 186 + "lineNumber": 195 }, "deprecated": false }, @@ -257,11 +273,11 @@ "label": "reserved", "description": [], "signature": [ - "Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined" + "Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined" ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 190 + "lineNumber": 199 }, "deprecated": false }, @@ -284,7 +300,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 194 + "lineNumber": 203 }, "deprecated": false, "children": [], @@ -411,7 +427,7 @@ "\nIf your feature requires access to specific Alert Types, then specify your access needs here.\nInclude both Alert Types registered by the feature and external Alert Types such as built-in\nAlert Types and Alert Types provided by other features to which you wish to grant access." ], "signature": [ - "{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined" + "{ rule?: { all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined; alert?: { all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined; } | undefined" ], "source": { "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", @@ -419,6 +435,24 @@ }, "deprecated": false }, + { + "parentPluginId": "features", + "id": "def-public.FeatureKibanaPrivileges.cases", + "type": "Object", + "tags": [], + "label": "cases", + "description": [ + "\nIf your feature requires access to specific owners of cases (aka plugins that have created cases), then specify your access needs here. The values here should\nbe unique identifiers for the owners of cases you want access to." + ], + "signature": [ + "{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined" + ], + "source": { + "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", + "lineNumber": 135 + }, + "deprecated": false + }, { "parentPluginId": "features", "id": "def-public.FeatureKibanaPrivileges.savedObject", @@ -433,7 +467,7 @@ ], "source": { "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", - "lineNumber": 110 + "lineNumber": 161 }, "deprecated": false }, @@ -453,7 +487,7 @@ ], "source": { "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", - "lineNumber": 153 + "lineNumber": 204 }, "deprecated": false } @@ -651,6 +685,24 @@ }, "deprecated": false }, + { + "parentPluginId": "features", + "id": "def-public.KibanaFeatureConfig.cases", + "type": "Object", + "tags": [], + "label": "cases", + "description": [ + "\nIf your feature grants access to specific case types, you can specify them here to control visibility based on the current space." + ], + "signature": [ + "readonly string[] | undefined" + ], + "source": { + "path": "x-pack/plugins/features/common/kibana_feature.ts", + "lineNumber": 104 + }, + "deprecated": false + }, { "parentPluginId": "features", "id": "def-public.KibanaFeatureConfig.privileges", @@ -683,7 +735,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 113 + "lineNumber": 118 }, "deprecated": false }, @@ -709,7 +761,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 121 + "lineNumber": 126 }, "deprecated": false }, @@ -727,7 +779,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 126 + "lineNumber": 131 }, "deprecated": false }, @@ -747,7 +799,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 131 + "lineNumber": 136 }, "deprecated": false } @@ -838,7 +890,7 @@ "section": "def-common.FeatureKibanaPrivileges", "text": "FeatureKibanaPrivileges" }, - ", \"management\" | \"catalogue\" | \"alerting\" | \"ui\" | \"app\" | \"api\" | \"savedObject\">" + ", \"management\" | \"catalogue\" | \"alerting\" | \"ui\" | \"cases\" | \"app\" | \"api\" | \"savedObject\">" ], "source": { "path": "x-pack/plugins/features/common/sub_feature.ts", @@ -886,7 +938,7 @@ "\nDenotes which Primary Feature Privilege this sub-feature privilege should be included in.\n`read` is also included in `all` automatically." ], "signature": [ - "\"none\" | \"all\" | \"read\"" + "\"all\" | \"none\" | \"read\"" ], "source": { "path": "x-pack/plugins/features/common/sub_feature.ts", @@ -1139,7 +1191,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 137 + "lineNumber": 142 }, "deprecated": false, "children": [ @@ -1162,7 +1214,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 138 + "lineNumber": 143 }, "deprecated": false }, @@ -1178,7 +1230,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 140 + "lineNumber": 145 }, "deprecated": false, "children": [ @@ -1190,7 +1242,7 @@ "label": "config", "description": [], "signature": [ - "Readonly<{ id: string; name: string; category: Readonly<{ id: string; label: string; ariaLabel?: string | undefined; order?: number | undefined; euiIconType?: string | undefined; }>; order?: number | undefined; excludeFromBasePrivileges?: boolean | undefined; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; app: readonly string[]; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: readonly string[] | undefined; privileges: Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null; subFeatures?: readonly Readonly<{ name: string; privilegeGroups: readonly Readonly<{ groupType: ", + "Readonly<{ id: string; name: string; category: Readonly<{ id: string; label: string; ariaLabel?: string | undefined; order?: number | undefined; euiIconType?: string | undefined; }>; order?: number | undefined; excludeFromBasePrivileges?: boolean | undefined; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; app: readonly string[]; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: readonly string[] | undefined; cases?: readonly string[] | undefined; privileges: Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null; subFeatures?: readonly Readonly<{ name: string; privilegeGroups: readonly Readonly<{ groupType: ", { "pluginId": "features", "scope": "common", @@ -1198,11 +1250,11 @@ "section": "def-common.SubFeaturePrivilegeGroupType", "text": "SubFeaturePrivilegeGroupType" }, - "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"none\" | \"all\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; ui: readonly string[]; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]; }>[] | undefined; privilegesTooltip?: string | undefined; reserved?: Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined; }>" + "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"all\" | \"none\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; ui: readonly string[]; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]; }>[] | undefined; privilegesTooltip?: string | undefined; reserved?: Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined; }>" ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 140 + "lineNumber": 145 }, "deprecated": false, "isRequired": true @@ -1219,7 +1271,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 146 + "lineNumber": 151 }, "deprecated": false }, @@ -1232,7 +1284,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 150 + "lineNumber": 155 }, "deprecated": false }, @@ -1248,7 +1300,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 154 + "lineNumber": 159 }, "deprecated": false }, @@ -1264,7 +1316,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 158 + "lineNumber": 163 }, "deprecated": false }, @@ -1280,7 +1332,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 162 + "lineNumber": 167 }, "deprecated": false }, @@ -1296,7 +1348,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 166 + "lineNumber": 171 }, "deprecated": false }, @@ -1312,7 +1364,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 170 + "lineNumber": 175 }, "deprecated": false }, @@ -1328,7 +1380,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 174 + "lineNumber": 179 }, "deprecated": false }, @@ -1340,11 +1392,11 @@ "label": "privileges", "description": [], "signature": [ - "Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null" + "Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null" ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 178 + "lineNumber": 183 }, "deprecated": false }, @@ -1360,7 +1412,23 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 182 + "lineNumber": 187 + }, + "deprecated": false + }, + { + "parentPluginId": "features", + "id": "def-server.KibanaFeature.cases", + "type": "Object", + "tags": [], + "label": "cases", + "description": [], + "signature": [ + "readonly string[] | undefined" + ], + "source": { + "path": "x-pack/plugins/features/common/kibana_feature.ts", + "lineNumber": 191 }, "deprecated": false }, @@ -1373,7 +1441,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 186 + "lineNumber": 195 }, "deprecated": false }, @@ -1385,11 +1453,11 @@ "label": "reserved", "description": [], "signature": [ - "Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined" + "Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined" ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 190 + "lineNumber": 199 }, "deprecated": false }, @@ -1412,7 +1480,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 194 + "lineNumber": 203 }, "deprecated": false, "children": [], @@ -1740,7 +1808,7 @@ "\nIf your feature requires access to specific Alert Types, then specify your access needs here.\nInclude both Alert Types registered by the feature and external Alert Types such as built-in\nAlert Types and Alert Types provided by other features to which you wish to grant access." ], "signature": [ - "{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined" + "{ rule?: { all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined; alert?: { all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined; } | undefined" ], "source": { "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", @@ -1748,6 +1816,24 @@ }, "deprecated": false }, + { + "parentPluginId": "features", + "id": "def-server.FeatureKibanaPrivileges.cases", + "type": "Object", + "tags": [], + "label": "cases", + "description": [ + "\nIf your feature requires access to specific owners of cases (aka plugins that have created cases), then specify your access needs here. The values here should\nbe unique identifiers for the owners of cases you want access to." + ], + "signature": [ + "{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined" + ], + "source": { + "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", + "lineNumber": 135 + }, + "deprecated": false + }, { "parentPluginId": "features", "id": "def-server.FeatureKibanaPrivileges.savedObject", @@ -1762,7 +1848,7 @@ ], "source": { "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", - "lineNumber": 110 + "lineNumber": 161 }, "deprecated": false }, @@ -1782,7 +1868,7 @@ ], "source": { "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", - "lineNumber": 153 + "lineNumber": 204 }, "deprecated": false } @@ -1980,6 +2066,24 @@ }, "deprecated": false }, + { + "parentPluginId": "features", + "id": "def-server.KibanaFeatureConfig.cases", + "type": "Object", + "tags": [], + "label": "cases", + "description": [ + "\nIf your feature grants access to specific case types, you can specify them here to control visibility based on the current space." + ], + "signature": [ + "readonly string[] | undefined" + ], + "source": { + "path": "x-pack/plugins/features/common/kibana_feature.ts", + "lineNumber": 104 + }, + "deprecated": false + }, { "parentPluginId": "features", "id": "def-server.KibanaFeatureConfig.privileges", @@ -2012,7 +2116,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 113 + "lineNumber": 118 }, "deprecated": false }, @@ -2038,7 +2142,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 121 + "lineNumber": 126 }, "deprecated": false }, @@ -2056,7 +2160,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 126 + "lineNumber": 131 }, "deprecated": false }, @@ -2076,7 +2180,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 131 + "lineNumber": 136 }, "deprecated": false } @@ -2708,7 +2812,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 137 + "lineNumber": 142 }, "deprecated": false, "children": [ @@ -2731,7 +2835,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 138 + "lineNumber": 143 }, "deprecated": false }, @@ -2747,7 +2851,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 140 + "lineNumber": 145 }, "deprecated": false, "children": [ @@ -2759,7 +2863,7 @@ "label": "config", "description": [], "signature": [ - "Readonly<{ id: string; name: string; category: Readonly<{ id: string; label: string; ariaLabel?: string | undefined; order?: number | undefined; euiIconType?: string | undefined; }>; order?: number | undefined; excludeFromBasePrivileges?: boolean | undefined; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; app: readonly string[]; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: readonly string[] | undefined; privileges: Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null; subFeatures?: readonly Readonly<{ name: string; privilegeGroups: readonly Readonly<{ groupType: ", + "Readonly<{ id: string; name: string; category: Readonly<{ id: string; label: string; ariaLabel?: string | undefined; order?: number | undefined; euiIconType?: string | undefined; }>; order?: number | undefined; excludeFromBasePrivileges?: boolean | undefined; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; app: readonly string[]; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: readonly string[] | undefined; cases?: readonly string[] | undefined; privileges: Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null; subFeatures?: readonly Readonly<{ name: string; privilegeGroups: readonly Readonly<{ groupType: ", { "pluginId": "features", "scope": "common", @@ -2767,11 +2871,11 @@ "section": "def-common.SubFeaturePrivilegeGroupType", "text": "SubFeaturePrivilegeGroupType" }, - "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"none\" | \"all\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; ui: readonly string[]; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]; }>[] | undefined; privilegesTooltip?: string | undefined; reserved?: Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined; }>" + "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"all\" | \"none\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; ui: readonly string[]; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]; }>[] | undefined; privilegesTooltip?: string | undefined; reserved?: Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined; }>" ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 140 + "lineNumber": 145 }, "deprecated": false, "isRequired": true @@ -2788,7 +2892,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 146 + "lineNumber": 151 }, "deprecated": false }, @@ -2801,7 +2905,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 150 + "lineNumber": 155 }, "deprecated": false }, @@ -2817,7 +2921,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 154 + "lineNumber": 159 }, "deprecated": false }, @@ -2833,7 +2937,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 158 + "lineNumber": 163 }, "deprecated": false }, @@ -2849,7 +2953,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 162 + "lineNumber": 167 }, "deprecated": false }, @@ -2865,7 +2969,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 166 + "lineNumber": 171 }, "deprecated": false }, @@ -2881,7 +2985,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 170 + "lineNumber": 175 }, "deprecated": false }, @@ -2897,7 +3001,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 174 + "lineNumber": 179 }, "deprecated": false }, @@ -2909,11 +3013,11 @@ "label": "privileges", "description": [], "signature": [ - "Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null" + "Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null" ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 178 + "lineNumber": 183 }, "deprecated": false }, @@ -2929,7 +3033,23 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 182 + "lineNumber": 187 + }, + "deprecated": false + }, + { + "parentPluginId": "features", + "id": "def-common.KibanaFeature.cases", + "type": "Object", + "tags": [], + "label": "cases", + "description": [], + "signature": [ + "readonly string[] | undefined" + ], + "source": { + "path": "x-pack/plugins/features/common/kibana_feature.ts", + "lineNumber": 191 }, "deprecated": false }, @@ -2942,7 +3062,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 186 + "lineNumber": 195 }, "deprecated": false }, @@ -2954,11 +3074,11 @@ "label": "reserved", "description": [], "signature": [ - "Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined" + "Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined" ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 190 + "lineNumber": 199 }, "deprecated": false }, @@ -2981,7 +3101,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 194 + "lineNumber": 203 }, "deprecated": false, "children": [], @@ -3035,7 +3155,7 @@ "section": "def-common.SubFeaturePrivilegeGroupType", "text": "SubFeaturePrivilegeGroupType" }, - "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"none\" | \"all\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; ui: readonly string[]; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]; }>" + "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"all\" | \"none\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; ui: readonly string[]; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]; }>" ], "source": { "path": "x-pack/plugins/features/common/sub_feature.ts", @@ -3076,7 +3196,7 @@ "section": "def-common.SubFeaturePrivilegeGroupType", "text": "SubFeaturePrivilegeGroupType" }, - "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"none\" | \"all\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; ui: readonly string[]; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]" + "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"all\" | \"none\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; ui: readonly string[]; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]" ], "source": { "path": "x-pack/plugins/features/common/sub_feature.ts", @@ -3100,7 +3220,7 @@ "section": "def-common.SubFeaturePrivilegeGroupType", "text": "SubFeaturePrivilegeGroupType" }, - "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"none\" | \"all\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; ui: readonly string[]; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]; }" + "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"all\" | \"none\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; ui: readonly string[]; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]; }" ], "source": { "path": "x-pack/plugins/features/common/sub_feature.ts", @@ -3432,7 +3552,7 @@ "\nIf your feature requires access to specific Alert Types, then specify your access needs here.\nInclude both Alert Types registered by the feature and external Alert Types such as built-in\nAlert Types and Alert Types provided by other features to which you wish to grant access." ], "signature": [ - "{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined" + "{ rule?: { all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined; alert?: { all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined; } | undefined" ], "source": { "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", @@ -3440,6 +3560,24 @@ }, "deprecated": false }, + { + "parentPluginId": "features", + "id": "def-common.FeatureKibanaPrivileges.cases", + "type": "Object", + "tags": [], + "label": "cases", + "description": [ + "\nIf your feature requires access to specific owners of cases (aka plugins that have created cases), then specify your access needs here. The values here should\nbe unique identifiers for the owners of cases you want access to." + ], + "signature": [ + "{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined" + ], + "source": { + "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", + "lineNumber": 135 + }, + "deprecated": false + }, { "parentPluginId": "features", "id": "def-common.FeatureKibanaPrivileges.savedObject", @@ -3454,7 +3592,7 @@ ], "source": { "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", - "lineNumber": 110 + "lineNumber": 161 }, "deprecated": false }, @@ -3474,7 +3612,7 @@ ], "source": { "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", - "lineNumber": 153 + "lineNumber": 204 }, "deprecated": false } @@ -3672,6 +3810,24 @@ }, "deprecated": false }, + { + "parentPluginId": "features", + "id": "def-common.KibanaFeatureConfig.cases", + "type": "Object", + "tags": [], + "label": "cases", + "description": [ + "\nIf your feature grants access to specific case types, you can specify them here to control visibility based on the current space." + ], + "signature": [ + "readonly string[] | undefined" + ], + "source": { + "path": "x-pack/plugins/features/common/kibana_feature.ts", + "lineNumber": 104 + }, + "deprecated": false + }, { "parentPluginId": "features", "id": "def-common.KibanaFeatureConfig.privileges", @@ -3704,7 +3860,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 113 + "lineNumber": 118 }, "deprecated": false }, @@ -3730,7 +3886,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 121 + "lineNumber": 126 }, "deprecated": false }, @@ -3748,7 +3904,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 126 + "lineNumber": 131 }, "deprecated": false }, @@ -3768,7 +3924,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 131 + "lineNumber": 136 }, "deprecated": false } @@ -3859,7 +4015,7 @@ "section": "def-common.FeatureKibanaPrivileges", "text": "FeatureKibanaPrivileges" }, - ", \"management\" | \"catalogue\" | \"alerting\" | \"ui\" | \"app\" | \"api\" | \"savedObject\">" + ", \"management\" | \"catalogue\" | \"alerting\" | \"ui\" | \"cases\" | \"app\" | \"api\" | \"savedObject\">" ], "source": { "path": "x-pack/plugins/features/common/sub_feature.ts", @@ -3907,7 +4063,7 @@ "\nDenotes which Primary Feature Privilege this sub-feature privilege should be included in.\n`read` is also included in `all` automatically." ], "signature": [ - "\"none\" | \"all\" | \"read\"" + "\"all\" | \"none\" | \"read\"" ], "source": { "path": "x-pack/plugins/features/common/sub_feature.ts", diff --git a/api_docs/features.mdx b/api_docs/features.mdx index 99776f69301592..377945d852ddd6 100644 --- a/api_docs/features.mdx +++ b/api_docs/features.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import featuresObj from './features.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 215 | 0 | 97 | 2 | + ## Client ### Setup diff --git a/api_docs/file_data_visualizer.json b/api_docs/file_data_visualizer.json deleted file mode 100644 index c536acd5f4997a..00000000000000 --- a/api_docs/file_data_visualizer.json +++ /dev/null @@ -1,328 +0,0 @@ -{ - "id": "fileDataVisualizer", - "client": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [], - "start": { - "parentPluginId": "fileDataVisualizer", - "id": "def-public.FileDataVisualizerPluginStart", - "type": "Type", - "tags": [], - "label": "FileDataVisualizerPluginStart", - "description": [], - "signature": [ - "{ getFileDataVisualizerComponent: () => Promise>; getMaxBytesFormatted: () => string; }" - ], - "source": { - "path": "x-pack/plugins/file_data_visualizer/public/plugin.ts", - "lineNumber": 33 - }, - "deprecated": false, - "lifecycle": "start", - "initialIsOpen": true - } - }, - "server": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [ - { - "parentPluginId": "fileDataVisualizer", - "id": "def-common.DataVisualizerTableState", - "type": "Interface", - "tags": [], - "label": "DataVisualizerTableState", - "description": [], - "source": { - "path": "x-pack/plugins/file_data_visualizer/common/types.ts", - "lineNumber": 14 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "fileDataVisualizer", - "id": "def-common.DataVisualizerTableState.pageSize", - "type": "number", - "tags": [], - "label": "pageSize", - "description": [], - "source": { - "path": "x-pack/plugins/file_data_visualizer/common/types.ts", - "lineNumber": 15 - }, - "deprecated": false - }, - { - "parentPluginId": "fileDataVisualizer", - "id": "def-common.DataVisualizerTableState.pageIndex", - "type": "number", - "tags": [], - "label": "pageIndex", - "description": [], - "source": { - "path": "x-pack/plugins/file_data_visualizer/common/types.ts", - "lineNumber": 16 - }, - "deprecated": false - }, - { - "parentPluginId": "fileDataVisualizer", - "id": "def-common.DataVisualizerTableState.sortField", - "type": "string", - "tags": [], - "label": "sortField", - "description": [], - "source": { - "path": "x-pack/plugins/file_data_visualizer/common/types.ts", - "lineNumber": 17 - }, - "deprecated": false - }, - { - "parentPluginId": "fileDataVisualizer", - "id": "def-common.DataVisualizerTableState.sortDirection", - "type": "string", - "tags": [], - "label": "sortDirection", - "description": [], - "source": { - "path": "x-pack/plugins/file_data_visualizer/common/types.ts", - "lineNumber": 18 - }, - "deprecated": false - }, - { - "parentPluginId": "fileDataVisualizer", - "id": "def-common.DataVisualizerTableState.visibleFieldTypes", - "type": "Array", - "tags": [], - "label": "visibleFieldTypes", - "description": [], - "signature": [ - "string[]" - ], - "source": { - "path": "x-pack/plugins/file_data_visualizer/common/types.ts", - "lineNumber": 19 - }, - "deprecated": false - }, - { - "parentPluginId": "fileDataVisualizer", - "id": "def-common.DataVisualizerTableState.visibleFieldNames", - "type": "Array", - "tags": [], - "label": "visibleFieldNames", - "description": [], - "signature": [ - "string[]" - ], - "source": { - "path": "x-pack/plugins/file_data_visualizer/common/types.ts", - "lineNumber": 20 - }, - "deprecated": false - }, - { - "parentPluginId": "fileDataVisualizer", - "id": "def-common.DataVisualizerTableState.showDistributions", - "type": "boolean", - "tags": [], - "label": "showDistributions", - "description": [], - "source": { - "path": "x-pack/plugins/file_data_visualizer/common/types.ts", - "lineNumber": 21 - }, - "deprecated": false - } - ], - "initialIsOpen": false - } - ], - "enums": [], - "misc": [ - { - "parentPluginId": "fileDataVisualizer", - "id": "def-common.ABSOLUTE_MAX_FILE_SIZE_BYTES", - "type": "number", - "tags": [], - "label": "ABSOLUTE_MAX_FILE_SIZE_BYTES", - "description": [], - "signature": [ - "1073741274" - ], - "source": { - "path": "x-pack/plugins/file_data_visualizer/common/constants.ts", - "lineNumber": 14 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "fileDataVisualizer", - "id": "def-common.FILE_SIZE_DISPLAY_FORMAT", - "type": "string", - "tags": [], - "label": "FILE_SIZE_DISPLAY_FORMAT", - "description": [], - "signature": [ - "\"0,0.[0] b\"" - ], - "source": { - "path": "x-pack/plugins/file_data_visualizer/common/constants.ts", - "lineNumber": 15 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "fileDataVisualizer", - "id": "def-common.INDEX_META_DATA_CREATED_BY", - "type": "string", - "tags": [], - "label": "INDEX_META_DATA_CREATED_BY", - "description": [], - "signature": [ - "\"file-data-visualizer\"" - ], - "source": { - "path": "x-pack/plugins/file_data_visualizer/common/constants.ts", - "lineNumber": 19 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "fileDataVisualizer", - "id": "def-common.InputData", - "type": "Type", - "tags": [], - "label": "InputData", - "description": [], - "signature": [ - "any[]" - ], - "source": { - "path": "x-pack/plugins/file_data_visualizer/common/types.ts", - "lineNumber": 10 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "fileDataVisualizer", - "id": "def-common.JobFieldType", - "type": "Type", - "tags": [], - "label": "JobFieldType", - "description": [], - "signature": [ - "\"number\" | \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"unknown\"" - ], - "source": { - "path": "x-pack/plugins/file_data_visualizer/common/types.ts", - "lineNumber": 12 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "fileDataVisualizer", - "id": "def-common.MAX_FILE_SIZE", - "type": "string", - "tags": [], - "label": "MAX_FILE_SIZE", - "description": [], - "signature": [ - "\"100MB\"" - ], - "source": { - "path": "x-pack/plugins/file_data_visualizer/common/constants.ts", - "lineNumber": 11 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "fileDataVisualizer", - "id": "def-common.MAX_FILE_SIZE_BYTES", - "type": "number", - "tags": [], - "label": "MAX_FILE_SIZE_BYTES", - "description": [], - "signature": [ - "104857600" - ], - "source": { - "path": "x-pack/plugins/file_data_visualizer/common/constants.ts", - "lineNumber": 12 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "fileDataVisualizer", - "id": "def-common.MB", - "type": "number", - "tags": [], - "label": "MB", - "description": [], - "source": { - "path": "x-pack/plugins/file_data_visualizer/common/constants.ts", - "lineNumber": 10 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "fileDataVisualizer", - "id": "def-common.UI_SETTING_MAX_FILE_SIZE", - "type": "string", - "tags": [], - "label": "UI_SETTING_MAX_FILE_SIZE", - "description": [], - "signature": [ - "\"fileUpload:maxFileSize\"" - ], - "source": { - "path": "x-pack/plugins/file_data_visualizer/common/constants.ts", - "lineNumber": 8 - }, - "deprecated": false, - "initialIsOpen": false - } - ], - "objects": [ - { - "parentPluginId": "fileDataVisualizer", - "id": "def-common.JOB_FIELD_TYPES", - "type": "Object", - "tags": [], - "label": "JOB_FIELD_TYPES", - "description": [], - "signature": [ - "{ readonly BOOLEAN: \"boolean\"; readonly DATE: \"date\"; readonly GEO_POINT: \"geo_point\"; readonly GEO_SHAPE: \"geo_shape\"; readonly IP: \"ip\"; readonly KEYWORD: \"keyword\"; readonly NUMBER: \"number\"; readonly TEXT: \"text\"; readonly UNKNOWN: \"unknown\"; }" - ], - "source": { - "path": "x-pack/plugins/file_data_visualizer/common/constants.ts", - "lineNumber": 21 - }, - "deprecated": false, - "initialIsOpen": false - } - ] - } -} \ No newline at end of file diff --git a/api_docs/file_data_visualizer.mdx b/api_docs/file_data_visualizer.mdx deleted file mode 100644 index 07d4fc76d448a2..00000000000000 --- a/api_docs/file_data_visualizer.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -id: kibFileDataVisualizerPluginApi -slug: /kibana-dev-docs/fileDataVisualizerPluginApi -title: fileDataVisualizer -image: https://source.unsplash.com/400x175/?github -summary: API docs for the fileDataVisualizer plugin -date: 2020-11-16 -tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fileDataVisualizer'] -warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. ---- - -import fileDataVisualizerObj from './file_data_visualizer.json'; - -## Client - -### Start - - -## Common - -### Objects - - -### Interfaces - - -### Consts, variables and types - - diff --git a/api_docs/file_upload.mdx b/api_docs/file_upload.mdx index aa4af1121e1183..acd0ed52e41826 100644 --- a/api_docs/file_upload.mdx +++ b/api_docs/file_upload.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import fileUploadObj from './file_upload.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 128 | 4 | 128 | 1 | + ## Client ### Start diff --git a/api_docs/fleet.json b/api_docs/fleet.json index 043dfcd16c2a79..bb7e8990626400 100644 --- a/api_docs/fleet.json +++ b/api_docs/fleet.json @@ -14,7 +14,7 @@ "(packageInfo: T) => string" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/services/pkg_key_from_package_info.ts", + "path": "x-pack/plugins/fleet/public/services/pkg_key_from_package_info.ts", "lineNumber": 8 }, "deprecated": false, @@ -30,7 +30,7 @@ "T" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/services/pkg_key_from_package_info.ts", + "path": "x-pack/plugins/fleet/public/services/pkg_key_from_package_info.ts", "lineNumber": 9 }, "deprecated": false, @@ -52,7 +52,7 @@ "\nSupported routing state for the agent policy details page routes with deploy agents action" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/intra_app_route_state.ts", + "path": "x-pack/plugins/fleet/public/types/intra_app_route_state.ts", "lineNumber": 37 }, "deprecated": false, @@ -78,7 +78,7 @@ " | undefined] | undefined" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/intra_app_route_state.ts", + "path": "x-pack/plugins/fleet/public/types/intra_app_route_state.ts", "lineNumber": 39 }, "deprecated": false @@ -96,7 +96,7 @@ "\nSupported routing state for the agent policy details page routes with deploy agents action" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/intra_app_route_state.ts", + "path": "x-pack/plugins/fleet/public/types/intra_app_route_state.ts", "lineNumber": 29 }, "deprecated": false, @@ -122,7 +122,7 @@ " | undefined] | undefined" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/intra_app_route_state.ts", + "path": "x-pack/plugins/fleet/public/types/intra_app_route_state.ts", "lineNumber": 31 }, "deprecated": false @@ -140,7 +140,7 @@ "\nSupported routing state for the create package policy page routes" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/intra_app_route_state.ts", + "path": "x-pack/plugins/fleet/public/types/intra_app_route_state.ts", "lineNumber": 15 }, "deprecated": false, @@ -182,7 +182,7 @@ " | undefined]) | undefined" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/intra_app_route_state.ts", + "path": "x-pack/plugins/fleet/public/types/intra_app_route_state.ts", "lineNumber": 17 }, "deprecated": false @@ -208,7 +208,7 @@ " | undefined] | undefined" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/intra_app_route_state.ts", + "path": "x-pack/plugins/fleet/public/types/intra_app_route_state.ts", "lineNumber": 21 }, "deprecated": false @@ -226,7 +226,7 @@ "string | undefined" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/intra_app_route_state.ts", + "path": "x-pack/plugins/fleet/public/types/intra_app_route_state.ts", "lineNumber": 23 }, "deprecated": false @@ -411,7 +411,7 @@ "Extension point registration contract for Integration details Custom view" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 94 }, "deprecated": false, @@ -424,7 +424,7 @@ "label": "package", "description": [], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 95 }, "deprecated": false @@ -440,7 +440,7 @@ "\"package-detail-custom\"" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 96 }, "deprecated": false @@ -488,7 +488,7 @@ ">; }" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 97 }, "deprecated": false, @@ -523,7 +523,7 @@ "label": "PackageCustomExtensionComponentProps", "description": [], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 87 }, "deprecated": false, @@ -538,7 +538,7 @@ "The package key value that should be used used for URLs" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 89 }, "deprecated": false @@ -649,7 +649,7 @@ ">>" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 90 }, "deprecated": false @@ -667,7 +667,7 @@ "Extension point registration contract for Integration Policy Create views" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 76 }, "deprecated": false, @@ -680,7 +680,7 @@ "label": "package", "description": [], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 77 }, "deprecated": false @@ -696,7 +696,7 @@ "\"package-policy-create\"" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 78 }, "deprecated": false @@ -744,7 +744,7 @@ ">; }" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 79 }, "deprecated": false, @@ -779,7 +779,7 @@ "label": "PackagePolicyCreateExtensionComponentProps", "description": [], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 60 }, "deprecated": false, @@ -803,7 +803,7 @@ } ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 62 }, "deprecated": false @@ -829,7 +829,7 @@ "; }) => void" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 67 }, "deprecated": false, @@ -854,7 +854,7 @@ "; }" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 67 }, "deprecated": false @@ -874,7 +874,7 @@ "Extension point registration contract for Integration Policy Edit views" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 48 }, "deprecated": false, @@ -887,7 +887,7 @@ "label": "package", "description": [], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 49 }, "deprecated": false @@ -903,7 +903,7 @@ "\"package-policy-edit\"" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 50 }, "deprecated": false @@ -951,7 +951,7 @@ ">; }" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 51 }, "deprecated": false, @@ -986,7 +986,7 @@ "label": "PackagePolicyEditExtensionComponentProps", "description": [], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 26 }, "deprecated": false, @@ -1010,7 +1010,7 @@ } ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 28 }, "deprecated": false @@ -1034,7 +1034,7 @@ } ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 30 }, "deprecated": false @@ -1060,7 +1060,7 @@ ">; }) => void" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 39 }, "deprecated": false, @@ -1085,7 +1085,7 @@ ">; }" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 39 }, "deprecated": false @@ -1105,7 +1105,7 @@ "Internal storage for registered UI Extension Points" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 16 }, "deprecated": false, @@ -1121,7 +1121,7 @@ "any" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 17 }, "deprecated": false @@ -1167,7 +1167,7 @@ } ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/intra_app_route_state.ts", + "path": "x-pack/plugins/fleet/public/types/intra_app_route_state.ts", "lineNumber": 45 }, "deprecated": false, @@ -1202,7 +1202,7 @@ ">" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 85 }, "deprecated": false, @@ -1237,7 +1237,7 @@ ">" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 58 }, "deprecated": false, @@ -1272,7 +1272,7 @@ ">" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 24 }, "deprecated": false, @@ -1313,7 +1313,7 @@ } ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 101 }, "deprecated": false, @@ -1340,7 +1340,7 @@ ") => void" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 13 }, "deprecated": false, @@ -1356,8 +1356,8 @@ "label": "pagePathGetters", "description": [], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 69 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 73 }, "deprecated": false, "children": [ @@ -1369,11 +1369,11 @@ "label": "base", "description": [], "signature": [ - "() => string" + "() => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 75 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 79 }, "deprecated": false, "children": [], @@ -1387,11 +1387,11 @@ "label": "overview", "description": [], "signature": [ - "() => string" + "() => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 76 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 80 }, "deprecated": false, "children": [], @@ -1405,11 +1405,11 @@ "label": "integrations", "description": [], "signature": [ - "() => string" + "() => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 77 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 81 }, "deprecated": false, "children": [], @@ -1423,11 +1423,11 @@ "label": "integrations_all", "description": [], "signature": [ - "() => string" + "() => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 78 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 82 }, "deprecated": false, "children": [], @@ -1441,11 +1441,11 @@ "label": "integrations_installed", "description": [], "signature": [ - "() => string" + "() => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 79 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 83 }, "deprecated": false, "children": [], @@ -1461,11 +1461,11 @@ "signature": [ "({ pkgkey, integration }: ", "DynamicPagePathValues", - ") => string" + ") => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 80 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 84 }, "deprecated": false, "children": [ @@ -1480,8 +1480,8 @@ "DynamicPagePathValues" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 80 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 84 }, "deprecated": false, "isRequired": true @@ -1499,11 +1499,11 @@ "signature": [ "({ pkgkey, integration }: ", "DynamicPagePathValues", - ") => string" + ") => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 82 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 88 }, "deprecated": false, "children": [ @@ -1518,8 +1518,8 @@ "DynamicPagePathValues" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 82 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 88 }, "deprecated": false, "isRequired": true @@ -1537,11 +1537,11 @@ "signature": [ "({ pkgkey, integration }: ", "DynamicPagePathValues", - ") => string" + ") => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 84 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 92 }, "deprecated": false, "children": [ @@ -1556,8 +1556,8 @@ "DynamicPagePathValues" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 84 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 92 }, "deprecated": false, "isRequired": true @@ -1575,11 +1575,11 @@ "signature": [ "({ pkgkey, integration }: ", "DynamicPagePathValues", - ") => string" + ") => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 86 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 96 }, "deprecated": false, "children": [ @@ -1594,8 +1594,8 @@ "DynamicPagePathValues" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 86 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 96 }, "deprecated": false, "isRequired": true @@ -1613,11 +1613,11 @@ "signature": [ "({ packagePolicyId }: ", "DynamicPagePathValues", - ") => string" + ") => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 88 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 100 }, "deprecated": false, "children": [ @@ -1632,8 +1632,8 @@ "DynamicPagePathValues" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 88 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 100 }, "deprecated": false, "isRequired": true @@ -1649,11 +1649,11 @@ "label": "policies", "description": [], "signature": [ - "() => string" + "() => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 90 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 104 }, "deprecated": false, "children": [], @@ -1667,11 +1667,11 @@ "label": "policies_list", "description": [], "signature": [ - "() => string" + "() => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 91 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 105 }, "deprecated": false, "children": [], @@ -1687,11 +1687,11 @@ "signature": [ "({ policyId, tabId }: ", "DynamicPagePathValues", - ") => string" + ") => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 92 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 106 }, "deprecated": false, "children": [ @@ -1706,8 +1706,8 @@ "DynamicPagePathValues" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 92 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 106 }, "deprecated": false, "isRequired": true @@ -1725,11 +1725,11 @@ "signature": [ "({ policyId }: ", "DynamicPagePathValues", - ") => string" + ") => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 93 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 110 }, "deprecated": false, "children": [ @@ -1744,8 +1744,8 @@ "DynamicPagePathValues" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 93 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 110 }, "deprecated": false, "isRequired": true @@ -1763,11 +1763,11 @@ "signature": [ "({ pkgkey, integration }: ", "DynamicPagePathValues", - ") => string" + ") => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 94 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 114 }, "deprecated": false, "children": [ @@ -1782,8 +1782,8 @@ "DynamicPagePathValues" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 94 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 114 }, "deprecated": false, "isRequired": true @@ -1801,11 +1801,11 @@ "signature": [ "({ policyId, packagePolicyId }: ", "DynamicPagePathValues", - ") => string" + ") => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 96 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 118 }, "deprecated": false, "children": [ @@ -1820,8 +1820,8 @@ "DynamicPagePathValues" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 96 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 118 }, "deprecated": false, "isRequired": true @@ -1837,11 +1837,11 @@ "label": "fleet", "description": [], "signature": [ - "() => string" + "() => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 98 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 122 }, "deprecated": false, "children": [], @@ -1857,11 +1857,11 @@ "signature": [ "({ kuery }: ", "DynamicPagePathValues", - ") => string" + ") => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 99 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 123 }, "deprecated": false, "children": [ @@ -1876,8 +1876,8 @@ "DynamicPagePathValues" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 99 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 123 }, "deprecated": false, "isRequired": true @@ -1895,11 +1895,11 @@ "signature": [ "({ agentId, tabId, logQuery }: ", "DynamicPagePathValues", - ") => string" + ") => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 100 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 127 }, "deprecated": false, "children": [ @@ -1914,8 +1914,8 @@ "DynamicPagePathValues" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 100 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 127 }, "deprecated": false, "isRequired": true @@ -1931,11 +1931,11 @@ "label": "fleet_enrollment_tokens", "description": [], "signature": [ - "() => string" + "() => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 102 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 131 }, "deprecated": false, "children": [], @@ -1949,11 +1949,11 @@ "label": "data_streams", "description": [], "signature": [ - "() => string" + "() => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 103 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 132 }, "deprecated": false, "children": [], @@ -1972,7 +1972,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/public/plugin.ts", - "lineNumber": 51 + "lineNumber": 48 }, "deprecated": false, "children": [], @@ -1990,7 +1990,7 @@ ], "source": { "path": "x-pack/plugins/fleet/public/plugin.ts", - "lineNumber": 56 + "lineNumber": 53 }, "deprecated": false, "children": [ @@ -2014,7 +2014,7 @@ ], "source": { "path": "x-pack/plugins/fleet/public/plugin.ts", - "lineNumber": 57 + "lineNumber": 54 }, "deprecated": false, "returnComment": [], @@ -2052,7 +2052,7 @@ } ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 13 }, "deprecated": false @@ -2071,7 +2071,7 @@ ], "source": { "path": "x-pack/plugins/fleet/public/plugin.ts", - "lineNumber": 58 + "lineNumber": 55 }, "deprecated": false, "returnComment": [], @@ -3721,7 +3721,7 @@ "signature": [ "Pick<", "KibanaClient", - ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"helpers\" | \"count\" | \"search\" | \"security\" | \"eql\" | \"on\" | \"off\" | \"transform\" | \"emit\" | \"once\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", + ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"helpers\" | \"count\" | \"search\" | \"security\" | \"eql\" | \"on\" | \"off\" | \"transform\" | \"emit\" | \"once\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", "TransportRequestParams", ", options?: ", "TransportRequestOptions", @@ -3966,7 +3966,7 @@ "signature": [ "Pick<", "KibanaClient", - ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"helpers\" | \"count\" | \"search\" | \"security\" | \"eql\" | \"on\" | \"off\" | \"transform\" | \"emit\" | \"once\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", + ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"helpers\" | \"count\" | \"search\" | \"security\" | \"eql\" | \"on\" | \"off\" | \"transform\" | \"emit\" | \"once\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", "TransportRequestParams", ", options?: ", "TransportRequestOptions", @@ -4448,7 +4448,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 90 + "lineNumber": 91 }, "deprecated": false, "children": [ @@ -4470,7 +4470,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 91 + "lineNumber": 92 }, "deprecated": false }, @@ -4493,7 +4493,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 92 + "lineNumber": 93 }, "deprecated": false }, @@ -4516,7 +4516,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 93 + "lineNumber": 94 }, "deprecated": false }, @@ -4538,7 +4538,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 94 + "lineNumber": 95 }, "deprecated": false }, @@ -4561,7 +4561,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 95 + "lineNumber": 96 }, "deprecated": false }, @@ -4584,7 +4584,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 96 + "lineNumber": 97 }, "deprecated": false } @@ -4767,7 +4767,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 137 + "lineNumber": 138 }, "deprecated": false, "initialIsOpen": false @@ -4784,7 +4784,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/index.ts", - "lineNumber": 66 + "lineNumber": 83 }, "deprecated": false, "initialIsOpen": false @@ -4801,7 +4801,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/services/package_policy.ts", - "lineNumber": 655 + "lineNumber": 656 }, "deprecated": false, "initialIsOpen": false @@ -4838,7 +4838,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 122 + "lineNumber": 123 }, "deprecated": false, "lifecycle": "setup", @@ -4855,7 +4855,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 160 + "lineNumber": 161 }, "deprecated": false, "children": [ @@ -4873,7 +4873,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 166 + "lineNumber": 167 }, "deprecated": false, "returnComment": [], @@ -4897,7 +4897,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 167 + "lineNumber": 168 }, "deprecated": false }, @@ -4919,7 +4919,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 168 + "lineNumber": 169 }, "deprecated": false }, @@ -4941,7 +4941,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 169 + "lineNumber": 170 }, "deprecated": false }, @@ -4959,7 +4959,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 173 + "lineNumber": 174 }, "deprecated": false }, @@ -4981,7 +4981,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 174 + "lineNumber": 175 }, "deprecated": false }, @@ -5007,7 +5007,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 179 + "lineNumber": 180 }, "deprecated": false, "returnComment": [], @@ -5088,7 +5088,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 179 + "lineNumber": 180 }, "deprecated": false } @@ -5109,7 +5109,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 185 + "lineNumber": 186 }, "deprecated": false, "returnComment": [], @@ -5123,7 +5123,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 185 + "lineNumber": 186 }, "deprecated": false } @@ -8203,7 +8203,7 @@ "label": "agents", "description": [], "signature": [ - "{ enabled: boolean; elasticsearch: { host?: string | undefined; ca_sha256?: string | undefined; }; fleet_server?: { hosts?: string[] | undefined; } | undefined; }" + "{ enabled: boolean; elasticsearch: { hosts?: string[] | undefined; ca_sha256?: string | undefined; }; fleet_server?: { hosts?: string[] | undefined; } | undefined; }" ], "source": { "path": "x-pack/plugins/fleet/common/types/index.ts", @@ -17304,6 +17304,23 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "fleet", + "id": "def-common.INTEGRATIONS_PLUGIN_ID", + "type": "string", + "tags": [], + "label": "INTEGRATIONS_PLUGIN_ID", + "description": [], + "signature": [ + "\"integrations\"" + ], + "source": { + "path": "x-pack/plugins/fleet/common/constants/plugin.ts", + "lineNumber": 9 + }, + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "fleet", "id": "def-common.KibanaAssetParts", diff --git a/api_docs/fleet.mdx b/api_docs/fleet.mdx index 1388184f7a9480..2113069fe47e07 100644 --- a/api_docs/fleet.mdx +++ b/api_docs/fleet.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import fleetObj from './fleet.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 1071 | 15 | 981 | 8 | + ## Client ### Setup diff --git a/api_docs/global_search.mdx b/api_docs/global_search.mdx index 2e88a252eb35dd..041b9aba8ec7c8 100644 --- a/api_docs/global_search.mdx +++ b/api_docs/global_search.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import globalSearchObj from './global_search.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 68 | 0 | 14 | 5 | + ## Client ### Setup diff --git a/api_docs/home.json b/api_docs/home.json index a1039beb8d3a24..c11d02dfed9de1 100644 --- a/api_docs/home.json +++ b/api_docs/home.json @@ -501,7 +501,7 @@ ], "source": { "path": "src/plugins/home/public/plugin.ts", - "lineNumber": 161 + "lineNumber": 166 }, "deprecated": false, "initialIsOpen": false @@ -534,7 +534,7 @@ ], "source": { "path": "src/plugins/home/public/plugin.ts", - "lineNumber": 158 + "lineNumber": 163 }, "deprecated": false, "initialIsOpen": false @@ -602,7 +602,7 @@ ], "source": { "path": "src/plugins/home/public/plugin.ts", - "lineNumber": 164 + "lineNumber": 169 }, "deprecated": false, "initialIsOpen": false @@ -873,7 +873,7 @@ "description": [], "source": { "path": "src/plugins/home/public/plugin.ts", - "lineNumber": 167 + "lineNumber": 175 }, "deprecated": false, "children": [ @@ -889,7 +889,25 @@ ], "source": { "path": "src/plugins/home/public/plugin.ts", - "lineNumber": 168 + "lineNumber": 176 + }, + "deprecated": false + }, + { + "parentPluginId": "home", + "id": "def-public.HomePublicPluginSetup.addData", + "type": "Object", + "tags": [], + "label": "addData", + "description": [], + "signature": [ + "{ registerAddDataTab: (tab: ", + "AddDataTab", + ") => void; }" + ], + "source": { + "path": "src/plugins/home/public/plugin.ts", + "lineNumber": 177 }, "deprecated": false }, @@ -921,7 +939,7 @@ ], "source": { "path": "src/plugins/home/public/plugin.ts", - "lineNumber": 169 + "lineNumber": 178 }, "deprecated": false }, @@ -949,7 +967,7 @@ ], "source": { "path": "src/plugins/home/public/plugin.ts", - "lineNumber": 176 + "lineNumber": 185 }, "deprecated": true, "references": [ @@ -964,7 +982,7 @@ "plugin": "apm", "link": { "path": "x-pack/plugins/apm/public/plugin.ts", - "lineNumber": 82 + "lineNumber": 85 } }, { @@ -989,7 +1007,7 @@ "description": [], "source": { "path": "src/plugins/home/public/plugin.ts", - "lineNumber": 178 + "lineNumber": 187 }, "deprecated": false, "children": [ @@ -1005,7 +1023,7 @@ ], "source": { "path": "src/plugins/home/public/plugin.ts", - "lineNumber": 179 + "lineNumber": 188 }, "deprecated": false } diff --git a/api_docs/home.mdx b/api_docs/home.mdx index 0a8bac237b045b..23c58467b6a986 100644 --- a/api_docs/home.mdx +++ b/api_docs/home.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import homeObj from './home.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 89 | 0 | 65 | 5 | + ## Client ### Setup diff --git a/api_docs/index_lifecycle_management.mdx b/api_docs/index_lifecycle_management.mdx index f6aff00be5c616..a16206ad3d3610 100644 --- a/api_docs/index_lifecycle_management.mdx +++ b/api_docs/index_lifecycle_management.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import indexLifecycleManagementObj from './index_lifecycle_management.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 5 | 0 | 5 | 0 | + ## Client ### Interfaces diff --git a/api_docs/index_management.json b/api_docs/index_management.json index 9d4edf199ca274..9dc02a51148bca 100644 --- a/api_docs/index_management.json +++ b/api_docs/index_management.json @@ -722,7 +722,7 @@ "description": [], "source": { "path": "x-pack/plugins/index_management/server/plugin.ts", - "lineNumber": 25 + "lineNumber": 23 }, "deprecated": false, "children": [ @@ -740,7 +740,7 @@ ], "source": { "path": "x-pack/plugins/index_management/server/plugin.ts", - "lineNumber": 26 + "lineNumber": 24 }, "deprecated": false } diff --git a/api_docs/index_management.mdx b/api_docs/index_management.mdx index 0f22d279f7ecf9..9190012ac0b293 100644 --- a/api_docs/index_management.mdx +++ b/api_docs/index_management.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import indexManagementObj from './index_management.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 162 | 12 | 157 | 3 | + ## Client ### Functions diff --git a/api_docs/index_pattern_field_editor.mdx b/api_docs/index_pattern_field_editor.mdx index 7c057e8706f7de..1627a18e66724a 100644 --- a/api_docs/index_pattern_field_editor.mdx +++ b/api_docs/index_pattern_field_editor.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import indexPatternFieldEditorObj from './index_pattern_field_editor.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 31 | 1 | 29 | 4 | + ## Client ### Start diff --git a/api_docs/index_pattern_management.mdx b/api_docs/index_pattern_management.mdx index b74d3a7262870a..7d82efb213ff1c 100644 --- a/api_docs/index_pattern_management.mdx +++ b/api_docs/index_pattern_management.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import indexPatternManagementObj from './index_pattern_management.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 46 | 0 | 46 | 4 | + ## Client ### Setup diff --git a/api_docs/infra.mdx b/api_docs/infra.mdx index 83eb9982628644..0a13dcdfb5bcca 100644 --- a/api_docs/infra.mdx +++ b/api_docs/infra.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import infraObj from './infra.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 23 | 0 | 20 | 4 | + ## Client ### Objects diff --git a/api_docs/ingest_pipelines.mdx b/api_docs/ingest_pipelines.mdx index eb56280c5b4ae5..25bdbceda4eadd 100644 --- a/api_docs/ingest_pipelines.mdx +++ b/api_docs/ingest_pipelines.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import ingestPipelinesObj from './ingest_pipelines.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 9 | 0 | 9 | 4 | + ## Client ### Classes diff --git a/api_docs/inspector.mdx b/api_docs/inspector.mdx index 1fe62ba63e26e3..d69ef22ce788ad 100644 --- a/api_docs/inspector.mdx +++ b/api_docs/inspector.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import inspectorObj from './inspector.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 101 | 6 | 78 | 4 | + ## Client ### Setup diff --git a/api_docs/kibana_legacy.mdx b/api_docs/kibana_legacy.mdx index 208cb8013d063b..5cd9244f0ea57f 100644 --- a/api_docs/kibana_legacy.mdx +++ b/api_docs/kibana_legacy.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import kibanaLegacyObj from './kibana_legacy.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 93 | 3 | 85 | 1 | + ## Client ### Functions diff --git a/api_docs/kibana_react.json b/api_docs/kibana_react.json index 98537d71d7b019..a477de7c6512c1 100644 --- a/api_docs/kibana_react.json +++ b/api_docs/kibana_react.json @@ -3952,11 +3952,11 @@ "CommonProps", " & React.HTMLAttributes & ", "DisambiguateSet", - "<{ position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }, { position: \"static\" | \"sticky\"; }> & { position: \"static\" | \"sticky\"; } & { paddingSize?: \"m\" | \"s\" | \"none\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | (", + "<{ position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }, { position: \"static\" | \"sticky\"; }> & { position: \"static\" | \"sticky\"; } & { paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | (", "CommonProps", " & React.HTMLAttributes & ", "DisambiguateSet", - "<{ position: \"static\" | \"sticky\"; }, { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }> & { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; } & { paddingSize?: \"m\" | \"s\" | \"none\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | undefined; }, { template: \"default\" | \"empty\" | \"centeredBody\" | \"centeredContent\"; }> & { template: \"default\" | \"empty\" | \"centeredBody\" | \"centeredContent\"; } & { paddingSize?: \"m\" | \"s\" | \"none\" | \"l\" | undefined; pageSideBar?: React.ReactNode; pageSideBarProps?: ", + "<{ position: \"static\" | \"sticky\"; }, { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }> & { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; } & { paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | undefined; }, { template: \"default\" | \"empty\" | \"centeredBody\" | \"centeredContent\"; }> & { template: \"default\" | \"empty\" | \"centeredBody\" | \"centeredContent\"; } & { paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; pageSideBar?: React.ReactNode; pageSideBarProps?: ", "EuiPageSideBarProps", " | undefined; pageHeader?: ", "EuiPageHeaderProps", @@ -3976,19 +3976,19 @@ "CommonProps", " & React.HTMLAttributes & ", "DisambiguateSet", - "<{ position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }, { position: \"static\" | \"sticky\"; }> & { position: \"static\" | \"sticky\"; } & { paddingSize?: \"m\" | \"s\" | \"none\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | (", + "<{ position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }, { position: \"static\" | \"sticky\"; }> & { position: \"static\" | \"sticky\"; } & { paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | (", "CommonProps", " & React.HTMLAttributes & ", "DisambiguateSet", - "<{ position: \"static\" | \"sticky\"; }, { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }> & { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; } & { paddingSize?: \"m\" | \"s\" | \"none\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | undefined; }> & { template?: \"default\" | undefined; bottomBar?: React.ReactNode; bottomBarProps?: (", + "<{ position: \"static\" | \"sticky\"; }, { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }> & { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; } & { paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | undefined; }> & { template?: \"default\" | undefined; bottomBar?: React.ReactNode; bottomBarProps?: (", "CommonProps", " & React.HTMLAttributes & ", "DisambiguateSet", - "<{ position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }, { position: \"static\" | \"sticky\"; }> & { position: \"static\" | \"sticky\"; } & { paddingSize?: \"m\" | \"s\" | \"none\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | (", + "<{ position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }, { position: \"static\" | \"sticky\"; }> & { position: \"static\" | \"sticky\"; } & { paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | (", "CommonProps", " & React.HTMLAttributes & ", "DisambiguateSet", - "<{ position: \"static\" | \"sticky\"; }, { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }> & { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; } & { paddingSize?: \"m\" | \"s\" | \"none\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | undefined; } & { paddingSize?: \"m\" | \"s\" | \"none\" | \"l\" | undefined; pageSideBar?: React.ReactNode; pageSideBarProps?: ", + "<{ position: \"static\" | \"sticky\"; }, { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }> & { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; } & { paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | undefined; } & { paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; pageSideBar?: React.ReactNode; pageSideBarProps?: ", "EuiPageSideBarProps", " | undefined; pageHeader?: ", "EuiPageHeaderProps", @@ -4122,7 +4122,7 @@ "label": "POSITIONS", "description": [], "signature": [ - "(\"left\" | \"right\" | \"none\" | \"center\")[]" + "(\"none\" | \"left\" | \"right\" | \"center\")[]" ], "source": { "path": "src/plugins/kibana_react/public/toolbar_button/toolbar_button.tsx", @@ -4185,7 +4185,7 @@ "EuiButtonProps", ", { buttonRef?: ((instance: HTMLButtonElement | null) => void) | React.RefObject | null | undefined; }>> & ", "EuiButtonProps", - " & { onClick?: ((event: React.MouseEvent) => void) | undefined; } & React.ButtonHTMLAttributes & { buttonRef?: ((instance: HTMLButtonElement | null) => void) | React.RefObject | null | undefined; } & { fontWeight?: \"bold\" | \"normal\" | undefined; size?: \"m\" | \"s\" | undefined; hasArrow?: boolean | undefined; groupPosition?: \"left\" | \"right\" | \"none\" | \"center\" | undefined; dataTestSubj?: string | undefined; }) | (", + " & { onClick?: ((event: React.MouseEvent) => void) | undefined; } & React.ButtonHTMLAttributes & { buttonRef?: ((instance: HTMLButtonElement | null) => void) | React.RefObject | null | undefined; } & { fontWeight?: \"bold\" | \"normal\" | undefined; size?: \"m\" | \"s\" | undefined; hasArrow?: boolean | undefined; groupPosition?: \"none\" | \"left\" | \"right\" | \"center\" | undefined; dataTestSubj?: string | undefined; }) | (", "DisambiguateSet", "<", "PropsForButton", @@ -4197,7 +4197,7 @@ "EuiButtonProps", ", { buttonRef?: ((instance: HTMLAnchorElement | null) => void) | React.RefObject | null | undefined; }>> & ", "EuiButtonProps", - " & { href?: string | undefined; onClick?: ((event: React.MouseEvent) => void) | undefined; } & React.AnchorHTMLAttributes & { buttonRef?: ((instance: HTMLAnchorElement | null) => void) | React.RefObject | null | undefined; } & { fontWeight?: \"bold\" | \"normal\" | undefined; size?: \"m\" | \"s\" | undefined; hasArrow?: boolean | undefined; groupPosition?: \"left\" | \"right\" | \"none\" | \"center\" | undefined; dataTestSubj?: string | undefined; })" + " & { href?: string | undefined; onClick?: ((event: React.MouseEvent) => void) | undefined; } & React.AnchorHTMLAttributes & { buttonRef?: ((instance: HTMLAnchorElement | null) => void) | React.RefObject | null | undefined; } & { fontWeight?: \"bold\" | \"normal\" | undefined; size?: \"m\" | \"s\" | undefined; hasArrow?: boolean | undefined; groupPosition?: \"none\" | \"left\" | \"right\" | \"center\" | undefined; dataTestSubj?: string | undefined; })" ], "source": { "path": "src/plugins/kibana_react/public/toolbar_button/toolbar_button.tsx", @@ -5003,7 +5003,7 @@ "label": "eui", "description": [], "signature": [ - "{ paddingSizes: { xs: string; s: string; m: string; l: string; xl: string; }; avatarSizing: { s: { size: string; 'font-size': string; }; m: { size: string; 'font-size': string; }; l: { size: string; 'font-size': string; }; xl: { size: string; 'font-size': string; }; }; euiBadgeGroupGutterTypes: { gutterExtraSmall: string; gutterSmall: string; }; euiBreadcrumbSpacing: string; euiBreadcrumbTruncateWidth: string; euiButtonEmptyTypes: { primary: string; danger: string; disabled: string; ghost: string; text: string; success: string; warning: string; }; euiButtonIconTypes: { accent: string; danger: string; ghost: string; primary: string; subdued: string; success: string; text: string; warning: string; }; euiCallOutTypes: { primary: string; success: string; warning: string; danger: string; }; euiCardSpacing: string; euiCardBottomNodeHeight: string; euiCardSelectButtonBorders: { text: string; primary: string; success: string; danger: string; ghost: string; }; euiCardSelectButtonBackgrounds: { text: string; primary: string; success: string; danger: string; ghost: string; }; euiCardPaddingModifiers: { paddingNone: number; paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiCheckableCardPadding: string; euiCollapsibleNavWidth: string; euiCollapsibleNavGroupLightBackgroundColor: string; euiCollapsibleNavGroupDarkBackgroundColor: string; euiCollapsibleNavGroupDarkHighContrastColor: string; euiColorPickerValueRange0: string; euiColorPickerValueRange1: string; euiColorPickerSaturationRange0: string; euiColorPickerSaturationRange1: string; euiColorPickerIndicatorSize: string; euiColorPickerWidth: string; euiColorPaletteDisplaySizes: { sizeExtraSmall: string; sizeSmall: string; sizeMedium: string; }; euiContextMenuWidth: string; euiControlBarBackground: string; euiControlBarText: string; euiControlBarBorderColor: string; euiControlBarInitialHeight: string; euiControlBarMaxHeight: string; euiControlBarHeights: { s: string; m: string; l: string; }; euiDataGridPrefix: string; euiDataGridStyles: string; euiDataGridColumnResizerWidth: string; euiDataGridPopoverMaxHeight: string; euiDataGridCellPaddingS: string; euiDataGridCellPaddingM: string; euiDataGridCellPaddingL: string; euiDataGridVerticalBorder: string; euiDatePickerCalendarWidth: string; euiSuperDatePickerWidth: string; euiSuperDatePickerButtonWidth: string; euiDragAndDropSpacing: { s: string; m: string; l: string; }; euiExpressionColors: { subdued: string; primary: string; secondary: string; warning: string; danger: string; accent: string; }; euiFacetGutterSizes: { gutterNone: number; gutterSmall: string; gutterMedium: string; gutterLarge: string; }; gutterTypes: { gutterExtraSmall: string; gutterSmall: string; gutterMedium: string; gutterLarge: string; gutterExtraLarge: string; }; fractions: { fourths: { percentage: string; count: number; }; thirds: { percentage: string; count: number; }; halves: { percentage: string; count: number; }; single: { percentage: string; count: number; }; }; flyoutSizes: { small: { min: string; width: string; max: string; }; medium: { min: string; width: string; max: string; }; large: { min: string; width: string; max: string; }; }; euiFlyoutBorder: string; euiFlyoutPaddingModifiers: { paddingNone: number; paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiFilePickerTallHeight: string; euiRangeLevelColors: { primary: string; success: string; warning: string; danger: string; }; textareaResizing: { vertical: string; horizontal: string; both: string; none: string; }; euiHeaderLinksGutterSizes: { gutterXS: string; gutterS: string; gutterM: string; gutterL: string; }; ruleMargins: { marginXSmall: string; marginSmall: string; marginMedium: string; marginLarge: string; marginXLarge: string; marginXXLarge: string; }; euiIconLoadingOpacity: number; euiIconColors: { accent: string; danger: string; ghost: string; primary: string; secondary: string; success: string; subdued: string; text: string; warning: string; }; euiIconSizes: { small: string; medium: string; large: string; xLarge: string; xxLarge: string; }; euiKeyPadMenuSize: string; euiKeyPadMenuItemBetaBadgeSize: string; euiLinkColors: { subdued: string; primary: string; secondary: string; accent: string; warning: string; danger: string; text: string; ghost: string; }; euiListGroupItemHoverBackground: string; euiListGroupItemHoverBackgroundGhost: string; euiListGroupGutterTypes: { gutterSmall: string; gutterMedium: string; }; euiListGroupItemColorTypes: { primary: string; text: string; subdued: string; ghost: string; }; euiListGroupItemSizeTypes: { xSmall: string; small: string; medium: string; large: string; }; euiGradientStartStop: string; euiGradientMiddle: string; browserDefaultFontSize: string; euiMarkdownEditorMinHeight: string; euiPopoverArrowSize: string; euiPopoverTranslateDistance: string; euiProgressSizes: { xs: string; s: string; m: string; l: string; }; euiProgressColors: { primary: string; secondary: string; success: string; warning: string; danger: string; accent: string; subdued: string; vis0: string; vis1: string; vis2: string; vis3: string; vis4: string; vis5: string; vis6: string; vis7: string; vis8: string; vis9: string; customColor: string; }; euiResizableButtonTransitionSpeed: string; euiResizableButtonSize: string; euiSelectableListItemBorder: string; euiSelectableListItemPadding: string; euiSelectableTemplateSitewideTypes: { application: { color: string; 'font-weight': number; }; deployment: { color: string; 'font-weight': number; }; article: { color: string; 'font-weight': number; }; case: { color: string; 'font-weight': number; }; platform: { color: string; 'font-weight': number; }; }; euiSideNavEmphasizedBackgroundColor: string; euiSideNavRootTextcolor: string; euiSideNavBranchTextcolor: string; euiSideNavSelectedTextcolor: string; spacerSizes: { xs: string; s: string; m: string; l: string; xl: string; xxl: string; }; euiStepNumberSize: string; euiStepNumberSmallSize: string; euiStepNumberMargin: string; euiStepStatusColorsToFade: { warning: string; danger: string; disabled: string; incomplete: string; }; euiSuggestItemColors: { tint0: string; tint1: string; tint2: string; tint3: string; tint4: string; tint5: string; tint6: string; tint7: string; tint8: string; tint9: string; tint10: string; }; euiTableCellContentPadding: string; euiTableCellContentPaddingCompressed: string; euiTableCellCheckboxWidth: string; euiTableActionsAreaWidth: string; euiTableHoverColor: string; euiTableSelectedColor: string; euiTableHoverSelectedColor: string; euiTableActionsBorderColor: string; euiTableHoverClickableColor: string; euiTableFocusClickableColor: string; euiTabFontSize: string; euiTabFontSizeS: string; euiTabFontSizeL: string; euiTextColors: { default: string; subdued: string; secondary: string; accent: string; warning: string; danger: string; ghost: string; }; euiTextConstrainedMaxWidth: string; euiToastWidth: string; euiToastTypes: { primary: string; success: string; warning: string; danger: string; }; euiTokenGrayColor: string; euiTokenTypes: { euiColorVis0: { graphic: string; behindText: string; }; euiColorVis1: { graphic: string; behindText: string; }; euiColorVis2: { graphic: string; behindText: string; }; euiColorVis3: { graphic: string; behindText: string; }; euiColorVis4: { graphic: string; behindText: string; }; euiColorVis5: { graphic: string; behindText: string; }; euiColorVis6: { graphic: string; behindText: string; }; euiColorVis7: { graphic: string; behindText: string; }; euiColorVis8: { graphic: string; behindText: string; }; euiColorVis9: { graphic: string; behindText: string; }; gray: { graphic: string; behindText: string; }; }; euiTokenTypeKeys: string; euiAnimSlightBounce: string; euiAnimSlightResistance: string; euiAnimSpeedExtraFast: string; euiAnimSpeedFast: string; euiAnimSpeedNormal: string; euiAnimSpeedSlow: string; euiAnimSpeedExtraSlow: string; euiBorderWidthThin: string; euiBorderWidthThick: string; euiBorderColor: string; euiBorderRadius: string; euiBorderRadiusSmall: string; euiBorderThick: string; euiBorderThin: string; euiBorderEditable: string; euiButtonHeight: string; euiButtonHeightSmall: string; euiButtonHeightXSmall: string; euiButtonColorDisabled: string; euiButtonColorDisabledText: string; euiButtonColorGhostDisabled: string; euiButtonTypes: { primary: string; secondary: string; warning: string; danger: string; ghost: string; text: string; }; euiColorGhost: string; euiColorInk: string; euiColorPrimary: string; euiColorSecondary: string; euiColorAccent: string; euiColorSuccess: string; euiColorWarning: string; euiColorDanger: string; euiColorEmptyShade: string; euiColorLightestShade: string; euiColorLightShade: string; euiColorMediumShade: string; euiColorDarkShade: string; euiColorDarkestShade: string; euiColorFullShade: string; euiPageBackgroundColor: string; euiColorHighlight: string; euiTextColor: string; euiTitleColor: string; euiTextSubduedColor: string; euiColorDisabled: string; euiColorPrimaryText: string; euiColorSecondaryText: string; euiColorAccentText: string; euiColorWarningText: string; euiColorDangerText: string; euiColorDisabledText: string; euiColorSuccessText: string; euiLinkColor: string; euiPaletteColorBlind: { euiColorVis0: { graphic: string; behindText: string; }; euiColorVis1: { graphic: string; behindText: string; }; euiColorVis2: { graphic: string; behindText: string; }; euiColorVis3: { graphic: string; behindText: string; }; euiColorVis4: { graphic: string; behindText: string; }; euiColorVis5: { graphic: string; behindText: string; }; euiColorVis6: { graphic: string; behindText: string; }; euiColorVis7: { graphic: string; behindText: string; }; euiColorVis8: { graphic: string; behindText: string; }; euiColorVis9: { graphic: string; behindText: string; }; }; euiPaletteColorBlindKeys: string; euiColorVis0: string; euiColorVis1: string; euiColorVis2: string; euiColorVis3: string; euiColorVis4: string; euiColorVis5: string; euiColorVis6: string; euiColorVis7: string; euiColorVis8: string; euiColorVis9: string; euiColorVis0_behindText: string; euiColorVis1_behindText: string; euiColorVis2_behindText: string; euiColorVis3_behindText: string; euiColorVis4_behindText: string; euiColorVis5_behindText: string; euiColorVis6_behindText: string; euiColorVis7_behindText: string; euiColorVis8_behindText: string; euiColorVis9_behindText: string; euiColorChartLines: string; euiColorChartBand: string; euiCodeBlockBackgroundColor: string; euiCodeBlockColor: string; euiCodeBlockSelectedBackgroundColor: string; euiCodeBlockCommentColor: string; euiCodeBlockSelectorTagColor: string; euiCodeBlockStringColor: string; euiCodeBlockTagColor: string; euiCodeBlockNameColor: string; euiCodeBlockNumberColor: string; euiCodeBlockKeywordColor: string; euiCodeBlockFunctionTitleColor: string; euiCodeBlockTypeColor: string; euiCodeBlockAttributeColor: string; euiCodeBlockSymbolColor: string; euiCodeBlockParamsColor: string; euiCodeBlockMetaColor: string; euiCodeBlockTitleColor: string; euiCodeBlockSectionColor: string; euiCodeBlockAdditionColor: string; euiCodeBlockDeletionColor: string; euiCodeBlockSelectorClassColor: string; euiCodeBlockSelectorIdColor: string; euiFormMaxWidth: string; euiFormControlHeight: string; euiFormControlCompressedHeight: string; euiFormControlPadding: string; euiFormControlCompressedPadding: string; euiFormControlBorderRadius: number; euiFormControlCompressedBorderRadius: string; euiRadioSize: string; euiCheckBoxSize: string; euiCheckboxBorderRadius: string; euiSwitchHeight: string; euiSwitchWidth: string; euiSwitchThumbSize: string; euiSwitchIconHeight: string; euiSwitchHeightCompressed: string; euiSwitchWidthCompressed: string; euiSwitchThumbSizeCompressed: string; euiSwitchHeightMini: string; euiSwitchWidthMini: string; euiSwitchThumbSizeMini: string; euiFormBackgroundColor: string; euiFormBackgroundDisabledColor: string; euiFormBackgroundReadOnlyColor: string; euiFormBorderOpaqueColor: string; euiFormBorderColor: string; euiFormBorderDisabledColor: string; euiFormCustomControlDisabledIconColor: string; euiFormCustomControlBorderColor: string; euiFormControlDisabledColor: string; euiFormControlBoxShadow: string; euiFormInputGroupLabelBackground: string; euiFormInputGroupBorder: string; euiSwitchOffColor: string; euiFormControlLayoutGroupInputHeight: string; euiFormControlLayoutGroupInputCompressedHeight: string; euiFormControlLayoutGroupInputCompressedBorderRadius: string; euiRangeTrackColor: string; euiRangeThumbRadius: string; euiRangeThumbHeight: string; euiRangeThumbWidth: string; euiRangeThumbBorderColor: string; euiRangeTrackWidth: string; euiRangeTrackHeight: string; euiRangeTrackBorderWidth: number; euiRangeTrackBorderColor: string; euiRangeTrackRadius: string; euiRangeDisabledOpacity: number; euiRangeHighlightHeight: string; euiHeaderBackgroundColor: string; euiHeaderDarkBackgroundColor: string; euiHeaderBorderColor: string; euiHeaderBreadcrumbColor: string; euiHeaderHeight: string; euiHeaderChildSize: string; euiHeaderHeightCompensation: string; euiPageDefaultMaxWidth: string; euiPageSidebarMinWidth: string; euiPanelPaddingModifiers: { paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiPanelBorderRadiusModifiers: { borderRadiusNone: number; borderRadiusMedium: string; }; euiPanelBackgroundColorModifiers: { transparent: string; plain: string; subdued: string; accent: string; primary: string; success: string; warning: string; danger: string; }; euiBreakpoints: { xs: number; s: string; m: string; l: string; xl: string; }; euiBreakpointKeys: string; euiShadowColor: string; euiShadowColorLarge: string; euiSize: string; euiSizeXS: string; euiSizeS: string; euiSizeM: string; euiSizeL: string; euiSizeXL: string; euiSizeXXL: string; euiButtonMinWidth: string; euiScrollBar: string; euiScrollBarCorner: string; euiFocusRingColor: string; euiFocusRingAnimStartColor: string; euiFocusRingAnimStartSize: string; euiFocusRingAnimStartSizeLarge: string; euiFocusRingSizeLarge: string; euiFocusRingSize: string; euiFocusTransparency: number; euiFocusBackgroundColor: string; euiTooltipBackgroundColor: string; euiTooltipAnimations: { top: string; left: string; bottom: string; right: string; }; euiFontFamily: string; euiCodeFontFamily: string; euiFontFeatureSettings: string; euiTextScale: string; euiFontSize: string; euiFontSizeXS: string; euiFontSizeS: string; euiFontSizeM: string; euiFontSizeL: string; euiFontSizeXL: string; euiFontSizeXXL: string; euiLineHeight: number; euiBodyLineHeight: number; euiFontWeightLight: number; euiFontWeightRegular: number; euiFontWeightMedium: number; euiFontWeightSemiBold: number; euiFontWeightBold: number; euiCodeFontWeightRegular: number; euiCodeFontWeightBold: number; euiTitles: { xxxs: { 'font-size': string; 'line-height': string; 'font-weight': number; }; xxs: { 'font-size': string; 'line-height': string; 'font-weight': number; }; xs: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; s: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; m: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; l: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; }; euiZLevel0: number; euiZLevel1: number; euiZLevel2: number; euiZLevel3: number; euiZLevel4: number; euiZLevel5: number; euiZLevel6: number; euiZLevel7: number; euiZLevel8: number; euiZLevel9: number; euiZContent: number; euiZHeader: number; euiZContentMenu: number; euiZFlyout: number; euiZNavigation: number; euiZMask: number; euiZModal: number; euiZToastList: number; } | { paddingSizes: { xs: string; s: string; m: string; l: string; xl: string; }; avatarSizing: { s: { size: string; 'font-size': string; }; m: { size: string; 'font-size': string; }; l: { size: string; 'font-size': string; }; xl: { size: string; 'font-size': string; }; }; euiBadgeGroupGutterTypes: { gutterExtraSmall: string; gutterSmall: string; }; euiBreadcrumbSpacing: string; euiBreadcrumbTruncateWidth: string; euiButtonEmptyTypes: { primary: string; danger: string; disabled: string; ghost: string; text: string; success: string; warning: string; }; euiButtonIconTypes: { accent: string; danger: string; ghost: string; primary: string; subdued: string; success: string; text: string; warning: string; }; euiCallOutTypes: { primary: string; success: string; warning: string; danger: string; }; euiCardSpacing: string; euiCardBottomNodeHeight: string; euiCardSelectButtonBorders: { text: string; primary: string; success: string; danger: string; ghost: string; }; euiCardSelectButtonBackgrounds: { text: string; primary: string; success: string; danger: string; ghost: string; }; euiCardPaddingModifiers: { paddingNone: number; paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiCheckableCardPadding: string; euiCollapsibleNavWidth: string; euiCollapsibleNavGroupLightBackgroundColor: string; euiCollapsibleNavGroupDarkBackgroundColor: string; euiCollapsibleNavGroupDarkHighContrastColor: string; euiColorPickerValueRange0: string; euiColorPickerValueRange1: string; euiColorPickerSaturationRange0: string; euiColorPickerSaturationRange1: string; euiColorPickerIndicatorSize: string; euiColorPickerWidth: string; euiColorPaletteDisplaySizes: { sizeExtraSmall: string; sizeSmall: string; sizeMedium: string; }; euiContextMenuWidth: string; euiControlBarBackground: string; euiControlBarText: string; euiControlBarBorderColor: string; euiControlBarInitialHeight: string; euiControlBarMaxHeight: string; euiControlBarHeights: { s: string; m: string; l: string; }; euiDataGridPrefix: string; euiDataGridStyles: string; euiDataGridColumnResizerWidth: string; euiDataGridPopoverMaxHeight: string; euiDataGridCellPaddingS: string; euiDataGridCellPaddingM: string; euiDataGridCellPaddingL: string; euiDataGridVerticalBorder: string; euiDatePickerCalendarWidth: string; euiSuperDatePickerWidth: string; euiSuperDatePickerButtonWidth: string; euiDragAndDropSpacing: { s: string; m: string; l: string; }; euiExpressionColors: { subdued: string; primary: string; secondary: string; warning: string; danger: string; accent: string; }; euiFacetGutterSizes: { gutterNone: number; gutterSmall: string; gutterMedium: string; gutterLarge: string; }; gutterTypes: { gutterExtraSmall: string; gutterSmall: string; gutterMedium: string; gutterLarge: string; gutterExtraLarge: string; }; fractions: { fourths: { percentage: string; count: number; }; thirds: { percentage: string; count: number; }; halves: { percentage: string; count: number; }; single: { percentage: string; count: number; }; }; flyoutSizes: { small: { min: string; width: string; max: string; }; medium: { min: string; width: string; max: string; }; large: { min: string; width: string; max: string; }; }; euiFlyoutBorder: string; euiFlyoutPaddingModifiers: { paddingNone: number; paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiFilePickerTallHeight: string; euiRangeLevelColors: { primary: string; success: string; warning: string; danger: string; }; textareaResizing: { vertical: string; horizontal: string; both: string; none: string; }; euiHeaderLinksGutterSizes: { gutterXS: string; gutterS: string; gutterM: string; gutterL: string; }; ruleMargins: { marginXSmall: string; marginSmall: string; marginMedium: string; marginLarge: string; marginXLarge: string; marginXXLarge: string; }; euiIconLoadingOpacity: number; euiIconColors: { accent: string; danger: string; ghost: string; primary: string; secondary: string; success: string; subdued: string; text: string; warning: string; }; euiIconSizes: { small: string; medium: string; large: string; xLarge: string; xxLarge: string; }; euiKeyPadMenuSize: string; euiKeyPadMenuItemBetaBadgeSize: string; euiLinkColors: { subdued: string; primary: string; secondary: string; accent: string; warning: string; danger: string; text: string; ghost: string; }; euiListGroupItemHoverBackground: string; euiListGroupItemHoverBackgroundGhost: string; euiListGroupGutterTypes: { gutterSmall: string; gutterMedium: string; }; euiListGroupItemColorTypes: { primary: string; text: string; subdued: string; ghost: string; }; euiListGroupItemSizeTypes: { xSmall: string; small: string; medium: string; large: string; }; euiGradientStartStop: string; euiGradientMiddle: string; browserDefaultFontSize: string; euiMarkdownEditorMinHeight: string; euiPopoverArrowSize: string; euiPopoverTranslateDistance: string; euiProgressSizes: { xs: string; s: string; m: string; l: string; }; euiProgressColors: { primary: string; secondary: string; success: string; warning: string; danger: string; accent: string; subdued: string; vis0: string; vis1: string; vis2: string; vis3: string; vis4: string; vis5: string; vis6: string; vis7: string; vis8: string; vis9: string; customColor: string; }; euiResizableButtonTransitionSpeed: string; euiResizableButtonSize: string; euiSelectableListItemBorder: string; euiSelectableListItemPadding: string; euiSelectableTemplateSitewideTypes: { application: { color: string; 'font-weight': number; }; deployment: { color: string; 'font-weight': number; }; article: { color: string; 'font-weight': number; }; case: { color: string; 'font-weight': number; }; platform: { color: string; 'font-weight': number; }; }; euiSideNavEmphasizedBackgroundColor: string; euiSideNavRootTextcolor: string; euiSideNavBranchTextcolor: string; euiSideNavSelectedTextcolor: string; spacerSizes: { xs: string; s: string; m: string; l: string; xl: string; xxl: string; }; euiStepNumberSize: string; euiStepNumberSmallSize: string; euiStepNumberMargin: string; euiStepStatusColorsToFade: { warning: string; danger: string; disabled: string; incomplete: string; }; euiSuggestItemColors: { tint0: string; tint1: string; tint2: string; tint3: string; tint4: string; tint5: string; tint6: string; tint7: string; tint8: string; tint9: string; tint10: string; }; euiTableCellContentPadding: string; euiTableCellContentPaddingCompressed: string; euiTableCellCheckboxWidth: string; euiTableActionsAreaWidth: string; euiTableHoverColor: string; euiTableSelectedColor: string; euiTableHoverSelectedColor: string; euiTableActionsBorderColor: string; euiTableHoverClickableColor: string; euiTableFocusClickableColor: string; euiTabFontSize: string; euiTabFontSizeS: string; euiTabFontSizeL: string; euiTextColors: { default: string; subdued: string; secondary: string; accent: string; warning: string; danger: string; ghost: string; }; euiTextConstrainedMaxWidth: string; euiToastWidth: string; euiToastTypes: { primary: string; success: string; warning: string; danger: string; }; euiTokenGrayColor: string; euiTokenTypes: { euiColorVis0: { graphic: string; behindText: string; }; euiColorVis1: { graphic: string; behindText: string; }; euiColorVis2: { graphic: string; behindText: string; }; euiColorVis3: { graphic: string; behindText: string; }; euiColorVis4: { graphic: string; behindText: string; }; euiColorVis5: { graphic: string; behindText: string; }; euiColorVis6: { graphic: string; behindText: string; }; euiColorVis7: { graphic: string; behindText: string; }; euiColorVis8: { graphic: string; behindText: string; }; euiColorVis9: { graphic: string; behindText: string; }; gray: { graphic: string; behindText: string; }; }; euiTokenTypeKeys: string; euiAnimSlightBounce: string; euiAnimSlightResistance: string; euiAnimSpeedExtraFast: string; euiAnimSpeedFast: string; euiAnimSpeedNormal: string; euiAnimSpeedSlow: string; euiAnimSpeedExtraSlow: string; euiBorderWidthThin: string; euiBorderWidthThick: string; euiBorderColor: string; euiBorderRadius: string; euiBorderRadiusSmall: string; euiBorderThick: string; euiBorderThin: string; euiBorderEditable: string; euiButtonHeight: string; euiButtonHeightSmall: string; euiButtonHeightXSmall: string; euiButtonColorDisabled: string; euiButtonColorDisabledText: string; euiButtonColorGhostDisabled: string; euiButtonTypes: { primary: string; secondary: string; warning: string; danger: string; ghost: string; text: string; }; euiColorGhost: string; euiColorInk: string; euiColorPrimary: string; euiColorSecondary: string; euiColorAccent: string; euiColorSuccess: string; euiColorWarning: string; euiColorDanger: string; euiColorEmptyShade: string; euiColorLightestShade: string; euiColorLightShade: string; euiColorMediumShade: string; euiColorDarkShade: string; euiColorDarkestShade: string; euiColorFullShade: string; euiPageBackgroundColor: string; euiColorHighlight: string; euiTextColor: string; euiTitleColor: string; euiTextSubduedColor: string; euiColorDisabled: string; euiColorPrimaryText: string; euiColorSecondaryText: string; euiColorAccentText: string; euiColorWarningText: string; euiColorDangerText: string; euiColorDisabledText: string; euiColorSuccessText: string; euiLinkColor: string; euiPaletteColorBlind: { euiColorVis0: { graphic: string; behindText: string; }; euiColorVis1: { graphic: string; behindText: string; }; euiColorVis2: { graphic: string; behindText: string; }; euiColorVis3: { graphic: string; behindText: string; }; euiColorVis4: { graphic: string; behindText: string; }; euiColorVis5: { graphic: string; behindText: string; }; euiColorVis6: { graphic: string; behindText: string; }; euiColorVis7: { graphic: string; behindText: string; }; euiColorVis8: { graphic: string; behindText: string; }; euiColorVis9: { graphic: string; behindText: string; }; }; euiPaletteColorBlindKeys: string; euiColorVis0: string; euiColorVis1: string; euiColorVis2: string; euiColorVis3: string; euiColorVis4: string; euiColorVis5: string; euiColorVis6: string; euiColorVis7: string; euiColorVis8: string; euiColorVis9: string; euiColorVis0_behindText: string; euiColorVis1_behindText: string; euiColorVis2_behindText: string; euiColorVis3_behindText: string; euiColorVis4_behindText: string; euiColorVis5_behindText: string; euiColorVis6_behindText: string; euiColorVis7_behindText: string; euiColorVis8_behindText: string; euiColorVis9_behindText: string; euiColorChartLines: string; euiColorChartBand: string; euiCodeBlockBackgroundColor: string; euiCodeBlockColor: string; euiCodeBlockSelectedBackgroundColor: string; euiCodeBlockCommentColor: string; euiCodeBlockSelectorTagColor: string; euiCodeBlockStringColor: string; euiCodeBlockTagColor: string; euiCodeBlockNameColor: string; euiCodeBlockNumberColor: string; euiCodeBlockKeywordColor: string; euiCodeBlockFunctionTitleColor: string; euiCodeBlockTypeColor: string; euiCodeBlockAttributeColor: string; euiCodeBlockSymbolColor: string; euiCodeBlockParamsColor: string; euiCodeBlockMetaColor: string; euiCodeBlockTitleColor: string; euiCodeBlockSectionColor: string; euiCodeBlockAdditionColor: string; euiCodeBlockDeletionColor: string; euiCodeBlockSelectorClassColor: string; euiCodeBlockSelectorIdColor: string; euiFormMaxWidth: string; euiFormControlHeight: string; euiFormControlCompressedHeight: string; euiFormControlPadding: string; euiFormControlCompressedPadding: string; euiFormControlBorderRadius: number; euiFormControlCompressedBorderRadius: string; euiRadioSize: string; euiCheckBoxSize: string; euiCheckboxBorderRadius: string; euiSwitchHeight: string; euiSwitchWidth: string; euiSwitchThumbSize: string; euiSwitchIconHeight: string; euiSwitchHeightCompressed: string; euiSwitchWidthCompressed: string; euiSwitchThumbSizeCompressed: string; euiSwitchHeightMini: string; euiSwitchWidthMini: string; euiSwitchThumbSizeMini: string; euiFormBackgroundColor: string; euiFormBackgroundDisabledColor: string; euiFormBackgroundReadOnlyColor: string; euiFormBorderOpaqueColor: string; euiFormBorderColor: string; euiFormBorderDisabledColor: string; euiFormCustomControlDisabledIconColor: string; euiFormCustomControlBorderColor: string; euiFormControlDisabledColor: string; euiFormControlBoxShadow: string; euiFormInputGroupLabelBackground: string; euiFormInputGroupBorder: string; euiSwitchOffColor: string; euiFormControlLayoutGroupInputHeight: string; euiFormControlLayoutGroupInputCompressedHeight: string; euiFormControlLayoutGroupInputCompressedBorderRadius: string; euiRangeTrackColor: string; euiRangeThumbRadius: string; euiRangeThumbHeight: string; euiRangeThumbWidth: string; euiRangeThumbBorderColor: string; euiRangeTrackWidth: string; euiRangeTrackHeight: string; euiRangeTrackBorderWidth: number; euiRangeTrackBorderColor: string; euiRangeTrackRadius: string; euiRangeDisabledOpacity: number; euiRangeHighlightHeight: string; euiHeaderBackgroundColor: string; euiHeaderDarkBackgroundColor: string; euiHeaderBorderColor: string; euiHeaderBreadcrumbColor: string; euiHeaderHeight: string; euiHeaderChildSize: string; euiHeaderHeightCompensation: string; euiPageDefaultMaxWidth: string; euiPageSidebarMinWidth: string; euiPanelPaddingModifiers: { paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiPanelBorderRadiusModifiers: { borderRadiusNone: number; borderRadiusMedium: string; }; euiPanelBackgroundColorModifiers: { transparent: string; plain: string; subdued: string; accent: string; primary: string; success: string; warning: string; danger: string; }; euiBreakpoints: { xs: number; s: string; m: string; l: string; xl: string; }; euiBreakpointKeys: string; euiShadowColor: string; euiShadowColorLarge: string; euiSize: string; euiSizeXS: string; euiSizeS: string; euiSizeM: string; euiSizeL: string; euiSizeXL: string; euiSizeXXL: string; euiButtonMinWidth: string; euiScrollBar: string; euiScrollBarCorner: string; euiFocusRingColor: string; euiFocusRingAnimStartColor: string; euiFocusRingAnimStartSize: string; euiFocusRingAnimStartSizeLarge: string; euiFocusRingSizeLarge: string; euiFocusRingSize: string; euiFocusTransparency: number; euiFocusBackgroundColor: string; euiTooltipBackgroundColor: string; euiTooltipAnimations: { top: string; left: string; bottom: string; right: string; }; euiFontFamily: string; euiCodeFontFamily: string; euiFontFeatureSettings: string; euiTextScale: string; euiFontSize: string; euiFontSizeXS: string; euiFontSizeS: string; euiFontSizeM: string; euiFontSizeL: string; euiFontSizeXL: string; euiFontSizeXXL: string; euiLineHeight: number; euiBodyLineHeight: number; euiFontWeightLight: number; euiFontWeightRegular: number; euiFontWeightMedium: number; euiFontWeightSemiBold: number; euiFontWeightBold: number; euiCodeFontWeightRegular: number; euiCodeFontWeightBold: number; euiTitles: { xxxs: { 'font-size': string; 'line-height': string; 'font-weight': number; }; xxs: { 'font-size': string; 'line-height': string; 'font-weight': number; }; xs: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; s: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; m: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; l: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; }; euiZLevel0: number; euiZLevel1: number; euiZLevel2: number; euiZLevel3: number; euiZLevel4: number; euiZLevel5: number; euiZLevel6: number; euiZLevel7: number; euiZLevel8: number; euiZLevel9: number; euiZContent: number; euiZHeader: number; euiZContentMenu: number; euiZFlyout: number; euiZNavigation: number; euiZMask: number; euiZModal: number; euiZToastList: number; }" + "{ paddingSizes: { xs: string; s: string; m: string; l: string; xl: string; }; avatarSizing: { s: { size: string; 'font-size': string; }; m: { size: string; 'font-size': string; }; l: { size: string; 'font-size': string; }; xl: { size: string; 'font-size': string; }; }; euiBadgeGroupGutterTypes: { gutterExtraSmall: string; gutterSmall: string; }; euiBreadcrumbSpacing: string; euiBreadcrumbTruncateWidth: string; euiButtonEmptyTypes: { primary: string; danger: string; disabled: string; ghost: string; text: string; success: string; warning: string; }; euiButtonIconTypes: { accent: string; danger: string; ghost: string; primary: string; subdued: string; success: string; text: string; warning: string; }; euiCallOutTypes: { primary: string; success: string; warning: string; danger: string; }; euiCardSpacing: string; euiCardBottomNodeHeight: string; euiCardSelectButtonBorders: { text: string; primary: string; success: string; danger: string; ghost: string; }; euiCardSelectButtonBackgrounds: { text: string; primary: string; success: string; danger: string; ghost: string; }; euiCardPaddingModifiers: { paddingNone: number; paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiCheckableCardPadding: string; euiCollapsibleNavWidth: string; euiCollapsibleNavGroupLightBackgroundColor: string; euiCollapsibleNavGroupDarkBackgroundColor: string; euiCollapsibleNavGroupDarkHighContrastColor: string; euiColorPickerValueRange0: string; euiColorPickerValueRange1: string; euiColorPickerSaturationRange0: string; euiColorPickerSaturationRange1: string; euiColorPickerIndicatorSize: string; euiColorPickerWidth: string; euiColorPaletteDisplaySizes: { sizeExtraSmall: string; sizeSmall: string; sizeMedium: string; }; euiContextMenuWidth: string; euiControlBarBackground: string; euiControlBarText: string; euiControlBarBorderColor: string; euiControlBarInitialHeight: string; euiControlBarMaxHeight: string; euiControlBarHeights: { s: string; m: string; l: string; }; euiDataGridPrefix: string; euiDataGridStyles: string; euiDataGridColumnResizerWidth: string; euiDataGridPopoverMaxHeight: string; euiDataGridCellPaddingS: string; euiDataGridCellPaddingM: string; euiDataGridCellPaddingL: string; euiDataGridVerticalBorder: string; euiDatePickerCalendarWidth: string; euiSuperDatePickerWidth: string; euiSuperDatePickerButtonWidth: string; euiDragAndDropSpacing: { s: string; m: string; l: string; }; euiExpressionColors: { subdued: string; primary: string; secondary: string; warning: string; danger: string; accent: string; }; euiFacetGutterSizes: { gutterNone: number; gutterSmall: string; gutterMedium: string; gutterLarge: string; }; gutterTypes: { gutterExtraSmall: string; gutterSmall: string; gutterMedium: string; gutterLarge: string; gutterExtraLarge: string; }; fractions: { fourths: { percentage: string; count: number; }; thirds: { percentage: string; count: number; }; halves: { percentage: string; count: number; }; single: { percentage: string; count: number; }; }; flyoutSizes: { small: { min: string; width: string; max: string; }; medium: { min: string; width: string; max: string; }; large: { min: string; width: string; max: string; }; }; euiFlyoutBorder: string; euiFlyoutPaddingModifiers: { paddingNone: number; paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiFilePickerTallHeight: string; euiRangeLevelColors: { primary: string; success: string; warning: string; danger: string; }; textareaResizing: { vertical: string; horizontal: string; both: string; none: string; }; euiHeaderLinksGutterSizes: { gutterXS: string; gutterS: string; gutterM: string; gutterL: string; }; ruleMargins: { marginXSmall: string; marginSmall: string; marginMedium: string; marginLarge: string; marginXLarge: string; marginXXLarge: string; }; euiIconLoadingOpacity: number; euiIconColors: { accent: string; danger: string; ghost: string; primary: string; secondary: string; success: string; subdued: string; text: string; warning: string; inherit: string; }; euiIconSizes: { small: string; medium: string; large: string; xLarge: string; xxLarge: string; }; euiKeyPadMenuSize: string; euiKeyPadMenuItemBetaBadgeSize: string; euiLinkColors: { subdued: string; primary: string; secondary: string; accent: string; warning: string; danger: string; text: string; ghost: string; }; euiListGroupItemHoverBackground: string; euiListGroupItemHoverBackgroundGhost: string; euiListGroupGutterTypes: { gutterSmall: string; gutterMedium: string; }; euiListGroupItemColorTypes: { primary: string; text: string; subdued: string; ghost: string; }; euiListGroupItemSizeTypes: { xSmall: string; small: string; medium: string; large: string; }; euiGradientStartStop: string; euiGradientMiddle: string; browserDefaultFontSize: string; euiMarkdownEditorMinHeight: string; euiPopoverArrowSize: string; euiPopoverTranslateDistance: string; euiProgressSizes: { xs: string; s: string; m: string; l: string; }; euiProgressColors: { primary: string; secondary: string; success: string; warning: string; danger: string; accent: string; subdued: string; vis0: string; vis1: string; vis2: string; vis3: string; vis4: string; vis5: string; vis6: string; vis7: string; vis8: string; vis9: string; customColor: string; }; euiResizableButtonTransitionSpeed: string; euiResizableButtonSize: string; euiSelectableListItemBorder: string; euiSelectableListItemPadding: string; euiSelectableTemplateSitewideTypes: { application: { color: string; 'font-weight': number; }; deployment: { color: string; 'font-weight': number; }; article: { color: string; 'font-weight': number; }; case: { color: string; 'font-weight': number; }; platform: { color: string; 'font-weight': number; }; }; euiSideNavEmphasizedBackgroundColor: string; euiSideNavRootTextcolor: string; euiSideNavBranchTextcolor: string; euiSideNavSelectedTextcolor: string; spacerSizes: { xs: string; s: string; m: string; l: string; xl: string; xxl: string; }; euiStepNumberSize: string; euiStepNumberSmallSize: string; euiStepNumberMargin: string; euiStepStatusColorsToFade: { warning: string; danger: string; disabled: string; incomplete: string; }; euiSuggestItemColors: { tint0: string; tint1: string; tint2: string; tint3: string; tint4: string; tint5: string; tint6: string; tint7: string; tint8: string; tint9: string; tint10: string; }; euiTableCellContentPadding: string; euiTableCellContentPaddingCompressed: string; euiTableCellCheckboxWidth: string; euiTableActionsAreaWidth: string; euiTableHoverColor: string; euiTableSelectedColor: string; euiTableHoverSelectedColor: string; euiTableActionsBorderColor: string; euiTableHoverClickableColor: string; euiTableFocusClickableColor: string; euiTabFontSize: string; euiTabFontSizeS: string; euiTabFontSizeL: string; euiTextColors: { default: string; subdued: string; secondary: string; accent: string; warning: string; danger: string; ghost: string; }; euiTextConstrainedMaxWidth: string; euiToastWidth: string; euiToastTypes: { primary: string; success: string; warning: string; danger: string; }; euiTokenGrayColor: string; euiTokenTypes: { euiColorVis0: { graphic: string; behindText: string; }; euiColorVis1: { graphic: string; behindText: string; }; euiColorVis2: { graphic: string; behindText: string; }; euiColorVis3: { graphic: string; behindText: string; }; euiColorVis4: { graphic: string; behindText: string; }; euiColorVis5: { graphic: string; behindText: string; }; euiColorVis6: { graphic: string; behindText: string; }; euiColorVis7: { graphic: string; behindText: string; }; euiColorVis8: { graphic: string; behindText: string; }; euiColorVis9: { graphic: string; behindText: string; }; gray: { graphic: string; behindText: string; }; }; euiTokenTypeKeys: string; euiAnimSlightBounce: string; euiAnimSlightResistance: string; euiAnimSpeedExtraFast: string; euiAnimSpeedFast: string; euiAnimSpeedNormal: string; euiAnimSpeedSlow: string; euiAnimSpeedExtraSlow: string; euiBorderWidthThin: string; euiBorderWidthThick: string; euiBorderColor: string; euiBorderRadius: string; euiBorderRadiusSmall: string; euiBorderThick: string; euiBorderThin: string; euiBorderEditable: string; euiButtonHeight: string; euiButtonHeightSmall: string; euiButtonHeightXSmall: string; euiButtonColorDisabled: string; euiButtonColorDisabledText: string; euiButtonColorGhostDisabled: string; euiButtonTypes: { primary: string; secondary: string; warning: string; danger: string; ghost: string; text: string; }; euiColorGhost: string; euiColorInk: string; euiColorPrimary: string; euiColorSecondary: string; euiColorAccent: string; euiColorSuccess: string; euiColorWarning: string; euiColorDanger: string; euiColorEmptyShade: string; euiColorLightestShade: string; euiColorLightShade: string; euiColorMediumShade: string; euiColorDarkShade: string; euiColorDarkestShade: string; euiColorFullShade: string; euiPageBackgroundColor: string; euiColorHighlight: string; euiTextColor: string; euiTitleColor: string; euiTextSubduedColor: string; euiColorDisabled: string; euiColorPrimaryText: string; euiColorSecondaryText: string; euiColorAccentText: string; euiColorWarningText: string; euiColorDangerText: string; euiColorDisabledText: string; euiColorSuccessText: string; euiLinkColor: string; euiPaletteColorBlind: { euiColorVis0: { graphic: string; behindText: string; }; euiColorVis1: { graphic: string; behindText: string; }; euiColorVis2: { graphic: string; behindText: string; }; euiColorVis3: { graphic: string; behindText: string; }; euiColorVis4: { graphic: string; behindText: string; }; euiColorVis5: { graphic: string; behindText: string; }; euiColorVis6: { graphic: string; behindText: string; }; euiColorVis7: { graphic: string; behindText: string; }; euiColorVis8: { graphic: string; behindText: string; }; euiColorVis9: { graphic: string; behindText: string; }; }; euiPaletteColorBlindKeys: string; euiColorVis0: string; euiColorVis1: string; euiColorVis2: string; euiColorVis3: string; euiColorVis4: string; euiColorVis5: string; euiColorVis6: string; euiColorVis7: string; euiColorVis8: string; euiColorVis9: string; euiColorVis0_behindText: string; euiColorVis1_behindText: string; euiColorVis2_behindText: string; euiColorVis3_behindText: string; euiColorVis4_behindText: string; euiColorVis5_behindText: string; euiColorVis6_behindText: string; euiColorVis7_behindText: string; euiColorVis8_behindText: string; euiColorVis9_behindText: string; euiColorChartLines: string; euiColorChartBand: string; euiCodeBlockBackgroundColor: string; euiCodeBlockColor: string; euiCodeBlockSelectedBackgroundColor: string; euiCodeBlockCommentColor: string; euiCodeBlockSelectorTagColor: string; euiCodeBlockStringColor: string; euiCodeBlockTagColor: string; euiCodeBlockNameColor: string; euiCodeBlockNumberColor: string; euiCodeBlockKeywordColor: string; euiCodeBlockFunctionTitleColor: string; euiCodeBlockTypeColor: string; euiCodeBlockAttributeColor: string; euiCodeBlockSymbolColor: string; euiCodeBlockParamsColor: string; euiCodeBlockMetaColor: string; euiCodeBlockTitleColor: string; euiCodeBlockSectionColor: string; euiCodeBlockAdditionColor: string; euiCodeBlockDeletionColor: string; euiCodeBlockSelectorClassColor: string; euiCodeBlockSelectorIdColor: string; euiFormMaxWidth: string; euiFormControlHeight: string; euiFormControlCompressedHeight: string; euiFormControlPadding: string; euiFormControlCompressedPadding: string; euiFormControlBorderRadius: number; euiFormControlCompressedBorderRadius: string; euiRadioSize: string; euiCheckBoxSize: string; euiCheckboxBorderRadius: string; euiSwitchHeight: string; euiSwitchWidth: string; euiSwitchThumbSize: string; euiSwitchIconHeight: string; euiSwitchHeightCompressed: string; euiSwitchWidthCompressed: string; euiSwitchThumbSizeCompressed: string; euiSwitchHeightMini: string; euiSwitchWidthMini: string; euiSwitchThumbSizeMini: string; euiFormBackgroundColor: string; euiFormBackgroundDisabledColor: string; euiFormBackgroundReadOnlyColor: string; euiFormBorderOpaqueColor: string; euiFormBorderColor: string; euiFormBorderDisabledColor: string; euiFormCustomControlDisabledIconColor: string; euiFormCustomControlBorderColor: string; euiFormControlDisabledColor: string; euiFormControlBoxShadow: string; euiFormControlPlaceholderText: string; euiFormInputGroupLabelBackground: string; euiFormInputGroupBorder: string; euiSwitchOffColor: string; euiFormControlLayoutGroupInputHeight: string; euiFormControlLayoutGroupInputCompressedHeight: string; euiFormControlLayoutGroupInputCompressedBorderRadius: string; euiRangeTrackColor: string; euiRangeThumbRadius: string; euiRangeThumbHeight: string; euiRangeThumbWidth: string; euiRangeThumbBorderColor: string; euiRangeTrackWidth: string; euiRangeTrackHeight: string; euiRangeTrackBorderWidth: number; euiRangeTrackBorderColor: string; euiRangeTrackRadius: string; euiRangeDisabledOpacity: number; euiRangeHighlightHeight: string; euiHeaderBackgroundColor: string; euiHeaderDarkBackgroundColor: string; euiHeaderBorderColor: string; euiHeaderBreadcrumbColor: string; euiHeaderHeight: string; euiHeaderChildSize: string; euiHeaderHeightCompensation: string; euiPageDefaultMaxWidth: string; euiPageSidebarMinWidth: string; euiPanelPaddingModifiers: { paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiPanelBorderRadiusModifiers: { borderRadiusNone: number; borderRadiusMedium: string; }; euiPanelBackgroundColorModifiers: { transparent: string; plain: string; subdued: string; accent: string; primary: string; success: string; warning: string; danger: string; }; euiBreakpoints: { xs: number; s: string; m: string; l: string; xl: string; }; euiBreakpointKeys: string; euiShadowColor: string; euiShadowColorLarge: string; euiSize: string; euiSizeXS: string; euiSizeS: string; euiSizeM: string; euiSizeL: string; euiSizeXL: string; euiSizeXXL: string; euiButtonMinWidth: string; euiScrollBar: string; euiScrollBarCorner: string; euiFocusRingColor: string; euiFocusRingAnimStartColor: string; euiFocusRingAnimStartSize: string; euiFocusRingAnimStartSizeLarge: string; euiFocusRingSizeLarge: string; euiFocusRingSize: string; euiFocusTransparency: number; euiFocusBackgroundColor: string; euiTooltipBackgroundColor: string; euiTooltipAnimations: { top: string; left: string; bottom: string; right: string; }; euiFontFamily: string; euiCodeFontFamily: string; euiFontFeatureSettings: string; euiTextScale: string; euiFontSize: string; euiFontSizeXS: string; euiFontSizeS: string; euiFontSizeM: string; euiFontSizeL: string; euiFontSizeXL: string; euiFontSizeXXL: string; euiLineHeight: number; euiBodyLineHeight: number; euiFontWeightLight: number; euiFontWeightRegular: number; euiFontWeightMedium: number; euiFontWeightSemiBold: number; euiFontWeightBold: number; euiCodeFontWeightRegular: number; euiCodeFontWeightBold: number; euiTitles: { xxxs: { 'font-size': string; 'line-height': string; 'font-weight': number; }; xxs: { 'font-size': string; 'line-height': string; 'font-weight': number; }; xs: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; s: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; m: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; l: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; }; euiZLevel0: number; euiZLevel1: number; euiZLevel2: number; euiZLevel3: number; euiZLevel4: number; euiZLevel5: number; euiZLevel6: number; euiZLevel7: number; euiZLevel8: number; euiZLevel9: number; euiZContent: number; euiZHeader: number; euiZContentMenu: number; euiZFlyout: number; euiZNavigation: number; euiZMask: number; euiZModal: number; euiZToastList: number; } | { paddingSizes: { xs: string; s: string; m: string; l: string; xl: string; }; avatarSizing: { s: { size: string; 'font-size': string; }; m: { size: string; 'font-size': string; }; l: { size: string; 'font-size': string; }; xl: { size: string; 'font-size': string; }; }; euiBadgeGroupGutterTypes: { gutterExtraSmall: string; gutterSmall: string; }; euiBreadcrumbSpacing: string; euiBreadcrumbTruncateWidth: string; euiButtonEmptyTypes: { primary: string; danger: string; disabled: string; ghost: string; text: string; success: string; warning: string; }; euiButtonIconTypes: { accent: string; danger: string; ghost: string; primary: string; subdued: string; success: string; text: string; warning: string; }; euiCallOutTypes: { primary: string; success: string; warning: string; danger: string; }; euiCardSpacing: string; euiCardBottomNodeHeight: string; euiCardSelectButtonBorders: { text: string; primary: string; success: string; danger: string; ghost: string; }; euiCardSelectButtonBackgrounds: { text: string; primary: string; success: string; danger: string; ghost: string; }; euiCardPaddingModifiers: { paddingNone: number; paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiCheckableCardPadding: string; euiCollapsibleNavWidth: string; euiCollapsibleNavGroupLightBackgroundColor: string; euiCollapsibleNavGroupDarkBackgroundColor: string; euiCollapsibleNavGroupDarkHighContrastColor: string; euiColorPickerValueRange0: string; euiColorPickerValueRange1: string; euiColorPickerSaturationRange0: string; euiColorPickerSaturationRange1: string; euiColorPickerIndicatorSize: string; euiColorPickerWidth: string; euiColorPaletteDisplaySizes: { sizeExtraSmall: string; sizeSmall: string; sizeMedium: string; }; euiContextMenuWidth: string; euiControlBarBackground: string; euiControlBarText: string; euiControlBarBorderColor: string; euiControlBarInitialHeight: string; euiControlBarMaxHeight: string; euiControlBarHeights: { s: string; m: string; l: string; }; euiDataGridPrefix: string; euiDataGridStyles: string; euiDataGridColumnResizerWidth: string; euiDataGridPopoverMaxHeight: string; euiDataGridCellPaddingS: string; euiDataGridCellPaddingM: string; euiDataGridCellPaddingL: string; euiDataGridVerticalBorder: string; euiDatePickerCalendarWidth: string; euiSuperDatePickerWidth: string; euiSuperDatePickerButtonWidth: string; euiDragAndDropSpacing: { s: string; m: string; l: string; }; euiExpressionColors: { subdued: string; primary: string; secondary: string; warning: string; danger: string; accent: string; }; euiFacetGutterSizes: { gutterNone: number; gutterSmall: string; gutterMedium: string; gutterLarge: string; }; gutterTypes: { gutterExtraSmall: string; gutterSmall: string; gutterMedium: string; gutterLarge: string; gutterExtraLarge: string; }; fractions: { fourths: { percentage: string; count: number; }; thirds: { percentage: string; count: number; }; halves: { percentage: string; count: number; }; single: { percentage: string; count: number; }; }; flyoutSizes: { small: { min: string; width: string; max: string; }; medium: { min: string; width: string; max: string; }; large: { min: string; width: string; max: string; }; }; euiFlyoutBorder: string; euiFlyoutPaddingModifiers: { paddingNone: number; paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiFilePickerTallHeight: string; euiRangeLevelColors: { primary: string; success: string; warning: string; danger: string; }; textareaResizing: { vertical: string; horizontal: string; both: string; none: string; }; euiHeaderLinksGutterSizes: { gutterXS: string; gutterS: string; gutterM: string; gutterL: string; }; ruleMargins: { marginXSmall: string; marginSmall: string; marginMedium: string; marginLarge: string; marginXLarge: string; marginXXLarge: string; }; euiIconLoadingOpacity: number; euiIconColors: { accent: string; danger: string; ghost: string; primary: string; secondary: string; success: string; subdued: string; text: string; warning: string; inherit: string; }; euiIconSizes: { small: string; medium: string; large: string; xLarge: string; xxLarge: string; }; euiKeyPadMenuSize: string; euiKeyPadMenuItemBetaBadgeSize: string; euiLinkColors: { subdued: string; primary: string; secondary: string; accent: string; warning: string; danger: string; text: string; ghost: string; }; euiListGroupItemHoverBackground: string; euiListGroupItemHoverBackgroundGhost: string; euiListGroupGutterTypes: { gutterSmall: string; gutterMedium: string; }; euiListGroupItemColorTypes: { primary: string; text: string; subdued: string; ghost: string; }; euiListGroupItemSizeTypes: { xSmall: string; small: string; medium: string; large: string; }; euiGradientStartStop: string; euiGradientMiddle: string; browserDefaultFontSize: string; euiMarkdownEditorMinHeight: string; euiPopoverArrowSize: string; euiPopoverTranslateDistance: string; euiProgressSizes: { xs: string; s: string; m: string; l: string; }; euiProgressColors: { primary: string; secondary: string; success: string; warning: string; danger: string; accent: string; subdued: string; vis0: string; vis1: string; vis2: string; vis3: string; vis4: string; vis5: string; vis6: string; vis7: string; vis8: string; vis9: string; customColor: string; }; euiResizableButtonTransitionSpeed: string; euiResizableButtonSize: string; euiSelectableListItemBorder: string; euiSelectableListItemPadding: string; euiSelectableTemplateSitewideTypes: { application: { color: string; 'font-weight': number; }; deployment: { color: string; 'font-weight': number; }; article: { color: string; 'font-weight': number; }; case: { color: string; 'font-weight': number; }; platform: { color: string; 'font-weight': number; }; }; euiSideNavEmphasizedBackgroundColor: string; euiSideNavRootTextcolor: string; euiSideNavBranchTextcolor: string; euiSideNavSelectedTextcolor: string; spacerSizes: { xs: string; s: string; m: string; l: string; xl: string; xxl: string; }; euiStepNumberSize: string; euiStepNumberSmallSize: string; euiStepNumberMargin: string; euiStepStatusColorsToFade: { warning: string; danger: string; disabled: string; incomplete: string; }; euiSuggestItemColors: { tint0: string; tint1: string; tint2: string; tint3: string; tint4: string; tint5: string; tint6: string; tint7: string; tint8: string; tint9: string; tint10: string; }; euiTableCellContentPadding: string; euiTableCellContentPaddingCompressed: string; euiTableCellCheckboxWidth: string; euiTableActionsAreaWidth: string; euiTableHoverColor: string; euiTableSelectedColor: string; euiTableHoverSelectedColor: string; euiTableActionsBorderColor: string; euiTableHoverClickableColor: string; euiTableFocusClickableColor: string; euiTabFontSize: string; euiTabFontSizeS: string; euiTabFontSizeL: string; euiTextColors: { default: string; subdued: string; secondary: string; accent: string; warning: string; danger: string; ghost: string; }; euiTextConstrainedMaxWidth: string; euiToastWidth: string; euiToastTypes: { primary: string; success: string; warning: string; danger: string; }; euiTokenGrayColor: string; euiTokenTypes: { euiColorVis0: { graphic: string; behindText: string; }; euiColorVis1: { graphic: string; behindText: string; }; euiColorVis2: { graphic: string; behindText: string; }; euiColorVis3: { graphic: string; behindText: string; }; euiColorVis4: { graphic: string; behindText: string; }; euiColorVis5: { graphic: string; behindText: string; }; euiColorVis6: { graphic: string; behindText: string; }; euiColorVis7: { graphic: string; behindText: string; }; euiColorVis8: { graphic: string; behindText: string; }; euiColorVis9: { graphic: string; behindText: string; }; gray: { graphic: string; behindText: string; }; }; euiTokenTypeKeys: string; euiAnimSlightBounce: string; euiAnimSlightResistance: string; euiAnimSpeedExtraFast: string; euiAnimSpeedFast: string; euiAnimSpeedNormal: string; euiAnimSpeedSlow: string; euiAnimSpeedExtraSlow: string; euiBorderWidthThin: string; euiBorderWidthThick: string; euiBorderColor: string; euiBorderRadius: string; euiBorderRadiusSmall: string; euiBorderThick: string; euiBorderThin: string; euiBorderEditable: string; euiButtonHeight: string; euiButtonHeightSmall: string; euiButtonHeightXSmall: string; euiButtonColorDisabled: string; euiButtonColorDisabledText: string; euiButtonColorGhostDisabled: string; euiButtonTypes: { primary: string; secondary: string; warning: string; danger: string; ghost: string; text: string; }; euiColorGhost: string; euiColorInk: string; euiColorPrimary: string; euiColorSecondary: string; euiColorAccent: string; euiColorSuccess: string; euiColorWarning: string; euiColorDanger: string; euiColorEmptyShade: string; euiColorLightestShade: string; euiColorLightShade: string; euiColorMediumShade: string; euiColorDarkShade: string; euiColorDarkestShade: string; euiColorFullShade: string; euiPageBackgroundColor: string; euiColorHighlight: string; euiTextColor: string; euiTitleColor: string; euiTextSubduedColor: string; euiColorDisabled: string; euiColorPrimaryText: string; euiColorSecondaryText: string; euiColorAccentText: string; euiColorWarningText: string; euiColorDangerText: string; euiColorDisabledText: string; euiColorSuccessText: string; euiLinkColor: string; euiPaletteColorBlind: { euiColorVis0: { graphic: string; behindText: string; }; euiColorVis1: { graphic: string; behindText: string; }; euiColorVis2: { graphic: string; behindText: string; }; euiColorVis3: { graphic: string; behindText: string; }; euiColorVis4: { graphic: string; behindText: string; }; euiColorVis5: { graphic: string; behindText: string; }; euiColorVis6: { graphic: string; behindText: string; }; euiColorVis7: { graphic: string; behindText: string; }; euiColorVis8: { graphic: string; behindText: string; }; euiColorVis9: { graphic: string; behindText: string; }; }; euiPaletteColorBlindKeys: string; euiColorVis0: string; euiColorVis1: string; euiColorVis2: string; euiColorVis3: string; euiColorVis4: string; euiColorVis5: string; euiColorVis6: string; euiColorVis7: string; euiColorVis8: string; euiColorVis9: string; euiColorVis0_behindText: string; euiColorVis1_behindText: string; euiColorVis2_behindText: string; euiColorVis3_behindText: string; euiColorVis4_behindText: string; euiColorVis5_behindText: string; euiColorVis6_behindText: string; euiColorVis7_behindText: string; euiColorVis8_behindText: string; euiColorVis9_behindText: string; euiColorChartLines: string; euiColorChartBand: string; euiCodeBlockBackgroundColor: string; euiCodeBlockColor: string; euiCodeBlockSelectedBackgroundColor: string; euiCodeBlockCommentColor: string; euiCodeBlockSelectorTagColor: string; euiCodeBlockStringColor: string; euiCodeBlockTagColor: string; euiCodeBlockNameColor: string; euiCodeBlockNumberColor: string; euiCodeBlockKeywordColor: string; euiCodeBlockFunctionTitleColor: string; euiCodeBlockTypeColor: string; euiCodeBlockAttributeColor: string; euiCodeBlockSymbolColor: string; euiCodeBlockParamsColor: string; euiCodeBlockMetaColor: string; euiCodeBlockTitleColor: string; euiCodeBlockSectionColor: string; euiCodeBlockAdditionColor: string; euiCodeBlockDeletionColor: string; euiCodeBlockSelectorClassColor: string; euiCodeBlockSelectorIdColor: string; euiFormMaxWidth: string; euiFormControlHeight: string; euiFormControlCompressedHeight: string; euiFormControlPadding: string; euiFormControlCompressedPadding: string; euiFormControlBorderRadius: number; euiFormControlCompressedBorderRadius: string; euiRadioSize: string; euiCheckBoxSize: string; euiCheckboxBorderRadius: string; euiSwitchHeight: string; euiSwitchWidth: string; euiSwitchThumbSize: string; euiSwitchIconHeight: string; euiSwitchHeightCompressed: string; euiSwitchWidthCompressed: string; euiSwitchThumbSizeCompressed: string; euiSwitchHeightMini: string; euiSwitchWidthMini: string; euiSwitchThumbSizeMini: string; euiFormBackgroundColor: string; euiFormBackgroundDisabledColor: string; euiFormBackgroundReadOnlyColor: string; euiFormBorderOpaqueColor: string; euiFormBorderColor: string; euiFormBorderDisabledColor: string; euiFormCustomControlDisabledIconColor: string; euiFormCustomControlBorderColor: string; euiFormControlDisabledColor: string; euiFormControlBoxShadow: string; euiFormControlPlaceholderText: string; euiFormInputGroupLabelBackground: string; euiFormInputGroupBorder: string; euiSwitchOffColor: string; euiFormControlLayoutGroupInputHeight: string; euiFormControlLayoutGroupInputCompressedHeight: string; euiFormControlLayoutGroupInputCompressedBorderRadius: string; euiRangeTrackColor: string; euiRangeThumbRadius: string; euiRangeThumbHeight: string; euiRangeThumbWidth: string; euiRangeThumbBorderColor: string; euiRangeTrackWidth: string; euiRangeTrackHeight: string; euiRangeTrackBorderWidth: number; euiRangeTrackBorderColor: string; euiRangeTrackRadius: string; euiRangeDisabledOpacity: number; euiRangeHighlightHeight: string; euiHeaderBackgroundColor: string; euiHeaderDarkBackgroundColor: string; euiHeaderBorderColor: string; euiHeaderBreadcrumbColor: string; euiHeaderHeight: string; euiHeaderChildSize: string; euiHeaderHeightCompensation: string; euiPageDefaultMaxWidth: string; euiPageSidebarMinWidth: string; euiPanelPaddingModifiers: { paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiPanelBorderRadiusModifiers: { borderRadiusNone: number; borderRadiusMedium: string; }; euiPanelBackgroundColorModifiers: { transparent: string; plain: string; subdued: string; accent: string; primary: string; success: string; warning: string; danger: string; }; euiBreakpoints: { xs: number; s: string; m: string; l: string; xl: string; }; euiBreakpointKeys: string; euiShadowColor: string; euiShadowColorLarge: string; euiSize: string; euiSizeXS: string; euiSizeS: string; euiSizeM: string; euiSizeL: string; euiSizeXL: string; euiSizeXXL: string; euiButtonMinWidth: string; euiScrollBar: string; euiScrollBarCorner: string; euiFocusRingColor: string; euiFocusRingAnimStartColor: string; euiFocusRingAnimStartSize: string; euiFocusRingAnimStartSizeLarge: string; euiFocusRingSizeLarge: string; euiFocusRingSize: string; euiFocusTransparency: number; euiFocusBackgroundColor: string; euiTooltipBackgroundColor: string; euiTooltipAnimations: { top: string; left: string; bottom: string; right: string; }; euiFontFamily: string; euiCodeFontFamily: string; euiFontFeatureSettings: string; euiTextScale: string; euiFontSize: string; euiFontSizeXS: string; euiFontSizeS: string; euiFontSizeM: string; euiFontSizeL: string; euiFontSizeXL: string; euiFontSizeXXL: string; euiLineHeight: number; euiBodyLineHeight: number; euiFontWeightLight: number; euiFontWeightRegular: number; euiFontWeightMedium: number; euiFontWeightSemiBold: number; euiFontWeightBold: number; euiCodeFontWeightRegular: number; euiCodeFontWeightBold: number; euiTitles: { xxxs: { 'font-size': string; 'line-height': string; 'font-weight': number; }; xxs: { 'font-size': string; 'line-height': string; 'font-weight': number; }; xs: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; s: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; m: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; l: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; }; euiZLevel0: number; euiZLevel1: number; euiZLevel2: number; euiZLevel3: number; euiZLevel4: number; euiZLevel5: number; euiZLevel6: number; euiZLevel7: number; euiZLevel8: number; euiZLevel9: number; euiZContent: number; euiZHeader: number; euiZContentMenu: number; euiZFlyout: number; euiZNavigation: number; euiZMask: number; euiZModal: number; euiZToastList: number; }" ], "source": { "path": "src/plugins/kibana_react/common/eui_styled_components.tsx", diff --git a/api_docs/kibana_react.mdx b/api_docs/kibana_react.mdx index f4a5cf71d6a3d8..da356108593a14 100644 --- a/api_docs/kibana_react.mdx +++ b/api_docs/kibana_react.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import kibanaReactObj from './kibana_react.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 245 | 1 | 216 | 4 | + ## Client ### Objects diff --git a/api_docs/kibana_utils.json b/api_docs/kibana_utils.json index 66eefa9097bfb1..99296f3235f0f7 100644 --- a/api_docs/kibana_utils.json +++ b/api_docs/kibana_utils.json @@ -3805,7 +3805,7 @@ "description": [], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 704 + "lineNumber": 731 }, "deprecated": false }, @@ -3828,7 +3828,7 @@ ], "source": { "path": "src/core/public/application/types.ts", - "lineNumber": 704 + "lineNumber": 731 }, "deprecated": false } diff --git a/api_docs/kibana_utils.mdx b/api_docs/kibana_utils.mdx index 9a9001af4b1f0c..a76992e0bc2b89 100644 --- a/api_docs/kibana_utils.mdx +++ b/api_docs/kibana_utils.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import kibanaUtilsObj from './kibana_utils.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 551 | 5 | 373 | 8 | + ## Client ### Objects diff --git a/api_docs/lens.json b/api_docs/lens.json index 196361f65682b9..782d060f398cb3 100644 --- a/api_docs/lens.json +++ b/api_docs/lens.json @@ -87,7 +87,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/cardinality.tsx", - "lineNumber": 45 + "lineNumber": 52 }, "deprecated": false, "children": [ @@ -103,7 +103,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/cardinality.tsx", - "lineNumber": 48 + "lineNumber": 55 }, "deprecated": false } @@ -119,7 +119,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/public/datatable_visualization/visualization.tsx", - "lineNumber": 42 + "lineNumber": 48 }, "deprecated": false, "children": [ @@ -136,7 +136,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/datatable_visualization/visualization.tsx", - "lineNumber": 43 + "lineNumber": 49 }, "deprecated": false }, @@ -149,7 +149,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/public/datatable_visualization/visualization.tsx", - "lineNumber": 44 + "lineNumber": 50 }, "deprecated": false }, @@ -166,7 +166,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/datatable_visualization/visualization.tsx", - "lineNumber": 45 + "lineNumber": 51 }, "deprecated": false } @@ -199,7 +199,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/date_histogram.tsx", - "lineNumber": 43 + "lineNumber": 44 }, "deprecated": false, "children": [ @@ -215,7 +215,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/date_histogram.tsx", - "lineNumber": 44 + "lineNumber": 45 }, "deprecated": false }, @@ -231,7 +231,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/date_histogram.tsx", - "lineNumber": 45 + "lineNumber": 46 }, "deprecated": false } @@ -308,7 +308,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/column_types.ts", - "lineNumber": 45 + "lineNumber": 46 }, "deprecated": false, "children": [ @@ -324,7 +324,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/column_types.ts", - "lineNumber": 46 + "lineNumber": 47 }, "deprecated": false }, @@ -340,7 +340,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/column_types.ts", - "lineNumber": 47 + "lineNumber": 48 }, "deprecated": false } @@ -407,7 +407,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/last_value.tsx", - "lineNumber": 80 + "lineNumber": 87 }, "deprecated": false, "children": [ @@ -423,7 +423,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/last_value.tsx", - "lineNumber": 81 + "lineNumber": 88 }, "deprecated": false }, @@ -439,7 +439,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/last_value.tsx", - "lineNumber": 82 + "lineNumber": 89 }, "deprecated": false } @@ -522,7 +522,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/public/plugin.ts", - "lineNumber": 83 + "lineNumber": 84 }, "deprecated": false, "children": [ @@ -558,7 +558,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/plugin.ts", - "lineNumber": 92 + "lineNumber": 93 }, "deprecated": false }, @@ -580,7 +580,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/plugin.ts", - "lineNumber": 101 + "lineNumber": 102 }, "deprecated": false, "returnComment": [], @@ -599,7 +599,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/plugin.ts", - "lineNumber": 101 + "lineNumber": 102 }, "deprecated": false }, @@ -615,7 +615,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/plugin.ts", - "lineNumber": 101 + "lineNumber": 102 }, "deprecated": false } @@ -635,7 +635,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/plugin.ts", - "lineNumber": 105 + "lineNumber": 106 }, "deprecated": false, "returnComment": [], @@ -657,7 +657,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/plugin.ts", - "lineNumber": 110 + "lineNumber": 111 }, "deprecated": false, "returnComment": [], @@ -720,7 +720,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/public/types.ts", - "lineNumber": 363 + "lineNumber": 362 }, "deprecated": false, "children": [ @@ -736,7 +736,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/types.ts", - "lineNumber": 365 + "lineNumber": 364 }, "deprecated": false }, @@ -749,7 +749,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/public/types.ts", - "lineNumber": 368 + "lineNumber": 367 }, "deprecated": false }, @@ -767,7 +767,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/types.ts", - "lineNumber": 374 + "lineNumber": 373 }, "deprecated": false } @@ -800,7 +800,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/percentile.tsx", - "lineNumber": 24 + "lineNumber": 25 }, "deprecated": false, "children": [ @@ -816,7 +816,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/percentile.tsx", - "lineNumber": 25 + "lineNumber": 26 }, "deprecated": false }, @@ -832,7 +832,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/percentile.tsx", - "lineNumber": 26 + "lineNumber": 27 }, "deprecated": false } @@ -1039,7 +1039,7 @@ "label": "numberDisplay", "description": [], "signature": [ - "\"hidden\" | \"value\" | \"percent\"" + "\"percent\" | \"hidden\" | \"value\"" ], "source": { "path": "x-pack/plugins/lens/public/pie_visualization/types.ts", @@ -1156,7 +1156,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx", - "lineNumber": 56 + "lineNumber": 161 }, "deprecated": false, "children": [ @@ -1172,7 +1172,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx", - "lineNumber": 57 + "lineNumber": 162 }, "deprecated": false }, @@ -1188,7 +1188,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx", - "lineNumber": 58 + "lineNumber": 163 }, "deprecated": false } @@ -1277,7 +1277,13 @@ "label": "yConfig", "description": [], "signature": [ - "YConfig", + { + "pluginId": "lens", + "scope": "public", + "docId": "kibLensPluginApi", + "section": "def-public.YConfig", + "text": "YConfig" + }, "[] | undefined" ], "source": { @@ -1353,7 +1359,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 474 + "lineNumber": 475 }, "deprecated": false, "children": [ @@ -1369,7 +1375,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 475 + "lineNumber": 476 }, "deprecated": false }, @@ -1391,7 +1397,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 476 + "lineNumber": 477 }, "deprecated": false }, @@ -1407,7 +1413,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 477 + "lineNumber": 478 }, "deprecated": false }, @@ -1423,7 +1429,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 478 + "lineNumber": 479 }, "deprecated": false }, @@ -1440,7 +1446,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 479 + "lineNumber": 480 }, "deprecated": false }, @@ -1457,7 +1463,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 480 + "lineNumber": 481 }, "deprecated": false }, @@ -1480,7 +1486,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 481 + "lineNumber": 482 }, "deprecated": false }, @@ -1496,7 +1502,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 482 + "lineNumber": 483 }, "deprecated": false }, @@ -1512,7 +1518,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 483 + "lineNumber": 484 }, "deprecated": false }, @@ -1528,7 +1534,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 484 + "lineNumber": 485 }, "deprecated": false }, @@ -1551,7 +1557,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 485 + "lineNumber": 486 }, "deprecated": false }, @@ -1574,7 +1580,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 486 + "lineNumber": 487 }, "deprecated": false }, @@ -1597,7 +1603,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 487 + "lineNumber": 488 }, "deprecated": false }, @@ -1613,7 +1619,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 488 + "lineNumber": 489 }, "deprecated": false }, @@ -1629,7 +1635,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 489 + "lineNumber": 490 }, "deprecated": false }, @@ -1645,7 +1651,84 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 490 + "lineNumber": 491 + }, + "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-public.XYState.valuesInLegend", + "type": "CompoundType", + "tags": [], + "label": "valuesInLegend", + "description": [], + "signature": [ + "boolean | undefined" + ], + "source": { + "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", + "lineNumber": 492 + }, + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "lens", + "id": "def-public.YConfig", + "type": "Interface", + "tags": [], + "label": "YConfig", + "description": [], + "source": { + "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", + "lineNumber": 418 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "lens", + "id": "def-public.YConfig.forAccessor", + "type": "string", + "tags": [], + "label": "forAccessor", + "description": [], + "source": { + "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", + "lineNumber": 419 + }, + "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-public.YConfig.axisMode", + "type": "CompoundType", + "tags": [], + "label": "axisMode", + "description": [], + "signature": [ + "\"left\" | \"right\" | \"auto\" | undefined" + ], + "source": { + "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", + "lineNumber": 420 + }, + "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-public.YConfig.color", + "type": "string", + "tags": [], + "label": "color", + "description": [], + "signature": [ + "string | undefined" + ], + "source": { + "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", + "lineNumber": 421 }, "deprecated": false } @@ -1676,7 +1759,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx", - "lineNumber": 132 + "lineNumber": 139 }, "deprecated": false, "initialIsOpen": false @@ -1742,7 +1825,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/cumulative_sum.tsx", - "lineNumber": 33 + "lineNumber": 34 }, "deprecated": false, "initialIsOpen": false @@ -1759,7 +1842,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/types.ts", - "lineNumber": 352 + "lineNumber": 351 }, "deprecated": false, "initialIsOpen": false @@ -1875,7 +1958,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/index.ts", - "lineNumber": 79 + "lineNumber": 80 }, "deprecated": false, "initialIsOpen": false @@ -1992,7 +2075,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/index.ts", - "lineNumber": 58 + "lineNumber": 59 }, "deprecated": false, "initialIsOpen": false @@ -2018,7 +2101,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx", - "lineNumber": 134 + "lineNumber": 141 }, "deprecated": false, "initialIsOpen": false @@ -2044,7 +2127,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx", - "lineNumber": 135 + "lineNumber": 142 }, "deprecated": false, "initialIsOpen": false @@ -2070,7 +2153,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx", - "lineNumber": 133 + "lineNumber": 140 }, "deprecated": false, "initialIsOpen": false @@ -2090,7 +2173,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/moving_average.tsx", - "lineNumber": 47 + "lineNumber": 43 }, "deprecated": false, "initialIsOpen": false @@ -2109,7 +2192,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/index.ts", - "lineNumber": 498 + "lineNumber": 533 }, "deprecated": false, "initialIsOpen": false @@ -2209,7 +2292,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx", - "lineNumber": 131 + "lineNumber": 138 }, "deprecated": false, "initialIsOpen": false @@ -2296,7 +2379,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 471 + "lineNumber": 472 }, "deprecated": false, "initialIsOpen": false @@ -2350,7 +2433,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 31 + "lineNumber": 34 }, "deprecated": false, "children": [ @@ -2366,7 +2449,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 35 + "lineNumber": 38 }, "deprecated": false, "children": [ @@ -2389,7 +2472,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 35 + "lineNumber": 38 }, "deprecated": false, "isRequired": true @@ -2433,7 +2516,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 39 + "lineNumber": 42 }, "deprecated": false, "children": [ @@ -2464,7 +2547,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 39 + "lineNumber": 42 }, "deprecated": false, "isRequired": true @@ -2487,7 +2570,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 39 + "lineNumber": 42 }, "deprecated": false, "isRequired": true @@ -2523,7 +2606,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 59 + "lineNumber": 63 }, "deprecated": false, "children": [ @@ -2545,7 +2628,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 59 + "lineNumber": 63 }, "deprecated": false, "isRequired": true @@ -2568,7 +2651,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 59 + "lineNumber": 63 }, "deprecated": false, "isRequired": true @@ -2588,7 +2671,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 66 + "lineNumber": 70 }, "deprecated": false, "children": [], @@ -2609,7 +2692,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 21 + "lineNumber": 23 }, "deprecated": false, "children": [ @@ -2632,7 +2715,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 22 + "lineNumber": 24 }, "deprecated": false }, @@ -2655,7 +2738,29 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 23 + "lineNumber": 25 + }, + "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-server.PluginSetupContract.embeddable", + "type": "Object", + "tags": [], + "label": "embeddable", + "description": [], + "signature": [ + { + "pluginId": "embeddable", + "scope": "server", + "docId": "kibEmbeddablePluginApi", + "section": "def-server.EmbeddableSetup", + "text": "EmbeddableSetup" + } + ], + "source": { + "path": "x-pack/plugins/lens/server/plugin.tsx", + "lineNumber": 26 }, "deprecated": false } @@ -2671,7 +2776,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 26 + "lineNumber": 29 }, "deprecated": false, "children": [ @@ -2694,7 +2799,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 27 + "lineNumber": 30 }, "deprecated": false }, @@ -2716,7 +2821,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 28 + "lineNumber": 31 }, "deprecated": false } diff --git a/api_docs/lens.mdx b/api_docs/lens.mdx index 8e9369253c2e34..8c47be1b5897ca 100644 --- a/api_docs/lens.mdx +++ b/api_docs/lens.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import lensObj from './lens.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 172 | 0 | 161 | 16 | + ## Client ### Interfaces diff --git a/api_docs/license_api_guard.mdx b/api_docs/license_api_guard.mdx index d11b92e9bbc145..a2859cc03f8775 100644 --- a/api_docs/license_api_guard.mdx +++ b/api_docs/license_api_guard.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import licenseApiGuardObj from './license_api_guard.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 8 | 0 | 8 | 0 | + ## Server ### Classes diff --git a/api_docs/license_management.mdx b/api_docs/license_management.mdx index 8fde04390ebf08..b198e83acebf35 100644 --- a/api_docs/license_management.mdx +++ b/api_docs/license_management.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import licenseManagementObj from './license_management.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 3 | 0 | 3 | 0 | + ## Client ### Setup diff --git a/api_docs/licensing.json b/api_docs/licensing.json index 1451cff869f47a..862a00e65215f4 100644 --- a/api_docs/licensing.json +++ b/api_docs/licensing.json @@ -45,7 +45,7 @@ "\nThe validity status of the license." ], "signature": [ - "\"active\" | \"invalid\" | \"expired\" | undefined" + "\"invalid\" | \"active\" | \"expired\" | undefined" ], "source": { "path": "x-pack/plugins/licensing/common/types.ts", @@ -381,7 +381,7 @@ "\nThe state of checking the results of a license type meeting the license minimum." ], "signature": [ - "\"valid\" | \"invalid\" | \"expired\" | \"unavailable\"" + "\"valid\" | \"invalid\" | \"unavailable\" | \"expired\"" ], "source": { "path": "x-pack/plugins/licensing/common/types.ts", @@ -492,7 +492,7 @@ "\nThe validity status of the license." ], "signature": [ - "\"active\" | \"invalid\" | \"expired\"" + "\"invalid\" | \"active\" | \"expired\"" ], "source": { "path": "x-pack/plugins/licensing/common/types.ts", @@ -839,7 +839,7 @@ "label": "LicenseCheckState", "description": [], "signature": [ - "\"valid\" | \"invalid\" | \"expired\" | \"unavailable\"" + "\"valid\" | \"invalid\" | \"unavailable\" | \"expired\"" ], "source": { "path": "x-pack/plugins/licensing/common/types.ts", @@ -856,7 +856,7 @@ "label": "LicenseStatus", "description": [], "signature": [ - "\"active\" | \"invalid\" | \"expired\"" + "\"invalid\" | \"active\" | \"expired\"" ], "source": { "path": "x-pack/plugins/licensing/common/types.ts", @@ -987,7 +987,7 @@ "plugin": "security", "link": { "path": "x-pack/plugins/security/public/plugin.tsx", - "lineNumber": 82 + "lineNumber": 84 } }, { @@ -1001,7 +1001,7 @@ "plugin": "ml", "link": { "path": "x-pack/plugins/ml/public/plugin.ts", - "lineNumber": 136 + "lineNumber": 141 } }, { @@ -1022,7 +1022,7 @@ "plugin": "fleet", "link": { "path": "x-pack/plugins/fleet/public/plugin.ts", - "lineNumber": 97 + "lineNumber": 94 } }, { @@ -2078,7 +2078,7 @@ "\nThe validity status of the license." ], "signature": [ - "\"active\" | \"invalid\" | \"expired\" | undefined" + "\"invalid\" | \"active\" | \"expired\" | undefined" ], "source": { "path": "x-pack/plugins/licensing/common/types.ts", @@ -2414,7 +2414,7 @@ "\nThe state of checking the results of a license type meeting the license minimum." ], "signature": [ - "\"valid\" | \"invalid\" | \"expired\" | \"unavailable\"" + "\"valid\" | \"invalid\" | \"unavailable\" | \"expired\"" ], "source": { "path": "x-pack/plugins/licensing/common/types.ts", @@ -2581,7 +2581,7 @@ "\nThe validity status of the license." ], "signature": [ - "\"active\" | \"invalid\" | \"expired\"" + "\"invalid\" | \"active\" | \"expired\"" ], "source": { "path": "x-pack/plugins/licensing/common/types.ts", @@ -2947,7 +2947,7 @@ "label": "LicenseCheckState", "description": [], "signature": [ - "\"valid\" | \"invalid\" | \"expired\" | \"unavailable\"" + "\"valid\" | \"invalid\" | \"unavailable\" | \"expired\"" ], "source": { "path": "x-pack/plugins/licensing/common/types.ts", @@ -2964,7 +2964,7 @@ "label": "LicenseStatus", "description": [], "signature": [ - "\"active\" | \"invalid\" | \"expired\"" + "\"invalid\" | \"active\" | \"expired\"" ], "source": { "path": "x-pack/plugins/licensing/common/types.ts", @@ -3074,7 +3074,7 @@ "plugin": "security", "link": { "path": "x-pack/plugins/security/server/plugin.ts", - "lineNumber": 225 + "lineNumber": 229 } }, { @@ -3119,13 +3119,6 @@ "lineNumber": 139 } }, - { - "plugin": "indexManagement", - "link": { - "path": "x-pack/plugins/index_management/server/services/license.ts", - "lineNumber": 36 - } - }, { "plugin": "remoteClusters", "link": { @@ -3137,7 +3130,7 @@ "plugin": "fleet", "link": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 213 + "lineNumber": 214 } }, { @@ -3154,18 +3147,11 @@ "lineNumber": 41 } }, - { - "plugin": "ingestPipelines", - "link": { - "path": "x-pack/plugins/ingest_pipelines/server/services/license.ts", - "lineNumber": 40 - } - }, { "plugin": "maps", "link": { "path": "x-pack/plugins/maps/server/plugin.ts", - "lineNumber": 164 + "lineNumber": 167 } }, { diff --git a/api_docs/licensing.mdx b/api_docs/licensing.mdx index 695734b79f4934..af26b10762d273 100644 --- a/api_docs/licensing.mdx +++ b/api_docs/licensing.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import licensingObj from './licensing.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 120 | 0 | 44 | 8 | + ## Client ### Setup diff --git a/api_docs/lists.json b/api_docs/lists.json index 90f5cd726287b9..061227499d67f2 100644 --- a/api_docs/lists.json +++ b/api_docs/lists.json @@ -341,7 +341,7 @@ "description": [], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 56 + "lineNumber": 59 }, "deprecated": false, "children": [ @@ -357,7 +357,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 61 + "lineNumber": 64 }, "deprecated": false, "children": [ @@ -373,7 +373,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 61 + "lineNumber": 64 }, "deprecated": false, "isRequired": true @@ -395,7 +395,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 66 + "lineNumber": 69 }, "deprecated": false, "children": [ @@ -411,7 +411,45 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 66 + "lineNumber": 69 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "lists", + "id": "def-server.ExceptionListClient.getExceptionListSummary", + "type": "Function", + "tags": [], + "label": "getExceptionListSummary", + "description": [], + "signature": [ + "({ listId, id, namespaceType, }: ", + "GetExceptionListSummaryOptions", + ") => Promise<{ windows: number; linux: number; macos: number; total: number; } | null>" + ], + "source": { + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", + "lineNumber": 78 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "lists", + "id": "def-server.ExceptionListClient.getExceptionListSummary.$1", + "type": "Object", + "tags": [], + "label": "{\n listId,\n id,\n namespaceType,\n }", + "description": [], + "signature": [ + "GetExceptionListSummaryOptions" + ], + "source": { + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", + "lineNumber": 78 }, "deprecated": false, "isRequired": true @@ -429,11 +467,11 @@ "signature": [ "({ itemId, id, namespaceType, }: ", "GetExceptionListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 75 + "lineNumber": 87 }, "deprecated": false, "children": [ @@ -449,7 +487,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 75 + "lineNumber": 87 }, "deprecated": false, "isRequired": true @@ -471,7 +509,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 90 + "lineNumber": 102 }, "deprecated": false, "children": [], @@ -493,7 +531,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 102 + "lineNumber": 114 }, "deprecated": false, "children": [], @@ -513,7 +551,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 114 + "lineNumber": 126 }, "deprecated": false, "children": [], @@ -531,11 +569,11 @@ "signature": [ "({ comments, description, entries, itemId, meta, name, osTypes, tags, type, }: ", "CreateEndpointListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 128 + "lineNumber": 140 }, "deprecated": false, "children": [ @@ -551,7 +589,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 128 + "lineNumber": 140 }, "deprecated": false, "isRequired": true @@ -571,11 +609,11 @@ "signature": [ "({ _version, comments, description, entries, id, itemId, meta, name, osTypes, tags, type, }: ", "UpdateEndpointListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 164 + "lineNumber": 176 }, "deprecated": false, "children": [ @@ -591,7 +629,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 164 + "lineNumber": 176 }, "deprecated": false, "isRequired": true @@ -611,11 +649,11 @@ "signature": [ "({ itemId, id, }: ", "GetEndpointListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 200 + "lineNumber": 212 }, "deprecated": false, "children": [ @@ -631,7 +669,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 200 + "lineNumber": 212 }, "deprecated": false, "isRequired": true @@ -653,7 +691,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 208 + "lineNumber": 220 }, "deprecated": false, "children": [ @@ -669,7 +707,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 208 + "lineNumber": 220 }, "deprecated": false, "isRequired": true @@ -691,7 +729,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 235 + "lineNumber": 247 }, "deprecated": false, "children": [ @@ -707,7 +745,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 235 + "lineNumber": 247 }, "deprecated": false, "isRequired": true @@ -729,7 +767,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 266 + "lineNumber": 278 }, "deprecated": false, "children": [ @@ -745,7 +783,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 266 + "lineNumber": 278 }, "deprecated": false, "isRequired": true @@ -769,11 +807,11 @@ "section": "def-server.CreateExceptionListItemOptions", "text": "CreateExceptionListItemOptions" }, - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 280 + "lineNumber": 292 }, "deprecated": false, "children": [ @@ -795,7 +833,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 280 + "lineNumber": 292 }, "deprecated": false, "isRequired": true @@ -819,11 +857,11 @@ "section": "def-server.UpdateExceptionListItemOptions", "text": "UpdateExceptionListItemOptions" }, - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 311 + "lineNumber": 323 }, "deprecated": false, "children": [ @@ -845,7 +883,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 311 + "lineNumber": 323 }, "deprecated": false, "isRequired": true @@ -863,11 +901,11 @@ "signature": [ "({ id, itemId, namespaceType, }: ", "DeleteExceptionListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 344 + "lineNumber": 356 }, "deprecated": false, "children": [ @@ -883,7 +921,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 344 + "lineNumber": 356 }, "deprecated": false, "isRequired": true @@ -905,7 +943,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 358 + "lineNumber": 370 }, "deprecated": false, "children": [ @@ -921,7 +959,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 358 + "lineNumber": 370 }, "deprecated": false, "isRequired": true @@ -941,11 +979,11 @@ "signature": [ "({ id, itemId, }: ", "DeleteEndpointListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 373 + "lineNumber": 385 }, "deprecated": false, "children": [ @@ -961,7 +999,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 373 + "lineNumber": 385 }, "deprecated": false, "isRequired": true @@ -979,11 +1017,11 @@ "signature": [ "({ listId, filter, perPage, page, sortField, sortOrder, namespaceType, }: ", "FindExceptionListItemOptions", - ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } | null>" + ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 386 + "lineNumber": 398 }, "deprecated": false, "children": [ @@ -999,7 +1037,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 386 + "lineNumber": 398 }, "deprecated": false, "isRequired": true @@ -1017,11 +1055,11 @@ "signature": [ "({ listId, filter, perPage, page, sortField, sortOrder, namespaceType, }: ", "FindExceptionListsItemOptions", - ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } | null>" + ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 408 + "lineNumber": 420 }, "deprecated": false, "children": [ @@ -1037,7 +1075,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 408 + "lineNumber": 420 }, "deprecated": false, "isRequired": true @@ -1055,11 +1093,11 @@ "signature": [ "({ perPage, page, sortField, sortOrder, valueListId, }: ", "FindValueListExceptionListsItems", - ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } | null>" + ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 430 + "lineNumber": 442 }, "deprecated": false, "children": [ @@ -1075,7 +1113,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 430 + "lineNumber": 442 }, "deprecated": false, "isRequired": true @@ -1097,7 +1135,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 448 + "lineNumber": 460 }, "deprecated": false, "children": [ @@ -1113,7 +1151,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 448 + "lineNumber": 460 }, "deprecated": false, "isRequired": true @@ -1133,11 +1171,11 @@ "signature": [ "({ filter, perPage, page, sortField, sortOrder, }: ", "FindEndpointListItemOptions", - ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } | null>" + ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 476 + "lineNumber": 488 }, "deprecated": false, "children": [ @@ -1153,7 +1191,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 476 + "lineNumber": 488 }, "deprecated": false, "isRequired": true @@ -1259,7 +1297,7 @@ "signature": [ "({ id }: ", "GetListOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -1297,7 +1335,7 @@ "signature": [ "({ id, deserializer, immutable, serializer, name, description, type, meta, version, }: ", "CreateListOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -1335,7 +1373,7 @@ "signature": [ "({ id, deserializer, serializer, name, description, immutable, type, meta, version, }: ", "CreateListIfItDoesNotExistOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -1733,7 +1771,7 @@ "signature": [ "({ id }: ", "DeleteListItemOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -1771,7 +1809,7 @@ "signature": [ "({ listId, value, type, }: ", "DeleteListItemByValueOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -1809,7 +1847,7 @@ "signature": [ "({ id }: ", "DeleteListOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -1885,7 +1923,7 @@ "signature": [ "({ deserializer, serializer, type, listId, stream, meta, version, }: ", "ImportListItemsToStreamOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -1923,7 +1961,7 @@ "signature": [ "({ listId, value, type, }: ", "GetListItemByValueOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -1961,7 +1999,7 @@ "signature": [ "({ id, deserializer, serializer, listId, value, type, meta, }: ", "CreateListItemOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -1999,7 +2037,7 @@ "signature": [ "({ _version, id, value, meta, }: ", "UpdateListItemOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -2037,7 +2075,7 @@ "signature": [ "({ _version, id, name, description, meta, version, }: ", "UpdateListOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -2075,7 +2113,7 @@ "signature": [ "({ id }: ", "GetListItemOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -2113,7 +2151,7 @@ "signature": [ "({ type, listId, value, }: ", "GetListItemsByValueOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -2151,7 +2189,7 @@ "signature": [ "({ type, listId, value, }: ", "SearchListItemByValuesOptions", - ") => Promise<{ items: { _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]; value: unknown; }[]>" + ") => Promise<{ items: { _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]; value: unknown; }[]>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -2189,7 +2227,7 @@ "signature": [ "({ filter, currentIndexPosition, perPage, page, sortField, sortOrder, searchAfter, }: ", "FindListOptions", - ") => Promise<{ cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }[]; page: number; per_page: number; total: number; }>" + ") => Promise<{ cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }[]; page: number; per_page: number; total: number; }>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -2227,7 +2265,7 @@ "signature": [ "({ listId, filter, currentIndexPosition, perPage, page, sortField, sortOrder, searchAfter, }: ", "FindListItemOptions", - ") => Promise<{ cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]; page: number; per_page: number; total: number; } | null>" + ") => Promise<{ cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]; page: number; per_page: number; total: number; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -2270,7 +2308,7 @@ "description": [], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 118 + "lineNumber": 124 }, "deprecated": false, "children": [ @@ -2286,7 +2324,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 119 + "lineNumber": 125 }, "deprecated": false }, @@ -2298,11 +2336,11 @@ "label": "entries", "description": [], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 120 + "lineNumber": 126 }, "deprecated": false }, @@ -2315,7 +2353,7 @@ "description": [], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 121 + "lineNumber": 127 }, "deprecated": false }, @@ -2328,7 +2366,7 @@ "description": [], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 122 + "lineNumber": 128 }, "deprecated": false }, @@ -2344,7 +2382,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 123 + "lineNumber": 129 }, "deprecated": false }, @@ -2357,7 +2395,7 @@ "description": [], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 124 + "lineNumber": 130 }, "deprecated": false }, @@ -2373,7 +2411,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 125 + "lineNumber": 131 }, "deprecated": false }, @@ -2386,7 +2424,7 @@ "description": [], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 126 + "lineNumber": 132 }, "deprecated": false }, @@ -2402,7 +2440,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 127 + "lineNumber": 133 }, "deprecated": false }, @@ -2418,7 +2456,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 128 + "lineNumber": 134 }, "deprecated": false }, @@ -2434,7 +2472,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 129 + "lineNumber": 135 }, "deprecated": false } @@ -2859,7 +2897,7 @@ "signature": [ "Pick<", "KibanaClient", - ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"helpers\" | \"count\" | \"search\" | \"security\" | \"eql\" | \"on\" | \"off\" | \"transform\" | \"emit\" | \"once\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", + ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"helpers\" | \"count\" | \"search\" | \"security\" | \"eql\" | \"on\" | \"off\" | \"transform\" | \"emit\" | \"once\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", "TransportRequestParams", ", options?: ", "TransportRequestOptions", @@ -2981,7 +3019,7 @@ "description": [], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 144 + "lineNumber": 150 }, "deprecated": false, "children": [ @@ -2997,7 +3035,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 145 + "lineNumber": 151 }, "deprecated": false }, @@ -3013,7 +3051,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 146 + "lineNumber": 152 }, "deprecated": false }, @@ -3025,11 +3063,11 @@ "label": "entries", "description": [], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 147 + "lineNumber": 153 }, "deprecated": false }, @@ -3045,7 +3083,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 148 + "lineNumber": 154 }, "deprecated": false }, @@ -3061,7 +3099,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 149 + "lineNumber": 155 }, "deprecated": false }, @@ -3077,7 +3115,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 150 + "lineNumber": 156 }, "deprecated": false }, @@ -3093,7 +3131,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 151 + "lineNumber": 157 }, "deprecated": false }, @@ -3109,7 +3147,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 152 + "lineNumber": 158 }, "deprecated": false }, @@ -3125,7 +3163,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 153 + "lineNumber": 159 }, "deprecated": false }, @@ -3141,7 +3179,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 154 + "lineNumber": 160 }, "deprecated": false }, @@ -3157,7 +3195,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 155 + "lineNumber": 161 }, "deprecated": false }, @@ -3173,7 +3211,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 156 + "lineNumber": 162 }, "deprecated": false } diff --git a/api_docs/lists.mdx b/api_docs/lists.mdx index 8ef77a85fb548e..47b1bde5c07822 100644 --- a/api_docs/lists.mdx +++ b/api_docs/lists.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import listsObj from './lists.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 151 | 0 | 143 | 38 | + ## Client ### Setup diff --git a/api_docs/management.mdx b/api_docs/management.mdx index 16e097a6158e6a..22586c7b58b494 100644 --- a/api_docs/management.mdx +++ b/api_docs/management.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import managementObj from './management.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 38 | 0 | 38 | 4 | + ## Client ### Setup diff --git a/api_docs/maps.json b/api_docs/maps.json index d418518dcb0d2c..9c1c7243a41bc5 100644 --- a/api_docs/maps.json +++ b/api_docs/maps.json @@ -57,7 +57,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 95 + "lineNumber": 93 }, "deprecated": false, "children": [ @@ -70,7 +70,7 @@ "description": [], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 98 + "lineNumber": 96 }, "deprecated": false }, @@ -86,7 +86,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 118 + "lineNumber": 115 }, "deprecated": false, "children": [ @@ -102,7 +102,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 118 + "lineNumber": 115 }, "deprecated": false, "isRequired": true @@ -125,7 +125,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 118 + "lineNumber": 115 }, "deprecated": false, "isRequired": true @@ -165,7 +165,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 118 + "lineNumber": 115 }, "deprecated": false, "isRequired": false @@ -194,7 +194,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 200 + "lineNumber": 194 }, "deprecated": false, "children": [ @@ -216,7 +216,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 201 + "lineNumber": 195 }, "deprecated": false, "isRequired": true @@ -238,7 +238,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 206 + "lineNumber": 200 }, "deprecated": false, "children": [], @@ -258,7 +258,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 214 + "lineNumber": 208 }, "deprecated": false, "children": [], @@ -276,7 +276,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 219 + "lineNumber": 213 }, "deprecated": false, "children": [], @@ -294,7 +294,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 223 + "lineNumber": 217 }, "deprecated": false, "children": [], @@ -314,7 +314,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 227 + "lineNumber": 221 }, "deprecated": false, "children": [ @@ -330,7 +330,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 227 + "lineNumber": 221 }, "deprecated": false, "isRequired": true @@ -352,7 +352,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 231 + "lineNumber": 225 }, "deprecated": false, "children": [ @@ -368,7 +368,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 231 + "lineNumber": 225 }, "deprecated": false, "isRequired": true @@ -395,7 +395,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 235 + "lineNumber": 229 }, "deprecated": false, "children": [], @@ -413,7 +413,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 239 + "lineNumber": 233 }, "deprecated": false, "children": [], @@ -439,7 +439,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 283 + "lineNumber": 273 }, "deprecated": false, "children": [], @@ -457,7 +457,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 291 + "lineNumber": 281 }, "deprecated": false, "children": [], @@ -475,7 +475,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 301 + "lineNumber": 291 }, "deprecated": false, "children": [ @@ -488,7 +488,7 @@ "description": [], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 301 + "lineNumber": 291 }, "deprecated": false, "children": [ @@ -501,7 +501,7 @@ "description": [], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 301 + "lineNumber": 291 }, "deprecated": false } @@ -510,56 +510,6 @@ ], "returnComment": [] }, - { - "parentPluginId": "maps", - "id": "def-public.MapEmbeddable._dispatchSetRefreshConfig", - "type": "Function", - "tags": [], - "label": "_dispatchSetRefreshConfig", - "description": [], - "signature": [ - "(refreshConfig: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.RefreshInterval", - "text": "RefreshInterval" - }, - ") => void" - ], - "source": { - "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 321 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "maps", - "id": "def-public.MapEmbeddable._dispatchSetRefreshConfig.$1", - "type": "Object", - "tags": [], - "label": "refreshConfig", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.RefreshInterval", - "text": "RefreshInterval" - } - ], - "source": { - "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 321 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, { "parentPluginId": "maps", "id": "def-public.MapEmbeddable._dispatchSetChartsPaletteServiceGetColor", @@ -572,7 +522,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 331 + "lineNumber": 311 }, "deprecated": false, "children": [ @@ -588,7 +538,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 331 + "lineNumber": 311 }, "deprecated": false, "isRequired": false @@ -610,7 +560,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 349 + "lineNumber": 329 }, "deprecated": false, "children": [ @@ -626,7 +576,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 349 + "lineNumber": 329 }, "deprecated": false, "isRequired": true @@ -648,7 +598,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 375 + "lineNumber": 355 }, "deprecated": false, "children": [ @@ -665,7 +615,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 375 + "lineNumber": 355 }, "deprecated": false, "isRequired": true @@ -693,7 +643,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 392 + "lineNumber": 372 }, "deprecated": false, "children": [ @@ -709,7 +659,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 392 + "lineNumber": 372 }, "deprecated": false, "isRequired": true @@ -726,7 +676,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 392 + "lineNumber": 372 }, "deprecated": false, "isRequired": true @@ -749,7 +699,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 392 + "lineNumber": 372 }, "deprecated": false, "isRequired": false @@ -777,7 +727,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 406 + "lineNumber": 386 }, "deprecated": false, "children": [ @@ -800,7 +750,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 406 + "lineNumber": 386 }, "deprecated": false, "isRequired": true @@ -817,7 +767,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 406 + "lineNumber": 386 }, "deprecated": false, "isRequired": true @@ -845,7 +795,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 418 + "lineNumber": 398 }, "deprecated": false, "children": [], @@ -871,7 +821,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 439 + "lineNumber": 419 }, "deprecated": false, "children": [], @@ -889,7 +839,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 450 + "lineNumber": 430 }, "deprecated": false, "children": [], @@ -907,7 +857,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 487 + "lineNumber": 466 }, "deprecated": false, "children": [], @@ -925,7 +875,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 501 + "lineNumber": 480 }, "deprecated": false, "children": [], @@ -943,7 +893,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 517 + "lineNumber": 496 }, "deprecated": false, "children": [], @@ -961,7 +911,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 523 + "lineNumber": 502 }, "deprecated": false, "children": [], @@ -1377,7 +1327,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/types.ts", - "lineNumber": 42 + "lineNumber": 41 }, "deprecated": false, "initialIsOpen": false @@ -1409,7 +1359,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/types.ts", - "lineNumber": 44 + "lineNumber": 43 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/maps.mdx b/api_docs/maps.mdx index f4f5594b193471..efa7ddb5fddf58 100644 --- a/api_docs/maps.mdx +++ b/api_docs/maps.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import mapsObj from './maps.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 196 | 2 | 195 | 11 | + ## Client ### Start diff --git a/api_docs/maps_ems.mdx b/api_docs/maps_ems.mdx index 5907add0c54659..0abd9d511cf90c 100644 --- a/api_docs/maps_ems.mdx +++ b/api_docs/maps_ems.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import mapsEmsObj from './maps_ems.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 75 | 1 | 75 | 0 | + ## Client ### Setup diff --git a/api_docs/metrics_entities.json b/api_docs/metrics_entities.json index 3e67e8e7500076..b78278a84162a3 100644 --- a/api_docs/metrics_entities.json +++ b/api_docs/metrics_entities.json @@ -64,7 +64,7 @@ "signature": [ "Pick<", "KibanaClient", - ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"helpers\" | \"count\" | \"search\" | \"security\" | \"eql\" | \"on\" | \"off\" | \"transform\" | \"emit\" | \"once\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", + ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"helpers\" | \"count\" | \"search\" | \"security\" | \"eql\" | \"on\" | \"off\" | \"transform\" | \"emit\" | \"once\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", "TransportRequestParams", ", options?: ", "TransportRequestOptions", diff --git a/api_docs/metrics_entities.mdx b/api_docs/metrics_entities.mdx index 19a27636511c3c..182a78cd0ddc1b 100644 --- a/api_docs/metrics_entities.mdx +++ b/api_docs/metrics_entities.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import metricsEntitiesObj from './metrics_entities.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 9 | 0 | 6 | 1 | + ## Server ### Setup diff --git a/api_docs/ml.json b/api_docs/ml.json index dee66858b9be94..2e0e6364993d53 100644 --- a/api_docs/ml.json +++ b/api_docs/ml.json @@ -868,7 +868,7 @@ "description": [], "source": { "path": "x-pack/plugins/ml/common/types/capabilities.ts", - "lineNumber": 153 + "lineNumber": 161 }, "deprecated": false, "children": [ @@ -884,7 +884,7 @@ ], "source": { "path": "x-pack/plugins/ml/common/types/capabilities.ts", - "lineNumber": 154 + "lineNumber": 162 }, "deprecated": false }, @@ -897,7 +897,7 @@ "description": [], "source": { "path": "x-pack/plugins/ml/common/types/capabilities.ts", - "lineNumber": 155 + "lineNumber": 163 }, "deprecated": false }, @@ -910,7 +910,7 @@ "description": [], "source": { "path": "x-pack/plugins/ml/common/types/capabilities.ts", - "lineNumber": 156 + "lineNumber": 164 }, "deprecated": false }, @@ -923,7 +923,7 @@ "description": [], "source": { "path": "x-pack/plugins/ml/common/types/capabilities.ts", - "lineNumber": 157 + "lineNumber": 165 }, "deprecated": false } @@ -1513,14 +1513,14 @@ "description": [], "signature": [ "{ GTE: ", - "TotalHitsRelation", + "SearchTotalHitsRelation", "; EQ: ", - "TotalHitsRelation", + "SearchTotalHitsRelation", "; }" ], "source": { "path": "x-pack/plugins/ml/common/types/es_client.ts", - "lineNumber": 20 + "lineNumber": 22 }, "deprecated": false, "initialIsOpen": false @@ -1563,7 +1563,7 @@ ], "source": { "path": "x-pack/plugins/ml/public/plugin.ts", - "lineNumber": 213 + "lineNumber": 212 }, "deprecated": false, "lifecycle": "start", @@ -1779,7 +1779,7 @@ ", indexPatternTitle: string, query: any, fields: ", "HistogramField", "[], samplerShardSize: number, runtimeMappings?: Record | undefined) => Promise" ], "source": { @@ -1889,7 +1889,7 @@ "description": [], "signature": [ "Record | undefined" ], "source": { @@ -2852,7 +2852,7 @@ "signature": [ "CombinedJob", " extends ", - "Job" + "MlJob" ], "source": { "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/combined_job.ts", @@ -2884,7 +2884,7 @@ "label": "datafeed_config", "description": [], "signature": [ - "Datafeed" + "MlDatafeed" ], "source": { "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/combined_job.ts", @@ -2937,9 +2937,9 @@ "label": "datafeed_config", "description": [], "signature": [ - "Datafeed", + "MlDatafeed", " & ", - "DatafeedStats" + "MlDatafeedStats" ], "source": { "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/combined_job.ts", @@ -2950,72 +2950,6 @@ ], "initialIsOpen": false }, - { - "parentPluginId": "ml", - "id": "def-server.IndicesOptions", - "type": "Interface", - "tags": [], - "label": "IndicesOptions", - "description": [], - "source": { - "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/datafeed.ts", - "lineNumber": 19 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "ml", - "id": "def-server.IndicesOptions.allow_no_indices", - "type": "CompoundType", - "tags": [], - "label": "allow_no_indices", - "description": [], - "signature": [ - "boolean | undefined" - ], - "source": { - "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/datafeed.ts", - "lineNumber": 20 - }, - "deprecated": false - }, - { - "parentPluginId": "ml", - "id": "def-server.IndicesOptions.expand_wildcards", - "type": "CompoundType", - "tags": [], - "label": "expand_wildcards", - "description": [], - "signature": [ - "string | ", - "ExpandWildcardOptions", - "[] | undefined" - ], - "source": { - "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/datafeed.ts", - "lineNumber": 21 - }, - "deprecated": false - }, - { - "parentPluginId": "ml", - "id": "def-server.IndicesOptions.ignore_unavailable", - "type": "CompoundType", - "tags": [], - "label": "ignore_unavailable", - "description": [], - "signature": [ - "boolean | undefined" - ], - "source": { - "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/datafeed.ts", - "lineNumber": 22 - }, - "deprecated": false - } - ], - "initialIsOpen": false - }, { "parentPluginId": "ml", "id": "def-server.Influencer", @@ -3516,156 +3450,6 @@ ], "initialIsOpen": false }, - { - "parentPluginId": "ml", - "id": "def-server.ModelSnapshot", - "type": "Interface", - "tags": [], - "label": "ModelSnapshot", - "description": [], - "source": { - "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/model_snapshot.ts", - "lineNumber": 11 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "ml", - "id": "def-server.ModelSnapshot.job_id", - "type": "string", - "tags": [], - "label": "job_id", - "description": [], - "source": { - "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/model_snapshot.ts", - "lineNumber": 12 - }, - "deprecated": false - }, - { - "parentPluginId": "ml", - "id": "def-server.ModelSnapshot.min_version", - "type": "string", - "tags": [], - "label": "min_version", - "description": [], - "source": { - "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/model_snapshot.ts", - "lineNumber": 13 - }, - "deprecated": false - }, - { - "parentPluginId": "ml", - "id": "def-server.ModelSnapshot.timestamp", - "type": "number", - "tags": [], - "label": "timestamp", - "description": [], - "source": { - "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/model_snapshot.ts", - "lineNumber": 14 - }, - "deprecated": false - }, - { - "parentPluginId": "ml", - "id": "def-server.ModelSnapshot.description", - "type": "string", - "tags": [], - "label": "description", - "description": [], - "source": { - "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/model_snapshot.ts", - "lineNumber": 15 - }, - "deprecated": false - }, - { - "parentPluginId": "ml", - "id": "def-server.ModelSnapshot.snapshot_id", - "type": "string", - "tags": [], - "label": "snapshot_id", - "description": [], - "source": { - "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/model_snapshot.ts", - "lineNumber": 16 - }, - "deprecated": false - }, - { - "parentPluginId": "ml", - "id": "def-server.ModelSnapshot.snapshot_doc_count", - "type": "number", - "tags": [], - "label": "snapshot_doc_count", - "description": [], - "source": { - "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/model_snapshot.ts", - "lineNumber": 17 - }, - "deprecated": false - }, - { - "parentPluginId": "ml", - "id": "def-server.ModelSnapshot.model_size_stats", - "type": "CompoundType", - "tags": [], - "label": "model_size_stats", - "description": [], - "signature": [ - "ModelSizeStats", - " & { model_bytes_exceeded: number; model_bytes_memory_limit: number; peak_model_bytes?: number | undefined; }" - ], - "source": { - "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/model_snapshot.ts", - "lineNumber": 18 - }, - "deprecated": false - }, - { - "parentPluginId": "ml", - "id": "def-server.ModelSnapshot.latest_record_time_stamp", - "type": "number", - "tags": [], - "label": "latest_record_time_stamp", - "description": [], - "source": { - "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/model_snapshot.ts", - "lineNumber": 19 - }, - "deprecated": false - }, - { - "parentPluginId": "ml", - "id": "def-server.ModelSnapshot.latest_result_time_stamp", - "type": "number", - "tags": [], - "label": "latest_result_time_stamp", - "description": [], - "source": { - "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/model_snapshot.ts", - "lineNumber": 20 - }, - "deprecated": false - }, - { - "parentPluginId": "ml", - "id": "def-server.ModelSnapshot.retain", - "type": "boolean", - "tags": [], - "label": "retain", - "description": [], - "source": { - "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/model_snapshot.ts", - "lineNumber": 21 - }, - "deprecated": false - } - ], - "initialIsOpen": false - }, { "parentPluginId": "ml", "id": "def-server.PerPartitionCategorization", @@ -3726,7 +3510,7 @@ "description": [], "signature": [ "{ [x: string]: ", - "AggregationContainer", + "AggregationsAggregationContainer", "; }" ], "source": { @@ -3744,7 +3528,7 @@ "label": "AnalysisConfig", "description": [], "signature": [ - "AnalysisConfig" + "MlAnalysisConfig" ], "source": { "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/job.ts", @@ -3761,7 +3545,7 @@ "label": "AnalysisLimits", "description": [], "signature": [ - "AnalysisLimits" + "MlAnalysisLimits" ], "source": { "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/job.ts", @@ -3812,7 +3596,7 @@ "label": "ChunkingConfig", "description": [], "signature": [ - "ChunkingConfig" + "MlChunkingConfig" ], "source": { "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/datafeed.ts", @@ -3829,7 +3613,7 @@ "label": "CustomRule", "description": [], "signature": [ - "DetectionRule" + "MlDetectionRule" ], "source": { "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/job.ts", @@ -3846,7 +3630,7 @@ "label": "CustomSettings", "description": [], "signature": [ - "CustomSettings" + "MlCustomSettings" ], "source": { "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/job.ts", @@ -3863,11 +3647,11 @@ "label": "DataCounts", "description": [], "signature": [ - "DataCounts" + "MlDataCounts" ], "source": { "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/job_stats.ts", - "lineNumber": 15 + "lineNumber": 12 }, "deprecated": false, "initialIsOpen": false @@ -3880,7 +3664,7 @@ "label": "DataDescription", "description": [], "signature": [ - "DataDescription" + "MlDataDescription" ], "source": { "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/job.ts", @@ -3897,7 +3681,7 @@ "label": "Datafeed", "description": [], "signature": [ - "Datafeed" + "MlDatafeed" ], "source": { "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/datafeed.ts", @@ -3931,7 +3715,7 @@ "label": "DatafeedStats", "description": [], "signature": [ - "DatafeedStats" + "MlDatafeedStats" ], "source": { "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/datafeed_stats.ts", @@ -3948,9 +3732,9 @@ "label": "DatafeedWithStats", "description": [], "signature": [ - "Datafeed", + "MlDatafeed", " & ", - "DatafeedStats" + "MlDatafeedStats" ], "source": { "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/combined_job.ts", @@ -3967,7 +3751,7 @@ "label": "Detector", "description": [], "signature": [ - "Detector" + "MlDetector" ], "source": { "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/job.ts", @@ -4001,11 +3785,28 @@ "label": "ForecastsStats", "description": [], "signature": [ - "JobForecastStatistics" + "MlJobForecastStatistics" ], "source": { "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/job_stats.ts", - "lineNumber": 27 + "lineNumber": 18 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "ml", + "id": "def-server.IndicesOptions", + "type": "Type", + "tags": [], + "label": "IndicesOptions", + "description": [], + "signature": [ + "MlDatafeedIndicesOptions" + ], + "source": { + "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/datafeed.ts", + "lineNumber": 18 }, "deprecated": false, "initialIsOpen": false @@ -4018,7 +3819,7 @@ "label": "Job", "description": [], "signature": [ - "Job" + "MlJob" ], "source": { "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/job.ts", @@ -4052,12 +3853,7 @@ "label": "JobStats", "description": [], "signature": [ - "JobStats", - " & { model_size_stats: ", - "ModelSizeStats", - "; timing_stats: ", - "TimingStats", - "; }" + "MlJobStats" ], "source": { "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/job_stats.ts", @@ -4074,14 +3870,10 @@ "label": "JobWithStats", "description": [], "signature": [ - "Job", + "MlJob", + " & ", + "MlJobStats", " & ", - "JobStats", - " & { model_size_stats: ", - "ModelSizeStats", - "; timing_stats: ", - "TimingStats", - "; } & ", "JobAlertingRuleStats" ], "source": { @@ -4117,7 +3909,7 @@ "label": "ModelPlotConfig", "description": [], "signature": [ - "ModelPlotConfig" + "MlModelPlotConfig" ], "source": { "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/job.ts", @@ -4134,12 +3926,28 @@ "label": "ModelSizeStats", "description": [], "signature": [ - "ModelSizeStats", - " & { model_bytes_exceeded: number; model_bytes_memory_limit: number; peak_model_bytes?: number | undefined; }" + "MlModelSizeStats" ], "source": { "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/job_stats.ts", - "lineNumber": 17 + "lineNumber": 14 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "ml", + "id": "def-server.ModelSnapshot", + "type": "Type", + "tags": [], + "label": "ModelSnapshot", + "description": [], + "signature": [ + "MlModelSnapshot" + ], + "source": { + "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/model_snapshot.ts", + "lineNumber": 10 }, "deprecated": false, "initialIsOpen": false @@ -4169,11 +3977,11 @@ "label": "Node", "description": [], "signature": [ - "DiscoveryNode" + "MlDiscoveryNode" ], "source": { "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/job_stats.ts", - "lineNumber": 29 + "lineNumber": 20 }, "deprecated": false, "initialIsOpen": false @@ -4203,12 +4011,11 @@ "label": "TimingStats", "description": [], "signature": [ - "TimingStats", - " & { total_bucket_processing_time_ms: number; }" + "MlTimingStats" ], "source": { "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/job_stats.ts", - "lineNumber": 23 + "lineNumber": 16 }, "deprecated": false, "initialIsOpen": false @@ -4671,7 +4478,7 @@ "description": [], "signature": [ "{ [x: string]: ", - "RuntimeField", + "MappingRuntimeField", "; }" ], "source": { @@ -4692,14 +4499,14 @@ "description": [], "signature": [ "{ GTE: ", - "TotalHitsRelation", + "SearchTotalHitsRelation", "; EQ: ", - "TotalHitsRelation", + "SearchTotalHitsRelation", "; }" ], "source": { "path": "x-pack/plugins/ml/common/types/es_client.ts", - "lineNumber": 20 + "lineNumber": 22 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/ml.mdx b/api_docs/ml.mdx index abb03511bbcaa7..4a9b98a3268373 100644 --- a/api_docs/ml.mdx +++ b/api_docs/ml.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import mlObj from './ml.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 274 | 10 | 270 | 32 | + ## Client ### Start diff --git a/api_docs/monitoring.json b/api_docs/monitoring.json index 188e3f7b321001..2569619f007d71 100644 --- a/api_docs/monitoring.json +++ b/api_docs/monitoring.json @@ -96,7 +96,7 @@ "signature": [ "Pick<", "KibanaClient", - ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"helpers\" | \"count\" | \"search\" | \"security\" | \"eql\" | \"on\" | \"off\" | \"transform\" | \"emit\" | \"once\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", + ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"helpers\" | \"count\" | \"search\" | \"security\" | \"eql\" | \"on\" | \"off\" | \"transform\" | \"emit\" | \"once\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", "TransportRequestParams", ", options?: ", "TransportRequestOptions", diff --git a/api_docs/monitoring.mdx b/api_docs/monitoring.mdx index 4c32b1c933c930..e3dd2a0bbb6a5d 100644 --- a/api_docs/monitoring.mdx +++ b/api_docs/monitoring.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import monitoringObj from './monitoring.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 10 | 0 | 10 | 2 | + ## Server ### Setup diff --git a/api_docs/navigation.mdx b/api_docs/navigation.mdx index d9dc1703ed4d86..b8b6f82162916a 100644 --- a/api_docs/navigation.mdx +++ b/api_docs/navigation.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import navigationObj from './navigation.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 31 | 0 | 31 | 2 | + ## Client ### Setup diff --git a/api_docs/newsfeed.json b/api_docs/newsfeed.json index 45ec0de037851f..eec5a9c5642e50 100644 --- a/api_docs/newsfeed.json +++ b/api_docs/newsfeed.json @@ -228,7 +228,7 @@ "description": [], "source": { "path": "src/plugins/newsfeed/public/lib/api.ts", - "lineNumber": 25 + "lineNumber": 16 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/newsfeed.mdx b/api_docs/newsfeed.mdx index cb5c264e1940c7..0c3fe2bbc6640a 100644 --- a/api_docs/newsfeed.mdx +++ b/api_docs/newsfeed.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import newsfeedObj from './newsfeed.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 17 | 0 | 17 | 0 | + ## Client ### Setup diff --git a/api_docs/observability.json b/api_docs/observability.json index fc645dd7e2e6b8..f59cf6407de756 100644 --- a/api_docs/observability.json +++ b/api_docs/observability.json @@ -145,7 +145,11 @@ "section": "def-public.AlertTypeModel", "text": "AlertTypeModel" }, - " & { format: Formatter; }) => void; getFormatter: (typeId: string) => Formatter | undefined; } & { registerFormatter: () => void; }" + " & { format: ", + "Formatter", + "; }) => void; getFormatter: (typeId: string) => ", + "Formatter", + " | undefined; } & { registerFormatter: () => void; }" ], "source": { "path": "x-pack/plugins/observability/public/rules/observability_rule_type_registry_mock.ts", @@ -417,7 +421,7 @@ "signature": [ "({ children, ...props }: { children?: React.ReactNode; } & ", "CommonProps", - " & Pick, \"children\" | \"onClick\" | \"onChange\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\"> & { bordered?: boolean | undefined; flush?: boolean | undefined; gutterSize?: \"m\" | \"s\" | \"none\" | undefined; listItems?: ", + " & Pick, \"children\" | \"onClick\" | \"onChange\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\"> & { bordered?: boolean | undefined; flush?: boolean | undefined; gutterSize?: \"none\" | \"m\" | \"s\" | undefined; listItems?: ", "EuiListGroupItemProps", "[] | undefined; color?: \"text\" | \"primary\" | \"inherit\" | \"ghost\" | \"subdued\" | undefined; size?: \"m\" | \"s\" | \"l\" | \"xs\" | undefined; maxWidth?: string | number | boolean | undefined; showToolTips?: boolean | undefined; wrapText?: boolean | undefined; ariaLabelledby?: string | undefined; }) => JSX.Element" ], @@ -437,7 +441,7 @@ "signature": [ "{ children?: React.ReactNode; } & ", "CommonProps", - " & Pick, \"children\" | \"onClick\" | \"onChange\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\"> & { bordered?: boolean | undefined; flush?: boolean | undefined; gutterSize?: \"m\" | \"s\" | \"none\" | undefined; listItems?: ", + " & Pick, \"children\" | \"onClick\" | \"onChange\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\"> & { bordered?: boolean | undefined; flush?: boolean | undefined; gutterSize?: \"none\" | \"m\" | \"s\" | undefined; listItems?: ", "EuiListGroupItemProps", "[] | undefined; color?: \"text\" | \"primary\" | \"inherit\" | \"ghost\" | \"subdued\" | undefined; size?: \"m\" | \"s\" | \"l\" | \"xs\" | undefined; maxWidth?: string | number | boolean | undefined; showToolTips?: boolean | undefined; wrapText?: boolean | undefined; ariaLabelledby?: string | undefined; }" ], @@ -573,6 +577,46 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "observability", + "id": "def-public.useBreadcrumbs", + "type": "Function", + "tags": [], + "label": "useBreadcrumbs", + "description": [], + "signature": [ + "(extraCrumbs: ", + "EuiBreadcrumb", + "[]) => void" + ], + "source": { + "path": "x-pack/plugins/observability/public/hooks/use_breadcrumbs.ts", + "lineNumber": 43 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "observability", + "id": "def-public.useBreadcrumbs.$1", + "type": "Array", + "tags": [], + "label": "extraCrumbs", + "description": [], + "signature": [ + "EuiBreadcrumb", + "[]" + ], + "source": { + "path": "x-pack/plugins/observability/public/hooks/use_breadcrumbs.ts", + "lineNumber": 43 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "observability", "id": "def-public.useChartTheme", @@ -887,7 +931,7 @@ "label": "useUiTracker", "description": [], "signature": [ - "({\n app: defaultApp,\n}: { app?: \"apm\" | \"fleet\" | \"infra_metrics\" | \"infra_logs\" | \"uptime\" | \"synthetics\" | \"observability-overview\" | \"stack_monitoring\" | \"ux\" | undefined; }) => ({ app, metric, metricType }: ", + "({\n app: defaultApp,\n}: { app?: \"fleet\" | \"apm\" | \"infra_metrics\" | \"infra_logs\" | \"uptime\" | \"synthetics\" | \"observability-overview\" | \"stack_monitoring\" | \"ux\" | undefined; }) => ({ app, metric, metricType }: ", { "pluginId": "observability", "scope": "public", @@ -924,7 +968,7 @@ "label": "app", "description": [], "signature": [ - "\"apm\" | \"fleet\" | \"infra_metrics\" | \"infra_logs\" | \"uptime\" | \"synthetics\" | \"observability-overview\" | \"stack_monitoring\" | \"ux\" | undefined" + "\"fleet\" | \"apm\" | \"infra_metrics\" | \"infra_logs\" | \"uptime\" | \"synthetics\" | \"observability-overview\" | \"stack_monitoring\" | \"ux\" | undefined" ], "source": { "path": "x-pack/plugins/observability/public/hooks/use_track_metric.tsx", @@ -2267,7 +2311,7 @@ "description": [], "source": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 73 + "lineNumber": 82 }, "deprecated": false, "children": [ @@ -2283,7 +2327,7 @@ ], "source": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 74 + "lineNumber": 83 }, "deprecated": false }, @@ -2299,7 +2343,7 @@ ], "source": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 78 + "lineNumber": 87 }, "deprecated": false }, @@ -2316,7 +2360,7 @@ ], "source": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 79 + "lineNumber": 88 }, "deprecated": false }, @@ -2332,7 +2376,7 @@ ], "source": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 80 + "lineNumber": 89 }, "deprecated": false }, @@ -2344,11 +2388,11 @@ "label": "reportType", "description": [], "signature": [ - "\"logs\" | \"cpu\" | \"pld\" | \"kpi\" | \"upd\" | \"upp\" | \"svl\" | \"tpt\" | \"mem\" | \"nwk\"" + "\"logs\" | \"cpu\" | \"pld\" | \"kpi\" | \"cwv\" | \"upd\" | \"upp\" | \"svl\" | \"tpt\" | \"mem\" | \"nwk\"" ], "source": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 81 + "lineNumber": 90 }, "deprecated": false }, @@ -2364,7 +2408,7 @@ ], "source": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 82 + "lineNumber": 91 }, "deprecated": false }, @@ -2380,7 +2424,7 @@ ], "source": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 83 + "lineNumber": 92 }, "deprecated": false }, @@ -2396,7 +2440,7 @@ ], "source": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 84 + "lineNumber": 93 }, "deprecated": false } @@ -3006,7 +3050,11 @@ "section": "def-public.AlertTypeModel", "text": "AlertTypeModel" }, - " & { format: Formatter; }) => void; getFormatter: (typeId: string) => Formatter | undefined; }" + " & { format: ", + "Formatter", + "; }) => void; getFormatter: (typeId: string) => ", + "Formatter", + " | undefined; }" ], "source": { "path": "x-pack/plugins/observability/public/rules/create_observability_rule_type_registry.ts", @@ -3046,7 +3094,9 @@ "DisambiguateSet", ", \"children\" | \"type\" | \"onClick\" | \"onChange\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"download\" | \"media\" | \"target\" | \"ping\" | \"hrefLang\" | \"rel\" | \"referrerPolicy\">, React.ButtonHTMLAttributes> & React.ButtonHTMLAttributes)> & ", "DisambiguateSet", - ", \"children\" | \"type\" | \"onClick\" | \"onChange\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"download\" | \"media\" | \"target\" | \"ping\" | \"hrefLang\" | \"rel\" | \"referrerPolicy\">, React.ButtonHTMLAttributes> & React.ButtonHTMLAttributes), \"children\" | \"type\" | \"onChange\" | \"onKeyDown\" | \"title\" | \"id\" | \"name\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"download\" | \"autoFocus\" | \"disabled\" | \"form\" | \"formAction\" | \"formEncType\" | \"formMethod\" | \"formNoValidate\" | \"formTarget\" | \"value\" | \"media\" | \"ping\" | \"hrefLang\" | \"referrerPolicy\"> & { size?: \"m\" | \"s\" | \"l\" | \"xs\" | undefined; color?: \"text\" | \"primary\" | \"inherit\" | \"ghost\" | \"subdued\" | undefined; label: React.ReactNode; isActive?: boolean | undefined; isDisabled?: boolean | undefined; href?: string | undefined; target?: string | undefined; rel?: string | undefined; iconType?: string | React.ComponentClass<{}, any> | React.FunctionComponent<{}> | undefined; icon?: React.ReactElement React.ReactElement React.Component)> | null) | (new (props: any) => React.Component)> | undefined; showToolTip?: boolean | undefined; extraAction?: ({ type?: \"reset\" | \"button\" | \"submit\" | undefined; } & ", + ", \"children\" | \"type\" | \"onClick\" | \"onChange\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"download\" | \"media\" | \"target\" | \"ping\" | \"hrefLang\" | \"rel\" | \"referrerPolicy\">, React.ButtonHTMLAttributes> & React.ButtonHTMLAttributes), \"children\" | \"type\" | \"onChange\" | \"onKeyDown\" | \"title\" | \"id\" | \"name\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"download\" | \"autoFocus\" | \"disabled\" | \"form\" | \"formAction\" | \"formEncType\" | \"formMethod\" | \"formNoValidate\" | \"formTarget\" | \"value\" | \"media\" | \"ping\" | \"hrefLang\" | \"referrerPolicy\"> & { size?: \"m\" | \"s\" | \"l\" | \"xs\" | undefined; color?: \"text\" | \"primary\" | \"inherit\" | \"ghost\" | \"subdued\" | undefined; label: React.ReactNode; isActive?: boolean | undefined; isDisabled?: boolean | undefined; href?: string | undefined; target?: string | undefined; rel?: string | undefined; iconType?: string | React.ComponentClass<{}, any> | React.FunctionComponent<{}> | undefined; iconProps?: Pick<", + "EuiIconProps", + ", \"string\" | \"children\" | \"from\" | \"origin\" | \"onClick\" | \"onChange\" | \"color\" | \"onKeyDown\" | \"y\" | \"d\" | \"x\" | \"title\" | \"id\" | \"operator\" | \"name\" | \"version\" | \"filter\" | \"size\" | \"format\" | \"order\" | \"className\" | \"lang\" | \"style\" | \"tabIndex\" | \"role\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"scale\" | \"height\" | \"max\" | \"media\" | \"method\" | \"min\" | \"target\" | \"width\" | \"crossOrigin\" | \"accentHeight\" | \"accumulate\" | \"additive\" | \"alignmentBaseline\" | \"allowReorder\" | \"alphabetic\" | \"amplitude\" | \"arabicForm\" | \"ascent\" | \"attributeName\" | \"attributeType\" | \"autoReverse\" | \"azimuth\" | \"baseFrequency\" | \"baselineShift\" | \"baseProfile\" | \"bbox\" | \"begin\" | \"bias\" | \"by\" | \"calcMode\" | \"capHeight\" | \"clip\" | \"clipPath\" | \"clipPathUnits\" | \"clipRule\" | \"colorInterpolation\" | \"colorInterpolationFilters\" | \"colorProfile\" | \"colorRendering\" | \"contentScriptType\" | \"contentStyleType\" | \"cursor\" | \"cx\" | \"cy\" | \"decelerate\" | \"descent\" | \"diffuseConstant\" | \"direction\" | \"display\" | \"divisor\" | \"dominantBaseline\" | \"dur\" | \"dx\" | \"dy\" | \"edgeMode\" | \"elevation\" | \"enableBackground\" | \"end\" | \"exponent\" | \"externalResourcesRequired\" | \"fill\" | \"fillOpacity\" | \"fillRule\" | \"filterRes\" | \"filterUnits\" | \"floodColor\" | \"floodOpacity\" | \"focusable\" | \"fontFamily\" | \"fontSize\" | \"fontSizeAdjust\" | \"fontStretch\" | \"fontStyle\" | \"fontVariant\" | \"fontWeight\" | \"fx\" | \"fy\" | \"g1\" | \"g2\" | \"glyphName\" | \"glyphOrientationHorizontal\" | \"glyphOrientationVertical\" | \"glyphRef\" | \"gradientTransform\" | \"gradientUnits\" | \"hanging\" | \"horizAdvX\" | \"horizOriginX\" | \"href\" | \"ideographic\" | \"imageRendering\" | \"in2\" | \"in\" | \"intercept\" | \"k1\" | \"k2\" | \"k3\" | \"k4\" | \"k\" | \"kernelMatrix\" | \"kernelUnitLength\" | \"kerning\" | \"keyPoints\" | \"keySplines\" | \"keyTimes\" | \"lengthAdjust\" | \"letterSpacing\" | \"lightingColor\" | \"limitingConeAngle\" | \"local\" | \"markerEnd\" | \"markerHeight\" | \"markerMid\" | \"markerStart\" | \"markerUnits\" | \"markerWidth\" | \"mask\" | \"maskContentUnits\" | \"maskUnits\" | \"mathematical\" | \"mode\" | \"numOctaves\" | \"offset\" | \"opacity\" | \"orient\" | \"orientation\" | \"overflow\" | \"overlinePosition\" | \"overlineThickness\" | \"paintOrder\" | \"panose1\" | \"path\" | \"pathLength\" | \"patternContentUnits\" | \"patternTransform\" | \"patternUnits\" | \"pointerEvents\" | \"points\" | \"pointsAtX\" | \"pointsAtY\" | \"pointsAtZ\" | \"preserveAlpha\" | \"preserveAspectRatio\" | \"primitiveUnits\" | \"r\" | \"radius\" | \"refX\" | \"refY\" | \"renderingIntent\" | \"repeatCount\" | \"repeatDur\" | \"requiredExtensions\" | \"requiredFeatures\" | \"restart\" | \"result\" | \"rotate\" | \"rx\" | \"ry\" | \"seed\" | \"shapeRendering\" | \"slope\" | \"spacing\" | \"specularConstant\" | \"specularExponent\" | \"speed\" | \"spreadMethod\" | \"startOffset\" | \"stdDeviation\" | \"stemh\" | \"stemv\" | \"stitchTiles\" | \"stopColor\" | \"stopOpacity\" | \"strikethroughPosition\" | \"strikethroughThickness\" | \"stroke\" | \"strokeDasharray\" | \"strokeDashoffset\" | \"strokeLinecap\" | \"strokeLinejoin\" | \"strokeMiterlimit\" | \"strokeOpacity\" | \"strokeWidth\" | \"surfaceScale\" | \"systemLanguage\" | \"tableValues\" | \"targetX\" | \"targetY\" | \"textAnchor\" | \"textDecoration\" | \"textLength\" | \"textRendering\" | \"to\" | \"transform\" | \"u1\" | \"u2\" | \"underlinePosition\" | \"underlineThickness\" | \"unicode\" | \"unicodeBidi\" | \"unicodeRange\" | \"unitsPerEm\" | \"vAlphabetic\" | \"values\" | \"vectorEffect\" | \"vertAdvY\" | \"vertOriginX\" | \"vertOriginY\" | \"vHanging\" | \"vIdeographic\" | \"viewBox\" | \"viewTarget\" | \"visibility\" | \"vMathematical\" | \"widths\" | \"wordSpacing\" | \"writingMode\" | \"x1\" | \"x2\" | \"xChannelSelector\" | \"xHeight\" | \"xlinkActuate\" | \"xlinkArcrole\" | \"xlinkHref\" | \"xlinkRole\" | \"xlinkShow\" | \"xlinkTitle\" | \"xlinkType\" | \"xmlBase\" | \"xmlLang\" | \"xmlns\" | \"xmlnsXlink\" | \"xmlSpace\" | \"y1\" | \"y2\" | \"yChannelSelector\" | \"z\" | \"zoomAndPan\" | \"titleId\" | \"onIconLoad\"> | undefined; icon?: React.ReactElement React.ReactElement React.Component)> | null) | (new (props: any) => React.Component)> | undefined; showToolTip?: boolean | undefined; extraAction?: ({ type?: \"reset\" | \"button\" | \"submit\" | undefined; } & ", "EuiButtonIconProps", " & { onClick?: ((event: React.MouseEvent) => void) | undefined; } & React.ButtonHTMLAttributes & { buttonRef?: ((instance: HTMLButtonElement | null) => void) | React.RefObject | null | undefined; } & { alwaysShow?: boolean | undefined; }) | undefined; onClick?: ((event: React.MouseEvent) => void) | undefined; wrapText?: boolean | undefined; buttonRef?: ((instance: HTMLButtonElement | null) => void) | React.RefObject | null | undefined; }" ], @@ -3142,7 +3192,11 @@ "section": "def-public.AlertTypeModel", "text": "AlertTypeModel" }, - " & { format: Formatter; }) => void; getFormatter: (typeId: string) => Formatter | undefined; }; isAlertingExperienceEnabled: () => boolean; navigation: { registerSections: (sections$: ", + " & { format: ", + "Formatter", + "; }) => void; getFormatter: (typeId: string) => ", + "Formatter", + " | undefined; }; isAlertingExperienceEnabled: () => boolean; navigation: { registerSections: (sections$: ", "Observable", "<", "NavigationSection", @@ -3328,46 +3382,50 @@ "description": [], "signature": [ "(", - "TypeMapping", + "MappingTypeMapping", " & { all_field?: ", - "AllField", - " | undefined; date_detection?: boolean | undefined; dynamic?: boolean | \"strict\" | undefined; dynamic_date_formats?: string[] | undefined; dynamic_templates?: Record | Record[] | undefined; field_names_field?: ", - "FieldNamesField", + "MappingFieldNamesField", " | undefined; index_field?: ", - "IndexField", + "MappingIndexField", " | undefined; meta?: Record | undefined; numeric_detection?: boolean | undefined; properties?: Record | undefined; routing_field?: ", - "RoutingField", + "MappingRoutingField", " | undefined; size_field?: ", - "SizeField", + "MappingSizeField", " | undefined; source_field?: ", - "SourceField", - " | undefined; }) | (Record | undefined; }) | (Record & { all_field?: ", - "AllField", - " | undefined; date_detection?: boolean | undefined; dynamic?: boolean | \"strict\" | undefined; dynamic_date_formats?: string[] | undefined; dynamic_templates?: Record | Record[] | undefined; field_names_field?: ", - "FieldNamesField", + "MappingFieldNamesField", " | undefined; index_field?: ", - "IndexField", + "MappingIndexField", " | undefined; meta?: Record | undefined; numeric_detection?: boolean | undefined; properties?: Record | undefined; routing_field?: ", - "RoutingField", + "MappingRoutingField", " | undefined; size_field?: ", - "SizeField", + "MappingSizeField", " | undefined; source_field?: ", - "SourceField", - " | undefined; })" + "MappingSourceField", + " | undefined; runtime?: Record | undefined; })" ], "source": { "path": "x-pack/plugins/observability/server/utils/create_or_update_index.ts", @@ -3385,7 +3443,7 @@ "signature": [ "Pick<", "KibanaClient", - ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"helpers\" | \"count\" | \"search\" | \"security\" | \"eql\" | \"on\" | \"off\" | \"transform\" | \"emit\" | \"once\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", + ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"helpers\" | \"count\" | \"search\" | \"security\" | \"eql\" | \"on\" | \"off\" | \"transform\" | \"emit\" | \"once\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", "TransportRequestParams", ", options?: ", "TransportRequestOptions", @@ -3432,12 +3490,12 @@ "description": [], "signature": [ "(kql: string | undefined) => ", - "QueryContainer", + "QueryDslQueryContainer", "[]" ], "source": { "path": "x-pack/plugins/observability/server/utils/queries.ts", - "lineNumber": 35 + "lineNumber": 39 }, "deprecated": false, "children": [ @@ -3453,7 +3511,7 @@ ], "source": { "path": "x-pack/plugins/observability/server/utils/queries.ts", - "lineNumber": 35 + "lineNumber": 39 }, "deprecated": false, "isRequired": false @@ -3471,7 +3529,7 @@ "description": [], "signature": [ "(start: number | undefined, end: number | undefined, field: string) => ", - "QueryContainer", + "QueryDslQueryContainer", "[]" ], "source": { @@ -3492,7 +3550,7 @@ ], "source": { "path": "x-pack/plugins/observability/server/utils/queries.ts", - "lineNumber": 21 + "lineNumber": 22 }, "deprecated": false, "isRequired": false @@ -3509,7 +3567,7 @@ ], "source": { "path": "x-pack/plugins/observability/server/utils/queries.ts", - "lineNumber": 21 + "lineNumber": 23 }, "deprecated": false, "isRequired": false @@ -3526,7 +3584,7 @@ ], "source": { "path": "x-pack/plugins/observability/server/utils/queries.ts", - "lineNumber": 21 + "lineNumber": 24 }, "deprecated": false, "isRequired": true @@ -3799,46 +3857,50 @@ "description": [], "signature": [ "(", - "TypeMapping", + "MappingTypeMapping", " & { all_field?: ", - "AllField", - " | undefined; date_detection?: boolean | undefined; dynamic?: boolean | \"strict\" | undefined; dynamic_date_formats?: string[] | undefined; dynamic_templates?: Record | Record[] | undefined; field_names_field?: ", - "FieldNamesField", + "MappingFieldNamesField", " | undefined; index_field?: ", - "IndexField", + "MappingIndexField", " | undefined; meta?: Record | undefined; numeric_detection?: boolean | undefined; properties?: Record | undefined; routing_field?: ", - "RoutingField", + "MappingRoutingField", " | undefined; size_field?: ", - "SizeField", + "MappingSizeField", " | undefined; source_field?: ", - "SourceField", - " | undefined; }) | (Record | undefined; }) | (Record & { all_field?: ", - "AllField", - " | undefined; date_detection?: boolean | undefined; dynamic?: boolean | \"strict\" | undefined; dynamic_date_formats?: string[] | undefined; dynamic_templates?: Record | Record[] | undefined; field_names_field?: ", - "FieldNamesField", + "MappingFieldNamesField", " | undefined; index_field?: ", - "IndexField", + "MappingIndexField", " | undefined; meta?: Record | undefined; numeric_detection?: boolean | undefined; properties?: Record | undefined; routing_field?: ", - "RoutingField", + "MappingRoutingField", " | undefined; size_field?: ", - "SizeField", + "MappingSizeField", " | undefined; source_field?: ", - "SourceField", - " | undefined; })" + "MappingSourceField", + " | undefined; runtime?: Record | undefined; })" ], "source": { "path": "x-pack/plugins/observability/server/utils/create_or_update_index.ts", diff --git a/api_docs/observability.mdx b/api_docs/observability.mdx index 353e65b0fa0808..6787e3f0238c87 100644 --- a/api_docs/observability.mdx +++ b/api_docs/observability.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import observabilityObj from './observability.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 194 | 0 | 194 | 10 | + ## Client ### Setup diff --git a/api_docs/osquery.mdx b/api_docs/osquery.mdx index 8638e916107a4a..a981f8f4b8c658 100644 --- a/api_docs/osquery.mdx +++ b/api_docs/osquery.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import osqueryObj from './osquery.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 10 | 0 | 10 | 0 | + ## Client ### Setup diff --git a/api_docs/presentation_util.mdx b/api_docs/presentation_util.mdx index 9416a74b8f42c1..3df30c54e4390b 100644 --- a/api_docs/presentation_util.mdx +++ b/api_docs/presentation_util.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import presentationUtilObj from './presentation_util.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 125 | 1 | 121 | 3 | + ## Client ### Setup diff --git a/api_docs/remote_clusters.mdx b/api_docs/remote_clusters.mdx index a669a858ba6be1..166aeee82153e1 100644 --- a/api_docs/remote_clusters.mdx +++ b/api_docs/remote_clusters.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import remoteClustersObj from './remote_clusters.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 4 | 0 | 4 | 0 | + ## Client ### Setup diff --git a/api_docs/reporting.mdx b/api_docs/reporting.mdx index 445d38e4ec71b8..f349b223ddf97c 100644 --- a/api_docs/reporting.mdx +++ b/api_docs/reporting.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import reportingObj from './reporting.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 133 | 1 | 132 | 19 | + ## Client ### Start diff --git a/api_docs/rollup.mdx b/api_docs/rollup.mdx index 3216c8cd968952..7a7765dfe1584a 100644 --- a/api_docs/rollup.mdx +++ b/api_docs/rollup.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import rollupObj from './rollup.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 20 | 0 | 20 | 0 | + ## Common ### Objects diff --git a/api_docs/rule_registry.json b/api_docs/rule_registry.json index cd1f4994c1da61..f114f1bf227516 100644 --- a/api_docs/rule_registry.json +++ b/api_docs/rule_registry.json @@ -342,6 +342,115 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "ruleRegistry", + "id": "def-server.createPersistenceRuleTypeFactory", + "type": "Function", + "tags": [], + "label": "createPersistenceRuleTypeFactory", + "description": [], + "signature": [ + "({ logger, ruleDataClient, }: { ruleDataClient: ", + { + "pluginId": "ruleRegistry", + "scope": "server", + "docId": "kibRuleRegistryPluginApi", + "section": "def-server.RuleDataClient", + "text": "RuleDataClient" + }, + "; logger: ", + "Logger", + "; }) => , TAlertInstanceContext extends { [x: string]: unknown; }, TServices extends { alertWithPersistence: PersistenceAlertService; findAlerts: PersistenceAlertQueryService; }>(type: ", + "AlertTypeWithExecutor", + ") => { executor: (options: ", + { + "pluginId": "alerting", + "scope": "server", + "docId": "kibAlertingPluginApi", + "section": "def-server.AlertExecutorOptions", + "text": "AlertExecutorOptions" + }, + ", { [x: string]: unknown; }, TAlertInstanceContext, never> & { services: any; }) => Promise; id: string; name: string; validate?: { params?: ", + "AlertTypeParamsValidator", + " | undefined; } | undefined; actionGroups: ", + { + "pluginId": "alerting", + "scope": "common", + "docId": "kibAlertingPluginApi", + "section": "def-common.ActionGroup", + "text": "ActionGroup" + }, + "[]; defaultActionGroupId: string; recoveryActionGroup?: ", + { + "pluginId": "alerting", + "scope": "common", + "docId": "kibAlertingPluginApi", + "section": "def-common.ActionGroup", + "text": "ActionGroup" + }, + " | undefined; producer: string; actionVariables?: { context?: ", + { + "pluginId": "alerting", + "scope": "common", + "docId": "kibAlertingPluginApi", + "section": "def-common.ActionVariable", + "text": "ActionVariable" + }, + "[] | undefined; state?: ", + { + "pluginId": "alerting", + "scope": "common", + "docId": "kibAlertingPluginApi", + "section": "def-common.ActionVariable", + "text": "ActionVariable" + }, + "[] | undefined; params?: ", + { + "pluginId": "alerting", + "scope": "common", + "docId": "kibAlertingPluginApi", + "section": "def-common.ActionVariable", + "text": "ActionVariable" + }, + "[] | undefined; } | undefined; minimumLicenseRequired: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\"; }" + ], + "source": { + "path": "x-pack/plugins/rule_registry/server/utils/create_persistence_rule_type_factory.ts", + "lineNumber": 42 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "ruleRegistry", + "id": "def-server.createPersistenceRuleTypeFactory.$1", + "type": "Object", + "tags": [], + "label": "{\n logger,\n ruleDataClient,\n}", + "description": [], + "signature": [ + "{ ruleDataClient: ", + { + "pluginId": "ruleRegistry", + "scope": "server", + "docId": "kibRuleRegistryPluginApi", + "section": "def-server.RuleDataClient", + "text": "RuleDataClient" + }, + "; logger: ", + "Logger", + "; }" + ], + "source": { + "path": "x-pack/plugins/rule_registry/server/utils/create_persistence_rule_type_factory.ts", + "lineNumber": 42 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "ruleRegistry", "id": "def-server.getRuleExecutorData", @@ -784,7 +893,7 @@ "signature": [ "(input: unknown) => OutputOf<", "Optional", - "<{ readonly \"kibana.rac.alert.producer\": { readonly type: \"keyword\"; }; readonly \"kibana.rac.alert.uuid\": { readonly type: \"keyword\"; }; readonly \"kibana.rac.alert.id\": { readonly type: \"keyword\"; }; readonly \"kibana.rac.alert.start\": { readonly type: \"date\"; }; readonly \"kibana.rac.alert.end\": { readonly type: \"date\"; }; readonly \"kibana.rac.alert.duration.us\": { readonly type: \"long\"; }; readonly \"kibana.rac.alert.severity.level\": { readonly type: \"keyword\"; }; readonly \"kibana.rac.alert.severity.value\": { readonly type: \"long\"; }; readonly \"kibana.rac.alert.status\": { readonly type: \"keyword\"; }; readonly \"kibana.rac.alert.evaluation.threshold\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.rac.alert.evaluation.value\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly '@timestamp': { readonly type: \"date\"; readonly array: false; readonly required: true; }; readonly tags: { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly 'event.kind': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'event.action': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'rule.uuid': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'rule.id': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'rule.name': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'rule.category': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; }, \"tags\" | \"kibana.rac.alert.uuid\" | \"event.kind\" | \"event.action\" | \"rule.uuid\" | \"rule.id\" | \"rule.name\" | \"rule.category\" | \"kibana.rac.alert.producer\" | \"kibana.rac.alert.id\" | \"kibana.rac.alert.start\" | \"kibana.rac.alert.end\" | \"kibana.rac.alert.duration.us\" | \"kibana.rac.alert.severity.level\" | \"kibana.rac.alert.severity.value\" | \"kibana.rac.alert.status\" | \"kibana.rac.alert.evaluation.threshold\" | \"kibana.rac.alert.evaluation.value\">>" + "<{ readonly \"kibana.rac.alert.producer\": { readonly type: \"keyword\"; }; readonly \"kibana.rac.alert.uuid\": { readonly type: \"keyword\"; }; readonly \"kibana.rac.alert.id\": { readonly type: \"keyword\"; }; readonly \"kibana.rac.alert.start\": { readonly type: \"date\"; }; readonly \"kibana.rac.alert.end\": { readonly type: \"date\"; }; readonly \"kibana.rac.alert.duration.us\": { readonly type: \"long\"; }; readonly \"kibana.rac.alert.severity.level\": { readonly type: \"keyword\"; }; readonly \"kibana.rac.alert.severity.value\": { readonly type: \"long\"; }; readonly \"kibana.rac.alert.status\": { readonly type: \"keyword\"; }; readonly \"kibana.rac.alert.evaluation.threshold\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.rac.alert.evaluation.value\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly tags: { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly '@timestamp': { readonly type: \"date\"; readonly array: false; readonly required: true; }; readonly 'event.kind': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'event.action': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'rule.uuid': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'rule.id': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'rule.name': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'rule.category': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; }, \"tags\" | \"kibana.rac.alert.uuid\" | \"event.kind\" | \"event.action\" | \"rule.uuid\" | \"rule.id\" | \"rule.name\" | \"rule.category\" | \"kibana.rac.alert.producer\" | \"kibana.rac.alert.id\" | \"kibana.rac.alert.start\" | \"kibana.rac.alert.end\" | \"kibana.rac.alert.duration.us\" | \"kibana.rac.alert.severity.level\" | \"kibana.rac.alert.severity.value\" | \"kibana.rac.alert.status\" | \"kibana.rac.alert.evaluation.threshold\" | \"kibana.rac.alert.evaluation.value\">>" ], "source": { "path": "x-pack/plugins/rule_registry/common/parse_technical_fields.ts", diff --git a/api_docs/rule_registry.mdx b/api_docs/rule_registry.mdx index 964d29594d3c66..a0171607e8eebd 100644 --- a/api_docs/rule_registry.mdx +++ b/api_docs/rule_registry.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import ruleRegistryObj from './rule_registry.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 43 | 0 | 43 | 6 | + ## Server ### Setup diff --git a/api_docs/runtime_fields.mdx b/api_docs/runtime_fields.mdx index a1d1b548350eec..2b9585f558ad5a 100644 --- a/api_docs/runtime_fields.mdx +++ b/api_docs/runtime_fields.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import runtimeFieldsObj from './runtime_fields.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 24 | 0 | 19 | 2 | + ## Client ### Setup diff --git a/api_docs/saved_objects.json b/api_docs/saved_objects.json index 48579ca8e589e0..6af18c749db67c 100644 --- a/api_docs/saved_objects.json +++ b/api_docs/saved_objects.json @@ -781,15 +781,15 @@ { "plugin": "dashboard", "link": { - "path": "src/plugins/dashboard/public/application/types.ts", - "lineNumber": 25 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 33 } }, { "plugin": "dashboard", "link": { - "path": "src/plugins/dashboard/public/application/types.ts", - "lineNumber": 74 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 186 } }, { @@ -803,7 +803,7 @@ "plugin": "dashboard", "link": { "path": "src/plugins/dashboard/public/plugin.tsx", - "lineNumber": 126 + "lineNumber": 127 } }, { @@ -1383,20 +1383,20 @@ "plugin": "embeddable", "link": { "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx", - "lineNumber": 167 + "lineNumber": 165 } }, { "plugin": "discover", "link": { - "path": "src/plugins/discover/public/application/components/top_nav/on_save_search.tsx", + "path": "src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx", "lineNumber": 11 } }, { "plugin": "discover", "link": { - "path": "src/plugins/discover/public/application/components/top_nav/on_save_search.tsx", + "path": "src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx", "lineNumber": 133 } }, @@ -2670,42 +2670,42 @@ "plugin": "dashboard", "link": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 18 + "lineNumber": 19 } }, { "plugin": "dashboard", "link": { - "path": "src/plugins/dashboard/public/application/actions/clone_panel_action.tsx", - "lineNumber": 14 + "path": "src/plugins/dashboard/public/application/lib/dashboard_tagging.ts", + "lineNumber": 10 } }, { "plugin": "dashboard", "link": { - "path": "src/plugins/dashboard/public/application/actions/clone_panel_action.tsx", - "lineNumber": 98 + "path": "src/plugins/dashboard/public/application/lib/dashboard_tagging.ts", + "lineNumber": 15 } }, { "plugin": "dashboard", "link": { "path": "src/plugins/dashboard/public/application/actions/clone_panel_action.tsx", - "lineNumber": 126 + "lineNumber": 14 } }, { "plugin": "dashboard", "link": { - "path": "src/plugins/dashboard/public/application/hooks/use_dashboard_state_manager.ts", - "lineNumber": 23 + "path": "src/plugins/dashboard/public/application/actions/clone_panel_action.tsx", + "lineNumber": 98 } }, { "plugin": "dashboard", "link": { - "path": "src/plugins/dashboard/public/application/hooks/use_dashboard_state_manager.ts", - "lineNumber": 35 + "path": "src/plugins/dashboard/public/application/actions/clone_panel_action.tsx", + "lineNumber": 126 } }, { @@ -4337,7 +4337,7 @@ "plugin": "dashboard", "link": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 41 + "lineNumber": 42 } } ] @@ -4364,14 +4364,14 @@ "plugin": "dashboard", "link": { "path": "src/plugins/dashboard/public/application/listing/dashboard_listing.tsx", - "lineNumber": 87 + "lineNumber": 92 } }, { "plugin": "dashboard", "link": { "path": "src/plugins/dashboard/public/application/listing/dashboard_listing.tsx", - "lineNumber": 172 + "lineNumber": 177 } }, { diff --git a/api_docs/saved_objects.mdx b/api_docs/saved_objects.mdx index 01d7f9fce991fc..66579c3e3b0ca7 100644 --- a/api_docs/saved_objects.mdx +++ b/api_docs/saved_objects.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import savedObjectsObj from './saved_objects.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 211 | 3 | 197 | 5 | + ## Client ### Setup diff --git a/api_docs/saved_objects_management.json b/api_docs/saved_objects_management.json index 5d95b713715fa6..8e8e7850261a34 100644 --- a/api_docs/saved_objects_management.json +++ b/api_docs/saved_objects_management.json @@ -987,7 +987,7 @@ "label": "euiColumn", "description": [], "signature": [ - "{ children?: React.ReactNode; headers?: string | undefined; onClick?: ((event: React.MouseEvent) => void) | undefined; onChange?: ((event: React.FormEvent) => void) | undefined; color?: string | undefined; onKeyDown?: ((event: React.KeyboardEvent) => void) | undefined; description?: string | undefined; title?: string | undefined; id?: string | undefined; name: React.ReactNode; field: string; defaultChecked?: boolean | undefined; defaultValue?: string | number | string[] | undefined; suppressContentEditableWarning?: boolean | undefined; suppressHydrationWarning?: boolean | undefined; accessKey?: string | undefined; className?: string | undefined; contentEditable?: boolean | \"true\" | \"false\" | \"inherit\" | undefined; contextMenu?: string | undefined; dir?: string | undefined; draggable?: boolean | \"true\" | \"false\" | undefined; hidden?: boolean | undefined; lang?: string | undefined; placeholder?: string | undefined; slot?: string | undefined; spellCheck?: boolean | \"true\" | \"false\" | undefined; style?: React.CSSProperties | undefined; tabIndex?: number | undefined; translate?: \"yes\" | \"no\" | undefined; radioGroup?: string | undefined; role?: string | undefined; about?: string | undefined; datatype?: string | undefined; inlist?: any; prefix?: string | undefined; property?: string | undefined; resource?: string | undefined; typeof?: string | undefined; vocab?: string | undefined; autoCapitalize?: string | undefined; autoCorrect?: string | undefined; autoSave?: string | undefined; itemProp?: string | undefined; itemScope?: boolean | undefined; itemType?: string | undefined; itemID?: string | undefined; itemRef?: string | undefined; results?: number | undefined; security?: string | undefined; unselectable?: \"on\" | \"off\" | undefined; inputMode?: \"text\" | \"none\" | \"search\" | \"email\" | \"tel\" | \"url\" | \"numeric\" | \"decimal\" | undefined; is?: string | undefined; 'aria-activedescendant'?: string | undefined; 'aria-atomic'?: boolean | \"true\" | \"false\" | undefined; 'aria-autocomplete'?: \"none\" | \"list\" | \"inline\" | \"both\" | undefined; 'aria-busy'?: boolean | \"true\" | \"false\" | undefined; 'aria-checked'?: boolean | \"mixed\" | \"true\" | \"false\" | undefined; 'aria-colcount'?: number | undefined; 'aria-colindex'?: number | undefined; 'aria-colspan'?: number | undefined; 'aria-controls'?: string | undefined; 'aria-current'?: boolean | \"date\" | \"location\" | \"page\" | \"true\" | \"false\" | \"step\" | \"time\" | undefined; 'aria-describedby'?: string | undefined; 'aria-details'?: string | undefined; 'aria-disabled'?: boolean | \"true\" | \"false\" | undefined; 'aria-dropeffect'?: \"none\" | \"copy\" | \"link\" | \"execute\" | \"move\" | \"popup\" | undefined; 'aria-errormessage'?: string | undefined; 'aria-expanded'?: boolean | \"true\" | \"false\" | undefined; 'aria-flowto'?: string | undefined; 'aria-grabbed'?: boolean | \"true\" | \"false\" | undefined; 'aria-haspopup'?: boolean | \"grid\" | \"menu\" | \"true\" | \"false\" | \"listbox\" | \"tree\" | \"dialog\" | undefined; 'aria-hidden'?: boolean | \"true\" | \"false\" | undefined; 'aria-invalid'?: boolean | \"true\" | \"false\" | \"grammar\" | \"spelling\" | undefined; 'aria-keyshortcuts'?: string | undefined; 'aria-label'?: string | undefined; 'aria-labelledby'?: string | undefined; 'aria-level'?: number | undefined; 'aria-live'?: \"off\" | \"assertive\" | \"polite\" | undefined; 'aria-modal'?: boolean | \"true\" | \"false\" | undefined; 'aria-multiline'?: boolean | \"true\" | \"false\" | undefined; 'aria-multiselectable'?: boolean | \"true\" | \"false\" | undefined; 'aria-orientation'?: \"horizontal\" | \"vertical\" | undefined; 'aria-owns'?: string | undefined; 'aria-placeholder'?: string | undefined; 'aria-posinset'?: number | undefined; 'aria-pressed'?: boolean | \"mixed\" | \"true\" | \"false\" | undefined; 'aria-readonly'?: boolean | \"true\" | \"false\" | undefined; 'aria-relevant'?: \"text\" | \"additions\" | \"additions text\" | \"all\" | \"removals\" | undefined; 'aria-required'?: boolean | \"true\" | \"false\" | undefined; 'aria-roledescription'?: string | undefined; 'aria-rowcount'?: number | undefined; 'aria-rowindex'?: number | undefined; 'aria-rowspan'?: number | undefined; 'aria-selected'?: boolean | \"true\" | \"false\" | undefined; 'aria-setsize'?: number | undefined; 'aria-sort'?: \"none\" | \"ascending\" | \"descending\" | \"other\" | undefined; 'aria-valuemax'?: number | undefined; 'aria-valuemin'?: number | undefined; 'aria-valuenow'?: number | undefined; 'aria-valuetext'?: string | undefined; dangerouslySetInnerHTML?: { __html: string; } | undefined; onCopy?: ((event: React.ClipboardEvent) => void) | undefined; onCopyCapture?: ((event: React.ClipboardEvent) => void) | undefined; onCut?: ((event: React.ClipboardEvent) => void) | undefined; onCutCapture?: ((event: React.ClipboardEvent) => void) | undefined; onPaste?: ((event: React.ClipboardEvent) => void) | undefined; onPasteCapture?: ((event: React.ClipboardEvent) => void) | undefined; onCompositionEnd?: ((event: React.CompositionEvent) => void) | undefined; onCompositionEndCapture?: ((event: React.CompositionEvent) => void) | undefined; onCompositionStart?: ((event: React.CompositionEvent) => void) | undefined; onCompositionStartCapture?: ((event: React.CompositionEvent) => void) | undefined; onCompositionUpdate?: ((event: React.CompositionEvent) => void) | undefined; onCompositionUpdateCapture?: ((event: React.CompositionEvent) => void) | undefined; onFocus?: ((event: React.FocusEvent) => void) | undefined; onFocusCapture?: ((event: React.FocusEvent) => void) | undefined; onBlur?: ((event: React.FocusEvent) => void) | undefined; onBlurCapture?: ((event: React.FocusEvent) => void) | undefined; onChangeCapture?: ((event: React.FormEvent) => void) | undefined; onBeforeInput?: ((event: React.FormEvent) => void) | undefined; onBeforeInputCapture?: ((event: React.FormEvent) => void) | undefined; onInput?: ((event: React.FormEvent) => void) | undefined; onInputCapture?: ((event: React.FormEvent) => void) | undefined; onReset?: ((event: React.FormEvent) => void) | undefined; onResetCapture?: ((event: React.FormEvent) => void) | undefined; onSubmit?: ((event: React.FormEvent) => void) | undefined; onSubmitCapture?: ((event: React.FormEvent) => void) | undefined; onInvalid?: ((event: React.FormEvent) => void) | undefined; onInvalidCapture?: ((event: React.FormEvent) => void) | undefined; onLoad?: ((event: React.SyntheticEvent) => void) | undefined; onLoadCapture?: ((event: React.SyntheticEvent) => void) | undefined; onError?: ((event: React.SyntheticEvent) => void) | undefined; onErrorCapture?: ((event: React.SyntheticEvent) => void) | undefined; onKeyDownCapture?: ((event: React.KeyboardEvent) => void) | undefined; onKeyPress?: ((event: React.KeyboardEvent) => void) | undefined; onKeyPressCapture?: ((event: React.KeyboardEvent) => void) | undefined; onKeyUp?: ((event: React.KeyboardEvent) => void) | undefined; onKeyUpCapture?: ((event: React.KeyboardEvent) => void) | undefined; onAbort?: ((event: React.SyntheticEvent) => void) | undefined; onAbortCapture?: ((event: React.SyntheticEvent) => void) | undefined; onCanPlay?: ((event: React.SyntheticEvent) => void) | undefined; onCanPlayCapture?: ((event: React.SyntheticEvent) => void) | undefined; onCanPlayThrough?: ((event: React.SyntheticEvent) => void) | undefined; onCanPlayThroughCapture?: ((event: React.SyntheticEvent) => void) | undefined; onDurationChange?: ((event: React.SyntheticEvent) => void) | undefined; onDurationChangeCapture?: ((event: React.SyntheticEvent) => void) | undefined; onEmptied?: ((event: React.SyntheticEvent) => void) | undefined; onEmptiedCapture?: ((event: React.SyntheticEvent) => void) | undefined; onEncrypted?: ((event: React.SyntheticEvent) => void) | undefined; onEncryptedCapture?: ((event: React.SyntheticEvent) => void) | undefined; onEnded?: ((event: React.SyntheticEvent) => void) | undefined; onEndedCapture?: ((event: React.SyntheticEvent) => void) | undefined; onLoadedData?: ((event: React.SyntheticEvent) => void) | undefined; onLoadedDataCapture?: ((event: React.SyntheticEvent) => void) | undefined; onLoadedMetadata?: ((event: React.SyntheticEvent) => void) | undefined; onLoadedMetadataCapture?: ((event: React.SyntheticEvent) => void) | undefined; onLoadStart?: ((event: React.SyntheticEvent) => void) | undefined; onLoadStartCapture?: ((event: React.SyntheticEvent) => void) | undefined; onPause?: ((event: React.SyntheticEvent) => void) | undefined; onPauseCapture?: ((event: React.SyntheticEvent) => void) | undefined; onPlay?: ((event: React.SyntheticEvent) => void) | undefined; onPlayCapture?: ((event: React.SyntheticEvent) => void) | undefined; onPlaying?: ((event: React.SyntheticEvent) => void) | undefined; onPlayingCapture?: ((event: React.SyntheticEvent) => void) | undefined; onProgress?: ((event: React.SyntheticEvent) => void) | undefined; onProgressCapture?: ((event: React.SyntheticEvent) => void) | undefined; onRateChange?: ((event: React.SyntheticEvent) => void) | undefined; onRateChangeCapture?: ((event: React.SyntheticEvent) => void) | undefined; onSeeked?: ((event: React.SyntheticEvent) => void) | undefined; onSeekedCapture?: ((event: React.SyntheticEvent) => void) | undefined; onSeeking?: ((event: React.SyntheticEvent) => void) | undefined; onSeekingCapture?: ((event: React.SyntheticEvent) => void) | undefined; onStalled?: ((event: React.SyntheticEvent) => void) | undefined; onStalledCapture?: ((event: React.SyntheticEvent) => void) | undefined; onSuspend?: ((event: React.SyntheticEvent) => void) | undefined; onSuspendCapture?: ((event: React.SyntheticEvent) => void) | undefined; onTimeUpdate?: ((event: React.SyntheticEvent) => void) | undefined; onTimeUpdateCapture?: ((event: React.SyntheticEvent) => void) | undefined; onVolumeChange?: ((event: React.SyntheticEvent) => void) | undefined; onVolumeChangeCapture?: ((event: React.SyntheticEvent) => void) | undefined; onWaiting?: ((event: React.SyntheticEvent) => void) | undefined; onWaitingCapture?: ((event: React.SyntheticEvent) => void) | undefined; onAuxClick?: ((event: React.MouseEvent) => void) | undefined; onAuxClickCapture?: ((event: React.MouseEvent) => void) | undefined; onClickCapture?: ((event: React.MouseEvent) => void) | undefined; onContextMenu?: ((event: React.MouseEvent) => void) | undefined; onContextMenuCapture?: ((event: React.MouseEvent) => void) | undefined; onDoubleClick?: ((event: React.MouseEvent) => void) | undefined; onDoubleClickCapture?: ((event: React.MouseEvent) => void) | undefined; onDrag?: ((event: React.DragEvent) => void) | undefined; onDragCapture?: ((event: React.DragEvent) => void) | undefined; onDragEnd?: ((event: React.DragEvent) => void) | undefined; onDragEndCapture?: ((event: React.DragEvent) => void) | undefined; onDragEnter?: ((event: React.DragEvent) => void) | undefined; onDragEnterCapture?: ((event: React.DragEvent) => void) | undefined; onDragExit?: ((event: React.DragEvent) => void) | undefined; onDragExitCapture?: ((event: React.DragEvent) => void) | undefined; onDragLeave?: ((event: React.DragEvent) => void) | undefined; onDragLeaveCapture?: ((event: React.DragEvent) => void) | undefined; onDragOver?: ((event: React.DragEvent) => void) | undefined; onDragOverCapture?: ((event: React.DragEvent) => void) | undefined; onDragStart?: ((event: React.DragEvent) => void) | undefined; onDragStartCapture?: ((event: React.DragEvent) => void) | undefined; onDrop?: ((event: React.DragEvent) => void) | undefined; onDropCapture?: ((event: React.DragEvent) => void) | undefined; onMouseDown?: ((event: React.MouseEvent) => void) | undefined; onMouseDownCapture?: ((event: React.MouseEvent) => void) | undefined; onMouseEnter?: ((event: React.MouseEvent) => void) | undefined; onMouseLeave?: ((event: React.MouseEvent) => void) | undefined; onMouseMove?: ((event: React.MouseEvent) => void) | undefined; onMouseMoveCapture?: ((event: React.MouseEvent) => void) | undefined; onMouseOut?: ((event: React.MouseEvent) => void) | undefined; onMouseOutCapture?: ((event: React.MouseEvent) => void) | undefined; onMouseOver?: ((event: React.MouseEvent) => void) | undefined; onMouseOverCapture?: ((event: React.MouseEvent) => void) | undefined; onMouseUp?: ((event: React.MouseEvent) => void) | undefined; onMouseUpCapture?: ((event: React.MouseEvent) => void) | undefined; onSelect?: ((event: React.SyntheticEvent) => void) | undefined; onSelectCapture?: ((event: React.SyntheticEvent) => void) | undefined; onTouchCancel?: ((event: React.TouchEvent) => void) | undefined; onTouchCancelCapture?: ((event: React.TouchEvent) => void) | undefined; onTouchEnd?: ((event: React.TouchEvent) => void) | undefined; onTouchEndCapture?: ((event: React.TouchEvent) => void) | undefined; onTouchMove?: ((event: React.TouchEvent) => void) | undefined; onTouchMoveCapture?: ((event: React.TouchEvent) => void) | undefined; onTouchStart?: ((event: React.TouchEvent) => void) | undefined; onTouchStartCapture?: ((event: React.TouchEvent) => void) | undefined; onPointerDown?: ((event: React.PointerEvent) => void) | undefined; onPointerDownCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerMove?: ((event: React.PointerEvent) => void) | undefined; onPointerMoveCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerUp?: ((event: React.PointerEvent) => void) | undefined; onPointerUpCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerCancel?: ((event: React.PointerEvent) => void) | undefined; onPointerCancelCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerEnter?: ((event: React.PointerEvent) => void) | undefined; onPointerEnterCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerLeave?: ((event: React.PointerEvent) => void) | undefined; onPointerLeaveCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerOver?: ((event: React.PointerEvent) => void) | undefined; onPointerOverCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerOut?: ((event: React.PointerEvent) => void) | undefined; onPointerOutCapture?: ((event: React.PointerEvent) => void) | undefined; onGotPointerCapture?: ((event: React.PointerEvent) => void) | undefined; onGotPointerCaptureCapture?: ((event: React.PointerEvent) => void) | undefined; onLostPointerCapture?: ((event: React.PointerEvent) => void) | undefined; onLostPointerCaptureCapture?: ((event: React.PointerEvent) => void) | undefined; onScroll?: ((event: React.UIEvent) => void) | undefined; onScrollCapture?: ((event: React.UIEvent) => void) | undefined; onWheel?: ((event: React.WheelEvent) => void) | undefined; onWheelCapture?: ((event: React.WheelEvent) => void) | undefined; onAnimationStart?: ((event: React.AnimationEvent) => void) | undefined; onAnimationStartCapture?: ((event: React.AnimationEvent) => void) | undefined; onAnimationEnd?: ((event: React.AnimationEvent) => void) | undefined; onAnimationEndCapture?: ((event: React.AnimationEvent) => void) | undefined; onAnimationIteration?: ((event: React.AnimationEvent) => void) | undefined; onAnimationIterationCapture?: ((event: React.AnimationEvent) => void) | undefined; onTransitionEnd?: ((event: React.TransitionEvent) => void) | undefined; onTransitionEndCapture?: ((event: React.TransitionEvent) => void) | undefined; css?: ", + "{ children?: React.ReactNode; headers?: string | undefined; onClick?: ((event: React.MouseEvent) => void) | undefined; onChange?: ((event: React.FormEvent) => void) | undefined; color?: string | undefined; onKeyDown?: ((event: React.KeyboardEvent) => void) | undefined; description?: string | undefined; title?: string | undefined; id?: string | undefined; name: React.ReactNode; field: string; defaultChecked?: boolean | undefined; defaultValue?: string | number | string[] | undefined; suppressContentEditableWarning?: boolean | undefined; suppressHydrationWarning?: boolean | undefined; accessKey?: string | undefined; className?: string | undefined; contentEditable?: boolean | \"true\" | \"false\" | \"inherit\" | undefined; contextMenu?: string | undefined; dir?: string | undefined; draggable?: boolean | \"true\" | \"false\" | undefined; hidden?: boolean | undefined; lang?: string | undefined; placeholder?: string | undefined; slot?: string | undefined; spellCheck?: boolean | \"true\" | \"false\" | undefined; style?: React.CSSProperties | undefined; tabIndex?: number | undefined; translate?: \"yes\" | \"no\" | undefined; radioGroup?: string | undefined; role?: string | undefined; about?: string | undefined; datatype?: string | undefined; inlist?: any; prefix?: string | undefined; property?: string | undefined; resource?: string | undefined; typeof?: string | undefined; vocab?: string | undefined; autoCapitalize?: string | undefined; autoCorrect?: string | undefined; autoSave?: string | undefined; itemProp?: string | undefined; itemScope?: boolean | undefined; itemType?: string | undefined; itemID?: string | undefined; itemRef?: string | undefined; results?: number | undefined; security?: string | undefined; unselectable?: \"on\" | \"off\" | undefined; inputMode?: \"none\" | \"text\" | \"search\" | \"email\" | \"tel\" | \"url\" | \"numeric\" | \"decimal\" | undefined; is?: string | undefined; 'aria-activedescendant'?: string | undefined; 'aria-atomic'?: boolean | \"true\" | \"false\" | undefined; 'aria-autocomplete'?: \"none\" | \"list\" | \"inline\" | \"both\" | undefined; 'aria-busy'?: boolean | \"true\" | \"false\" | undefined; 'aria-checked'?: boolean | \"mixed\" | \"true\" | \"false\" | undefined; 'aria-colcount'?: number | undefined; 'aria-colindex'?: number | undefined; 'aria-colspan'?: number | undefined; 'aria-controls'?: string | undefined; 'aria-current'?: boolean | \"date\" | \"location\" | \"page\" | \"true\" | \"false\" | \"step\" | \"time\" | undefined; 'aria-describedby'?: string | undefined; 'aria-details'?: string | undefined; 'aria-disabled'?: boolean | \"true\" | \"false\" | undefined; 'aria-dropeffect'?: \"none\" | \"copy\" | \"link\" | \"execute\" | \"move\" | \"popup\" | undefined; 'aria-errormessage'?: string | undefined; 'aria-expanded'?: boolean | \"true\" | \"false\" | undefined; 'aria-flowto'?: string | undefined; 'aria-grabbed'?: boolean | \"true\" | \"false\" | undefined; 'aria-haspopup'?: boolean | \"grid\" | \"menu\" | \"true\" | \"false\" | \"listbox\" | \"tree\" | \"dialog\" | undefined; 'aria-hidden'?: boolean | \"true\" | \"false\" | undefined; 'aria-invalid'?: boolean | \"true\" | \"false\" | \"grammar\" | \"spelling\" | undefined; 'aria-keyshortcuts'?: string | undefined; 'aria-label'?: string | undefined; 'aria-labelledby'?: string | undefined; 'aria-level'?: number | undefined; 'aria-live'?: \"off\" | \"assertive\" | \"polite\" | undefined; 'aria-modal'?: boolean | \"true\" | \"false\" | undefined; 'aria-multiline'?: boolean | \"true\" | \"false\" | undefined; 'aria-multiselectable'?: boolean | \"true\" | \"false\" | undefined; 'aria-orientation'?: \"horizontal\" | \"vertical\" | undefined; 'aria-owns'?: string | undefined; 'aria-placeholder'?: string | undefined; 'aria-posinset'?: number | undefined; 'aria-pressed'?: boolean | \"mixed\" | \"true\" | \"false\" | undefined; 'aria-readonly'?: boolean | \"true\" | \"false\" | undefined; 'aria-relevant'?: \"all\" | \"text\" | \"additions\" | \"additions text\" | \"removals\" | undefined; 'aria-required'?: boolean | \"true\" | \"false\" | undefined; 'aria-roledescription'?: string | undefined; 'aria-rowcount'?: number | undefined; 'aria-rowindex'?: number | undefined; 'aria-rowspan'?: number | undefined; 'aria-selected'?: boolean | \"true\" | \"false\" | undefined; 'aria-setsize'?: number | undefined; 'aria-sort'?: \"none\" | \"ascending\" | \"descending\" | \"other\" | undefined; 'aria-valuemax'?: number | undefined; 'aria-valuemin'?: number | undefined; 'aria-valuenow'?: number | undefined; 'aria-valuetext'?: string | undefined; dangerouslySetInnerHTML?: { __html: string; } | undefined; onCopy?: ((event: React.ClipboardEvent) => void) | undefined; onCopyCapture?: ((event: React.ClipboardEvent) => void) | undefined; onCut?: ((event: React.ClipboardEvent) => void) | undefined; onCutCapture?: ((event: React.ClipboardEvent) => void) | undefined; onPaste?: ((event: React.ClipboardEvent) => void) | undefined; onPasteCapture?: ((event: React.ClipboardEvent) => void) | undefined; onCompositionEnd?: ((event: React.CompositionEvent) => void) | undefined; onCompositionEndCapture?: ((event: React.CompositionEvent) => void) | undefined; onCompositionStart?: ((event: React.CompositionEvent) => void) | undefined; onCompositionStartCapture?: ((event: React.CompositionEvent) => void) | undefined; onCompositionUpdate?: ((event: React.CompositionEvent) => void) | undefined; onCompositionUpdateCapture?: ((event: React.CompositionEvent) => void) | undefined; onFocus?: ((event: React.FocusEvent) => void) | undefined; onFocusCapture?: ((event: React.FocusEvent) => void) | undefined; onBlur?: ((event: React.FocusEvent) => void) | undefined; onBlurCapture?: ((event: React.FocusEvent) => void) | undefined; onChangeCapture?: ((event: React.FormEvent) => void) | undefined; onBeforeInput?: ((event: React.FormEvent) => void) | undefined; onBeforeInputCapture?: ((event: React.FormEvent) => void) | undefined; onInput?: ((event: React.FormEvent) => void) | undefined; onInputCapture?: ((event: React.FormEvent) => void) | undefined; onReset?: ((event: React.FormEvent) => void) | undefined; onResetCapture?: ((event: React.FormEvent) => void) | undefined; onSubmit?: ((event: React.FormEvent) => void) | undefined; onSubmitCapture?: ((event: React.FormEvent) => void) | undefined; onInvalid?: ((event: React.FormEvent) => void) | undefined; onInvalidCapture?: ((event: React.FormEvent) => void) | undefined; onLoad?: ((event: React.SyntheticEvent) => void) | undefined; onLoadCapture?: ((event: React.SyntheticEvent) => void) | undefined; onError?: ((event: React.SyntheticEvent) => void) | undefined; onErrorCapture?: ((event: React.SyntheticEvent) => void) | undefined; onKeyDownCapture?: ((event: React.KeyboardEvent) => void) | undefined; onKeyPress?: ((event: React.KeyboardEvent) => void) | undefined; onKeyPressCapture?: ((event: React.KeyboardEvent) => void) | undefined; onKeyUp?: ((event: React.KeyboardEvent) => void) | undefined; onKeyUpCapture?: ((event: React.KeyboardEvent) => void) | undefined; onAbort?: ((event: React.SyntheticEvent) => void) | undefined; onAbortCapture?: ((event: React.SyntheticEvent) => void) | undefined; onCanPlay?: ((event: React.SyntheticEvent) => void) | undefined; onCanPlayCapture?: ((event: React.SyntheticEvent) => void) | undefined; onCanPlayThrough?: ((event: React.SyntheticEvent) => void) | undefined; onCanPlayThroughCapture?: ((event: React.SyntheticEvent) => void) | undefined; onDurationChange?: ((event: React.SyntheticEvent) => void) | undefined; onDurationChangeCapture?: ((event: React.SyntheticEvent) => void) | undefined; onEmptied?: ((event: React.SyntheticEvent) => void) | undefined; onEmptiedCapture?: ((event: React.SyntheticEvent) => void) | undefined; onEncrypted?: ((event: React.SyntheticEvent) => void) | undefined; onEncryptedCapture?: ((event: React.SyntheticEvent) => void) | undefined; onEnded?: ((event: React.SyntheticEvent) => void) | undefined; onEndedCapture?: ((event: React.SyntheticEvent) => void) | undefined; onLoadedData?: ((event: React.SyntheticEvent) => void) | undefined; onLoadedDataCapture?: ((event: React.SyntheticEvent) => void) | undefined; onLoadedMetadata?: ((event: React.SyntheticEvent) => void) | undefined; onLoadedMetadataCapture?: ((event: React.SyntheticEvent) => void) | undefined; onLoadStart?: ((event: React.SyntheticEvent) => void) | undefined; onLoadStartCapture?: ((event: React.SyntheticEvent) => void) | undefined; onPause?: ((event: React.SyntheticEvent) => void) | undefined; onPauseCapture?: ((event: React.SyntheticEvent) => void) | undefined; onPlay?: ((event: React.SyntheticEvent) => void) | undefined; onPlayCapture?: ((event: React.SyntheticEvent) => void) | undefined; onPlaying?: ((event: React.SyntheticEvent) => void) | undefined; onPlayingCapture?: ((event: React.SyntheticEvent) => void) | undefined; onProgress?: ((event: React.SyntheticEvent) => void) | undefined; onProgressCapture?: ((event: React.SyntheticEvent) => void) | undefined; onRateChange?: ((event: React.SyntheticEvent) => void) | undefined; onRateChangeCapture?: ((event: React.SyntheticEvent) => void) | undefined; onSeeked?: ((event: React.SyntheticEvent) => void) | undefined; onSeekedCapture?: ((event: React.SyntheticEvent) => void) | undefined; onSeeking?: ((event: React.SyntheticEvent) => void) | undefined; onSeekingCapture?: ((event: React.SyntheticEvent) => void) | undefined; onStalled?: ((event: React.SyntheticEvent) => void) | undefined; onStalledCapture?: ((event: React.SyntheticEvent) => void) | undefined; onSuspend?: ((event: React.SyntheticEvent) => void) | undefined; onSuspendCapture?: ((event: React.SyntheticEvent) => void) | undefined; onTimeUpdate?: ((event: React.SyntheticEvent) => void) | undefined; onTimeUpdateCapture?: ((event: React.SyntheticEvent) => void) | undefined; onVolumeChange?: ((event: React.SyntheticEvent) => void) | undefined; onVolumeChangeCapture?: ((event: React.SyntheticEvent) => void) | undefined; onWaiting?: ((event: React.SyntheticEvent) => void) | undefined; onWaitingCapture?: ((event: React.SyntheticEvent) => void) | undefined; onAuxClick?: ((event: React.MouseEvent) => void) | undefined; onAuxClickCapture?: ((event: React.MouseEvent) => void) | undefined; onClickCapture?: ((event: React.MouseEvent) => void) | undefined; onContextMenu?: ((event: React.MouseEvent) => void) | undefined; onContextMenuCapture?: ((event: React.MouseEvent) => void) | undefined; onDoubleClick?: ((event: React.MouseEvent) => void) | undefined; onDoubleClickCapture?: ((event: React.MouseEvent) => void) | undefined; onDrag?: ((event: React.DragEvent) => void) | undefined; onDragCapture?: ((event: React.DragEvent) => void) | undefined; onDragEnd?: ((event: React.DragEvent) => void) | undefined; onDragEndCapture?: ((event: React.DragEvent) => void) | undefined; onDragEnter?: ((event: React.DragEvent) => void) | undefined; onDragEnterCapture?: ((event: React.DragEvent) => void) | undefined; onDragExit?: ((event: React.DragEvent) => void) | undefined; onDragExitCapture?: ((event: React.DragEvent) => void) | undefined; onDragLeave?: ((event: React.DragEvent) => void) | undefined; onDragLeaveCapture?: ((event: React.DragEvent) => void) | undefined; onDragOver?: ((event: React.DragEvent) => void) | undefined; onDragOverCapture?: ((event: React.DragEvent) => void) | undefined; onDragStart?: ((event: React.DragEvent) => void) | undefined; onDragStartCapture?: ((event: React.DragEvent) => void) | undefined; onDrop?: ((event: React.DragEvent) => void) | undefined; onDropCapture?: ((event: React.DragEvent) => void) | undefined; onMouseDown?: ((event: React.MouseEvent) => void) | undefined; onMouseDownCapture?: ((event: React.MouseEvent) => void) | undefined; onMouseEnter?: ((event: React.MouseEvent) => void) | undefined; onMouseLeave?: ((event: React.MouseEvent) => void) | undefined; onMouseMove?: ((event: React.MouseEvent) => void) | undefined; onMouseMoveCapture?: ((event: React.MouseEvent) => void) | undefined; onMouseOut?: ((event: React.MouseEvent) => void) | undefined; onMouseOutCapture?: ((event: React.MouseEvent) => void) | undefined; onMouseOver?: ((event: React.MouseEvent) => void) | undefined; onMouseOverCapture?: ((event: React.MouseEvent) => void) | undefined; onMouseUp?: ((event: React.MouseEvent) => void) | undefined; onMouseUpCapture?: ((event: React.MouseEvent) => void) | undefined; onSelect?: ((event: React.SyntheticEvent) => void) | undefined; onSelectCapture?: ((event: React.SyntheticEvent) => void) | undefined; onTouchCancel?: ((event: React.TouchEvent) => void) | undefined; onTouchCancelCapture?: ((event: React.TouchEvent) => void) | undefined; onTouchEnd?: ((event: React.TouchEvent) => void) | undefined; onTouchEndCapture?: ((event: React.TouchEvent) => void) | undefined; onTouchMove?: ((event: React.TouchEvent) => void) | undefined; onTouchMoveCapture?: ((event: React.TouchEvent) => void) | undefined; onTouchStart?: ((event: React.TouchEvent) => void) | undefined; onTouchStartCapture?: ((event: React.TouchEvent) => void) | undefined; onPointerDown?: ((event: React.PointerEvent) => void) | undefined; onPointerDownCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerMove?: ((event: React.PointerEvent) => void) | undefined; onPointerMoveCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerUp?: ((event: React.PointerEvent) => void) | undefined; onPointerUpCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerCancel?: ((event: React.PointerEvent) => void) | undefined; onPointerCancelCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerEnter?: ((event: React.PointerEvent) => void) | undefined; onPointerEnterCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerLeave?: ((event: React.PointerEvent) => void) | undefined; onPointerLeaveCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerOver?: ((event: React.PointerEvent) => void) | undefined; onPointerOverCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerOut?: ((event: React.PointerEvent) => void) | undefined; onPointerOutCapture?: ((event: React.PointerEvent) => void) | undefined; onGotPointerCapture?: ((event: React.PointerEvent) => void) | undefined; onGotPointerCaptureCapture?: ((event: React.PointerEvent) => void) | undefined; onLostPointerCapture?: ((event: React.PointerEvent) => void) | undefined; onLostPointerCaptureCapture?: ((event: React.PointerEvent) => void) | undefined; onScroll?: ((event: React.UIEvent) => void) | undefined; onScrollCapture?: ((event: React.UIEvent) => void) | undefined; onWheel?: ((event: React.WheelEvent) => void) | undefined; onWheelCapture?: ((event: React.WheelEvent) => void) | undefined; onAnimationStart?: ((event: React.AnimationEvent) => void) | undefined; onAnimationStartCapture?: ((event: React.AnimationEvent) => void) | undefined; onAnimationEnd?: ((event: React.AnimationEvent) => void) | undefined; onAnimationEndCapture?: ((event: React.AnimationEvent) => void) | undefined; onAnimationIteration?: ((event: React.AnimationEvent) => void) | undefined; onAnimationIterationCapture?: ((event: React.AnimationEvent) => void) | undefined; onTransitionEnd?: ((event: React.TransitionEvent) => void) | undefined; onTransitionEndCapture?: ((event: React.TransitionEvent) => void) | undefined; css?: ", "InterpolationWithTheme", "; 'data-test-subj'?: string | undefined; width?: string | undefined; render?: ((value: any, record: ", { @@ -1320,7 +1320,7 @@ "section": "def-public.SavedObjectsManagementServiceRegistryEntry", "text": "SavedObjectsManagementServiceRegistryEntry" }, - " | undefined; register: (entry: ", + " | undefined; all: () => ", { "pluginId": "savedObjectsManagement", "scope": "public", @@ -1328,7 +1328,7 @@ "section": "def-public.SavedObjectsManagementServiceRegistryEntry", "text": "SavedObjectsManagementServiceRegistryEntry" }, - ") => void; all: () => ", + "[]; register: (entry: ", { "pluginId": "savedObjectsManagement", "scope": "public", @@ -1336,7 +1336,7 @@ "section": "def-public.SavedObjectsManagementServiceRegistryEntry", "text": "SavedObjectsManagementServiceRegistryEntry" }, - "[]; }" + ") => void; }" ], "source": { "path": "src/plugins/saved_objects_management/public/services/service_registry.ts", @@ -1448,7 +1448,7 @@ "section": "def-public.SavedObjectsManagementServiceRegistryEntry", "text": "SavedObjectsManagementServiceRegistryEntry" }, - " | undefined; register: (entry: ", + " | undefined; all: () => ", { "pluginId": "savedObjectsManagement", "scope": "public", @@ -1456,7 +1456,7 @@ "section": "def-public.SavedObjectsManagementServiceRegistryEntry", "text": "SavedObjectsManagementServiceRegistryEntry" }, - ") => void; all: () => ", + "[]; register: (entry: ", { "pluginId": "savedObjectsManagement", "scope": "public", @@ -1464,7 +1464,7 @@ "section": "def-public.SavedObjectsManagementServiceRegistryEntry", "text": "SavedObjectsManagementServiceRegistryEntry" }, - "[]; }" + ") => void; }" ], "source": { "path": "src/plugins/saved_objects_management/public/plugin.ts", diff --git a/api_docs/saved_objects_management.mdx b/api_docs/saved_objects_management.mdx index 916288f934b575..0ee0660609f14d 100644 --- a/api_docs/saved_objects_management.mdx +++ b/api_docs/saved_objects_management.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import savedObjectsManagementObj from './saved_objects_management.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 96 | 0 | 85 | 0 | + ## Client ### Setup diff --git a/api_docs/saved_objects_tagging.mdx b/api_docs/saved_objects_tagging.mdx index 52a8b19a8300bc..fe1d90171a2c17 100644 --- a/api_docs/saved_objects_tagging.mdx +++ b/api_docs/saved_objects_tagging.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import savedObjectsTaggingObj from './saved_objects_tagging.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 54 | 0 | 50 | 0 | + ## Client ### Start diff --git a/api_docs/saved_objects_tagging_oss.mdx b/api_docs/saved_objects_tagging_oss.mdx index 921ee5240bfe8b..6fe8b4c6d46981 100644 --- a/api_docs/saved_objects_tagging_oss.mdx +++ b/api_docs/saved_objects_tagging_oss.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import savedObjectsTaggingOssObj from './saved_objects_tagging_oss.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 89 | 3 | 50 | 0 | + ## Client ### Setup diff --git a/api_docs/screenshot_mode.json b/api_docs/screenshot_mode.json index b7d680b6e93b1e..22b613bf0b04bc 100644 --- a/api_docs/screenshot_mode.json +++ b/api_docs/screenshot_mode.json @@ -2,11 +2,83 @@ "id": "screenshotMode", "client": { "classes": [], - "functions": [], + "functions": [ + { + "parentPluginId": "screenshotMode", + "id": "def-public.setScreenshotModeEnabled", + "type": "Function", + "tags": [], + "label": "setScreenshotModeEnabled", + "description": [ + "\nUse this function to set the current browser to screenshot mode.\n\nThis function should be called as early as possible to ensure that screenshot mode is\ncorrectly detected for the first page load. It is not suitable for use inside any plugin\ncode unless the plugin code is guaranteed to, somehow, load before any other code.\n\nAdditionally, we don't know what environment this code will run in so we remove as many external\nreferences as possible to make it portable. For instance, running inside puppeteer." + ], + "signature": [ + "() => void" + ], + "source": { + "path": "src/plugins/screenshot_mode/common/get_set_browser_screenshot_mode.ts", + "lineNumber": 39 + }, + "deprecated": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + } + ], "interfaces": [], "enums": [], - "misc": [], - "objects": [] + "misc": [ + { + "parentPluginId": "screenshotMode", + "id": "def-public.KBN_SCREENSHOT_MODE_ENABLED_KEY", + "type": "string", + "tags": [], + "label": "KBN_SCREENSHOT_MODE_ENABLED_KEY", + "description": [], + "signature": [ + "\"__KBN_SCREENSHOT_MODE_ENABLED_KEY__\"" + ], + "source": { + "path": "src/plugins/screenshot_mode/common/get_set_browser_screenshot_mode.ts", + "lineNumber": 13 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "screenshotMode", + "id": "def-public.KBN_SCREENSHOT_MODE_HEADER", + "type": "string", + "tags": [], + "label": "KBN_SCREENSHOT_MODE_HEADER", + "description": [], + "source": { + "path": "src/plugins/screenshot_mode/common/constants.ts", + "lineNumber": 9 + }, + "deprecated": false, + "initialIsOpen": false + } + ], + "objects": [], + "setup": { + "parentPluginId": "screenshotMode", + "id": "def-public.ScreenshotModePluginSetup", + "type": "Type", + "tags": [], + "label": "ScreenshotModePluginSetup", + "description": [], + "signature": [ + "IScreenshotModeService" + ], + "source": { + "path": "src/plugins/screenshot_mode/public/types.ts", + "lineNumber": 17 + }, + "deprecated": false, + "lifecycle": "setup", + "initialIsOpen": true + } }, "server": { "classes": [], @@ -86,6 +158,23 @@ ], "enums": [], "misc": [ + { + "parentPluginId": "screenshotMode", + "id": "def-server.KBN_SCREENSHOT_MODE_ENABLED_KEY", + "type": "string", + "tags": [], + "label": "KBN_SCREENSHOT_MODE_ENABLED_KEY", + "description": [], + "signature": [ + "\"__KBN_SCREENSHOT_MODE_ENABLED_KEY__\"" + ], + "source": { + "path": "src/plugins/screenshot_mode/common/get_set_browser_screenshot_mode.ts", + "lineNumber": 13 + }, + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "screenshotMode", "id": "def-server.KBN_SCREENSHOT_MODE_HEADER", @@ -325,6 +414,23 @@ "interfaces": [], "enums": [], "misc": [ + { + "parentPluginId": "screenshotMode", + "id": "def-common.KBN_SCREENSHOT_MODE_ENABLED_KEY", + "type": "string", + "tags": [], + "label": "KBN_SCREENSHOT_MODE_ENABLED_KEY", + "description": [], + "signature": [ + "\"__KBN_SCREENSHOT_MODE_ENABLED_KEY__\"" + ], + "source": { + "path": "src/plugins/screenshot_mode/common/get_set_browser_screenshot_mode.ts", + "lineNumber": 13 + }, + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "screenshotMode", "id": "def-common.KBN_SCREENSHOT_MODE_HEADER", diff --git a/api_docs/screenshot_mode.mdx b/api_docs/screenshot_mode.mdx index 115a348cbe2e6e..a098e5f296d69d 100644 --- a/api_docs/screenshot_mode.mdx +++ b/api_docs/screenshot_mode.mdx @@ -11,6 +11,27 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import screenshotModeObj from './screenshot_mode.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 21 | 0 | 16 | 1 | + +## Client + +### Setup + + +### Functions + + +### Consts, variables and types + + ## Server ### Setup diff --git a/api_docs/security.json b/api_docs/security.json index 7e28ad2a222bb3..f7547221cec666 100644 --- a/api_docs/security.json +++ b/api_docs/security.json @@ -14,7 +14,13 @@ "\nRepresents the currently authenticated user." ], "signature": [ - "AuthenticatedUser", + { + "pluginId": "security", + "scope": "common", + "docId": "kibSecurityPluginApi", + "section": "def-common.AuthenticatedUser", + "text": "AuthenticatedUser" + }, " extends ", "User" ], @@ -96,6 +102,70 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "security", + "id": "def-public.AuthenticationServiceSetup", + "type": "Interface", + "tags": [], + "label": "AuthenticationServiceSetup", + "description": [], + "source": { + "path": "x-pack/plugins/security/public/authentication/authentication_service.ts", + "lineNumber": 33 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "security", + "id": "def-public.AuthenticationServiceSetup.getCurrentUser", + "type": "Function", + "tags": [], + "label": "getCurrentUser", + "description": [ + "\nReturns currently authenticated user and throws if current user isn't authenticated." + ], + "signature": [ + "() => Promise<", + { + "pluginId": "security", + "scope": "common", + "docId": "kibSecurityPluginApi", + "section": "def-common.AuthenticatedUser", + "text": "AuthenticatedUser" + }, + ">" + ], + "source": { + "path": "x-pack/plugins/security/public/authentication/authentication_service.ts", + "lineNumber": 37 + }, + "deprecated": false, + "returnComment": [], + "children": [] + }, + { + "parentPluginId": "security", + "id": "def-public.AuthenticationServiceSetup.areAPIKeysEnabled", + "type": "Function", + "tags": [], + "label": "areAPIKeysEnabled", + "description": [ + "\nDetermines if API Keys are currently enabled." + ], + "signature": [ + "() => Promise" + ], + "source": { + "path": "x-pack/plugins/security/public/authentication/authentication_service.ts", + "lineNumber": 42 + }, + "deprecated": false, + "returnComment": [], + "children": [] + } + ], + "initialIsOpen": false + }, { "parentPluginId": "security", "id": "def-public.SecurityLicense", @@ -408,6 +478,104 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "security", + "id": "def-public.SecurityNavControlServiceStart", + "type": "Interface", + "tags": [], + "label": "SecurityNavControlServiceStart", + "description": [], + "source": { + "path": "x-pack/plugins/security/public/nav_control/nav_control_service.tsx", + "lineNumber": 32 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "security", + "id": "def-public.SecurityNavControlServiceStart.getUserMenuLinks$", + "type": "Function", + "tags": [], + "label": "getUserMenuLinks$", + "description": [ + "\nReturns an Observable of the array of user menu links (the links that show up under the user's Avatar in the UI) registered by other plugins" + ], + "signature": [ + "() => ", + "Observable", + "<", + { + "pluginId": "security", + "scope": "public", + "docId": "kibSecurityPluginApi", + "section": "def-public.UserMenuLink", + "text": "UserMenuLink" + }, + "[]>" + ], + "source": { + "path": "x-pack/plugins/security/public/nav_control/nav_control_service.tsx", + "lineNumber": 36 + }, + "deprecated": false, + "returnComment": [], + "children": [] + }, + { + "parentPluginId": "security", + "id": "def-public.SecurityNavControlServiceStart.addUserMenuLinks", + "type": "Function", + "tags": [], + "label": "addUserMenuLinks", + "description": [ + "\nRegisters the provided user menu links to be displayed in the user menu (the links that show up under the user's Avatar in the UI)." + ], + "signature": [ + "(newUserMenuLink: ", + { + "pluginId": "security", + "scope": "public", + "docId": "kibSecurityPluginApi", + "section": "def-public.UserMenuLink", + "text": "UserMenuLink" + }, + "[]) => void" + ], + "source": { + "path": "x-pack/plugins/security/public/nav_control/nav_control_service.tsx", + "lineNumber": 41 + }, + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "security", + "id": "def-public.newUserMenuLink", + "type": "Array", + "tags": [], + "label": "newUserMenuLink", + "description": [], + "signature": [ + { + "pluginId": "security", + "scope": "public", + "docId": "kibSecurityPluginApi", + "section": "def-public.UserMenuLink", + "text": "UserMenuLink" + }, + "[]" + ], + "source": { + "path": "x-pack/plugins/security/public/nav_control/nav_control_service.tsx", + "lineNumber": 41 + }, + "deprecated": false + } + ] + } + ], + "initialIsOpen": false + }, { "parentPluginId": "security", "id": "def-public.UserMenuLink", @@ -500,55 +668,161 @@ } ], "enums": [], - "misc": [], + "misc": [ + { + "parentPluginId": "security", + "id": "def-public.AuthenticationServiceStart", + "type": "Type", + "tags": [], + "label": "AuthenticationServiceStart", + "description": [ + "\nStart has the same contract as Setup for now." + ], + "signature": [ + { + "pluginId": "security", + "scope": "public", + "docId": "kibSecurityPluginApi", + "section": "def-public.AuthenticationServiceSetup", + "text": "AuthenticationServiceSetup" + } + ], + "source": { + "path": "x-pack/plugins/security/public/authentication/authentication_service.ts", + "lineNumber": 48 + }, + "deprecated": false, + "initialIsOpen": false + } + ], "objects": [], "setup": { "parentPluginId": "security", "id": "def-public.SecurityPluginSetup", - "type": "Type", + "type": "Interface", "tags": [], "label": "SecurityPluginSetup", "description": [], - "signature": [ - "{ authc: ", - "AuthenticationServiceSetup", - "; sessionTimeout: ", - "SessionTimeout", - "; license: Readonly<{ isLicenseAvailable: () => boolean; isEnabled: () => boolean; getType: () => \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; getFeatures: () => ", - "SecurityLicenseFeatures", - "; features$: ", - "Observable", - "<", - "SecurityLicenseFeatures", - ">; }>; __legacyCompat: { logoutUrl: string; tenant: string; }; }" - ], "source": { "path": "x-pack/plugins/security/public/plugin.tsx", - "lineNumber": 164 + "lineNumber": 167 }, "deprecated": false, + "children": [ + { + "parentPluginId": "security", + "id": "def-public.SecurityPluginSetup.authc", + "type": "Object", + "tags": [], + "label": "authc", + "description": [ + "\nExposes authentication information about the currently logged in user." + ], + "signature": [ + { + "pluginId": "security", + "scope": "public", + "docId": "kibSecurityPluginApi", + "section": "def-public.AuthenticationServiceSetup", + "text": "AuthenticationServiceSetup" + } + ], + "source": { + "path": "x-pack/plugins/security/public/plugin.tsx", + "lineNumber": 171 + }, + "deprecated": false + }, + { + "parentPluginId": "security", + "id": "def-public.SecurityPluginSetup.license", + "type": "Object", + "tags": [], + "label": "license", + "description": [ + "\nExposes information about the available security features under the current license." + ], + "signature": [ + { + "pluginId": "security", + "scope": "common", + "docId": "kibSecurityPluginApi", + "section": "def-common.SecurityLicense", + "text": "SecurityLicense" + } + ], + "source": { + "path": "x-pack/plugins/security/public/plugin.tsx", + "lineNumber": 175 + }, + "deprecated": false + } + ], "lifecycle": "setup", "initialIsOpen": true }, "start": { "parentPluginId": "security", "id": "def-public.SecurityPluginStart", - "type": "Type", + "type": "Interface", "tags": [], "label": "SecurityPluginStart", "description": [], - "signature": [ - "{ navControlService: ", - "SecurityNavControlServiceStart", - "; authc: ", - "AuthenticationServiceSetup", - "; }" - ], "source": { "path": "x-pack/plugins/security/public/plugin.tsx", - "lineNumber": 165 + "lineNumber": 178 }, "deprecated": false, + "children": [ + { + "parentPluginId": "security", + "id": "def-public.SecurityPluginStart.navControlService", + "type": "Object", + "tags": [], + "label": "navControlService", + "description": [ + "\nExposes the ability to add custom links to the dropdown menu in the top right, where the user's Avatar is." + ], + "signature": [ + { + "pluginId": "security", + "scope": "public", + "docId": "kibSecurityPluginApi", + "section": "def-public.SecurityNavControlServiceStart", + "text": "SecurityNavControlServiceStart" + } + ], + "source": { + "path": "x-pack/plugins/security/public/plugin.tsx", + "lineNumber": 182 + }, + "deprecated": false + }, + { + "parentPluginId": "security", + "id": "def-public.SecurityPluginStart.authc", + "type": "Object", + "tags": [], + "label": "authc", + "description": [ + "\nExposes authentication information about the currently logged in user." + ], + "signature": [ + { + "pluginId": "security", + "scope": "public", + "docId": "kibSecurityPluginApi", + "section": "def-public.AuthenticationServiceSetup", + "text": "AuthenticationServiceSetup" + } + ], + "source": { + "path": "x-pack/plugins/security/public/plugin.tsx", + "lineNumber": 186 + }, + "deprecated": false + } + ], "lifecycle": "start", "initialIsOpen": true } @@ -681,6 +955,121 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "security", + "id": "def-server.AuditServiceSetup", + "type": "Interface", + "tags": [], + "label": "AuditServiceSetup", + "description": [], + "source": { + "path": "x-pack/plugins/security/server/audit/audit_service.ts", + "lineNumber": 40 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "security", + "id": "def-server.AuditServiceSetup.asScoped", + "type": "Function", + "tags": [], + "label": "asScoped", + "description": [], + "signature": [ + "(request: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, + ") => ", + { + "pluginId": "security", + "scope": "server", + "docId": "kibSecurityPluginApi", + "section": "def-server.AuditLogger", + "text": "AuditLogger" + } + ], + "source": { + "path": "x-pack/plugins/security/server/audit/audit_service.ts", + "lineNumber": 41 + }, + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "security", + "id": "def-server.request", + "type": "Object", + "tags": [], + "label": "request", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, + "" + ], + "source": { + "path": "x-pack/plugins/security/server/audit/audit_service.ts", + "lineNumber": 41 + }, + "deprecated": false + } + ] + }, + { + "parentPluginId": "security", + "id": "def-server.AuditServiceSetup.getLogger", + "type": "Function", + "tags": [], + "label": "getLogger", + "description": [], + "signature": [ + "(id?: string | undefined) => ", + { + "pluginId": "security", + "scope": "server", + "docId": "kibSecurityPluginApi", + "section": "def-server.LegacyAuditLogger", + "text": "LegacyAuditLogger" + } + ], + "source": { + "path": "x-pack/plugins/security/server/audit/audit_service.ts", + "lineNumber": 42 + }, + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "security", + "id": "def-server.id", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "signature": [ + "string | undefined" + ], + "source": { + "path": "x-pack/plugins/security/server/audit/audit_service.ts", + "lineNumber": 42 + }, + "deprecated": false + } + ] + } + ], + "initialIsOpen": false + }, { "parentPluginId": "security", "id": "def-server.AuthenticatedUser", @@ -691,7 +1080,13 @@ "\nRepresents the currently authenticated user." ], "signature": [ - "AuthenticatedUser", + { + "pluginId": "security", + "scope": "common", + "docId": "kibSecurityPluginApi", + "section": "def-common.AuthenticatedUser", + "text": "AuthenticatedUser" + }, " extends ", "User" ], @@ -775,26 +1170,194 @@ }, { "parentPluginId": "security", - "id": "def-server.CheckPrivilegesPayload", + "id": "def-server.AuthenticationServiceStart", "type": "Interface", "tags": [], - "label": "CheckPrivilegesPayload", - "description": [], + "label": "AuthenticationServiceStart", + "description": [ + "\nAuthentication services available on the security plugin's start contract." + ], "source": { - "path": "x-pack/plugins/security/server/authorization/types.ts", - "lineNumber": 70 + "path": "x-pack/plugins/security/server/authentication/authentication_service.ts", + "lineNumber": 72 }, "deprecated": false, "children": [ { "parentPluginId": "security", - "id": "def-server.CheckPrivilegesPayload.kibana", - "type": "CompoundType", + "id": "def-server.AuthenticationServiceStart.apiKeys", + "type": "Object", "tags": [], - "label": "kibana", + "label": "apiKeys", "description": [], "signature": [ - "string | string[] | undefined" + "{ create: (request: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, + ", params: ", + "CreateAPIKeyParams", + ") => Promise<", + { + "pluginId": "security", + "scope": "server", + "docId": "kibSecurityPluginApi", + "section": "def-server.CreateAPIKeyResult", + "text": "CreateAPIKeyResult" + }, + " | null>; areAPIKeysEnabled: () => Promise; invalidate: (request: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, + ", params: ", + { + "pluginId": "security", + "scope": "server", + "docId": "kibSecurityPluginApi", + "section": "def-server.InvalidateAPIKeysParams", + "text": "InvalidateAPIKeysParams" + }, + ") => Promise<", + { + "pluginId": "security", + "scope": "server", + "docId": "kibSecurityPluginApi", + "section": "def-server.InvalidateAPIKeyResult", + "text": "InvalidateAPIKeyResult" + }, + " | null>; grantAsInternalUser: (request: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, + ", createParams: ", + "CreateAPIKeyParams", + ") => Promise<", + { + "pluginId": "security", + "scope": "server", + "docId": "kibSecurityPluginApi", + "section": "def-server.GrantAPIKeyResult", + "text": "GrantAPIKeyResult" + }, + " | null>; invalidateAsInternalUser: (params: ", + { + "pluginId": "security", + "scope": "server", + "docId": "kibSecurityPluginApi", + "section": "def-server.InvalidateAPIKeysParams", + "text": "InvalidateAPIKeysParams" + }, + ") => Promise<", + { + "pluginId": "security", + "scope": "server", + "docId": "kibSecurityPluginApi", + "section": "def-server.InvalidateAPIKeyResult", + "text": "InvalidateAPIKeyResult" + }, + " | null>; }" + ], + "source": { + "path": "x-pack/plugins/security/server/authentication/authentication_service.ts", + "lineNumber": 73 + }, + "deprecated": false + }, + { + "parentPluginId": "security", + "id": "def-server.AuthenticationServiceStart.getCurrentUser", + "type": "Function", + "tags": [], + "label": "getCurrentUser", + "description": [], + "signature": [ + "(request: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, + ") => ", + { + "pluginId": "security", + "scope": "common", + "docId": "kibSecurityPluginApi", + "section": "def-common.AuthenticatedUser", + "text": "AuthenticatedUser" + }, + " | null" + ], + "source": { + "path": "x-pack/plugins/security/server/authentication/authentication_service.ts", + "lineNumber": 81 + }, + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "security", + "id": "def-server.request", + "type": "Object", + "tags": [], + "label": "request", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, + "" + ], + "source": { + "path": "x-pack/plugins/security/server/authentication/authentication_service.ts", + "lineNumber": 81 + }, + "deprecated": false + } + ] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "security", + "id": "def-server.CheckPrivilegesPayload", + "type": "Interface", + "tags": [], + "label": "CheckPrivilegesPayload", + "description": [], + "source": { + "path": "x-pack/plugins/security/server/authorization/types.ts", + "lineNumber": 70 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "security", + "id": "def-server.CheckPrivilegesPayload.kibana", + "type": "CompoundType", + "tags": [], + "label": "kibana", + "description": [], + "signature": [ + "string | string[] | undefined" ], "source": { "path": "x-pack/plugins/security/server/authorization/types.ts", @@ -832,7 +1395,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 56 + "lineNumber": 62 }, "deprecated": false, "children": [ @@ -847,7 +1410,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 60 + "lineNumber": 66 }, "deprecated": false }, @@ -862,7 +1425,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 64 + "lineNumber": 70 }, "deprecated": false }, @@ -880,7 +1443,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 68 + "lineNumber": 74 }, "deprecated": false }, @@ -895,7 +1458,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 72 + "lineNumber": 78 }, "deprecated": false } @@ -911,7 +1474,7 @@ "description": [], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 75 + "lineNumber": 81 }, "deprecated": false, "children": [ @@ -926,7 +1489,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 79 + "lineNumber": 85 }, "deprecated": false }, @@ -941,7 +1504,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 83 + "lineNumber": 89 }, "deprecated": false }, @@ -956,7 +1519,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 87 + "lineNumber": 93 }, "deprecated": false } @@ -974,7 +1537,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 93 + "lineNumber": 99 }, "deprecated": false, "children": [ @@ -992,7 +1555,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 97 + "lineNumber": 103 }, "deprecated": false }, @@ -1010,7 +1573,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 101 + "lineNumber": 107 }, "deprecated": false }, @@ -1025,7 +1588,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 105 + "lineNumber": 111 }, "deprecated": false }, @@ -1043,7 +1606,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 109 + "lineNumber": 115 }, "deprecated": false } @@ -1061,7 +1624,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 46 + "lineNumber": 52 }, "deprecated": false, "children": [ @@ -1077,7 +1640,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 47 + "lineNumber": 53 }, "deprecated": false } @@ -1234,256 +1797,478 @@ } ], "initialIsOpen": false + } + ], + "enums": [], + "misc": [ + { + "parentPluginId": "security", + "id": "def-server.AuthorizationServiceSetup", + "type": "Type", + "tags": [], + "label": "AuthorizationServiceSetup", + "description": [], + "source": { + "path": "x-pack/plugins/security/server/index.ts", + "lineNumber": 31 + }, + "deprecated": false, + "initialIsOpen": false }, { "parentPluginId": "security", - "id": "def-server.SecurityPluginSetup", + "id": "def-server.ROUTE_TAG_CAN_REDIRECT", + "type": "string", + "tags": [], + "label": "ROUTE_TAG_CAN_REDIRECT", + "description": [ + "\nIf the route is marked with this tag Security can safely assume that the calling party that sends\nrequest to this route can handle redirect responses. It's particularly important if we want the\nspecific route to be able to initiate or participate in the authentication handshake that may\ninvolve redirects and will eventually redirect authenticated user to this route." + ], + "signature": [ + "\"security:canRedirect\"" + ], + "source": { + "path": "x-pack/plugins/security/server/routes/tags.ts", + "lineNumber": 21 + }, + "deprecated": false, + "initialIsOpen": false + } + ], + "objects": [], + "setup": { + "parentPluginId": "security", + "id": "def-server.SecurityPluginSetup", + "type": "Interface", + "tags": [], + "label": "SecurityPluginSetup", + "description": [ + "\nDescribes public Security plugin contract returned at the `setup` stage." + ], + "source": { + "path": "x-pack/plugins/security/server/plugin.ts", + "lineNumber": 72 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "security", + "id": "def-server.SecurityPluginSetup.authc", + "type": "Object", + "tags": [ + "deprecated" + ], + "label": "authc", + "description": [], + "signature": [ + "{ getCurrentUser: (request: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, + ") => ", + { + "pluginId": "security", + "scope": "common", + "docId": "kibSecurityPluginApi", + "section": "def-common.AuthenticatedUser", + "text": "AuthenticatedUser" + }, + " | null; }" + ], + "source": { + "path": "x-pack/plugins/security/server/plugin.ts", + "lineNumber": 76 + }, + "deprecated": true, + "references": [ + { + "plugin": "reporting", + "link": { + "path": "x-pack/plugins/reporting/server/routes/lib/get_user.ts", + "lineNumber": 13 + } + }, + { + "plugin": "encryptedSavedObjects", + "link": { + "path": "x-pack/plugins/encrypted_saved_objects/server/crypto/encryption_key_rotation_service.ts", + "lineNumber": 107 + } + }, + { + "plugin": "encryptedSavedObjects", + "link": { + "path": "x-pack/plugins/encrypted_saved_objects/server/saved_objects/index.ts", + "lineNumber": 67 + } + }, + { + "plugin": "actions", + "link": { + "path": "x-pack/plugins/actions/server/plugin.ts", + "lineNumber": 444 + } + }, + { + "plugin": "ml", + "link": { + "path": "x-pack/plugins/ml/server/routes/annotations.ts", + "lineNumber": 105 + } + }, + { + "plugin": "dashboardMode", + "link": { + "path": "x-pack/plugins/dashboard_mode/server/interceptors/dashboard_mode_request_interceptor.ts", + "lineNumber": 33 + } + }, + { + "plugin": "dataEnhanced", + "link": { + "path": "x-pack/plugins/data_enhanced/server/search/session/session_service.ts", + "lineNumber": 448 + } + }, + { + "plugin": "logstash", + "link": { + "path": "x-pack/plugins/logstash/server/routes/pipeline/save.ts", + "lineNumber": 41 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/create_signals_migration_route.ts", + "lineNumber": 48 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/delete_signals_migration_route.ts", + "lineNumber": 45 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.ts", + "lineNumber": 45 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/lib/timeline/utils/common.ts", + "lineNumber": 28 + } + } + ] + }, + { + "parentPluginId": "security", + "id": "def-server.SecurityPluginSetup.authz", + "type": "Object", + "tags": [ + "deprecated" + ], + "label": "authz", + "description": [], + "signature": [ + { + "pluginId": "security", + "scope": "server", + "docId": "kibSecurityPluginApi", + "section": "def-server.AuthorizationServiceSetup", + "text": "AuthorizationServiceSetup" + } + ], + "source": { + "path": "x-pack/plugins/security/server/plugin.ts", + "lineNumber": 80 + }, + "deprecated": true, + "references": [ + { + "plugin": "actions", + "link": { + "path": "x-pack/plugins/actions/server/plugin.ts", + "lineNumber": 443 + } + }, + { + "plugin": "ml", + "link": { + "path": "x-pack/plugins/ml/server/saved_objects/initialization/initialization.ts", + "lineNumber": 54 + } + }, + { + "plugin": "ml", + "link": { + "path": "x-pack/plugins/ml/server/plugin.ts", + "lineNumber": 153 + } + }, + { + "plugin": "ml", + "link": { + "path": "x-pack/plugins/ml/server/plugin.ts", + "lineNumber": 203 + } + }, + { + "plugin": "enterpriseSearch", + "link": { + "path": "x-pack/plugins/enterprise_search/server/lib/check_access.ts", + "lineNumber": 46 + } + }, + { + "plugin": "enterpriseSearch", + "link": { + "path": "x-pack/plugins/enterprise_search/server/lib/check_access.ts", + "lineNumber": 86 + } + }, + { + "plugin": "enterpriseSearch", + "link": { + "path": "x-pack/plugins/enterprise_search/server/lib/check_access.ts", + "lineNumber": 88 + } + }, + { + "plugin": "savedObjectsTagging", + "link": { + "path": "x-pack/plugins/saved_objects_tagging/server/request_handler_context.ts", + "lineNumber": 37 + } + } + ] + }, + { + "parentPluginId": "security", + "id": "def-server.SecurityPluginSetup.license", + "type": "Object", + "tags": [], + "label": "license", + "description": [ + "\nExposes information about the available security features under the current license." + ], + "signature": [ + { + "pluginId": "security", + "scope": "common", + "docId": "kibSecurityPluginApi", + "section": "def-common.SecurityLicense", + "text": "SecurityLicense" + } + ], + "source": { + "path": "x-pack/plugins/security/server/plugin.ts", + "lineNumber": 84 + }, + "deprecated": false + }, + { + "parentPluginId": "security", + "id": "def-server.SecurityPluginSetup.audit", + "type": "Object", + "tags": [], + "label": "audit", + "description": [ + "\nExposes services for audit logging." + ], + "signature": [ + { + "pluginId": "security", + "scope": "server", + "docId": "kibSecurityPluginApi", + "section": "def-server.AuditServiceSetup", + "text": "AuditServiceSetup" + } + ], + "source": { + "path": "x-pack/plugins/security/server/plugin.ts", + "lineNumber": 88 + }, + "deprecated": false + } + ], + "lifecycle": "setup", + "initialIsOpen": true + }, + "start": { + "parentPluginId": "security", + "id": "def-server.SecurityPluginStart", + "type": "Interface", + "tags": [], + "label": "SecurityPluginStart", + "description": [ + "\nDescribes public Security plugin contract returned at the `start` stage." + ], + "source": { + "path": "x-pack/plugins/security/server/plugin.ts", + "lineNumber": 94 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "security", + "id": "def-server.SecurityPluginStart.authc", + "type": "Object", + "tags": [], + "label": "authc", + "description": [ + "\nAuthentication services to confirm the user is who they say they are." + ], + "signature": [ + { + "pluginId": "security", + "scope": "server", + "docId": "kibSecurityPluginApi", + "section": "def-server.AuthenticationServiceStart", + "text": "AuthenticationServiceStart" + } + ], + "source": { + "path": "x-pack/plugins/security/server/plugin.ts", + "lineNumber": 98 + }, + "deprecated": false + }, + { + "parentPluginId": "security", + "id": "def-server.SecurityPluginStart.authz", + "type": "Object", + "tags": [], + "label": "authz", + "description": [ + "\nAuthorization services to manage and access the permissions a particular user has." + ], + "signature": [ + { + "pluginId": "security", + "scope": "server", + "docId": "kibSecurityPluginApi", + "section": "def-server.AuthorizationServiceSetup", + "text": "AuthorizationServiceSetup" + } + ], + "source": { + "path": "x-pack/plugins/security/server/plugin.ts", + "lineNumber": 102 + }, + "deprecated": false + } + ], + "lifecycle": "start", + "initialIsOpen": true + } + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [ + { + "parentPluginId": "security", + "id": "def-common.AuthenticatedUser", "type": "Interface", "tags": [], - "label": "SecurityPluginSetup", + "label": "AuthenticatedUser", "description": [ - "\nDescribes public Security plugin contract returned at the `setup` stage." + "\nRepresents the currently authenticated user." + ], + "signature": [ + { + "pluginId": "security", + "scope": "common", + "docId": "kibSecurityPluginApi", + "section": "def-common.AuthenticatedUser", + "text": "AuthenticatedUser" + }, + " extends ", + "User" ], "source": { - "path": "x-pack/plugins/security/server/plugin.ts", - "lineNumber": 69 + "path": "x-pack/plugins/security/common/model/authenticated_user.ts", + "lineNumber": 21 }, "deprecated": false, "children": [ { "parentPluginId": "security", - "id": "def-server.SecurityPluginSetup.authc", + "id": "def-common.AuthenticatedUser.authentication_realm", "type": "Object", - "tags": [ - "deprecated" + "tags": [], + "label": "authentication_realm", + "description": [ + "\nThe name and type of the Realm that has authenticated the user." ], - "label": "authc", - "description": [], "signature": [ - "{ getCurrentUser: (request: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.KibanaRequest", - "text": "KibanaRequest" - }, - ") => ", - "AuthenticatedUser", - " | null; }" + "UserRealm" ], "source": { - "path": "x-pack/plugins/security/server/plugin.ts", - "lineNumber": 73 + "path": "x-pack/plugins/security/common/model/authenticated_user.ts", + "lineNumber": 25 }, - "deprecated": true, - "references": [ - { - "plugin": "reporting", - "link": { - "path": "x-pack/plugins/reporting/server/routes/lib/get_user.ts", - "lineNumber": 13 - } - }, - { - "plugin": "encryptedSavedObjects", - "link": { - "path": "x-pack/plugins/encrypted_saved_objects/server/crypto/encryption_key_rotation_service.ts", - "lineNumber": 107 - } - }, - { - "plugin": "encryptedSavedObjects", - "link": { - "path": "x-pack/plugins/encrypted_saved_objects/server/saved_objects/index.ts", - "lineNumber": 67 - } - }, - { - "plugin": "actions", - "link": { - "path": "x-pack/plugins/actions/server/plugin.ts", - "lineNumber": 444 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/server/routes/annotations.ts", - "lineNumber": 105 - } - }, - { - "plugin": "cases", - "link": { - "path": "x-pack/plugins/cases/server/plugin.ts", - "lineNumber": 89 - } - }, - { - "plugin": "dashboardMode", - "link": { - "path": "x-pack/plugins/dashboard_mode/server/interceptors/dashboard_mode_request_interceptor.ts", - "lineNumber": 33 - } - }, - { - "plugin": "dataEnhanced", - "link": { - "path": "x-pack/plugins/data_enhanced/server/search/session/session_service.ts", - "lineNumber": 448 - } - }, - { - "plugin": "logstash", - "link": { - "path": "x-pack/plugins/logstash/server/routes/pipeline/save.ts", - "lineNumber": 41 - } - }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/create_signals_migration_route.ts", - "lineNumber": 48 - } - }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/delete_signals_migration_route.ts", - "lineNumber": 45 - } - }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.ts", - "lineNumber": 45 - } - }, - { - "plugin": "securitySolution", - "link": { - "path": "x-pack/plugins/security_solution/server/lib/timeline/utils/common.ts", - "lineNumber": 28 - } - } - ] + "deprecated": false }, { "parentPluginId": "security", - "id": "def-server.SecurityPluginSetup.authz", + "id": "def-common.AuthenticatedUser.lookup_realm", "type": "Object", - "tags": [ - "deprecated" + "tags": [], + "label": "lookup_realm", + "description": [ + "\nThe name and type of the Realm where the user information were retrieved from." ], - "label": "authz", - "description": [], "signature": [ - "{ mode: ", - "AuthorizationMode", - "; actions: ", - "Actions", - "; checkPrivilegesDynamicallyWithRequest: ", - "CheckPrivilegesDynamicallyWithRequest", - "; checkPrivilegesWithRequest: ", - "CheckPrivilegesWithRequest", - "; }" + "UserRealm" ], "source": { - "path": "x-pack/plugins/security/server/plugin.ts", - "lineNumber": 77 + "path": "x-pack/plugins/security/common/model/authenticated_user.ts", + "lineNumber": 30 }, - "deprecated": true, - "references": [ - { - "plugin": "actions", - "link": { - "path": "x-pack/plugins/actions/server/plugin.ts", - "lineNumber": 443 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/server/saved_objects/initialization/initialization.ts", - "lineNumber": 54 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/server/plugin.ts", - "lineNumber": 153 - } - }, - { - "plugin": "ml", - "link": { - "path": "x-pack/plugins/ml/server/plugin.ts", - "lineNumber": 203 - } - }, - { - "plugin": "enterpriseSearch", - "link": { - "path": "x-pack/plugins/enterprise_search/server/lib/check_access.ts", - "lineNumber": 46 - } - }, - { - "plugin": "enterpriseSearch", - "link": { - "path": "x-pack/plugins/enterprise_search/server/lib/check_access.ts", - "lineNumber": 86 - } - }, - { - "plugin": "enterpriseSearch", - "link": { - "path": "x-pack/plugins/enterprise_search/server/lib/check_access.ts", - "lineNumber": 88 - } - }, - { - "plugin": "savedObjectsTagging", - "link": { - "path": "x-pack/plugins/saved_objects_tagging/server/request_handler_context.ts", - "lineNumber": 37 - } - } - ] + "deprecated": false }, { "parentPluginId": "security", - "id": "def-server.SecurityPluginSetup.license", + "id": "def-common.AuthenticatedUser.authentication_provider", "type": "Object", "tags": [], - "label": "license", - "description": [], + "label": "authentication_provider", + "description": [ + "\nThe authentication provider that used to authenticate user." + ], "signature": [ - "SecurityLicense" + "AuthenticationProvider" ], "source": { - "path": "x-pack/plugins/security/server/plugin.ts", - "lineNumber": 81 + "path": "x-pack/plugins/security/common/model/authenticated_user.ts", + "lineNumber": 35 }, "deprecated": false }, { "parentPluginId": "security", - "id": "def-server.SecurityPluginSetup.audit", - "type": "Object", + "id": "def-common.AuthenticatedUser.authentication_type", + "type": "string", "tags": [], - "label": "audit", - "description": [], - "signature": [ - "AuditServiceSetup" + "label": "authentication_type", + "description": [ + "\nThe AuthenticationType used by ES to authenticate the user.\n" ], "source": { - "path": "x-pack/plugins/security/server/plugin.ts", - "lineNumber": 82 + "path": "x-pack/plugins/security/common/model/authenticated_user.ts", + "lineNumber": 42 }, "deprecated": false } @@ -1492,68 +2277,106 @@ }, { "parentPluginId": "security", - "id": "def-server.SecurityPluginStart", + "id": "def-common.SecurityLicense", "type": "Interface", "tags": [], - "label": "SecurityPluginStart", - "description": [ - "\nDescribes public Security plugin contract returned at the `start` stage." - ], + "label": "SecurityLicense", + "description": [], "source": { - "path": "x-pack/plugins/security/server/plugin.ts", - "lineNumber": 88 + "path": "x-pack/plugins/security/common/licensing/license_service.ts", + "lineNumber": 14 }, "deprecated": false, "children": [ { "parentPluginId": "security", - "id": "def-server.SecurityPluginStart.authc", - "type": "Object", + "id": "def-common.SecurityLicense.isLicenseAvailable", + "type": "Function", "tags": [], - "label": "authc", + "label": "isLicenseAvailable", "description": [], "signature": [ - "{ getCurrentUser: (request: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.KibanaRequest", - "text": "KibanaRequest" - }, - ") => ", - "AuthenticatedUser", - " | null; apiKeys: Pick<", - "APIKeys", - ", \"create\" | \"areAPIKeysEnabled\" | \"invalidate\" | \"grantAsInternalUser\" | \"invalidateAsInternalUser\">; }" + "() => boolean" ], "source": { - "path": "x-pack/plugins/security/server/plugin.ts", - "lineNumber": 89 + "path": "x-pack/plugins/security/common/licensing/license_service.ts", + "lineNumber": 15 }, - "deprecated": false + "deprecated": false, + "children": [], + "returnComment": [] }, { "parentPluginId": "security", - "id": "def-server.SecurityPluginStart.authz", + "id": "def-common.SecurityLicense.isEnabled", + "type": "Function", + "tags": [], + "label": "isEnabled", + "description": [], + "signature": [ + "() => boolean" + ], + "source": { + "path": "x-pack/plugins/security/common/licensing/license_service.ts", + "lineNumber": 16 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "security", + "id": "def-common.SecurityLicense.getType", + "type": "Function", + "tags": [], + "label": "getType", + "description": [], + "signature": [ + "() => \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined" + ], + "source": { + "path": "x-pack/plugins/security/common/licensing/license_service.ts", + "lineNumber": 17 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "security", + "id": "def-common.SecurityLicense.getFeatures", + "type": "Function", + "tags": [], + "label": "getFeatures", + "description": [], + "signature": [ + "() => ", + "SecurityLicenseFeatures" + ], + "source": { + "path": "x-pack/plugins/security/common/licensing/license_service.ts", + "lineNumber": 18 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "security", + "id": "def-common.SecurityLicense.features$", "type": "Object", "tags": [], - "label": "authz", + "label": "features$", "description": [], "signature": [ - "{ mode: ", - "AuthorizationMode", - "; actions: ", - "Actions", - "; checkPrivilegesDynamicallyWithRequest: ", - "CheckPrivilegesDynamicallyWithRequest", - "; checkPrivilegesWithRequest: ", - "CheckPrivilegesWithRequest", - "; }" + "Observable", + "<", + "SecurityLicenseFeatures", + ">" ], "source": { - "path": "x-pack/plugins/security/server/plugin.ts", - "lineNumber": 90 + "path": "x-pack/plugins/security/common/licensing/license_service.ts", + "lineNumber": 19 }, "deprecated": false } @@ -1562,59 +2385,6 @@ } ], "enums": [], - "misc": [ - { - "parentPluginId": "security", - "id": "def-server.AuthorizationServiceSetup", - "type": "Type", - "tags": [], - "label": "AuthorizationServiceSetup", - "description": [], - "signature": [ - "{ mode: ", - "AuthorizationMode", - "; actions: ", - "Actions", - "; checkPrivilegesDynamicallyWithRequest: ", - "CheckPrivilegesDynamicallyWithRequest", - "; checkPrivilegesWithRequest: ", - "CheckPrivilegesWithRequest", - "; }" - ], - "source": { - "path": "x-pack/plugins/security/server/index.ts", - "lineNumber": 30 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "security", - "id": "def-server.ROUTE_TAG_CAN_REDIRECT", - "type": "string", - "tags": [], - "label": "ROUTE_TAG_CAN_REDIRECT", - "description": [ - "\nIf the route is marked with this tag Security can safely assume that the calling party that sends\nrequest to this route can handle redirect responses. It's particularly important if we want the\nspecific route to be able to initiate or participate in the authentication handshake that may\ninvolve redirects and will eventually redirect authenticated user to this route." - ], - "signature": [ - "\"security:canRedirect\"" - ], - "source": { - "path": "x-pack/plugins/security/server/routes/tags.ts", - "lineNumber": 21 - }, - "deprecated": false, - "initialIsOpen": false - } - ], - "objects": [] - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], "misc": [], "objects": [] } diff --git a/api_docs/security.mdx b/api_docs/security.mdx index 4d2afe42cb1515..e31fa44014c941 100644 --- a/api_docs/security.mdx +++ b/api_docs/security.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import securityObj from './security.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 95 | 0 | 45 | 11 | + ## Client ### Setup @@ -22,11 +32,25 @@ import securityObj from './security.json'; ### Interfaces +### Consts, variables and types + + ## Server +### Setup + + +### Start + + ### Interfaces ### Consts, variables and types +## Common + +### Interfaces + + diff --git a/api_docs/security_oss.mdx b/api_docs/security_oss.mdx index f8c49a56551cd3..ada97232ffe846 100644 --- a/api_docs/security_oss.mdx +++ b/api_docs/security_oss.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import securityOssObj from './security_oss.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 12 | 0 | 9 | 3 | + ## Client ### Setup diff --git a/api_docs/security_solution.json b/api_docs/security_solution.json index a265ea7fdc7ac2..747ef4b4b715b0 100644 --- a/api_docs/security_solution.json +++ b/api_docs/security_solution.json @@ -43,7 +43,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/public/plugin.tsx", - "lineNumber": 74 + "lineNumber": 75 }, "deprecated": false, "children": [ @@ -59,7 +59,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/public/plugin.tsx", - "lineNumber": 78 + "lineNumber": 79 }, "deprecated": false, "children": [ @@ -82,7 +82,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/public/plugin.tsx", - "lineNumber": 78 + "lineNumber": 79 }, "deprecated": false, "isRequired": true @@ -123,7 +123,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/public/plugin.tsx", - "lineNumber": 102 + "lineNumber": 103 }, "deprecated": false, "children": [ @@ -150,7 +150,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/public/plugin.tsx", - "lineNumber": 102 + "lineNumber": 103 }, "deprecated": false, "isRequired": true @@ -167,7 +167,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/public/plugin.tsx", - "lineNumber": 102 + "lineNumber": 103 }, "deprecated": false, "isRequired": true @@ -197,7 +197,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/public/plugin.tsx", - "lineNumber": 343 + "lineNumber": 344 }, "deprecated": false, "children": [ @@ -219,7 +219,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/public/plugin.tsx", - "lineNumber": 343 + "lineNumber": 344 }, "deprecated": false, "isRequired": true @@ -236,7 +236,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/public/plugin.tsx", - "lineNumber": 343 + "lineNumber": 344 }, "deprecated": false, "isRequired": true @@ -256,7 +256,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/public/plugin.tsx", - "lineNumber": 388 + "lineNumber": 389 }, "deprecated": false, "children": [], @@ -445,7 +445,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 133 + "lineNumber": 143 }, "deprecated": false, "children": [ @@ -461,7 +461,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 148 + "lineNumber": 159 }, "deprecated": false, "children": [ @@ -484,7 +484,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 148 + "lineNumber": 159 }, "deprecated": false, "isRequired": true @@ -524,7 +524,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 160 + "lineNumber": 171 }, "deprecated": false, "children": [ @@ -557,7 +557,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 160 + "lineNumber": 171 }, "deprecated": false, "isRequired": true @@ -574,7 +574,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 160 + "lineNumber": 171 }, "deprecated": false, "isRequired": true @@ -604,7 +604,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 345 + "lineNumber": 471 }, "deprecated": false, "children": [ @@ -626,7 +626,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 345 + "lineNumber": 471 }, "deprecated": false, "isRequired": true @@ -643,7 +643,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 345 + "lineNumber": 471 }, "deprecated": false, "isRequired": true @@ -663,7 +663,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 420 + "lineNumber": 546 }, "deprecated": false, "children": [], @@ -747,7 +747,7 @@ "description": [], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 109 + "lineNumber": 127 }, "deprecated": false, "children": [], @@ -763,7 +763,7 @@ "description": [], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 112 + "lineNumber": 130 }, "deprecated": false, "children": [], diff --git a/api_docs/security_solution.mdx b/api_docs/security_solution.mdx index b38a877f7edd56..0667a98e3762bf 100644 --- a/api_docs/security_solution.mdx +++ b/api_docs/security_solution.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import securitySolutionObj from './security_solution.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 32 | 0 | 32 | 6 | + ## Client ### Setup diff --git a/api_docs/share.json b/api_docs/share.json index 82f5b8697b72df..41b7ecc38e1f05 100644 --- a/api_docs/share.json +++ b/api_docs/share.json @@ -124,7 +124,7 @@ ], "source": { "path": "src/plugins/share/public/url_generators/url_generator_service.ts", - "lineNumber": 25 + "lineNumber": 35 }, "deprecated": false, "children": [ @@ -140,7 +140,7 @@ ], "source": { "path": "src/plugins/share/public/url_generators/url_generator_service.ts", - "lineNumber": 30 + "lineNumber": 40 }, "deprecated": false, "children": [], @@ -167,7 +167,7 @@ ], "source": { "path": "src/plugins/share/public/url_generators/url_generator_service.ts", - "lineNumber": 32 + "lineNumber": 42 }, "deprecated": false, "children": [ @@ -190,7 +190,7 @@ ], "source": { "path": "src/plugins/share/public/url_generators/url_generator_service.ts", - "lineNumber": 32 + "lineNumber": 42 }, "deprecated": false, "isRequired": true @@ -219,7 +219,7 @@ ], "source": { "path": "src/plugins/share/public/url_generators/url_generator_service.ts", - "lineNumber": 45 + "lineNumber": 55 }, "deprecated": false, "children": [ @@ -241,7 +241,7 @@ ], "source": { "path": "src/plugins/share/public/url_generators/url_generator_service.ts", - "lineNumber": 45 + "lineNumber": 55 }, "deprecated": false, "isRequired": true @@ -261,7 +261,7 @@ ], "source": { "path": "src/plugins/share/public/url_generators/url_generator_service.ts", - "lineNumber": 52 + "lineNumber": 62 }, "deprecated": false, "children": [], @@ -1316,11 +1316,13 @@ }, ") => void; } & { urlGenerators: ", "UrlGeneratorsSetup", + "; url: ", + "UrlService", "; }" ], "source": { "path": "src/plugins/share/public/plugin.ts", - "lineNumber": 56 + "lineNumber": 32 }, "deprecated": false, "lifecycle": "setup", @@ -1344,11 +1346,13 @@ }, ") => void; } & { urlGenerators: ", "UrlGeneratorsStart", + "; url: ", + "UrlService", "; }" ], "source": { "path": "src/plugins/share/public/plugin.ts", - "lineNumber": 61 + "lineNumber": 47 }, "deprecated": false, "lifecycle": "start", diff --git a/api_docs/share.mdx b/api_docs/share.mdx index e2a9da26c0fc46..58886148bd4a7b 100644 --- a/api_docs/share.mdx +++ b/api_docs/share.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import shareObj from './share.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 67 | 1 | 61 | 4 | + ## Client ### Setup diff --git a/api_docs/snapshot_restore.mdx b/api_docs/snapshot_restore.mdx index a0fc3231baf4d9..ab2f9175987378 100644 --- a/api_docs/snapshot_restore.mdx +++ b/api_docs/snapshot_restore.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import snapshotRestoreObj from './snapshot_restore.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 22 | 1 | 22 | 1 | + ## Common ### Objects diff --git a/api_docs/spaces.json b/api_docs/spaces.json index 2f2d79c2379d58..002145f3b48db6 100644 --- a/api_docs/spaces.json +++ b/api_docs/spaces.json @@ -1203,7 +1203,7 @@ "plugin": "security", "link": { "path": "x-pack/plugins/security/server/plugin.ts", - "lineNumber": 263 + "lineNumber": 267 } }, { @@ -1245,7 +1245,7 @@ "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 194 + "lineNumber": 206 } }, { @@ -2002,28 +2002,28 @@ "plugin": "security", "link": { "path": "x-pack/plugins/security/server/plugin.ts", - "lineNumber": 57 + "lineNumber": 60 } }, { "plugin": "security", "link": { "path": "x-pack/plugins/security/server/plugin.ts", - "lineNumber": 263 + "lineNumber": 267 } }, { "plugin": "security", "link": { "path": "x-pack/plugins/security/server/plugin.ts", - "lineNumber": 281 + "lineNumber": 285 } }, { "plugin": "security", "link": { "path": "x-pack/plugins/security/server/plugin.ts", - "lineNumber": 297 + "lineNumber": 301 } }, { @@ -2086,7 +2086,7 @@ "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 194 + "lineNumber": 206 } } ] diff --git a/api_docs/spaces.mdx b/api_docs/spaces.mdx index ccaffdd3748b55..197fe460b47d35 100644 --- a/api_docs/spaces.mdx +++ b/api_docs/spaces.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import spacesObj from './spaces.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 96 | 0 | 0 | 0 | + ## Client ### Setup diff --git a/api_docs/spaces_oss.mdx b/api_docs/spaces_oss.mdx index e889a319f5f23c..b36b0b4c19aff4 100644 --- a/api_docs/spaces_oss.mdx +++ b/api_docs/spaces_oss.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import spacesOssObj from './spaces_oss.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 71 | 0 | 5 | 0 | + ## Client ### Setup diff --git a/api_docs/stack_alerts.mdx b/api_docs/stack_alerts.mdx index 9fbed513491dd0..eefe0a2dc76fe7 100644 --- a/api_docs/stack_alerts.mdx +++ b/api_docs/stack_alerts.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import stackAlertsObj from './stack_alerts.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 4 | 0 | 4 | 0 | + ## Server ### Consts, variables and types diff --git a/api_docs/task_manager.json b/api_docs/task_manager.json index 61e37fa5acc0ce..34f16e8ad309b6 100644 --- a/api_docs/task_manager.json +++ b/api_docs/task_manager.json @@ -364,7 +364,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 297 + "lineNumber": 302 }, "deprecated": false, "children": [ @@ -379,7 +379,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 302 + "lineNumber": 307 }, "deprecated": false }, @@ -397,7 +397,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 307 + "lineNumber": 312 }, "deprecated": false }, @@ -415,7 +415,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 313 + "lineNumber": 318 }, "deprecated": false }, @@ -430,7 +430,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 319 + "lineNumber": 324 }, "deprecated": false }, @@ -454,7 +454,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 324 + "lineNumber": 329 }, "deprecated": false }, @@ -472,7 +472,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 330 + "lineNumber": 335 }, "deprecated": false }, @@ -490,7 +490,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 337 + "lineNumber": 342 }, "deprecated": false }, @@ -508,7 +508,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 343 + "lineNumber": 348 }, "deprecated": false }, @@ -526,7 +526,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 353 + "lineNumber": 358 }, "deprecated": false }, @@ -544,7 +544,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 358 + "lineNumber": 363 }, "deprecated": false } @@ -766,6 +766,24 @@ }, "deprecated": false }, + { + "parentPluginId": "taskManager", + "id": "def-server.TaskInstance.traceparent", + "type": "string", + "tags": [], + "label": "traceparent", + "description": [ + "\nThe serialized traceparent string of the current APM transaction or span." + ], + "signature": [ + "string | undefined" + ], + "source": { + "path": "x-pack/plugins/task_manager/server/task.ts", + "lineNumber": 263 + }, + "deprecated": false + }, { "parentPluginId": "taskManager", "id": "def-server.TaskInstance.user", @@ -780,7 +798,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 263 + "lineNumber": 268 }, "deprecated": false }, @@ -798,7 +816,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 269 + "lineNumber": 274 }, "deprecated": false }, @@ -816,7 +834,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 274 + "lineNumber": 279 }, "deprecated": false } diff --git a/api_docs/task_manager.mdx b/api_docs/task_manager.mdx index b143323bf1c7a5..5c6d5b3d08ba48 100644 --- a/api_docs/task_manager.mdx +++ b/api_docs/task_manager.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import taskManagerObj from './task_manager.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 44 | 0 | 18 | 7 | + ## Server ### Setup diff --git a/api_docs/telemetry.json b/api_docs/telemetry.json index 5a4d029dc0938b..30c80119d62e25 100644 --- a/api_docs/telemetry.json +++ b/api_docs/telemetry.json @@ -15,7 +15,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 82 + "lineNumber": 90 }, "deprecated": false, "children": [ @@ -30,7 +30,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 84 + "lineNumber": 92 }, "deprecated": false }, @@ -45,7 +45,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 86 + "lineNumber": 94 }, "deprecated": false }, @@ -60,7 +60,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 88 + "lineNumber": 96 }, "deprecated": false }, @@ -75,7 +75,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 90 + "lineNumber": 98 }, "deprecated": false }, @@ -93,7 +93,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 92 + "lineNumber": 100 }, "deprecated": false }, @@ -108,7 +108,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 94 + "lineNumber": 102 }, "deprecated": false }, @@ -126,7 +126,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 96 + "lineNumber": 104 }, "deprecated": false }, @@ -144,7 +144,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 98 + "lineNumber": 106 }, "deprecated": false }, @@ -162,7 +162,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 100 + "lineNumber": 108 }, "deprecated": false } @@ -180,7 +180,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 36 + "lineNumber": 38 }, "deprecated": false, "children": [ @@ -198,7 +198,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 38 + "lineNumber": 40 }, "deprecated": false, "returnComment": [], @@ -215,10 +215,30 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 40 + "lineNumber": 42 }, "deprecated": false }, + { + "parentPluginId": "telemetry", + "id": "def-public.TelemetryServicePublicApis.canSendTelemetry", + "type": "Function", + "tags": [], + "label": "canSendTelemetry", + "description": [ + "Can phone-home telemetry calls be made? This depends on whether we have opted-in or if we are rendering a report" + ], + "signature": [ + "() => boolean" + ], + "source": { + "path": "src/plugins/telemetry/public/plugin.ts", + "lineNumber": 44 + }, + "deprecated": false, + "returnComment": [], + "children": [] + }, { "parentPluginId": "telemetry", "id": "def-public.TelemetryServicePublicApis.getCanChangeOptInStatus", @@ -233,7 +253,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 42 + "lineNumber": 46 }, "deprecated": false, "returnComment": [], @@ -253,7 +273,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 44 + "lineNumber": 48 }, "deprecated": false, "returnComment": [], @@ -273,7 +293,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 50 + "lineNumber": 54 }, "deprecated": false, "returnComment": [], @@ -289,7 +309,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 50 + "lineNumber": 54 }, "deprecated": false } @@ -313,7 +333,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 64 + "lineNumber": 68 }, "deprecated": false, "children": [ @@ -337,7 +357,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 66 + "lineNumber": 70 }, "deprecated": false }, @@ -355,7 +375,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 68 + "lineNumber": 72 }, "deprecated": false }, @@ -373,7 +393,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 73 + "lineNumber": 77 }, "deprecated": false } @@ -392,7 +412,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 56 + "lineNumber": 60 }, "deprecated": false, "children": [ @@ -416,7 +436,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 58 + "lineNumber": 62 }, "deprecated": false } @@ -641,7 +661,7 @@ "text": "NodeUsage" }, " extends ", - "NodeUsageInformation" + "NodesUsageNodeUsage" ], "source": { "path": "src/plugins/telemetry/server/telemetry_collection/get_nodes_usage.ts", diff --git a/api_docs/telemetry.mdx b/api_docs/telemetry.mdx index 995c9b22e268ab..f8d632c0d97082 100644 --- a/api_docs/telemetry.mdx +++ b/api_docs/telemetry.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import telemetryObj from './telemetry.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 42 | 0 | 0 | 0 | + ## Client ### Setup diff --git a/api_docs/telemetry_collection_manager.json b/api_docs/telemetry_collection_manager.json index d30ff36b560934..681e10bd3ffaa4 100644 --- a/api_docs/telemetry_collection_manager.json +++ b/api_docs/telemetry_collection_manager.json @@ -86,7 +86,7 @@ "signature": [ "Pick<", "KibanaClient", - ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"helpers\" | \"count\" | \"search\" | \"security\" | \"eql\" | \"on\" | \"off\" | \"transform\" | \"emit\" | \"once\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", + ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"helpers\" | \"count\" | \"search\" | \"security\" | \"eql\" | \"on\" | \"off\" | \"transform\" | \"emit\" | \"once\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", "TransportRequestParams", ", options?: ", "TransportRequestOptions", diff --git a/api_docs/telemetry_collection_manager.mdx b/api_docs/telemetry_collection_manager.mdx index d112897e1c4899..749ec3ba2bd71e 100644 --- a/api_docs/telemetry_collection_manager.mdx +++ b/api_docs/telemetry_collection_manager.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import telemetryCollectionManagerObj from './telemetry_collection_manager.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 29 | 0 | 29 | 4 | + ## Server ### Setup diff --git a/api_docs/telemetry_collection_xpack.json b/api_docs/telemetry_collection_xpack.json index a97647773c7f14..1dd45d1d619f16 100644 --- a/api_docs/telemetry_collection_xpack.json +++ b/api_docs/telemetry_collection_xpack.json @@ -22,7 +22,7 @@ "label": "ESLicense", "description": [], "signature": [ - "LicenseInformation" + "LicenseGetLicenseInformation" ], "source": { "path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts", diff --git a/api_docs/telemetry_collection_xpack.mdx b/api_docs/telemetry_collection_xpack.mdx index 058a9d3fcb460e..53914260b037f3 100644 --- a/api_docs/telemetry_collection_xpack.mdx +++ b/api_docs/telemetry_collection_xpack.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import telemetryCollectionXpackObj from './telemetry_collection_xpack.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 1 | 0 | 1 | 0 | + ## Server ### Consts, variables and types diff --git a/api_docs/telemetry_management_section.mdx b/api_docs/telemetry_management_section.mdx index 78193e3485c591..71831a66284fc5 100644 --- a/api_docs/telemetry_management_section.mdx +++ b/api_docs/telemetry_management_section.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import telemetryManagementSectionObj from './telemetry_management_section.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 14 | 0 | 13 | 0 | + ## Client ### Setup diff --git a/api_docs/timelines.mdx b/api_docs/timelines.mdx index cb16e39419a438..e9d4a75e39991a 100644 --- a/api_docs/timelines.mdx +++ b/api_docs/timelines.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import timelinesObj from './timelines.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 6 | 0 | 6 | 1 | + ## Client ### Setup diff --git a/api_docs/triggers_actions_ui.json b/api_docs/triggers_actions_ui.json index de7a13b3080fe0..bccb50d96759ad 100644 --- a/api_docs/triggers_actions_ui.json +++ b/api_docs/triggers_actions_ui.json @@ -422,60 +422,6 @@ ], "initialIsOpen": false }, - { - "parentPluginId": "triggersActionsUi", - "id": "def-public.getActionType", - "type": "Function", - "tags": [], - "label": "getActionType", - "description": [], - "signature": [ - "() => ", - "ActionTypeModel", - "<", - "JiraConfig", - ", ", - "JiraSecrets", - ", ", - "JiraActionParams", - ">" - ], - "source": { - "path": "x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/jira/jira.tsx", - "lineNumber": 62 - }, - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "triggersActionsUi", - "id": "def-public.getActionType", - "type": "Function", - "tags": [], - "label": "getActionType", - "description": [], - "signature": [ - "() => ", - "ActionTypeModel", - "<", - "ResilientConfig", - ", ", - "ResilientSecrets", - ", ", - "ResilientActionParams", - ">" - ], - "source": { - "path": "x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/resilient/resilient.tsx", - "lineNumber": 67 - }, - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, { "parentPluginId": "triggersActionsUi", "id": "def-public.getFields", @@ -656,60 +602,6 @@ "returnComment": [], "initialIsOpen": false }, - { - "parentPluginId": "triggersActionsUi", - "id": "def-public.getServiceNowITSMActionType", - "type": "Function", - "tags": [], - "label": "getServiceNowITSMActionType", - "description": [], - "signature": [ - "() => ", - "ActionTypeModel", - "<", - "ServiceNowConfig", - ", ", - "ServiceNowSecrets", - ", ", - "ServiceNowITSMActionParams", - ">" - ], - "source": { - "path": "x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow.tsx", - "lineNumber": 63 - }, - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "triggersActionsUi", - "id": "def-public.getServiceNowSIRActionType", - "type": "Function", - "tags": [], - "label": "getServiceNowSIRActionType", - "description": [], - "signature": [ - "() => ", - "ActionTypeModel", - "<", - "ServiceNowConfig", - ", ", - "ServiceNowSecrets", - ", ", - "ServiceNowSIRActionParams", - ">" - ], - "source": { - "path": "x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow.tsx", - "lineNumber": 98 - }, - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, { "parentPluginId": "triggersActionsUi", "id": "def-public.getTimeFieldOptions", diff --git a/api_docs/triggers_actions_ui.mdx b/api_docs/triggers_actions_ui.mdx index 50a7a11abdf16c..91327ad1f990f3 100644 --- a/api_docs/triggers_actions_ui.mdx +++ b/api_docs/triggers_actions_ui.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import triggersActionsUiObj from './triggers_actions_ui.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 237 | 1 | 228 | 19 | + ## Client ### Setup diff --git a/api_docs/ui_actions.json b/api_docs/ui_actions.json index b623984736ee15..cb35cacedf7bae 100644 --- a/api_docs/ui_actions.json +++ b/api_docs/ui_actions.json @@ -775,7 +775,7 @@ "plugin": "discover", "link": { "path": "src/plugins/discover/public/application/embeddable/search_embeddable.ts", - "lineNumber": 114 + "lineNumber": 115 } }, { diff --git a/api_docs/ui_actions.mdx b/api_docs/ui_actions.mdx index 9833f2a19e63ac..9045dc736bb2f8 100644 --- a/api_docs/ui_actions.mdx +++ b/api_docs/ui_actions.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import uiActionsObj from './ui_actions.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 127 | 0 | 88 | 11 | + ## Client ### Setup diff --git a/api_docs/ui_actions_enhanced.mdx b/api_docs/ui_actions_enhanced.mdx index 285232bf3fe0cd..3e9c9247532290 100644 --- a/api_docs/ui_actions_enhanced.mdx +++ b/api_docs/ui_actions_enhanced.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import uiActionsEnhancedObj from './ui_actions_enhanced.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 205 | 2 | 147 | 10 | + ## Client ### Setup diff --git a/api_docs/uptime.mdx b/api_docs/uptime.mdx index 8d63edcd18ecad..ceb7d854a8fecc 100644 --- a/api_docs/uptime.mdx +++ b/api_docs/uptime.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import uptimeObj from './uptime.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 6 | 0 | 6 | 3 | + ## Server ### Functions diff --git a/api_docs/url_forwarding.mdx b/api_docs/url_forwarding.mdx index a80a1e0e53f277..b457ca9eb331fa 100644 --- a/api_docs/url_forwarding.mdx +++ b/api_docs/url_forwarding.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import urlForwardingObj from './url_forwarding.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 15 | 0 | 15 | 0 | + ## Client ### Classes diff --git a/api_docs/usage_collection.json b/api_docs/usage_collection.json index ab02b8b567fb8b..e0912fe6bed40a 100644 --- a/api_docs/usage_collection.json +++ b/api_docs/usage_collection.json @@ -777,7 +777,7 @@ "\nPossible type values in the schema" ], "signature": [ - "\"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"short\" | \"integer\" | \"byte\" | \"float\"" + "\"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"short\" | \"float\" | \"integer\" | \"byte\"" ], "source": { "path": "src/plugins/usage_collection/server/collector/types.ts", diff --git a/api_docs/usage_collection.mdx b/api_docs/usage_collection.mdx index 62db0389c2d5cd..197cfc72f17afb 100644 --- a/api_docs/usage_collection.mdx +++ b/api_docs/usage_collection.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import usageCollectionObj from './usage_collection.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 57 | 0 | 16 | 2 | + ## Client ### Setup diff --git a/api_docs/vis_type_timeseries.mdx b/api_docs/vis_type_timeseries.mdx index 041d01196bad9d..a904e00ef0efc5 100644 --- a/api_docs/vis_type_timeseries.mdx +++ b/api_docs/vis_type_timeseries.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import visTypeTimeseriesObj from './vis_type_timeseries.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 10 | 1 | 10 | 3 | + ## Server ### Setup diff --git a/api_docs/visualizations.json b/api_docs/visualizations.json index 0df428a158a3da..83f9436420dcd2 100644 --- a/api_docs/visualizations.json +++ b/api_docs/visualizations.json @@ -1888,7 +1888,7 @@ "label": "group", "description": [], "signature": [ - "\"buckets\" | \"metrics\" | \"none\"" + "\"none\" | \"buckets\" | \"metrics\"" ], "source": { "path": "src/plugins/visualizations/public/vis_types/types.ts", diff --git a/api_docs/visualizations.mdx b/api_docs/visualizations.mdx index d3834b2d5f83f8..c6d9bdc741d4af 100644 --- a/api_docs/visualizations.mdx +++ b/api_docs/visualizations.mdx @@ -11,6 +11,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import visualizationsObj from './visualizations.json'; + + + + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 246 | 13 | 228 | 12 | + ## Client ### Setup diff --git a/dev_docs/tutorials/expressions.mdx b/dev_docs/tutorials/expressions.mdx index f0fc1dc595cfa4..4688da98b7b019 100644 --- a/dev_docs/tutorials/expressions.mdx +++ b/dev_docs/tutorials/expressions.mdx @@ -9,23 +9,26 @@ tags: ['kibana', 'onboarding', 'dev', 'architecture'] ## Expressions service -Expression service exposes a registry of reusable functions primary used for fetching and transposing data and a registry of renderer functions that can render data into a DOM element. -Adding functions is easy and so is reusing them. An expression is a chain of functions with provided arguments, which given a single input translates to a single output. +Expression service exposes a registry of reusable functions primary used for fetching and transposing data and a registry of renderer functions that can render data into a DOM element. +Adding functions is easy and so is reusing them. + +An expression is a chain of functions with provided arguments, which given a single input translates to a single output. Each expression is representable by a human friendly string which a user can type. -### creating expressions +### Creating expressions Here is a very simple expression string: - essql 'select column1, column2 from myindex' | mapColumn name=column3 fn='{ column1 + 3 }' | table - +``` +essql 'select column1, column2 from myindex' | mapColumn name=column3 fn='{ column1 + 3 }' | table +``` It consists of 3 functions: - - essql which runs given sql query against elasticsearch and returns the results + - `essql` which runs given sql query against elasticsearch and returns the results - `mapColumn`, which computes a new column from existing ones; - `table`, which prepares the data for rendering in a tabular format. - + The same expression could also be constructed in the code: ```ts @@ -40,7 +43,7 @@ const expression = buildExpression([ Note: Consumers need to be aware which plugin registers specific functions with expressions function registry and import correct type definitions from there. - + The `expressions` service is available on both server and client, with similar APIs. @@ -53,7 +56,7 @@ const executionContract = expressions.execute(expression, input); const result = await executionContract.getData(); ``` - + Check the full spec of execute function [here](https://github.com/elastic/kibana/blob/master/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.execution.md) @@ -61,13 +64,13 @@ In addition, on the browser side, there are two additional ways to run expressio #### React expression renderer component -This is the easiest way to get expressions rendered inside your application. +This is the easiest way to get expressions rendered inside your application. ```ts ``` - + Check the full spec of ReactExpressionRenderer component props [here](https://github.com/elastic/kibana/blob/master/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.reactexpressionrendererprops.md) @@ -79,7 +82,7 @@ If you are not using React, you can use the loader expression service provides t const handler = loader(domElement, expression, params); ``` - + Check the full spec of expression loader params [here](https://github.com/elastic/kibana/blob/master/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.iexpressionloaderparams.md) @@ -102,7 +105,7 @@ const functionDefinition = { expressions.registerFunction(functionDefinition); ``` - + Check the full interface of ExpressionFuntionDefinition [here](https://github.com/elastic/kibana/blob/master/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.expressionfunctiondefinition.md) @@ -124,6 +127,6 @@ const rendererDefinition = { expressions.registerRenderer(rendererDefinition); ``` - + Check the full interface of ExpressionRendererDefinition [here](https://github.com/elastic/kibana/blob/master/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.expressionrenderdefinition.md) diff --git a/docs/api/index-patterns.asciidoc b/docs/api/index-patterns.asciidoc index 79d2f164fb8c3b..b343d80b4fc15c 100644 --- a/docs/api/index-patterns.asciidoc +++ b/docs/api/index-patterns.asciidoc @@ -20,6 +20,12 @@ The following index patterns APIs are available: ** <> to set a default index pattern * Fields ** <> to change field metadata, such as `count`, `customLabel` and `format` +* Runtime fields + ** <> to retrieve a runtime field + ** <> to create a runtime field + ** <> to create or update a runtime field + ** <> to partially update an existing runtime field + ** <> to delete a runtime field include::index-patterns/get.asciidoc[] include::index-patterns/create.asciidoc[] @@ -28,3 +34,9 @@ include::index-patterns/delete.asciidoc[] include::index-patterns/default-get.asciidoc[] include::index-patterns/default-set.asciidoc[] include::index-patterns/update-fields.asciidoc[] +include::index-patterns/runtime-fields/get.asciidoc[] +include::index-patterns/runtime-fields/create.asciidoc[] +include::index-patterns/runtime-fields/upsert.asciidoc[] +include::index-patterns/runtime-fields/update.asciidoc[] +include::index-patterns/runtime-fields/delete.asciidoc[] + diff --git a/docs/api/index-patterns/create.asciidoc b/docs/api/index-patterns/create.asciidoc index 771292d6f934d5..521e25931ad49f 100644 --- a/docs/api/index-patterns/create.asciidoc +++ b/docs/api/index-patterns/create.asciidoc @@ -84,6 +84,7 @@ $ curl -X POST api/index_patterns/index_pattern "typeMeta": {}, "fieldFormats": {}, "fieldAttrs": {}, + "runtimeFieldMap": {} "allowNoIndex": "..." } } diff --git a/docs/api/index-patterns/get.asciidoc b/docs/api/index-patterns/get.asciidoc index 3f53bf0726bf14..64588e63f62ae3 100644 --- a/docs/api/index-patterns/get.asciidoc +++ b/docs/api/index-patterns/get.asciidoc @@ -58,6 +58,7 @@ The API returns an index pattern object: "typeMeta": {}, "fieldFormats": {}, "fieldAttrs": {}, + "runtimeFieldMap" {}, "allowNoIndex: "..." } } diff --git a/docs/api/index-patterns/runtime-fields/create.asciidoc b/docs/api/index-patterns/runtime-fields/create.asciidoc new file mode 100644 index 00000000000000..b0773c29e5309f --- /dev/null +++ b/docs/api/index-patterns/runtime-fields/create.asciidoc @@ -0,0 +1,61 @@ +[[index-patterns-runtime-field-api-create]] +=== Create runtime field API +++++ +Create runtime field +++++ + +experimental[] Create a runtime field + +[[index-patterns-runtime-field-create-request]] +==== Request + +`POST :/api/index_patterns/index_pattern//runtime_field` + +`POST :/s//api/index_patterns/index_pattern//runtime_field` + +[[index-patterns-runtime-field-create-params]] +==== Path parameters + +`space_id`:: +(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. + +`index_pattern_id`:: +(Required, string) The ID of the index pattern. + +[[index-patterns-runtime-field-create-body]] +==== Request body + +`name`:: (Required, string) The name for a runtime field. + +`runtimeField`:: (Required, object) The runtime field definition object. + + +[[index-patterns-runtime-field-create-example]] +==== Examples + +Create a runtime field on an index pattern: + +[source,sh] +-------------------------------------------------- +$ curl -X POST api/index_patterns/index_pattern//runtime_field +{ + "name": "runtimeFoo", + "runtimeField": { + "type": "long", + "script": { + "source": "emit(doc["foo"].value)" + } + } +} +-------------------------------------------------- +// KIBANA + +The API returns created runtime field object and update index pattern object: + +[source,sh] +-------------------------------------------------- +{ + "index_pattern": {...}, + "field": {...} +} +-------------------------------------------------- diff --git a/docs/api/index-patterns/runtime-fields/delete.asciidoc b/docs/api/index-patterns/runtime-fields/delete.asciidoc new file mode 100644 index 00000000000000..840789fe1ec23f --- /dev/null +++ b/docs/api/index-patterns/runtime-fields/delete.asciidoc @@ -0,0 +1,37 @@ +[[index-patterns-runtime-field-api-delete]] +=== Delete runtime field API +++++ +Delete runtime field +++++ + +experimental[] Delete a runtime field from an index pattern. + +[[index-patterns-runtime-field-api-delete-request]] +==== Request + +`DELETE :/api/index_patterns/index_pattern//runtime_field/` + +`DELETE :/s//api/index_patterns/index_pattern//runtime_field/` + +[[index-patterns-runtime-field-api-delete-path-params]] +==== Path parameters + +`space_id`:: +(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. + +`index_pattern_id`:: +(Required, string) The ID of the index pattern your want to delete a runtime field from. + +`name`:: +(Required, string) The name of the runtime field you want to delete. + + +==== Example + +Delete a runtime field from an index pattern: + +[source,sh] +-------------------------------------------------- +$ curl -X DELETE api/index_patterns/index_pattern//runtime_field/ +-------------------------------------------------- +// KIBANA diff --git a/docs/api/index-patterns/runtime-fields/get.asciidoc b/docs/api/index-patterns/runtime-fields/get.asciidoc new file mode 100644 index 00000000000000..42bd209c708bc3 --- /dev/null +++ b/docs/api/index-patterns/runtime-fields/get.asciidoc @@ -0,0 +1,52 @@ +[[index-patterns-runtime-field-api-get]] +=== Get runtime field API +++++ +Get runtime field +++++ + +experimental[] Get a runtime field + +[[index-patterns-runtime-field-get-request]] +==== Request + +`GET :/api/index_patterns/index_pattern//runtime_field/` + +`GET :/s//api/index_patterns/index_pattern//runtime_field/` + +[[index-patterns-runtime-field-get-params]] +==== Path parameters + +`space_id`:: +(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. + +`index_pattern_id`:: +(Required, string) The ID of the index pattern. + +`name`:: +(Required, string) The name of the runtime field you want to retrieve. + + +[[index-patterns-runtime-field-get-example]] +==== Example + +Retrieve a runtime field named `foo` of index pattern with the `my-pattern` ID: + +[source,sh] +-------------------------------------------------- +$ curl -X GET api/index_patterns/index_pattern/my-pattern/runtime_field/foo +-------------------------------------------------- +// KIBANA + +The API returns a runtime `field` object, and a `runtimeField` definition object: + +[source,sh] +-------------------------------------------------- +{ + "field": { + ... + }, + "runtimeField": { + ... + } +} +-------------------------------------------------- diff --git a/docs/api/index-patterns/runtime-fields/update.asciidoc b/docs/api/index-patterns/runtime-fields/update.asciidoc new file mode 100644 index 00000000000000..f34460896f7bc9 --- /dev/null +++ b/docs/api/index-patterns/runtime-fields/update.asciidoc @@ -0,0 +1,66 @@ +[[index-patterns-runtime-field-api-update]] +=== Update runtime field API +++++ +Update runtime field +++++ + +experimental[] Update an existing runtime field + +[[index-patterns-runtime-field-update-request]] +==== Request + +`POST :/api/index_patterns/index_pattern//runtime_field/` + +`POST :/s//api/index_patterns/index_pattern//runtime_field/` + +[[index-patterns-runtime-field-update-params]] +==== Path parameters + +`space_id`:: +(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. + +`index_pattern_id`:: +(Required, string) The ID of the index pattern. + +`name`:: +(Required, string) The name of the runtime field you want to update. + +[[index-patterns-runtime-field-update-body]] +==== Request body + +`runtimeField`:: (Required, object) The runtime field definition object. + +You can update following fields: + +* `type` +* `script` + + + +[[index-patterns-runtime-field-update-example]] +==== Examples + +Update an existing runtime field on an index pattern: + +[source,sh] +-------------------------------------------------- +$ curl -X POST api/index_patterns/index_pattern//runtime_field/ +{ + "runtimeField": { + "script": { + "source": "emit(doc["bar"].value)" + } + } +} +-------------------------------------------------- +// KIBANA + +The API returns updated runtime field object and updated index pattern object: + +[source,sh] +-------------------------------------------------- +{ + "index_pattern": {...}, + "field": {...} +} +-------------------------------------------------- diff --git a/docs/api/index-patterns/runtime-fields/upsert.asciidoc b/docs/api/index-patterns/runtime-fields/upsert.asciidoc new file mode 100644 index 00000000000000..1b436db19c62e4 --- /dev/null +++ b/docs/api/index-patterns/runtime-fields/upsert.asciidoc @@ -0,0 +1,61 @@ +[[index-patterns-runtime-field-api-upsert]] +=== Upsert runtime field API +++++ +Upsert runtime field +++++ + +experimental[] Create or update an existing runtime field + +[[index-patterns-runtime-field-upsert-request]] +==== Request + +`PUT :/api/index_patterns/index_pattern//runtime_field` + +`PUT :/s//api/index_patterns/index_pattern//runtime_field` + +[[index-patterns-runtime-field-upsert-params]] +==== Path parameters + +`space_id`:: +(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. + +`index_pattern_id`:: +(Required, string) The ID of the index pattern. + +[[index-patterns-runtime-field-upsert-body]] +==== Request body + +`name`:: (Required, string) The name for a new runtime field or a name of an existing runtime field. + +`runtimeField`:: (Required, object) The runtime field definition object. + + +[[index-patterns-runtime-field-upsert-example]] +==== Examples + +Create or update an existing runtime field on an index pattern: + +[source,sh] +-------------------------------------------------- +$ curl -X PUT api/index_patterns/index_pattern//runtime_field +{ + "name": "runtimeFoo", + "runtimeField": { + "type": "long", + "script": { + "source": "emit(doc["foo"].value)" + } + } +} +-------------------------------------------------- +// KIBANA + +The API returns created or updated runtime field object and updated index pattern object: + +[source,sh] +-------------------------------------------------- +{ + "index_pattern": {...}, + "field": {...} +} +-------------------------------------------------- diff --git a/docs/api/index-patterns/update.asciidoc b/docs/api/index-patterns/update.asciidoc index 8ed0ff89fb928c..2d5fe882d448df 100644 --- a/docs/api/index-patterns/update.asciidoc +++ b/docs/api/index-patterns/update.asciidoc @@ -93,7 +93,8 @@ $ curl -X POST api/saved_objects/index-pattern/my-pattern "fieldFormats": {}, "type": "...", "typeMeta": {}, - "fields": {} + "fields": {}, + "runtimeFieldMap": {} } } -------------------------------------------------- diff --git a/docs/canvas/canvas-function-reference.asciidoc b/docs/canvas/canvas-function-reference.asciidoc index 67210c9d77057e..272cd524c2c200 100644 --- a/docs/canvas/canvas-function-reference.asciidoc +++ b/docs/canvas/canvas-function-reference.asciidoc @@ -2893,6 +2893,33 @@ Alias: `type` [[u_fns]] == U +[float] +[[uiSetting_fn]] +=== `uiSetting` + +Returns a UI settings parameter value. + +*Accepts:* `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** + +Aliases: `parameter` +|`string` +|The parameter name. + +|`default` +|`any` +|A default value in case of the parameter is not set. + +Default: `null` +|=== + +*Returns:* `ui_setting` + [float] [[urlparam_fn]] === `urlparam` diff --git a/docs/developer/contributing/development-functional-tests.asciidoc b/docs/developer/contributing/development-functional-tests.asciidoc index f0041b85c14ebf..6f5c05f526bd6b 100644 --- a/docs/developer/contributing/development-functional-tests.asciidoc +++ b/docs/developer/contributing/development-functional-tests.asciidoc @@ -229,9 +229,9 @@ export default function ({ getService, getPageObject }) { before(async () => { await Promise.all([ // start with an empty .kibana index - esArchiver.load('empty_kibana'), + esArchiver.load('test/functional/fixtures/es_archiver/empty_kibana'), // load some basic log data only if the index doesn't exist - esArchiver.loadIfNeeded('makelogs') + esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/makelogs') ]); // go to the page described by `apps.visualize` in the config await PageObjects.common.navigateTo('visualize'); @@ -243,7 +243,7 @@ export default function ({ getService, getPageObject }) { // we unload the empty_kibana archive but not the makelogs // archive because we don't make any changes to it, and subsequent // suites could use it if they call `.loadIfNeeded()`. - await esArchiver.unload('empty_kibana'); + await esArchiver.unload('test/functional/fixtures/es_archiver/empty_kibana'); }); // This series of tests illustrate how tests generally verify @@ -370,9 +370,9 @@ await testSubjects.click(‘containerButton’); * Source: {blob}test/common/services/es_archiver.ts[test/common/services/es_archiver.ts] * Load/unload archives created with the `esArchiver` * Popular methods: -** `esArchiver.load(name)` -** `esArchiver.loadIfNeeded(name)` -** `esArchiver.unload(name)` +** `esArchiver.load(path)` +** `esArchiver.loadIfNeeded(path)` +** `esArchiver.unload(path)` Full list of services that are used in functional tests can be found here: {blob}test/functional/services[test/functional/services] diff --git a/docs/developer/getting-started/monorepo-packages.asciidoc b/docs/developer/getting-started/monorepo-packages.asciidoc index 029ee9ea4faf6c..0ae806618adc5d 100644 --- a/docs/developer/getting-started/monorepo-packages.asciidoc +++ b/docs/developer/getting-started/monorepo-packages.asciidoc @@ -97,6 +97,7 @@ yarn kbn watch-bazel - @kbn/securitysolution-list-utils - @kbn/securitysolution-utils - @kbn/server-http-tools +- @kbn/server-route-repository - @kbn/std - @kbn/telemetry-utils - @kbn/tinymath diff --git a/docs/developer/getting-started/sample-data.asciidoc b/docs/developer/getting-started/sample-data.asciidoc index 0d313cbabe64e4..2454c9d8a61468 100644 --- a/docs/developer/getting-started/sample-data.asciidoc +++ b/docs/developer/getting-started/sample-data.asciidoc @@ -6,7 +6,7 @@ There are a couple ways to easily get data ingested into {es}. [discrete] === Sample data packages available for one click installation -The easiest is to install one or more of our vailable sample data packages. If you have no data, you should be +The easiest is to install one or more of our available sample data packages. If you have no data, you should be prompted to install when running {kib} for the first time. You can also access and install the sample data packages by going to the home page and clicking "add sample data". @@ -27,5 +27,5 @@ Make sure to execute `node scripts/makelogs` *after* {es} is up and running! [discrete] === CSV upload -If running with a platinum or trial license, you can also use the CSV uploader provided inside the Machine learning app. -Navigate to the Data visualizer to upload your data from a file. \ No newline at end of file +You can also use the CSV uploader provided on the {kib} home page. +Navigate to **Add data** > **Upload file** to upload your data from a file. \ No newline at end of file diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index 7d06562547f70c..6675a8dd283c9b 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -369,6 +369,10 @@ The client-side plugin configures following values: |The data_enhanced plugin is the x-pack counterpart to the src/plguins/data plugin. +|{kib-repo}blob/{branch}/x-pack/plugins/data_visualizer/README.md[dataVisualizer] +|The data_visualizer plugin enables you to explore the fields in your data. + + |{kib-repo}blob/{branch}/x-pack/plugins/discover_enhanced/README.md[discoverEnhanced] |Contains the enhancements to the OSS discover app. @@ -396,10 +400,6 @@ actitivies. |The features plugin enhance Kibana with a per-feature privilege system. -|{kib-repo}blob/{branch}/x-pack/plugins/file_data_visualizer[fileDataVisualizer] -|WARNING: Missing README. - - |{kib-repo}blob/{branch}/x-pack/plugins/file_upload[fileUpload] |WARNING: Missing README. diff --git a/docs/developer/plugin/external-plugin-functional-tests.asciidoc b/docs/developer/plugin/external-plugin-functional-tests.asciidoc index b39d576d852685..55b311794f9dcb 100644 --- a/docs/developer/plugin/external-plugin-functional-tests.asciidoc +++ b/docs/developer/plugin/external-plugin-functional-tests.asciidoc @@ -58,11 +58,6 @@ export default async function ({ readConfigFile }) { } }, - // choose where esArchiver should load archives from - esArchiver: { - directory: resolve(__dirname, './es_archives'), - }, - // choose where screenshots should be saved screenshots: { directory: resolve(__dirname, './tmp/screenshots'), diff --git a/docs/development/core/public/kibana-plugin-core-public.app.euiicontype.md b/docs/development/core/public/kibana-plugin-core-public.app.euiicontype.md deleted file mode 100644 index ff79d832f92e2b..00000000000000 --- a/docs/development/core/public/kibana-plugin-core-public.app.euiicontype.md +++ /dev/null @@ -1,13 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [App](./kibana-plugin-core-public.app.md) > [euiIconType](./kibana-plugin-core-public.app.euiicontype.md) - -## App.euiIconType property - -A EUI iconType that will be used for the app's icon. This icon takes precendence over the `icon` property. - -Signature: - -```typescript -euiIconType?: string; -``` diff --git a/docs/development/core/public/kibana-plugin-core-public.app.icon.md b/docs/development/core/public/kibana-plugin-core-public.app.icon.md deleted file mode 100644 index 98260da5d20219..00000000000000 --- a/docs/development/core/public/kibana-plugin-core-public.app.icon.md +++ /dev/null @@ -1,13 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [App](./kibana-plugin-core-public.app.md) > [icon](./kibana-plugin-core-public.app.icon.md) - -## App.icon property - -A URL to an image file used as an icon. Used as a fallback if `euiIconType` is not provided. - -Signature: - -```typescript -icon?: string; -``` diff --git a/docs/development/core/public/kibana-plugin-core-public.app.md b/docs/development/core/public/kibana-plugin-core-public.app.md index 721d9a2f121c73..d79a12a83367d0 100644 --- a/docs/development/core/public/kibana-plugin-core-public.app.md +++ b/docs/development/core/public/kibana-plugin-core-public.app.md @@ -8,7 +8,7 @@ Signature: ```typescript -export interface App +export interface App extends AppNavOptions ``` ## Properties @@ -21,16 +21,13 @@ export interface App | [chromeless](./kibana-plugin-core-public.app.chromeless.md) | boolean | Hide the UI chrome when the application is mounted. Defaults to false. Takes precedence over chrome service visibility settings. | | [deepLinks](./kibana-plugin-core-public.app.deeplinks.md) | AppDeepLink[] | Input type for registering secondary in-app locations for an application.Deep links must include at least one of path or deepLinks. A deep link that does not have a path represents a topological level in the application's hierarchy, but does not have a destination URL that is user-accessible. | | [defaultPath](./kibana-plugin-core-public.app.defaultpath.md) | string | Allow to define the default path a user should be directed to when navigating to the app. When defined, this value will be used as a default for the path option when calling [navigateToApp](./kibana-plugin-core-public.applicationstart.navigatetoapp.md)\`, and will also be appended to the [application navLink](./kibana-plugin-core-public.chromenavlink.md) in the navigation bar. | -| [euiIconType](./kibana-plugin-core-public.app.euiicontype.md) | string | A EUI iconType that will be used for the app's icon. This icon takes precendence over the icon property. | | [exactRoute](./kibana-plugin-core-public.app.exactroute.md) | boolean | If set to true, the application's route will only be checked against an exact match. Defaults to false. | -| [icon](./kibana-plugin-core-public.app.icon.md) | string | A URL to an image file used as an icon. Used as a fallback if euiIconType is not provided. | | [id](./kibana-plugin-core-public.app.id.md) | string | The unique identifier of the application | | [keywords](./kibana-plugin-core-public.app.keywords.md) | string[] | Optional keywords to match with in deep links search. Omit if this part of the hierarchy does not have a page URL. | | [mount](./kibana-plugin-core-public.app.mount.md) | AppMount<HistoryLocationState> | A mount function called when the user navigates to this app's route. | | [navLinkStatus](./kibana-plugin-core-public.app.navlinkstatus.md) | AppNavLinkStatus | The initial status of the application's navLink. Defaulting to visible if status is accessible and hidden if status is inaccessible See [AppNavLinkStatus](./kibana-plugin-core-public.appnavlinkstatus.md) | -| [order](./kibana-plugin-core-public.app.order.md) | number | An ordinal used to sort nav links relative to one another for display. | +| [searchable](./kibana-plugin-core-public.app.searchable.md) | boolean | The initial flag to determine if the application is searchable in the global search. Defaulting to true if navLinkStatus is visible or omitted. | | [status](./kibana-plugin-core-public.app.status.md) | AppStatus | The initial status of the application. Defaulting to accessible | | [title](./kibana-plugin-core-public.app.title.md) | string | The title of the application. | -| [tooltip](./kibana-plugin-core-public.app.tooltip.md) | string | A tooltip shown when hovering over app link. | | [updater$](./kibana-plugin-core-public.app.updater_.md) | Observable<AppUpdater> | An [AppUpdater](./kibana-plugin-core-public.appupdater.md) observable that can be used to update the application [AppUpdatableFields](./kibana-plugin-core-public.appupdatablefields.md) at runtime. | diff --git a/docs/development/core/public/kibana-plugin-core-public.app.order.md b/docs/development/core/public/kibana-plugin-core-public.app.order.md deleted file mode 100644 index bb6be116b6b587..00000000000000 --- a/docs/development/core/public/kibana-plugin-core-public.app.order.md +++ /dev/null @@ -1,13 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [App](./kibana-plugin-core-public.app.md) > [order](./kibana-plugin-core-public.app.order.md) - -## App.order property - -An ordinal used to sort nav links relative to one another for display. - -Signature: - -```typescript -order?: number; -``` diff --git a/docs/development/core/public/kibana-plugin-core-public.app.searchable.md b/docs/development/core/public/kibana-plugin-core-public.app.searchable.md new file mode 100644 index 00000000000000..ab1b559a7f6a1d --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.app.searchable.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [App](./kibana-plugin-core-public.app.md) > [searchable](./kibana-plugin-core-public.app.searchable.md) + +## App.searchable property + +The initial flag to determine if the application is searchable in the global search. Defaulting to `true` if `navLinkStatus` is `visible` or omitted. + +Signature: + +```typescript +searchable?: boolean; +``` diff --git a/docs/development/core/public/kibana-plugin-core-public.app.tooltip.md b/docs/development/core/public/kibana-plugin-core-public.app.tooltip.md deleted file mode 100644 index e901de0fdccc98..00000000000000 --- a/docs/development/core/public/kibana-plugin-core-public.app.tooltip.md +++ /dev/null @@ -1,13 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [App](./kibana-plugin-core-public.app.md) > [tooltip](./kibana-plugin-core-public.app.tooltip.md) - -## App.tooltip property - -A tooltip shown when hovering over app link. - -Signature: - -```typescript -tooltip?: string; -``` diff --git a/docs/development/core/public/kibana-plugin-core-public.appdeeplink.md b/docs/development/core/public/kibana-plugin-core-public.appdeeplink.md index 5aa951cffdcb54..30fd3085a4341a 100644 --- a/docs/development/core/public/kibana-plugin-core-public.appdeeplink.md +++ b/docs/development/core/public/kibana-plugin-core-public.appdeeplink.md @@ -16,7 +16,8 @@ export declare type AppDeepLink = { title: string; keywords?: string[]; navLinkStatus?: AppNavLinkStatus; -} & ({ + searchable?: boolean; +} & AppNavOptions & ({ path: string; deepLinks?: AppDeepLink[]; } | { diff --git a/docs/development/core/public/kibana-plugin-core-public.appnavoptions.euiicontype.md b/docs/development/core/public/kibana-plugin-core-public.appnavoptions.euiicontype.md new file mode 100644 index 00000000000000..069eccf63a2351 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.appnavoptions.euiicontype.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [AppNavOptions](./kibana-plugin-core-public.appnavoptions.md) > [euiIconType](./kibana-plugin-core-public.appnavoptions.euiicontype.md) + +## AppNavOptions.euiIconType property + +A EUI iconType that will be used for the app's icon. This icon takes precendence over the `icon` property. + +Signature: + +```typescript +euiIconType?: string; +``` diff --git a/docs/development/core/public/kibana-plugin-core-public.appnavoptions.icon.md b/docs/development/core/public/kibana-plugin-core-public.appnavoptions.icon.md new file mode 100644 index 00000000000000..3b809fc4aec396 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.appnavoptions.icon.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [AppNavOptions](./kibana-plugin-core-public.appnavoptions.md) > [icon](./kibana-plugin-core-public.appnavoptions.icon.md) + +## AppNavOptions.icon property + +A URL to an image file used as an icon. Used as a fallback if `euiIconType` is not provided. + +Signature: + +```typescript +icon?: string; +``` diff --git a/docs/development/core/public/kibana-plugin-core-public.appnavoptions.md b/docs/development/core/public/kibana-plugin-core-public.appnavoptions.md new file mode 100644 index 00000000000000..52c28c861dc704 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.appnavoptions.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [AppNavOptions](./kibana-plugin-core-public.appnavoptions.md) + +## AppNavOptions interface + +App navigation menu options + +Signature: + +```typescript +export interface AppNavOptions +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [euiIconType](./kibana-plugin-core-public.appnavoptions.euiicontype.md) | string | A EUI iconType that will be used for the app's icon. This icon takes precendence over the icon property. | +| [icon](./kibana-plugin-core-public.appnavoptions.icon.md) | string | A URL to an image file used as an icon. Used as a fallback if euiIconType is not provided. | +| [order](./kibana-plugin-core-public.appnavoptions.order.md) | number | An ordinal used to sort nav links relative to one another for display. | +| [tooltip](./kibana-plugin-core-public.appnavoptions.tooltip.md) | string | A tooltip shown when hovering over app link. | + diff --git a/docs/development/core/public/kibana-plugin-core-public.appnavoptions.order.md b/docs/development/core/public/kibana-plugin-core-public.appnavoptions.order.md new file mode 100644 index 00000000000000..ca7ae482a04adb --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.appnavoptions.order.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [AppNavOptions](./kibana-plugin-core-public.appnavoptions.md) > [order](./kibana-plugin-core-public.appnavoptions.order.md) + +## AppNavOptions.order property + +An ordinal used to sort nav links relative to one another for display. + +Signature: + +```typescript +order?: number; +``` diff --git a/docs/development/core/public/kibana-plugin-core-public.appnavoptions.tooltip.md b/docs/development/core/public/kibana-plugin-core-public.appnavoptions.tooltip.md new file mode 100644 index 00000000000000..97c18c2e56a1ee --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.appnavoptions.tooltip.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [AppNavOptions](./kibana-plugin-core-public.appnavoptions.md) > [tooltip](./kibana-plugin-core-public.appnavoptions.tooltip.md) + +## AppNavOptions.tooltip property + +A tooltip shown when hovering over app link. + +Signature: + +```typescript +tooltip?: string; +``` diff --git a/docs/development/core/public/kibana-plugin-core-public.appupdatablefields.md b/docs/development/core/public/kibana-plugin-core-public.appupdatablefields.md index d7b12d4b707010..c24da05abe7ecd 100644 --- a/docs/development/core/public/kibana-plugin-core-public.appupdatablefields.md +++ b/docs/development/core/public/kibana-plugin-core-public.appupdatablefields.md @@ -9,5 +9,5 @@ Defines the list of fields that can be updated via an [AppUpdater](./kibana-plug Signature: ```typescript -export declare type AppUpdatableFields = Pick; +export declare type AppUpdatableFields = Pick; ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.chromenavlink.md b/docs/development/core/public/kibana-plugin-core-public.chromenavlink.md index dfe8f119505aa8..c7dd461617e344 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromenavlink.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromenavlink.md @@ -26,5 +26,5 @@ export interface ChromeNavLink | [order](./kibana-plugin-core-public.chromenavlink.order.md) | number | An ordinal used to sort nav links relative to one another for display. | | [title](./kibana-plugin-core-public.chromenavlink.title.md) | string | The title of the application. | | [tooltip](./kibana-plugin-core-public.chromenavlink.tooltip.md) | string | A tooltip shown when hovering over an app link. | -| [url](./kibana-plugin-core-public.chromenavlink.url.md) | string | The route used to open the of an application. If unset, baseUrl will be used instead. | +| [url](./kibana-plugin-core-public.chromenavlink.url.md) | string | The route used to open the default path and the deep links of an application. | diff --git a/docs/development/core/public/kibana-plugin-core-public.chromenavlink.url.md b/docs/development/core/public/kibana-plugin-core-public.chromenavlink.url.md index 833930c4947862..b9d12e450df505 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromenavlink.url.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromenavlink.url.md @@ -4,10 +4,10 @@ ## ChromeNavLink.url property -The route used to open the of an application. If unset, `baseUrl` will be used instead. +The route used to open the default path and the deep links of an application. Signature: ```typescript -readonly url?: string; +readonly url: string; ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.md b/docs/development/core/public/kibana-plugin-core-public.md index 6239279f275d1c..f341a7cd9315f8 100644 --- a/docs/development/core/public/kibana-plugin-core-public.md +++ b/docs/development/core/public/kibana-plugin-core-public.md @@ -38,6 +38,7 @@ The plugin integrates with the core system via lifecycle events: `setup` | [ApplicationSetup](./kibana-plugin-core-public.applicationsetup.md) | | | [ApplicationStart](./kibana-plugin-core-public.applicationstart.md) | | | [AppMountParameters](./kibana-plugin-core-public.appmountparameters.md) | | +| [AppNavOptions](./kibana-plugin-core-public.appnavoptions.md) | App navigation menu options | | [AsyncPlugin](./kibana-plugin-core-public.asyncplugin.md) | A plugin with asynchronous lifecycle methods. | | [Capabilities](./kibana-plugin-core-public.capabilities.md) | The read-only set of capabilities available for the current UI session. Capabilities are simple key-value pairs of (string, boolean), where the string denotes the capability ID, and the boolean is a flag indicating if the capability is enabled or disabled. | | [ChromeBadge](./kibana-plugin-core-public.chromebadge.md) | | diff --git a/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.deeplinkid.md b/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.deeplinkid.md new file mode 100644 index 00000000000000..4039e1338fc1c0 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.deeplinkid.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [NavigateToAppOptions](./kibana-plugin-core-public.navigatetoappoptions.md) > [deepLinkId](./kibana-plugin-core-public.navigatetoappoptions.deeplinkid.md) + +## NavigateToAppOptions.deepLinkId property + +optional [deep link](./kibana-plugin-core-public.app.deeplinks.md) id inside the application to navigate to. If an additional [path](./kibana-plugin-core-public.navigatetoappoptions.path.md) is defined it will be appended to the deep link path. + +Signature: + +```typescript +deepLinkId?: string; +``` diff --git a/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.md b/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.md index 79b59a19508e76..7b01bab056d843 100644 --- a/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.md +++ b/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.md @@ -16,8 +16,9 @@ export interface NavigateToAppOptions | Property | Type | Description | | --- | --- | --- | +| [deepLinkId](./kibana-plugin-core-public.navigatetoappoptions.deeplinkid.md) | string | optional [deep link](./kibana-plugin-core-public.app.deeplinks.md) id inside the application to navigate to. If an additional [path](./kibana-plugin-core-public.navigatetoappoptions.path.md) is defined it will be appended to the deep link path. | | [openInNewTab](./kibana-plugin-core-public.navigatetoappoptions.openinnewtab.md) | boolean | if true, will open the app in new tab, will share session information via window.open if base | -| [path](./kibana-plugin-core-public.navigatetoappoptions.path.md) | string | optional path inside application to deep link to. If undefined, will use [the app's default path](./kibana-plugin-core-public.app.defaultpath.md)\` as default. | +| [path](./kibana-plugin-core-public.navigatetoappoptions.path.md) | string | optional path inside application to deep link to. If undefined, will use [the app's default path](./kibana-plugin-core-public.app.defaultpath.md) as default. | | [replace](./kibana-plugin-core-public.navigatetoappoptions.replace.md) | boolean | if true, will not create a new history entry when navigating (using replace instead of push) | | [state](./kibana-plugin-core-public.navigatetoappoptions.state.md) | unknown | optional state to forward to the application | diff --git a/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.path.md b/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.path.md index 095553d05778c9..b39fc8c324ad9a 100644 --- a/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.path.md +++ b/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.path.md @@ -4,7 +4,7 @@ ## NavigateToAppOptions.path property -optional path inside application to deep link to. If undefined, will use [the app's default path](./kibana-plugin-core-public.app.defaultpath.md)\` as default. +optional path inside application to deep link to. If undefined, will use [the app's default path](./kibana-plugin-core-public.app.defaultpath.md) as default. Signature: diff --git a/docs/development/core/public/kibana-plugin-core-public.publicappdeeplinkinfo.md b/docs/development/core/public/kibana-plugin-core-public.publicappdeeplinkinfo.md index d3a6a4de905fdf..40fd98687c6194 100644 --- a/docs/development/core/public/kibana-plugin-core-public.publicappdeeplinkinfo.md +++ b/docs/development/core/public/kibana-plugin-core-public.publicappdeeplinkinfo.md @@ -9,9 +9,10 @@ Public information about a registered app's [deepLinks](./kibana-plugin-core-pub Signature: ```typescript -export declare type PublicAppDeepLinkInfo = Omit & { +export declare type PublicAppDeepLinkInfo = Omit & { deepLinks: PublicAppDeepLinkInfo[]; keywords: string[]; navLinkStatus: AppNavLinkStatus; + searchable: boolean; }; ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.publicappinfo.md b/docs/development/core/public/kibana-plugin-core-public.publicappinfo.md index a5563eae83563f..01d23ae47a0d95 100644 --- a/docs/development/core/public/kibana-plugin-core-public.publicappinfo.md +++ b/docs/development/core/public/kibana-plugin-core-public.publicappinfo.md @@ -9,11 +9,12 @@ Public information about a registered [application](./kibana-plugin-core-public. Signature: ```typescript -export declare type PublicAppInfo = Omit & { +export declare type PublicAppInfo = Omit & { status: AppStatus; navLinkStatus: AppNavLinkStatus; appRoute: string; keywords: string[]; deepLinks: PublicAppDeepLinkInfo[]; + searchable: boolean; }; ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.md index 7be45c6c173b45..706408f81f02a8 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.md @@ -30,7 +30,7 @@ export interface SavedObjectsFindOptions | [searchAfter](./kibana-plugin-core-public.savedobjectsfindoptions.searchafter.md) | estypes.Id[] | Use the sort values from the previous page to retrieve the next page of results. | | [searchFields](./kibana-plugin-core-public.savedobjectsfindoptions.searchfields.md) | string[] | The fields to perform the parsed query against. See Elasticsearch Simple Query String fields argument for more information | | [sortField](./kibana-plugin-core-public.savedobjectsfindoptions.sortfield.md) | string | | -| [sortOrder](./kibana-plugin-core-public.savedobjectsfindoptions.sortorder.md) | estypes.SortOrder | | +| [sortOrder](./kibana-plugin-core-public.savedobjectsfindoptions.sortorder.md) | estypes.SearchSortOrder | | | [type](./kibana-plugin-core-public.savedobjectsfindoptions.type.md) | string | string[] | | | [typeToNamespacesMap](./kibana-plugin-core-public.savedobjectsfindoptions.typetonamespacesmap.md) | Map<string, string[] | undefined> | This map defines each type to search for, and the namespace(s) to search for the type in; this is only intended to be used by a saved object client wrapper. If this is defined, it supersedes the type and namespaces fields when building the Elasticsearch query. Any types that are not included in this map will be excluded entirely. If a type is included but its value is undefined, the operation will search for that type in the Default namespace. | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.sortorder.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.sortorder.md index 36f99e51ea8c65..506fb9041e353b 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.sortorder.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.sortorder.md @@ -7,5 +7,5 @@ Signature: ```typescript -sortOrder?: estypes.SortOrder; +sortOrder?: estypes.SearchSortOrder; ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.md b/docs/development/core/server/kibana-plugin-core-server.md index 32a2f3312708ce..604cdea1a7fbe6 100644 --- a/docs/development/core/server/kibana-plugin-core-server.md +++ b/docs/development/core/server/kibana-plugin-core-server.md @@ -159,8 +159,6 @@ The plugin integrates with the core system via lifecycle events: `setup` | [SavedObjectsCollectMultiNamespaceReferencesObject](./kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesobject.md) | An object to collect references for. It must be a multi-namespace type (in other words, the object type must be registered with the namespaceType: 'multiple' or namespaceType: 'multiple-isolated' option).Note: if options.purpose is 'updateObjectsSpaces', it must be a shareable type (in other words, the object type must be registered with the namespaceType: 'multiple'). | | [SavedObjectsCollectMultiNamespaceReferencesOptions](./kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesoptions.md) | Options for collecting references. | | [SavedObjectsCollectMultiNamespaceReferencesResponse](./kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesresponse.md) | The response when object references are collected. | -| [SavedObjectsComplexFieldMapping](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.md) | See [SavedObjectsFieldMapping](./kibana-plugin-core-server.savedobjectsfieldmapping.md) for documentation. | -| [SavedObjectsCoreFieldMapping](./kibana-plugin-core-server.savedobjectscorefieldmapping.md) | See [SavedObjectsFieldMapping](./kibana-plugin-core-server.savedobjectsfieldmapping.md) for documentation. | | [SavedObjectsCreateOptions](./kibana-plugin-core-server.savedobjectscreateoptions.md) | | | [SavedObjectsCreatePointInTimeFinderDependencies](./kibana-plugin-core-server.savedobjectscreatepointintimefinderdependencies.md) | | | [SavedObjectsDeleteByNamespaceOptions](./kibana-plugin-core-server.savedobjectsdeletebynamespaceoptions.md) | | diff --git a/docs/development/core/server/kibana-plugin-core-server.pluginmanifest.description.md b/docs/development/core/server/kibana-plugin-core-server.pluginmanifest.description.md new file mode 100644 index 00000000000000..b6bba3b5e356cd --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.pluginmanifest.description.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [PluginManifest](./kibana-plugin-core-server.pluginmanifest.md) > [description](./kibana-plugin-core-server.pluginmanifest.description.md) + +## PluginManifest.description property + +TODO: make required once all plugins specify this. A brief description of what this plugin does and any capabilities it provides. + +Signature: + +```typescript +readonly description?: string; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.pluginmanifest.md b/docs/development/core/server/kibana-plugin-core-server.pluginmanifest.md index bd15b95d73acea..b3e20bc7ed693a 100644 --- a/docs/development/core/server/kibana-plugin-core-server.pluginmanifest.md +++ b/docs/development/core/server/kibana-plugin-core-server.pluginmanifest.md @@ -21,10 +21,12 @@ Should never be used in code outside of Core but is exported for documentation p | Property | Type | Description | | --- | --- | --- | | [configPath](./kibana-plugin-core-server.pluginmanifest.configpath.md) | ConfigPath | Root used by the plugin, defaults to "id" in snake\_case format. | +| [description](./kibana-plugin-core-server.pluginmanifest.description.md) | string | TODO: make required once all plugins specify this. A brief description of what this plugin does and any capabilities it provides. | | [extraPublicDirs](./kibana-plugin-core-server.pluginmanifest.extrapublicdirs.md) | string[] | Specifies directory names that can be imported by other ui-plugins built using the same instance of the @kbn/optimizer. A temporary measure we plan to replace with better mechanisms for sharing static code between plugins | | [id](./kibana-plugin-core-server.pluginmanifest.id.md) | PluginName | Identifier of the plugin. Must be a string in camelCase. Part of a plugin public contract. Other plugins leverage it to access plugin API, navigate to the plugin, etc. | | [kibanaVersion](./kibana-plugin-core-server.pluginmanifest.kibanaversion.md) | string | The version of Kibana the plugin is compatible with, defaults to "version". | | [optionalPlugins](./kibana-plugin-core-server.pluginmanifest.optionalplugins.md) | readonly PluginName[] | An optional list of the other plugins that if installed and enabled \*\*may be\*\* leveraged by this plugin for some additional functionality but otherwise are not required for this plugin to work properly. | +| [owner](./kibana-plugin-core-server.pluginmanifest.owner.md) | {
readonly name: string;
readonly githubTeam?: string;
} | TODO: make required once all internal plugins have this specified. | | [requiredBundles](./kibana-plugin-core-server.pluginmanifest.requiredbundles.md) | readonly string[] | List of plugin ids that this plugin's UI code imports modules from that are not in requiredPlugins. | | [requiredPlugins](./kibana-plugin-core-server.pluginmanifest.requiredplugins.md) | readonly PluginName[] | An optional list of the other plugins that \*\*must be\*\* installed and enabled for this plugin to function properly. | | [server](./kibana-plugin-core-server.pluginmanifest.server.md) | boolean | Specifies whether plugin includes some server-side specific functionality. | diff --git a/docs/development/core/server/kibana-plugin-core-server.pluginmanifest.owner.md b/docs/development/core/server/kibana-plugin-core-server.pluginmanifest.owner.md new file mode 100644 index 00000000000000..a90af81aa186a4 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.pluginmanifest.owner.md @@ -0,0 +1,16 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [PluginManifest](./kibana-plugin-core-server.pluginmanifest.md) > [owner](./kibana-plugin-core-server.pluginmanifest.owner.md) + +## PluginManifest.owner property + +TODO: make required once all internal plugins have this specified. + +Signature: + +```typescript +readonly owner?: { + readonly name: string; + readonly githubTeam?: string; + }; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.doc_values.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.doc_values.md deleted file mode 100644 index 3f2d81cc97c7c8..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.doc_values.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsComplexFieldMapping](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.md) > [doc\_values](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.doc_values.md) - -## SavedObjectsComplexFieldMapping.doc\_values property - -Signature: - -```typescript -doc_values?: boolean; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.dynamic.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.dynamic.md deleted file mode 100644 index b01da3c62fda67..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.dynamic.md +++ /dev/null @@ -1,15 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsComplexFieldMapping](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.md) > [dynamic](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.dynamic.md) - -## SavedObjectsComplexFieldMapping.dynamic property - -The dynamic property of the mapping, either `false` or `'strict'`. If unspecified `dynamic: 'strict'` will be inherited from the top-level index mappings. - -Note: To limit the number of mapping fields Saved Object types should \*never\* use `dynamic: true`. - -Signature: - -```typescript -dynamic?: false | 'strict'; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.enabled.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.enabled.md deleted file mode 100644 index 08513aa2a849b7..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.enabled.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsComplexFieldMapping](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.md) > [enabled](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.enabled.md) - -## SavedObjectsComplexFieldMapping.enabled property - -Signature: - -```typescript -enabled?: boolean; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.md deleted file mode 100644 index fc262cad54f183..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.md +++ /dev/null @@ -1,24 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsComplexFieldMapping](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.md) - -## SavedObjectsComplexFieldMapping interface - -See [SavedObjectsFieldMapping](./kibana-plugin-core-server.savedobjectsfieldmapping.md) for documentation. - -Signature: - -```typescript -export interface SavedObjectsComplexFieldMapping -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [doc\_values](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.doc_values.md) | boolean | | -| [dynamic](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.dynamic.md) | false | 'strict' | The dynamic property of the mapping, either false or 'strict'. If unspecified dynamic: 'strict' will be inherited from the top-level index mappings.Note: To limit the number of mapping fields Saved Object types should \*never\* use dynamic: true. | -| [enabled](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.enabled.md) | boolean | | -| [properties](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.properties.md) | SavedObjectsMappingProperties | | -| [type](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.type.md) | string | | - diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.properties.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.properties.md deleted file mode 100644 index 613a36a09ba1ed..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.properties.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsComplexFieldMapping](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.md) > [properties](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.properties.md) - -## SavedObjectsComplexFieldMapping.properties property - -Signature: - -```typescript -properties: SavedObjectsMappingProperties; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.type.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.type.md deleted file mode 100644 index 8aaa524dad43a9..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.type.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsComplexFieldMapping](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.md) > [type](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.type.md) - -## SavedObjectsComplexFieldMapping.type property - -Signature: - -```typescript -type?: string; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.doc_values.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.doc_values.md deleted file mode 100644 index 2a79eafd85a6c2..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.doc_values.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsCoreFieldMapping](./kibana-plugin-core-server.savedobjectscorefieldmapping.md) > [doc\_values](./kibana-plugin-core-server.savedobjectscorefieldmapping.doc_values.md) - -## SavedObjectsCoreFieldMapping.doc\_values property - -Signature: - -```typescript -doc_values?: boolean; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.fields.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.fields.md deleted file mode 100644 index 4f88b635ca2f7c..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.fields.md +++ /dev/null @@ -1,16 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsCoreFieldMapping](./kibana-plugin-core-server.savedobjectscorefieldmapping.md) > [fields](./kibana-plugin-core-server.savedobjectscorefieldmapping.fields.md) - -## SavedObjectsCoreFieldMapping.fields property - -Signature: - -```typescript -fields?: { - [subfield: string]: { - type: string; - ignore_above?: number; - }; - }; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.index.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.index.md deleted file mode 100644 index e3cf685e310d27..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.index.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsCoreFieldMapping](./kibana-plugin-core-server.savedobjectscorefieldmapping.md) > [index](./kibana-plugin-core-server.savedobjectscorefieldmapping.index.md) - -## SavedObjectsCoreFieldMapping.index property - -Signature: - -```typescript -index?: boolean; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.md deleted file mode 100644 index e9b9c2bcf51b55..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.md +++ /dev/null @@ -1,24 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsCoreFieldMapping](./kibana-plugin-core-server.savedobjectscorefieldmapping.md) - -## SavedObjectsCoreFieldMapping interface - -See [SavedObjectsFieldMapping](./kibana-plugin-core-server.savedobjectsfieldmapping.md) for documentation. - -Signature: - -```typescript -export interface SavedObjectsCoreFieldMapping -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [doc\_values](./kibana-plugin-core-server.savedobjectscorefieldmapping.doc_values.md) | boolean | | -| [fields](./kibana-plugin-core-server.savedobjectscorefieldmapping.fields.md) | {
[subfield: string]: {
type: string;
ignore_above?: number;
};
} | | -| [index](./kibana-plugin-core-server.savedobjectscorefieldmapping.index.md) | boolean | | -| [null\_value](./kibana-plugin-core-server.savedobjectscorefieldmapping.null_value.md) | number | boolean | string | | -| [type](./kibana-plugin-core-server.savedobjectscorefieldmapping.type.md) | string | | - diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.null_value.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.null_value.md deleted file mode 100644 index 627ea3695383a0..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.null_value.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsCoreFieldMapping](./kibana-plugin-core-server.savedobjectscorefieldmapping.md) > [null\_value](./kibana-plugin-core-server.savedobjectscorefieldmapping.null_value.md) - -## SavedObjectsCoreFieldMapping.null\_value property - -Signature: - -```typescript -null_value?: number | boolean | string; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.type.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.type.md deleted file mode 100644 index 94d395d7983e57..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.type.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsCoreFieldMapping](./kibana-plugin-core-server.savedobjectscorefieldmapping.md) > [type](./kibana-plugin-core-server.savedobjectscorefieldmapping.type.md) - -## SavedObjectsCoreFieldMapping.type property - -Signature: - -```typescript -type: string; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfieldmapping.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfieldmapping.md index 925ca4be92e663..85b52bacafa252 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfieldmapping.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfieldmapping.md @@ -11,5 +11,7 @@ Please refer to [elasticsearch documentation](https://www.elastic.co/guide/en/el Signature: ```typescript -export declare type SavedObjectsFieldMapping = SavedObjectsCoreFieldMapping | SavedObjectsComplexFieldMapping; +export declare type SavedObjectsFieldMapping = estypes.MappingProperty & { + dynamic?: false | 'strict'; +}; ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.md index a92b1f48d08ebc..d3696ee71049a2 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.md @@ -30,7 +30,7 @@ export interface SavedObjectsFindOptions | [searchAfter](./kibana-plugin-core-server.savedobjectsfindoptions.searchafter.md) | estypes.Id[] | Use the sort values from the previous page to retrieve the next page of results. | | [searchFields](./kibana-plugin-core-server.savedobjectsfindoptions.searchfields.md) | string[] | The fields to perform the parsed query against. See Elasticsearch Simple Query String fields argument for more information | | [sortField](./kibana-plugin-core-server.savedobjectsfindoptions.sortfield.md) | string | | -| [sortOrder](./kibana-plugin-core-server.savedobjectsfindoptions.sortorder.md) | estypes.SortOrder | | +| [sortOrder](./kibana-plugin-core-server.savedobjectsfindoptions.sortorder.md) | estypes.SearchSortOrder | | | [type](./kibana-plugin-core-server.savedobjectsfindoptions.type.md) | string | string[] | | | [typeToNamespacesMap](./kibana-plugin-core-server.savedobjectsfindoptions.typetonamespacesmap.md) | Map<string, string[] | undefined> | This map defines each type to search for, and the namespace(s) to search for the type in; this is only intended to be used by a saved object client wrapper. If this is defined, it supersedes the type and namespaces fields when building the Elasticsearch query. Any types that are not included in this map will be excluded entirely. If a type is included but its value is undefined, the operation will search for that type in the Default namespace. | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.sortorder.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.sortorder.md index e1c657e3a5171f..dca5a7d8c75836 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.sortorder.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.sortorder.md @@ -7,5 +7,5 @@ Signature: ```typescript -sortOrder?: estypes.SortOrder; +sortOrder?: estypes.SearchSortOrder; ``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.lang.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.lang.md index a994fc458cfb6f..f99e7ba8b967ec 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.lang.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.lang.md @@ -7,5 +7,5 @@ Signature: ```typescript -lang?: string; +lang?: estypes.ScriptLanguage; ``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.md index 4e3dea5549b566..29377ff8fd392a 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.md @@ -26,7 +26,7 @@ export interface IFieldType | [esTypes](./kibana-plugin-plugins-data-public.ifieldtype.estypes.md) | string[] | | | [filterable](./kibana-plugin-plugins-data-public.ifieldtype.filterable.md) | boolean | | | [format](./kibana-plugin-plugins-data-public.ifieldtype.format.md) | any | | -| [lang](./kibana-plugin-plugins-data-public.ifieldtype.lang.md) | string | | +| [lang](./kibana-plugin-plugins-data-public.ifieldtype.lang.md) | estypes.ScriptLanguage | | | [name](./kibana-plugin-plugins-data-public.ifieldtype.name.md) | string | | | [readFromDocValues](./kibana-plugin-plugins-data-public.ifieldtype.readfromdocvalues.md) | boolean | | | [script](./kibana-plugin-plugins-data-public.ifieldtype.script.md) | string | | diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.addscriptedfield.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.addscriptedfield.md index 812f014b15a6c9..e0ee1f0ec15a4c 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.addscriptedfield.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.addscriptedfield.md @@ -6,6 +6,7 @@ > Warning: This API is now obsolete. > +> use runtime field instead > Add scripted field to field list diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getnonscriptedfields.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getnonscriptedfields.md index 1792a979bf7490..94adbefe535dd3 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getnonscriptedfields.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getnonscriptedfields.md @@ -6,6 +6,7 @@ > Warning: This API is now obsolete. > +> use runtime field instead > Signature: diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getruntimefield.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getruntimefield.md new file mode 100644 index 00000000000000..c0aca53255b8fd --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getruntimefield.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [getRuntimeField](./kibana-plugin-plugins-data-public.indexpattern.getruntimefield.md) + +## IndexPattern.getRuntimeField() method + +Returns runtime field if exists + +Signature: + +```typescript +getRuntimeField(name: string): RuntimeField | null; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | | + +Returns: + +`RuntimeField | null` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getscriptedfields.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getscriptedfields.md index b6b3dcb19bac17..57e1b5f49371bf 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getscriptedfields.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getscriptedfields.md @@ -6,6 +6,7 @@ > Warning: This API is now obsolete. > +> use runtime field instead > Signature: diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.hasruntimefield.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.hasruntimefield.md new file mode 100644 index 00000000000000..96dbe13a7f1978 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.hasruntimefield.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [hasRuntimeField](./kibana-plugin-plugins-data-public.indexpattern.hasruntimefield.md) + +## IndexPattern.hasRuntimeField() method + +Checks if runtime field exists + +Signature: + +```typescript +hasRuntimeField(name: string): boolean; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | | + +Returns: + +`boolean` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.md index 53d173d39f50d0..51ca42fdce70a7 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.md @@ -54,13 +54,16 @@ export declare class IndexPattern implements IIndexPattern | [getFormatterForField(field)](./kibana-plugin-plugins-data-public.indexpattern.getformatterforfield.md) | | Provide a field, get its formatter | | [getFormatterForFieldNoDefault(fieldname)](./kibana-plugin-plugins-data-public.indexpattern.getformatterforfieldnodefault.md) | | Get formatter for a given field name. Return undefined if none exists | | [getNonScriptedFields()](./kibana-plugin-plugins-data-public.indexpattern.getnonscriptedfields.md) | | | +| [getRuntimeField(name)](./kibana-plugin-plugins-data-public.indexpattern.getruntimefield.md) | | Returns runtime field if exists | | [getScriptedFields()](./kibana-plugin-plugins-data-public.indexpattern.getscriptedfields.md) | | | | [getSourceFiltering()](./kibana-plugin-plugins-data-public.indexpattern.getsourcefiltering.md) | | Get the source filtering configuration for that index. | | [getTimeField()](./kibana-plugin-plugins-data-public.indexpattern.gettimefield.md) | | | +| [hasRuntimeField(name)](./kibana-plugin-plugins-data-public.indexpattern.hasruntimefield.md) | | Checks if runtime field exists | | [isTimeBased()](./kibana-plugin-plugins-data-public.indexpattern.istimebased.md) | | | | [isTimeNanosBased()](./kibana-plugin-plugins-data-public.indexpattern.istimenanosbased.md) | | | -| [removeRuntimeField(name)](./kibana-plugin-plugins-data-public.indexpattern.removeruntimefield.md) | | Remove a runtime field - removed from mapped field or removed unmapped field as appropriate | +| [removeRuntimeField(name)](./kibana-plugin-plugins-data-public.indexpattern.removeruntimefield.md) | | Remove a runtime field - removed from mapped field or removed unmapped field as appropriate. Doesn't clear associated field attributes. | | [removeScriptedField(fieldName)](./kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md) | | Remove scripted field from field list | +| [replaceAllRuntimeFields(newFields)](./kibana-plugin-plugins-data-public.indexpattern.replaceallruntimefields.md) | | Replaces all existing runtime fields with new fields | | [setFieldAttrs(fieldName, attrName, value)](./kibana-plugin-plugins-data-public.indexpattern.setfieldattrs.md) | | | | [setFieldCount(fieldName, count)](./kibana-plugin-plugins-data-public.indexpattern.setfieldcount.md) | | | | [setFieldCustomLabel(fieldName, customLabel)](./kibana-plugin-plugins-data-public.indexpattern.setfieldcustomlabel.md) | | | diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.removeruntimefield.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.removeruntimefield.md index 7a5228fece782e..f2774924fc73c1 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.removeruntimefield.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.removeruntimefield.md @@ -4,7 +4,7 @@ ## IndexPattern.removeRuntimeField() method -Remove a runtime field - removed from mapped field or removed unmapped field as appropriate +Remove a runtime field - removed from mapped field or removed unmapped field as appropriate. Doesn't clear associated field attributes. Signature: @@ -16,7 +16,7 @@ removeRuntimeField(name: string): void; | Parameter | Type | Description | | --- | --- | --- | -| name | string | | +| name | string | Field name to remove | Returns: diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md index 91f25c09ab197a..d3e1b26810fd74 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md @@ -6,6 +6,7 @@ > Warning: This API is now obsolete. > +> use runtime field instead > Remove scripted field from field list diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.replaceallruntimefields.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.replaceallruntimefields.md new file mode 100644 index 00000000000000..076b2b38cf474a --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.replaceallruntimefields.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [replaceAllRuntimeFields](./kibana-plugin-plugins-data-public.indexpattern.replaceallruntimefields.md) + +## IndexPattern.replaceAllRuntimeFields() method + +Replaces all existing runtime fields with new fields + +Signature: + +```typescript +replaceAllRuntimeFields(newFields: Record): void; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| newFields | Record<string, RuntimeField> | | + +Returns: + +`void` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.lang.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.lang.md index b81218eb088866..3666e503e27227 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.lang.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.lang.md @@ -9,7 +9,7 @@ Script field language Signature: ```typescript -get lang(): string | undefined; +get lang(): "painless" | "expression" | "mustache" | "java" | undefined; -set lang(lang: string | undefined); +set lang(lang: "painless" | "expression" | "mustache" | "java" | undefined); ``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.md index 05c807b1cd8457..8cd1a476cf32f8 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.md @@ -28,7 +28,7 @@ export declare class IndexPatternField implements IFieldType | [esTypes](./kibana-plugin-plugins-data-public.indexpatternfield.estypes.md) | | string[] | undefined | | | [filterable](./kibana-plugin-plugins-data-public.indexpatternfield.filterable.md) | | boolean | | | [isMapped](./kibana-plugin-plugins-data-public.indexpatternfield.ismapped.md) | | boolean | undefined | Is the field part of the index mapping? | -| [lang](./kibana-plugin-plugins-data-public.indexpatternfield.lang.md) | | string | undefined | Script field language | +| [lang](./kibana-plugin-plugins-data-public.indexpatternfield.lang.md) | | "painless" | "expression" | "mustache" | "java" | undefined | Script field language | | [name](./kibana-plugin-plugins-data-public.indexpatternfield.name.md) | | string | | | [readFromDocValues](./kibana-plugin-plugins-data-public.indexpatternfield.readfromdocvalues.md) | | boolean | | | [runtimeField](./kibana-plugin-plugins-data-public.indexpatternfield.runtimefield.md) | | RuntimeField | undefined | | diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.tojson.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.tojson.md index f0600dd20658a8..8882fa05ce0c25 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.tojson.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.tojson.md @@ -10,7 +10,7 @@ toJSON(): { count: number; script: string | undefined; - lang: string | undefined; + lang: "painless" | "expression" | "mustache" | "java" | undefined; conflictDescriptions: Record | undefined; name: string; type: string; @@ -28,7 +28,7 @@ toJSON(): { `{ count: number; script: string | undefined; - lang: string | undefined; + lang: "painless" | "expression" | "mustache" | "java" | undefined; conflictDescriptions: Record | undefined; name: string; type: string; diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.phrasefilter.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.phrasefilter.md index 090b78a7078cc5..8d0447d58634c9 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.phrasefilter.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.phrasefilter.md @@ -12,7 +12,7 @@ export declare type PhraseFilter = Filter & { script?: { script: { source?: any; - lang?: string; + lang?: estypes.ScriptLanguage; params: any; }; }; diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilter.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilter.md index fbe04f5e0a2a94..1cb627ec3a8f93 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilter.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilter.md @@ -12,7 +12,7 @@ export declare type RangeFilter = Filter & EsRangeFilter & { script?: { script: { params: any; - lang: string; + lang: estypes.ScriptLanguage; source: any; }; }; diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.reason.lang.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.reason.lang.md index 095142cf0f05b1..757d8f34a0c3ab 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.reason.lang.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.reason.lang.md @@ -7,5 +7,5 @@ Signature: ```typescript -lang?: string; +lang?: estypes.ScriptLanguage; ``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.reason.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.reason.md index a1a76f2d2a295e..fb39333cf245e0 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.reason.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.reason.md @@ -15,7 +15,7 @@ export interface Reason | Property | Type | Description | | --- | --- | --- | | [caused\_by](./kibana-plugin-plugins-data-public.reason.caused_by.md) | {
type: string;
reason: string;
} | | -| [lang](./kibana-plugin-plugins-data-public.reason.lang.md) | string | | +| [lang](./kibana-plugin-plugins-data-public.reason.lang.md) | estypes.ScriptLanguage | | | [position](./kibana-plugin-plugins-data-public.reason.position.md) | {
offset: number;
start: number;
end: number;
} | | | [reason](./kibana-plugin-plugins-data-public.reason.reason.md) | string | | | [script\_stack](./kibana-plugin-plugins-data-public.reason.script_stack.md) | string[] | | diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.lang.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.lang.md index d033804cb6fcbb..3d5a757cb8f187 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.lang.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.lang.md @@ -7,5 +7,5 @@ Signature: ```typescript -lang?: string; +lang?: estypes.ScriptLanguage; ``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.md index 5ac48d26a85d6d..bbc4cc2135d406 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.md @@ -26,7 +26,7 @@ export interface IFieldType | [esTypes](./kibana-plugin-plugins-data-server.ifieldtype.estypes.md) | string[] | | | [filterable](./kibana-plugin-plugins-data-server.ifieldtype.filterable.md) | boolean | | | [format](./kibana-plugin-plugins-data-server.ifieldtype.format.md) | any | | -| [lang](./kibana-plugin-plugins-data-server.ifieldtype.lang.md) | string | | +| [lang](./kibana-plugin-plugins-data-server.ifieldtype.lang.md) | estypes.ScriptLanguage | | | [name](./kibana-plugin-plugins-data-server.ifieldtype.name.md) | string | | | [readFromDocValues](./kibana-plugin-plugins-data-server.ifieldtype.readfromdocvalues.md) | boolean | | | [script](./kibana-plugin-plugins-data-server.ifieldtype.script.md) | string | | diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.addscriptedfield.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.addscriptedfield.md index 981f28a51ae09d..33f1ac5e316605 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.addscriptedfield.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.addscriptedfield.md @@ -6,6 +6,7 @@ > Warning: This API is now obsolete. > +> use runtime field instead > Add scripted field to field list diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getnonscriptedfields.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getnonscriptedfields.md index cff2c5de98de61..e791dfc7c3738f 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getnonscriptedfields.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getnonscriptedfields.md @@ -6,6 +6,7 @@ > Warning: This API is now obsolete. > +> use runtime field instead > Signature: diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getruntimefield.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getruntimefield.md new file mode 100644 index 00000000000000..d5dc8f966316b0 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getruntimefield.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IndexPattern](./kibana-plugin-plugins-data-server.indexpattern.md) > [getRuntimeField](./kibana-plugin-plugins-data-server.indexpattern.getruntimefield.md) + +## IndexPattern.getRuntimeField() method + +Returns runtime field if exists + +Signature: + +```typescript +getRuntimeField(name: string): RuntimeField | null; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | | + +Returns: + +`RuntimeField | null` + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getscriptedfields.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getscriptedfields.md index 62b8f1b62ac787..95f9f31309674c 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getscriptedfields.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getscriptedfields.md @@ -6,6 +6,7 @@ > Warning: This API is now obsolete. > +> use runtime field instead > Signature: diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.hasruntimefield.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.hasruntimefield.md new file mode 100644 index 00000000000000..5000d5e645cbb9 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.hasruntimefield.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IndexPattern](./kibana-plugin-plugins-data-server.indexpattern.md) > [hasRuntimeField](./kibana-plugin-plugins-data-server.indexpattern.hasruntimefield.md) + +## IndexPattern.hasRuntimeField() method + +Checks if runtime field exists + +Signature: + +```typescript +hasRuntimeField(name: string): boolean; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | | + +Returns: + +`boolean` + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.md index 97d1cd91152623..27b8a31a2582ba 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.md @@ -54,13 +54,16 @@ export declare class IndexPattern implements IIndexPattern | [getFormatterForField(field)](./kibana-plugin-plugins-data-server.indexpattern.getformatterforfield.md) | | Provide a field, get its formatter | | [getFormatterForFieldNoDefault(fieldname)](./kibana-plugin-plugins-data-server.indexpattern.getformatterforfieldnodefault.md) | | Get formatter for a given field name. Return undefined if none exists | | [getNonScriptedFields()](./kibana-plugin-plugins-data-server.indexpattern.getnonscriptedfields.md) | | | +| [getRuntimeField(name)](./kibana-plugin-plugins-data-server.indexpattern.getruntimefield.md) | | Returns runtime field if exists | | [getScriptedFields()](./kibana-plugin-plugins-data-server.indexpattern.getscriptedfields.md) | | | | [getSourceFiltering()](./kibana-plugin-plugins-data-server.indexpattern.getsourcefiltering.md) | | Get the source filtering configuration for that index. | | [getTimeField()](./kibana-plugin-plugins-data-server.indexpattern.gettimefield.md) | | | +| [hasRuntimeField(name)](./kibana-plugin-plugins-data-server.indexpattern.hasruntimefield.md) | | Checks if runtime field exists | | [isTimeBased()](./kibana-plugin-plugins-data-server.indexpattern.istimebased.md) | | | | [isTimeNanosBased()](./kibana-plugin-plugins-data-server.indexpattern.istimenanosbased.md) | | | -| [removeRuntimeField(name)](./kibana-plugin-plugins-data-server.indexpattern.removeruntimefield.md) | | Remove a runtime field - removed from mapped field or removed unmapped field as appropriate | +| [removeRuntimeField(name)](./kibana-plugin-plugins-data-server.indexpattern.removeruntimefield.md) | | Remove a runtime field - removed from mapped field or removed unmapped field as appropriate. Doesn't clear associated field attributes. | | [removeScriptedField(fieldName)](./kibana-plugin-plugins-data-server.indexpattern.removescriptedfield.md) | | Remove scripted field from field list | +| [replaceAllRuntimeFields(newFields)](./kibana-plugin-plugins-data-server.indexpattern.replaceallruntimefields.md) | | Replaces all existing runtime fields with new fields | | [setFieldAttrs(fieldName, attrName, value)](./kibana-plugin-plugins-data-server.indexpattern.setfieldattrs.md) | | | | [setFieldCount(fieldName, count)](./kibana-plugin-plugins-data-server.indexpattern.setfieldcount.md) | | | | [setFieldCustomLabel(fieldName, customLabel)](./kibana-plugin-plugins-data-server.indexpattern.setfieldcustomlabel.md) | | | diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.removeruntimefield.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.removeruntimefield.md index da8e7e40a7fac2..ef32b80ba8502e 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.removeruntimefield.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.removeruntimefield.md @@ -4,7 +4,7 @@ ## IndexPattern.removeRuntimeField() method -Remove a runtime field - removed from mapped field or removed unmapped field as appropriate +Remove a runtime field - removed from mapped field or removed unmapped field as appropriate. Doesn't clear associated field attributes. Signature: @@ -16,7 +16,7 @@ removeRuntimeField(name: string): void; | Parameter | Type | Description | | --- | --- | --- | -| name | string | | +| name | string | Field name to remove | Returns: diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.removescriptedfield.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.removescriptedfield.md index f6beed7389e438..b351eba2ace4f6 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.removescriptedfield.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.removescriptedfield.md @@ -6,6 +6,7 @@ > Warning: This API is now obsolete. > +> use runtime field instead > Remove scripted field from field list diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.replaceallruntimefields.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.replaceallruntimefields.md new file mode 100644 index 00000000000000..35df871763f8a1 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.replaceallruntimefields.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IndexPattern](./kibana-plugin-plugins-data-server.indexpattern.md) > [replaceAllRuntimeFields](./kibana-plugin-plugins-data-server.indexpattern.replaceallruntimefields.md) + +## IndexPattern.replaceAllRuntimeFields() method + +Replaces all existing runtime fields with new fields + +Signature: + +```typescript +replaceAllRuntimeFields(newFields: Record): void; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| newFields | Record<string, RuntimeField> | | + +Returns: + +`void` + diff --git a/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.expressionsservice.md b/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.expressionsservice.md index 6ba0f0feb82b3a..9afd603bc48694 100644 --- a/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.expressionsservice.md +++ b/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.expressionsservice.md @@ -70,7 +70,7 @@ The actual function is defined in the fn key. The function can be \ | Method | Modifiers | Description | | --- | --- | --- | -| [setup()](./kibana-plugin-plugins-expressions-public.expressionsservice.setup.md) | | Returns Kibana Platform \*setup\* life-cycle contract. Useful to return the same contract on server-side and browser-side. | -| [start()](./kibana-plugin-plugins-expressions-public.expressionsservice.start.md) | | Returns Kibana Platform \*start\* life-cycle contract. Useful to return the same contract on server-side and browser-side. | +| [setup(args)](./kibana-plugin-plugins-expressions-public.expressionsservice.setup.md) | | Returns Kibana Platform \*setup\* life-cycle contract. Useful to return the same contract on server-side and browser-side. | +| [start(args)](./kibana-plugin-plugins-expressions-public.expressionsservice.start.md) | | Returns Kibana Platform \*start\* life-cycle contract. Useful to return the same contract on server-side and browser-side. | | [stop()](./kibana-plugin-plugins-expressions-public.expressionsservice.stop.md) | | | diff --git a/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.expressionsservice.setup.md b/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.expressionsservice.setup.md index a51f3f073d5181..991f1f717d5f56 100644 --- a/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.expressionsservice.setup.md +++ b/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.expressionsservice.setup.md @@ -9,8 +9,15 @@ Returns Kibana Platform \*setup\* life-cycle contract. Useful to return the same Signature: ```typescript -setup(): ExpressionsServiceSetup; +setup(...args: unknown[]): ExpressionsServiceSetup; ``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| args | unknown[] | | + Returns: `ExpressionsServiceSetup` diff --git a/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.expressionsservice.start.md b/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.expressionsservice.start.md index 766d703a0729da..34d33cacabebb6 100644 --- a/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.expressionsservice.start.md +++ b/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.expressionsservice.start.md @@ -9,8 +9,15 @@ Returns Kibana Platform \*start\* life-cycle contract. Useful to return the same Signature: ```typescript -start(): ExpressionsServiceStart; +start(...args: unknown[]): ExpressionsServiceStart; ``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| args | unknown[] | | + Returns: `ExpressionsServiceStart` diff --git a/docs/discover/images/discover-search-for-relevance.png b/docs/discover/images/discover-search-for-relevance.png index 4d59ad186ded42..e42ed2416f79ef 100644 Binary files a/docs/discover/images/discover-search-for-relevance.png and b/docs/discover/images/discover-search-for-relevance.png differ diff --git a/docs/discover/images/double-arrow.png b/docs/discover/images/double-arrow.png new file mode 100644 index 00000000000000..ba4ee11ebf7381 Binary files /dev/null and b/docs/discover/images/double-arrow.png differ diff --git a/docs/discover/images/downward-arrow.png b/docs/discover/images/downward-arrow.png new file mode 100644 index 00000000000000..47b03cfe82b348 Binary files /dev/null and b/docs/discover/images/downward-arrow.png differ diff --git a/docs/discover/search-for-relevance.asciidoc b/docs/discover/search-for-relevance.asciidoc index 0232c02b6e0614..f3cf1c3a7f52c6 100644 --- a/docs/discover/search-for-relevance.asciidoc +++ b/docs/discover/search-for-relevance.asciidoc @@ -1,24 +1,36 @@ [[discover-search-for-relevance]] == Search for relevance -Sometimes you might be unsure which documents best match your question. +Sometimes you might be unsure which documents best match your search. {es} assigns a relevancy, or score to each document, so you can can narrow your search to the documents with the most relevant results. The higher the score, the better it matches your query. -For example, suppose you have the <>, and you're a searching for -a flight that arrived or departed from `Warsaw` or `Venice` when the weather was clear. +This example shows how to use *Discover* to list +your documents from most relevant to least relevant. This example uses +the <>, or you can use your own data. -. In *Discover*, open the index pattern dropdown, and select `kibana_sample_data_flight`. -. In the query bar, click *KQL*, and switch to the <>. -. Search for `Warsaw OR Venice OR Clear`. -. If you don't see any results, open the time filter and select a time range that contains data. -. From the list of *Available fields*, add `_score` to the document table. -. In the document table, click the header for the `_score` column, and then sort the column by descending scores. +. In *Discover*, open the index pattern dropdown, and select that data you want to work with. + -The results are currently sorted by first `Time`, and then by `_score`. -. To sort only by `_score`, remove the `Time` field. +For the sample flights data, set the index pattern to *kibana_sample_data_flights*. +. In the query bar, click *KQL*, and then turn it off. + -Your table now shows documents with the best matches, from most to least relevant. +You're now using the <>. +. Run your search. For the sample data, try: ++ +```ts +Warsaw OR Venice OR Clear +``` +. If you don't see any results, expand the <>, for example to *Last 7 days*. +. From the list of *Available fields*, add `_score` and any other fields you want to the document table. +. To sort the `_score` column in descending order, hover over its header, and then click twice on +the arrow icon +image:images/double-arrow.png[Double arrow icon to indicate sorting] so it changes to +image:images/downward-arrow.png[Downward pointing arrow to indicate descending sorting]. ++ +At this point, you're doing a multi-column sort: first by `Time`, and then by `_score`. +. To turn off sorting for the `Time` field, hover over its header, and then click the down arrow. ++ +Your table now sorts documents from most to least relevant. + [role="screenshot"] image::images/discover-search-for-relevance.png["Example of a search for relevance"] diff --git a/docs/index-extra-title-page.html b/docs/index-extra-title-page.html index 06d8c0b2e827b9..7bcbc9f0751249 100644 --- a/docs/index-extra-title-page.html +++ b/docs/index-extra-title-page.html @@ -1,5 +1,6 @@

From creating beautiful visualizations to managing the Elastic Stack, learn how Kibana helps you get the most of your data.

+

Watch our videos

@@ -11,8 +12,8 @@ diff --git a/docs/setup/connect-to-elasticsearch.asciidoc b/docs/setup/connect-to-elasticsearch.asciidoc index 8c0aa12ffc4c61..5e18d934863aa9 100644 --- a/docs/setup/connect-to-elasticsearch.asciidoc +++ b/docs/setup/connect-to-elasticsearch.asciidoc @@ -46,8 +46,7 @@ image::images/add-data-fleet.png[Add data using Fleet] [[upload-data-kibana]] === Upload a file -experimental[] If your data is in a CSV, JSON, or log file, you can upload it using the File -Data Visualizer. You can upload a file up to 100 MB. This value is configurable up to 1 GB in +experimental[] If your data is in a CSV, JSON, or log file, you can upload it using the {file-data-viz}. You can upload a file up to 100 MB. This value is configurable up to 1 GB in <>. To upload a file with geospatial data, refer to <>. diff --git a/docs/setup/images/add-data-fv.png b/docs/setup/images/add-data-fv.png old mode 100755 new mode 100644 index 45313d133822c1..7e253cdd0229d7 Binary files a/docs/setup/images/add-data-fv.png and b/docs/setup/images/add-data-fv.png differ diff --git a/docs/setup/images/add-data-tutorials.png b/docs/setup/images/add-data-tutorials.png index 74deedc57b42ed..782b44e383772c 100644 Binary files a/docs/setup/images/add-data-tutorials.png and b/docs/setup/images/add-data-tutorials.png differ diff --git a/docs/user/dashboard/aggregation-reference.asciidoc b/docs/user/dashboard/aggregation-reference.asciidoc index 7d5547fe3c3c50..39e596df4af347 100644 --- a/docs/user/dashboard/aggregation-reference.asciidoc +++ b/docs/user/dashboard/aggregation-reference.asciidoc @@ -188,6 +188,12 @@ For information about {es} metrics aggregations, refer to {ref}/search-aggregati | Type | Agg-based | Markdown | Lens | TSVB +| Metrics with filters +| +^| X +| +| + | Average ^| X ^| X @@ -221,7 +227,7 @@ For information about {es} metrics aggregations, refer to {ref}/search-aggregati | Percentiles ^| X ^| X -| +^| X ^| X | Percentiles Rank @@ -230,10 +236,10 @@ For information about {es} metrics aggregations, refer to {ref}/search-aggregati | ^| X -| Top hit +| Top hit (Last value) +^| X ^| X ^| X -| ^| X | Value count @@ -266,7 +272,7 @@ For information about {es} pipeline aggregations, refer to {ref}/search-aggregat | Derivative ^| X ^| X -| +^| X ^| X | Max bucket @@ -290,13 +296,13 @@ For information about {es} pipeline aggregations, refer to {ref}/search-aggregat | Moving average ^| X ^| X -| +^| X ^| X | Cumulative sum ^| X ^| X -| +^| X ^| X | Bucket script diff --git a/docs/user/dashboard/lens.asciidoc b/docs/user/dashboard/lens.asciidoc index 3b3a7a9ee527d4..9f17a380bc209a 100644 --- a/docs/user/dashboard/lens.asciidoc +++ b/docs/user/dashboard/lens.asciidoc @@ -147,14 +147,24 @@ For the answers to common *Lens* questions, review the following. [float] [[kql-]] -===== When should I use the Filter function instead of KQL filters? +===== When should I use the top filter bar, filters function, or "Filter by"? -The easiest way to apply KQL filters is to use <>, but you can also use the *Filters* function in the following scenarios: +Using the top <> bar is best when you want to focus on a known set of +data for all the visualization results. These top level filters are combined with other filters +using AND logic. + +Use the *Filters* function in the following scenarios: * When you want to apply more than one KQL filter to the visualization. * When you want to apply the KQL filter to a single layer, which allows you to visualize filtered and unfiltered data. +Use the *Filter by* advanced option in the following scenarios: + +* When you want to assign a custom color to each filter in a bar, line or area chart. + +* When you want to build a complex table, such as showing both failure rate and overall. + [float] [[when-should-i-normalize-the-data-by-unit-or-use-a-custom-interval]] ===== When should I normalize the data by unit or use a custom interval? diff --git a/docs/user/dashboard/timelion.asciidoc b/docs/user/dashboard/timelion.asciidoc index 675fd03df36484..ec9e8b56f9342c 100644 --- a/docs/user/dashboard/timelion.asciidoc +++ b/docs/user/dashboard/timelion.asciidoc @@ -4,7 +4,7 @@ To use *Timelion*, you define a graph by chaining functions together, using the *Timelion*-specific syntax. The syntax enables some features that classical point series charts don't offer, such as pulling data from different indices or data sources into one graph. -deprecated::[7.0.0,"*Timelion* is still supported. The *Timelion app* is deprecated in 7.0, replaced by dashboard features. In the last 7.x minor version and later, the *Timelion app* is removed from {kib}. To prepare for the removal of *Timelion app*, you must migrate *Timelion app* worksheets to a dashboard. For information on how to migrate *Timelion app* worksheets, refer to the link:https://www.elastic.co/guide/en/kibana/7.10/release-notes-7.10.0.html#deprecation-v7.10.0[7.10.0 Release Notes]."] +deprecated::[7.0.0,"*Timelion* is still supported. The *Timelion app* is deprecated in 7.0, replaced by dashboard features. In 7.16 and later, the *Timelion app* is removed from {kib}. To prepare for the removal of *Timelion app*, you must migrate *Timelion app* worksheets to a dashboard. For information on how to migrate *Timelion app* worksheets, refer to the link:https://www.elastic.co/guide/en/kibana/7.10/release-notes-7.10.0.html#deprecation-v7.10.0[7.10.0 Release Notes]."] [float] ==== Timelion expressions diff --git a/docs/user/production-considerations/task-manager-health-monitoring.asciidoc b/docs/user/production-considerations/task-manager-health-monitoring.asciidoc index f64c120f61298f..d6b90a4f19e112 100644 --- a/docs/user/production-considerations/task-manager-health-monitoring.asciidoc +++ b/docs/user/production-considerations/task-manager-health-monitoring.asciidoc @@ -6,6 +6,8 @@ Health monitoring ++++ +experimental[] + The Task Manager has an internal monitoring mechanism to keep track of a variety of metrics, which can be consumed with either the health monitoring API or the {kib} server log. The health monitoring API provides a reliable endpoint that can be monitored. diff --git a/docs/user/production-considerations/task-manager-troubleshooting.asciidoc b/docs/user/production-considerations/task-manager-troubleshooting.asciidoc index 5e75aef0d9570f..c6a7b7f3d53fdc 100644 --- a/docs/user/production-considerations/task-manager-troubleshooting.asciidoc +++ b/docs/user/production-considerations/task-manager-troubleshooting.asciidoc @@ -60,6 +60,8 @@ For details on scaling Task Manager, see <>. [[task-manager-diagnosing-root-cause]] ==== Diagnose a root cause for drift +experimental[] + The following guide helps you identify a root cause for _drift_ by making sense of the output from the <> endpoint. By analyzing the different sections of the output, you can evaluate different theories that explain the drift in a deployment. diff --git a/examples/index_pattern_field_editor_example/README.md b/examples/index_pattern_field_editor_example/README.md new file mode 100644 index 00000000000000..35ae814fc10e25 --- /dev/null +++ b/examples/index_pattern_field_editor_example/README.md @@ -0,0 +1,7 @@ +## index pattern field editor example + +This example index pattern field editor app shows how to: + - Edit index pattern fields via flyout + - Delete index pattern runtime fields with modal confirm prompt + +To run this example, use the command `yarn start --run-examples`. \ No newline at end of file diff --git a/examples/index_pattern_field_editor_example/kibana.json b/examples/index_pattern_field_editor_example/kibana.json new file mode 100644 index 00000000000000..c522e6698ac3d6 --- /dev/null +++ b/examples/index_pattern_field_editor_example/kibana.json @@ -0,0 +1,10 @@ +{ + "id": "indexPatternFieldEditorExample", + "version": "0.0.1", + "kibanaVersion": "kibana", + "server": false, + "ui": true, + "requiredPlugins": ["data", "indexPatternFieldEditor", "developerExamples"], + "optionalPlugins": [], + "requiredBundles": [] +} diff --git a/examples/index_pattern_field_editor_example/public/app.tsx b/examples/index_pattern_field_editor_example/public/app.tsx new file mode 100644 index 00000000000000..bd725759380aae --- /dev/null +++ b/examples/index_pattern_field_editor_example/public/app.tsx @@ -0,0 +1,145 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { useState } from 'react'; +import ReactDOM from 'react-dom'; +import { + EuiPage, + EuiPageHeader, + EuiPageBody, + EuiPageContent, + EuiPageContentBody, + EuiButton, + EuiInMemoryTable, + EuiText, + DefaultItemAction, +} from '@elastic/eui'; +import { AppMountParameters } from '../../../src/core/public'; +import { + DataPublicPluginStart, + IndexPattern, + IndexPatternField, +} from '../../../src/plugins/data/public'; +import { IndexPatternFieldEditorStart } from '../../../src/plugins/index_pattern_field_editor/public'; + +interface Props { + indexPattern?: IndexPattern; + indexPatternFieldEditor: IndexPatternFieldEditorStart; +} + +const IndexPatternFieldEditorExample = ({ indexPattern, indexPatternFieldEditor }: Props) => { + const [fields, setFields] = useState( + indexPattern?.getNonScriptedFields() || [] + ); + const refreshFields = () => setFields(indexPattern?.getNonScriptedFields() || []); + const columns = [ + { + field: 'name', + name: 'Field name', + }, + { + name: 'Actions', + actions: [ + { + name: 'Edit', + description: 'Edit this field', + icon: 'pencil', + type: 'icon', + 'data-test-subj': 'editField', + onClick: (fld: IndexPatternField) => + indexPatternFieldEditor.openEditor({ + ctx: { indexPattern: indexPattern! }, + fieldName: fld.name, + onSave: refreshFields, + }), + }, + { + name: 'Delete', + description: 'Delete this field', + icon: 'trash', + type: 'icon', + 'data-test-subj': 'deleteField', + available: (fld) => !!fld.runtimeField, + onClick: (fld: IndexPatternField) => + indexPatternFieldEditor.openDeleteModal({ + fieldName: fld.name, + ctx: { + indexPattern: indexPattern!, + }, + onDelete: refreshFields, + }), + }, + ] as Array>, + }, + ]; + + const content = indexPattern ? ( + <> + Index pattern: {indexPattern?.title} +
+ + indexPatternFieldEditor.openEditor({ + ctx: { indexPattern: indexPattern! }, + onSave: refreshFields, + }) + } + data-test-subj="addField" + > + Add field + +
+ + items={fields} + columns={columns} + pagination={true} + hasActions={true} + sorting={{ + sort: { + field: 'name', + direction: 'asc', + }, + }} + /> + + ) : ( +

Please create an index pattern

+ ); + + return ( + + + Index pattern field editor demo + + {content} + + + + ); +}; + +interface RenderAppDependencies { + data: DataPublicPluginStart; + indexPatternFieldEditor: IndexPatternFieldEditorStart; +} + +export const renderApp = async ( + { data, indexPatternFieldEditor }: RenderAppDependencies, + { element }: AppMountParameters +) => { + const indexPattern = (await data.indexPatterns.getDefault()) || undefined; + ReactDOM.render( + , + element + ); + + return () => ReactDOM.unmountComponentAtNode(element); +}; diff --git a/examples/index_pattern_field_editor_example/public/index.ts b/examples/index_pattern_field_editor_example/public/index.ts new file mode 100644 index 00000000000000..cc509da31d25fb --- /dev/null +++ b/examples/index_pattern_field_editor_example/public/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { IndexPatternFieldEditorPlugin } from './plugin'; + +export const plugin = () => new IndexPatternFieldEditorPlugin(); diff --git a/examples/index_pattern_field_editor_example/public/plugin.tsx b/examples/index_pattern_field_editor_example/public/plugin.tsx new file mode 100644 index 00000000000000..ccbb93e3acf956 --- /dev/null +++ b/examples/index_pattern_field_editor_example/public/plugin.tsx @@ -0,0 +1,56 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Plugin, CoreSetup, AppMountParameters, AppNavLinkStatus } from '../../../src/core/public'; +import { DeveloperExamplesSetup } from '../../developer_examples/public'; +import { DataPublicPluginStart } from '../../../src/plugins/data/public'; +import { IndexPatternFieldEditorStart } from '../../../src/plugins/index_pattern_field_editor/public'; + +interface StartDeps { + data: DataPublicPluginStart; + indexPatternFieldEditor: IndexPatternFieldEditorStart; +} + +interface SetupDeps { + developerExamples: DeveloperExamplesSetup; +} + +export class IndexPatternFieldEditorPlugin implements Plugin { + public setup(core: CoreSetup, deps: SetupDeps) { + core.application.register({ + id: 'indexPatternFieldEditorExample', + title: 'Index pattern field editor example', + navLinkStatus: AppNavLinkStatus.hidden, + async mount(params: AppMountParameters) { + const [, depsStart] = await core.getStartServices(); + const { renderApp } = await import('./app'); + return renderApp(depsStart, params); + }, + }); + + deps.developerExamples.register({ + appId: 'indexPatternFieldEditorExample', + title: 'Index pattern field editor', + description: `IndexPatternFieldEditor provides a UI for editing index pattern fields directly from Kibana apps. This example plugin demonstrates integration.`, + links: [ + { + label: 'README', + href: + 'https://github.com/elastic/kibana/blob/master/src/plugins/index_pattern_field_editor/README.md', + iconType: 'logoGithub', + size: 's', + target: '_blank', + }, + ], + }); + } + + public start() {} + + public stop() {} +} diff --git a/examples/index_pattern_field_editor_example/tsconfig.json b/examples/index_pattern_field_editor_example/tsconfig.json new file mode 100644 index 00000000000000..1f6d52ed5260e4 --- /dev/null +++ b/examples/index_pattern_field_editor_example/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target", + "skipLibCheck": true + }, + "include": [ + "index.ts", + "public/**/*.ts", + "public/**/*.tsx", + "../../typings/**/*", + ], + "exclude": [], + "references": [ + { "path": "../../src/core/tsconfig.json" }, + { "path": "../../src/plugins/kibana_react/tsconfig.json" }, + ] +} \ No newline at end of file diff --git a/examples/search_examples/public/search_sessions/app.tsx b/examples/search_examples/public/search_sessions/app.tsx index a768600db24eea..7fdf91537c977c 100644 --- a/examples/search_examples/public/search_sessions/app.tsx +++ b/examples/search_examples/public/search_sessions/app.tsx @@ -702,7 +702,7 @@ function doSearch( const startTs = performance.now(); // Submit the search request using the `data.search` service. - // @ts-expect-error request.params is incompatible. Filter is not assignable to QueryContainer + // @ts-expect-error request.params is incompatible. Filter is not assignable to QueryDslQueryContainer return data.search .search(req, { sessionId }) .pipe( diff --git a/package.json b/package.json index a2499d85247d73..cf6bd407d53a43 100644 --- a/package.json +++ b/package.json @@ -99,9 +99,9 @@ "dependencies": { "@elastic/apm-rum": "^5.6.1", "@elastic/apm-rum-react": "^1.2.5", - "@elastic/charts": "29.2.0", + "@elastic/charts": "30.0.0", "@elastic/datemath": "link:bazel-bin/packages/elastic-datemath", - "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.4", + "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.13", "@elastic/ems-client": "7.13.0", "@elastic/eui": "33.0.0", "@elastic/filesaver": "1.1.2", @@ -118,7 +118,7 @@ "@hapi/boom": "^9.1.1", "@hapi/cookie": "^11.0.2", "@hapi/good-squeeze": "6.0.0", - "@hapi/h2o2": "^9.0.2", + "@hapi/h2o2": "^9.1.0", "@hapi/hapi": "^20.0.3", "@hapi/hoek": "^9.1.1", "@hapi/inert": "^6.0.3", @@ -150,7 +150,7 @@ "@kbn/securitysolution-list-utils": "link:bazel-bin/packages/kbn-securitysolution-list-utils", "@kbn/securitysolution-utils": "link:bazel-bin/packages/kbn-securitysolution-utils", "@kbn/server-http-tools": "link:bazel-bin/packages/kbn-server-http-tools", - "@kbn/server-route-repository": "link:packages/kbn-server-route-repository", + "@kbn/server-route-repository": "link:bazel-bin/packages/kbn-server-route-repository", "@kbn/std": "link:bazel-bin/packages/kbn-std", "@kbn/tinymath": "link:bazel-bin/packages/kbn-tinymath", "@kbn/ui-framework": "link:packages/kbn-ui-framework", @@ -198,7 +198,7 @@ "broadcast-channel": "^3.0.3", "chalk": "^4.1.0", "check-disk-space": "^2.1.0", - "cheerio": "0.22.0", + "cheerio": "^1.0.0-rc.9", "chokidar": "^3.4.3", "chroma-js": "^1.4.1", "classnames": "2.2.6", @@ -441,7 +441,7 @@ "@babel/traverse": "^7.12.12", "@babel/types": "^7.12.12", "@bazel/ibazel": "^0.15.10", - "@bazel/typescript": "^3.5.0", + "@bazel/typescript": "^3.5.1", "@cypress/snapshot": "^2.1.7", "@cypress/webpack-preprocessor": "^5.6.0", "@elastic/apm-rum": "^5.6.1", @@ -501,7 +501,6 @@ "@types/base64-js": "^1.2.5", "@types/bluebird": "^3.1.1", "@types/chance": "^1.0.0", - "@types/cheerio": "^0.22.28", "@types/chroma-js": "^1.4.2", "@types/chromedriver": "^81.0.0", "@types/classnames": "^2.2.9", @@ -748,6 +747,7 @@ "jest-cli": "^26.6.3", "jest-diff": "^26.6.2", "jest-environment-jsdom": "^26.6.2", + "jest-environment-jsdom-thirteen": "^1.0.1", "jest-raw-loader": "^1.0.1", "jest-silent-reporter": "^0.5.0", "jest-snapshot": "^26.6.2", diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel index 083ae90a031f50..3e17d471a3cac0 100644 --- a/packages/BUILD.bazel +++ b/packages/BUILD.bazel @@ -40,6 +40,7 @@ filegroup( "//packages/kbn-securitysolution-utils:build", "//packages/kbn-securitysolution-es-utils:build", "//packages/kbn-server-http-tools:build", + "//packages/kbn-server-route-repository:build", "//packages/kbn-std:build", "//packages/kbn-telemetry-tools:build", "//packages/kbn-tinymath:build", diff --git a/packages/kbn-apm-utils/src/index.ts b/packages/kbn-apm-utils/src/index.ts index f2f537138dad07..384b6683199e5b 100644 --- a/packages/kbn-apm-utils/src/index.ts +++ b/packages/kbn-apm-utils/src/index.ts @@ -16,6 +16,8 @@ export interface SpanOptions { labels?: Record; } +type Span = Exclude; + export function parseSpanOptions(optionsOrName: SpanOptions | string) { const options = typeof optionsOrName === 'string' ? { name: optionsOrName } : optionsOrName; @@ -30,7 +32,7 @@ const runInNewContext = any>(cb: T): ReturnType( optionsOrName: SpanOptions | string, - cb: () => Promise + cb: (span?: Span) => Promise ): Promise { const options = parseSpanOptions(optionsOrName); @@ -71,13 +73,17 @@ export async function withSpan( span.addLabels(labels); } - return cb() + return cb(span) .then((res) => { - span.outcome = 'success'; + if (!span.outcome || span.outcome === 'unknown') { + span.outcome = 'success'; + } return res; }) .catch((err) => { - span.outcome = 'failure'; + if (!span.outcome || span.outcome === 'unknown') { + span.outcome = 'failure'; + } throw err; }) .finally(() => { diff --git a/packages/kbn-cli-dev-mode/src/base_path_proxy_server.test.ts b/packages/kbn-cli-dev-mode/src/base_path_proxy_server.test.ts index a0afbe3a9b8c90..34c6be02847a7a 100644 --- a/packages/kbn-cli-dev-mode/src/base_path_proxy_server.test.ts +++ b/packages/kbn-cli-dev-mode/src/base_path_proxy_server.test.ts @@ -185,6 +185,45 @@ describe('BasePathProxyServer', () => { }); }); + test('forwards request cancellation', async () => { + let propagated = false; + + let notifyRequestReceived: () => void; + const requestReceived = new Promise((resolve) => { + notifyRequestReceived = resolve; + }); + + let notifyRequestAborted: () => void; + const requestAborted = new Promise((resolve) => { + notifyRequestAborted = resolve; + }); + + server.route({ + method: 'GET', + path: `${basePath}/foo/{test}`, + handler: async (request, h) => { + notifyRequestReceived(); + + request.raw.req.once('aborted', () => { + notifyRequestAborted(); + propagated = true; + }); + return await new Promise((resolve) => undefined); + }, + }); + await server.start(); + + const request = proxySupertest.get(`${basePath}/foo/some-string`).end(); + + await requestReceived; + + request.abort(); + + await requestAborted; + + expect(propagated).toEqual(true); + }); + test('handles putting', async () => { server.route({ method: 'PUT', diff --git a/packages/kbn-dev-utils/src/plugins/parse_kibana_platform_plugin.ts b/packages/kbn-dev-utils/src/plugins/parse_kibana_platform_plugin.ts index 8d3fdb0f390c5e..62231f8221a957 100644 --- a/packages/kbn-dev-utils/src/plugins/parse_kibana_platform_plugin.ts +++ b/packages/kbn-dev-utils/src/plugins/parse_kibana_platform_plugin.ts @@ -29,6 +29,16 @@ interface Manifest { server: boolean; kibanaVersion: string; version: string; + // TODO: make this required. + owner?: { + // Internally, this should be a team name. + name: string; + // All internally owned plugins should have a github team specified that can be pinged in issues, or used to look up + // members who can be asked questions regarding the plugin. + githubTeam?: string; + }; + // TODO: make required. + description?: string; serviceFolders: readonly string[]; requiredPlugins: readonly string[]; optionalPlugins: readonly string[]; @@ -66,6 +76,8 @@ export function parseKibanaPlatformPlugin(manifestPath: string): KibanaPlatformP version: manifest.version, kibanaVersion: manifest.kibanaVersion || manifest.version, serviceFolders: manifest.serviceFolders || [], + owner: manifest.owner, + description: manifest.description, requiredPlugins: isValidDepsDeclaration(manifest.requiredPlugins, 'requiredPlugins'), optionalPlugins: isValidDepsDeclaration(manifest.optionalPlugins, 'optionalPlugins'), requiredBundles: isValidDepsDeclaration(manifest.requiredBundles, 'requiredBundles'), diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_docs_cli.ts b/packages/kbn-docs-utils/src/api_docs/build_api_docs_cli.ts index 0e3d209d6398c5..55a466a430b696 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_docs_cli.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_docs_cli.ts @@ -13,20 +13,12 @@ import { REPO_ROOT, run, CiStatsReporter, createFlagError } from '@kbn/dev-utils import { Project } from 'ts-morph'; import { writePluginDocs } from './mdx/write_plugin_mdx_docs'; -import { ApiDeclaration, PluginApi, TypeKind } from './types'; +import { ApiDeclaration, ApiStats, MissingApiItemMap, PluginApi, TypeKind } from './types'; import { findPlugins } from './find_plugins'; import { pathsOutsideScopes } from './build_api_declarations/utils'; import { getPluginApiMap } from './get_plugin_api_map'; import { writeDeprecationDoc } from './mdx/write_deprecations_doc'; -export interface PluginInfo { - apiCount: number; - apiCountMissingComments: number; - id: string; - missingApiItems: string[]; - percentApiMissingComments: number; -} - function isStringArray(arr: unknown | string[]): arr is string[] { return Array.isArray(arr) && arr.every((p) => typeof p === 'string'); } @@ -95,14 +87,13 @@ export function runBuildApiDocsCli() { const id = plugin.manifest.id; const pluginApi = pluginApiMap[id]; - const apiCount = countApiForPlugin(pluginApi); - const pluginStats = collectApiStatsForPlugin(pluginApi); + const pluginStats = collectApiStatsForPlugin(pluginApi, missingApiItems); reporter.metrics([ { id, group: 'API count', - value: apiCount, + value: pluginStats.apiCount, }, { id, @@ -202,8 +193,8 @@ export function runBuildApiDocsCli() { } } - if (apiCount > 0) { - writePluginDocs(outputFolder, pluginApi, log); + if (pluginStats.apiCount > 0) { + writePluginDocs(outputFolder, { doc: pluginApi, plugin, pluginStats, log }); } writeDeprecationDoc(outputFolder, referencedDeprecations, log); }); @@ -239,27 +230,27 @@ function getTsProject(repoPath: string) { return project; } -interface ApiStats { - missingComments: ApiDeclaration[]; - isAnyType: ApiDeclaration[]; - noReferences: ApiDeclaration[]; -} - -function collectApiStatsForPlugin(doc: PluginApi): ApiStats { - const stats: ApiStats = { missingComments: [], isAnyType: [], noReferences: [] }; +function collectApiStatsForPlugin(doc: PluginApi, missingApiItems: MissingApiItemMap): ApiStats { + const stats: ApiStats = { + missingComments: [], + isAnyType: [], + noReferences: [], + apiCount: countApiForPlugin(doc), + missingExports: Object.values(missingApiItems[doc.id] ?? {}).length, + }; Object.values(doc.client).forEach((def) => { - collectStatsForApi(def, stats); + collectStatsForApi(def, stats, doc); }); Object.values(doc.server).forEach((def) => { - collectStatsForApi(def, stats); + collectStatsForApi(def, stats, doc); }); Object.values(doc.common).forEach((def) => { - collectStatsForApi(def, stats); + collectStatsForApi(def, stats, doc); }); return stats; } -function collectStatsForApi(doc: ApiDeclaration, stats: ApiStats): void { +function collectStatsForApi(doc: ApiDeclaration, stats: ApiStats, pluginApi: PluginApi): void { const missingComment = doc.description === undefined || doc.description.length === 0; if (missingComment) { stats.missingComments.push(doc); @@ -269,7 +260,7 @@ function collectStatsForApi(doc: ApiDeclaration, stats: ApiStats): void { } if (doc.children) { doc.children.forEach((child) => { - collectStatsForApi(child, stats); + collectStatsForApi(child, stats, pluginApi); }); } if (!doc.references || doc.references.length === 0) { diff --git a/packages/kbn-docs-utils/src/api_docs/mdx/types.ts b/packages/kbn-docs-utils/src/api_docs/mdx/types.ts new file mode 100644 index 00000000000000..38c25fe68f7bb2 --- /dev/null +++ b/packages/kbn-docs-utils/src/api_docs/mdx/types.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { KibanaPlatformPlugin, ToolingLog } from '@kbn/dev-utils'; +import { ApiStats, PluginApi } from '../types'; + +export interface WritePluginDocsOpts { + doc: PluginApi; + plugin: KibanaPlatformPlugin; + pluginStats: ApiStats; + log: ToolingLog; +} diff --git a/packages/kbn-docs-utils/src/api_docs/mdx/write_plugin_mdx_docs.ts b/packages/kbn-docs-utils/src/api_docs/mdx/write_plugin_mdx_docs.ts index 86ddf38cba4b66..557277331b099b 100644 --- a/packages/kbn-docs-utils/src/api_docs/mdx/write_plugin_mdx_docs.ts +++ b/packages/kbn-docs-utils/src/api_docs/mdx/write_plugin_mdx_docs.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import { ToolingLog } from '@kbn/dev-utils'; import fs from 'fs'; import Path from 'path'; import dedent from 'dedent'; @@ -19,6 +18,7 @@ import { groupPluginApi, } from '../utils'; import { writePluginDocSplitByFolder } from './write_plugin_split_by_folder'; +import { WritePluginDocsOpts } from './types'; /** * Converts the plugin doc to mdx and writes it into the file system. If the plugin, @@ -28,12 +28,15 @@ import { writePluginDocSplitByFolder } from './write_plugin_split_by_folder'; * @param doc Contains the information of the plugin that will be written into mdx. * @param log Used for logging debug and error information. */ -export function writePluginDocs(folder: string, doc: PluginApi, log: ToolingLog): void { +export function writePluginDocs( + folder: string, + { doc, plugin, pluginStats, log }: WritePluginDocsOpts +): void { if (doc.serviceFolders) { log.debug(`Splitting plugin ${doc.id}`); - writePluginDocSplitByFolder(folder, doc, log); + writePluginDocSplitByFolder(folder, { doc, log, plugin, pluginStats }); } else { - writePluginDoc(folder, doc, log); + writePluginDoc(folder, { doc, plugin, pluginStats, log }); } } @@ -50,7 +53,10 @@ function hasPublicApi(doc: PluginApi): boolean { * @param doc Contains the information of the plugin that will be written into mdx. * @param log Used for logging debug and error information. */ -export function writePluginDoc(folder: string, doc: PluginApi, log: ToolingLog): void { +export function writePluginDoc( + folder: string, + { doc, log, plugin, pluginStats }: WritePluginDocsOpts +): void { if (!hasPublicApi(doc)) { log.debug(`${doc.id} does not have a public api. Skipping.`); return; @@ -62,6 +68,7 @@ export function writePluginDoc(folder: string, doc: PluginApi, log: ToolingLog): // Append "obj" to avoid special names in here. 'case' is one in particular that // caused issues. const json = getJsonName(fileName) + 'Obj'; + const name = plugin.manifest.owner?.name; let mdx = dedent(` --- @@ -74,9 +81,26 @@ date: 2020-11-16 tags: ['contributor', 'dev', 'apidocs', 'kibana', '${doc.id}'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- - import ${json} from './${fileName}.json'; +${plugin.manifest.description ?? ''} + +${ + plugin.manifest.owner?.githubTeam && name + ? `Contact [${name}](https://github.com/orgs/elastic/teams/${plugin.manifest.owner?.githubTeam}) for questions regarding this plugin.` + : name + ? `Contact ${name} for questions regarding this plugin.` + : '' +} + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| ${pluginStats.apiCount} | ${pluginStats.isAnyType.length} | ${ + pluginStats.missingComments.length + } | ${pluginStats.missingExports} | + `) + '\n\n'; const scopedDoc = { diff --git a/packages/kbn-docs-utils/src/api_docs/mdx/write_plugin_split_by_folder.ts b/packages/kbn-docs-utils/src/api_docs/mdx/write_plugin_split_by_folder.ts index f5d547fc03520d..1a9037df0aa253 100644 --- a/packages/kbn-docs-utils/src/api_docs/mdx/write_plugin_split_by_folder.ts +++ b/packages/kbn-docs-utils/src/api_docs/mdx/write_plugin_split_by_folder.ts @@ -6,17 +6,22 @@ * Side Public License, v 1. */ -import { ToolingLog } from '@kbn/dev-utils'; import { snakeToCamel } from '../utils'; import { PluginApi, ApiDeclaration } from '../types'; import { writePluginDoc } from './write_plugin_mdx_docs'; +import { WritePluginDocsOpts } from './types'; -export function writePluginDocSplitByFolder(folder: string, doc: PluginApi, log: ToolingLog) { +export function writePluginDocSplitByFolder( + folder: string, + { doc, plugin, pluginStats, log }: WritePluginDocsOpts +) { const apisByFolder = splitApisByFolder(doc); log.debug(`Split ${doc.id} into ${apisByFolder.length} services`); apisByFolder.forEach((docDef) => { - writePluginDoc(folder, docDef, log); + // TODO: we should probably see if we can break down these stats by service folder. As it is, they will represent stats for + // the entire plugin. + writePluginDoc(folder, { doc: docDef, plugin, pluginStats, log }); }); } diff --git a/packages/kbn-docs-utils/src/api_docs/tests/api_doc_suite.test.ts b/packages/kbn-docs-utils/src/api_docs/tests/api_doc_suite.test.ts index ff71b0efc79d1c..c5538b9da229ea 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/api_doc_suite.test.ts +++ b/packages/kbn-docs-utils/src/api_docs/tests/api_doc_suite.test.ts @@ -13,7 +13,7 @@ import { Project } from 'ts-morph'; import { ToolingLog, KibanaPlatformPlugin } from '@kbn/dev-utils'; import { writePluginDocs } from '../mdx/write_plugin_mdx_docs'; -import { ApiDeclaration, PluginApi, Reference, TextWithLinks, TypeKind } from '../types'; +import { ApiDeclaration, ApiStats, PluginApi, Reference, TextWithLinks, TypeKind } from '../types'; import { getKibanaPlatformPlugin } from './kibana_platform_plugin_mock'; import { groupPluginApi } from '../utils'; import { getPluginApiMap } from '../get_plugin_api_map'; @@ -99,11 +99,23 @@ beforeAll(() => { const plugins: KibanaPlatformPlugin[] = [pluginA, pluginB]; const { pluginApiMap } = getPluginApiMap(project, plugins, log, { collectReferences: false }); + const pluginStats: ApiStats = { + missingComments: [], + isAnyType: [], + noReferences: [], + apiCount: 3, + missingExports: 0, + }; doc = pluginApiMap.pluginA; mdxOutputFolder = Path.resolve(__dirname, 'snapshots'); - writePluginDocs(mdxOutputFolder, doc, log); - writePluginDocs(mdxOutputFolder, pluginApiMap.pluginB, log); + writePluginDocs(mdxOutputFolder, { doc, plugin: pluginA, pluginStats, log }); + writePluginDocs(mdxOutputFolder, { + doc: pluginApiMap.pluginB, + plugin: pluginB, + pluginStats, + log, + }); }); it('Setup type is extracted', () => { diff --git a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.json b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.json index 7d8a90c3aad77a..0c3f65bc1b205d 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.json +++ b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.json @@ -598,7 +598,7 @@ "section": "def-public.ImAType", "text": "ImAType" }, - ", e?: string | undefined) => ", + ", e: string | undefined) => ", { "pluginId": "pluginA", "scope": "public", diff --git a/packages/kbn-docs-utils/src/api_docs/types.ts b/packages/kbn-docs-utils/src/api_docs/types.ts index 007b8c824d3c26..de53993fe30366 100644 --- a/packages/kbn-docs-utils/src/api_docs/types.ts +++ b/packages/kbn-docs-utils/src/api_docs/types.ts @@ -231,3 +231,10 @@ export interface ApiReference { export interface ReferencedDeprecations { [key: string]: Array<{ deprecatedApi: ApiDeclaration; ref: ApiReference }>; } +export interface ApiStats { + missingComments: ApiDeclaration[]; + isAnyType: ApiDeclaration[]; + noReferences: ApiDeclaration[]; + apiCount: number; + missingExports: number; +} diff --git a/packages/kbn-es-archiver/src/actions/edit.ts b/packages/kbn-es-archiver/src/actions/edit.ts index eb28985f714370..7a97bf08f36751 100644 --- a/packages/kbn-es-archiver/src/actions/edit.ts +++ b/packages/kbn-es-archiver/src/actions/edit.ts @@ -6,9 +6,9 @@ * Side Public License, v 1. */ -import { resolve, relative } from 'path'; +import { relative } from 'path'; import Fs from 'fs'; -import { createGunzip, createGzip, Z_BEST_COMPRESSION } from 'zlib'; +import { createGunzip, createGzip, constants } from 'zlib'; import { promisify } from 'util'; import globby from 'globby'; import { ToolingLog } from '@kbn/dev-utils'; @@ -17,24 +17,22 @@ import { createPromiseFromStreams } from '@kbn/utils'; const unlinkAsync = promisify(Fs.unlink); export async function editAction({ - prefix, - dataDir, + path, log, handler, }: { - prefix: string; - dataDir: string; + path: string; log: ToolingLog; handler: () => Promise; }) { const archives = ( await globby('**/*.gz', { - cwd: prefix ? resolve(dataDir, prefix) : dataDir, + cwd: path, absolute: true, }) - ).map((path) => ({ - path, - rawPath: path.slice(0, -3), + ).map((found) => ({ + path: found, + rawPath: found.slice(0, -3), })); await Promise.all( @@ -61,7 +59,7 @@ export async function editAction({ archives.map(async (archive) => { await createPromiseFromStreams([ Fs.createReadStream(archive.rawPath), - createGzip({ level: Z_BEST_COMPRESSION }), + createGzip({ level: constants.Z_BEST_COMPRESSION }), Fs.createWriteStream(archive.path), ]); diff --git a/packages/kbn-es-archiver/src/actions/load.ts b/packages/kbn-es-archiver/src/actions/load.ts index 248c4a65cb20a6..673fa7e7d96c86 100644 --- a/packages/kbn-es-archiver/src/actions/load.ts +++ b/packages/kbn-es-archiver/src/actions/load.ts @@ -6,10 +6,10 @@ * Side Public License, v 1. */ -import { resolve } from 'path'; +import { resolve, relative } from 'path'; import { createReadStream } from 'fs'; import { Readable } from 'stream'; -import { ToolingLog } from '@kbn/dev-utils'; +import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils'; import { KbnClient } from '@kbn/test'; import type { KibanaClient } from '@elastic/elasticsearch/api/kibana'; import { createPromiseFromStreams, concatStreamProviders } from '@kbn/utils'; @@ -37,23 +37,21 @@ const pipeline = (...streams: Readable[]) => ); export async function loadAction({ - name, + inputDir, skipExisting, useCreate, client, - dataDir, log, kbnClient, }: { - name: string; + inputDir: string; skipExisting: boolean; useCreate: boolean; client: KibanaClient; - dataDir: string; log: ToolingLog; kbnClient: KbnClient; }) { - const inputDir = resolve(dataDir, name); + const name = relative(REPO_ROOT, inputDir); const stats = createStats(name, log); const files = prioritizeMappings(await readDirectory(inputDir)); const kibanaPluginIds = await kbnClient.plugins.getEnabledIds(); diff --git a/packages/kbn-es-archiver/src/actions/rebuild_all.ts b/packages/kbn-es-archiver/src/actions/rebuild_all.ts index 1581ff41b95fca..f286f9719bdf1f 100644 --- a/packages/kbn-es-archiver/src/actions/rebuild_all.ts +++ b/packages/kbn-es-archiver/src/actions/rebuild_all.ts @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -import { resolve, dirname, relative } from 'path'; +import { resolve, relative } from 'path'; import { stat, Stats, rename, createReadStream, createWriteStream } from 'fs'; import { Readable, Writable } from 'stream'; import { fromNode } from 'bluebird'; -import { ToolingLog } from '@kbn/dev-utils'; +import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils'; import { createPromiseFromStreams } from '@kbn/utils'; import { prioritizeMappings, @@ -25,15 +25,7 @@ async function isDirectory(path: string): Promise { return stats.isDirectory(); } -export async function rebuildAllAction({ - dataDir, - log, - rootDir = dataDir, -}: { - dataDir: string; - log: ToolingLog; - rootDir?: string; -}) { +export async function rebuildAllAction({ dataDir, log }: { dataDir: string; log: ToolingLog }) { const childNames = prioritizeMappings(await readDirectory(dataDir)); for (const childName of childNames) { const childPath = resolve(dataDir, childName); @@ -42,13 +34,12 @@ export async function rebuildAllAction({ await rebuildAllAction({ dataDir: childPath, log, - rootDir, }); continue; } - const archiveName = dirname(relative(rootDir, childPath)); - log.info(`${archiveName} Rebuilding ${childName}`); + const archiveName = relative(REPO_ROOT, childPath); + log.info('[%s] Rebuilding %j', archiveName, childName); const gzip = isGzip(childPath); const tempFile = childPath + (gzip ? '.rebuilding.gz' : '.rebuilding'); @@ -60,6 +51,6 @@ export async function rebuildAllAction({ ] as [Readable, ...Writable[]]); await fromNode((cb) => rename(tempFile, childPath, cb)); - log.info(`${archiveName} Rebuilt ${childName}`); + log.info('[%s] Rebuilt %j', archiveName, childName); } } diff --git a/packages/kbn-es-archiver/src/actions/save.ts b/packages/kbn-es-archiver/src/actions/save.ts index c90f241a1c6399..da0966920de24e 100644 --- a/packages/kbn-es-archiver/src/actions/save.ts +++ b/packages/kbn-es-archiver/src/actions/save.ts @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -import { resolve } from 'path'; +import { resolve, relative } from 'path'; import { createWriteStream, mkdirSync } from 'fs'; import { Readable, Writable } from 'stream'; import type { KibanaClient } from '@elastic/elasticsearch/api/kibana'; -import { ToolingLog } from '@kbn/dev-utils'; +import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils'; import { createListStream, createPromiseFromStreams } from '@kbn/utils'; import { @@ -22,23 +22,21 @@ import { } from '../lib'; export async function saveAction({ - name, + outputDir, indices, client, - dataDir, log, raw, query, }: { - name: string; + outputDir: string; indices: string | string[]; client: KibanaClient; - dataDir: string; log: ToolingLog; raw: boolean; query?: Record; }) { - const outputDir = resolve(dataDir, name); + const name = relative(REPO_ROOT, outputDir); const stats = createStats(name, log); log.info('[%s] Creating archive of %j', name, indices); diff --git a/packages/kbn-es-archiver/src/actions/unload.ts b/packages/kbn-es-archiver/src/actions/unload.ts index f4e37871a53371..d8bc013b40991b 100644 --- a/packages/kbn-es-archiver/src/actions/unload.ts +++ b/packages/kbn-es-archiver/src/actions/unload.ts @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -import { resolve } from 'path'; +import { resolve, relative } from 'path'; import { createReadStream } from 'fs'; import { Readable, Writable } from 'stream'; import type { KibanaClient } from '@elastic/elasticsearch/api/kibana'; -import { ToolingLog } from '@kbn/dev-utils'; +import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils'; import { KbnClient } from '@kbn/test'; import { createPromiseFromStreams } from '@kbn/utils'; @@ -25,19 +25,17 @@ import { } from '../lib'; export async function unloadAction({ - name, + inputDir, client, - dataDir, log, kbnClient, }: { - name: string; + inputDir: string; client: KibanaClient; - dataDir: string; log: ToolingLog; kbnClient: KbnClient; }) { - const inputDir = resolve(dataDir, name); + const name = relative(REPO_ROOT, inputDir); const stats = createStats(name, log); const kibanaPluginIds = await kbnClient.plugins.getEnabledIds(); diff --git a/packages/kbn-es-archiver/src/cli.ts b/packages/kbn-es-archiver/src/cli.ts index 9617457d4573ed..9268f5fa7bbb5c 100644 --- a/packages/kbn-es-archiver/src/cli.ts +++ b/packages/kbn-es-archiver/src/cli.ts @@ -30,13 +30,12 @@ export function runCli() { new RunWithCommands({ description: 'CLI to manage archiving/restoring data in elasticsearch', globalFlags: { - string: ['es-url', 'kibana-url', 'dir', 'config', 'es-ca', 'kibana-ca'], + string: ['es-url', 'kibana-url', 'config', 'es-ca', 'kibana-ca'], help: ` - --config path to an FTR config file that sets --es-url, --kibana-url, and --dir + --config path to an FTR config file that sets --es-url and --kibana-url default: ${defaultConfigPath} --es-url url for Elasticsearch, prefer the --config flag --kibana-url url for Kibana, prefer the --config flag - --dir where arechives are stored, prefer the --config flag --kibana-ca if Kibana url points to https://localhost we default to the CA from @kbn/dev-utils, customize the CA with this flag --es-ca if Elasticsearch url points to https://localhost we default to the CA from @kbn/dev-utils, customize the CA with this flag `, @@ -104,17 +103,6 @@ export function runCli() { } } - let dir = flags.dir; - if (dir && typeof dir !== 'string') { - throw createFlagError('--dir must be a string'); - } - if (!dir && config) { - dir = Path.resolve(config.get('esArchiver.directory')); - } - if (!dir) { - throw createFlagError('--dir or --config must be defined'); - } - const client = new Client({ node: esUrl, ssl: esCa ? { ca: esCa } : undefined, @@ -130,7 +118,7 @@ export function runCli() { const esArchiver = new EsArchiver({ log, client, - dataDir: dir, + baseDir: process.cwd(), kbnClient, }); @@ -141,16 +129,16 @@ export function runCli() { }) .command({ name: 'save', - usage: 'save [name] [...indices]', + usage: 'save [path] [...indices]', description: ` - archive the [indices ...] into the --dir with [name] + archive the [indices ...] into a directory at [path] Example: - Save all [logstash-*] indices from http://localhost:9200 to [snapshots/my_test_data] directory + Save all [logstash-*] indices from http://localhost:9200 to the [test/functional/es_archives/my_test_data] directory - WARNING: If the [my_test_data] snapshot exists it will be deleted! + WARNING: If the [test/functional/es_archives/my_test_data] snapshot exists it will be deleted! - $ node scripts/es_archiver save my_test_data logstash-* --dir snapshots + $ node scripts/es_archiver save test/functional/es_archives/my_test_data logstash-* `, flags: { boolean: ['raw'], @@ -161,9 +149,9 @@ export function runCli() { `, }, async run({ flags, esArchiver }) { - const [name, ...indices] = flags._; - if (!name) { - throw createFlagError('missing [name] argument'); + const [path, ...indices] = flags._; + if (!path) { + throw createFlagError('missing [path] argument'); } if (!indices.length) { throw createFlagError('missing [...indices] arguments'); @@ -184,22 +172,22 @@ export function runCli() { } } - await esArchiver.save(name, indices, { raw, query: parsedQuery }); + await esArchiver.save(path, indices, { raw, query: parsedQuery }); }, }) .command({ name: 'load', - usage: 'load [name]', + usage: 'load [path]', description: ` - load the archive in --dir with [name] + load the archive stored at [path] Example: - Load the [my_test_data] snapshot from the archive directory and elasticsearch instance defined - in the [test/functional/config.js] config file + Load the [my_test_data] snapshot from the local directory and elasticsearch instance defined + in the [../config.js] config file WARNING: If the indices exist already they will be deleted! - $ node scripts/es_archiver load my_test_data --config test/functional/config.js + $ node scripts/es_archiver load my_test_data --config ../config.js `, flags: { boolean: ['use-create'], @@ -208,9 +196,9 @@ export function runCli() { `, }, async run({ flags, esArchiver }) { - const [name] = flags._; - if (!name) { - throw createFlagError('missing [name] argument'); + const [path] = flags._; + if (!path) { + throw createFlagError('missing [path] argument'); } if (flags._.length > 1) { throw createFlagError(`unknown extra arguments: [${flags._.slice(1).join(', ')}]`); @@ -221,40 +209,40 @@ export function runCli() { throw createFlagError('--use-create does not take a value'); } - await esArchiver.load(name, { useCreate }); + await esArchiver.load(path, { useCreate }); }, }) .command({ name: 'unload', - usage: 'unload [name]', - description: 'remove indices created by the archive in --dir with [name]', + usage: 'unload [path]', + description: 'remove indices created by the archive at [path]', async run({ flags, esArchiver }) { - const [name] = flags._; - if (!name) { - throw createFlagError('missing [name] argument'); + const [path] = flags._; + if (!path) { + throw createFlagError('missing [path] argument'); } if (flags._.length > 1) { throw createFlagError(`unknown extra arguments: [${flags._.slice(1).join(', ')}]`); } - await esArchiver.unload(name); + await esArchiver.unload(path); }, }) .command({ name: 'edit', - usage: 'edit [prefix]', + usage: 'edit [path]', description: - 'extract the archives under the prefix, wait for edits to be completed, and then recompress the archives', + 'extract the archives within or at [path], wait for edits to be completed, and then recompress the archives', async run({ flags, esArchiver }) { - const [prefix] = flags._; - if (!prefix) { - throw createFlagError('missing [prefix] argument'); + const [path] = flags._; + if (!path) { + throw createFlagError('missing [path] argument'); } if (flags._.length > 1) { throw createFlagError(`unknown extra arguments: [${flags._.slice(1).join(', ')}]`); } - await esArchiver.edit(prefix, async () => { + await esArchiver.edit(path, async () => { const rl = readline.createInterface({ input: process.stdin, output: process.stdout, @@ -278,10 +266,19 @@ export function runCli() { }, }) .command({ - name: 'rebuild-all', - description: '[internal] read and write all archives in --dir to remove any inconsistencies', - async run({ esArchiver }) { - await esArchiver.rebuildAll(); + name: 'rebuild-all [dir]', + description: + '[internal] read and write all archives within [dir] to remove any inconsistencies', + async run({ flags, esArchiver }) { + const [dir] = flags._; + if (!dir) { + throw createFlagError('missing [dir] argument'); + } + if (flags._.length > 1) { + throw createFlagError(`unknown extra arguments: [${flags._.slice(1).join(', ')}]`); + } + + await esArchiver.rebuildAll(dir); }, }) .execute(); diff --git a/packages/kbn-es-archiver/src/es_archiver.ts b/packages/kbn-es-archiver/src/es_archiver.ts index 93ce97efd4c84a..06a56b79e30120 100644 --- a/packages/kbn-es-archiver/src/es_archiver.ts +++ b/packages/kbn-es-archiver/src/es_archiver.ts @@ -6,8 +6,11 @@ * Side Public License, v 1. */ +import Fs from 'fs'; +import Path from 'path'; + import type { KibanaClient } from '@elastic/elasticsearch/api/kibana'; -import { ToolingLog } from '@kbn/dev-utils'; +import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils'; import { KbnClient } from '@kbn/test'; import { @@ -21,139 +24,128 @@ import { interface Options { client: KibanaClient; - dataDir: string; + baseDir?: string; log: ToolingLog; kbnClient: KbnClient; } export class EsArchiver { private readonly client: KibanaClient; - private readonly dataDir: string; + private readonly baseDir: string; private readonly log: ToolingLog; private readonly kbnClient: KbnClient; constructor(options: Options) { this.client = options.client; - this.dataDir = options.dataDir; + this.baseDir = options.baseDir ?? REPO_ROOT; this.log = options.log; this.kbnClient = options.kbnClient; } /** - * Extract data and mappings from an elasticsearch index and store - * it in the dataDir so it can be used later to recreate the index. + * Extract data and mappings from an elasticsearch index and store + * it in the baseDir so it can be used later to recreate the index. * - * @param {String} name - the name of this archive, used to determine filename - * @param {String|Array} indices - the indices to archive - * @param {Object} options - * @property {Boolean} options.raw - should the archive be raw (unzipped) or not - * @return Promise + * @param {String} path - relative path to the archive, resolved relative to this.baseDir which defaults to REPO_ROOT + * @param {String|Array} indices - the indices to archive + * @param {Object} options + * @property {Boolean} options.raw - should the archive be raw (unzipped) or not */ async save( - name: string, + path: string, indices: string | string[], { raw = false, query }: { raw?: boolean; query?: Record } = {} ) { return await saveAction({ - name, + outputDir: Path.resolve(this.baseDir, path), indices, raw, client: this.client, - dataDir: this.dataDir, log: this.log, query, }); } /** - * Load an index from an archive + * Load an index from an archive * - * @param {String} name - the name of the archive to load - * @param {Object} options - * @property {Boolean} options.skipExisting - should existing indices + * @param {String} path - relative path to the archive to load, resolved relative to this.baseDir which defaults to REPO_ROOT + * @param {Object} options + * @property {Boolean} options.skipExisting - should existing indices * be ignored or overwritten - * @property {Boolean} options.useCreate - use a create operation instead of index for documents - * @return Promise + * @property {Boolean} options.useCreate - use a create operation instead of index for documents */ async load( - name: string, + path: string, { skipExisting = false, useCreate = false, }: { skipExisting?: boolean; useCreate?: boolean } = {} ) { return await loadAction({ - name, + inputDir: this.findArchive(path), skipExisting: !!skipExisting, useCreate: !!useCreate, client: this.client, - dataDir: this.dataDir, log: this.log, kbnClient: this.kbnClient, }); } /** - * Remove the indexes in elasticsearch that have data in an archive. + * Remove the indexes in elasticsearch that have data in an archive. * - * @param {String} name - * @return Promise + * @param {String} path - relative path to the archive to unload, resolved relative to this.baseDir which defaults to REPO_ROOT */ - async unload(name: string) { + async unload(path: string) { return await unloadAction({ - name, + inputDir: this.findArchive(path), client: this.client, - dataDir: this.dataDir, log: this.log, kbnClient: this.kbnClient, }); } /** - * Parse and reformat all of the archives. This is primarily helpful - * for working on the esArchiver. + * Parse and reformat all of the archives. This is primarily helpful + * for working on the esArchiver. * - * @return Promise + * @param {String} dir - relative path to a directory which contains archives, resolved relative to this.baseDir which defaults to REPO_ROOT */ - async rebuildAll() { + async rebuildAll(dir: string) { return await rebuildAllAction({ - dataDir: this.dataDir, + dataDir: Path.resolve(this.baseDir, dir), log: this.log, }); } /** - * Extract the gzipped files in an archive, then call the handler. When it - * resolves re-archive the gzipped files. + * Extract the gzipped files in an archive, then call the handler. When it + * resolves re-archive the gzipped files. * - * @param {String} prefix optional prefix to limit archives that are extracted - * @param {() => Promise} handler - * @return Promise + * @param {String} path optional prefix to limit archives that are extracted + * @param {() => Promise} handler */ - async edit(prefix: string, handler: () => Promise) { + async edit(path: string, handler: () => Promise) { return await editAction({ - prefix, + path: Path.resolve(this.baseDir, path), log: this.log, - dataDir: this.dataDir, handler, }); } /** - * Just like load, but skips any existing index + * Just like load, but skips any existing index * - * @param {String} name - * @return Promise + * @param name */ async loadIfNeeded(name: string) { return await this.load(name, { skipExisting: true }); } /** - * Delete any Kibana indices, and initialize the Kibana index as Kibana would do - * on startup. - * - * @return Promise + * Delete any Kibana indices, and initialize the Kibana index as Kibana would do + * on startup. */ async emptyKibanaIndex() { return await emptyKibanaIndexAction({ @@ -162,4 +154,33 @@ export class EsArchiver { kbnClient: this.kbnClient, }); } + + /** + * Resolve a path relative to the baseDir + * + * @param relativePath + */ + private findArchive(relativePath: string) { + const path = Path.resolve(this.baseDir, relativePath); + let stats; + try { + stats = Fs.statSync(path); + } catch (error) { + if (error.code === 'ENOENT') { + throw new Error( + `Attempt to reference an esArchive with relative path [${relativePath}] could not be resolved. This path was resolved relative to [${this.baseDir}].` + ); + } + + throw error; + } + + if (stats.isDirectory()) { + return path; + } + + throw new Error( + `Attempt to reference an esArchive with relative path [${relativePath}] resolved to a file instead of a directory containing data/mapping files. This path was resolved relative to [${this.baseDir}].` + ); + } } diff --git a/packages/kbn-es-archiver/src/lib/indices/create_index_stream.ts b/packages/kbn-es-archiver/src/lib/indices/create_index_stream.ts index b45a8b18a5776a..fba3df24e896f8 100644 --- a/packages/kbn-es-archiver/src/lib/indices/create_index_stream.ts +++ b/packages/kbn-es-archiver/src/lib/indices/create_index_stream.ts @@ -19,7 +19,7 @@ import { deleteIndex } from './delete_index'; import { ES_CLIENT_HEADERS } from '../../client_headers'; interface DocRecord { - value: estypes.IndexState & { + value: estypes.IndicesIndexState & { index: string; type: string; }; diff --git a/packages/kbn-es-archiver/src/lib/indices/delete_index.ts b/packages/kbn-es-archiver/src/lib/indices/delete_index.ts index 2a42d52e2ca80b..d3d6f85d7a360b 100644 --- a/packages/kbn-es-archiver/src/lib/indices/delete_index.ts +++ b/packages/kbn-es-archiver/src/lib/indices/delete_index.ts @@ -126,7 +126,7 @@ export async function waitForSnapshotCompletion( const { body: repositoryMap } = await client.snapshot.getRepository({} as any); for (const repository of Object.keys(repositoryMap)) { const allInProgress = await getInProgressSnapshots(repository); - const found = allInProgress.find((s: any) => s.indices.includes(index)); + const found = allInProgress?.find((s: any) => s.indices.includes(index)); if (!found) { continue; diff --git a/packages/kbn-es-archiver/src/lib/indices/kibana_index.ts b/packages/kbn-es-archiver/src/lib/indices/kibana_index.ts index 51d4f28d20f2e0..0712d2789a91ae 100644 --- a/packages/kbn-es-archiver/src/lib/indices/kibana_index.ts +++ b/packages/kbn-es-archiver/src/lib/indices/kibana_index.ts @@ -35,7 +35,7 @@ export async function deleteKibanaIndices({ await client.indices.putSettings( { index: indexNames, - body: { index: { blocks: { read_only: false } } }, + body: { settings: { blocks: { read_only: false } } }, }, { headers: ES_CLIENT_HEADERS, diff --git a/packages/kbn-legacy-logging/BUILD.bazel b/packages/kbn-legacy-logging/BUILD.bazel index 21cb8c338f89f9..1fd04604dbd244 100644 --- a/packages/kbn-legacy-logging/BUILD.bazel +++ b/packages/kbn-legacy-logging/BUILD.bazel @@ -25,6 +25,7 @@ NPM_MODULE_EXTRA_FILES = [ SRC_DEPS = [ "//packages/kbn-config-schema", + "//packages/kbn-utils", "@npm//@elastic/numeral", "@npm//@hapi/hapi", "@npm//chokidar", diff --git a/packages/kbn-monaco/src/monaco_imports.ts b/packages/kbn-monaco/src/monaco_imports.ts index 872ac46352cf31..92ea23347c374c 100644 --- a/packages/kbn-monaco/src/monaco_imports.ts +++ b/packages/kbn-monaco/src/monaco_imports.ts @@ -21,5 +21,6 @@ import 'monaco-editor/esm/vs/editor/contrib/folding/folding.js'; // Needed for f import 'monaco-editor/esm/vs/editor/contrib/suggest/suggestController.js'; // Needed for suggestions import 'monaco-editor/esm/vs/editor/contrib/hover/hover.js'; // Needed for hover import 'monaco-editor/esm/vs/editor/contrib/parameterHints/parameterHints.js'; // Needed for signature +import 'monaco-editor/esm/vs/editor/contrib/bracketMatching/bracketMatching.js'; // Needed for brackets matching highlight export { monaco }; diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index 3427eee4b5c0ba..9b4199c8128644 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -34,7 +34,7 @@ pageLoadAssetSize: indexManagement: 140608 indexPatternManagement: 28222 infra: 184320 - fleet: 415829 + fleet: 450005 ingestPipelines: 58003 inputControlVis: 172675 inspector: 148711 @@ -87,7 +87,6 @@ pageLoadAssetSize: visDefaultEditor: 50178 visTypeMarkdown: 30896 visTypeMetric: 42790 - visTypePie: 34051 visTypeTable: 94934 visTypeTagcloud: 37575 visTypeTimelion: 68883 @@ -105,9 +104,10 @@ pageLoadAssetSize: indexPatternFieldEditor: 90489 osquery: 107090 fileUpload: 25664 - fileDataVisualizer: 27530 + dataVisualizer: 27530 banners: 17946 mapsEms: 26072 timelines: 28613 cases: 162385 screenshotMode: 17856 + visTypePie: 35583 diff --git a/packages/kbn-pm/dist/index.js b/packages/kbn-pm/dist/index.js index 4c4c0259f066b8..e455f487d13843 100644 --- a/packages/kbn-pm/dist/index.js +++ b/packages/kbn-pm/dist/index.js @@ -650,6 +650,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArray", function() { return __spreadArray; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; }); @@ -683,6 +684,8 @@ var extendStatics = function(d, b) { }; function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); @@ -805,19 +808,27 @@ function __read(o, n) { return ar; } +/** @deprecated */ function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } +/** @deprecated */ function __spreadArrays() { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; -}; +} + +function __spreadArray(to, from) { + for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) + to[j] = from[i]; + return to; +} function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); @@ -872,19 +883,17 @@ function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } -function __classPrivateFieldGet(receiver, privateMap) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to get private field on non-instance"); - } - return privateMap.get(receiver); +function __classPrivateFieldGet(receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); } -function __classPrivateFieldSet(receiver, privateMap, value) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to set private field on non-instance"); - } - privateMap.set(receiver, value); - return value; +function __classPrivateFieldSet(receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; } @@ -48471,7 +48480,7 @@ async function runBazelCommandWithRunner(bazelCommandRunner, bazelArgs, offline }); if (offline) { - bazelArgs.push('--config=offline'); + bazelArgs = [...bazelArgs, '--config=offline']; } const bazelProc = Object(_child_process__WEBPACK_IMPORTED_MODULE_4__["spawn"])(bazelCommandRunner, bazelArgs, bazelOpts); diff --git a/packages/kbn-pm/src/utils/bazel/run.ts b/packages/kbn-pm/src/utils/bazel/run.ts index 7b20ea43982e6a..c030081e53daaf 100644 --- a/packages/kbn-pm/src/utils/bazel/run.ts +++ b/packages/kbn-pm/src/utils/bazel/run.ts @@ -30,7 +30,7 @@ async function runBazelCommandWithRunner( }; if (offline) { - bazelArgs.push('--config=offline'); + bazelArgs = [...bazelArgs, '--config=offline']; } const bazelProc = spawn(bazelCommandRunner, bazelArgs, bazelOpts); diff --git a/packages/kbn-server-route-repository/BUILD.bazel b/packages/kbn-server-route-repository/BUILD.bazel new file mode 100644 index 00000000000000..3a146086e80bc3 --- /dev/null +++ b/packages/kbn-server-route-repository/BUILD.bazel @@ -0,0 +1,89 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm") + +PKG_BASE_NAME = "kbn-server-route-repository" +PKG_REQUIRE_NAME = "@kbn/server-route-repository" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + ], + exclude = [ + "**/*.test.*", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", + "README.md" +] + +SRC_DEPS = [ + "//packages/kbn-config-schema", + "//packages/kbn-io-ts-utils", + "@npm//@hapi/boom", + "@npm//fp-ts", + "@npm//io-ts", + "@npm//lodash", + "@npm//utility-types" +] + +TYPES_DEPS = [ + "@npm//@types/jest", + "@npm//@types/lodash", + "@npm//@types/node", +] + +DEPS = SRC_DEPS + TYPES_DEPS + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + ], +) + +ts_project( + name = "tsc", + args = ['--pretty'], + srcs = SRCS, + deps = DEPS, + declaration = True, + declaration_map = True, + incremental = True, + out_dir = "target", + source_map = True, + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_BASE_NAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = DEPS + [":tsc"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [ + ":%s" % PKG_BASE_NAME, + ] +) + +filegroup( + name = "build", + srcs = [ + ":npm_module", + ], + visibility = ["//visibility:public"], +) diff --git a/packages/kbn-server-route-repository/package.json b/packages/kbn-server-route-repository/package.json index 4ae625d83a7003..cfeab275e19cf6 100644 --- a/packages/kbn-server-route-repository/package.json +++ b/packages/kbn-server-route-repository/package.json @@ -4,10 +4,5 @@ "types": "./target/index.d.ts", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true, - "scripts": { - "build": "../../node_modules/.bin/tsc", - "kbn:bootstrap": "yarn build", - "kbn:watch": "yarn build --watch" - } + "private": true } diff --git a/packages/kbn-server-route-repository/tsconfig.json b/packages/kbn-server-route-repository/tsconfig.json index 8f1e72172c6759..7614a9411602ef 100644 --- a/packages/kbn-server-route-repository/tsconfig.json +++ b/packages/kbn-server-route-repository/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "incremental": false, + "incremental": true, "outDir": "./target", "stripInternal": false, "declaration": true, 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 e5d0fdc122a1ac..6a8f384208fd84 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 @@ -209,13 +209,6 @@ export const schema = Joi.object() // definition of apps that work with `common.navigateToApp()` apps: Joi.object().pattern(ID_PATTERN, appUrlPartsSchema()).default(), - // settings for the esArchiver module - esArchiver: Joi.object() - .keys({ - directory: Joi.string().default(defaultRelativeToConfigPath('fixtures/es_archiver')), - }) - .default(), - // settings for the saved objects svc kbnArchiver: Joi.object() .keys({ diff --git a/packages/kbn-test/src/functional_test_runner/public_types.ts b/packages/kbn-test/src/functional_test_runner/public_types.ts index 4a30744c09b516..d94f61e23b8b80 100644 --- a/packages/kbn-test/src/functional_test_runner/public_types.ts +++ b/packages/kbn-test/src/functional_test_runner/public_types.ts @@ -74,6 +74,12 @@ export interface GenericFtrProviderContext< getService(serviceName: 'failureMetadata'): FailureMetadata; getService(serviceName: T): ServiceMap[T]; + /** + * Get the instance of a page object + * @param pageObjectName + */ + getPageObject(pageObjectName: K): PageObjectMap[K]; + /** * Get a map of PageObjects * @param pageObjects diff --git a/packages/kbn-test/src/jest/utils/testbed/types.ts b/packages/kbn-test/src/jest/utils/testbed/types.ts index 520a78d03d7013..fdc000215c4f19 100644 --- a/packages/kbn-test/src/jest/utils/testbed/types.ts +++ b/packages/kbn-test/src/jest/utils/testbed/types.ts @@ -121,7 +121,7 @@ export interface TestBed { * * @param switchTestSubject The test subject of the EuiSwitch (can be a nested path. e.g. "myForm.mySwitch"). */ - toggleEuiSwitch: (switchTestSubject: T, isChecked?: boolean) => void; + toggleEuiSwitch: (switchTestSubject: T) => void; /** * The EUI ComboBox is a special input as it needs the ENTER key to be pressed * in order to register the value set. This helpers automatically does that. diff --git a/packages/kbn-test/src/kbn_archiver_cli.ts b/packages/kbn-test/src/kbn_archiver_cli.ts index 04581a83546686..6eb1d4bf68dadc 100644 --- a/packages/kbn-test/src/kbn_archiver_cli.ts +++ b/packages/kbn-test/src/kbn_archiver_cli.ts @@ -43,13 +43,11 @@ export function runKbnArchiverCli() { new RunWithCommands({ description: 'Import/export saved objects from archives, for testing', globalFlags: { - string: ['config', 'space', 'kibana-url', 'dir'], + string: ['config', 'space', 'kibana-url'], help: ` --space space id to operate on, defaults to the default space --config optional path to an FTR config file that will be parsed and used for defaults --kibana-url set the url that kibana can be reached at, uses the "servers.kibana" setting from --config by default - --dir directory that contains exports to be imported, or where exports will be saved, uses the "kbnArchiver.directory" - setting from --config by default `, }, async extendContext({ log, flags }) { @@ -79,23 +77,6 @@ export function runKbnArchiverCli() { ); } - let importExportDir; - if (flags.dir) { - if (typeof flags.dir !== 'string') { - throw createFlagError('expected --dir to be a string'); - } - - importExportDir = flags.dir; - } else if (config) { - importExportDir = config.get('kbnArchiver.directory'); - } - - if (!importExportDir) { - throw createFlagError( - '--config does not include a kbnArchiver.directory, specify it or include --dir flag' - ); - } - const space = flags.space; if (!(space === undefined || typeof space === 'string')) { throw createFlagError('--space must be a string'); @@ -106,7 +87,7 @@ export function runKbnArchiverCli() { kbnClient: new KbnClient({ log, url: kibanaUrl, - importExportDir, + importExportBaseDir: process.cwd(), }), }; }, diff --git a/packages/kbn-test/src/kbn_client/kbn_client.ts b/packages/kbn-test/src/kbn_client/kbn_client.ts index ac14a399918cb9..e44f5005933002 100644 --- a/packages/kbn-test/src/kbn_client/kbn_client.ts +++ b/packages/kbn-test/src/kbn_client/kbn_client.ts @@ -22,7 +22,7 @@ export interface KbnClientOptions { certificateAuthorities?: Buffer[]; log: ToolingLog; uiSettingDefaults?: UiSettingValues; - importExportDir?: string; + importExportBaseDir?: string; } export class KbnClient { @@ -67,7 +67,7 @@ export class KbnClient { this.log, this.requester, this.savedObjects, - options.importExportDir + options.importExportBaseDir ); } diff --git a/packages/kbn-test/src/kbn_client/kbn_client_import_export.ts b/packages/kbn-test/src/kbn_client/kbn_client_import_export.ts index fe67fbb70fa3ca..5fd30929fecf68 100644 --- a/packages/kbn-test/src/kbn_client/kbn_client_import_export.ts +++ b/packages/kbn-test/src/kbn_client/kbn_client_import_export.ts @@ -8,10 +8,11 @@ import { inspect } from 'util'; import Fs from 'fs/promises'; +import { existsSync } from 'fs'; import Path from 'path'; import FormData from 'form-data'; -import { ToolingLog, isAxiosResponseError, createFailError } from '@kbn/dev-utils'; +import { ToolingLog, isAxiosResponseError, createFailError, REPO_ROOT } from '@kbn/dev-utils'; import { KbnClientRequester, uriencode, ReqOptions } from './kbn_client_requester'; import { KbnClientSavedObjects } from './kbn_client_saved_objects'; @@ -39,7 +40,7 @@ export class KbnClientImportExport { public readonly log: ToolingLog, public readonly requester: KbnClientRequester, public readonly savedObjects: KbnClientSavedObjects, - public readonly dir?: string + public readonly baseDir: string = REPO_ROOT ) {} private resolvePath(path: string) { @@ -47,18 +48,19 @@ export class KbnClientImportExport { path = `${path}.json`; } - if (!this.dir && !Path.isAbsolute(path)) { + const absolutePath = Path.resolve(this.baseDir, path); + if (!existsSync(absolutePath)) { throw new Error( - 'unable to resolve relative path to import/export without a configured dir, either path absolute path or specify --dir' + `unable to resolve path [${path}] to import/export, resolved relative to [${this.baseDir}]` ); } - return this.dir ? Path.resolve(this.dir, path) : path; + return absolutePath; } - async load(name: string, options?: { space?: string }) { - const src = this.resolvePath(name); - this.log.debug('resolved import for', name, 'to', src); + async load(path: string, options?: { space?: string }) { + const src = this.resolvePath(path); + this.log.debug('resolved import for', path, 'to', src); const objects = await parseArchive(src); this.log.info('importing', objects.length, 'saved objects', { space: options?.space }); @@ -91,8 +93,8 @@ export class KbnClientImportExport { } } - async unload(name: string, options?: { space?: string }) { - const src = this.resolvePath(name); + async unload(path: string, options?: { space?: string }) { + const src = this.resolvePath(path); this.log.debug('unloading docs from archive at', src); const objects = await parseArchive(src); @@ -110,8 +112,8 @@ export class KbnClientImportExport { this.log.success(deleted, 'saved objects deleted'); } - async save(name: string, options: { types: string[]; space?: string }) { - const dest = this.resolvePath(name); + async save(path: string, options: { types: string[]; space?: string }) { + const dest = this.resolvePath(path); this.log.debug('saving export to', dest); const resp = await this.req(options.space, { diff --git a/packages/kbn-tinymath/grammar/grammar.peggy b/packages/kbn-tinymath/grammar/grammar.peggy index cbcb0b91bfea90..1c6f8c3334c234 100644 --- a/packages/kbn-tinymath/grammar/grammar.peggy +++ b/packages/kbn-tinymath/grammar/grammar.peggy @@ -1,16 +1,16 @@ // tinymath parsing grammar { - function simpleLocation (location) { - // Returns an object representing the position of the function within the expression, - // demarcated by the position of its first character and last character. We calculate these values - // using the offset because the expression could span multiple lines, and we don't want to deal - // with column and line values. - return { - min: location.start.offset, - max: location.end.offset + function simpleLocation (location) { + // Returns an object representing the position of the function within the expression, + // demarcated by the position of its first character and last character. We calculate these values + // using the offset because the expression could span multiple lines, and we don't want to deal + // with column and line values. + return { + min: location.start.offset, + max: location.end.offset + } } - } } start @@ -74,26 +74,34 @@ Expression = AddSubtract AddSubtract - = _ left:MultiplyDivide rest:(('+' / '-') MultiplyDivide)* _ { - return rest.reduce((acc, curr) => ({ + = _ left:MultiplyDivide rest:(('+' / '-') MultiplyDivide)+ _ { + const topLevel = rest.reduce((acc, curr) => ({ type: 'function', name: curr[0] === '+' ? 'add' : 'subtract', args: [acc, curr[1]], - location: simpleLocation(location()), - text: text() - }), left) + }), left); + if (typeof topLevel === 'object') { + topLevel.location = simpleLocation(location()); + topLevel.text = text(); + } + return topLevel; } + / MultiplyDivide MultiplyDivide = _ left:Factor rest:(('*' / '/') Factor)* _ { - return rest.reduce((acc, curr) => ({ + const topLevel = rest.reduce((acc, curr) => ({ type: 'function', name: curr[0] === '*' ? 'multiply' : 'divide', args: [acc, curr[1]], - location: simpleLocation(location()), - text: text() - }), left) + }), left); + if (typeof topLevel === 'object') { + topLevel.location = simpleLocation(location()); + topLevel.text = text(); + } + return topLevel; } + / Factor Factor = Group diff --git a/packages/kbn-tinymath/index.d.ts b/packages/kbn-tinymath/index.d.ts index c3c32a59fa15ad..8e15d86c88fc84 100644 --- a/packages/kbn-tinymath/index.d.ts +++ b/packages/kbn-tinymath/index.d.ts @@ -24,9 +24,11 @@ export interface TinymathLocation { export interface TinymathFunction { type: 'function'; name: string; - text: string; args: TinymathAST[]; - location: TinymathLocation; + // Location is not guaranteed because PEG grammars are not left-recursive + location?: TinymathLocation; + // Text is not guaranteed because PEG grammars are not left-recursive + text?: string; } export interface TinymathVariable { diff --git a/packages/kbn-tinymath/test/library.test.js b/packages/kbn-tinymath/test/library.test.js index bf1c7a9dbc5fb5..bbc8503684fd40 100644 --- a/packages/kbn-tinymath/test/library.test.js +++ b/packages/kbn-tinymath/test/library.test.js @@ -41,6 +41,35 @@ describe('Parser', () => { }); }); + describe('Math', () => { + it('converts basic symbols into left-to-right pairs', () => { + expect(parse('a + b + c - d')).toEqual({ + args: [ + { + name: 'add', + type: 'function', + args: [ + { + name: 'add', + type: 'function', + args: [ + expect.objectContaining({ location: { min: 0, max: 2 } }), + expect.objectContaining({ location: { min: 3, max: 6 } }), + ], + }, + expect.objectContaining({ location: { min: 7, max: 10 } }), + ], + }, + expect.objectContaining({ location: { min: 11, max: 13 } }), + ], + name: 'subtract', + type: 'function', + text: 'a + b + c - d', + location: { min: 0, max: 13 }, + }); + }); + }); + describe('Variables', () => { it('strings', () => { expect(parse('f')).toEqual(variableEqual('f')); @@ -263,6 +292,8 @@ describe('Evaluate', () => { expect(evaluate('5/20')).toEqual(0.25); expect(evaluate('1 + 1 + 2 + 3 + 12')).toEqual(19); expect(evaluate('100 / 10 / 10')).toEqual(1); + expect(evaluate('0 * 1 - 100 / 10 / 10')).toEqual(-1); + expect(evaluate('100 / (10 / 10)')).toEqual(100); }); it('equations with functions', () => { diff --git a/src/cli_plugin/install/index.js b/src/cli_plugin/install/index.js index 2683dd41d2bb32..dbad6bc8ba19c9 100644 --- a/src/cli_plugin/install/index.js +++ b/src/cli_plugin/install/index.js @@ -24,7 +24,7 @@ function processCommand(command, options) { const logger = new Logger(settings); - logWarnings(settings, logger); + logWarnings(logger); install(settings, logger); } diff --git a/src/cli_plugin/remove/index.js b/src/cli_plugin/remove/index.js index 329f506520c245..3f571e605028f3 100644 --- a/src/cli_plugin/remove/index.js +++ b/src/cli_plugin/remove/index.js @@ -24,7 +24,7 @@ function processCommand(command, options) { const logger = new Logger(settings); - logWarnings(settings, logger); + logWarnings(logger); remove(settings, logger); } diff --git a/src/core/TESTING.md b/src/core/TESTING.md index ef6db57c1a9930..10ead1ea8cfe22 100644 --- a/src/core/TESTING.md +++ b/src/core/TESTING.md @@ -792,8 +792,8 @@ To do that we'll write a Jest integration test using `TestUtils` to start Kibana and esArchiver to load fixture data into Elasticsearch. 1. Create the fixtures data you need in Elasticsearch -2. Create a fixtures archive with `node scripts/es_archiver save [index patterns...]` -3. Load the fixtures in your test using esArchiver `esArchiver.load('name')`; +2. Create a fixtures archive with `node scripts/es_archiver save [index patterns...]` +3. Load the fixtures in your test using esArchiver `esArchiver.load('path from root of repo')`; _todo: fully worked out example_ diff --git a/src/core/public/application/application_service.test.ts b/src/core/public/application/application_service.test.ts index 2e2f1cad49f199..5658d3f6260772 100644 --- a/src/core/public/application/application_service.test.ts +++ b/src/core/public/application/application_service.test.ts @@ -107,6 +107,7 @@ describe('#setup()', () => { status: AppStatus.inaccessible, tooltip: 'App inaccessible due to reason', defaultPath: 'foo/bar', + deepLinks: [{ id: 'subapp2', title: 'Subapp 2', path: '/subapp2' }], })); applications = await applications$.pipe(take(1)).toPromise(); @@ -118,6 +119,9 @@ describe('#setup()', () => { status: AppStatus.inaccessible, defaultPath: 'foo/bar', tooltip: 'App inaccessible due to reason', + deepLinks: [ + expect.objectContaining({ id: 'subapp2', title: 'Subapp 2', path: '/subapp2' }), + ], }) ); expect(applications.get('app2')).toEqual( @@ -814,6 +818,128 @@ describe('#start()', () => { expect(MockHistory.replace).not.toHaveBeenCalled(); }); }); + + describe('deepLinkId option', () => { + beforeEach(() => { + MockHistory.push.mockClear(); + }); + + it('preserves trailing slash when path contains a hash', async () => { + const { register } = service.setup(setupDeps); + + register( + Symbol(), + createApp({ + id: 'app1', + appRoute: '/custom/app-path', + deepLinks: [{ id: 'dl1', title: 'deep link 1', path: '/deep-link' }], + }) + ); + + const { navigateToApp } = await service.start(startDeps); + await navigateToApp('app1', { deepLinkId: 'dl1', path: '#/' }); + expect(MockHistory.push).toHaveBeenLastCalledWith( + '/custom/app-path/deep-link#/', + undefined + ); + + await navigateToApp('app1', { deepLinkId: 'dl1', path: '#/foo/bar/' }); + expect(MockHistory.push).toHaveBeenLastCalledWith( + '/custom/app-path/deep-link#/foo/bar/', + undefined + ); + + await navigateToApp('app1', { deepLinkId: 'dl1', path: '/path#/' }); + expect(MockHistory.push).toHaveBeenLastCalledWith( + '/custom/app-path/deep-link/path#/', + undefined + ); + + await navigateToApp('app1', { deepLinkId: 'dl1', path: '/path#/hash/' }); + expect(MockHistory.push).toHaveBeenLastCalledWith( + '/custom/app-path/deep-link/path#/hash/', + undefined + ); + + await navigateToApp('app1', { deepLinkId: 'dl1', path: '/path/' }); + expect(MockHistory.push).toHaveBeenLastCalledWith( + '/custom/app-path/deep-link/path', + undefined + ); + }); + + it('omits the defaultPath when the deepLinkId parameter is specified', async () => { + const { register } = service.setup(setupDeps); + + register( + Symbol(), + createApp({ + id: 'app1', + defaultPath: 'default/path', + deepLinks: [{ id: 'dl1', title: 'deep link 1', path: '/deep-link' }], + }) + ); + register( + Symbol(), + createApp({ + id: 'app2', + appRoute: '/custom-app-path', + defaultPath: '/my-default', + deepLinks: [{ id: 'dl2', title: 'deep link 2', path: '/deep-link-2' }], + }) + ); + + const { navigateToApp } = await service.start(startDeps); + + await navigateToApp('app1', {}); + expect(MockHistory.push).toHaveBeenLastCalledWith('/app/app1/default/path', undefined); + + await navigateToApp('app1', { deepLinkId: 'dl1' }); + expect(MockHistory.push).toHaveBeenLastCalledWith('/app/app1/deep-link', undefined); + + await navigateToApp('app1', { deepLinkId: 'dl1', path: 'some-other-path' }); + expect(MockHistory.push).toHaveBeenLastCalledWith( + '/app/app1/deep-link/some-other-path', + undefined + ); + + await navigateToApp('app2', {}); + expect(MockHistory.push).toHaveBeenLastCalledWith('/custom-app-path/my-default', undefined); + + await navigateToApp('app2', { deepLinkId: 'dl2' }); + expect(MockHistory.push).toHaveBeenLastCalledWith( + '/custom-app-path/deep-link-2', + undefined + ); + + await navigateToApp('app2', { deepLinkId: 'dl2', path: 'some-other-path' }); + expect(MockHistory.push).toHaveBeenLastCalledWith( + '/custom-app-path/deep-link-2/some-other-path', + undefined + ); + }); + + it('ignores the deepLinkId parameter if it is unknown', async () => { + const { register } = service.setup(setupDeps); + + register( + Symbol(), + createApp({ + id: 'app1', + defaultPath: 'default/path', + deepLinks: [{ id: 'dl1', title: 'deep link 1', path: '/deep-link' }], + }) + ); + + const { navigateToApp } = await service.start(startDeps); + + await navigateToApp('app1', { deepLinkId: 'dl-unknown' }); + expect(MockHistory.push).toHaveBeenLastCalledWith('/app/app1/default/path', undefined); + + await navigateToApp('app1', { deepLinkId: 'dl-unknown', path: 'some-other-path' }); + expect(MockHistory.push).toHaveBeenLastCalledWith('/app/app1/some-other-path', undefined); + }); + }); }); describe('navigateToUrl', () => { diff --git a/src/core/public/application/application_service.tsx b/src/core/public/application/application_service.tsx index bbfea61220b513..32d45b32c32ffd 100644 --- a/src/core/public/application/application_service.tsx +++ b/src/core/public/application/application_service.tsx @@ -64,6 +64,10 @@ const getAppUrl = (mounters: Map, appId: string, path: string = return appendAppPath(appBasePath, path); }; +const getAppDeepLinkPath = (mounters: Map, appId: string, deepLinkId: string) => { + return mounters.get(appId)?.deepLinkPaths[deepLinkId]; +}; + const allApplicationsFilter = '__ALL__'; interface AppUpdaterWrapper { @@ -175,6 +179,7 @@ export class ApplicationService { this.mounters.set(app.id, { appRoute: app.appRoute!, appBasePath: basePath.prepend(app.appRoute!), + deepLinkPaths: toDeepLinkPaths(app.deepLinks), exactRoute: app.exactRoute ?? false, mount: wrapMount(plugin, app), unmountBeforeMounting: false, @@ -226,7 +231,7 @@ export class ApplicationService { const navigateToApp: InternalApplicationStart['navigateToApp'] = async ( appId, - { path, state, replace = false, openInNewTab = false }: NavigateToAppOptions = {} + { deepLinkId, path, state, replace = false, openInNewTab = false }: NavigateToAppOptions = {} ) => { const currentAppId = this.currentAppId$.value; const navigatingToSameApp = currentAppId === appId; @@ -235,6 +240,12 @@ export class ApplicationService { : await this.shouldNavigate(overlays, appId); if (shouldNavigate) { + if (deepLinkId) { + const deepLinkPath = getAppDeepLinkPath(availableMounters, appId, deepLinkId); + if (deepLinkPath) { + path = appendAppPath(deepLinkPath, path); + } + } if (path === undefined) { path = applications$.value.get(appId)?.defaultPath; } @@ -384,8 +395,18 @@ const updateStatus = (app: App, statusUpdaters: AppUpdaterWrapper[]): App => { ...fields, // status and navLinkStatus enums are ordered by reversed priority // if multiple updaters wants to change these fields, we will always follow the priority order. - status: Math.max(changes.status ?? 0, fields.status ?? 0), - navLinkStatus: Math.max(changes.navLinkStatus ?? 0, fields.navLinkStatus ?? 0), + status: Math.max( + changes.status ?? AppStatus.accessible, + fields.status ?? AppStatus.accessible + ), + navLinkStatus: Math.max( + changes.navLinkStatus ?? AppNavLinkStatus.default, + fields.navLinkStatus ?? AppNavLinkStatus.default + ), + // deepLinks take the last defined update + deepLinks: fields.deepLinks + ? populateDeepLinkDefaults(fields.deepLinks) + : changes.deepLinks, }; } }); @@ -396,10 +417,22 @@ const updateStatus = (app: App, statusUpdaters: AppUpdaterWrapper[]): App => { }; const populateDeepLinkDefaults = (deepLinks?: AppDeepLink[]): AppDeepLink[] => { - if (!deepLinks) return []; + if (!deepLinks) { + return []; + } return deepLinks.map((deepLink) => ({ ...deepLink, navLinkStatus: deepLink.navLinkStatus ?? AppNavLinkStatus.default, deepLinks: populateDeepLinkDefaults(deepLink.deepLinks), })); }; + +const toDeepLinkPaths = (deepLinks?: AppDeepLink[]): Mounter['deepLinkPaths'] => { + if (!deepLinks) { + return {}; + } + return deepLinks.reduce((deepLinkPaths: Mounter['deepLinkPaths'], deepLink) => { + if (deepLink.path) deepLinkPaths[deepLink.id] = deepLink.path; + return { ...deepLinkPaths, ...toDeepLinkPaths(deepLink.deepLinks) }; + }, {}); +}; diff --git a/src/core/public/application/index.ts b/src/core/public/application/index.ts index 68e1991646afbd..882555fcd60e09 100644 --- a/src/core/public/application/index.ts +++ b/src/core/public/application/index.ts @@ -17,6 +17,7 @@ export type { AppUnmount, AppMountParameters, AppUpdatableFields, + AppNavOptions, AppUpdater, AppDeepLink, ApplicationSetup, diff --git a/src/core/public/application/integration_tests/router.test.tsx b/src/core/public/application/integration_tests/router.test.tsx index 55c18e49cba131..2543d22ee6d31b 100644 --- a/src/core/public/application/integration_tests/router.test.tsx +++ b/src/core/public/application/integration_tests/router.test.tsx @@ -96,7 +96,7 @@ describe('AppRouter', () => { expect(app1.mounter.mount).toHaveBeenCalled(); expect(dom?.html()).toMatchInlineSnapshot(` - "
+ "
basename: /app/app1 html: App 1
" @@ -108,7 +108,7 @@ describe('AppRouter', () => { expect(app1Unmount).toHaveBeenCalled(); expect(app2.mounter.mount).toHaveBeenCalled(); expect(dom?.html()).toMatchInlineSnapshot(` - "
+ "
basename: /app/app2 html:
App 2
" @@ -122,7 +122,7 @@ describe('AppRouter', () => { expect(standardApp.mounter.mount).toHaveBeenCalled(); expect(dom?.html()).toMatchInlineSnapshot(` - "
+ "
basename: /app/app1 html: App 1
" @@ -134,7 +134,7 @@ describe('AppRouter', () => { expect(standardAppUnmount).toHaveBeenCalled(); expect(chromelessApp.mounter.mount).toHaveBeenCalled(); expect(dom?.html()).toMatchInlineSnapshot(` - "
+ "
basename: /chromeless-a/path html:
Chromeless A
" @@ -146,7 +146,7 @@ describe('AppRouter', () => { expect(chromelessAppUnmount).toHaveBeenCalled(); expect(standardApp.mounter.mount).toHaveBeenCalledTimes(2); expect(dom?.html()).toMatchInlineSnapshot(` - "
+ "
basename: /app/app1 html: App 1
" @@ -160,7 +160,7 @@ describe('AppRouter', () => { expect(chromelessAppA.mounter.mount).toHaveBeenCalled(); expect(dom?.html()).toMatchInlineSnapshot(` - "
+ "
basename: /chromeless-a/path html:
Chromeless A
" @@ -172,7 +172,7 @@ describe('AppRouter', () => { expect(chromelessAppAUnmount).toHaveBeenCalled(); expect(chromelessAppB.mounter.mount).toHaveBeenCalled(); expect(dom?.html()).toMatchInlineSnapshot(` - "
+ "
basename: /chromeless-b/path html:
Chromeless B
" @@ -184,7 +184,7 @@ describe('AppRouter', () => { expect(chromelessAppBUnmount).toHaveBeenCalled(); expect(chromelessAppA.mounter.mount).toHaveBeenCalledTimes(2); expect(dom?.html()).toMatchInlineSnapshot(` - "
+ "
basename: /chromeless-a/path html:
Chromeless A
" diff --git a/src/core/public/application/integration_tests/utils.tsx b/src/core/public/application/integration_tests/utils.tsx index 40f8f3b7957192..dcf071719c11ad 100644 --- a/src/core/public/application/integration_tests/utils.tsx +++ b/src/core/public/application/integration_tests/utils.tsx @@ -35,12 +35,14 @@ export const createAppMounter = ({ appId, html = `
App ${appId}
`, appRoute = `/app/${appId}`, + deepLinkPaths = {}, exactRoute = false, extraMountHook, }: { appId: string; html?: string; appRoute?: string; + deepLinkPaths?: Record; exactRoute?: boolean; extraMountHook?: (params: AppMountParameters) => void; }): MockedMounterTuple => { @@ -51,6 +53,7 @@ export const createAppMounter = ({ mounter: { appRoute, appBasePath: appRoute, + deepLinkPaths, exactRoute, mount: jest.fn(async (params: AppMountParameters) => { const { appBasePath: basename, element } = params; diff --git a/src/core/public/application/types.ts b/src/core/public/application/types.ts index ffc41955360bdf..60b0dbf158dd91 100644 --- a/src/core/public/application/types.ts +++ b/src/core/public/application/types.ts @@ -63,9 +63,37 @@ export enum AppNavLinkStatus { */ export type AppUpdatableFields = Pick< App, - 'status' | 'navLinkStatus' | 'tooltip' | 'defaultPath' | 'deepLinks' + 'status' | 'navLinkStatus' | 'searchable' | 'tooltip' | 'defaultPath' | 'deepLinks' >; +/** + * App navigation menu options + * @public + */ +export interface AppNavOptions { + /** + * An ordinal used to sort nav links relative to one another for display. + */ + order?: number; + + /** + * A tooltip shown when hovering over app link. + */ + tooltip?: string; + + /** + * A EUI iconType that will be used for the app's icon. This icon + * takes precendence over the `icon` property. + */ + euiIconType?: string; + + /** + * A URL to an image file used as an icon. Used as a fallback + * if `euiIconType` is not provided. + */ + icon?: string; +} + /** * Updater for applications. * see {@link ApplicationSetup} @@ -76,7 +104,7 @@ export type AppUpdater = (app: App) => Partial | undefined; /** * @public */ -export interface App { +export interface App extends AppNavOptions { /** * The unique identifier of the application */ @@ -107,6 +135,12 @@ export interface App { */ navLinkStatus?: AppNavLinkStatus; + /** + * The initial flag to determine if the application is searchable in the global search. + * Defaulting to `true` if `navLinkStatus` is `visible` or omitted. + */ + searchable?: boolean; + /** * Allow to define the default path a user should be directed to when navigating to the app. * When defined, this value will be used as a default for the `path` option when calling {@link ApplicationStart.navigateToApp | navigateToApp}`, @@ -148,28 +182,6 @@ export interface App { */ updater$?: Observable; - /** - * An ordinal used to sort nav links relative to one another for display. - */ - order?: number; - - /** - * A tooltip shown when hovering over app link. - */ - tooltip?: string; - - /** - * A EUI iconType that will be used for the app's icon. This icon - * takes precendence over the `icon` property. - */ - euiIconType?: string; - - /** - * A URL to an image file used as an icon. Used as a fallback - * if `euiIconType` is not provided. - */ - icon?: string; - /** * Custom capabilities defined by the app. */ @@ -261,11 +273,12 @@ export interface App { */ export type PublicAppDeepLinkInfo = Omit< AppDeepLink, - 'deepLinks' | 'keywords' | 'navLinkStatus' + 'deepLinks' | 'keywords' | 'navLinkStatus' | 'searchable' > & { deepLinks: PublicAppDeepLinkInfo[]; keywords: string[]; navLinkStatus: AppNavLinkStatus; + searchable: boolean; }; /** @@ -285,33 +298,40 @@ export type AppDeepLink = { keywords?: string[]; /** Optional status of the chrome navigation, defaults to `hidden` */ navLinkStatus?: AppNavLinkStatus; -} & ( - | { - /** URL path to access this link, relative to the application's appRoute. */ - path: string; - /** Optional array of links that are 'underneath' this section in the hierarchy */ - deepLinks?: AppDeepLink[]; - } - | { - /** Optional path to access this section. Omit if this part of the hierarchy does not have a page URL. */ - path?: string; - /** Array links that are 'underneath' this section in this hierarchy. */ - deepLinks: AppDeepLink[]; - } -); + /** Optional flag to determine if the link is searchable in the global search. Defaulting to `true` if `navLinkStatus` is `visible` or omitted */ + searchable?: boolean; +} & AppNavOptions & + ( + | { + /** URL path to access this link, relative to the application's appRoute. */ + path: string; + /** Optional array of links that are 'underneath' this section in the hierarchy */ + deepLinks?: AppDeepLink[]; + } + | { + /** Optional path to access this section. Omit if this part of the hierarchy does not have a page URL. */ + path?: string; + /** Array links that are 'underneath' this section in this hierarchy. */ + deepLinks: AppDeepLink[]; + } + ); /** * Public information about a registered {@link App | application} * * @public */ -export type PublicAppInfo = Omit & { +export type PublicAppInfo = Omit< + App, + 'mount' | 'updater$' | 'keywords' | 'deepLinks' | 'searchable' +> & { // remove optional on fields populated with default values status: AppStatus; navLinkStatus: AppNavLinkStatus; appRoute: string; keywords: string[]; deepLinks: PublicAppDeepLinkInfo[]; + searchable: boolean; }; /** @@ -592,6 +612,7 @@ export interface AppLeaveActionFactory { export interface Mounter { appRoute: string; appBasePath: string; + deepLinkPaths: Record; mount: AppMount; exactRoute: boolean; unmountBeforeMounting?: boolean; @@ -657,11 +678,17 @@ export interface InternalApplicationSetup extends Pick { appRoute: '/some-route', unmountBeforeMounting: false, exactRoute: false, + deepLinkPaths: {}, mount: async ({ element }: AppMountParameters) => { await promise; const container = document.createElement('div'); @@ -133,6 +134,7 @@ describe('AppContainer', () => { const mounter = { appBasePath: '/base-path/some-route', appRoute: '/some-route', + deepLinkPaths: {}, unmountBeforeMounting: false, exactRoute: false, mount: async ({ element }: AppMountParameters) => { diff --git a/src/core/public/application/ui/app_container.tsx b/src/core/public/application/ui/app_container.tsx index 02d321095b3735..0312c707e10498 100644 --- a/src/core/public/application/ui/app_container.tsx +++ b/src/core/public/application/ui/app_container.tsx @@ -5,6 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ +import './app_container.scss'; import React, { Fragment, @@ -16,11 +17,12 @@ import React, { } from 'react'; import { EuiLoadingElastic } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; import type { MountPoint } from '../../types'; import { AppLeaveHandler, AppStatus, AppUnmount, Mounter } from '../types'; import { AppNotFound } from './app_not_found_screen'; import { ScopedHistory } from '../scoped_history'; -import './app_container.scss'; +import { APP_WRAPPER_CLASS } from '../../../utils'; interface Props { /** Path application is mounted on without the global basePath */ @@ -107,12 +109,16 @@ export const AppContainer: FunctionComponent = ({ return ( {appNotFound && } - {showSpinner && ( -
- -
+ {showSpinner && !appNotFound && ( + )} -
+
); }; diff --git a/src/core/public/application/utils/get_app_info.test.ts b/src/core/public/application/utils/get_app_info.test.ts index ef4a06707d6664..fa1e2dd9a4537d 100644 --- a/src/core/public/application/utils/get_app_info.test.ts +++ b/src/core/public/application/utils/get_app_info.test.ts @@ -7,7 +7,7 @@ */ import { of } from 'rxjs'; -import { App, AppNavLinkStatus, AppStatus } from '../types'; +import { App, AppDeepLink, AppNavLinkStatus, AppStatus } from '../types'; import { getAppInfo } from './get_app_info'; describe('getAppInfo', () => { @@ -18,10 +18,22 @@ describe('getAppInfo', () => { title: 'some-title', status: AppStatus.accessible, navLinkStatus: AppNavLinkStatus.default, + searchable: true, appRoute: `/app/some-id`, ...props, }); + const createDeepLink = (props: Partial = {}): AppDeepLink => ({ + id: 'some-deep-link-id', + title: 'my deep link', + path: '/my-deep-link', + navLinkStatus: AppNavLinkStatus.default, + searchable: true, + deepLinks: [], + keywords: [], + ...props, + }); + it('converts an application and remove sensitive properties', () => { const app = createApp(); const info = getAppInfo(app); @@ -31,6 +43,7 @@ describe('getAppInfo', () => { title: 'some-title', status: AppStatus.accessible, navLinkStatus: AppNavLinkStatus.visible, + searchable: true, appRoute: `/app/some-id`, keywords: [], deepLinks: [], @@ -54,12 +67,15 @@ describe('getAppInfo', () => { title: 'some-title', status: AppStatus.accessible, navLinkStatus: AppNavLinkStatus.visible, + searchable: true, appRoute: `/app/some-id`, keywords: [], deepLinks: [ { id: 'sub-id', title: 'sub-title', + navLinkStatus: AppNavLinkStatus.hidden, + searchable: true, keywords: [], deepLinks: [ { @@ -67,6 +83,8 @@ describe('getAppInfo', () => { title: 'sub-sub-title', path: '/sub-sub', keywords: [], + navLinkStatus: AppNavLinkStatus.hidden, + searchable: true, deepLinks: [], // default empty array added }, ], @@ -102,7 +120,70 @@ describe('getAppInfo', () => { ); }); - it('adds default meta fields to sublinks when needed', () => { + it('computes the searchable flag depending on the navLinkStatus when needed', () => { + expect( + getAppInfo( + createApp({ + navLinkStatus: AppNavLinkStatus.default, + searchable: undefined, + }) + ) + ).toEqual( + expect.objectContaining({ + searchable: true, + }) + ); + expect( + getAppInfo( + createApp({ + navLinkStatus: AppNavLinkStatus.visible, + searchable: undefined, + }) + ) + ).toEqual( + expect.objectContaining({ + searchable: true, + }) + ); + expect( + getAppInfo( + createApp({ + navLinkStatus: AppNavLinkStatus.disabled, + searchable: undefined, + }) + ) + ).toEqual( + expect.objectContaining({ + searchable: false, + }) + ); + expect( + getAppInfo( + createApp({ + navLinkStatus: AppNavLinkStatus.hidden, + searchable: undefined, + }) + ) + ).toEqual( + expect.objectContaining({ + searchable: false, + }) + ); + expect( + getAppInfo( + createApp({ + navLinkStatus: AppNavLinkStatus.hidden, + searchable: true, + }) + ) + ).toEqual( + expect.objectContaining({ + searchable: true, + }) + ); + }); + + it('adds default deepLinks when needed', () => { const app = createApp({ deepLinks: [ { @@ -126,17 +207,22 @@ describe('getAppInfo', () => { title: 'some-title', status: AppStatus.accessible, navLinkStatus: AppNavLinkStatus.visible, + searchable: true, appRoute: `/app/some-id`, keywords: [], deepLinks: [ { id: 'sub-id', title: 'sub-title', - keywords: [], // default empty array + navLinkStatus: AppNavLinkStatus.hidden, + searchable: true, + keywords: [], deepLinks: [ { id: 'sub-sub-id', title: 'sub-sub-title', + navLinkStatus: AppNavLinkStatus.hidden, + searchable: true, path: '/sub-sub', keywords: ['sub sub'], deepLinks: [], @@ -146,4 +232,127 @@ describe('getAppInfo', () => { ], }); }); + + it('computes the deepLinks navLinkStatus when needed', () => { + expect( + getAppInfo( + createApp({ + deepLinks: [ + createDeepLink({ + navLinkStatus: AppNavLinkStatus.visible, + }), + ], + }) + ) + ).toEqual( + expect.objectContaining({ + deepLinks: [ + expect.objectContaining({ + navLinkStatus: AppNavLinkStatus.visible, + }), + ], + }) + ); + expect( + getAppInfo( + createApp({ + deepLinks: [ + createDeepLink({ + navLinkStatus: AppNavLinkStatus.default, + }), + ], + }) + ) + ).toEqual( + expect.objectContaining({ + deepLinks: [ + expect.objectContaining({ + navLinkStatus: AppNavLinkStatus.hidden, + }), + ], + }) + ); + expect( + getAppInfo( + createApp({ + deepLinks: [ + createDeepLink({ + navLinkStatus: undefined, + }), + ], + }) + ) + ).toEqual( + expect.objectContaining({ + deepLinks: [ + expect.objectContaining({ + navLinkStatus: AppNavLinkStatus.hidden, + }), + ], + }) + ); + }); + + it('computes the deepLinks searchable depending on the navLinkStatus when needed', () => { + expect( + getAppInfo( + createApp({ + deepLinks: [ + createDeepLink({ + navLinkStatus: AppNavLinkStatus.default, + searchable: undefined, + }), + ], + }) + ) + ).toEqual( + expect.objectContaining({ + deepLinks: [ + expect.objectContaining({ + searchable: true, + }), + ], + }) + ); + expect( + getAppInfo( + createApp({ + deepLinks: [ + createDeepLink({ + navLinkStatus: AppNavLinkStatus.hidden, + searchable: undefined, + }), + ], + }) + ) + ).toEqual( + expect.objectContaining({ + deepLinks: [ + expect.objectContaining({ + searchable: false, + }), + ], + }) + ); + expect( + getAppInfo( + createApp({ + deepLinks: [ + createDeepLink({ + navLinkStatus: AppNavLinkStatus.hidden, + searchable: true, + }), + ], + }) + ) + ).toEqual( + expect.objectContaining({ + deepLinks: [ + expect.objectContaining({ + searchable: true, + }), + ], + }) + ); + }); }); diff --git a/src/core/public/application/utils/get_app_info.ts b/src/core/public/application/utils/get_app_info.ts index 4c94e24f501bc4..6c753b7a71a0f7 100644 --- a/src/core/public/application/utils/get_app_info.ts +++ b/src/core/public/application/utils/get_app_info.ts @@ -16,17 +16,19 @@ import { } from '../types'; export function getAppInfo(app: App): PublicAppInfo { - const navLinkStatus = - app.navLinkStatus === AppNavLinkStatus.default - ? app.status === AppStatus.inaccessible - ? AppNavLinkStatus.hidden - : AppNavLinkStatus.visible - : app.navLinkStatus!; - const { updater$, mount, ...infos } = app; + const { updater$, mount, navLinkStatus = AppNavLinkStatus.default, ...infos } = app; return { ...infos, status: app.status!, - navLinkStatus, + navLinkStatus: + navLinkStatus === AppNavLinkStatus.default + ? app.status === AppStatus.inaccessible + ? AppNavLinkStatus.hidden + : AppNavLinkStatus.visible + : navLinkStatus, + searchable: + app.searchable ?? + (navLinkStatus === AppNavLinkStatus.default || navLinkStatus === AppNavLinkStatus.visible), appRoute: app.appRoute!, keywords: app.keywords ?? [], deepLinks: getDeepLinkInfos(app.deepLinks), @@ -37,17 +39,18 @@ function getDeepLinkInfos(deepLinks?: AppDeepLink[]): PublicAppDeepLinkInfo[] { if (!deepLinks) return []; return deepLinks.map( - (rawDeepLink): PublicAppDeepLinkInfo => { - const navLinkStatus = - rawDeepLink.navLinkStatus === AppNavLinkStatus.default - ? AppNavLinkStatus.hidden - : rawDeepLink.navLinkStatus!; + ({ navLinkStatus = AppNavLinkStatus.default, ...rawDeepLink }): PublicAppDeepLinkInfo => { return { id: rawDeepLink.id, title: rawDeepLink.title, path: rawDeepLink.path, keywords: rawDeepLink.keywords ?? [], - navLinkStatus, + navLinkStatus: + navLinkStatus === AppNavLinkStatus.default ? AppNavLinkStatus.hidden : navLinkStatus, + searchable: + rawDeepLink.searchable ?? + (navLinkStatus === AppNavLinkStatus.default || + navLinkStatus === AppNavLinkStatus.visible), deepLinks: getDeepLinkInfos(rawDeepLink.deepLinks), }; } diff --git a/src/core/public/chrome/nav_links/nav_link.ts b/src/core/public/chrome/nav_links/nav_link.ts index 87175ea465b7f1..4e9158cac5cd47 100644 --- a/src/core/public/chrome/nav_links/nav_link.ts +++ b/src/core/public/chrome/nav_links/nav_link.ts @@ -33,10 +33,9 @@ export interface ChromeNavLink { readonly baseUrl: string; /** - * The route used to open the {@link AppBase.defaultPath | default path } of an application. - * If unset, `baseUrl` will be used instead. + * The route used to open the default path and the deep links of an application. */ - readonly url?: string; + readonly url: string; /** * An ordinal used to sort nav links relative to one another for display. diff --git a/src/core/public/chrome/nav_links/nav_links_service.test.ts b/src/core/public/chrome/nav_links/nav_links_service.test.ts index afb902fd6bd83d..e1d537da6959b7 100644 --- a/src/core/public/chrome/nav_links/nav_links_service.test.ts +++ b/src/core/public/chrome/nav_links/nav_links_service.test.ts @@ -20,6 +20,22 @@ const availableApps = new Map([ order: -10, title: 'App 2', euiIconType: 'canvasApp', + deepLinks: [ + { + id: 'deepApp1', + order: 50, + title: 'Deep App 1', + path: '/deepapp1', + deepLinks: [ + { + id: 'deepApp2', + order: 40, + title: 'Deep App 2', + path: '/deepapp2', + }, + ], + }, + ], }, ], ['chromelessApp', { id: 'chromelessApp', order: 20, title: 'Chromless App', chromeless: true }], @@ -66,7 +82,7 @@ describe('NavLinksService', () => { map((links) => links.map((l) => l.id)) ) .toPromise() - ).toEqual(['app2', 'app1']); + ).toEqual(['app2', 'app1', 'app2:deepApp2', 'app2:deepApp1']); }); it('emits multiple values', async () => { @@ -76,7 +92,7 @@ describe('NavLinksService', () => { start.showOnly('app1'); service.stop(); - expect(emittedLinks).toEqual([['app2', 'app1'], ['app1']]); + expect(emittedLinks).toEqual([['app2', 'app1', 'app2:deepApp2', 'app2:deepApp1'], ['app1']]); }); it('completes when service is stopped', async () => { @@ -98,7 +114,12 @@ describe('NavLinksService', () => { describe('#getAll()', () => { it('returns a sorted array of navlinks', () => { - expect(start.getAll().map((l) => l.id)).toEqual(['app2', 'app1']); + expect(start.getAll().map((l) => l.id)).toEqual([ + 'app2', + 'app1', + 'app2:deepApp2', + 'app2:deepApp1', + ]); }); }); @@ -123,7 +144,7 @@ describe('NavLinksService', () => { map((links) => links.map((l) => l.id)) ) .toPromise() - ).toEqual(['app2', 'app1']); + ).toEqual(['app2', 'app1', 'app2:deepApp2', 'app2:deepApp1']); }); it('does nothing on chromeless applications', async () => { @@ -136,7 +157,7 @@ describe('NavLinksService', () => { map((links) => links.map((l) => l.id)) ) .toPromise() - ).toEqual(['app2', 'app1']); + ).toEqual(['app2', 'app1', 'app2:deepApp2', 'app2:deepApp1']); }); it('removes all other links', async () => { @@ -152,6 +173,19 @@ describe('NavLinksService', () => { ).toEqual(['app2']); }); + it('show only deep link', async () => { + start.showOnly('app2:deepApp1'); + expect( + await start + .getNavLinks$() + .pipe( + take(1), + map((links) => links.map((l) => l.id)) + ) + .toPromise() + ).toEqual(['app2:deepApp1']); + }); + it('still removes all other links when availableApps are re-emitted', async () => { start.showOnly('app2'); mockAppService.applications$.next(mockAppService.applications$.value); diff --git a/src/core/public/chrome/nav_links/nav_links_service.ts b/src/core/public/chrome/nav_links/nav_links_service.ts index d41d8ae964d622..af961987a63095 100644 --- a/src/core/public/chrome/nav_links/nav_links_service.ts +++ b/src/core/public/chrome/nav_links/nav_links_service.ts @@ -10,8 +10,8 @@ import { sortBy } from 'lodash'; import { BehaviorSubject, combineLatest, Observable, ReplaySubject } from 'rxjs'; import { map, takeUntil } from 'rxjs/operators'; -import { InternalApplicationStart } from '../../application'; -import { HttpStart } from '../../http'; +import { InternalApplicationStart, PublicAppDeepLinkInfo, PublicAppInfo } from '../../application'; +import { HttpStart, IBasePath } from '../../http'; import { ChromeNavLink, NavLinkWrapper } from './nav_link'; import { toNavLink } from './to_nav_link'; @@ -89,7 +89,13 @@ export class NavLinksService { return new Map( [...apps] .filter(([, app]) => !app.chromeless) - .map(([appId, app]) => [appId, toNavLink(app, http.basePath)]) + .reduce((navLinks: Array<[string, NavLinkWrapper]>, [appId, app]) => { + navLinks.push( + [appId, toNavLink(app, http.basePath)], + ...toNavDeepLinks(app, app.deepLinks, http.basePath) + ); + return navLinks; + }, []) ); }) ); @@ -163,3 +169,21 @@ function sortNavLinks(navLinks: ReadonlyMap) { 'order' ); } + +function toNavDeepLinks( + app: PublicAppInfo, + deepLinks: PublicAppDeepLinkInfo[], + basePath: IBasePath +): Array<[string, NavLinkWrapper]> { + if (!deepLinks) { + return []; + } + return deepLinks.reduce((navDeepLinks: Array<[string, NavLinkWrapper]>, deepLink) => { + const id = `${app.id}:${deepLink.id}`; + if (deepLink.path) { + navDeepLinks.push([id, toNavLink(app, basePath, { ...deepLink, id })]); + } + navDeepLinks.push(...toNavDeepLinks(app, deepLink.deepLinks, basePath)); + return navDeepLinks; + }, []); +} diff --git a/src/core/public/chrome/nav_links/to_nav_link.test.ts b/src/core/public/chrome/nav_links/to_nav_link.test.ts index db783d0028f075..9791f1bd1354b6 100644 --- a/src/core/public/chrome/nav_links/to_nav_link.test.ts +++ b/src/core/public/chrome/nav_links/to_nav_link.test.ts @@ -6,7 +6,12 @@ * Side Public License, v 1. */ -import { PublicAppInfo, AppNavLinkStatus, AppStatus } from '../../application'; +import { + PublicAppInfo, + AppNavLinkStatus, + AppStatus, + PublicAppDeepLinkInfo, +} from '../../application'; import { toNavLink } from './to_nav_link'; import { httpServiceMock } from '../../mocks'; @@ -16,12 +21,24 @@ const app = (props: Partial = {}): PublicAppInfo => ({ title: 'some-title', status: AppStatus.accessible, navLinkStatus: AppNavLinkStatus.default, + searchable: true, appRoute: `/app/some-id`, keywords: [], deepLinks: [], ...props, }); +const deepLink = (props: Partial = {}): PublicAppDeepLinkInfo => ({ + id: 'some-deep-link-id', + title: 'my deep link', + path: '/my-deep-link', + navLinkStatus: AppNavLinkStatus.default, + searchable: true, + deepLinks: [], + keywords: [], + ...props, +}); + describe('toNavLink', () => { const basePath = httpServiceMock.createSetupContract({ basePath: '/base-path' }).basePath; @@ -64,7 +81,7 @@ describe('toNavLink', () => { }), basePath ); - expect(link.properties.url).toEqual('http://localhost/base-path/my-route/my-path'); + expect(link.properties.url).toEqual('/base-path/my-route/my-path'); link = toNavLink( app({ @@ -73,9 +90,7 @@ describe('toNavLink', () => { }), basePath ); - expect(link.properties.url).toEqual( - 'http://localhost/base-path/my-route/my-path/some/default/path' - ); + expect(link.properties.url).toEqual('/base-path/my-route/my-path/some/default/path'); }); it('uses the application status when the navLinkStatus is set to default', () => { @@ -153,4 +168,90 @@ describe('toNavLink', () => { }) ); }); + + describe('deepLink parameter', () => { + it('should be hidden and not disabled by default', () => { + expect(toNavLink(app(), basePath, deepLink()).properties).toEqual( + expect.objectContaining({ + disabled: false, + hidden: true, + }) + ); + }); + + it('should not be hidden when navLinkStatus is visible', () => { + expect( + toNavLink( + app(), + basePath, + deepLink({ + navLinkStatus: AppNavLinkStatus.visible, + }) + ).properties + ).toEqual( + expect.objectContaining({ + disabled: false, + hidden: false, + }) + ); + }); + + it('should be disabled when navLinkStatus is disabled', () => { + expect( + toNavLink( + app(), + basePath, + deepLink({ + navLinkStatus: AppNavLinkStatus.disabled, + }) + ).properties + ).toEqual( + expect.objectContaining({ + disabled: true, + hidden: false, + }) + ); + }); + + it('should have href, baseUrl and url containing the path', () => { + const testApp = app({ + appRoute: '/app/app-id', + defaultPath: '/default-path', + }); + + expect(toNavLink(testApp, basePath).properties).toEqual( + expect.objectContaining({ + baseUrl: 'http://localhost/base-path/app/app-id', + url: '/base-path/app/app-id/default-path', + href: 'http://localhost/base-path/app/app-id/default-path', + }) + ); + + expect( + toNavLink( + testApp, + basePath, + deepLink({ + id: 'deep-link-id', + path: '/my-deep-link', + }) + ).properties + ).toEqual( + expect.objectContaining({ + baseUrl: 'http://localhost/base-path/app/app-id', + url: '/base-path/app/app-id/my-deep-link', + href: 'http://localhost/base-path/app/app-id/my-deep-link', + }) + ); + }); + + it('should use the main app category', () => { + expect(toNavLink(app(), basePath, deepLink()).properties.category).toBeUndefined(); + + const category = { id: 'some-category', label: 'some category' }; + expect(toNavLink(app({ category }), basePath, deepLink()).properties.category).toEqual( + category + ); + }); + }); }); diff --git a/src/core/public/chrome/nav_links/to_nav_link.ts b/src/core/public/chrome/nav_links/to_nav_link.ts index f56d496f42d8f6..6acf37d40f089b 100644 --- a/src/core/public/chrome/nav_links/to_nav_link.ts +++ b/src/core/public/chrome/nav_links/to_nav_link.ts @@ -6,29 +6,50 @@ * Side Public License, v 1. */ -import { PublicAppInfo, AppNavLinkStatus, AppStatus } from '../../application'; +import { + PublicAppInfo, + AppNavLinkStatus, + AppStatus, + PublicAppDeepLinkInfo, +} from '../../application'; import { IBasePath } from '../../http'; import { NavLinkWrapper } from './nav_link'; import { appendAppPath } from '../../application/utils'; -export function toNavLink(app: PublicAppInfo, basePath: IBasePath): NavLinkWrapper { - const useAppStatus = app.navLinkStatus === AppNavLinkStatus.default; +export function toNavLink( + app: PublicAppInfo, + basePath: IBasePath, + deepLink?: PublicAppDeepLinkInfo +): NavLinkWrapper { const relativeBaseUrl = basePath.prepend(app.appRoute!); - const url = relativeToAbsolute(appendAppPath(relativeBaseUrl, app.defaultPath)); + const url = appendAppPath(relativeBaseUrl, deepLink?.path || app.defaultPath); + const href = relativeToAbsolute(url); const baseUrl = relativeToAbsolute(relativeBaseUrl); return new NavLinkWrapper({ - ...app, - hidden: useAppStatus - ? app.status === AppStatus.inaccessible - : app.navLinkStatus === AppNavLinkStatus.hidden, - disabled: useAppStatus ? false : app.navLinkStatus === AppNavLinkStatus.disabled, + ...(deepLink || app), + ...(app.category ? { category: app.category } : {}), // deepLinks use the main app category + hidden: deepLink ? isDeepNavLinkHidden(deepLink) : isAppNavLinkHidden(app), + disabled: (deepLink?.navLinkStatus ?? app.navLinkStatus) === AppNavLinkStatus.disabled, baseUrl, - href: url, + href, url, }); } +function isAppNavLinkHidden(app: PublicAppInfo) { + return app.navLinkStatus === AppNavLinkStatus.default + ? app.status === AppStatus.inaccessible + : app.navLinkStatus === AppNavLinkStatus.hidden; +} + +function isDeepNavLinkHidden(deepLink: PublicAppDeepLinkInfo) { + return ( + deepLink.navLinkStatus === AppNavLinkStatus.default || + deepLink.navLinkStatus === AppNavLinkStatus.hidden + ); +} + /** * @param {string} url - a relative or root relative url. If a relative path is given then the * absolute url returned will depend on the current page where this function is called from. For example diff --git a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap index 0f5efe667ec2fc..3668829a6888cd 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap @@ -73,6 +73,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` "id": "Custom link", "isActive": true, "title": "Custom link", + "url": "/", }, "closed": false, "hasError": false, @@ -140,6 +141,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` "id": "discover", "isActive": true, "title": "discover", + "url": "/", }, Object { "baseUrl": "/", @@ -154,6 +156,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` "id": "siem", "isActive": true, "title": "siem", + "url": "/", }, Object { "baseUrl": "/", @@ -168,6 +171,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` "id": "metrics", "isActive": true, "title": "metrics", + "url": "/", }, Object { "baseUrl": "/", @@ -182,6 +186,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` "id": "monitoring", "isActive": true, "title": "monitoring", + "url": "/", }, Object { "baseUrl": "/", @@ -196,6 +201,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` "id": "visualize", "isActive": true, "title": "visualize", + "url": "/", }, Object { "baseUrl": "/", @@ -210,6 +216,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` "id": "dashboard", "isActive": true, "title": "dashboard", + "url": "/", }, Object { "baseUrl": "/", @@ -219,6 +226,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` "id": "canvas", "isActive": true, "title": "canvas", + "url": "/", }, Object { "baseUrl": "/", @@ -233,6 +241,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` "id": "logs", "isActive": true, "title": "logs", + "url": "/", }, ], "closed": false, @@ -351,6 +360,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` "values": Array [], } } + url="/" > ) { id: title, href: title, baseUrl: '/', + url: '/', isActive: true, 'data-test-subj': title, }; @@ -50,6 +51,7 @@ function mockProps() { isLocked: false, isNavOpen: false, homeHref: '/', + url: '/', navLinks$: new BehaviorSubject([]), recentlyAccessed$: new BehaviorSubject([]), storage: new StubBrowserStorage(), diff --git a/src/core/public/chrome/ui/header/collapsible_nav.tsx b/src/core/public/chrome/ui/header/collapsible_nav.tsx index b5b2919b659bdf..0e85dbea237cb2 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav.tsx +++ b/src/core/public/chrome/ui/header/collapsible_nav.tsx @@ -107,7 +107,7 @@ export function CollapsibleNav({ link, appId, dataTestSubj: 'collapsibleNavAppLink', - navigateToApp, + navigateToUrl, onClick: closeNav, ...(needsIcon && { basePath }), }); @@ -137,7 +137,7 @@ export function CollapsibleNav({ createEuiListItem({ link: customNavLink, basePath, - navigateToApp, + navigateToUrl, dataTestSubj: 'collapsibleNavCustomNavLink', onClick: closeNav, externalLink: true, diff --git a/src/core/public/chrome/ui/header/header.test.tsx b/src/core/public/chrome/ui/header/header.test.tsx index e0f10fe66c9f06..fdbdde8556eebf 100644 --- a/src/core/public/chrome/ui/header/header.test.tsx +++ b/src/core/public/chrome/ui/header/header.test.tsx @@ -61,13 +61,14 @@ describe('Header', () => { const breadcrumbs$ = new BehaviorSubject([{ text: 'test' }]); const isLocked$ = new BehaviorSubject(false); const navLinks$ = new BehaviorSubject([ - { id: 'kibana', title: 'kibana', baseUrl: '', href: '' }, + { id: 'kibana', title: 'kibana', baseUrl: '', href: '', url: '' }, ]); const headerBanner$ = new BehaviorSubject(undefined); const customNavLink$ = new BehaviorSubject({ id: 'cloud-deployment-link', title: 'Manage cloud deployment', baseUrl: '', + url: '', href: '', }); const recentlyAccessed$ = new BehaviorSubject([ diff --git a/src/core/public/chrome/ui/header/nav_link.tsx b/src/core/public/chrome/ui/header/nav_link.tsx index 84f758e2c737e5..b0ebf7cc5f8e5e 100644 --- a/src/core/public/chrome/ui/header/nav_link.tsx +++ b/src/core/public/chrome/ui/header/nav_link.tsx @@ -23,7 +23,7 @@ interface Props { basePath?: HttpStart['basePath']; dataTestSubj: string; onClick?: Function; - navigateToApp: CoreStart['application']['navigateToApp']; + navigateToUrl: CoreStart['application']['navigateToUrl']; externalLink?: boolean; } @@ -36,11 +36,11 @@ export function createEuiListItem({ appId, basePath, onClick = () => {}, - navigateToApp, + navigateToUrl, dataTestSubj, externalLink = false, }: Props) { - const { href, id, title, disabled, euiIconType, icon, tooltip } = link; + const { href, id, title, disabled, euiIconType, icon, tooltip, url } = link; return { label: tooltip ?? title, @@ -57,7 +57,7 @@ export function createEuiListItem({ !isModifiedOrPrevented(event) ) { event.preventDefault(); - navigateToApp(id); + navigateToUrl(url); } }, isActive: appId === id, diff --git a/src/core/public/doc_links/doc_links_service.ts b/src/core/public/doc_links/doc_links_service.ts index 36d613ec82f9e0..d4ab8f624f7111 100644 --- a/src/core/public/doc_links/doc_links_service.ts +++ b/src/core/public/doc_links/doc_links_service.ts @@ -32,14 +32,14 @@ export class DocLinksService { guide: `${KIBANA_DOCS}canvas.html`, }, dashboard: { - guide: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/dashboard.html`, - drilldowns: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/drilldowns.html`, - drilldownsTriggerPicker: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/drilldowns.html#url-drilldowns`, - urlDrilldownTemplateSyntax: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/url_templating-language.html`, - urlDrilldownVariables: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/url_templating-language.html#url-template-variables`, + guide: `${KIBANA_DOCS}dashboard.html`, + drilldowns: `${KIBANA_DOCS}drilldowns.html`, + drilldownsTriggerPicker: `${KIBANA_DOCS}drilldowns.html#url-drilldowns`, + urlDrilldownTemplateSyntax: `${KIBANA_DOCS}url_templating-language.html`, + urlDrilldownVariables: `${KIBANA_DOCS}url_templating-language.html#url-template-variables`, }, discover: { - guide: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/discover.html`, + guide: `${KIBANA_DOCS}discover.html`, }, filebeat: { base: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}`, @@ -128,14 +128,14 @@ export class DocLinksService { luceneExpressions: `${ELASTICSEARCH_DOCS}modules-scripting-expression.html`, }, indexPatterns: { - introduction: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/index-patterns.html`, - fieldFormattersNumber: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/numeral.html`, - fieldFormattersString: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/field-formatters-string.html`, + introduction: `${KIBANA_DOCS}index-patterns.html`, + fieldFormattersNumber: `${KIBANA_DOCS}numeral.html`, + fieldFormattersString: `${KIBANA_DOCS}field-formatters-string.html`, runtimeFields: `${KIBANA_DOCS}managing-index-patterns.html#runtime-fields`, }, - addData: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/connect-to-elasticsearch.html`, - kibana: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/index.html`, - upgradeAssistant: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/upgrade-assistant.html`, + addData: `${KIBANA_DOCS}connect-to-elasticsearch.html`, + kibana: `${KIBANA_DOCS}index.html`, + upgradeAssistant: `${KIBANA_DOCS}upgrade-assistant.html`, elasticsearch: { docsBase: `${ELASTICSEARCH_DOCS}`, asyncSearch: `${ELASTICSEARCH_DOCS}async-search-intro.html`, @@ -195,23 +195,23 @@ export class DocLinksService { }, query: { eql: `${ELASTICSEARCH_DOCS}eql.html`, - kueryQuerySyntax: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kuery-query.html`, + kueryQuerySyntax: `${KIBANA_DOCS}kuery-query.html`, luceneQuerySyntax: `${ELASTICSEARCH_DOCS}query-dsl-query-string-query.html#query-string-syntax`, percolate: `${ELASTICSEARCH_DOCS}query-dsl-percolate-query.html`, queryDsl: `${ELASTICSEARCH_DOCS}query-dsl.html`, }, search: { - sessions: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/search-sessions.html`, + sessions: `${KIBANA_DOCS}search-sessions.html`, }, date: { dateMath: `${ELASTICSEARCH_DOCS}common-options.html#date-math`, dateMathIndexNames: `${ELASTICSEARCH_DOCS}date-math-index-names.html`, }, management: { - dashboardSettings: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/advanced-options.html#kibana-dashboard-settings`, + dashboardSettings: `${KIBANA_DOCS}advanced-options.html#kibana-dashboard-settings`, indexManagement: `${ELASTICSEARCH_DOCS}index-mgmt.html`, - kibanaSearchSettings: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/advanced-options.html#kibana-search-settings`, - visualizationSettings: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/advanced-options.html#kibana-visualization-settings`, + kibanaSearchSettings: `${KIBANA_DOCS}advanced-options.html#kibana-search-settings`, + visualizationSettings: `${KIBANA_DOCS}advanced-options.html#kibana-visualization-settings`, }, ml: { guide: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/index.html`, @@ -242,52 +242,52 @@ export class DocLinksService { guide: `${ELASTICSEARCH_DOCS}transforms.html`, }, visualize: { - guide: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/dashboard.html`, - timelionDeprecation: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/timelion.html`, + guide: `${KIBANA_DOCS}dashboard.html`, + timelionDeprecation: `${KIBANA_DOCS}timelion.html`, lens: `${ELASTIC_WEBSITE_URL}what-is/kibana-lens`, - lensPanels: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/lens.html`, + lensPanels: `${KIBANA_DOCS}lens.html`, maps: `${ELASTIC_WEBSITE_URL}maps`, - vega: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/vega.html`, + vega: `${KIBANA_DOCS}vega.html`, }, observability: { guide: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/index.html`, }, alerting: { - guide: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/alert-management.html`, - actionTypes: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/action-types.html`, - emailAction: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/email-action-type.html`, - emailActionConfig: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/email-action-type.html`, - generalSettings: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/alert-action-settings-kb.html#general-alert-action-settings`, - indexAction: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/index-action-type.html`, - esQuery: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/rule-type-es-query.html`, - indexThreshold: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/rule-type-index-threshold.html`, - pagerDutyAction: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/pagerduty-action-type.html`, - preconfiguredConnectors: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/pre-configured-connectors.html`, - preconfiguredAlertHistoryConnector: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/index-action-type.html#preconfigured-connector-alert-history`, - serviceNowAction: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/servicenow-action-type.html#configuring-servicenow`, - setupPrerequisites: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/alerting-getting-started.html#alerting-setup-prerequisites`, - slackAction: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/slack-action-type.html#configuring-slack`, - teamsAction: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/teams-action-type.html#configuring-teams`, + guide: `${KIBANA_DOCS}alert-management.html`, + actionTypes: `${KIBANA_DOCS}action-types.html`, + emailAction: `${KIBANA_DOCS}email-action-type.html`, + emailActionConfig: `${KIBANA_DOCS}email-action-type.html`, + generalSettings: `${KIBANA_DOCS}alert-action-settings-kb.html#general-alert-action-settings`, + indexAction: `${KIBANA_DOCS}index-action-type.html`, + esQuery: `${KIBANA_DOCS}rule-type-es-query.html`, + indexThreshold: `${KIBANA_DOCS}rule-type-index-threshold.html`, + pagerDutyAction: `${KIBANA_DOCS}pagerduty-action-type.html`, + preconfiguredConnectors: `${KIBANA_DOCS}pre-configured-connectors.html`, + preconfiguredAlertHistoryConnector: `${KIBANA_DOCS}index-action-type.html#preconfigured-connector-alert-history`, + serviceNowAction: `${KIBANA_DOCS}servicenow-action-type.html#configuring-servicenow`, + setupPrerequisites: `${KIBANA_DOCS}alerting-getting-started.html#alerting-setup-prerequisites`, + slackAction: `${KIBANA_DOCS}slack-action-type.html#configuring-slack`, + teamsAction: `${KIBANA_DOCS}teams-action-type.html#configuring-teams`, }, maps: { - guide: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/maps.html`, - importGeospatialPrivileges: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/import-geospatial-data.html#import-geospatial-privileges`, + guide: `${KIBANA_DOCS}maps.html`, + importGeospatialPrivileges: `${KIBANA_DOCS}import-geospatial-data.html#import-geospatial-privileges`, }, monitoring: { - alertsKibana: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kibana-alerts.html`, - alertsKibanaCpuThreshold: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kibana-alerts.html#kibana-alerts-cpu-threshold`, - alertsKibanaDiskThreshold: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kibana-alerts.html#kibana-alerts-disk-usage-threshold`, - alertsKibanaJvmThreshold: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kibana-alerts.html#kibana-alerts-jvm-memory-threshold`, - alertsKibanaMissingData: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kibana-alerts.html#kibana-alerts-missing-monitoring-data`, - alertsKibanaThreadpoolRejections: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kibana-alerts.html#kibana-alerts-thread-pool-rejections`, - alertsKibanaCCRReadExceptions: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kibana-alerts.html#kibana-alerts-ccr-read-exceptions`, - alertsKibanaLargeShardSize: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kibana-alerts.html#kibana-alerts-large-shard-size`, - alertsKibanaClusterAlerts: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kibana-alerts.html#kibana-alerts-cluster-alerts`, + alertsKibana: `${KIBANA_DOCS}kibana-alerts.html`, + alertsKibanaCpuThreshold: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-cpu-threshold`, + alertsKibanaDiskThreshold: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-disk-usage-threshold`, + alertsKibanaJvmThreshold: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-jvm-memory-threshold`, + alertsKibanaMissingData: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-missing-monitoring-data`, + alertsKibanaThreadpoolRejections: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-thread-pool-rejections`, + alertsKibanaCCRReadExceptions: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-ccr-read-exceptions`, + alertsKibanaLargeShardSize: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-large-shard-size`, + alertsKibanaClusterAlerts: `${KIBANA_DOCS}kibana-alerts.html#kibana-alerts-cluster-alerts`, metricbeatBlog: `${ELASTIC_WEBSITE_URL}blog/external-collection-for-elastic-stack-monitoring-is-now-available-via-metricbeat`, monitorElasticsearch: `${ELASTICSEARCH_DOCS}configuring-metricbeat.html`, - monitorKibana: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/monitoring-metricbeat.html`, + monitorKibana: `${KIBANA_DOCS}monitoring-metricbeat.html`, monitorLogstash: `${ELASTIC_WEBSITE_URL}guide/en/logstash/${DOC_LINK_VERSION}/monitoring-with-metricbeat.html`, - troubleshootKibana: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/monitor-troubleshooting.html`, + troubleshootKibana: `${KIBANA_DOCS}monitor-troubleshooting.html`, }, security: { apiKeyServiceSettings: `${ELASTICSEARCH_DOCS}security-settings.html#api-key-service-settings`, @@ -295,8 +295,8 @@ export class DocLinksService { elasticsearchSettings: `${ELASTICSEARCH_DOCS}security-settings.html`, elasticsearchEnableSecurity: `${ELASTICSEARCH_DOCS}configuring-stack-security.html`, indicesPrivileges: `${ELASTICSEARCH_DOCS}security-privileges.html#privileges-list-indices`, - kibanaTLS: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/configuring-tls.html`, - kibanaPrivileges: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kibana-privileges.html`, + kibanaTLS: `${KIBANA_DOCS}configuring-tls.html`, + kibanaPrivileges: `${KIBANA_DOCS}kibana-privileges.html`, mappingRoles: `${ELASTICSEARCH_DOCS}mapping-roles.html`, mappingRolesFieldRules: `${ELASTICSEARCH_DOCS}role-mapping-resources.html#mapping-roles-rule-field`, runAsPrivilege: `${ELASTICSEARCH_DOCS}security-privileges.html#_run_as_privilege`, @@ -305,7 +305,7 @@ export class DocLinksService { jiraAction: `${ELASTICSEARCH_DOCS}actions-jira.html`, pagerDutyAction: `${ELASTICSEARCH_DOCS}actions-pagerduty.html`, slackAction: `${ELASTICSEARCH_DOCS}actions-slack.html`, - ui: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/watcher-ui.html`, + ui: `${KIBANA_DOCS}watcher-ui.html`, }, ccs: { guide: `${ELASTICSEARCH_DOCS}modules-cross-cluster-search.html`, diff --git a/src/core/public/index.ts b/src/core/public/index.ts index 24b48683cdd937..32737ff427ef3e 100644 --- a/src/core/public/index.ts +++ b/src/core/public/index.ts @@ -91,6 +91,7 @@ export type { AppLeaveConfirmAction, AppUpdatableFields, AppUpdater, + AppNavOptions, AppDeepLink, PublicAppInfo, PublicAppDeepLinkInfo, diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md index 667863d29623ed..235110aeb4633c 100644 --- a/src/core/public/public.api.md +++ b/src/core/public/public.api.md @@ -53,24 +53,21 @@ import { UserProvidedValues as UserProvidedValues_2 } from 'src/core/server/type export function __kbnBootstrap__(): Promise; // @public (undocumented) -export interface App { +export interface App extends AppNavOptions { appRoute?: string; capabilities?: Partial; category?: AppCategory; chromeless?: boolean; deepLinks?: AppDeepLink[]; defaultPath?: string; - euiIconType?: string; exactRoute?: boolean; - icon?: string; id: string; keywords?: string[]; mount: AppMount; navLinkStatus?: AppNavLinkStatus; - order?: number; + searchable?: boolean; status?: AppStatus; title: string; - tooltip?: string; updater$?: Observable; } @@ -92,7 +89,8 @@ export type AppDeepLink = { title: string; keywords?: string[]; navLinkStatus?: AppNavLinkStatus; -} & ({ + searchable?: boolean; +} & AppNavOptions & ({ path: string; deepLinks?: AppDeepLink[]; } | { @@ -179,6 +177,14 @@ export enum AppNavLinkStatus { visible = 1 } +// @public +export interface AppNavOptions { + euiIconType?: string; + icon?: string; + order?: number; + tooltip?: string; +} + // @public export enum AppStatus { accessible = 0, @@ -189,7 +195,7 @@ export enum AppStatus { export type AppUnmount = () => void; // @public -export type AppUpdatableFields = Pick; +export type AppUpdatableFields = Pick; // @public export type AppUpdater = (app: App) => Partial | undefined; @@ -314,8 +320,7 @@ export interface ChromeNavLink { readonly order?: number; readonly title: string; readonly tooltip?: string; - // Warning: (ae-unresolved-link) The @link reference could not be resolved: The package "kibana" does not have an export "AppBase" - readonly url?: string; + readonly url: string; } // @public @@ -916,10 +921,9 @@ export interface IUiSettingsClient { // @public export type MountPoint = (element: T) => UnmountCallback; -// Warning: (ae-missing-release-tag) "NavigateToAppOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export interface NavigateToAppOptions { + deepLinkId?: string; openInNewTab?: boolean; path?: string; replace?: boolean; @@ -1067,19 +1071,21 @@ export interface PluginInitializerContext export type PluginOpaqueId = symbol; // @public -export type PublicAppDeepLinkInfo = Omit & { +export type PublicAppDeepLinkInfo = Omit & { deepLinks: PublicAppDeepLinkInfo[]; keywords: string[]; navLinkStatus: AppNavLinkStatus; + searchable: boolean; }; // @public -export type PublicAppInfo = Omit & { +export type PublicAppInfo = Omit & { status: AppStatus; navLinkStatus: AppNavLinkStatus; appRoute: string; keywords: string[]; deepLinks: PublicAppDeepLinkInfo[]; + searchable: boolean; }; // @public @@ -1249,7 +1255,7 @@ export interface SavedObjectsCreateOptions { // @public (undocumented) export interface SavedObjectsFindOptions { // @alpha - aggs?: Record; + aggs?: Record; defaultSearchOperator?: 'AND' | 'OR'; fields?: string[]; // Warning: (ae-forgotten-export) The symbol "KueryNode" needs to be exported by the entry point index.d.ts @@ -1275,7 +1281,7 @@ export interface SavedObjectsFindOptions { // (undocumented) sortField?: string; // (undocumented) - sortOrder?: estypes.SortOrder; + sortOrder?: estypes.SearchSortOrder; // (undocumented) type: string | string[]; typeToNamespacesMap?: Map; diff --git a/src/core/public/rendering/_base.scss b/src/core/public/rendering/_base.scss index 3a748f3ceb6fd3..4bd6afe90d3429 100644 --- a/src/core/public/rendering/_base.scss +++ b/src/core/public/rendering/_base.scss @@ -35,27 +35,12 @@ position: relative; // This is temporary for apps that relied on this being present on `.application` } -// TODO: This is problematic because it doesn't stay in line with EUI: -// adapted from euiHeaderAffordForFixed as we need to handle the top banner @mixin kbnAffordForHeader($headerHeight) { - padding-top: $headerHeight; + @include euiHeaderAffordForFixed($headerHeight); #app-fixed-viewport { top: $headerHeight; } - - .euiFlyout, - .euiCollapsibleNav { - top: $headerHeight; - height: calc(100% - #{$headerHeight}); - } - - @include euiBreakpoint('m', 'l', 'xl') { - .euiPageSideBar--sticky { - max-height: calc(100vh - #{$headerHeight}); - top: #{$headerHeight}; - } - } } .kbnBody { diff --git a/src/core/public/styles/_base.scss b/src/core/public/styles/_base.scss index 46f46b469783b8..3386fa73f328aa 100644 --- a/src/core/public/styles/_base.scss +++ b/src/core/public/styles/_base.scss @@ -28,3 +28,9 @@ .euiBody--collapsibleNavIsDocked .euiBottomBar { margin-left: $euiCollapsibleNavWidth; } + +// Temporary fix for EuiPageHeader with a bottom border but no tabs or padding +// Will fix in EUI -- @cchaos +.euiPageHeader--bottomBorder:not(.euiPageHeader--tabsAtBottom):not([class*='euiPageHeader--padding']) { + padding-bottom: $euiSizeL; +} diff --git a/src/core/server/elasticsearch/version_check/ensure_es_version.ts b/src/core/server/elasticsearch/version_check/ensure_es_version.ts index 43cd52f1b57211..e1f18f8ad836ad 100644 --- a/src/core/server/elasticsearch/version_check/ensure_es_version.ts +++ b/src/core/server/elasticsearch/version_check/ensure_es_version.ts @@ -31,7 +31,7 @@ export interface PollEsNodesVersionOptions { interface NodeInfo { version: string; ip: string; - http: { + http?: { publish_address: string; }; name: string; diff --git a/src/core/server/http/integration_tests/core_services.test.ts b/src/core/server/http/integration_tests/core_services.test.ts index 5433f0d3c3e31c..99b63fc73687a1 100644 --- a/src/core/server/http/integration_tests/core_services.test.ts +++ b/src/core/server/http/integration_tests/core_services.test.ts @@ -405,7 +405,7 @@ describe('http service', () => { const { body } = await kbnTestServer.request.get(root, '/new-platform/').expect(400); - expect(body.message).toEqual('[error_type]: error_reason'); + expect(body.message).toMatch('[error_type]: error_reason'); }); }); }); diff --git a/src/core/server/index.ts b/src/core/server/index.ts index 2e495657d34104..ef1ee69ff529b5 100644 --- a/src/core/server/index.ts +++ b/src/core/server/index.ts @@ -339,8 +339,6 @@ export type { SavedObjectsDeleteByNamespaceOptions, SavedObjectsIncrementCounterOptions, SavedObjectsIncrementCounterField, - SavedObjectsComplexFieldMapping, - SavedObjectsCoreFieldMapping, SavedObjectsFieldMapping, SavedObjectsTypeMappingDefinition, SavedObjectsMappingProperties, diff --git a/src/core/server/plugins/discovery/plugin_manifest_parser.ts b/src/core/server/plugins/discovery/plugin_manifest_parser.ts index 7ac629534ba089..b59418a67219e0 100644 --- a/src/core/server/plugins/discovery/plugin_manifest_parser.ts +++ b/src/core/server/plugins/discovery/plugin_manifest_parser.ts @@ -48,6 +48,8 @@ const KNOWN_MANIFEST_FIELDS = (() => { extraPublicDirs: true, requiredBundles: true, serviceFolders: true, + owner: true, + description: true, }; return new Set(Object.keys(manifestFields)); @@ -187,6 +189,8 @@ export async function parseManifest( ui: includesUiPlugin, server: includesServerPlugin, extraPublicDirs: manifest.extraPublicDirs, + owner: manifest.owner, + description: manifest.description, }; } diff --git a/src/core/server/plugins/types.ts b/src/core/server/plugins/types.ts index 6b50b5e820665e..0cdc806e997ef7 100644 --- a/src/core/server/plugins/types.ts +++ b/src/core/server/plugins/types.ts @@ -208,6 +208,27 @@ export interface PluginManifest { * folders will cause your plugin API reference to be broken up into sub sections. */ readonly serviceFolders?: readonly string[]; + + /** + * TODO: make required once all internal plugins have this specified. + */ + readonly owner?: { + /** + * The name of the team that currently owns this plugin. + */ + readonly name: string; + /** + * All internal plugins should have a github team specified. GitHub teams can be viewed here: + * https://github.com/orgs/elastic/teams + */ + readonly githubTeam?: string; + }; + + /** + * TODO: make required once all plugins specify this. + * A brief description of what this plugin does and any capabilities it provides. + */ + readonly description?: string; } /** diff --git a/src/core/server/rendering/views/styles.tsx b/src/core/server/rendering/views/styles.tsx index 105f94df9218fc..fbeab4fb4388fa 100644 --- a/src/core/server/rendering/views/styles.tsx +++ b/src/core/server/rendering/views/styles.tsx @@ -52,7 +52,6 @@ const InlineStyles: FC<{ darkMode: boolean }> = ({ darkMode }) => { .kbnWelcomeView { line-height: 1.5; - background-color: ${darkMode ? '#1D1E24' : '#FFF'}; height: 100%; display: -webkit-box; display: -webkit-flex; diff --git a/src/core/server/saved_objects/index.ts b/src/core/server/saved_objects/index.ts index 2af25e0cdef3f2..b1b1584d7de88c 100644 --- a/src/core/server/saved_objects/index.ts +++ b/src/core/server/saved_objects/index.ts @@ -72,8 +72,6 @@ export type { } from './service/lib/repository'; export type { - SavedObjectsCoreFieldMapping, - SavedObjectsComplexFieldMapping, SavedObjectsFieldMapping, SavedObjectsMappingProperties, SavedObjectsTypeMappingDefinition, diff --git a/src/core/server/saved_objects/mappings/index.ts b/src/core/server/saved_objects/mappings/index.ts index bf1029e9f3b81d..5da185ace79c63 100644 --- a/src/core/server/saved_objects/mappings/index.ts +++ b/src/core/server/saved_objects/mappings/index.ts @@ -8,8 +8,6 @@ export { getTypes, getProperty, getRootProperties, getRootPropertiesObjects } from './lib'; export type { - SavedObjectsComplexFieldMapping, - SavedObjectsCoreFieldMapping, SavedObjectsTypeMappingDefinition, SavedObjectsTypeMappingDefinitions, SavedObjectsMappingProperties, diff --git a/src/core/server/saved_objects/mappings/lib/get_property.test.ts b/src/core/server/saved_objects/mappings/lib/get_property.test.ts index dab712bbb87add..8732b5e07d3fa7 100644 --- a/src/core/server/saved_objects/mappings/lib/get_property.test.ts +++ b/src/core/server/saved_objects/mappings/lib/get_property.test.ts @@ -34,7 +34,7 @@ const MAPPINGS = { }, }, }, -}; +} as const; function runTest(key: string | string[], mapping: IndexMapping | SavedObjectsFieldMapping) { expect(typeof key === 'string' || Array.isArray(key)).toBeTruthy(); diff --git a/src/core/server/saved_objects/mappings/lib/get_property.ts b/src/core/server/saved_objects/mappings/lib/get_property.ts index c2daa1e70a898a..2a9993bc175ca1 100644 --- a/src/core/server/saved_objects/mappings/lib/get_property.ts +++ b/src/core/server/saved_objects/mappings/lib/get_property.ts @@ -7,7 +7,7 @@ */ import { toPath } from 'lodash'; -import { SavedObjectsCoreFieldMapping, SavedObjectsFieldMapping, IndexMapping } from '../types'; +import { SavedObjectsFieldMapping, IndexMapping } from '../types'; function getPropertyMappingFromObjectMapping( mapping: IndexMapping | SavedObjectsFieldMapping, @@ -15,7 +15,7 @@ function getPropertyMappingFromObjectMapping( ): SavedObjectsFieldMapping | undefined { const props = (mapping && (mapping as IndexMapping).properties) || - (mapping && (mapping as SavedObjectsCoreFieldMapping).fields); + (mapping && (mapping as SavedObjectsFieldMapping).fields); if (!props) { return undefined; diff --git a/src/core/server/saved_objects/mappings/lib/get_root_properties_objects.test.ts b/src/core/server/saved_objects/mappings/lib/get_root_properties_objects.test.ts index 2daca3a1fdd83c..cbc6808418bc06 100644 --- a/src/core/server/saved_objects/mappings/lib/get_root_properties_objects.test.ts +++ b/src/core/server/saved_objects/mappings/lib/get_root_properties_objects.test.ts @@ -15,7 +15,7 @@ test(`returns single object with properties`, () => { properties: {}, }, }, - }; + } as const; const result = getRootPropertiesObjects(mappings); expect(result).toEqual({ @@ -32,7 +32,7 @@ test(`returns single object with type === 'object'`, () => { type: 'object', }, }, - }; + } as const; const result = getRootPropertiesObjects(mappings); expect(result).toEqual({ @@ -75,7 +75,7 @@ test(`returns two objects with type === 'object'`, () => { type: 'object', }, }, - }; + } as const; const result = getRootPropertiesObjects(mappings); expect(result).toEqual({ @@ -95,7 +95,7 @@ test(`excludes objects without properties and type of keyword`, () => { type: 'keyword', }, }, - }; + } as const; const result = getRootPropertiesObjects(mappings); expect(result).toEqual({}); @@ -111,7 +111,7 @@ test(`excludes two objects without properties and type of keyword`, () => { type: 'keyword', }, }, - }; + } as const; const result = getRootPropertiesObjects(mappings); expect(result).toEqual({}); @@ -127,7 +127,7 @@ test(`includes one object with properties and excludes one object without proper type: 'keyword', }, }, - }; + } as const; const result = getRootPropertiesObjects(mappings); expect(result).toEqual({ @@ -147,7 +147,7 @@ test(`includes one object with type === 'object' and excludes one object without type: 'keyword', }, }, - }; + } as const; const result = getRootPropertiesObjects(mappings); expect(result).toEqual({ @@ -170,7 +170,7 @@ test('excludes references and migrationVersion which are part of the blacklist', type: 'object', }, }, - }; + } as const; const result = getRootPropertiesObjects(mappings); expect(result).toEqual({ foo: { diff --git a/src/core/server/saved_objects/mappings/lib/get_root_properties_objects.ts b/src/core/server/saved_objects/mappings/lib/get_root_properties_objects.ts index 3a25865c03b265..54ea4eafc186f9 100644 --- a/src/core/server/saved_objects/mappings/lib/get_root_properties_objects.ts +++ b/src/core/server/saved_objects/mappings/lib/get_root_properties_objects.ts @@ -6,11 +6,7 @@ * Side Public License, v 1. */ -import { - SavedObjectsComplexFieldMapping, - IndexMapping, - SavedObjectsMappingProperties, -} from '../types'; +import { SavedObjectsFieldMapping, IndexMapping, SavedObjectsMappingProperties } from '../types'; import { getRootProperties } from './get_root_properties'; /** @@ -36,7 +32,7 @@ export function getRootPropertiesObjects(mappings: IndexMapping) { // we consider the existence of the properties or type of object to designate that this is an object datatype if ( !omittedRootProps.includes(key) && - ((value as SavedObjectsComplexFieldMapping).properties || value.type === 'object') + ((value as SavedObjectsFieldMapping).properties || value.type === 'object') ) { acc[key] = value; } diff --git a/src/core/server/saved_objects/mappings/types.ts b/src/core/server/saved_objects/mappings/types.ts index 25fb61de935187..e2ad2a91fd000a 100644 --- a/src/core/server/saved_objects/mappings/types.ts +++ b/src/core/server/saved_objects/mappings/types.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import type { estypes } from '@elastic/elasticsearch'; /** * Describe a saved object type mapping. * @@ -96,9 +97,17 @@ export interface SavedObjectsMappingProperties { * * @public */ -export type SavedObjectsFieldMapping = - | SavedObjectsCoreFieldMapping - | SavedObjectsComplexFieldMapping; +export type SavedObjectsFieldMapping = estypes.MappingProperty & { + /** + * The dynamic property of the mapping, either `false` or `'strict'`. If + * unspecified `dynamic: 'strict'` will be inherited from the top-level + * index mappings. + * + * Note: To limit the number of mapping fields Saved Object types should + * *never* use `dynamic: true`. + */ + dynamic?: false | 'strict'; +}; /** @internal */ export interface IndexMapping { @@ -114,42 +123,3 @@ export interface IndexMappingMeta { // the md5 hash of that mapping's value when the index was created. migrationMappingPropertyHashes?: { [k: string]: string }; } - -/** - * See {@link SavedObjectsFieldMapping} for documentation. - * - * @public - */ -export interface SavedObjectsCoreFieldMapping { - type: string; - null_value?: number | boolean | string; - index?: boolean; - doc_values?: boolean; - fields?: { - [subfield: string]: { - type: string; - ignore_above?: number; - }; - }; -} - -/** - * See {@link SavedObjectsFieldMapping} for documentation. - * - * @public - */ -export interface SavedObjectsComplexFieldMapping { - /** - * The dynamic property of the mapping, either `false` or `'strict'`. If - * unspecified `dynamic: 'strict'` will be inherited from the top-level - * index mappings. - * - * Note: To limit the number of mapping fields Saved Object types should - * *never* use `dynamic: true`. - */ - dynamic?: false | 'strict'; - enabled?: boolean; - doc_values?: boolean; - type?: string; - properties: SavedObjectsMappingProperties; -} diff --git a/src/core/server/saved_objects/migrations/core/build_active_mappings.test.ts b/src/core/server/saved_objects/migrations/core/build_active_mappings.test.ts index 5465da2f620adb..a39fff20abbe71 100644 --- a/src/core/server/saved_objects/migrations/core/build_active_mappings.test.ts +++ b/src/core/server/saved_objects/migrations/core/build_active_mappings.test.ts @@ -19,19 +19,19 @@ describe('buildActiveMappings', () => { const properties = { aaa: { type: 'text' }, bbb: { type: 'long' }, - }; + } as const; expect(buildActiveMappings(properties)).toMatchSnapshot(); }); test('disallows duplicate mappings', () => { - const properties = { type: { type: 'long' } }; + const properties = { type: { type: 'long' } } as const; expect(() => buildActiveMappings(properties)).toThrow(/Cannot redefine core mapping \"type\"/); }); test('disallows mappings with leading underscore', () => { - const properties = { _hm: { type: 'keyword' } }; + const properties = { _hm: { type: 'keyword' } } as const; expect(() => buildActiveMappings(properties)).toThrow( /Invalid mapping \"_hm\"\. Mappings cannot start with _/ @@ -60,7 +60,7 @@ describe('buildActiveMappings', () => { aaa: { type: 'keyword', fields: { a: { type: 'keyword' }, b: { type: 'text' } } }, bbb: { fields: { b: { type: 'text' }, a: { type: 'keyword' } }, type: 'keyword' }, ccc: { fields: { b: { type: 'text' }, a: { type: 'text' } }, type: 'keyword' }, - }; + } as const; const mappings = buildActiveMappings(properties); const hashes = mappings._meta!.migrationMappingPropertyHashes!; diff --git a/src/core/server/saved_objects/migrations/core/build_index_map.test.ts b/src/core/server/saved_objects/migrations/core/build_index_map.test.ts index c7a3251e33ab18..731b7f8c029c24 100644 --- a/src/core/server/saved_objects/migrations/core/build_index_map.test.ts +++ b/src/core/server/saved_objects/migrations/core/build_index_map.test.ts @@ -36,7 +36,7 @@ test('mappings without index pattern goes to default index', () => { type1: { properties: { field1: { - type: 'string', + type: 'text', }, }, }, @@ -48,7 +48,7 @@ test('mappings without index pattern goes to default index', () => { type1: { properties: { field1: { - type: 'string', + type: 'text', }, }, }, @@ -69,7 +69,7 @@ test(`mappings with custom index pattern doesn't go to default index`, () => { type1: { properties: { field1: { - type: 'string', + type: 'text', }, }, }, @@ -81,7 +81,7 @@ test(`mappings with custom index pattern doesn't go to default index`, () => { type1: { properties: { field1: { - type: 'string', + type: 'text', }, }, }, @@ -103,7 +103,7 @@ test('creating a script gets added to the index pattern', () => { type1: { properties: { field1: { - type: 'string', + type: 'text', }, }, }, @@ -116,7 +116,7 @@ test('creating a script gets added to the index pattern', () => { type1: { properties: { field1: { - type: 'string', + type: 'text', }, }, }, @@ -144,18 +144,18 @@ test('throws when two scripts are defined for an index pattern', () => { type1: { properties: { field1: { - type: 'string', + type: 'text', }, }, }, type2: { properties: { field1: { - type: 'string', + type: 'text', }, }, }, - }; + } as const; expect(() => createIndexMap({ kibanaIndexName: defaultIndex, diff --git a/src/core/server/saved_objects/migrations/core/elastic_index.test.ts b/src/core/server/saved_objects/migrations/core/elastic_index.test.ts index 1d2ec6abc0dd14..c9c24cc85a4528 100644 --- a/src/core/server/saved_objects/migrations/core/elastic_index.test.ts +++ b/src/core/server/saved_objects/migrations/core/elastic_index.test.ts @@ -40,10 +40,10 @@ describe('ElasticIndex', () => { return elasticsearchClientMock.createSuccessTransportRequestPromise({ [index]: { aliases: { foo: index }, - mappings: { dynamic: 'strict', properties: { a: 'b' } }, + mappings: { dynamic: 'strict', properties: { a: 'b' } as any }, settings: {}, }, - } as estypes.GetIndexResponse); + } as estypes.IndicesGetResponse); }); const info = await Index.fetchInfo(client, '.baz'); @@ -164,7 +164,7 @@ describe('ElasticIndex', () => { client.tasks.get.mockResolvedValue( elasticsearchClientMock.createSuccessTransportRequestPromise({ completed: true, - } as estypes.GetTaskResponse) + } as estypes.TaskGetResponse) ); const info = { @@ -175,7 +175,7 @@ describe('ElasticIndex', () => { dynamic: 'strict' as const, properties: { foo: { type: 'keyword' } }, }, - }; + } as const; await Index.convertToAlias( client, @@ -248,7 +248,7 @@ describe('ElasticIndex', () => { reason: 'all shards failed', failed_shards: [], }, - } as estypes.GetTaskResponse) + } as estypes.TaskGetResponse) ); const info = { diff --git a/src/core/server/saved_objects/migrations/core/elastic_index.ts b/src/core/server/saved_objects/migrations/core/elastic_index.ts index 76fdd5e73d804f..296a4cee07c11b 100644 --- a/src/core/server/saved_objects/migrations/core/elastic_index.ts +++ b/src/core/server/saved_objects/migrations/core/elastic_index.ts @@ -32,7 +32,7 @@ export interface FullIndexInfo { // saved objects which are no longer used. These saved objects will still be // kept in the outdated index for backup purposes, but won't be available in // the upgraded index. -export const excludeUnusedTypesQuery: estypes.QueryContainer = { +export const excludeUnusedTypesQuery: estypes.QueryDslQueryContainer = { bool: { must_not: [ // https://github.com/elastic/kibana/issues/91869 @@ -401,7 +401,6 @@ async function reindex( task_id: String(task), }); - // @ts-expect-error @elastic/elasticsearch GetTaskResponse doesn't contain `error` property const e = body.error; if (e) { throw new Error(`Re-index failed [${e.type}] ${e.reason} :: ${JSON.stringify(e)}`); diff --git a/src/core/server/saved_objects/migrations/core/index_migrator.test.ts b/src/core/server/saved_objects/migrations/core/index_migrator.test.ts index fcc03f363139b0..64d4fa3609e90f 100644 --- a/src/core/server/saved_objects/migrations/core/index_migrator.test.ts +++ b/src/core/server/saved_objects/migrations/core/index_migrator.test.ts @@ -450,7 +450,7 @@ function withIndex( client.tasks.get.mockReturnValue( elasticsearchClientMock.createSuccessTransportRequestPromise({ completed: true, - } as estypes.GetTaskResponse) + } as estypes.TaskGetResponse) ); client.search.mockReturnValue( elasticsearchClientMock.createSuccessTransportRequestPromise(searchResult(0) as any) diff --git a/src/core/server/saved_objects/migrations/core/migration_context.test.ts b/src/core/server/saved_objects/migrations/core/migration_context.test.ts index 5f2e8a37ec4279..240b41266abb66 100644 --- a/src/core/server/saved_objects/migrations/core/migration_context.test.ts +++ b/src/core/server/saved_objects/migrations/core/migration_context.test.ts @@ -31,7 +31,7 @@ describe('disableUnknownTypeMappingFields', () => { }, }, }, - }; + } as const; const activeMappings = { _meta: { migrationMappingPropertyHashes: { @@ -46,7 +46,7 @@ describe('disableUnknownTypeMappingFields', () => { }, }, }, - }; + } as const; const targetMappings = disableUnknownTypeMappingFields(activeMappings, sourceMappings); it('disables complex field mappings from unknown types in the source mappings', () => { diff --git a/src/core/server/saved_objects/migrations/kibana/kibana_migrator.test.ts b/src/core/server/saved_objects/migrations/kibana/kibana_migrator.test.ts index 37cea5d2de3d2c..d0cc52f2dd9bd1 100644 --- a/src/core/server/saved_objects/migrations/kibana/kibana_migrator.test.ts +++ b/src/core/server/saved_objects/migrations/kibana/kibana_migrator.test.ts @@ -320,7 +320,11 @@ const mockV2MigrationOptions = () => { ) ); options.client.indices.addBlock.mockReturnValue( - elasticsearchClientMock.createSuccessTransportRequestPromise({ acknowledged: true }) + elasticsearchClientMock.createSuccessTransportRequestPromise({ + acknowledged: true, + shards_acknowledged: true, + indices: [], + }) ); options.client.reindex.mockReturnValue( elasticsearchClientMock.createSuccessTransportRequestPromise({ @@ -333,7 +337,7 @@ const mockV2MigrationOptions = () => { error: undefined, failures: [], task: { description: 'task description' } as any, - } as estypes.GetTaskResponse) + } as estypes.TaskGetResponse) ); options.client.search = jest diff --git a/src/core/server/saved_objects/migrationsv2/actions/create_index.ts b/src/core/server/saved_objects/migrationsv2/actions/create_index.ts index 47ee44e762db79..8e5042a5ff8fe0 100644 --- a/src/core/server/saved_objects/migrationsv2/actions/create_index.ts +++ b/src/core/server/saved_objects/migrationsv2/actions/create_index.ts @@ -24,8 +24,8 @@ import { } from './constants'; import { waitForIndexStatusYellow } from './wait_for_index_status_yellow'; -function aliasArrayToRecord(aliases: string[]): Record { - const result: Record = {}; +function aliasArrayToRecord(aliases: string[]): Record { + const result: Record = {}; for (const alias of aliases) { result[alias] = {}; } diff --git a/src/core/server/saved_objects/migrationsv2/actions/integration_tests/actions.test.ts b/src/core/server/saved_objects/migrationsv2/actions/integration_tests/actions.test.ts index b508a6198bfb34..3fa4d59e383bfa 100644 --- a/src/core/server/saved_objects/migrationsv2/actions/integration_tests/actions.test.ts +++ b/src/core/server/saved_objects/migrationsv2/actions/integration_tests/actions.test.ts @@ -242,9 +242,7 @@ describe('migration actions', () => { it('rejects if there is a non-retryable error', async () => { expect.assertions(1); const task = removeWriteBlock({ client, index: 'no_such_index' }); - await expect(task()).rejects.toMatchInlineSnapshot( - `[ResponseError: index_not_found_exception]` - ); + await expect(task()).rejects.toThrow('index_not_found_exception'); }); }); @@ -264,7 +262,7 @@ describe('migration actions', () => { // Allocate 1 replica so that this index stays yellow number_of_replicas: '1', // Disable all shard allocation so that the index status is red - index: { routing: { allocation: { enable: 'none' } } }, + routing: { allocation: { enable: 'none' } }, }, }, }, @@ -284,7 +282,7 @@ describe('migration actions', () => { index: 'red_then_yellow_index', body: { // Enable all shard allocation so that the index status turns yellow - index: { routing: { allocation: { enable: 'all' } } }, + settings: { routing: { allocation: { enable: 'all' } } }, }, }); @@ -354,7 +352,7 @@ describe('migration actions', () => { index: 'clone_red_then_yellow_index', body: { // Enable all shard allocation so that the index status goes yellow - index: { routing: { allocation: { enable: 'all' } } }, + settings: { routing: { allocation: { enable: 'all' } } }, }, }); indexYellow = true; @@ -859,9 +857,7 @@ describe('migration actions', () => { sourceIndex: 'no_such_index', targetIndex: 'existing_index_2', }); - await expect(task()).rejects.toMatchInlineSnapshot( - `[ResponseError: index_not_found_exception]` - ); + await expect(task()).rejects.toThrow('index_not_found_exception'); task = verifyReindex({ client, @@ -1142,10 +1138,7 @@ describe('migration actions', () => { timeout: '10s', }); - await expect(task()).rejects.toMatchInlineSnapshot(` - [Error: pickupUpdatedMappings task failed with the following error: - {"type":"index_not_found_exception","reason":"no such index [no_such_index]","resource.type":"index_or_alias","resource.id":"no_such_index","index_uuid":"_na_","index":"no_such_index"}] - `); + await expect(task()).rejects.toThrow('index_not_found_exception'); }); it('resolves left wait_for_task_completion_timeout when the task does not complete within the timeout', async () => { const res = (await pickupUpdatedMappings( @@ -1433,7 +1426,7 @@ describe('migration actions', () => { index: 'red_then_yellow_index', body: { // Disable all shard allocation so that the index status is red - index: { routing: { allocation: { enable: 'all' } } }, + settings: { routing: { allocation: { enable: 'all' } } }, }, }); indexYellow = true; @@ -1455,7 +1448,7 @@ describe('migration actions', () => { // failure await expect( createIndex({ client, indexName: 'existing_index_2_alias', mappings: undefined as any })() - ).rejects.toMatchInlineSnapshot(`[ResponseError: invalid_index_name_exception]`); + ).rejects.toThrow('invalid_index_name_exception'); }); }); diff --git a/src/core/server/saved_objects/migrationsv2/actions/read_with_pit.ts b/src/core/server/saved_objects/migrationsv2/actions/read_with_pit.ts index 16f1df05f26b3e..b101e7db0141ca 100644 --- a/src/core/server/saved_objects/migrationsv2/actions/read_with_pit.ts +++ b/src/core/server/saved_objects/migrationsv2/actions/read_with_pit.ts @@ -28,7 +28,7 @@ export interface ReadWithPit { export interface ReadWithPitParams { client: ElasticsearchClient; pitId: string; - query: estypes.QueryContainer; + query: estypes.QueryDslQueryContainer; batchSize: number; searchAfter?: number[]; seqNoPrimaryTerm?: boolean; diff --git a/src/core/server/saved_objects/migrationsv2/actions/reindex.ts b/src/core/server/saved_objects/migrationsv2/actions/reindex.ts index ca8d3b594703c3..e9cfb4b61dace5 100644 --- a/src/core/server/saved_objects/migrationsv2/actions/reindex.ts +++ b/src/core/server/saved_objects/migrationsv2/actions/reindex.ts @@ -32,7 +32,7 @@ export interface ReindexParams { * are no longer used. These saved objects will still be kept in the outdated * index for backup purposes, but won't be available in the upgraded index. */ - unusedTypesQuery: estypes.QueryContainer; + unusedTypesQuery: estypes.QueryDslQueryContainer; } /** * Reindex documents from the `sourceIndex` into the `targetIndex`. Returns a diff --git a/src/core/server/saved_objects/migrationsv2/actions/remove_write_block.ts b/src/core/server/saved_objects/migrationsv2/actions/remove_write_block.ts index c55e4a235fbf10..b5bf64d5c29f75 100644 --- a/src/core/server/saved_objects/migrationsv2/actions/remove_write_block.ts +++ b/src/core/server/saved_objects/migrationsv2/actions/remove_write_block.ts @@ -39,7 +39,7 @@ export const removeWriteBlock = ({ // Don't change any existing settings preserve_existing: true, body: { - index: { + settings: { blocks: { write: false, }, diff --git a/src/core/server/saved_objects/migrationsv2/actions/search_for_outdated_documents.ts b/src/core/server/saved_objects/migrationsv2/actions/search_for_outdated_documents.ts index 7406cd35b1593e..c27170a78245b2 100644 --- a/src/core/server/saved_objects/migrationsv2/actions/search_for_outdated_documents.ts +++ b/src/core/server/saved_objects/migrationsv2/actions/search_for_outdated_documents.ts @@ -24,7 +24,7 @@ export interface SearchResponse { export interface SearchForOutdatedDocumentsOptions { batchSize: number; targetIndex: string; - outdatedDocumentsQuery?: estypes.QueryContainer; + outdatedDocumentsQuery?: estypes.QueryDslQueryContainer; } /** diff --git a/src/core/server/saved_objects/migrationsv2/actions/wait_for_reindex_task.ts b/src/core/server/saved_objects/migrationsv2/actions/wait_for_reindex_task.ts index fcadb5e80298a7..18cf3350292b5c 100644 --- a/src/core/server/saved_objects/migrationsv2/actions/wait_for_reindex_task.ts +++ b/src/core/server/saved_objects/migrationsv2/actions/wait_for_reindex_task.ts @@ -42,7 +42,7 @@ export const waitForReindexTask = flow( if (res.error.value.type === 'index_not_found_exception') { return TaskEither.left({ type: 'index_not_found_exception' as const, - index: res.error.value.index, + index: res.error.value.index!, }); } else { throw new Error('Reindex failed with the following error:\n' + JSON.stringify(res.error)); diff --git a/src/core/server/saved_objects/migrationsv2/actions/wait_for_task.ts b/src/core/server/saved_objects/migrationsv2/actions/wait_for_task.ts index 4e3631797e34bc..0cdaa88c535ab7 100644 --- a/src/core/server/saved_objects/migrationsv2/actions/wait_for_task.ts +++ b/src/core/server/saved_objects/migrationsv2/actions/wait_for_task.ts @@ -16,7 +16,7 @@ import { } from './catch_retryable_es_client_errors'; /** @internal */ export interface WaitForTaskResponse { - error: Option.Option<{ type: string; reason: string; index: string }>; + error: Option.Option<{ type: string; reason: string; index?: string }>; completed: boolean; failures: Option.Option; description?: string; @@ -84,7 +84,6 @@ export const waitForTask = ({ const failures = body.response?.failures ?? []; return Either.right({ completed: body.completed, - // @ts-expect-error @elastic/elasticsearch GetTaskResponse doesn't declare `error` property error: Option.fromNullable(body.error), failures: failures.length > 0 ? Option.some(failures) : Option.none, description: body.task.description, diff --git a/src/core/server/saved_objects/migrationsv2/integration_tests/archives/7.13.0_so_with_multiple_namespaces.zip b/src/core/server/saved_objects/migrationsv2/integration_tests/archives/7.13.0_so_with_multiple_namespaces.zip deleted file mode 100644 index a92211c16c5593..00000000000000 Binary files a/src/core/server/saved_objects/migrationsv2/integration_tests/archives/7.13.0_so_with_multiple_namespaces.zip and /dev/null differ diff --git a/src/core/server/saved_objects/migrationsv2/integration_tests/archives/7.13.0_with_corrupted_so.zip b/src/core/server/saved_objects/migrationsv2/integration_tests/archives/7.13.0_with_corrupted_so.zip index c6c89ac2879b2e..44f2fc9ba19eb5 100644 Binary files a/src/core/server/saved_objects/migrationsv2/integration_tests/archives/7.13.0_with_corrupted_so.zip and b/src/core/server/saved_objects/migrationsv2/integration_tests/archives/7.13.0_with_corrupted_so.zip differ diff --git a/src/core/server/saved_objects/migrationsv2/integration_tests/archives/7.13.2_so_with_multiple_namespaces.zip b/src/core/server/saved_objects/migrationsv2/integration_tests/archives/7.13.2_so_with_multiple_namespaces.zip new file mode 100644 index 00000000000000..e4dce85f15e38e Binary files /dev/null and b/src/core/server/saved_objects/migrationsv2/integration_tests/archives/7.13.2_so_with_multiple_namespaces.zip differ diff --git a/src/core/server/saved_objects/migrationsv2/integration_tests/cleanup.test.ts b/src/core/server/saved_objects/migrationsv2/integration_tests/cleanup.test.ts index 91d86353b48fac..83d97555a47987 100644 --- a/src/core/server/saved_objects/migrationsv2/integration_tests/cleanup.test.ts +++ b/src/core/server/saved_objects/migrationsv2/integration_tests/cleanup.test.ts @@ -53,8 +53,7 @@ function createRoot() { ); } -// FAILING: https://github.com/elastic/kibana/issues/98352 -describe.skip('migration v2', () => { +describe('migration v2', () => { let esServer: kbnTestServer.TestElasticsearchUtils; let root: Root; @@ -78,7 +77,7 @@ describe.skip('migration v2', () => { adjustTimeout: (t: number) => jest.setTimeout(t), settings: { es: { - license: 'trial', + license: 'basic', // original SO: // { // _index: '.kibana_7.13.0_001', diff --git a/src/core/server/saved_objects/migrationsv2/integration_tests/migration.test.ts b/src/core/server/saved_objects/migrationsv2/integration_tests/migration.test.ts index 5e4b8feefbd958..f9d8e7cc4fbaab 100644 --- a/src/core/server/saved_objects/migrationsv2/integration_tests/migration.test.ts +++ b/src/core/server/saved_objects/migrationsv2/integration_tests/migration.test.ts @@ -157,7 +157,10 @@ describe('migration v2', () => { const response = body[migratedIndex]; expect(response).toBeDefined(); - expect(Object.keys(response.aliases).sort()).toEqual(['.kibana', `.kibana_${kibanaVersion}`]); + expect(Object.keys(response.aliases!).sort()).toEqual([ + '.kibana', + `.kibana_${kibanaVersion}`, + ]); }); it('copies all the document of the previous index to the new one', async () => { @@ -216,7 +219,10 @@ describe('migration v2', () => { const response = body[migratedIndex]; expect(response).toBeDefined(); - expect(Object.keys(response.aliases).sort()).toEqual(['.kibana', `.kibana_${kibanaVersion}`]); + expect(Object.keys(response.aliases!).sort()).toEqual([ + '.kibana', + `.kibana_${kibanaVersion}`, + ]); }); it('copies all the document of the previous index to the new one', async () => { diff --git a/src/core/server/saved_objects/migrationsv2/integration_tests/rewriting_id.test.ts b/src/core/server/saved_objects/migrationsv2/integration_tests/rewriting_id.test.ts index 0f4085f6186be4..759a9572d733b2 100644 --- a/src/core/server/saved_objects/migrationsv2/integration_tests/rewriting_id.test.ts +++ b/src/core/server/saved_objects/migrationsv2/integration_tests/rewriting_id.test.ts @@ -89,7 +89,7 @@ function createRoot() { } // FAILING: https://github.com/elastic/kibana/issues/98351 -describe.skip('migration v2', () => { +describe('migration v2', () => { let esServer: kbnTestServer.TestElasticsearchUtils; let root: Root; @@ -114,7 +114,7 @@ describe.skip('migration v2', () => { adjustTimeout: (t: number) => jest.setTimeout(t), settings: { es: { - license: 'trial', + license: 'basic', // original SO: // [ // { id: 'foo:1', type: 'foo', foo: { name: 'Foo 1 default' } }, @@ -133,7 +133,7 @@ describe.skip('migration v2', () => { // namespace: 'spacex', // }, // ]; - dataArchive: Path.join(__dirname, 'archives', '7.13.0_so_with_multiple_namespaces.zip'), + dataArchive: Path.join(__dirname, 'archives', '7.13.2_so_with_multiple_namespaces.zip'), }, }, }); diff --git a/src/core/server/saved_objects/migrationsv2/model.test.ts b/src/core/server/saved_objects/migrationsv2/model.test.ts index 186cb24b4a34a8..86dc590aabdad8 100644 --- a/src/core/server/saved_objects/migrationsv2/model.test.ts +++ b/src/core/server/saved_objects/migrationsv2/model.test.ts @@ -244,7 +244,7 @@ describe('migrations v2 model', () => { disabled_saved_object_type: '7997cf5a56cc02bdc9c93361bde732b0', }, }, - }; + } as const; test('INIT -> OUTDATED_DOCUMENTS_SEARCH_OPEN_PIT if .kibana is already pointing to the target index', () => { const res: ResponseType<'INIT'> = Either.right({ @@ -683,7 +683,7 @@ describe('migrations v2 model', () => { disabled_saved_object_type: '7997cf5a56cc02bdc9c93361bde732b0', }, }, - }; + } as const; const waitForYellowSourceState: WaitForYellowSourceState = { ...baseState, diff --git a/src/core/server/saved_objects/migrationsv2/types.ts b/src/core/server/saved_objects/migrationsv2/types.ts index adcd2ad32fd24e..1151e8337d3d59 100644 --- a/src/core/server/saved_objects/migrationsv2/types.ts +++ b/src/core/server/saved_objects/migrationsv2/types.ts @@ -53,7 +53,7 @@ export interface BaseState extends ControlState { readonly tempIndexMappings: IndexMapping; /** Script to apply to a legacy index before it can be used as a migration source */ readonly preMigrationScript: Option.Option; - readonly outdatedDocumentsQuery: estypes.QueryContainer; + readonly outdatedDocumentsQuery: estypes.QueryDslQueryContainer; readonly retryCount: number; readonly retryDelay: number; /** @@ -112,7 +112,7 @@ export interface BaseState extends ControlState { * are no longer used. These saved objects will still be kept in the outdated * index for backup purposes, but won't be available in the upgraded index. */ - readonly unusedTypesQuery: estypes.QueryContainer; + readonly unusedTypesQuery: estypes.QueryDslQueryContainer; } export interface InitState extends BaseState { @@ -132,7 +132,7 @@ export interface PostInitState extends BaseState { /** The target index is the index to which the migration writes */ readonly targetIndex: string; readonly versionIndexReadyActions: Option.Option; - readonly outdatedDocumentsQuery: estypes.QueryContainer; + readonly outdatedDocumentsQuery: estypes.QueryDslQueryContainer; } export interface DoneState extends PostInitState { diff --git a/src/core/server/saved_objects/saved_objects_type_registry.ts b/src/core/server/saved_objects/saved_objects_type_registry.ts index a63837132b652e..ba5960c59239d7 100644 --- a/src/core/server/saved_objects/saved_objects_type_registry.ts +++ b/src/core/server/saved_objects/saved_objects_type_registry.ts @@ -33,7 +33,7 @@ export class SavedObjectTypeRegistry { throw new Error(`Type '${type.name}' is already registered`); } validateType(type); - this.types.set(type.name, deepFreeze(type)); + this.types.set(type.name, deepFreeze(type) as SavedObjectsType); } /** diff --git a/src/core/server/saved_objects/service/lib/aggregations/validation.test.ts b/src/core/server/saved_objects/service/lib/aggregations/validation.test.ts index 57421db76f5b6e..53f1b5c9d78c57 100644 --- a/src/core/server/saved_objects/service/lib/aggregations/validation.test.ts +++ b/src/core/server/saved_objects/service/lib/aggregations/validation.test.ts @@ -9,7 +9,7 @@ import type { estypes } from '@elastic/elasticsearch'; import { validateAndConvertAggregations } from './validation'; -type AggsMap = Record; +type AggsMap = Record; const mockMappings = { properties: { @@ -19,7 +19,9 @@ const mockMappings = { references: { type: 'nested', properties: { - id: 'keyword', + id: { + type: 'keyword', + }, }, }, foo: { @@ -31,7 +33,7 @@ const mockMappings = { type: 'text', }, bytes: { - type: 'number', + type: 'integer', }, }, }, @@ -73,7 +75,7 @@ const mockMappings = { }, }, }, -}; +} as const; describe('validateAndConvertAggregations', () => { it('validates a simple aggregations', () => { diff --git a/src/core/server/saved_objects/service/lib/aggregations/validation.ts b/src/core/server/saved_objects/service/lib/aggregations/validation.ts index cd41a23f4a28b5..5ef89f297a796b 100644 --- a/src/core/server/saved_objects/service/lib/aggregations/validation.ts +++ b/src/core/server/saved_objects/service/lib/aggregations/validation.ts @@ -37,9 +37,9 @@ interface ValidationContext { */ export const validateAndConvertAggregations = ( allowedTypes: string[], - aggs: Record, + aggs: Record, indexMapping: IndexMapping -): Record => { +): Record => { return validateAggregations(aggs, { allowedTypes, indexMapping, @@ -53,16 +53,15 @@ export const validateAndConvertAggregations = ( * Or a nested record of aggregation (`SearchRequest.body.aggs.myAggregation.aggs`) */ const validateAggregations = ( - aggregations: Record, + aggregations: Record, context: ValidationContext ) => { - return Object.entries(aggregations).reduce>( - (memo, [aggrName, aggrContainer]) => { - memo[aggrName] = validateAggregation(aggrContainer, childContext(context, aggrName)); - return memo; - }, - {} - ); + return Object.entries(aggregations).reduce< + Record + >((memo, [aggrName, aggrContainer]) => { + memo[aggrName] = validateAggregation(aggrContainer, childContext(context, aggrName)); + return memo; + }, {}); }; /** @@ -70,7 +69,7 @@ const validateAggregations = ( * from a nested aggregation record, including its potential nested aggregations. */ const validateAggregation = ( - aggregation: estypes.AggregationContainer, + aggregation: estypes.AggregationsAggregationContainer, context: ValidationContext ) => { const container = validateAggregationContainer(aggregation, context); @@ -93,10 +92,10 @@ const validateAggregation = ( * (ignoring its nested aggregations) */ const validateAggregationContainer = ( - container: estypes.AggregationContainer, + container: estypes.AggregationsAggregationContainer, context: ValidationContext ) => { - return Object.entries(container).reduce( + return Object.entries(container).reduce( (memo, [aggName, aggregation]) => { if (aggregationKeys.includes(aggName)) { return memo; diff --git a/src/core/server/saved_objects/service/lib/aggregations/validation_utils.test.ts b/src/core/server/saved_objects/service/lib/aggregations/validation_utils.test.ts index 25c3aea474ecec..0425e46b4477e6 100644 --- a/src/core/server/saved_objects/service/lib/aggregations/validation_utils.test.ts +++ b/src/core/server/saved_objects/service/lib/aggregations/validation_utils.test.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import { IndexMapping } from '../../../mappings'; import { isRootLevelAttribute, rewriteRootLevelAttribute, @@ -14,7 +13,7 @@ import { rewriteObjectTypeAttribute, } from './validation_utils'; -const mockMappings: IndexMapping = { +const mockMappings = { properties: { updated_at: { type: 'date', @@ -28,7 +27,7 @@ const mockMappings: IndexMapping = { type: 'text', }, bytes: { - type: 'number', + type: 'integer', }, }, }, @@ -70,7 +69,7 @@ const mockMappings: IndexMapping = { }, }, }, -}; +} as const; describe('isRootLevelAttribute', () => { it('returns true when referring to a path to a valid root level field', () => { diff --git a/src/core/server/saved_objects/service/lib/filter_utils.test.ts b/src/core/server/saved_objects/service/lib/filter_utils.test.ts index 2ef5219ccfff16..e6934398862dc0 100644 --- a/src/core/server/saved_objects/service/lib/filter_utils.test.ts +++ b/src/core/server/saved_objects/service/lib/filter_utils.test.ts @@ -31,7 +31,7 @@ const mockMappings = { type: 'text', }, bytes: { - type: 'number', + type: 'integer', }, }, }, @@ -90,7 +90,7 @@ const mockMappings = { }, }, }, -}; +} as const; describe('Filter Utils', () => { describe('#validateConvertFilterToKueryNode', () => { diff --git a/src/core/server/saved_objects/service/lib/repository.ts b/src/core/server/saved_objects/service/lib/repository.ts index c626a2b2acfb58..6b51bd57248a1d 100644 --- a/src/core/server/saved_objects/service/lib/repository.ts +++ b/src/core/server/saved_objects/service/lib/repository.ts @@ -672,7 +672,6 @@ export class SavedObjectsRepository { } const deleteDocNotFound = body.result === 'not_found'; - // @ts-expect-error 'error' does not exist on type 'DeleteResponse' const deleteIndexNotFound = body.error && body.error.type === 'index_not_found_exception'; if (deleteDocNotFound || deleteIndexNotFound) { // see "404s from missing index" above @@ -897,7 +896,7 @@ export class SavedObjectsRepository { per_page: perPage, total: body.hits.total, saved_objects: body.hits.hits.map( - (hit: estypes.Hit): SavedObjectsFindResult => ({ + (hit: estypes.SearchHit): SavedObjectsFindResult => ({ // @ts-expect-error @elastic/elasticsearch declared Id as string | number ...this._rawToSavedObject(hit), score: hit._score!, @@ -1835,13 +1834,9 @@ export class SavedObjectsRepository { ...(preference ? { preference } : {}), }; - const { body, statusCode } = await this.client.openPointInTime( - // @ts-expect-error @elastic/elasticsearch OpenPointInTimeRequest.index expected to accept string[] - esOptions, - { - ignore: [404], - } - ); + const { body, statusCode } = await this.client.openPointInTime(esOptions, { + ignore: [404], + }); if (statusCode === 404) { throw SavedObjectsErrorHelpers.createGenericNotFoundError(); } diff --git a/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts b/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts index 64b3dd428fb8bf..3196a59ca39ee4 100644 --- a/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts +++ b/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts @@ -26,7 +26,7 @@ interface GetSearchDslOptions { rootSearchFields?: string[]; searchAfter?: estypes.Id[]; sortField?: string; - sortOrder?: estypes.SortOrder; + sortOrder?: estypes.SearchSortOrder; namespaces?: string[]; pit?: SavedObjectsPitParams; typeToNamespacesMap?: Map; diff --git a/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.test.ts b/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.test.ts index 1376f0d50a9da6..e2a21cc03ce3be 100644 --- a/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.test.ts +++ b/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.test.ts @@ -50,7 +50,7 @@ const MAPPINGS = { }, }, }, -}; +} as const; describe('searchDsl/getSortParams', () => { describe('type, no sortField', () => { diff --git a/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts b/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts index 64849c308f3f09..592110a5413ec7 100644 --- a/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts +++ b/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts @@ -16,8 +16,8 @@ export function getSortingParams( mappings: IndexMapping, type: string | string[], sortField?: string, - sortOrder?: estypes.SortOrder -): { sort?: estypes.SortContainer[] } { + sortOrder?: estypes.SearchSortOrder +): { sort?: estypes.SearchSortContainer[] } { if (!sortField) { return {}; } diff --git a/src/core/server/saved_objects/service/lib/update_objects_spaces.ts b/src/core/server/saved_objects/service/lib/update_objects_spaces.ts index 079549265385cd..3131d0240f96b9 100644 --- a/src/core/server/saved_objects/service/lib/update_objects_spaces.ts +++ b/src/core/server/saved_objects/service/lib/update_objects_spaces.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import type { BulkOperationContainer, MultiGetOperation } from '@elastic/elasticsearch/api/types'; +import type { estypes } from '@elastic/elasticsearch'; import intersection from 'lodash/intersection'; import type { ISavedObjectTypeRegistry } from '../../saved_objects_type_registry'; @@ -173,7 +173,7 @@ export async function updateObjectsSpaces({ }; }); - const bulkGetDocs = expectedBulkGetResults.reduce((acc, x) => { + const bulkGetDocs = expectedBulkGetResults.reduce((acc, x) => { if (isRight(x) && x.value.esRequestIndex !== undefined) { acc.push({ _id: serializer.generateRawId(undefined, x.value.type, x.value.id), @@ -192,7 +192,7 @@ export async function updateObjectsSpaces({ const time = new Date().toISOString(); let bulkOperationRequestIndexCounter = 0; - const bulkOperationParams: BulkOperationContainer[] = []; + const bulkOperationParams: estypes.BulkOperationContainer[] = []; const expectedBulkOperationResults: Either[] = expectedBulkGetResults.map( (expectedBulkGetResult) => { if (isLeft(expectedBulkGetResult)) { diff --git a/src/core/server/saved_objects/types.ts b/src/core/server/saved_objects/types.ts index d3bfdcc6923dcf..964ba671b59646 100644 --- a/src/core/server/saved_objects/types.ts +++ b/src/core/server/saved_objects/types.ts @@ -80,7 +80,7 @@ export interface SavedObjectsFindOptions { page?: number; perPage?: number; sortField?: string; - sortOrder?: estypes.SortOrder; + sortOrder?: estypes.SearchSortOrder; /** * An array of fields to include in the results * @example @@ -137,7 +137,7 @@ export interface SavedObjectsFindOptions { * * @alpha */ - aggs?: Record; + aggs?: Record; namespaces?: string[]; /** * This map defines each type to search for, and the namespace(s) to search for the type in; this is only intended to be used by a saved diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md index 379e4147ae024c..ce13174ee19cc2 100644 --- a/src/core/server/server.api.md +++ b/src/core/server/server.api.md @@ -1917,11 +1917,16 @@ export interface PluginInitializerContext { export interface PluginManifest { // Warning: (ae-unresolved-link) The @link reference could not be resolved: Reexported declarations are not supported readonly configPath: ConfigPath; + readonly description?: string; // @deprecated readonly extraPublicDirs?: string[]; readonly id: PluginName; readonly kibanaVersion: string; readonly optionalPlugins: readonly PluginName[]; + readonly owner?: { + readonly name: string; + readonly githubTeam?: string; + }; readonly requiredBundles: readonly string[]; readonly requiredPlugins: readonly PluginName[]; readonly server: boolean; @@ -2361,38 +2366,6 @@ export interface SavedObjectsCollectMultiNamespaceReferencesResponse { objects: SavedObjectReferenceWithContext[]; } -// @public -export interface SavedObjectsComplexFieldMapping { - // (undocumented) - doc_values?: boolean; - dynamic?: false | 'strict'; - // (undocumented) - enabled?: boolean; - // (undocumented) - properties: SavedObjectsMappingProperties; - // (undocumented) - type?: string; -} - -// @public -export interface SavedObjectsCoreFieldMapping { - // (undocumented) - doc_values?: boolean; - // (undocumented) - fields?: { - [subfield: string]: { - type: string; - ignore_above?: number; - }; - }; - // (undocumented) - index?: boolean; - // (undocumented) - null_value?: number | boolean | string; - // (undocumented) - type: string; -} - // @public (undocumented) export interface SavedObjectsCreateOptions extends SavedObjectsBaseOptions { coreMigrationVersion?: string; @@ -2554,12 +2527,14 @@ export interface SavedObjectsExportTransformContext { } // @public -export type SavedObjectsFieldMapping = SavedObjectsCoreFieldMapping | SavedObjectsComplexFieldMapping; +export type SavedObjectsFieldMapping = estypes.MappingProperty & { + dynamic?: false | 'strict'; +}; // @public (undocumented) export interface SavedObjectsFindOptions { // @alpha - aggs?: Record; + aggs?: Record; defaultSearchOperator?: 'AND' | 'OR'; fields?: string[]; // Warning: (ae-forgotten-export) The symbol "KueryNode" needs to be exported by the entry point index.d.ts @@ -2583,7 +2558,7 @@ export interface SavedObjectsFindOptions { // (undocumented) sortField?: string; // (undocumented) - sortOrder?: estypes.SortOrder; + sortOrder?: estypes.SearchSortOrder; // (undocumented) type: string | string[]; typeToNamespacesMap?: Map; @@ -3290,9 +3265,9 @@ export const validBodyOutput: readonly ["data", "stream"]; // // src/core/server/elasticsearch/client/types.ts:94:7 - (ae-forgotten-export) The symbol "Explanation" needs to be exported by the entry point index.d.ts // src/core/server/http/router/response.ts:301:3 - (ae-forgotten-export) The symbol "KibanaResponse" needs to be exported by the entry point index.d.ts -// src/core/server/plugins/types.ts:326:3 - (ae-forgotten-export) The symbol "KibanaConfigType" needs to be exported by the entry point index.d.ts -// src/core/server/plugins/types.ts:326:3 - (ae-forgotten-export) The symbol "SharedGlobalConfigKeys" needs to be exported by the entry point index.d.ts -// src/core/server/plugins/types.ts:329:3 - (ae-forgotten-export) The symbol "SavedObjectsConfigType" needs to be exported by the entry point index.d.ts -// src/core/server/plugins/types.ts:434:5 - (ae-unresolved-link) The @link reference could not be resolved: The package "kibana" does not have an export "create" +// src/core/server/plugins/types.ts:347:3 - (ae-forgotten-export) The symbol "KibanaConfigType" needs to be exported by the entry point index.d.ts +// src/core/server/plugins/types.ts:347:3 - (ae-forgotten-export) The symbol "SharedGlobalConfigKeys" needs to be exported by the entry point index.d.ts +// src/core/server/plugins/types.ts:350:3 - (ae-forgotten-export) The symbol "SavedObjectsConfigType" needs to be exported by the entry point index.d.ts +// src/core/server/plugins/types.ts:455:5 - (ae-unresolved-link) The @link reference could not be resolved: The package "kibana" does not have an export "create" ``` diff --git a/src/dev/build/lib/version_info.ts b/src/dev/build/lib/version_info.ts index 6be34a54e24f8c..9ad20b4a6935bb 100644 --- a/src/dev/build/lib/version_info.ts +++ b/src/dev/build/lib/version_info.ts @@ -7,6 +7,9 @@ */ import execa from 'execa'; +import fs from 'fs'; +import { join } from 'path'; +import { REPO_ROOT } from '@kbn/utils'; import { getBuildNumber } from './get_build_number'; interface Options { @@ -27,11 +30,12 @@ export async function getVersionInfo({ isRelease, versionQualifier, pkg }: Optio isRelease ? '' : '-SNAPSHOT' ); + const buildSha = fs.existsSync(join(REPO_ROOT, '.git')) + ? (await execa('git', ['rev-parse', 'HEAD'], { cwd: REPO_ROOT })).stdout + : process.env.GIT_COMMIT || process.env.BUILDKITE_COMMIT || ''; + return { - buildSha: - process.env.GIT_COMMIT || - process.env.BUILDKITE_COMMIT || - (await execa('git', ['rev-parse', 'HEAD'])).stdout, + buildSha, buildVersion, buildNumber: await getBuildNumber(), }; diff --git a/src/plugins/advanced_settings/public/management_app/advanced_settings.tsx b/src/plugins/advanced_settings/public/management_app/advanced_settings.tsx index c7a8c0a6135c7a..1391312df5231a 100644 --- a/src/plugins/advanced_settings/public/management_app/advanced_settings.tsx +++ b/src/plugins/advanced_settings/public/management_app/advanced_settings.tsx @@ -269,6 +269,7 @@ export class AdvancedSettings extends Component
- - - - + + - +

General

-
- - - - - - - , - "settingsCount": -1, - } + + + + + + + + + , + "settingsCount": -1, } - /> - - -
-
- + } + /> + + + + + <_EuiSplitPanelInner> -
-
+ + - - - - + + - +

Dashboard

-
-
-
- + + + + + <_EuiSplitPanelInner> -
-
+ + - - - - + + - +

X-pack

-
- - - - - - - , - "settingsCount": 9, - } + + + + + + + + + , + "settingsCount": 9, } - /> - - -
-
- + } + /> + + + + + <_EuiSplitPanelInner> -
-
+ + @@ -269,52 +272,53 @@ exports[`Form should not render no settings message when instructed not to 1`] = exports[`Form should render no settings message when there are no settings 1`] = `
- - - - + + - +

General

-
- - - - - - - , - "settingsCount": -1, - } + + + + + + + + + , + "settingsCount": -1, } - /> - - -
-
- + } + /> + + + + + <_EuiSplitPanelInner> -
-
+ + - - - - + + - +

Dashboard

-
-
-
- + + + + + <_EuiSplitPanelInner> -
-
+ + - - - - + + - +

X-pack

-
- - - - - - - , - "settingsCount": 9, - } + + + + + + + + + , + "settingsCount": 9, } - /> - - -
-
- + } + /> + + + + + <_EuiSplitPanelInner> -
-
+ + @@ -535,52 +541,53 @@ exports[`Form should render no settings message when there are no settings 1`] = exports[`Form should render normally 1`] = `
- - - - + + - +

General

-
- - - - - - - , - "settingsCount": -1, - } + + + + + + + + + , + "settingsCount": -1, } - /> - - -
-
- + } + /> + + + + + <_EuiSplitPanelInner> -
-
+ + - - - - + + - +

Dashboard

-
-
-
- + + + + + <_EuiSplitPanelInner> -
-
+ + - - - - + + - +

X-pack

-
- - - - - - - , - "settingsCount": 9, - } + + + + + + + + + , + "settingsCount": 9, } - /> - - -
-
- + } + /> + + + + + <_EuiSplitPanelInner> -
-
+ + @@ -801,52 +810,53 @@ exports[`Form should render normally 1`] = ` exports[`Form should render read-only when saving is disabled 1`] = `
- - - - + + - +

General

-
- - - - - - - , - "settingsCount": -1, - } + + + + + + + + + , + "settingsCount": -1, } - /> - - -
-
- + } + /> + + + + + <_EuiSplitPanelInner> -
-
+ + - - - - + + - +

Dashboard

-
-
-
- + + + + + <_EuiSplitPanelInner> -
-
+ + - - - - + + - +

X-pack

-
- - - - - - - , - "settingsCount": 9, - } + + + + + + + + + , + "settingsCount": 9, } - /> - - -
-
- + } + /> + + + + + <_EuiSplitPanelInner> -
-
+ + diff --git a/src/plugins/advanced_settings/public/management_app/components/form/form.tsx b/src/plugins/advanced_settings/public/management_app/components/form/form.tsx index d953bb8f6a6f61..0b08a317e87c9f 100644 --- a/src/plugins/advanced_settings/public/management_app/components/form/form.tsx +++ b/src/plugins/advanced_settings/public/management_app/components/form/form.tsx @@ -11,16 +11,16 @@ import React, { PureComponent, Fragment } from 'react'; import { EuiFlexGroup, EuiFlexItem, - EuiForm, + EuiSplitPanel, EuiLink, - EuiPanel, + EuiCallOut, EuiSpacer, - EuiText, EuiTextColor, EuiBottomBar, EuiButton, EuiToolTip, EuiButtonEmpty, + EuiTitle, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { isEmpty } from 'lodash'; @@ -47,6 +47,7 @@ interface FormProps { dockLinks: DocLinksStart['links']; toasts: ToastsStart; trackUiMetric?: (metricType: UiCounterMetricType, eventName: string | string[]) => void; + queryText?: string; } interface FormState { @@ -241,17 +242,18 @@ export class Form extends PureComponent { renderCategory(category: Category, settings: FieldSetting[], totalSettings: number) { return ( - - - - - + + + + +

{getCategoryName(category)}

-
- {this.renderClearQueryLink(totalSettings, settings.length)} -
-
- + + + {this.renderClearQueryLink(totalSettings, settings.length)} + + + {settings.map((setting) => { return ( { /> ); })} -
-
+ +
); @@ -276,22 +278,28 @@ export class Form extends PureComponent { maybeRenderNoSettings(clearQuery: FormProps['clearQuery']) { if (this.props.showNoResultsMessage) { return ( - - - - - ), - }} - /> - + + + + + ), + queryText: {this.props.queryText}, + }} + /> + + } + /> ); } return null; diff --git a/src/plugins/bfetch/kibana.json b/src/plugins/bfetch/kibana.json index 9f9f2176af671f..6d37d68ffd584f 100644 --- a/src/plugins/bfetch/kibana.json +++ b/src/plugins/bfetch/kibana.json @@ -3,5 +3,10 @@ "version": "kibana", "server": true, "ui": true, - "requiredBundles": ["kibanaUtils"] + "requiredBundles": ["kibanaUtils"], + "owner": { + "name": "App Services", + "githubTeam": "kibana-app-services" + }, + "description": "Considering using bfetch capabilities when fetching large amounts of data. This services supports batching HTTP requests and streaming responses back." } diff --git a/src/plugins/dashboard/public/application/actions/expand_panel_action.tsx b/src/plugins/dashboard/public/application/actions/expand_panel_action.tsx index f90a0cef95bb8f..98f7bbbee3d7cd 100644 --- a/src/plugins/dashboard/public/application/actions/expand_panel_action.tsx +++ b/src/plugins/dashboard/public/application/actions/expand_panel_action.tsx @@ -6,14 +6,11 @@ * Side Public License, v 1. */ -import { dashboardExpandPanelAction } from '../../dashboard_strings'; +import { DashboardContainerInput } from '../..'; import { IEmbeddable } from '../../services/embeddable'; +import { dashboardExpandPanelAction } from '../../dashboard_strings'; import { Action, IncompatibleActionError } from '../../services/ui_actions'; -import { - DASHBOARD_CONTAINER_TYPE, - DashboardContainer, - DashboardContainerInput, -} from '../embeddable'; +import { DASHBOARD_CONTAINER_TYPE, DashboardContainer } from '../embeddable'; export const ACTION_EXPAND_PANEL = 'togglePanel'; diff --git a/src/plugins/dashboard/public/application/dashboard_app.tsx b/src/plugins/dashboard/public/application/dashboard_app.tsx index 93310bb8213615..8db6a0e8a8c7fd 100644 --- a/src/plugins/dashboard/public/application/dashboard_app.tsx +++ b/src/plugins/dashboard/public/application/dashboard_app.tsx @@ -7,35 +7,20 @@ */ import { History } from 'history'; -import { merge, Subject, Subscription } from 'rxjs'; -import React, { useCallback, useEffect, useMemo, useState } from 'react'; +import React, { useEffect, useMemo } from 'react'; -import { debounceTime, finalize, switchMap, tap } from 'rxjs/operators'; +import { useDashboardSelector } from './state'; +import { useDashboardAppState } from './hooks'; import { useKibana } from '../../../kibana_react/public'; -import { DashboardConstants } from '../dashboard_constants'; -import { DashboardTopNav } from './top_nav/dashboard_top_nav'; -import { DashboardAppServices, DashboardEmbedSettings, DashboardRedirect } from './types'; import { - getChangesFromAppStateForContainerState, - getDashboardContainerInput, - getFiltersSubscription, - getInputSubscription, - getOutputSubscription, - getSearchSessionIdFromURL, -} from './dashboard_app_functions'; -import { - useDashboardBreadcrumbs, - useDashboardContainer, - useDashboardStateManager, - useSavedDashboard, -} from './hooks'; - -import { IndexPattern, waitUntilNextSessionCompletes$ } from '../services/data'; + getDashboardBreadcrumb, + getDashboardTitle, + leaveConfirmStrings, +} from '../dashboard_strings'; import { EmbeddableRenderer } from '../services/embeddable'; -import { DashboardContainerInput } from '.'; -import { leaveConfirmStrings } from '../dashboard_strings'; -import { createQueryParamObservable, replaceUrlHashQuery } from '../../../kibana_utils/public'; - +import { DashboardTopNav, isCompleteDashboardAppState } from './top_nav/dashboard_top_nav'; +import { DashboardAppServices, DashboardEmbedSettings, DashboardRedirect } from '../types'; +import { createKbnUrlStateStorage, withNotifyOnErrors } from '../services/kibana_utils'; export interface DashboardAppProps { history: History; savedDashboardId?: string; @@ -50,236 +35,37 @@ export function DashboardApp({ history, }: DashboardAppProps) { const { - data, core, + chrome, + embeddable, onAppLeave, uiSettings, - embeddable, - dashboardCapabilities, - indexPatterns: indexPatternService, } = useKibana().services; - const triggerRefresh$ = useMemo(() => new Subject<{ force?: boolean }>(), []); - const [indexPatterns, setIndexPatterns] = useState([]); - - const savedDashboard = useSavedDashboard(savedDashboardId, history); - - const getIncomingEmbeddable = useCallback( - (removeAfterFetch?: boolean) => { - return embeddable - .getStateTransfer() - .getIncomingEmbeddablePackage(DashboardConstants.DASHBOARDS_ID, removeAfterFetch); - }, - [embeddable] + const kbnUrlStateStorage = useMemo( + () => + createKbnUrlStateStorage({ + history, + useHash: uiSettings.get('state:storeInSessionStorage'), + ...withNotifyOnErrors(core.notifications.toasts), + }), + [core.notifications.toasts, history, uiSettings] ); - const { dashboardStateManager, viewMode, setViewMode } = useDashboardStateManager( - savedDashboard, - history, - getIncomingEmbeddable - ); - const [unsavedChanges, setUnsavedChanges] = useState(false); - const dashboardContainer = useDashboardContainer({ - timeFilter: data.query.timefilter.timefilter, - dashboardStateManager, - getIncomingEmbeddable, - setUnsavedChanges, + const dashboardState = useDashboardSelector((state) => state.dashboardStateReducer); + const dashboardAppState = useDashboardAppState({ history, + redirectTo, + savedDashboardId, + kbnUrlStateStorage, + isEmbeddedExternally: Boolean(embedSettings), }); - const searchSessionIdQuery$ = useMemo( - () => createQueryParamObservable(history, DashboardConstants.SEARCH_SESSION_ID), - [history] - ); - - const refreshDashboardContainer = useCallback( - (force?: boolean) => { - if (!dashboardContainer || !dashboardStateManager) { - return; - } - - const changes = getChangesFromAppStateForContainerState({ - dashboardContainer, - appStateDashboardInput: getDashboardContainerInput({ - isEmbeddedExternally: Boolean(embedSettings), - dashboardStateManager, - lastReloadRequestTime: force ? Date.now() : undefined, - dashboardCapabilities, - query: data.query, - }), - }); - - if (changes) { - // state keys change in which likely won't need a data fetch - const noRefetchKeys: Array = [ - 'viewMode', - 'title', - 'description', - 'expandedPanelId', - 'useMargins', - 'isEmbeddedExternally', - 'isFullScreenMode', - ]; - const shouldRefetch = Object.keys(changes).some( - (changeKey) => !noRefetchKeys.includes(changeKey as keyof DashboardContainerInput) - ); - - const newSearchSessionId: string | undefined = (() => { - // do not update session id if this is irrelevant state change to prevent excessive searches - if (!shouldRefetch) return; - - let searchSessionIdFromURL = getSearchSessionIdFromURL(history); - if (searchSessionIdFromURL) { - if ( - data.search.session.isRestore() && - data.search.session.isCurrentSession(searchSessionIdFromURL) - ) { - // navigating away from a restored session - dashboardStateManager.kbnUrlStateStorage.kbnUrlControls.updateAsync((nextUrl) => { - if (nextUrl.includes(DashboardConstants.SEARCH_SESSION_ID)) { - return replaceUrlHashQuery(nextUrl, (query) => { - delete query[DashboardConstants.SEARCH_SESSION_ID]; - return query; - }); - } - return nextUrl; - }); - searchSessionIdFromURL = undefined; - } else { - data.search.session.restore(searchSessionIdFromURL); - } - } - - return searchSessionIdFromURL ?? data.search.session.start(); - })(); - - if (changes.viewMode) { - setViewMode(changes.viewMode); - } - dashboardContainer.updateInput({ - ...changes, - ...(newSearchSessionId && { searchSessionId: newSearchSessionId }), - }); - } - }, - [ - history, - data.query, - setViewMode, - embedSettings, - dashboardContainer, - data.search.session, - dashboardCapabilities, - dashboardStateManager, - ] - ); - - // Manage dashboard container subscriptions - useEffect(() => { - if (!dashboardStateManager || !dashboardContainer) { - return; - } - const timeFilter = data.query.timefilter.timefilter; - const subscriptions = new Subscription(); - - subscriptions.add( - getInputSubscription({ - dashboardContainer, - dashboardStateManager, - filterManager: data.query.filterManager, - }) - ); - subscriptions.add( - getOutputSubscription({ - dashboardContainer, - indexPatterns: indexPatternService, - onUpdateIndexPatterns: (newIndexPatterns) => setIndexPatterns(newIndexPatterns), - }) - ); - subscriptions.add( - getFiltersSubscription({ - query: data.query, - dashboardStateManager, - }) - ); - subscriptions.add( - merge( - ...[timeFilter.getRefreshIntervalUpdate$(), timeFilter.getTimeUpdate$()] - ).subscribe(() => triggerRefresh$.next()) - ); - - subscriptions.add( - searchSessionIdQuery$.subscribe(() => { - triggerRefresh$.next({ force: true }); - }) - ); - - subscriptions.add( - data.query.timefilter.timefilter - .getAutoRefreshFetch$() - .pipe( - tap(() => { - triggerRefresh$.next({ force: true }); - }), - switchMap((done) => - // best way on a dashboard to estimate that panels are updated is to rely on search session service state - waitUntilNextSessionCompletes$(data.search.session).pipe(finalize(done)) - ) - ) - .subscribe() - ); - - dashboardStateManager.registerChangeListener(() => { - setUnsavedChanges(dashboardStateManager.getIsDirty(data.query.timefilter.timefilter)); - // we aren't checking dirty state because there are changes the container needs to know about - // that won't make the dashboard "dirty" - like a view mode change. - triggerRefresh$.next(); - }); - - // debounce `refreshDashboardContainer()` - // use `forceRefresh=true` in case at least one debounced trigger asked for it - let forceRefresh: boolean = false; - subscriptions.add( - triggerRefresh$ - .pipe( - tap((trigger) => { - forceRefresh = forceRefresh || (trigger?.force ?? false); - }), - debounceTime(50) - ) - .subscribe(() => { - refreshDashboardContainer(forceRefresh); - forceRefresh = false; - }) - ); - - return () => { - subscriptions.unsubscribe(); - }; - }, [ - core.http, - uiSettings, - data.query, - dashboardContainer, - data.search.session, - indexPatternService, - dashboardStateManager, - searchSessionIdQuery$, - triggerRefresh$, - refreshDashboardContainer, - ]); - - // Sync breadcrumbs when Dashboard State Manager changes - useDashboardBreadcrumbs(dashboardStateManager, redirectTo); - - // Build onAppLeave when Dashboard State Manager changes + // Build app leave handler whenever hasUnsavedChanges changes useEffect(() => { - if (!dashboardStateManager || !dashboardContainer) { - return; - } onAppLeave((actions) => { if ( - dashboardStateManager?.getIsDirty() && + dashboardAppState.hasUnsavedChanges && !embeddable.getStateTransfer().isTransferInProgress ) { return actions.confirm( @@ -293,37 +79,36 @@ export function DashboardApp({ // reset on app leave handler so leaving from the listing page doesn't trigger a confirmation onAppLeave((actions) => actions.default()); }; - }, [dashboardStateManager, dashboardContainer, onAppLeave, embeddable]); + }, [onAppLeave, embeddable, dashboardAppState.hasUnsavedChanges]); + + // Set breadcrumbs when dashboard's title or view mode changes + useEffect(() => { + if (!dashboardState.title && savedDashboardId) return; + chrome.setBreadcrumbs([ + { + text: getDashboardBreadcrumb(), + 'data-test-subj': 'dashboardListingBreadcrumb', + onClick: () => { + redirectTo({ destination: 'listing' }); + }, + }, + { + text: getDashboardTitle(dashboardState.title, dashboardState.viewMode, !savedDashboardId), + }, + ]); + }, [chrome, dashboardState.title, dashboardState.viewMode, redirectTo, savedDashboardId]); return ( <> - {savedDashboard && dashboardStateManager && dashboardContainer && viewMode && ( + {isCompleteDashboardAppState(dashboardAppState) && ( <> setUnsavedChanges(false)} - timefilter={data.query.timefilter.timefilter} - onQuerySubmit={(_payload, isUpdate) => { - if (isUpdate === false) { - // The user can still request a reload in the query bar, even if the - // query is the same, and in that case, we have to explicitly ask for - // a reload, since no state changes will cause it. - triggerRefresh$.next({ force: true }); - } - }} + redirectTo={redirectTo} + embedSettings={embedSettings} + dashboardAppState={dashboardAppState} />
- +
)} diff --git a/src/plugins/dashboard/public/application/dashboard_app_functions.ts b/src/plugins/dashboard/public/application/dashboard_app_functions.ts deleted file mode 100644 index 895a56242bf96e..00000000000000 --- a/src/plugins/dashboard/public/application/dashboard_app_functions.ts +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { History } from 'history'; - -import _, { uniqBy } from 'lodash'; -import deepEqual from 'fast-deep-equal'; -import { merge, Observable, pipe } from 'rxjs'; -import { - debounceTime, - distinctUntilChanged, - filter, - map, - mapTo, - startWith, - switchMap, -} from 'rxjs/operators'; - -import { DashboardAppCapabilities } from './types'; -import { DashboardConstants } from '../dashboard_constants'; -import { DashboardStateManager } from './dashboard_state_manager'; -import { convertSavedDashboardPanelToPanelState } from '../../common/embeddable/embeddable_saved_object_converters'; -import { - DashboardPanelState, - DashboardContainer, - DashboardContainerInput, - SavedDashboardPanel, -} from '.'; - -import { getQueryParams } from '../services/kibana_utils'; -import { EmbeddablePackageState, isErrorEmbeddable } from '../services/embeddable'; -import { - esFilters, - FilterManager, - IndexPattern, - IndexPatternsContract, - QueryStart, -} from '../services/data'; - -export const getChangesFromAppStateForContainerState = ({ - dashboardContainer, - appStateDashboardInput, -}: { - dashboardContainer: DashboardContainer; - appStateDashboardInput: DashboardContainerInput; -}) => { - if (!dashboardContainer || isErrorEmbeddable(dashboardContainer)) { - return appStateDashboardInput; - } - const containerInput = dashboardContainer.getInput(); - const differences: Partial = {}; - - // Filters shouldn't be compared using regular isEqual - if ( - !esFilters.compareFilters( - containerInput.filters, - appStateDashboardInput.filters, - esFilters.COMPARE_ALL_OPTIONS - ) - ) { - differences.filters = appStateDashboardInput.filters; - } - - Object.keys( - _.omit(containerInput, [ - 'filters', - 'searchSessionId', - 'lastReloadRequestTime', - 'switchViewMode', - ]) - ).forEach((key) => { - const containerValue = (containerInput as { [key: string]: unknown })[key]; - const appStateValue = ((appStateDashboardInput as unknown) as { [key: string]: unknown })[key]; - if (!_.isEqual(containerValue, appStateValue)) { - (differences as { [key: string]: unknown })[key] = appStateValue; - } - }); - - // last reload request time can be undefined without causing a refresh - if ( - appStateDashboardInput.lastReloadRequestTime && - containerInput.lastReloadRequestTime !== appStateDashboardInput.lastReloadRequestTime - ) { - differences.lastReloadRequestTime = appStateDashboardInput.lastReloadRequestTime; - } - - // cloneDeep hack is needed, as there are multiple places, where container's input mutated, - // but values from appStateValue are deeply frozen, as they can't be mutated directly - return Object.values(differences).length === 0 ? undefined : _.cloneDeep(differences); -}; - -export const getDashboardContainerInput = ({ - query, - searchSessionId, - incomingEmbeddable, - isEmbeddedExternally, - lastReloadRequestTime, - dashboardStateManager, - dashboardCapabilities, -}: { - dashboardCapabilities: DashboardAppCapabilities; - dashboardStateManager: DashboardStateManager; - incomingEmbeddable?: EmbeddablePackageState; - lastReloadRequestTime?: number; - isEmbeddedExternally: boolean; - searchSessionId?: string; - query: QueryStart; -}): DashboardContainerInput => { - const embeddablesMap: { - [key: string]: DashboardPanelState; - } = {}; - dashboardStateManager.getPanels().forEach((panel: SavedDashboardPanel) => { - embeddablesMap[panel.panelIndex] = convertSavedDashboardPanelToPanelState(panel); - }); - - // If the incoming embeddable state's id already exists in the embeddables map, replace the input, retaining the existing gridData for that panel. - if (incomingEmbeddable?.embeddableId && embeddablesMap[incomingEmbeddable.embeddableId]) { - const originalPanelState = embeddablesMap[incomingEmbeddable.embeddableId]; - embeddablesMap[incomingEmbeddable.embeddableId] = { - gridData: originalPanelState.gridData, - type: incomingEmbeddable.type, - explicitInput: { - ...originalPanelState.explicitInput, - ...incomingEmbeddable.input, - id: incomingEmbeddable.embeddableId, - }, - }; - } - - return { - refreshConfig: query.timefilter.timefilter.getRefreshInterval(), - hidePanelTitles: dashboardStateManager.getHidePanelTitles(), - isFullScreenMode: dashboardStateManager.getFullScreenMode(), - expandedPanelId: dashboardStateManager.getExpandedPanelId(), - description: dashboardStateManager.getDescription(), - id: dashboardStateManager.savedDashboard.id || '', - useMargins: dashboardStateManager.getUseMargins(), - syncColors: dashboardStateManager.getSyncColors(), - viewMode: dashboardStateManager.getViewMode(), - filters: query.filterManager.getFilters(), - query: dashboardStateManager.getQuery(), - title: dashboardStateManager.getTitle(), - panels: embeddablesMap, - lastReloadRequestTime, - dashboardCapabilities, - isEmbeddedExternally, - searchSessionId, - timeRange: { - ..._.cloneDeep(query.timefilter.timefilter.getTime()), - }, - }; -}; - -export const getInputSubscription = ({ - dashboardContainer, - dashboardStateManager, - filterManager, -}: { - dashboardContainer: DashboardContainer; - dashboardStateManager: DashboardStateManager; - filterManager: FilterManager; -}) => - dashboardContainer.getInput$().subscribe(() => { - // This has to be first because handleDashboardContainerChanges causes - // appState.save which will cause refreshDashboardContainer to be called. - - if ( - !esFilters.compareFilters( - dashboardContainer.getInput().filters, - filterManager.getFilters(), - esFilters.COMPARE_ALL_OPTIONS - ) - ) { - // Add filters modifies the object passed to it, hence the clone deep. - filterManager.addFilters(_.cloneDeep(dashboardContainer.getInput().filters)); - - dashboardStateManager.applyFilters( - dashboardStateManager.getQuery(), - dashboardContainer.getInput().filters - ); - } - - dashboardStateManager.handleDashboardContainerChanges(dashboardContainer); - }); - -export const getOutputSubscription = ({ - dashboardContainer, - indexPatterns, - onUpdateIndexPatterns, -}: { - dashboardContainer: DashboardContainer; - indexPatterns: IndexPatternsContract; - onUpdateIndexPatterns: (newIndexPatterns: IndexPattern[]) => void; -}) => { - const updateIndexPatternsOperator = pipe( - filter((container: DashboardContainer) => !!container && !isErrorEmbeddable(container)), - map((container: DashboardContainer): IndexPattern[] => { - let panelIndexPatterns: IndexPattern[] = []; - Object.values(container.getChildIds()).forEach((id) => { - const embeddableInstance = container.getChild(id); - if (isErrorEmbeddable(embeddableInstance)) return; - const embeddableIndexPatterns = (embeddableInstance.getOutput() as any).indexPatterns; - if (!embeddableIndexPatterns) return; - panelIndexPatterns.push(...embeddableIndexPatterns); - }); - panelIndexPatterns = uniqBy(panelIndexPatterns, 'id'); - return panelIndexPatterns; - }), - distinctUntilChanged((a, b) => - deepEqual( - a.map((ip) => ip && ip.id), - b.map((ip) => ip && ip.id) - ) - ), - // using switchMap for previous task cancellation - switchMap((panelIndexPatterns: IndexPattern[]) => { - return new Observable((observer) => { - if (panelIndexPatterns && panelIndexPatterns.length > 0) { - if (observer.closed) return; - onUpdateIndexPatterns(panelIndexPatterns); - observer.complete(); - } else { - indexPatterns.getDefault().then((defaultIndexPattern) => { - if (observer.closed) return; - onUpdateIndexPatterns([defaultIndexPattern as IndexPattern]); - observer.complete(); - }); - } - }); - }) - ); - - return merge( - // output of dashboard container itself - dashboardContainer.getOutput$(), - // plus output of dashboard container children, - // children may change, so make sure we subscribe/unsubscribe with switchMap - dashboardContainer.getOutput$().pipe( - map(() => dashboardContainer!.getChildIds()), - distinctUntilChanged(deepEqual), - switchMap((newChildIds: string[]) => - merge(...newChildIds.map((childId) => dashboardContainer!.getChild(childId).getOutput$())) - ) - ) - ) - .pipe( - mapTo(dashboardContainer), - startWith(dashboardContainer), // to trigger initial index pattern update - updateIndexPatternsOperator - ) - .subscribe(); -}; - -export const getFiltersSubscription = ({ - query, - dashboardStateManager, -}: { - query: QueryStart; - dashboardStateManager: DashboardStateManager; -}) => { - return merge(query.filterManager.getUpdates$(), query.queryString.getUpdates$()) - .pipe(debounceTime(100)) - .subscribe(() => { - dashboardStateManager.applyFilters( - query.queryString.getQuery(), - query.filterManager.getFilters() - ); - }); -}; - -export const getSearchSessionIdFromURL = (history: History): string | undefined => - getQueryParams(history.location)[DashboardConstants.SEARCH_SESSION_ID] as string | undefined; diff --git a/src/plugins/dashboard/public/application/dashboard_router.tsx b/src/plugins/dashboard/public/application/dashboard_router.tsx index be279ed98492e7..e77353000ced46 100644 --- a/src/plugins/dashboard/public/application/dashboard_router.tsx +++ b/src/plugins/dashboard/public/application/dashboard_router.tsx @@ -8,36 +8,37 @@ import './index.scss'; import React from 'react'; +import { History } from 'history'; +import { Provider } from 'react-redux'; +import { first } from 'rxjs/operators'; import { I18nProvider } from '@kbn/i18n/react'; import { parse, ParsedQuery } from 'query-string'; import { render, unmountComponentAtNode } from 'react-dom'; import { Switch, Route, RouteComponentProps, HashRouter, Redirect } from 'react-router-dom'; -import { first } from 'rxjs/operators'; import { DashboardListing } from './listing'; +import { dashboardStateStore } from './state'; import { DashboardApp } from './dashboard_app'; -import { addHelpMenuToAppChrome, DashboardPanelStorage } from './lib'; +import { DashboardNoMatch } from './listing/dashboard_no_match'; +import { KibanaContextProvider } from '../services/kibana_react'; +import { addHelpMenuToAppChrome, DashboardSessionStorage } from './lib'; import { createDashboardListingFilterUrl } from '../dashboard_constants'; -import { getDashboardPageTitle, dashboardReadonlyBadge } from '../dashboard_strings'; import { createDashboardEditUrl, DashboardConstants } from '../dashboard_constants'; -import { DashboardAppServices, DashboardEmbedSettings, RedirectToProps } from './types'; +import { getDashboardPageTitle, dashboardReadonlyBadge } from '../dashboard_strings'; +import { createKbnUrlStateStorage, withNotifyOnErrors } from '../services/kibana_utils'; +import { DashboardAppServices, DashboardEmbedSettings, RedirectToProps } from '../types'; import { DashboardFeatureFlagConfig, DashboardSetupDependencies, DashboardStart, DashboardStartDependencies, } from '../plugin'; - -import { createKbnUrlStateStorage, withNotifyOnErrors } from '../services/kibana_utils'; -import { KibanaContextProvider } from '../services/kibana_react'; - import { AppMountParameters, CoreSetup, PluginInitializerContext, ScopedHistory, } from '../services/core'; -import { DashboardNoMatch } from './listing/dashboard_no_match'; export const dashboardUrlParams = { showTopMenu: 'show-top-menu', @@ -89,12 +90,14 @@ export async function mountApp({ const activeSpaceId = spacesApi && (await spacesApi.getActiveSpace$().pipe(first()).toPromise())?.id; let globalEmbedSettings: DashboardEmbedSettings | undefined; + let routerHistory: History; const dashboardServices: DashboardAppServices = { navigation, onAppLeave, savedObjects, urlForwarding, + visualizations, usageCollection, core: coreStart, data: dataStart, @@ -109,10 +112,6 @@ export async function mountApp({ indexPatterns: dataStart.indexPatterns, savedQueryService: dataStart.query.savedQueries, savedObjectsClient: coreStart.savedObjects.client, - dashboardPanelStorage: new DashboardPanelStorage( - core.notifications.toasts, - activeSpaceId || 'default' - ), savedDashboards: dashboardStart.getSavedDashboardLoader(), savedObjectsTagging: savedObjectsTaggingOss?.getTaggingApi(), allowByValueEmbeddables: initializerContext.config.get() @@ -127,7 +126,10 @@ export async function mountApp({ visualizeCapabilities: { save: Boolean(coreStart.application.capabilities.visualize?.save) }, storeSearchSession: Boolean(coreStart.application.capabilities.dashboard.storeSearchSession), }, - visualizations, + dashboardSessionStorage: new DashboardSessionStorage( + core.notifications.toasts, + activeSpaceId || 'default' + ), }; const getUrlStateStorage = (history: RouteComponentProps['history']) => @@ -137,10 +139,9 @@ export async function mountApp({ ...withNotifyOnErrors(core.notifications.toasts), }); - const redirect = (routeProps: RouteComponentProps, redirectTo: RedirectToProps) => { - const historyFunction = redirectTo.useReplace - ? routeProps.history.replace - : routeProps.history.push; + const redirect = (redirectTo: RedirectToProps) => { + if (!routerHistory) return; + const historyFunction = redirectTo.useReplace ? routerHistory.replace : routerHistory.push; let destination; if (redirectTo.destination === 'dashboard') { destination = redirectTo.id @@ -168,12 +169,15 @@ export async function mountApp({ if (routeParams.embed && !globalEmbedSettings) { globalEmbedSettings = getDashboardEmbedSettings(routeParams); } + if (!routerHistory) { + routerHistory = routeProps.history; + } return ( redirect(routeProps, props)} + redirectTo={redirect} /> ); }; @@ -183,13 +187,15 @@ export async function mountApp({ const routeParams = parse(routeProps.history.location.search); const title = (routeParams.title as string) || undefined; const filter = (routeParams.filter as string) || undefined; - + if (!routerHistory) { + routerHistory = routeProps.history; + } return ( redirect(routeProps, props)} + redirectTo={redirect} /> ); }; @@ -215,26 +221,32 @@ export async function mountApp({ const app = ( - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + ); diff --git a/src/plugins/dashboard/public/application/dashboard_state.test.ts b/src/plugins/dashboard/public/application/dashboard_state.test.ts deleted file mode 100644 index ffe5c80febe026..00000000000000 --- a/src/plugins/dashboard/public/application/dashboard_state.test.ts +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { createBrowserHistory } from 'history'; -import { getSavedDashboardMock } from './test_helpers'; -import { DashboardContainer, DashboardContainerInput, DashboardPanelState } from '.'; -import { DashboardStateManager } from './dashboard_state_manager'; -import { DashboardContainerServices } from './embeddable/dashboard_container'; - -import { EmbeddableInput, ViewMode } from '../services/embeddable'; -import { createKbnUrlStateStorage } from '../services/kibana_utils'; -import { InputTimeRange, TimefilterContract, TimeRange } from '../services/data'; - -import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks'; -import { coreMock } from '../../../../core/public/mocks'; - -describe('DashboardState', function () { - let dashboardState: DashboardStateManager; - const savedDashboard = getSavedDashboardMock(); - - let mockTime: TimeRange = { to: 'now', from: 'now-15m' }; - const mockTimefilter = { - getTime: () => { - return mockTime; - }, - setTime: (time: InputTimeRange) => { - mockTime = time as TimeRange; - }, - } as TimefilterContract; - - // TS is *very* picky with type guards / predicates. can't just use jest.fn() - function mockHasTaggingCapabilities(obj: any): obj is any { - return false; - } - - function initDashboardState() { - dashboardState = new DashboardStateManager({ - savedDashboard, - hideWriteControls: false, - allowByValueEmbeddables: false, - hasPendingEmbeddable: () => false, - kibanaVersion: '7.0.0', - kbnUrlStateStorage: createKbnUrlStateStorage(), - history: createBrowserHistory(), - toasts: coreMock.createStart().notifications.toasts, - hasTaggingCapabilities: mockHasTaggingCapabilities, - }); - } - - function initDashboardContainer(initialInput?: Partial) { - const { doStart } = embeddablePluginMock.createInstance(); - const defaultInput: DashboardContainerInput = { - id: '123', - viewMode: ViewMode.EDIT, - filters: [] as DashboardContainerInput['filters'], - query: {} as DashboardContainerInput['query'], - timeRange: {} as DashboardContainerInput['timeRange'], - useMargins: true, - syncColors: false, - title: 'ultra awesome test dashboard', - isFullScreenMode: false, - panels: {} as DashboardContainerInput['panels'], - }; - const input = { ...defaultInput, ...(initialInput ?? {}) }; - return new DashboardContainer(input, { embeddable: doStart() } as DashboardContainerServices); - } - - describe('syncTimefilterWithDashboard', function () { - test('syncs quick time', function () { - savedDashboard.timeRestore = true; - savedDashboard.timeFrom = 'now/w'; - savedDashboard.timeTo = 'now/w'; - - mockTime.from = '2015-09-19 06:31:44.000'; - mockTime.to = '2015-09-29 06:31:44.000'; - - initDashboardState(); - dashboardState.syncTimefilterWithDashboardTime(mockTimefilter); - - expect(mockTime.to).toBe('now/w'); - expect(mockTime.from).toBe('now/w'); - }); - - test('syncs relative time', function () { - savedDashboard.timeRestore = true; - savedDashboard.timeFrom = 'now-13d'; - savedDashboard.timeTo = 'now'; - - mockTime.from = '2015-09-19 06:31:44.000'; - mockTime.to = '2015-09-29 06:31:44.000'; - - initDashboardState(); - dashboardState.syncTimefilterWithDashboardTime(mockTimefilter); - - expect(mockTime.to).toBe('now'); - expect(mockTime.from).toBe('now-13d'); - }); - - test('syncs absolute time', function () { - savedDashboard.timeRestore = true; - savedDashboard.timeFrom = '2015-09-19 06:31:44.000'; - savedDashboard.timeTo = '2015-09-29 06:31:44.000'; - - mockTime.from = 'now/w'; - mockTime.to = 'now/w'; - - initDashboardState(); - dashboardState.syncTimefilterWithDashboardTime(mockTimefilter); - - expect(mockTime.to).toBe(savedDashboard.timeTo); - expect(mockTime.from).toBe(savedDashboard.timeFrom); - }); - }); - - describe('Dashboard Container Changes', () => { - beforeEach(() => { - initDashboardState(); - }); - - test('expanedPanelId in container input casues state update', () => { - dashboardState.setExpandedPanelId = jest.fn(); - - const dashboardContainer = initDashboardContainer({ - expandedPanelId: 'theCoolestPanelOnThisDashboard', - panels: { - theCoolestPanelOnThisDashboard: { - explicitInput: { id: 'theCoolestPanelOnThisDashboard' }, - } as DashboardPanelState, - }, - }); - - dashboardState.handleDashboardContainerChanges(dashboardContainer); - expect(dashboardState.setExpandedPanelId).toHaveBeenCalledWith( - 'theCoolestPanelOnThisDashboard' - ); - }); - - test('expanedPanelId is not updated when it is the same', () => { - dashboardState.setExpandedPanelId = jest - .fn() - .mockImplementation(dashboardState.setExpandedPanelId); - - const dashboardContainer = initDashboardContainer({ - expandedPanelId: 'theCoolestPanelOnThisDashboard', - panels: { - theCoolestPanelOnThisDashboard: { - explicitInput: { id: 'theCoolestPanelOnThisDashboard' }, - } as DashboardPanelState, - }, - }); - - dashboardState.handleDashboardContainerChanges(dashboardContainer); - dashboardState.handleDashboardContainerChanges(dashboardContainer); - expect(dashboardState.setExpandedPanelId).toHaveBeenCalledTimes(1); - }); - - test('expandedPanelId is set to undefined if panel does not exist in input', () => { - dashboardState.setExpandedPanelId = jest - .fn() - .mockImplementation(dashboardState.setExpandedPanelId); - const dashboardContainer = initDashboardContainer({ - expandedPanelId: 'theCoolestPanelOnThisDashboard', - panels: { - theCoolestPanelOnThisDashboard: { - explicitInput: { id: 'theCoolestPanelOnThisDashboard' }, - } as DashboardPanelState, - }, - }); - - dashboardState.handleDashboardContainerChanges(dashboardContainer); - expect(dashboardState.setExpandedPanelId).toHaveBeenCalledWith( - 'theCoolestPanelOnThisDashboard' - ); - - dashboardContainer.updateInput({ expandedPanelId: 'theLeastCoolPanelOnThisDashboard' }); - dashboardState.handleDashboardContainerChanges(dashboardContainer); - expect(dashboardState.setExpandedPanelId).toHaveBeenCalledWith(undefined); - }); - }); - - describe('isDirty', function () { - beforeAll(() => { - initDashboardState(); - }); - - test('getIsDirty is true if isDirty is true and editing', () => { - dashboardState.switchViewMode(ViewMode.EDIT); - dashboardState.isDirty = true; - expect(dashboardState.getIsDirty()).toBeTruthy(); - }); - - test('getIsDirty is false if isDirty is true and editing', () => { - dashboardState.switchViewMode(ViewMode.VIEW); - dashboardState.isDirty = true; - expect(dashboardState.getIsDirty()).toBeFalsy(); - }); - }); - - describe('initial view mode', () => { - test('initial view mode set to view when hideWriteControls is true', () => { - const initialViewModeDashboardState = new DashboardStateManager({ - savedDashboard, - hideWriteControls: true, - allowByValueEmbeddables: false, - hasPendingEmbeddable: () => false, - kibanaVersion: '7.0.0', - kbnUrlStateStorage: createKbnUrlStateStorage(), - history: createBrowserHistory(), - toasts: coreMock.createStart().notifications.toasts, - hasTaggingCapabilities: mockHasTaggingCapabilities, - }); - expect(initialViewModeDashboardState.getViewMode()).toBe(ViewMode.VIEW); - }); - - test('initial view mode set to edit if edit mode specified in URL', () => { - const kbnUrlStateStorage = createKbnUrlStateStorage(); - kbnUrlStateStorage.set('_a', { viewMode: ViewMode.EDIT }); - - const initialViewModeDashboardState = new DashboardStateManager({ - savedDashboard, - kbnUrlStateStorage, - kibanaVersion: '7.0.0', - hideWriteControls: false, - allowByValueEmbeddables: false, - history: createBrowserHistory(), - hasPendingEmbeddable: () => false, - toasts: coreMock.createStart().notifications.toasts, - hasTaggingCapabilities: mockHasTaggingCapabilities, - }); - expect(initialViewModeDashboardState.getViewMode()).toBe(ViewMode.EDIT); - }); - - test('initial view mode set to edit if the dashboard is new', () => { - const newDashboard = getSavedDashboardMock(); - newDashboard.id = undefined; - const initialViewModeDashboardState = new DashboardStateManager({ - savedDashboard: newDashboard, - kibanaVersion: '7.0.0', - hideWriteControls: false, - allowByValueEmbeddables: false, - history: createBrowserHistory(), - hasPendingEmbeddable: () => false, - kbnUrlStateStorage: createKbnUrlStateStorage(), - toasts: coreMock.createStart().notifications.toasts, - hasTaggingCapabilities: mockHasTaggingCapabilities, - }); - expect(initialViewModeDashboardState.getViewMode()).toBe(ViewMode.EDIT); - }); - - test('initial view mode set to edit if there is a pending embeddable', () => { - const newDashboard = getSavedDashboardMock(); - newDashboard.id = undefined; - const initialViewModeDashboardState = new DashboardStateManager({ - savedDashboard: newDashboard, - kibanaVersion: '7.0.0', - hideWriteControls: false, - allowByValueEmbeddables: false, - history: createBrowserHistory(), - hasPendingEmbeddable: () => true, - kbnUrlStateStorage: createKbnUrlStateStorage(), - toasts: coreMock.createStart().notifications.toasts, - hasTaggingCapabilities: mockHasTaggingCapabilities, - }); - expect(initialViewModeDashboardState.getViewMode()).toBe(ViewMode.EDIT); - }); - }); -}); diff --git a/src/plugins/dashboard/public/application/dashboard_state_manager.ts b/src/plugins/dashboard/public/application/dashboard_state_manager.ts deleted file mode 100644 index 58b413f4303e66..00000000000000 --- a/src/plugins/dashboard/public/application/dashboard_state_manager.ts +++ /dev/null @@ -1,771 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import _ from 'lodash'; -import { Moment } from 'moment'; -import { i18n } from '@kbn/i18n'; -import { History } from 'history'; -import { Observable, Subscription } from 'rxjs'; - -import { FilterUtils } from './lib/filter_utils'; -import { DashboardContainer } from './embeddable'; -import { DashboardSavedObject } from '../saved_dashboards'; -import { migrateLegacyQuery } from './lib/migrate_legacy_query'; -import { - getAppStateDefaults, - migrateAppState, - getDashboardIdFromUrl, - DashboardPanelStorage, -} from './lib'; -import { convertPanelStateToSavedDashboardPanel } from '../../common/embeddable/embeddable_saved_object_converters'; -import { - DashboardAppState, - DashboardAppStateDefaults, - DashboardAppStateInUrl, - DashboardAppStateTransitions, - SavedDashboardPanel, -} from '../types'; - -import { ViewMode } from '../services/embeddable'; -import { UsageCollectionSetup } from '../services/usage_collection'; -import { Filter, Query, TimefilterContract as Timefilter } from '../services/data'; -import type { SavedObjectTagDecoratorTypeGuard } from '../services/saved_objects_tagging_oss'; -import { - createStateContainer, - IKbnUrlStateStorage, - ISyncStateRef, - ReduxLikeStateContainer, - syncState, -} from '../services/kibana_utils'; -import { STATE_STORAGE_KEY } from '../url_generator'; -import { NotificationsStart } from '../services/core'; -import { getMigratedToastText } from '../dashboard_strings'; - -/** - * Dashboard state manager handles connecting angular and redux state between the angular and react portions of the - * app. There are two "sources of truth" that need to stay in sync - AppState (aka the `_a` portion of the url) and - * the Store. They aren't complete duplicates of each other as AppState has state that the Store doesn't, and vice - * versa. They should be as decoupled as possible so updating the store won't affect bwc of urls. - */ -export class DashboardStateManager { - public savedDashboard: DashboardSavedObject; - public lastSavedDashboardFilters: { - timeTo?: string | Moment; - timeFrom?: string | Moment; - filterBars: Filter[]; - query: Query; - }; - private stateDefaults: DashboardAppStateDefaults; - private toasts: NotificationsStart['toasts']; - private hideWriteControls: boolean; - private kibanaVersion: string; - public isDirty: boolean; - private changeListeners: Array<(status: { dirty: boolean }) => void>; - private hasShownMigrationToast = false; - - public get appState(): DashboardAppState { - return this.stateContainer.get(); - } - - public get appState$(): Observable { - return this.stateContainer.state$; - } - - private readonly stateContainer: ReduxLikeStateContainer< - DashboardAppState, - DashboardAppStateTransitions - >; - private readonly stateContainerChangeSub: Subscription; - private readonly dashboardPanelStorage?: DashboardPanelStorage; - public readonly kbnUrlStateStorage: IKbnUrlStateStorage; - private readonly stateSyncRef: ISyncStateRef; - private readonly allowByValueEmbeddables: boolean; - - private readonly usageCollection: UsageCollectionSetup | undefined; - public readonly hasTaggingCapabilities: SavedObjectTagDecoratorTypeGuard; - private hasPendingEmbeddable: () => boolean; - - /** - * - * @param savedDashboard - * @param hideWriteControls true if write controls should be hidden. - * @param kibanaVersion current kibanaVersion - * @param - */ - constructor({ - toasts, - history, - kibanaVersion, - savedDashboard, - usageCollection, - hideWriteControls, - kbnUrlStateStorage, - hasPendingEmbeddable, - dashboardPanelStorage, - hasTaggingCapabilities, - allowByValueEmbeddables, - }: { - history: History; - kibanaVersion: string; - hideWriteControls: boolean; - hasPendingEmbeddable: () => boolean; - allowByValueEmbeddables: boolean; - savedDashboard: DashboardSavedObject; - toasts: NotificationsStart['toasts']; - usageCollection?: UsageCollectionSetup; - kbnUrlStateStorage: IKbnUrlStateStorage; - dashboardPanelStorage?: DashboardPanelStorage; - hasTaggingCapabilities: SavedObjectTagDecoratorTypeGuard; - }) { - this.toasts = toasts; - this.kibanaVersion = kibanaVersion; - this.savedDashboard = savedDashboard; - this.hideWriteControls = hideWriteControls; - this.usageCollection = usageCollection; - this.hasTaggingCapabilities = hasTaggingCapabilities; - this.allowByValueEmbeddables = allowByValueEmbeddables; - this.hasPendingEmbeddable = hasPendingEmbeddable; - this.dashboardPanelStorage = dashboardPanelStorage; - this.kbnUrlStateStorage = kbnUrlStateStorage; - - // get state defaults from saved dashboard, make sure it is migrated - const viewMode = this.getInitialViewMode(); - this.stateDefaults = migrateAppState( - getAppStateDefaults(viewMode, this.savedDashboard, this.hasTaggingCapabilities), - kibanaVersion, - usageCollection - ); - - // setup initial state by merging defaults with state from url & panels storage - // also run migration, as state in url could be of older version - const initialUrlState = this.kbnUrlStateStorage.get(STATE_STORAGE_KEY); - - const initialState = migrateAppState( - { - ...this.stateDefaults, - ...this.getUnsavedPanelState(), - ...initialUrlState, - }, - kibanaVersion, - usageCollection - ); - - this.isDirty = false; - - if (initialUrlState?.panels && !_.isEqual(initialUrlState.panels, this.stateDefaults.panels)) { - this.isDirty = true; - this.setUnsavedPanels(initialState.panels); - } - - // setup state container using initial state both from defaults and from url - this.stateContainer = createStateContainer( - initialState, - { - set: (state) => (prop, value) => ({ ...state, [prop]: value }), - setOption: (state) => (option, value) => ({ - ...state, - options: { - ...state.options, - [option]: value, - }, - }), - } - ); - - // We can't compare the filters stored on this.appState to this.savedDashboard because in order to apply - // the filters to the visualizations, we need to save it on the dashboard. We keep track of the original - // filter state in order to let the user know if their filters changed and provide this specific information - // in the 'lose changes' warning message. - this.lastSavedDashboardFilters = this.getFilterState(); - - this.changeListeners = []; - - this.stateContainerChangeSub = this.stateContainer.state$.subscribe(() => { - this.isDirty = this.checkIsDirty(); - this.changeListeners.forEach((listener) => listener({ dirty: this.isDirty })); - }); - - // setup state syncing utils. state container will be synced with url into `STATE_STORAGE_KEY` query param - this.stateSyncRef = syncState({ - storageKey: STATE_STORAGE_KEY, - stateContainer: { - ...this.stateContainer, - get: () => this.toUrlState(this.stateContainer.get()), - set: (stateFromUrl: DashboardAppStateInUrl | null) => { - // sync state required state container to be able to handle null - // overriding set() so it could handle null coming from url - if (stateFromUrl) { - // Skip this update if current dashboardId in the url is different from what we have in the current instance of state manager - // As dashboard is driven by angular at the moment, the destroy cycle happens async, - // If the dashboardId has changed it means this instance - // is going to be destroyed soon and we shouldn't sync state anymore, - // as it could potentially trigger further url updates - const currentDashboardIdInUrl = getDashboardIdFromUrl(history.location.pathname); - if (currentDashboardIdInUrl !== this.savedDashboard.id) return; - - // set View mode before the rest of the state so unsaved panels can be added correctly. - if (this.appState.viewMode !== stateFromUrl.viewMode) { - this.switchViewMode(stateFromUrl.viewMode); - } - - this.stateContainer.set({ - ...this.stateDefaults, - ...this.getUnsavedPanelState(), - ...stateFromUrl, - }); - } else { - // Do nothing in case when state from url is empty, - // this fixes: https://github.com/elastic/kibana/issues/57789 - // There are not much cases when state in url could become empty: - // 1. User manually removed `_a` from the url - // 2. Browser is navigating away from the page and most likely there is no `_a` in the url. - // In this case we don't want to do any state updates - // and just allow $scope.$on('destroy') fire later and clean up everything - } - }, - }, - stateStorage: this.kbnUrlStateStorage, - }); - } - - public startStateSyncing() { - this.saveState({ replace: true }); - this.stateSyncRef.start(); - } - - public registerChangeListener(callback: (status: { dirty: boolean }) => void) { - this.changeListeners.push(callback); - } - - public handleDashboardContainerChanges(dashboardContainer: DashboardContainer) { - let dirty = false; - let dirtyBecauseOfInitialStateMigration = false; - - const savedDashboardPanelMap: { [key: string]: SavedDashboardPanel } = {}; - - const input = dashboardContainer.getInput(); - - this.getPanels().forEach((savedDashboardPanel) => { - if (input.panels[savedDashboardPanel.panelIndex] !== undefined) { - savedDashboardPanelMap[savedDashboardPanel.panelIndex] = savedDashboardPanel; - } else { - // A panel was deleted. - dirty = true; - } - }); - - const convertedPanelStateMap: { [key: string]: SavedDashboardPanel } = {}; - - let expandedPanelValid = false; - Object.values(input.panels).forEach((panelState) => { - if (savedDashboardPanelMap[panelState.explicitInput.id] === undefined) { - dirty = true; - } - - if (panelState.explicitInput.id === input.expandedPanelId) { - expandedPanelValid = true; - } - - convertedPanelStateMap[panelState.explicitInput.id] = convertPanelStateToSavedDashboardPanel( - panelState, - this.kibanaVersion - ); - - if ( - !_.isEqual( - convertedPanelStateMap[panelState.explicitInput.id], - savedDashboardPanelMap[panelState.explicitInput.id] - ) - ) { - // A panel was changed - dirty = true; - - const oldVersion = savedDashboardPanelMap[panelState.explicitInput.id]?.version; - const newVersion = convertedPanelStateMap[panelState.explicitInput.id]?.version; - if (oldVersion && newVersion && oldVersion !== newVersion) { - dirtyBecauseOfInitialStateMigration = true; - } - } - }); - - if (dirty) { - this.stateContainer.transitions.set('panels', Object.values(convertedPanelStateMap)); - if (dirtyBecauseOfInitialStateMigration) { - if (this.getIsEditMode() && !this.hasShownMigrationToast) { - this.toasts.addSuccess(getMigratedToastText()); - this.hasShownMigrationToast = true; - } - this.saveState({ replace: true }); - } - - // If a panel has been changed, and the state is now equal to the state in the saved object, remove the unsaved panels - if (!this.isDirty && this.getIsEditMode()) { - this.clearUnsavedPanels(); - } else { - this.setUnsavedPanels(this.getPanels()); - } - } - - if (input.isFullScreenMode !== this.getFullScreenMode()) { - this.setFullScreenMode(input.isFullScreenMode); - } - - if (expandedPanelValid && input.expandedPanelId !== this.getExpandedPanelId()) { - this.setExpandedPanelId(input.expandedPanelId); - } else if (!expandedPanelValid && this.getExpandedPanelId()) { - this.setExpandedPanelId(undefined); - } - - if (!_.isEqual(input.query, this.getQuery())) { - this.setQuery(input.query); - } - - this.changeListeners.forEach((listener) => listener({ dirty })); - } - - public getFullScreenMode() { - return this.appState.fullScreenMode; - } - - public setFullScreenMode(fullScreenMode: boolean) { - this.stateContainer.transitions.set('fullScreenMode', fullScreenMode); - } - - public getExpandedPanelId() { - return this.appState.expandedPanelId; - } - - public setExpandedPanelId(expandedPanelId?: string) { - this.stateContainer.transitions.set('expandedPanelId', expandedPanelId); - } - - public setFilters(filters: Filter[]) { - this.stateContainer.transitions.set('filters', filters); - } - - /** - * Resets the state back to the last saved version of the dashboard. - */ - public resetState() { - // In order to show the correct warning, we have to store the unsaved - // title on the dashboard object. We should fix this at some point, but this is how all the other object - // save panels work at the moment. - this.savedDashboard.title = this.savedDashboard.lastSavedTitle; - - // appState.reset uses the internal defaults to reset the state, but some of the default settings (e.g. the panels - // array) point to the same object that is stored on appState and is getting modified. - // The right way to fix this might be to ensure the defaults object stored on state is a deep - // clone, but given how much code uses the state object, I determined that to be too risky of a change for - // now. TODO: revisit this! - const currentViewMode = this.stateContainer.get().viewMode; - this.stateDefaults = migrateAppState( - getAppStateDefaults(currentViewMode, this.savedDashboard, this.hasTaggingCapabilities), - this.kibanaVersion, - this.usageCollection - ); - // The original query won't be restored by the above because the query on this.savedDashboard is applied - // in place in order for it to affect the visualizations. - this.stateDefaults.query = this.lastSavedDashboardFilters.query; - // Need to make a copy to ensure they are not overwritten. - this.stateDefaults.filters = [...this.getLastSavedFilterBars()]; - this.isDirty = false; - - this.stateContainer.set(this.stateDefaults); - } - - /** - * Returns an object which contains the current filter state of this.savedDashboard. - */ - public getFilterState() { - return { - timeTo: this.savedDashboard.timeTo, - timeFrom: this.savedDashboard.timeFrom, - filterBars: this.savedDashboard.getFilters(), - query: this.savedDashboard.getQuery(), - }; - } - - public getTitle() { - return this.appState.title; - } - - public isSaved() { - return !!this.savedDashboard.id; - } - - public isNew() { - return !this.isSaved(); - } - - public getDescription() { - return this.appState.description; - } - - public getTags() { - return this.appState.tags; - } - - public setDescription(description: string) { - this.stateContainer.transitions.set('description', description); - } - - public setTitle(title: string) { - this.savedDashboard.title = title; - this.stateContainer.transitions.set('title', title); - } - - public setTags(tags: string[]) { - this.stateContainer.transitions.set('tags', tags); - } - - public getAppState() { - return this.stateContainer.get(); - } - - public getQuery(): Query { - return migrateLegacyQuery(this.stateContainer.get().query); - } - - public getSavedQueryId() { - return this.stateContainer.get().savedQuery; - } - - public setSavedQueryId(id?: string) { - this.stateContainer.transitions.set('savedQuery', id); - } - - public getUseMargins() { - // Existing dashboards that don't define this should default to false. - return this.appState.options.useMargins === undefined - ? false - : this.appState.options.useMargins; - } - - public setUseMargins(useMargins: boolean) { - this.stateContainer.transitions.setOption('useMargins', useMargins); - } - - public getSyncColors() { - // Existing dashboards that don't define this should default to true. - return this.appState.options.syncColors === undefined ? true : this.appState.options.syncColors; - } - - public setSyncColors(syncColors: boolean) { - this.stateContainer.transitions.setOption('syncColors', syncColors); - } - - public getHidePanelTitles() { - return this.appState.options.hidePanelTitles; - } - - public setHidePanelTitles(hidePanelTitles: boolean) { - this.stateContainer.transitions.setOption('hidePanelTitles', hidePanelTitles); - } - - public getTimeRestore() { - return this.appState.timeRestore; - } - - public setTimeRestore(timeRestore: boolean) { - this.stateContainer.transitions.set('timeRestore', timeRestore); - } - - public getIsTimeSavedWithDashboard() { - return this.savedDashboard.timeRestore; - } - - public getLastSavedFilterBars(): Filter[] { - return this.lastSavedDashboardFilters.filterBars; - } - - public getLastSavedQuery() { - return this.lastSavedDashboardFilters.query; - } - - /** - * @returns True if the query changed since the last time the dashboard was saved, or if it's a - * new dashboard, if the query differs from the default. - */ - public getQueryChanged() { - const currentQuery = this.appState.query; - const lastSavedQuery = this.getLastSavedQuery(); - - const query = migrateLegacyQuery(currentQuery); - - const isLegacyStringQuery = - _.isString(lastSavedQuery) && _.isPlainObject(currentQuery) && _.has(currentQuery, 'query'); - if (isLegacyStringQuery) { - return lastSavedQuery !== query.query; - } - - return !_.isEqual(currentQuery, lastSavedQuery); - } - - /** - * @returns True if the filter bar state has changed since the last time the dashboard was saved, - * or if it's a new dashboard, if the query differs from the default. - */ - public getFilterBarChanged() { - return !_.isEqual( - FilterUtils.cleanFiltersForComparison(this.appState.filters), - FilterUtils.cleanFiltersForComparison(this.getLastSavedFilterBars()) - ); - } - - /** - * @param timeFilter - * @returns True if the time state has changed since the time saved with the dashboard. - */ - public getTimeChanged(timeFilter: Timefilter) { - return ( - !FilterUtils.areTimesEqual( - this.lastSavedDashboardFilters.timeFrom, - timeFilter.getTime().from - ) || - !FilterUtils.areTimesEqual(this.lastSavedDashboardFilters.timeTo, timeFilter.getTime().to) - ); - } - - public getViewMode() { - if (this.hideWriteControls) { - return ViewMode.VIEW; - } - if (this.stateContainer) { - return this.appState.viewMode; - } - // get viewMode should work properly even before the state container is created - return this.getInitialViewMode(); - } - - public getIsViewMode() { - return this.getViewMode() === ViewMode.VIEW; - } - - public getIsEditMode() { - return this.getViewMode() === ViewMode.EDIT; - } - - /** - * - * @returns True if the dashboard has changed since the last save (or, is new). - */ - public getIsDirty(timeFilter?: Timefilter) { - // Filter bar comparison is done manually (see cleanFiltersForComparison for the reason) and time picker - // changes are not tracked by the state monitor. - const hasTimeFilterChanged = timeFilter ? this.getFiltersChanged(timeFilter) : false; - return ( - this.hasUnsavedPanelState() || - (this.getIsEditMode() && (this.isDirty || hasTimeFilterChanged)) - ); - } - - public getPanels(): SavedDashboardPanel[] { - return this.appState.panels; - } - - public updatePanel(panelIndex: string, panelAttributes: any) { - const foundPanel = this.getPanels().find( - (panel: SavedDashboardPanel) => panel.panelIndex === panelIndex - ); - Object.assign(foundPanel, panelAttributes); - return foundPanel; - } - - /** - * @param timeFilter - * @returns An array of user friendly strings indicating the filter types that have changed. - */ - public getChangedFilterTypes(timeFilter: Timefilter) { - const changedFilters = []; - if (this.getFilterBarChanged()) { - changedFilters.push('filter'); - } - if (this.getQueryChanged()) { - changedFilters.push('query'); - } - if (this.savedDashboard.timeRestore && this.getTimeChanged(timeFilter)) { - changedFilters.push('time range'); - } - return changedFilters; - } - - /** - * @returns True if filters (query, filter bar filters, and time picker if time is stored - * with the dashboard) have changed since the last saved state (or if the dashboard hasn't been saved, - * the default state). - */ - public getFiltersChanged(timeFilter: Timefilter) { - return this.getChangedFilterTypes(timeFilter).length > 0; - } - - /** - * Updates timeFilter to match the time saved with the dashboard. - * @param timeFilter - * @param timeFilter.setTime - * @param timeFilter.setRefreshInterval - */ - public syncTimefilterWithDashboardTime(timeFilter: Timefilter) { - if (!this.getIsTimeSavedWithDashboard()) { - throw new Error( - i18n.translate('dashboard.stateManager.timeNotSavedWithDashboardErrorMessage', { - defaultMessage: 'The time is not saved with this dashboard so should not be synced.', - }) - ); - } - - if (this.savedDashboard.timeFrom && this.savedDashboard.timeTo) { - timeFilter.setTime({ - from: this.savedDashboard.timeFrom, - to: this.savedDashboard.timeTo, - }); - } - } - - /** - * Updates timeFilter to match the refreshInterval saved with the dashboard. - * @param timeFilter - */ - public syncTimefilterWithDashboardRefreshInterval(timeFilter: Timefilter) { - if (!this.getIsTimeSavedWithDashboard()) { - throw new Error( - i18n.translate('dashboard.stateManager.timeNotSavedWithDashboardErrorMessage', { - defaultMessage: 'The time is not saved with this dashboard so should not be synced.', - }) - ); - } - - if (this.savedDashboard.refreshInterval) { - timeFilter.setRefreshInterval(this.savedDashboard.refreshInterval); - } - } - - /** - * Synchronously writes current state to url - * returned boolean indicates whether the update happened and if history was updated - */ - private saveState({ replace }: { replace: boolean }): boolean { - // schedules setting current state to url - this.kbnUrlStateStorage.set( - STATE_STORAGE_KEY, - this.toUrlState(this.stateContainer.get()) - ); - // immediately forces scheduled updates and changes location - return !!this.kbnUrlStateStorage.kbnUrlControls.flush(replace); - } - - public setQuery(query: Query) { - this.stateContainer.transitions.set('query', query); - } - - /** - * Applies the current filter state to the dashboard. - * @param filter An array of filter bar filters. - */ - public applyFilters(query: Query, filters: Filter[]) { - this.savedDashboard.searchSource.setField('query', query); - this.savedDashboard.searchSource.setField('filter', filters); - this.stateContainer.transitions.set('query', query); - } - - public switchViewMode(newMode: ViewMode) { - this.stateContainer.transitions.set('viewMode', newMode); - this.restorePanels(); - } - - /** - * Destroys and cleans up this object when it's no longer used. - */ - public destroy() { - this.stateContainerChangeSub.unsubscribe(); - this.savedDashboard.destroy(); - if (this.stateSyncRef) { - this.stateSyncRef.stop(); - } - } - - public restorePanels() { - const unsavedState = this.getUnsavedPanelState(); - if (!unsavedState || unsavedState.panels?.length === 0) { - return; - } - this.stateContainer.set( - migrateAppState( - { - ...this.stateDefaults, - ...unsavedState, - ...this.kbnUrlStateStorage.get(STATE_STORAGE_KEY), - viewMode: this.getViewMode(), - }, - this.kibanaVersion, - this.usageCollection - ) - ); - } - - public clearUnsavedPanels() { - if (!this.allowByValueEmbeddables || !this.dashboardPanelStorage) { - return; - } - this.dashboardPanelStorage.clearPanels(this.savedDashboard?.id); - } - - public hasUnsavedPanelState(): boolean { - const panels = this.dashboardPanelStorage?.getPanels(this.savedDashboard?.id); - return panels !== undefined && panels.length > 0; - } - - private getUnsavedPanelState(): { panels?: SavedDashboardPanel[] } { - if (!this.allowByValueEmbeddables || this.getIsViewMode() || !this.dashboardPanelStorage) { - return {}; - } - const panels = this.dashboardPanelStorage.getPanels(this.savedDashboard?.id); - return panels ? { panels } : {}; - } - - private setUnsavedPanels(newPanels: SavedDashboardPanel[]) { - if ( - !this.allowByValueEmbeddables || - this.getIsViewMode() || - !this.getIsDirty() || - !this.dashboardPanelStorage - ) { - return; - } - this.dashboardPanelStorage.setPanels(this.savedDashboard?.id, newPanels); - } - - private toUrlState(state: DashboardAppState): DashboardAppStateInUrl { - if (this.getIsEditMode() && !this.allowByValueEmbeddables) { - return state; - } - const { panels, ...stateWithoutPanels } = state; - return stateWithoutPanels; - } - - private getInitialViewMode() { - if (this.hideWriteControls) { - return ViewMode.VIEW; - } - const viewModeFromUrl = this.kbnUrlStateStorage.get(STATE_STORAGE_KEY) - ?.viewMode; - if (viewModeFromUrl) { - return viewModeFromUrl; - } - return !this.savedDashboard.id || this.hasPendingEmbeddable() ? ViewMode.EDIT : ViewMode.VIEW; - } - - private checkIsDirty() { - // Filters need to be compared manually because they sometimes have a $$hashkey stored on the object. - // Query needs to be compared manually because saved legacy queries get migrated in app state automatically - const propsToIgnore: Array = ['viewMode', 'filters', 'query']; - - const initial = _.omit(this.stateDefaults, propsToIgnore); - const current = _.omit(this.stateContainer.get(), propsToIgnore); - return !_.isEqual(initial, current); - } -} diff --git a/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx b/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx index 847a190a6e083a..b6e2a7c4b8f021 100644 --- a/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx +++ b/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import _ from 'lodash'; import React from 'react'; import ReactDOM from 'react-dom'; import { I18nProvider } from '@kbn/i18n/react'; @@ -20,7 +21,6 @@ import { Container, PanelState, IEmbeddable, - ContainerInput, EmbeddableInput, EmbeddableStart, EmbeddableOutput, @@ -36,30 +36,13 @@ import { KibanaReactContextValue, } from '../../services/kibana_react'; import { PLACEHOLDER_EMBEDDABLE } from './placeholder'; -import { PanelPlacementMethod, IPanelPlacementArgs } from './panel/dashboard_panel_placement'; -import { DashboardAppCapabilities } from '../types'; +import { DashboardAppCapabilities, DashboardContainerInput } from '../../types'; import { PresentationUtilPluginStart } from '../../services/presentation_util'; +import { PanelPlacementMethod, IPanelPlacementArgs } from './panel/dashboard_panel_placement'; -export interface DashboardContainerInput extends ContainerInput { - dashboardCapabilities?: DashboardAppCapabilities; - refreshConfig?: RefreshInterval; - isEmbeddedExternally?: boolean; - isFullScreenMode: boolean; - expandedPanelId?: string; - timeRange: TimeRange; - description?: string; - useMargins: boolean; - syncColors?: boolean; - viewMode: ViewMode; - filters: Filter[]; - title: string; - query: Query; - panels: { - [panelId: string]: DashboardPanelState; - }; -} export interface DashboardContainerServices { ExitFullScreenButton: React.ComponentType; + presentationUtil: PresentationUtilPluginStart; SavedObjectFinder: React.ComponentType; notifications: CoreStart['notifications']; application: CoreStart['application']; @@ -69,7 +52,6 @@ export interface DashboardContainerServices { embeddable: EmbeddableStart; uiActions: UiActionsStart; http: CoreStart['http']; - presentationUtil: PresentationUtilPluginStart; } interface IndexSignature { @@ -104,7 +86,6 @@ const defaultCapabilities: DashboardAppCapabilities = { export class DashboardContainer extends Container { public readonly type = DASHBOARD_CONTAINER_TYPE; - public switchViewMode?: (newViewMode: ViewMode) => void; public getPanelCount = () => { return Object.keys(this.getInput().panels).length; @@ -134,7 +115,8 @@ export class DashboardContainer extends Container = {} ): DashboardPanelState { const panelState = super.createNewPanelState(factory, partial); - return createPanelState(panelState, this.input.panels); + const { newPanel } = createPanelState(panelState, this.input.panels); + return newPanel; } public showPlaceholderUntil( @@ -155,7 +137,8 @@ export class DashboardContainer extends Container; - const placeholderPanelState = createPanelState( + + const { otherPanels, newPanel: placeholderPanelState } = createPanelState( originalPanelState, this.input.panels, placementMethod, @@ -164,7 +147,7 @@ export class DashboardContainer extends Container - + , diff --git a/src/plugins/dashboard/public/application/embeddable/dashboard_container_by_value_renderer.tsx b/src/plugins/dashboard/public/application/embeddable/dashboard_container_by_value_renderer.tsx index 05e1e7eb9ec356..a4d96b557ac978 100644 --- a/src/plugins/dashboard/public/application/embeddable/dashboard_container_by_value_renderer.tsx +++ b/src/plugins/dashboard/public/application/embeddable/dashboard_container_by_value_renderer.tsx @@ -7,7 +7,7 @@ */ import * as React from 'react'; -import { DashboardContainerInput } from './dashboard_container'; +import { DashboardContainerInput } from '../..'; import { DashboardContainerFactory } from './dashboard_container_factory'; import { EmbeddableRenderer } from '../../services/embeddable'; diff --git a/src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx b/src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx index ff592742488f5d..2e984ccfa5ba9e 100644 --- a/src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx +++ b/src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx @@ -8,6 +8,10 @@ import { i18n } from '@kbn/i18n'; import { EmbeddablePersistableStateService } from 'src/plugins/embeddable/common'; + +import { DashboardContainerInput } from '../..'; +import { DASHBOARD_CONTAINER_TYPE } from './dashboard_constants'; +import { DashboardContainer, DashboardContainerServices } from './dashboard_container'; import { Container, ErrorEmbeddable, @@ -15,12 +19,6 @@ import { EmbeddableFactory, EmbeddableFactoryDefinition, } from '../../services/embeddable'; -import { - DashboardContainer, - DashboardContainerInput, - DashboardContainerServices, -} from './dashboard_container'; -import { DASHBOARD_CONTAINER_TYPE } from './dashboard_constants'; import { createExtract, createInject, diff --git a/src/plugins/dashboard/public/application/embeddable/empty_screen/__snapshots__/dashboard_empty_screen.test.tsx.snap b/src/plugins/dashboard/public/application/embeddable/empty_screen/__snapshots__/dashboard_empty_screen.test.tsx.snap index ae8943e9f6b3e3..9f56740fdac221 100644 --- a/src/plugins/dashboard/public/application/embeddable/empty_screen/__snapshots__/dashboard_empty_screen.test.tsx.snap +++ b/src/plugins/dashboard/public/application/embeddable/empty_screen/__snapshots__/dashboard_empty_screen.test.tsx.snap @@ -1025,30 +1025,7 @@ exports[`DashboardEmptyScreen renders correctly with view mode 1`] = ` className="euiTextColor euiTextColor--subdued" >

- Click - -   - - - - - -   - - in the menu bar above to start adding panels. + Click edit in the menu bar above to start adding panels.

diff --git a/src/plugins/dashboard/public/application/embeddable/empty_screen/dashboard_empty_screen.tsx b/src/plugins/dashboard/public/application/embeddable/empty_screen/dashboard_empty_screen.tsx index 6d5ff7e26958db..b2f1302c65c9c6 100644 --- a/src/plugins/dashboard/public/application/embeddable/empty_screen/dashboard_empty_screen.tsx +++ b/src/plugins/dashboard/public/application/embeddable/empty_screen/dashboard_empty_screen.tsx @@ -10,7 +10,6 @@ import React from 'react'; import { I18nProvider } from '@kbn/i18n/react'; import { EuiIcon, - EuiLink, EuiSpacer, EuiPageContent, EuiPageBody, @@ -24,7 +23,6 @@ import { emptyScreenStrings } from '../../../dashboard_strings'; export interface DashboardEmptyScreenProps { isEditMode?: boolean; - onLinkClick: () => void; uiSettings: IUiSettingsClient; http: HttpStart; isReadonlyMode?: boolean; @@ -32,7 +30,6 @@ export interface DashboardEmptyScreenProps { export function DashboardEmptyScreen({ isEditMode, - onLinkClick, uiSettings, http, isReadonlyMode, @@ -41,33 +38,7 @@ export function DashboardEmptyScreen({ const emptyStateGraphicURL = IS_DARK_THEME ? '/plugins/home/assets/welcome_graphic_dark_2x.png' : '/plugins/home/assets/welcome_graphic_light_2x.png'; - const paragraph = ( - description1: string | null, - description2: string, - linkText: string, - ariaLabel: string, - dataTestSubj?: string - ) => { - return ( - -

- {description1} - {description1 &&  } - - {linkText} - -   - {description2} -

-
- ); - }; - const enterEditModeParagraph = paragraph( - emptyScreenStrings.getHowToStartWorkingOnNewDashboardDescription1(), - emptyScreenStrings.getHowToStartWorkingOnNewDashboardDescription2(), - emptyScreenStrings.getHowToStartWorkingOnNewDashboardEditLinkText(), - emptyScreenStrings.getHowToStartWorkingOnNewDashboardEditLinkAriaLabel() - ); + const page = (mainText: string, showAdditionalParagraph?: boolean, additionalText?: string) => { return ( -
{enterEditModeParagraph}
+
+ +

{emptyScreenStrings.getHowToStartWorkingOnNewDashboardDescription()}

+
+
) : null} diff --git a/src/plugins/dashboard/public/application/embeddable/index.ts b/src/plugins/dashboard/public/application/embeddable/index.ts index 24b5362359d25b..a678dbea16a55f 100644 --- a/src/plugins/dashboard/public/application/embeddable/index.ts +++ b/src/plugins/dashboard/public/application/embeddable/index.ts @@ -10,7 +10,7 @@ export { DashboardContainerFactoryDefinition, DashboardContainerFactory, } from './dashboard_container_factory'; -export { DashboardContainer, DashboardContainerInput } from './dashboard_container'; +export { DashboardContainer } from './dashboard_container'; export { createPanelState } from './panel'; export * from './types'; diff --git a/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.test.ts b/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.test.ts index 7563d07154d6e7..97e078246aca6b 100644 --- a/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.test.ts +++ b/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.test.ts @@ -18,7 +18,7 @@ interface TestInput extends EmbeddableInput { const panels: { [key: string]: DashboardPanelState } = {}; test('createPanelState adds a new panel state in 0,0 position', () => { - const panelState = createPanelState( + const { newPanel: panelState } = createPanelState( { type: CONTACT_CARD_EMBEDDABLE, explicitInput: { test: 'hi', id: '123' }, @@ -37,7 +37,7 @@ test('createPanelState adds a new panel state in 0,0 position', () => { }); test('createPanelState adds a second new panel state', () => { - const panelState = createPanelState( + const { newPanel: panelState } = createPanelState( { type: CONTACT_CARD_EMBEDDABLE, explicitInput: { test: 'bye', id: '456' } }, panels ); @@ -51,7 +51,7 @@ test('createPanelState adds a second new panel state', () => { }); test('createPanelState adds a third new panel state', () => { - const panelState = createPanelState( + const { newPanel: panelState } = createPanelState( { type: CONTACT_CARD_EMBEDDABLE, explicitInput: { test: 'bye', id: '789' }, @@ -68,7 +68,7 @@ test('createPanelState adds a third new panel state', () => { test('createPanelState adds a new panel state in the top most position', () => { delete panels['456']; - const panelState = createPanelState( + const { newPanel: panelState } = createPanelState( { type: CONTACT_CARD_EMBEDDABLE, explicitInput: { test: 'bye', id: '987' }, diff --git a/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.ts b/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.ts index 775ac7d7078ad1..46a75ca06bdb53 100644 --- a/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.ts +++ b/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.ts @@ -26,7 +26,10 @@ export function createPanelState< currentPanels: { [key: string]: DashboardPanelState }, placementMethod?: PanelPlacementMethod, placementArgs?: TPlacementMethodArgs -): DashboardPanelState { +): { + newPanel: DashboardPanelState; + otherPanels: { [key: string]: DashboardPanelState }; +} { const defaultPlacementArgs = { width: DEFAULT_PANEL_WIDTH, height: DEFAULT_PANEL_HEIGHT, @@ -39,15 +42,18 @@ export function createPanelState< } : defaultPlacementArgs; - const gridDataLocation = placementMethod + const { newPanelPlacement, otherPanels } = placementMethod ? placementMethod(finalPlacementArgs as TPlacementMethodArgs) : findTopLeftMostOpenSpace(defaultPlacementArgs); return { - gridData: { - ...gridDataLocation, - i: panelState.explicitInput.id, + newPanel: { + gridData: { + ...newPanelPlacement, + i: panelState.explicitInput.id, + }, + ...panelState, }, - ...panelState, + otherPanels, }; } diff --git a/src/plugins/dashboard/public/application/embeddable/panel/dashboard_panel_placement.ts b/src/plugins/dashboard/public/application/embeddable/panel/dashboard_panel_placement.ts index c8e5fcbe4240b8..64b398200db1d3 100644 --- a/src/plugins/dashboard/public/application/embeddable/panel/dashboard_panel_placement.ts +++ b/src/plugins/dashboard/public/application/embeddable/panel/dashboard_panel_placement.ts @@ -13,7 +13,12 @@ import { DashboardPanelState, DASHBOARD_GRID_COLUMN_COUNT } from '..'; export type PanelPlacementMethod = ( args: PlacementArgs -) => Omit; +) => PanelPlacementMethodReturn; + +interface PanelPlacementMethodReturn { + newPanelPlacement: Omit; + otherPanels: { [key: string]: DashboardPanelState }; +} export interface IPanelPlacementArgs { width: number; @@ -30,7 +35,7 @@ export function findTopLeftMostOpenSpace({ width, height, currentPanels, -}: IPanelPlacementArgs): Omit { +}: IPanelPlacementArgs): PanelPlacementMethodReturn { let maxY = -1; const currentPanelsArray = Object.values(currentPanels); @@ -40,7 +45,7 @@ export function findTopLeftMostOpenSpace({ // Handle case of empty grid. if (maxY < 0) { - return { x: 0, y: 0, w: width, h: height }; + return { newPanelPlacement: { x: 0, y: 0, w: width, h: height }, otherPanels: currentPanels }; } const grid = new Array(maxY); @@ -80,7 +85,10 @@ export function findTopLeftMostOpenSpace({ if (spaceIsEmpty && fitsPanelWidth && fitsPanelHeight) { // Found space - return { x, y, w: width, h: height }; + return { + newPanelPlacement: { x, y, w: width, h: height }, + otherPanels: currentPanels, + }; } else if (grid[h][w] === 1) { // x, y spot doesn't work, break. break; @@ -90,7 +98,7 @@ export function findTopLeftMostOpenSpace({ } } } - return { x: 0, y: maxY, w: width, h: height }; + return { newPanelPlacement: { x: 0, y: maxY, w: width, h: height }, otherPanels: currentPanels }; } interface IplacementDirection { @@ -123,15 +131,15 @@ export function placePanelBeside({ height, currentPanels, placeBesideId, -}: IPanelPlacementBesideArgs): Omit { +}: IPanelPlacementBesideArgs): PanelPlacementMethodReturn { const panelToPlaceBeside = currentPanels[placeBesideId]; if (!panelToPlaceBeside) { throw new PanelNotFoundError(); } const beside = panelToPlaceBeside.gridData; - const otherPanels: GridData[] = []; + const otherPanelGridData: GridData[] = []; _.forOwn(currentPanels, (panel: DashboardPanelState, key: string | undefined) => { - otherPanels.push(panel.gridData); + otherPanelGridData.push(panel.gridData); }); const possiblePlacementDirections: IplacementDirection[] = [ @@ -147,7 +155,7 @@ export function placePanelBeside({ direction.grid.x + direction.grid.w <= DASHBOARD_GRID_COLUMN_COUNT && direction.grid.y >= 0 ) { - const intersection = otherPanels.some((currentPanelGrid: GridData) => { + const intersection = otherPanelGridData.some((currentPanelGrid: GridData) => { return ( direction.grid.x + direction.grid.w > currentPanelGrid.x && direction.grid.x < currentPanelGrid.x + currentPanelGrid.w && @@ -156,7 +164,7 @@ export function placePanelBeside({ ); }); if (!intersection) { - return direction.grid; + return { newPanelPlacement: direction.grid, otherPanels: currentPanels }; } } else { direction.fits = false; @@ -168,7 +176,8 @@ export function placePanelBeside({ * 2. place the cloned panel to the bottom * 3. reposition the panels after the cloned panel in the grid */ - const grid = otherPanels.sort(comparePanels); + const otherPanels = { ...currentPanels }; + const grid = otherPanelGridData.sort(comparePanels); let position = 0; for (position; position < grid.length; position++) { @@ -182,13 +191,13 @@ export function placePanelBeside({ const diff = bottomPlacement.grid.y + bottomPlacement.grid.h - - currentPanels[originalPositionInTheGrid].gridData.y; + otherPanels[originalPositionInTheGrid].gridData.y; for (let j = position + 1; j < grid.length; j++) { originalPositionInTheGrid = grid[j].i; - const movedPanel = _.cloneDeep(currentPanels[originalPositionInTheGrid]); + const movedPanel = _.cloneDeep(otherPanels[originalPositionInTheGrid]); movedPanel.gridData.y = movedPanel.gridData.y + diff; - currentPanels[originalPositionInTheGrid] = movedPanel; + otherPanels[originalPositionInTheGrid] = movedPanel; } - return bottomPlacement.grid; + return { newPanelPlacement: bottomPlacement.grid, otherPanels }; } diff --git a/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx index 442bae8dd1dff4..cbe10438e578aa 100644 --- a/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx +++ b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx @@ -15,7 +15,6 @@ import { context } from '../../../services/kibana_react'; import { DashboardEmptyScreen } from '../empty_screen/dashboard_empty_screen'; export interface DashboardViewportProps { - switchViewMode?: (newViewMode: ViewMode) => void; container: DashboardContainer; } @@ -120,7 +119,6 @@ export class DashboardViewport extends React.Component this.props.switchViewMode?.(ViewMode.EDIT)} isEditMode={isEditMode} uiSettings={this.context.services.uiSettings} http={this.context.services.http} diff --git a/src/plugins/dashboard/public/application/hooks/index.ts b/src/plugins/dashboard/public/application/hooks/index.ts index 09b7aea9c6a6da..d9c3cd231c3c3b 100644 --- a/src/plugins/dashboard/public/application/hooks/index.ts +++ b/src/plugins/dashboard/public/application/hooks/index.ts @@ -6,7 +6,4 @@ * Side Public License, v 1. */ -export { useSavedDashboard } from './use_saved_dashboard'; -export { useDashboardContainer } from './use_dashboard_container'; -export { useDashboardBreadcrumbs } from './use_dashboard_breadcrumbs'; -export { useDashboardStateManager } from './use_dashboard_state_manager'; +export { useDashboardAppState } from './use_dashboard_app_state'; diff --git a/src/plugins/dashboard/public/application/hooks/use_dashboard_app_state.test.tsx b/src/plugins/dashboard/public/application/hooks/use_dashboard_app_state.test.tsx new file mode 100644 index 00000000000000..0e15c655749678 --- /dev/null +++ b/src/plugins/dashboard/public/application/hooks/use_dashboard_app_state.test.tsx @@ -0,0 +1,337 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { of } from 'rxjs'; +import { Provider } from 'react-redux'; +import { createBrowserHistory } from 'history'; +import { renderHook, act, RenderHookResult } from '@testing-library/react-hooks'; + +import { DashboardContainer } from '..'; +import { DashboardSessionStorage } from '../lib'; +import { coreMock } from '../../../../../core/public/mocks'; +import { DashboardConstants } from '../../dashboard_constants'; +import { dataPluginMock } from '../../../../data/public/mocks'; +import { SavedObjectLoader } from '../../services/saved_objects'; +import { DashboardAppServices, DashboardAppState } from '../../types'; +import { KibanaContextProvider } from '../../../../kibana_react/public'; +import { EmbeddableFactory, ViewMode } from '../../services/embeddable'; +import { dashboardStateStore, setDescription, setViewMode } from '../state'; +import { DashboardContainerServices } from '../embeddable/dashboard_container'; +import { createKbnUrlStateStorage, defer } from '../../../../kibana_utils/public'; +import { Filter, IIndexPattern, IndexPatternsContract } from '../../services/data'; +import { useDashboardAppState, UseDashboardStateProps } from './use_dashboard_app_state'; +import { + getSampleDashboardInput, + getSavedDashboardMock, + makeDefaultServices, +} from '../test_helpers'; + +interface SetupEmbeddableFactoryReturn { + finalizeEmbeddableCreation: () => void; + dashboardContainer: DashboardContainer; + dashboardDestroySpy: jest.SpyInstance; +} + +interface RenderDashboardStateHookReturn { + embeddableFactoryResult: SetupEmbeddableFactoryReturn; + renderHookResult: RenderHookResult, DashboardAppState>; + services: DashboardAppServices; + props: UseDashboardStateProps; +} + +const originalDashboardEmbeddableId = 'originalDashboardEmbeddableId'; + +const createDashboardAppStateProps = (): UseDashboardStateProps => ({ + kbnUrlStateStorage: createKbnUrlStateStorage(), + savedDashboardId: 'testDashboardId', + history: createBrowserHistory(), + isEmbeddedExternally: false, + redirectTo: jest.fn(), +}); + +const createDashboardAppStateServices = () => { + const defaults = makeDefaultServices(); + const indexPatterns = {} as IndexPatternsContract; + const defaultIndexPattern = { id: 'foo', fields: [{ name: 'bar' }] } as IIndexPattern; + indexPatterns.ensureDefaultIndexPattern = jest + .fn() + .mockImplementation(() => Promise.resolve(true)); + indexPatterns.getDefault = jest + .fn() + .mockImplementation(() => Promise.resolve(defaultIndexPattern)); + + const data = dataPluginMock.createStartContract(); + data.query.filterManager.getUpdates$ = jest.fn().mockImplementation(() => of(void 0)); + data.query.queryString.getUpdates$ = jest.fn().mockImplementation(() => of({})); + data.query.timefilter.timefilter.getTimeUpdate$ = jest.fn().mockImplementation(() => of(void 0)); + data.query.timefilter.timefilter.getRefreshIntervalUpdate$ = jest + .fn() + .mockImplementation(() => of(void 0)); + + return { ...defaults, indexPatterns, data }; +}; + +const setupEmbeddableFactory = ( + services: DashboardAppServices, + id: string +): SetupEmbeddableFactoryReturn => { + const coreStart = coreMock.createStart(); + const containerOptions = ({ + notifications: services.core.notifications, + savedObjectMetaData: {} as unknown, + ExitFullScreenButton: () => null, + embeddable: services.embeddable, + uiSettings: services.uiSettings, + SavedObjectFinder: () => null, + overlays: coreStart.overlays, + application: {} as unknown, + inspector: {} as unknown, + uiActions: {} as unknown, + http: coreStart.http, + } as unknown) as DashboardContainerServices; + + const dashboardContainer = new DashboardContainer( + { ...getSampleDashboardInput(), id }, + containerOptions + ); + const deferEmbeddableCreate = defer(); + services.embeddable.getEmbeddableFactory = jest.fn().mockImplementation( + () => + (({ + create: () => deferEmbeddableCreate.promise, + } as unknown) as EmbeddableFactory) + ); + const dashboardDestroySpy = jest.spyOn(dashboardContainer, 'destroy'); + + return { + dashboardContainer, + dashboardDestroySpy, + finalizeEmbeddableCreation: () => { + act(() => { + deferEmbeddableCreate.resolve(dashboardContainer); + }); + }, + }; +}; + +const renderDashboardAppStateHook = ({ + partialProps, + partialServices, +}: { + partialProps?: Partial; + partialServices?: Partial; +}): RenderDashboardStateHookReturn => { + const props = { ...createDashboardAppStateProps(), ...(partialProps ?? {}) }; + const services = { ...createDashboardAppStateServices(), ...(partialServices ?? {}) }; + const embeddableFactoryResult = setupEmbeddableFactory(services, originalDashboardEmbeddableId); + const renderHookResult = renderHook( + (replaceProps: Partial) => + useDashboardAppState({ ...props, ...replaceProps }), + { + wrapper: ({ children }) => ( + + {children} + + ), + } + ); + return { embeddableFactoryResult, renderHookResult, services, props }; +}; + +describe('Dashboard container lifecycle', () => { + test('Dashboard container is destroyed on unmount', async () => { + const { renderHookResult, embeddableFactoryResult } = renderDashboardAppStateHook({}); + embeddableFactoryResult.finalizeEmbeddableCreation(); + await renderHookResult.waitForNextUpdate(); + + expect(embeddableFactoryResult.dashboardContainer).toBe( + renderHookResult.result.current.dashboardContainer + ); + expect(embeddableFactoryResult.dashboardDestroySpy).not.toBeCalled(); + renderHookResult.unmount(); + expect(embeddableFactoryResult.dashboardDestroySpy).toBeCalled(); + }); + + test('Old dashboard container is destroyed when new dashboardId is given', async () => { + const { renderHookResult, embeddableFactoryResult, services } = renderDashboardAppStateHook({}); + const getResult = () => renderHookResult.result.current; + + // on initial render dashboard container is undefined + expect(getResult().dashboardContainer).toBeUndefined(); + embeddableFactoryResult.finalizeEmbeddableCreation(); + + await renderHookResult.waitForNextUpdate(); + expect(embeddableFactoryResult.dashboardContainer).toBe(getResult().dashboardContainer); + expect(embeddableFactoryResult.dashboardDestroySpy).not.toBeCalled(); + + const newDashboardId = 'wow_a_new_dashboard_id'; + const embeddableFactoryNew = setupEmbeddableFactory(services, newDashboardId); + renderHookResult.rerender({ savedDashboardId: newDashboardId }); + + embeddableFactoryNew.finalizeEmbeddableCreation(); + await renderHookResult.waitForNextUpdate(); + + expect(embeddableFactoryNew.dashboardContainer).toEqual(getResult().dashboardContainer); + expect(embeddableFactoryNew.dashboardDestroySpy).not.toBeCalled(); + expect(embeddableFactoryResult.dashboardDestroySpy).toBeCalled(); + }); + + test('Dashboard container is destroyed if dashboard id is changed before container is resolved', async () => { + const { renderHookResult, embeddableFactoryResult, services } = renderDashboardAppStateHook({}); + const getResult = () => renderHookResult.result.current; + + // on initial render dashboard container is undefined + expect(getResult().dashboardContainer).toBeUndefined(); + await act(() => Promise.resolve()); // wait for the original savedDashboard to be loaded... + + const newDashboardId = 'wow_a_new_dashboard_id'; + const embeddableFactoryNew = setupEmbeddableFactory(services, newDashboardId); + + renderHookResult.rerender({ savedDashboardId: newDashboardId }); + await act(() => Promise.resolve()); // wait for the new savedDashboard to be loaded... + embeddableFactoryNew.finalizeEmbeddableCreation(); + await renderHookResult.waitForNextUpdate(); + expect(embeddableFactoryNew.dashboardContainer).toBe(getResult().dashboardContainer); + expect(embeddableFactoryNew.dashboardDestroySpy).not.toBeCalled(); + + embeddableFactoryResult.finalizeEmbeddableCreation(); + await act(() => Promise.resolve()); // Can't use waitFor from hooks, because there is no hook update + expect(embeddableFactoryNew.dashboardContainer).toBe(getResult().dashboardContainer); + expect(embeddableFactoryNew.dashboardDestroySpy).not.toBeCalled(); + expect(embeddableFactoryResult.dashboardDestroySpy).toBeCalled(); + }); +}); + +describe('Dashboard initial state', () => { + it('Extracts state from Dashboard Saved Object', async () => { + const { renderHookResult, embeddableFactoryResult } = renderDashboardAppStateHook({}); + const getResult = () => renderHookResult.result.current; + + // saved dashboard isn't applied until after the dashboard embeddable has been created. + expect(getResult().savedDashboard).toBeUndefined(); + + embeddableFactoryResult.finalizeEmbeddableCreation(); + await renderHookResult.waitForNextUpdate(); + + expect(getResult().savedDashboard).toBeDefined(); + expect(getResult().savedDashboard?.title).toEqual( + getResult().getLatestDashboardState?.().title + ); + }); + + it('Sets initial time range and filters from saved dashboard', async () => { + const savedDashboards = {} as SavedObjectLoader; + savedDashboards.get = jest.fn().mockImplementation((id?: string) => + Promise.resolve( + getSavedDashboardMock({ + getFilters: () => [({ meta: { test: 'filterMeTimbers' } } as unknown) as Filter], + timeRestore: true, + timeFrom: 'now-13d', + timeTo: 'now', + id, + }) + ) + ); + const partialServices: Partial = { savedDashboards }; + const { renderHookResult, embeddableFactoryResult, services } = renderDashboardAppStateHook({ + partialServices, + }); + const getResult = () => renderHookResult.result.current; + + embeddableFactoryResult.finalizeEmbeddableCreation(); + await renderHookResult.waitForNextUpdate(); + + expect(getResult().getLatestDashboardState?.().timeRestore).toEqual(true); + expect(services.data.query.timefilter.timefilter.setTime).toHaveBeenCalledWith({ + from: 'now-13d', + to: 'now', + }); + expect(services.data.query.filterManager.setAppFilters).toHaveBeenCalledWith([ + ({ meta: { test: 'filterMeTimbers' } } as unknown) as Filter, + ]); + }); + + it('Combines session state and URL state into initial state', async () => { + const dashboardSessionStorage = ({ + getState: jest + .fn() + .mockReturnValue({ viewMode: ViewMode.EDIT, description: 'this should be overwritten' }), + } as unknown) as DashboardSessionStorage; + const kbnUrlStateStorage = createKbnUrlStateStorage(); + kbnUrlStateStorage.set('_a', { description: 'with this' }); + const { renderHookResult, embeddableFactoryResult } = renderDashboardAppStateHook({ + partialProps: { kbnUrlStateStorage }, + partialServices: { dashboardSessionStorage }, + }); + const getResult = () => renderHookResult.result.current; + + embeddableFactoryResult.finalizeEmbeddableCreation(); + await renderHookResult.waitForNextUpdate(); + expect(getResult().getLatestDashboardState?.().description).toEqual('with this'); + expect(getResult().getLatestDashboardState?.().viewMode).toEqual(ViewMode.EDIT); + }); +}); + +describe('Dashboard state sync', () => { + let defaultDashboardAppStateHookResult: RenderDashboardStateHookReturn; + const getResult = () => defaultDashboardAppStateHookResult.renderHookResult.result.current; + + beforeEach(async () => { + DashboardConstants.CHANGE_APPLY_DEBOUNCE = 0; + DashboardConstants.CHANGE_CHECK_DEBOUNCE = 0; + defaultDashboardAppStateHookResult = renderDashboardAppStateHook({}); + defaultDashboardAppStateHookResult.embeddableFactoryResult.finalizeEmbeddableCreation(); + await defaultDashboardAppStateHookResult.renderHookResult.waitForNextUpdate(); + }); + + it('Updates Dashboard container input when state changes', async () => { + const { embeddableFactoryResult } = defaultDashboardAppStateHookResult; + embeddableFactoryResult.dashboardContainer.updateInput = jest.fn(); + act(() => { + dashboardStateStore.dispatch(setDescription('Well hello there new description')); + }); + await act(async () => { + await new Promise((resolve) => setTimeout(resolve, 3)); // So that $triggerDashboardRefresh.next is called + }); + expect(embeddableFactoryResult.dashboardContainer.updateInput).toHaveBeenCalledWith( + expect.objectContaining({ description: 'Well hello there new description' }) + ); + }); + + it('Updates state when dashboard container input changes', async () => { + const { embeddableFactoryResult } = defaultDashboardAppStateHookResult; + expect(getResult().getLatestDashboardState?.().fullScreenMode).toBe(false); + act(() => { + embeddableFactoryResult.dashboardContainer.updateInput({ + isFullScreenMode: true, + }); + }); + await act(() => Promise.resolve()); + expect(getResult().getLatestDashboardState?.().fullScreenMode).toBe(true); + }); + + it('pushes unsaved changes to the session storage', async () => { + const { services } = defaultDashboardAppStateHookResult; + expect(getResult().getLatestDashboardState?.().fullScreenMode).toBe(false); + act(() => { + dashboardStateStore.dispatch(setViewMode(ViewMode.EDIT)); // session storage is only populated in edit mode + dashboardStateStore.dispatch(setDescription('Wow an even cooler description.')); + }); + await act(async () => { + await new Promise((resolve) => setTimeout(resolve, 3)); + }); + expect(services.dashboardSessionStorage.setState).toHaveBeenCalledWith( + 'testDashboardId', + expect.objectContaining({ + description: 'Wow an even cooler description.', + viewMode: ViewMode.EDIT, + }) + ); + }); +}); diff --git a/src/plugins/dashboard/public/application/hooks/use_dashboard_app_state.ts b/src/plugins/dashboard/public/application/hooks/use_dashboard_app_state.ts new file mode 100644 index 00000000000000..e9a5275300ffe9 --- /dev/null +++ b/src/plugins/dashboard/public/application/hooks/use_dashboard_app_state.ts @@ -0,0 +1,351 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import _ from 'lodash'; +import { History } from 'history'; +import { debounceTime } from 'rxjs/operators'; +import { useCallback, useEffect, useMemo, useState } from 'react'; +import { BehaviorSubject, combineLatest, Subject } from 'rxjs'; + +import { DashboardConstants } from '../..'; +import { ViewMode } from '../../services/embeddable'; +import { useKibana } from '../../services/kibana_react'; +import { getNewDashboardTitle } from '../../dashboard_strings'; +import { IKbnUrlStateStorage } from '../../services/kibana_utils'; +import { setDashboardState, useDashboardDispatch, useDashboardSelector } from '../state'; +import { + DashboardBuildContext, + DashboardAppServices, + DashboardAppState, + DashboardRedirect, + DashboardState, +} from '../../types'; +import { + tryDestroyDashboardContainer, + syncDashboardContainerInput, + savedObjectToDashboardState, + syncDashboardIndexPatterns, + syncDashboardFilterState, + loadSavedDashboardState, + buildDashboardContainer, + loadDashboardUrlState, + diffDashboardState, + areTimeRangesEqual, +} from '../lib'; + +export interface UseDashboardStateProps { + history: History; + savedDashboardId?: string; + redirectTo: DashboardRedirect; + isEmbeddedExternally: boolean; + kbnUrlStateStorage: IKbnUrlStateStorage; +} + +export const useDashboardAppState = ({ + history, + redirectTo, + savedDashboardId, + kbnUrlStateStorage, + isEmbeddedExternally, +}: UseDashboardStateProps) => { + const dispatchDashboardStateChange = useDashboardDispatch(); + const dashboardState = useDashboardSelector((state) => state.dashboardStateReducer); + + /** + * Dashboard app state is the return value for this hook and contains interaction points that the rest of the app can use + * to read or manipulate dashboard state. + */ + const [dashboardAppState, setDashboardAppState] = useState(() => ({ + $onDashboardStateChange: new BehaviorSubject({} as DashboardState), + $triggerDashboardRefresh: new Subject<{ force?: boolean }>(), + })); + + /** + * Last saved state is diffed against the current dashboard state any time either changes. This is used to set the + * unsaved changes portion of the dashboardAppState. + */ + const [lastSavedState, setLastSavedState] = useState(); + const $onLastSavedStateChange = useMemo(() => new Subject(), []); + + /** + * Unpack services + */ + const services = useKibana().services; + const { + data, + core, + chrome, + embeddable, + indexPatterns, + usageCollection, + savedDashboards, + initializerContext, + savedObjectsTagging, + dashboardCapabilities, + dashboardSessionStorage, + } = services; + const { docTitle } = chrome; + const { notifications } = core; + const { query, search } = data; + const { getStateTransfer } = embeddable; + const { version: kibanaVersion } = initializerContext.env.packageInfo; + + /** + * This useEffect triggers when the dashboard ID changes, and is in charge of loading the saved dashboard, + * fetching the initial state, building the Dashboard Container embeddable, and setting up all state syncing. + */ + useEffect(() => { + // fetch incoming embeddable from state transfer service. + const incomingEmbeddable = getStateTransfer().getIncomingEmbeddablePackage( + DashboardConstants.DASHBOARDS_ID, + true + ); + + let canceled = false; + let onDestroy: () => void; + + /** + * The dashboard build context is a collection of all of the services and props required in subsequent steps to build the dashboard + * from the dashboardId. This build context doesn't contain any extrenuous services. + */ + const dashboardBuildContext: DashboardBuildContext = { + query, + search, + history, + embeddable, + indexPatterns, + notifications, + kibanaVersion, + savedDashboards, + kbnUrlStateStorage, + initializerContext, + isEmbeddedExternally, + dashboardCapabilities, + dispatchDashboardStateChange, + $checkForUnsavedChanges: new Subject(), + $onDashboardStateChange: dashboardAppState.$onDashboardStateChange, + $triggerDashboardRefresh: dashboardAppState.$triggerDashboardRefresh, + getLatestDashboardState: () => dashboardAppState.$onDashboardStateChange.value, + }; + + (async () => { + /** + * Load and unpack state from dashboard saved object. + */ + const loadSavedDashboardResult = await loadSavedDashboardState({ + ...dashboardBuildContext, + savedDashboardId, + }); + if (canceled || !loadSavedDashboardResult) return; + const { savedDashboard, savedDashboardState } = loadSavedDashboardResult; + + /** + * Combine initial state from the saved object, session storage, and URL, then dispatch it to Redux. + */ + const dashboardSessionStorageState = dashboardSessionStorage.getState(savedDashboardId) || {}; + const dashboardURLState = loadDashboardUrlState(dashboardBuildContext); + const initialDashboardState = { + ...savedDashboardState, + ...dashboardSessionStorageState, + ...dashboardURLState, + + // if there is an incoming embeddable, dashboard always needs to be in edit mode to receive it. + ...(incomingEmbeddable ? { viewMode: ViewMode.EDIT } : {}), + }; + dispatchDashboardStateChange(setDashboardState(initialDashboardState)); + + /** + * Start syncing dashboard state with the Query, Filters and Timepicker from the Query Service. + */ + const { applyFilters, stopSyncingDashboardFilterState } = syncDashboardFilterState({ + ...dashboardBuildContext, + initialDashboardState, + savedDashboard, + }); + + /** + * Build the dashboard container embeddable, and apply the incoming embeddable if it exists. + */ + const dashboardContainer = await buildDashboardContainer({ + ...dashboardBuildContext, + initialDashboardState, + incomingEmbeddable, + savedDashboard, + data, + }); + if (canceled || !dashboardContainer) { + tryDestroyDashboardContainer(dashboardContainer); + return; + } + + /** + * Start syncing index patterns between the Query Service and the Dashboard Container. + */ + const indexPatternsSubscription = syncDashboardIndexPatterns({ + dashboardContainer, + indexPatterns: dashboardBuildContext.indexPatterns, + onUpdateIndexPatterns: (newIndexPatterns) => + setDashboardAppState((s) => ({ ...s, indexPatterns: newIndexPatterns })), + }); + + /** + * Set up the two way syncing between the Dashboard Container and the Redux Store. + */ + const stopSyncingContainerInput = syncDashboardContainerInput({ + ...dashboardBuildContext, + dashboardContainer, + savedDashboard, + applyFilters, + }); + + /** + * Any time the redux state, or the last saved state changes, compare them, set the unsaved + * changes state, and and push the unsaved changes to session storage. + */ + const { timefilter } = dashboardBuildContext.query.timefilter; + const lastSavedSubscription = combineLatest([ + $onLastSavedStateChange, + dashboardAppState.$onDashboardStateChange, + dashboardBuildContext.$checkForUnsavedChanges, + ]) + .pipe(debounceTime(DashboardConstants.CHANGE_CHECK_DEBOUNCE)) + .subscribe((states) => { + const [lastSaved, current] = states; + const unsavedChanges = + current.viewMode === ViewMode.EDIT ? diffDashboardState(lastSaved, current) : {}; + + if (current.viewMode === ViewMode.EDIT) { + const savedTimeChanged = + lastSaved.timeRestore && + !areTimeRangesEqual( + { + from: savedDashboard?.timeFrom, + to: savedDashboard?.timeTo, + }, + timefilter.getTime() + ); + const hasUnsavedChanges = Object.keys(unsavedChanges).length > 0 || savedTimeChanged; + setDashboardAppState((s) => ({ ...s, hasUnsavedChanges })); + } + + unsavedChanges.viewMode = current.viewMode; // always push view mode into session store. + dashboardSessionStorage.setState(savedDashboardId, unsavedChanges); + }); + + /** + * initialize the last saved state, and build a callback which can be used to update + * the last saved state on save. + */ + setLastSavedState(savedDashboardState); + dashboardBuildContext.$checkForUnsavedChanges.next(); + const updateLastSavedState = () => { + setLastSavedState( + savedObjectToDashboardState({ + hideWriteControls: dashboardBuildContext.dashboardCapabilities.hideWriteControls, + version: dashboardBuildContext.kibanaVersion, + savedObjectsTagging, + usageCollection, + savedDashboard, + }) + ); + }; + + /** + * Apply changes to the dashboard app state, and set the document title + */ + docTitle.change(savedDashboardState.title || getNewDashboardTitle()); + setDashboardAppState((s) => ({ + ...s, + applyFilters, + savedDashboard, + dashboardContainer, + updateLastSavedState, + getLatestDashboardState: dashboardBuildContext.getLatestDashboardState, + })); + + onDestroy = () => { + stopSyncingContainerInput(); + stopSyncingDashboardFilterState(); + lastSavedSubscription.unsubscribe(); + indexPatternsSubscription.unsubscribe(); + tryDestroyDashboardContainer(dashboardContainer); + setDashboardAppState((state) => ({ + ...state, + dashboardContainer: undefined, + })); + }; + })(); + return () => { + canceled = true; + onDestroy?.(); + }; + }, [ + dashboardAppState.$triggerDashboardRefresh, + dashboardAppState.$onDashboardStateChange, + dispatchDashboardStateChange, + $onLastSavedStateChange, + dashboardSessionStorage, + dashboardCapabilities, + isEmbeddedExternally, + kbnUrlStateStorage, + savedObjectsTagging, + initializerContext, + savedDashboardId, + getStateTransfer, + savedDashboards, + usageCollection, + notifications, + indexPatterns, + kibanaVersion, + embeddable, + docTitle, + history, + search, + query, + data, + ]); + + /** + * rebuild reset to last saved state callback whenever last saved state changes + */ + const resetToLastSavedState = useCallback(() => { + if ( + !lastSavedState || + !dashboardAppState.savedDashboard || + !dashboardAppState.getLatestDashboardState + ) { + return; + } + + if (dashboardAppState.getLatestDashboardState().timeRestore) { + const { timefilter } = data.query.timefilter; + const { timeFrom: from, timeTo: to, refreshInterval } = dashboardAppState.savedDashboard; + if (from && to) timefilter.setTime({ from, to }); + if (refreshInterval) timefilter.setRefreshInterval(refreshInterval); + } + dispatchDashboardStateChange(setDashboardState(lastSavedState)); + }, [lastSavedState, dashboardAppState, data.query.timefilter, dispatchDashboardStateChange]); + + /** + * publish state to the state change observable when redux state changes + */ + useEffect(() => { + if (!dashboardState || Object.keys(dashboardState).length === 0) return; + dashboardAppState.$onDashboardStateChange.next(dashboardState); + }, [dashboardAppState.$onDashboardStateChange, dashboardState]); + + /** + * push last saved state to the state change observable when last saved state changes + */ + useEffect(() => { + if (!lastSavedState) return; + $onLastSavedStateChange.next(lastSavedState); + }, [$onLastSavedStateChange, lastSavedState]); + + return { ...dashboardAppState, resetToLastSavedState }; +}; diff --git a/src/plugins/dashboard/public/application/hooks/use_dashboard_breadcrumbs.ts b/src/plugins/dashboard/public/application/hooks/use_dashboard_breadcrumbs.ts deleted file mode 100644 index 50465cc4ab58b2..00000000000000 --- a/src/plugins/dashboard/public/application/hooks/use_dashboard_breadcrumbs.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { useEffect } from 'react'; -import _ from 'lodash'; - -import { useKibana } from '../../services/kibana_react'; - -import { DashboardStateManager } from '../dashboard_state_manager'; -import { getDashboardBreadcrumb, getDashboardTitle } from '../../dashboard_strings'; -import { DashboardAppServices, DashboardRedirect } from '../types'; - -export const useDashboardBreadcrumbs = ( - dashboardStateManager: DashboardStateManager | null, - redirectTo: DashboardRedirect -) => { - const { data, core, chrome } = useKibana().services; - - // Destructure and rename services; makes the Effect hook more specific, makes later - // abstraction of service dependencies easier. - const { setBreadcrumbs } = chrome; - const { timefilter } = data.query.timefilter; - const { openConfirm } = core.overlays; - - // Sync breadcrumbs when Dashboard State Manager changes - useEffect(() => { - if (!dashboardStateManager) { - return; - } - - setBreadcrumbs([ - { - text: getDashboardBreadcrumb(), - 'data-test-subj': 'dashboardListingBreadcrumb', - onClick: () => { - redirectTo({ destination: 'listing' }); - }, - }, - { - text: getDashboardTitle( - dashboardStateManager.getTitle(), - dashboardStateManager.getViewMode(), - dashboardStateManager.isNew() - ), - }, - ]); - }, [dashboardStateManager, timefilter, openConfirm, redirectTo, setBreadcrumbs]); -}; diff --git a/src/plugins/dashboard/public/application/hooks/use_dashboard_container.test.tsx b/src/plugins/dashboard/public/application/hooks/use_dashboard_container.test.tsx deleted file mode 100644 index 196af9a171dd8b..00000000000000 --- a/src/plugins/dashboard/public/application/hooks/use_dashboard_container.test.tsx +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { useDashboardContainer } from './use_dashboard_container'; -import { renderHook, act } from '@testing-library/react-hooks'; -import { KibanaContextProvider } from '../../../../kibana_react/public'; -import React from 'react'; -import { DashboardStateManager } from '../dashboard_state_manager'; -import { getSavedDashboardMock } from '../test_helpers'; -import { createKbnUrlStateStorage, defer } from '../../../../kibana_utils/public'; -import { createBrowserHistory } from 'history'; -import { dataPluginMock } from '../../../../data/public/mocks'; -import { embeddablePluginMock } from '../../../../embeddable/public/mocks'; -import { DashboardAppCapabilities } from '../types'; -import { EmbeddableFactory } from '../../../../embeddable/public'; -import { HelloWorldEmbeddable } from '../../../../embeddable/public/tests/fixtures'; -import { DashboardContainer } from '../embeddable'; -import { coreMock } from 'src/core/public/mocks'; - -const savedDashboard = getSavedDashboardMock(); - -// TS is *very* picky with type guards / predicates. can't just use jest.fn() -function mockHasTaggingCapabilities(obj: any): obj is any { - return false; -} - -const history = createBrowserHistory(); -const createDashboardState = () => - new DashboardStateManager({ - savedDashboard, - kibanaVersion: '7.0.0', - hideWriteControls: false, - allowByValueEmbeddables: false, - history: createBrowserHistory(), - hasPendingEmbeddable: () => false, - kbnUrlStateStorage: createKbnUrlStateStorage(), - hasTaggingCapabilities: mockHasTaggingCapabilities, - toasts: coreMock.createStart().notifications.toasts, - }); - -const defaultCapabilities: DashboardAppCapabilities = { - show: false, - createNew: false, - saveQuery: false, - createShortUrl: false, - hideWriteControls: true, - mapsCapabilities: { save: false }, - visualizeCapabilities: { save: false }, - storeSearchSession: true, -}; - -const getIncomingEmbeddable = () => undefined; - -const services = { - dashboardCapabilities: defaultCapabilities, - data: dataPluginMock.createStartContract(), - embeddable: embeddablePluginMock.createStartContract(), - scopedHistory: history, -}; - -const setupEmbeddableFactory = () => { - const embeddable = new HelloWorldEmbeddable({ id: 'id' }); - const deferEmbeddableCreate = defer(); - services.embeddable.getEmbeddableFactory.mockImplementation( - () => - (({ - create: () => deferEmbeddableCreate.promise, - } as unknown) as EmbeddableFactory) - ); - const destroySpy = jest.spyOn(embeddable, 'destroy'); - - return { - destroySpy, - embeddable, - createEmbeddable: () => { - act(() => { - deferEmbeddableCreate.resolve(embeddable); - }); - }, - }; -}; - -test('container is destroyed on unmount', async () => { - const { createEmbeddable, destroySpy, embeddable } = setupEmbeddableFactory(); - - const dashboardStateManager = createDashboardState(); - const { result, unmount, waitForNextUpdate } = renderHook( - () => - useDashboardContainer({ - getIncomingEmbeddable, - dashboardStateManager, - history, - }), - { - wrapper: ({ children }) => ( - {children} - ), - } - ); - - expect(result.current).toBeNull(); // null on initial render - - createEmbeddable(); - - await waitForNextUpdate(); - - expect(embeddable).toBe(result.current); - expect(destroySpy).not.toBeCalled(); - - unmount(); - - expect(destroySpy).toBeCalled(); -}); - -test('old container is destroyed on new dashboardStateManager', async () => { - const embeddableFactoryOld = setupEmbeddableFactory(); - - const { result, waitForNextUpdate, rerender } = renderHook< - DashboardStateManager, - DashboardContainer | null - >( - (dashboardStateManager) => - useDashboardContainer({ - getIncomingEmbeddable, - dashboardStateManager, - history, - }), - { - wrapper: ({ children }) => ( - {children} - ), - initialProps: createDashboardState(), - } - ); - - expect(result.current).toBeNull(); // null on initial render - - embeddableFactoryOld.createEmbeddable(); - - await waitForNextUpdate(); - - expect(embeddableFactoryOld.embeddable).toBe(result.current); - expect(embeddableFactoryOld.destroySpy).not.toBeCalled(); - - const embeddableFactoryNew = setupEmbeddableFactory(); - rerender(createDashboardState()); - - embeddableFactoryNew.createEmbeddable(); - - await waitForNextUpdate(); - - expect(embeddableFactoryNew.embeddable).toBe(result.current); - - expect(embeddableFactoryNew.destroySpy).not.toBeCalled(); - expect(embeddableFactoryOld.destroySpy).toBeCalled(); -}); - -test('destroyed if rerendered before resolved', async () => { - const embeddableFactoryOld = setupEmbeddableFactory(); - - const { result, waitForNextUpdate, rerender } = renderHook< - DashboardStateManager, - DashboardContainer | null - >( - (dashboardStateManager) => - useDashboardContainer({ - getIncomingEmbeddable, - dashboardStateManager, - history, - }), - { - wrapper: ({ children }) => ( - {children} - ), - initialProps: createDashboardState(), - } - ); - - expect(result.current).toBeNull(); // null on initial render - - const embeddableFactoryNew = setupEmbeddableFactory(); - rerender(createDashboardState()); - embeddableFactoryNew.createEmbeddable(); - await waitForNextUpdate(); - expect(embeddableFactoryNew.embeddable).toBe(result.current); - expect(embeddableFactoryNew.destroySpy).not.toBeCalled(); - - embeddableFactoryOld.createEmbeddable(); - - await act(() => Promise.resolve()); // Can't use waitFor from hooks, because there is no hook update - expect(embeddableFactoryNew.embeddable).toBe(result.current); - expect(embeddableFactoryNew.destroySpy).not.toBeCalled(); - expect(embeddableFactoryOld.destroySpy).toBeCalled(); -}); diff --git a/src/plugins/dashboard/public/application/hooks/use_dashboard_container.ts b/src/plugins/dashboard/public/application/hooks/use_dashboard_container.ts deleted file mode 100644 index d715fb70ec91a8..00000000000000 --- a/src/plugins/dashboard/public/application/hooks/use_dashboard_container.ts +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { useEffect, useState } from 'react'; -import { History } from 'history'; - -import { useKibana } from '../../services/kibana_react'; -import { - ContainerOutput, - EmbeddableFactoryNotFoundError, - EmbeddableInput, - EmbeddablePackageState, - ErrorEmbeddable, - isErrorEmbeddable, - ViewMode, -} from '../../services/embeddable'; - -import { DashboardStateManager } from '../dashboard_state_manager'; -import { getDashboardContainerInput, getSearchSessionIdFromURL } from '../dashboard_app_functions'; -import { DashboardContainer, DashboardContainerInput } from '../..'; -import { DashboardAppServices } from '../types'; -import { DASHBOARD_CONTAINER_TYPE } from '..'; -import { TimefilterContract } from '../../services/data'; - -export const useDashboardContainer = ({ - history, - timeFilter, - setUnsavedChanges, - getIncomingEmbeddable, - dashboardStateManager, - isEmbeddedExternally, -}: { - history: History; - isEmbeddedExternally?: boolean; - timeFilter?: TimefilterContract; - setUnsavedChanges?: (dirty: boolean) => void; - dashboardStateManager: DashboardStateManager | null; - getIncomingEmbeddable: (removeAfterFetch?: boolean) => EmbeddablePackageState | undefined; -}) => { - const { - dashboardCapabilities, - data, - embeddable, - scopedHistory, - } = useKibana().services; - - // Destructure and rename services; makes the Effect hook more specific, makes later - // abstraction of service dependencies easier. - const { query } = data; - const { session: searchSession } = data.search; - - const [dashboardContainer, setDashboardContainer] = useState(null); - - useEffect(() => { - if (!dashboardStateManager) { - return; - } - - // Load dashboard container - const dashboardFactory = embeddable.getEmbeddableFactory< - DashboardContainerInput, - ContainerOutput, - DashboardContainer - >(DASHBOARD_CONTAINER_TYPE); - - if (!dashboardFactory) { - throw new EmbeddableFactoryNotFoundError( - 'dashboard app requires dashboard embeddable factory' - ); - } - - const searchSessionIdFromURL = getSearchSessionIdFromURL(history); - - if (searchSessionIdFromURL) { - searchSession.restore(searchSessionIdFromURL); - } - - const incomingEmbeddable = getIncomingEmbeddable(true); - - let canceled = false; - let pendingContainer: DashboardContainer | ErrorEmbeddable | null | undefined; - (async function createContainer() { - const existingSession = searchSession.getSessionId(); - pendingContainer = await dashboardFactory.create( - getDashboardContainerInput({ - isEmbeddedExternally: Boolean(isEmbeddedExternally), - dashboardCapabilities, - dashboardStateManager, - incomingEmbeddable, - query, - searchSessionId: - searchSessionIdFromURL ?? - (existingSession && incomingEmbeddable ? existingSession : searchSession.start()), - }) - ); - - // already new container is being created - // no longer interested in the pending one - if (canceled) { - try { - pendingContainer?.destroy(); - pendingContainer = null; - } catch (e) { - // destroy could throw if something has already destroyed the container - // eslint-disable-next-line no-console - console.warn(e); - } - - return; - } - - if (!pendingContainer || isErrorEmbeddable(pendingContainer)) { - return; - } - - // inject switch view mode callback for the empty screen to use - pendingContainer.switchViewMode = (newViewMode: ViewMode) => - dashboardStateManager.switchViewMode(newViewMode); - - // If the incoming embeddable is newly created, or doesn't exist in the current panels list, - // add it with `addNewEmbeddable` - if ( - incomingEmbeddable && - (!incomingEmbeddable?.embeddableId || - (incomingEmbeddable.embeddableId && - !pendingContainer.getInput().panels[incomingEmbeddable.embeddableId])) - ) { - pendingContainer.addNewEmbeddable( - incomingEmbeddable.type, - incomingEmbeddable.input - ); - } - setDashboardContainer(pendingContainer); - setUnsavedChanges?.(dashboardStateManager.getIsDirty(data.query.timefilter.timefilter)); - })(); - return () => { - canceled = true; - try { - pendingContainer?.destroy(); - } catch (e) { - // destroy could throw if something has already destroyed the container - // eslint-disable-next-line no-console - console.warn(e); - } - - setDashboardContainer(null); - }; - }, [ - data.query.timefilter.timefilter, - dashboardCapabilities, - dashboardStateManager, - getIncomingEmbeddable, - isEmbeddedExternally, - setUnsavedChanges, - searchSession, - scopedHistory, - timeFilter, - embeddable, - history, - query, - ]); - - return dashboardContainer; -}; diff --git a/src/plugins/dashboard/public/application/hooks/use_dashboard_state_manager.ts b/src/plugins/dashboard/public/application/hooks/use_dashboard_state_manager.ts deleted file mode 100644 index 72b43723f07fbf..00000000000000 --- a/src/plugins/dashboard/public/application/hooks/use_dashboard_state_manager.ts +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { useEffect, useState } from 'react'; -import { History } from 'history'; -import _ from 'lodash'; -import { map } from 'rxjs/operators'; - -import { createKbnUrlStateStorage, withNotifyOnErrors } from '../../services/kibana_utils'; -import { useKibana } from '../../services/kibana_react'; -import { - connectToQueryState, - esFilters, - noSearchSessionStorageCapabilityMessage, - QueryState, - syncQueryStateWithUrl, -} from '../../services/data'; -import { SavedObject } from '../../services/saved_objects'; -import type { TagDecoratedSavedObject } from '../../services/saved_objects_tagging_oss'; - -import { DashboardSavedObject } from '../../saved_dashboards'; -import { migrateLegacyQuery } from '../lib/migrate_legacy_query'; -import { createSessionRestorationDataProvider } from '../lib/session_restoration'; -import { DashboardStateManager } from '../dashboard_state_manager'; -import { getDashboardTitle } from '../../dashboard_strings'; -import { DashboardAppServices } from '../types'; -import { EmbeddablePackageState, ViewMode } from '../../services/embeddable'; - -// TS is picky with type guards, we can't just inline `() => false` -function defaultTaggingGuard(_obj: SavedObject): _obj is TagDecoratedSavedObject { - return false; -} - -interface DashboardStateManagerReturn { - dashboardStateManager: DashboardStateManager | null; - viewMode: ViewMode | null; - setViewMode: (value: ViewMode) => void; -} - -export const useDashboardStateManager = ( - savedDashboard: DashboardSavedObject | null, - history: History, - getIncomingEmbeddable: () => EmbeddablePackageState | undefined -): DashboardStateManagerReturn => { - const { - data: dataPlugin, - core, - uiSettings, - usageCollection, - initializerContext, - savedObjectsTagging, - dashboardCapabilities, - dashboardPanelStorage, - allowByValueEmbeddables, - } = useKibana().services; - - // Destructure and rename services; makes the Effect hook more specific, makes later - // abstraction of service dependencies easier. - const { query: queryService } = dataPlugin; - const { session: searchSession } = dataPlugin.search; - const { filterManager, queryString: queryStringManager } = queryService; - const { timefilter } = queryService.timefilter; - const { toasts } = core.notifications; - const { hideWriteControls } = dashboardCapabilities; - const { version: kibanaVersion } = initializerContext.env.packageInfo; - - const [dashboardStateManager, setDashboardStateManager] = useState( - null - ); - const [viewMode, setViewMode] = useState(null); - - const hasTaggingCapabilities = savedObjectsTagging?.ui.hasTagDecoration || defaultTaggingGuard; - - useEffect(() => { - if (!savedDashboard) { - return; - } - - const kbnUrlStateStorage = createKbnUrlStateStorage({ - history, - useHash: uiSettings.get('state:storeInSessionStorage'), - ...withNotifyOnErrors(toasts), - }); - - const stateManager = new DashboardStateManager({ - hasPendingEmbeddable: () => Boolean(getIncomingEmbeddable()), - toasts: core.notifications.toasts, - hasTaggingCapabilities, - dashboardPanelStorage, - hideWriteControls, - history, - kbnUrlStateStorage, - kibanaVersion, - savedDashboard, - usageCollection, - allowByValueEmbeddables, - }); - - // sync initial app filters from state to filterManager - // if there is an existing similar global filter, then leave it as global - filterManager.setAppFilters(_.cloneDeep(stateManager.appState.filters)); - queryStringManager.setQuery(migrateLegacyQuery(stateManager.appState.query)); - - // setup syncing of app filters between appState and filterManager - const stopSyncingAppFilters = connectToQueryState( - queryService, - { - set: ({ filters, query }) => { - stateManager.setFilters(filters || []); - stateManager.setQuery(query || queryStringManager.getDefaultQuery()); - }, - get: () => ({ - filters: stateManager.appState.filters, - query: stateManager.getQuery(), - }), - state$: stateManager.appState$.pipe( - map((appState) => ({ - filters: appState.filters, - query: queryStringManager.formatQuery(appState.query), - })) - ), - }, - { - filters: esFilters.FilterStateStore.APP_STATE, - query: true, - } - ); - - // Apply initial filters to Dashboard State Manager - stateManager.applyFilters( - stateManager.getQuery() || queryStringManager.getDefaultQuery(), - filterManager.getFilters() - ); - - // The hash check is so we only update the time filter on dashboard open, not during - // normal cross app navigation. - if (stateManager.getIsTimeSavedWithDashboard()) { - const initialGlobalStateInUrl = kbnUrlStateStorage.get('_g'); - if (!initialGlobalStateInUrl?.time) { - stateManager.syncTimefilterWithDashboardTime(timefilter); - } - if (!initialGlobalStateInUrl?.refreshInterval) { - stateManager.syncTimefilterWithDashboardRefreshInterval(timefilter); - } - } - - // starts syncing `_g` portion of url with query services - // it is important to start this syncing after `dashboardStateManager.syncTimefilterWithDashboard(timefilter);` above is run, - // otherwise it will case redundant browser history records - const { stop: stopSyncingQueryServiceStateWithUrl } = syncQueryStateWithUrl( - queryService, - kbnUrlStateStorage - ); - - // starts syncing `_a` portion of url - stateManager.startStateSyncing(); - - const dashboardTitle = getDashboardTitle( - stateManager.getTitle(), - stateManager.getViewMode(), - stateManager.isNew() - ); - - searchSession.enableStorage( - createSessionRestorationDataProvider({ - data: dataPlugin, - getDashboardTitle: () => dashboardTitle, - getDashboardId: () => savedDashboard?.id || '', - getAppState: () => stateManager.getAppState(), - }), - { - isDisabled: () => - dashboardCapabilities.storeSearchSession - ? { disabled: false } - : { - disabled: true, - reasonText: noSearchSessionStorageCapabilityMessage, - }, - } - ); - - setDashboardStateManager(stateManager); - setViewMode(stateManager.getViewMode()); - - return () => { - stateManager?.destroy(); - setDashboardStateManager(null); - stopSyncingAppFilters(); - stopSyncingQueryServiceStateWithUrl(); - }; - }, [ - dataPlugin, - filterManager, - hasTaggingCapabilities, - initializerContext.config, - dashboardPanelStorage, - getIncomingEmbeddable, - hideWriteControls, - history, - kibanaVersion, - queryService, - queryStringManager, - savedDashboard, - searchSession, - timefilter, - toasts, - uiSettings, - usageCollection, - allowByValueEmbeddables, - core.notifications.toasts, - dashboardCapabilities.storeSearchSession, - ]); - - return { dashboardStateManager, viewMode, setViewMode }; -}; diff --git a/src/plugins/dashboard/public/application/hooks/use_saved_dashboard.ts b/src/plugins/dashboard/public/application/hooks/use_saved_dashboard.ts deleted file mode 100644 index 639bc830803a44..00000000000000 --- a/src/plugins/dashboard/public/application/hooks/use_saved_dashboard.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { useEffect, useState } from 'react'; -import { History } from 'history'; -import _ from 'lodash'; - -import { useKibana } from '../../services/kibana_react'; - -import { DashboardConstants } from '../..'; -import { DashboardSavedObject } from '../../saved_dashboards'; -import { getDashboard60Warning, getNewDashboardTitle } from '../../dashboard_strings'; -import { DashboardAppServices } from '../types'; - -export const useSavedDashboard = (savedDashboardId: string | undefined, history: History) => { - const { data, core, chrome, savedDashboards } = useKibana().services; - const [savedDashboard, setSavedDashboard] = useState(null); - - // Destructure and rename services; makes the Effect hook more specific, makes later - // abstraction of service dependencies easier. - const { indexPatterns } = data; - const { recentlyAccessed: recentlyAccessedPaths, docTitle } = chrome; - const { toasts } = core.notifications; - - useEffect(() => { - (async function loadSavedDashboard() { - if (savedDashboardId === 'create') { - history.replace({ - ...history.location, // preserve query, - pathname: DashboardConstants.CREATE_NEW_DASHBOARD_URL, - }); - - toasts.addWarning(getDashboard60Warning()); - return; - } - - await indexPatterns.ensureDefaultIndexPattern(); - - try { - const dashboard = (await savedDashboards.get(savedDashboardId)) as DashboardSavedObject; - docTitle.change(dashboard.title || getNewDashboardTitle()); - setSavedDashboard(dashboard); - } catch (error) { - // E.g. a corrupt or deleted dashboard - toasts.addDanger(error.message); - history.push(DashboardConstants.LANDING_PAGE_PATH); - } - })(); - return () => setSavedDashboard(null); - }, [ - toasts, - docTitle, - history, - indexPatterns, - recentlyAccessedPaths, - savedDashboardId, - savedDashboards, - ]); - - return savedDashboard; -}; diff --git a/src/plugins/dashboard/public/application/lib/build_dashboard_container.ts b/src/plugins/dashboard/public/application/lib/build_dashboard_container.ts new file mode 100644 index 00000000000000..cb8c5ac5745e4c --- /dev/null +++ b/src/plugins/dashboard/public/application/lib/build_dashboard_container.ts @@ -0,0 +1,160 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import _ from 'lodash'; +import { DashboardSavedObject } from '../../saved_dashboards'; +import { DashboardContainer, DASHBOARD_CONTAINER_TYPE } from '../embeddable'; +import { + DashboardBuildContext, + DashboardState, + DashboardContainerInput, + DashboardAppServices, +} from '../../types'; +import { + enableDashboardSearchSessions, + getSearchSessionIdFromURL, + stateToDashboardContainerInput, +} from '.'; +import { + ContainerOutput, + EmbeddableFactoryNotFoundError, + EmbeddableInput, + EmbeddablePackageState, + ErrorEmbeddable, + isErrorEmbeddable, +} from '../../services/embeddable'; + +type BuildDashboardContainerProps = DashboardBuildContext & { + data: DashboardAppServices['data']; // the whole data service is required here because it is required by getUrlGeneratorState + savedDashboard: DashboardSavedObject; + initialDashboardState: DashboardState; + incomingEmbeddable?: EmbeddablePackageState; +}; + +/** + * Builds the dashboard container and manages initial search session + */ +export const buildDashboardContainer = async ({ + getLatestDashboardState, + initialDashboardState, + isEmbeddedExternally, + dashboardCapabilities, + incomingEmbeddable, + savedDashboard, + kibanaVersion, + embeddable, + history, + data, +}: BuildDashboardContainerProps) => { + const { + search: { session }, + } = data; + + // set up search session + enableDashboardSearchSessions({ + data, + kibanaVersion, + savedDashboard, + initialDashboardState, + getLatestDashboardState, + canStoreSearchSession: dashboardCapabilities.storeSearchSession, + }); + const searchSessionIdFromURL = getSearchSessionIdFromURL(history); + if (searchSessionIdFromURL) { + session.restore(searchSessionIdFromURL); + } + + const dashboardFactory = embeddable.getEmbeddableFactory< + DashboardContainerInput, + ContainerOutput, + DashboardContainer + >(DASHBOARD_CONTAINER_TYPE); + + if (!dashboardFactory) { + throw new EmbeddableFactoryNotFoundError('dashboard app requires dashboard embeddable factory'); + } + + /** + * Use an existing session instead of starting a new one if there is a session already, and dashboard is being created with an incoming + * embeddable. + */ + const existingSession = session.getSessionId(); + const searchSessionId = + searchSessionIdFromURL ?? + (existingSession && incomingEmbeddable ? existingSession : session.start()); + + // Build the initial input for the dashboard container based on the dashboard state. + const initialInput = stateToDashboardContainerInput({ + isEmbeddedExternally: Boolean(isEmbeddedExternally), + dashboardState: initialDashboardState, + dashboardCapabilities, + incomingEmbeddable, + query: data.query, + searchSessionId, + savedDashboard, + }); + + /** + * Handle the Incoming Embeddable Part 1: + * If the incoming embeddable already exists e.g. if it has been edited by value, the incoming state for that panel needs to replace the + * state for the matching panel already in the dashboard. This needs to happen BEFORE the dashboard container is built, so that the panel + * retains the same placement. + */ + if (incomingEmbeddable?.embeddableId && initialInput.panels[incomingEmbeddable.embeddableId]) { + const originalPanelState = initialInput.panels[incomingEmbeddable.embeddableId]; + initialInput.panels = { + ...initialInput.panels, + [incomingEmbeddable.embeddableId]: { + gridData: originalPanelState.gridData, + type: incomingEmbeddable.type, + explicitInput: { + ...originalPanelState.explicitInput, + ...incomingEmbeddable.input, + id: incomingEmbeddable.embeddableId, + }, + }, + }; + } + + const dashboardContainer = await dashboardFactory.create(initialInput); + if (!dashboardContainer || isErrorEmbeddable(dashboardContainer)) { + tryDestroyDashboardContainer(dashboardContainer); + return; + } + + /** + * Handle the Incoming Embeddable Part 2: + * If the incoming embeddable is new, we can add it to the container using `addNewEmbeddable` after the container is created + * this lets the container handle the placement of it (using the default placement algorithm "top left most open space") + */ + if ( + incomingEmbeddable && + (!incomingEmbeddable?.embeddableId || + (incomingEmbeddable.embeddableId && + !dashboardContainer.getInput().panels[incomingEmbeddable.embeddableId])) + ) { + dashboardContainer.addNewEmbeddable( + incomingEmbeddable.type, + incomingEmbeddable.input + ); + } + + return dashboardContainer; +}; + +export const tryDestroyDashboardContainer = ( + container: DashboardContainer | ErrorEmbeddable | undefined +) => { + try { + container?.destroy(); + } catch (e) { + // destroy could throw if something has already destroyed the container + // eslint-disable-next-line no-console + console.warn(e); + } +}; diff --git a/src/plugins/dashboard/public/application/lib/convert_dashboard_state.ts b/src/plugins/dashboard/public/application/lib/convert_dashboard_state.ts new file mode 100644 index 00000000000000..ee2ec2bb14fe47 --- /dev/null +++ b/src/plugins/dashboard/public/application/lib/convert_dashboard_state.ts @@ -0,0 +1,143 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import _ from 'lodash'; +import { DashboardSavedObject } from '../../saved_dashboards'; +import { getTagsFromSavedDashboard, migrateAppState } from '.'; +import { EmbeddablePackageState, ViewMode } from '../../services/embeddable'; +import { + convertPanelStateToSavedDashboardPanel, + convertSavedDashboardPanelToPanelState, +} from '../../../common/embeddable/embeddable_saved_object_converters'; +import { + DashboardState, + RawDashboardState, + DashboardPanelMap, + SavedDashboardPanel, + DashboardAppServices, + DashboardContainerInput, + DashboardBuildContext, +} from '../../types'; + +interface SavedObjectToDashboardStateProps { + version: string; + hideWriteControls: boolean; + savedDashboard: DashboardSavedObject; + usageCollection: DashboardAppServices['usageCollection']; + savedObjectsTagging: DashboardAppServices['savedObjectsTagging']; +} + +interface StateToDashboardContainerInputProps { + searchSessionId?: string; + isEmbeddedExternally?: boolean; + dashboardState: DashboardState; + savedDashboard: DashboardSavedObject; + query: DashboardBuildContext['query']; + incomingEmbeddable?: EmbeddablePackageState; + dashboardCapabilities: DashboardBuildContext['dashboardCapabilities']; +} + +interface StateToRawDashboardStateProps { + version: string; + state: DashboardState; +} +/** + * Converts a dashboard saved object to a dashboard state by extracting raw state from the given Dashboard + * Saved Object migrating the panel states to the latest version, then converting each panel from a saved + * dashboard panel to a panel state. + */ +export const savedObjectToDashboardState = ({ + version, + hideWriteControls, + savedDashboard, + usageCollection, + savedObjectsTagging, +}: SavedObjectToDashboardStateProps): DashboardState => { + const rawState = migrateAppState( + { + fullScreenMode: false, + title: savedDashboard.title, + query: savedDashboard.getQuery(), + filters: savedDashboard.getFilters(), + timeRestore: savedDashboard.timeRestore, + description: savedDashboard.description || '', + tags: getTagsFromSavedDashboard(savedDashboard, savedObjectsTagging), + panels: savedDashboard.panelsJSON ? JSON.parse(savedDashboard.panelsJSON) : [], + viewMode: savedDashboard.id || hideWriteControls ? ViewMode.VIEW : ViewMode.EDIT, + options: savedDashboard.optionsJSON ? JSON.parse(savedDashboard.optionsJSON) : {}, + }, + version, + usageCollection + ); + + const panels: DashboardPanelMap = {}; + rawState.panels?.forEach((panel: SavedDashboardPanel) => { + panels[panel.panelIndex] = convertSavedDashboardPanelToPanelState(panel); + }); + return { ...rawState, panels }; +}; + +/** + * Converts a dashboard state object to dashboard container input + */ +export const stateToDashboardContainerInput = ({ + dashboardCapabilities, + isEmbeddedExternally, + query: queryService, + searchSessionId, + savedDashboard, + dashboardState, +}: StateToDashboardContainerInputProps): DashboardContainerInput => { + const { filterManager, timefilter: timefilterService } = queryService; + const { timefilter } = timefilterService; + + const { + expandedPanelId, + fullScreenMode, + description, + options, + viewMode, + panels, + query, + title, + } = dashboardState; + + return { + refreshConfig: timefilter.getRefreshInterval(), + filters: filterManager.getFilters(), + isFullScreenMode: fullScreenMode, + id: savedDashboard.id || '', + dashboardCapabilities, + isEmbeddedExternally, + ...(options || {}), + searchSessionId, + expandedPanelId, + description, + viewMode, + panels, + query, + title, + timeRange: { + ..._.cloneDeep(timefilter.getTime()), + }, + }; +}; + +/** + * Converts a given dashboard state object to raw dashboard state. This is useful for sharing, and session restoration, as + * they require panels to be formatted as an array. + */ +export const stateToRawDashboardState = ({ + version, + state, +}: StateToRawDashboardStateProps): RawDashboardState => { + const savedDashboardPanels = Object.values(state.panels).map((panel) => + convertPanelStateToSavedDashboardPanel(panel, version) + ); + return { ..._.omit(state, 'panels'), panels: savedDashboardPanels }; +}; diff --git a/src/plugins/dashboard/public/application/lib/dashboard_panel_storage.ts b/src/plugins/dashboard/public/application/lib/dashboard_panel_storage.ts deleted file mode 100644 index 02890f6aaa7904..00000000000000 --- a/src/plugins/dashboard/public/application/lib/dashboard_panel_storage.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { set } from '@elastic/safer-lodash-set'; -import { Storage } from '../../services/kibana_utils'; -import { NotificationsStart } from '../../services/core'; -import { panelStorageErrorStrings } from '../../dashboard_strings'; -import { SavedDashboardPanel } from '..'; - -export const DASHBOARD_PANELS_UNSAVED_ID = 'unsavedDashboard'; -const DASHBOARD_PANELS_SESSION_KEY = 'dashboardStateManagerPanels'; - -export class DashboardPanelStorage { - private sessionStorage: Storage; - - constructor(private toasts: NotificationsStart['toasts'], private activeSpaceId: string) { - this.sessionStorage = new Storage(sessionStorage); - } - - public clearPanels(id = DASHBOARD_PANELS_UNSAVED_ID) { - try { - const sessionStorage = this.sessionStorage.get(DASHBOARD_PANELS_SESSION_KEY); - const sessionStorageForSpace = sessionStorage?.[this.activeSpaceId] || {}; - if (sessionStorageForSpace[id]) { - delete sessionStorageForSpace[id]; - this.sessionStorage.set(DASHBOARD_PANELS_SESSION_KEY, sessionStorage); - } - } catch (e) { - this.toasts.addDanger({ - title: panelStorageErrorStrings.getPanelsClearError(e.message), - 'data-test-subj': 'dashboardPanelsClearFailure', - }); - } - } - - public getPanels(id = DASHBOARD_PANELS_UNSAVED_ID): SavedDashboardPanel[] | undefined { - try { - return this.sessionStorage.get(DASHBOARD_PANELS_SESSION_KEY)?.[this.activeSpaceId]?.[id]; - } catch (e) { - this.toasts.addDanger({ - title: panelStorageErrorStrings.getPanelsGetError(e.message), - 'data-test-subj': 'dashboardPanelsGetFailure', - }); - } - } - - public setPanels(id = DASHBOARD_PANELS_UNSAVED_ID, newPanels: SavedDashboardPanel[]) { - try { - const sessionStoragePanels = this.sessionStorage.get(DASHBOARD_PANELS_SESSION_KEY) || {}; - set(sessionStoragePanels, [this.activeSpaceId, id], newPanels); - this.sessionStorage.set(DASHBOARD_PANELS_SESSION_KEY, sessionStoragePanels); - } catch (e) { - this.toasts.addDanger({ - title: panelStorageErrorStrings.getPanelsSetError(e.message), - 'data-test-subj': 'dashboardPanelsSetFailure', - }); - } - } - - public getDashboardIdsWithUnsavedChanges() { - try { - return Object.keys( - this.sessionStorage.get(DASHBOARD_PANELS_SESSION_KEY)?.[this.activeSpaceId] || {} - ); - } catch (e) { - this.toasts.addDanger({ - title: panelStorageErrorStrings.getPanelsGetError(e.message), - 'data-test-subj': 'dashboardPanelsGetFailure', - }); - return []; - } - } - - public dashboardHasUnsavedEdits(id = DASHBOARD_PANELS_UNSAVED_ID) { - return this.getDashboardIdsWithUnsavedChanges().indexOf(id) !== -1; - } -} diff --git a/src/plugins/dashboard/public/application/lib/dashboard_session_restoration.ts b/src/plugins/dashboard/public/application/lib/dashboard_session_restoration.ts new file mode 100644 index 00000000000000..7dd2b53a581558 --- /dev/null +++ b/src/plugins/dashboard/public/application/lib/dashboard_session_restoration.ts @@ -0,0 +1,131 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { History } from 'history'; +import { DashboardConstants } from '../..'; +import { DashboardState } from '../../types'; +import { getDashboardTitle } from '../../dashboard_strings'; +import { DashboardSavedObject } from '../../saved_dashboards'; +import { getQueryParams } from '../../services/kibana_utils'; +import { createQueryParamObservable } from '../../../../kibana_utils/public'; +import { DASHBOARD_APP_URL_GENERATOR, DashboardUrlGeneratorState } from '../../url_generator'; +import { + DataPublicPluginStart, + noSearchSessionStorageCapabilityMessage, +} from '../../services/data'; +import { stateToRawDashboardState } from './convert_dashboard_state'; + +export const getSearchSessionIdFromURL = (history: History): string | undefined => + getQueryParams(history.location)[DashboardConstants.SEARCH_SESSION_ID] as string | undefined; + +export const getSessionURLObservable = (history: History) => + createQueryParamObservable(history, DashboardConstants.SEARCH_SESSION_ID); + +export function createSessionRestorationDataProvider(deps: { + kibanaVersion: string; + data: DataPublicPluginStart; + getAppState: () => DashboardState; + getDashboardTitle: () => string; + getDashboardId: () => string; +}) { + return { + getName: async () => deps.getDashboardTitle(), + getUrlGeneratorData: async () => { + return { + urlGeneratorId: DASHBOARD_APP_URL_GENERATOR, + initialState: getUrlGeneratorState({ ...deps, shouldRestoreSearchSession: false }), + restoreState: getUrlGeneratorState({ ...deps, shouldRestoreSearchSession: true }), + }; + }, + }; +} + +/** + * Enables dashboard search sessions. + */ +export function enableDashboardSearchSessions({ + canStoreSearchSession, + initialDashboardState, + getLatestDashboardState, + savedDashboard, + kibanaVersion, + data, +}: { + kibanaVersion: string; + data: DataPublicPluginStart; + canStoreSearchSession: boolean; + savedDashboard: DashboardSavedObject; + initialDashboardState: DashboardState; + getLatestDashboardState: () => DashboardState; +}) { + const dashboardTitle = getDashboardTitle( + initialDashboardState.title, + initialDashboardState.viewMode, + !savedDashboard.id + ); + + data.search.session.enableStorage( + createSessionRestorationDataProvider({ + data, + kibanaVersion, + getDashboardTitle: () => dashboardTitle, + getDashboardId: () => savedDashboard?.id || '', + getAppState: getLatestDashboardState, + }), + { + isDisabled: () => + canStoreSearchSession + ? { disabled: false } + : { + disabled: true, + reasonText: noSearchSessionStorageCapabilityMessage, + }, + } + ); +} + +/** + * Fetches the state to store when a session is saved so that this dashboard can be recreated exactly + * as it was. + */ +function getUrlGeneratorState({ + data, + getAppState, + kibanaVersion, + getDashboardId, + shouldRestoreSearchSession, +}: { + kibanaVersion: string; + data: DataPublicPluginStart; + getAppState: () => DashboardState; + getDashboardId: () => string; + shouldRestoreSearchSession: boolean; +}): DashboardUrlGeneratorState { + const appState = stateToRawDashboardState({ state: getAppState(), version: kibanaVersion }); + const { filterManager, queryString } = data.query; + const { timefilter } = data.query.timefilter; + + return { + timeRange: shouldRestoreSearchSession ? timefilter.getAbsoluteTime() : timefilter.getTime(), + searchSessionId: shouldRestoreSearchSession ? data.search.session.getSessionId() : undefined, + panels: getDashboardId() ? undefined : appState.panels, + query: queryString.formatQuery(appState.query), + filters: filterManager.getFilters(), + savedQuery: appState.savedQuery, + dashboardId: getDashboardId(), + preserveSavedFilters: false, + viewMode: appState.viewMode, + useHash: false, + refreshInterval: shouldRestoreSearchSession + ? { + pause: true, // force pause refresh interval when restoring a session + value: 0, + } + : undefined, + }; +} diff --git a/src/plugins/dashboard/public/application/lib/dashboard_session_storage.ts b/src/plugins/dashboard/public/application/lib/dashboard_session_storage.ts new file mode 100644 index 00000000000000..7d0e60c0609a8e --- /dev/null +++ b/src/plugins/dashboard/public/application/lib/dashboard_session_storage.ts @@ -0,0 +1,91 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { set } from '@elastic/safer-lodash-set'; +import { Storage } from '../../services/kibana_utils'; +import { NotificationsStart } from '../../services/core'; +import { panelStorageErrorStrings } from '../../dashboard_strings'; +import { DashboardState } from '../../types'; + +export const DASHBOARD_PANELS_UNSAVED_ID = 'unsavedDashboard'; +const DASHBOARD_PANELS_SESSION_KEY = 'dashboardStateManagerPanels'; + +export class DashboardSessionStorage { + private sessionStorage: Storage; + + constructor(private toasts: NotificationsStart['toasts'], private activeSpaceId: string) { + this.sessionStorage = new Storage(sessionStorage); + } + + public clearState(id = DASHBOARD_PANELS_UNSAVED_ID) { + try { + const sessionStorage = this.sessionStorage.get(DASHBOARD_PANELS_SESSION_KEY); + const sessionStorageForSpace = sessionStorage?.[this.activeSpaceId] || {}; + if (sessionStorageForSpace[id]) { + delete sessionStorageForSpace[id]; + this.sessionStorage.set(DASHBOARD_PANELS_SESSION_KEY, sessionStorage); + } + } catch (e) { + this.toasts.addDanger({ + title: panelStorageErrorStrings.getPanelsClearError(e.message), + 'data-test-subj': 'dashboardPanelsClearFailure', + }); + } + } + + public getState(id = DASHBOARD_PANELS_UNSAVED_ID): Partial | undefined { + try { + return this.sessionStorage.get(DASHBOARD_PANELS_SESSION_KEY)?.[this.activeSpaceId]?.[id]; + } catch (e) { + this.toasts.addDanger({ + title: panelStorageErrorStrings.getPanelsGetError(e.message), + 'data-test-subj': 'dashboardPanelsGetFailure', + }); + } + } + + public setState(id = DASHBOARD_PANELS_UNSAVED_ID, newState: Partial) { + try { + const sessionStateStorage = this.sessionStorage.get(DASHBOARD_PANELS_SESSION_KEY) || {}; + set(sessionStateStorage, [this.activeSpaceId, id], newState); + this.sessionStorage.set(DASHBOARD_PANELS_SESSION_KEY, sessionStateStorage); + } catch (e) { + this.toasts.addDanger({ + title: panelStorageErrorStrings.getPanelsSetError(e.message), + 'data-test-subj': 'dashboardPanelsSetFailure', + }); + } + } + + public getDashboardIdsWithUnsavedChanges() { + try { + const dashboardStatesInSpace = + this.sessionStorage.get(DASHBOARD_PANELS_SESSION_KEY)?.[this.activeSpaceId] || {}; + const dashboardsWithUnsavedChanges: string[] = []; + Object.keys(dashboardStatesInSpace).map((dashboardId) => { + if ( + Object.keys(dashboardStatesInSpace[dashboardId]).some( + (stateKey) => stateKey !== 'viewMode' + ) + ) + dashboardsWithUnsavedChanges.push(dashboardId); + }); + return dashboardsWithUnsavedChanges; + } catch (e) { + this.toasts.addDanger({ + title: panelStorageErrorStrings.getPanelsGetError(e.message), + 'data-test-subj': 'dashboardPanelsGetFailure', + }); + return []; + } + } + + public dashboardHasUnsavedEdits(id = DASHBOARD_PANELS_UNSAVED_ID) { + return this.getDashboardIdsWithUnsavedChanges().indexOf(id) !== -1; + } +} diff --git a/src/plugins/dashboard/public/application/lib/dashboard_tagging.ts b/src/plugins/dashboard/public/application/lib/dashboard_tagging.ts new file mode 100644 index 00000000000000..df2521044d1a3f --- /dev/null +++ b/src/plugins/dashboard/public/application/lib/dashboard_tagging.ts @@ -0,0 +1,28 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { DashboardSavedObject } from '../..'; +import { SavedObject } from '../../services/saved_objects'; +import { SavedObjectsTaggingApi } from '../../services/saved_objects_tagging_oss'; +import type { TagDecoratedSavedObject } from '../../services/saved_objects_tagging_oss'; + +// TS is picky with type guards, we can't just inline `() => false` +function defaultTaggingGuard(_obj: SavedObject): _obj is TagDecoratedSavedObject { + return false; +} + +export const getTagsFromSavedDashboard = ( + savedDashboard: DashboardSavedObject, + api?: SavedObjectsTaggingApi +) => { + const hasTaggingCapabilities = getHasTaggingCapabilitiesGuard(api); + return hasTaggingCapabilities(savedDashboard) ? savedDashboard.getTags() : []; +}; + +export const getHasTaggingCapabilitiesGuard = (api?: SavedObjectsTaggingApi) => + api?.ui.hasTagDecoration || defaultTaggingGuard; diff --git a/src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts b/src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts new file mode 100644 index 00000000000000..b1abba44891fcf --- /dev/null +++ b/src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts @@ -0,0 +1,129 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import _ from 'lodash'; +import { DashboardPanelState } from '..'; +import { esFilters, Filter } from '../../services/data'; +import { + DashboardContainerInput, + DashboardOptions, + DashboardPanelMap, + DashboardState, +} from '../../types'; + +interface DashboardDiffCommon { + [key: string]: unknown; +} + +type DashboardDiffCommonFilters = DashboardDiffCommon & { filters: Filter[] }; + +export const diffDashboardContainerInput = ( + originalInput: DashboardContainerInput, + newInput: DashboardContainerInput +) => { + return commonDiffFilters( + (originalInput as unknown) as DashboardDiffCommonFilters, + (newInput as unknown) as DashboardDiffCommonFilters, + ['searchSessionId', 'lastReloadRequestTime'] + ); +}; + +export const diffDashboardState = ( + original: DashboardState, + newState: DashboardState +): Partial => { + const common = commonDiffFilters( + (original as unknown) as DashboardDiffCommonFilters, + (newState as unknown) as DashboardDiffCommonFilters, + ['viewMode', 'panels', 'options', 'savedQuery', 'expandedPanelId'], + true + ); + + return { + ...common, + ...(panelsAreEqual(original.panels, newState.panels) ? {} : { panels: newState.panels }), + ...(optionsAreEqual(original.options, newState.options) ? {} : { options: newState.options }), + }; +}; + +const optionsAreEqual = (optionsA: DashboardOptions, optionsB: DashboardOptions): boolean => { + const optionKeys = [...Object.keys(optionsA), ...Object.keys(optionsB)]; + for (const key of optionKeys) { + if ( + Boolean(((optionsA as unknown) as { [key: string]: boolean })[key]) !== + Boolean(((optionsB as unknown) as { [key: string]: boolean })[key]) + ) { + return false; + } + } + return true; +}; + +const panelsAreEqual = (panelsA: DashboardPanelMap, panelsB: DashboardPanelMap): boolean => { + const embeddableIdsA = Object.keys(panelsA); + const embeddableIdsB = Object.keys(panelsB); + if ( + embeddableIdsA.length !== embeddableIdsB.length || + _.xor(embeddableIdsA, embeddableIdsB).length > 0 + ) { + return false; + } + // embeddable ids are equal so let's compare individual panels. + for (const id of embeddableIdsA) { + if ( + Object.keys( + commonDiff( + (panelsA[id] as unknown) as DashboardDiffCommon, + (panelsB[id] as unknown) as DashboardDiffCommon, + ['panelRefName'] + ) + ).length > 0 + ) { + return false; + } + } + + return true; +}; + +const commonDiffFilters = ( + originalObj: DashboardDiffCommonFilters, + newObj: DashboardDiffCommonFilters, + omitKeys: string[], + ignorePinned?: boolean +): Partial => { + const filtersAreDifferent = () => + !esFilters.compareFilters( + originalObj.filters, + ignorePinned ? newObj.filters.filter((f) => !esFilters.isFilterPinned(f)) : newObj.filters, + esFilters.COMPARE_ALL_OPTIONS + ); + const otherDifferences = commonDiff(originalObj, newObj, [...omitKeys, 'filters']); + return _.cloneDeep({ + ...otherDifferences, + ...(filtersAreDifferent() ? { filters: newObj.filters } : {}), + }); +}; + +const commonDiff = ( + originalObj: DashboardDiffCommon, + newObj: DashboardDiffCommon, + omitKeys: string[] +) => { + const differences: Partial = {}; + const keys = [...Object.keys(originalObj), ...Object.keys(newObj)].filter( + (key) => !omitKeys.includes(key) + ); + keys.forEach((key) => { + if (key === undefined) return; + if (!_.isEqual(originalObj[key], newObj[key])) { + (differences as { [key: string]: unknown })[key] = newObj[key]; + } + }); + return differences; +}; diff --git a/src/plugins/dashboard/public/application/lib/filter_utils.ts b/src/plugins/dashboard/public/application/lib/filter_utils.ts index 83dd036285a512..51acc4676c5433 100644 --- a/src/plugins/dashboard/public/application/lib/filter_utils.ts +++ b/src/plugins/dashboard/public/application/lib/filter_utils.ts @@ -8,59 +8,68 @@ import _ from 'lodash'; import moment, { Moment } from 'moment'; -import { Filter } from '../../services/data'; +import { Optional } from '@kbn/utility-types'; + +import { Filter, TimeRange } from '../../services/data'; + +type TimeRangeCompare = Optional; /** - * @typedef {Object} QueryFilter - * @property query_string {Object} - * @property query_string.query {String} + * Converts the time to a utc formatted string. If the time is not valid (e.g. it might be in a relative format like + * 'now-15m', then it just returns what it was passed). + * @param time {string|Moment} + * @returns the time represented in utc format, or if the time range was not able to be parsed into a moment + * object, it returns the same object it was given. */ - -export class FilterUtils { - /** - * Converts the time to a utc formatted string. If the time is not valid (e.g. it might be in a relative format like - * 'now-15m', then it just returns what it was passed). - * @param time {string|Moment} - * @returns the time represented in utc format, or if the time range was not able to be parsed into a moment - * object, it returns the same object it was given. - */ - public static convertTimeToUTCString(time?: string | Moment): undefined | string { - if (moment(time).isValid()) { - return moment(time).utc().format('YYYY-MM-DDTHH:mm:ss.SSS[Z]'); - } else { - // If it's not a valid moment date, then it should be a string representing a relative time - // like 'now' or 'now-15m'. - return time as string; - } +export const convertTimeToUTCString = (time?: string | Moment): undefined | string => { + if (moment(time).isValid()) { + return moment(time).utc().format('YYYY-MM-DDTHH:mm:ss.SSS[Z]'); + } else { + // If it's not a valid moment date, then it should be a string representing a relative time + // like 'now' or 'now-15m'. + return time as string; } +}; - /** - * Compares the two times, making sure they are in both compared in string format. Absolute times - * are sometimes stored as moment objects, but converted to strings when reloaded. Relative times are - * strings that are not convertible to moment objects. - * @param timeA {string|Moment} - * @param timeB {string|Moment} - * @returns {boolean} - */ - public static areTimesEqual(timeA?: string | Moment, timeB?: string | Moment) { - return this.convertTimeToUTCString(timeA) === this.convertTimeToUTCString(timeB); - } +export const areTimeRangesEqual = (rangeA: TimeRangeCompare, rangeB: TimeRangeCompare): boolean => { + return areTimesEqual(rangeA.from, rangeB.from) && areTimesEqual(rangeA.to, rangeB.to); +}; - /** - * Depending on how a dashboard is loaded, the filter object may contain a $$hashKey and $state that will throw - * off a filter comparison. This removes those variables. - * @param filters {Array.} - * @returns {Array.} - */ - public static cleanFiltersForComparison(filters: Filter[]) { - return _.map(filters, (filter) => { - const f: Partial = _.omit(filter, ['$$hashKey', '$state']); - if (f.meta) { - // f.meta.value is the value displayed in the filter bar. - // It may also be loaded differently and shouldn't be used in this comparison. - return _.omit(f.meta, ['value']); - } - return f; - }); - } -} +/** + * Compares the two times, making sure they are in both compared in string format. Absolute times + * are sometimes stored as moment objects, but converted to strings when reloaded. Relative times are + * strings that are not convertible to moment objects. + * @param timeA {string|Moment} + * @param timeB {string|Moment} + * @returns {boolean} + */ +export const areTimesEqual = (timeA?: string | Moment, timeB?: string | Moment) => { + return convertTimeToUTCString(timeA) === convertTimeToUTCString(timeB); +}; + +/** + * Depending on how a dashboard is loaded, the filter object may contain a $$hashKey and $state that will throw + * off a filter comparison. This removes those variables. + * @param filters {Array.} + * @returns {Array.} + */ +export const cleanFiltersForComparison = (filters: Filter[]) => { + return _.map(filters, (filter) => { + const f: Partial = _.omit(filter, ['$$hashKey', '$state']); + if (f.meta) { + // f.meta.value is the value displayed in the filter bar. + // It may also be loaded differently and shouldn't be used in this comparison. + return _.omit(f.meta, ['value']); + } + return f; + }); +}; + +export const cleanFiltersForSerialize = (filters: Filter[]): Filter[] => { + return filters.map((filter) => { + if (filter.meta.value) { + delete filter.meta.value; + } + return filter; + }); +}; diff --git a/src/plugins/dashboard/public/application/lib/get_app_state_defaults.ts b/src/plugins/dashboard/public/application/lib/get_app_state_defaults.ts deleted file mode 100644 index d8d335317c2b23..00000000000000 --- a/src/plugins/dashboard/public/application/lib/get_app_state_defaults.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import type { SavedObjectTagDecoratorTypeGuard } from '../../services/saved_objects_tagging_oss'; -import { ViewMode } from '../../services/embeddable'; -import { DashboardSavedObject } from '../../saved_dashboards'; -import { DashboardAppStateDefaults } from '../../types'; - -export function getAppStateDefaults( - viewMode: ViewMode, - savedDashboard: DashboardSavedObject, - hasTaggingCapabilities: SavedObjectTagDecoratorTypeGuard -): DashboardAppStateDefaults { - return { - fullScreenMode: false, - title: savedDashboard.title, - description: savedDashboard.description || '', - tags: hasTaggingCapabilities(savedDashboard) ? savedDashboard.getTags() : [], - timeRestore: savedDashboard.timeRestore, - panels: savedDashboard.panelsJSON ? JSON.parse(savedDashboard.panelsJSON) : [], - options: savedDashboard.optionsJSON ? JSON.parse(savedDashboard.optionsJSON) : {}, - query: savedDashboard.getQuery(), - filters: savedDashboard.getFilters(), - viewMode, - }; -} diff --git a/src/plugins/dashboard/public/application/lib/index.ts b/src/plugins/dashboard/public/application/lib/index.ts index f457589c7588ea..937c1d2a77c06b 100644 --- a/src/plugins/dashboard/public/application/lib/index.ts +++ b/src/plugins/dashboard/public/application/lib/index.ts @@ -6,11 +6,28 @@ * Side Public License, v 1. */ +export * from './filter_utils'; +export { getDashboardIdFromUrl } from './url'; export { saveDashboard } from './save_dashboard'; -export { getAppStateDefaults } from './get_app_state_defaults'; export { migrateAppState } from './migrate_app_state'; -export { getDashboardIdFromUrl } from './url'; -export { createSessionRestorationDataProvider } from './session_restoration'; export { addHelpMenuToAppChrome } from './help_menu_util'; +export { getTagsFromSavedDashboard } from './dashboard_tagging'; +export { loadDashboardUrlState } from './load_dashboard_url_state'; +export { DashboardSessionStorage } from './dashboard_session_storage'; +export { loadSavedDashboardState } from './load_saved_dashboard_state'; export { attemptLoadDashboardByTitle } from './load_dashboard_by_title'; -export { DashboardPanelStorage } from './dashboard_panel_storage'; +export { syncDashboardFilterState } from './sync_dashboard_filter_state'; +export { syncDashboardIndexPatterns } from './sync_dashboard_index_patterns'; +export { syncDashboardContainerInput } from './sync_dashboard_container_input'; +export { diffDashboardContainerInput, diffDashboardState } from './diff_dashboard_state'; +export { buildDashboardContainer, tryDestroyDashboardContainer } from './build_dashboard_container'; +export { + stateToDashboardContainerInput, + savedObjectToDashboardState, +} from './convert_dashboard_state'; +export { + createSessionRestorationDataProvider, + enableDashboardSearchSessions, + getSearchSessionIdFromURL, + getSessionURLObservable, +} from './dashboard_session_restoration'; diff --git a/src/plugins/dashboard/public/application/lib/load_dashboard_url_state.ts b/src/plugins/dashboard/public/application/lib/load_dashboard_url_state.ts new file mode 100644 index 00000000000000..efff2ba6bc0870 --- /dev/null +++ b/src/plugins/dashboard/public/application/lib/load_dashboard_url_state.ts @@ -0,0 +1,63 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import _ from 'lodash'; + +import { migrateAppState } from '.'; +import { replaceUrlHashQuery } from '../../../../kibana_utils/public'; +import { DASHBOARD_STATE_STORAGE_KEY } from '../../dashboard_constants'; +import { convertSavedDashboardPanelToPanelState } from '../../../common/embeddable/embeddable_saved_object_converters'; +import { + DashboardBuildContext, + DashboardPanelMap, + DashboardState, + RawDashboardState, + SavedDashboardPanel, +} from '../../types'; +import { migrateLegacyQuery } from './migrate_legacy_query'; + +/** + * Loads any dashboard state from the URL, and removes the state from the URL. + */ +export const loadDashboardUrlState = ({ + kibanaVersion, + usageCollection, + kbnUrlStateStorage, +}: DashboardBuildContext): Partial => { + const rawAppStateInUrl = kbnUrlStateStorage.get(DASHBOARD_STATE_STORAGE_KEY); + if (!rawAppStateInUrl) return {}; + + const panelsMap: DashboardPanelMap = {}; + if (rawAppStateInUrl.panels && rawAppStateInUrl.panels.length > 0) { + const rawState = migrateAppState(rawAppStateInUrl, kibanaVersion, usageCollection); + rawState.panels?.forEach((panel: SavedDashboardPanel) => { + panelsMap[panel.panelIndex] = convertSavedDashboardPanelToPanelState(panel); + }); + } + + const migratedQuery = rawAppStateInUrl.query + ? migrateLegacyQuery(rawAppStateInUrl.query) + : undefined; + + // remove state from URL + kbnUrlStateStorage.kbnUrlControls.updateAsync((nextUrl) => { + if (nextUrl.includes(DASHBOARD_STATE_STORAGE_KEY)) { + return replaceUrlHashQuery(nextUrl, (query) => { + delete query[DASHBOARD_STATE_STORAGE_KEY]; + return query; + }); + } + return nextUrl; + }, true); + + return { + ..._.omit(rawAppStateInUrl, ['panels', 'query']), + ...(migratedQuery ? { query: migratedQuery } : {}), + ...(rawAppStateInUrl.panels ? { panels: panelsMap } : {}), + }; +}; diff --git a/src/plugins/dashboard/public/application/lib/load_saved_dashboard_state.ts b/src/plugins/dashboard/public/application/lib/load_saved_dashboard_state.ts new file mode 100644 index 00000000000000..9069173c15e8f8 --- /dev/null +++ b/src/plugins/dashboard/public/application/lib/load_saved_dashboard_state.ts @@ -0,0 +1,82 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import _ from 'lodash'; + +import { savedObjectToDashboardState } from './convert_dashboard_state'; +import { DashboardState, DashboardBuildContext } from '../../types'; +import { DashboardConstants, DashboardSavedObject } from '../..'; +import { getDashboard60Warning } from '../../dashboard_strings'; +import { migrateLegacyQuery } from './migrate_legacy_query'; +import { cleanFiltersForSerialize } from './filter_utils'; +import { ViewMode } from '../../services/embeddable'; + +interface LoadSavedDashboardStateReturn { + savedDashboardState: DashboardState; + savedDashboard: DashboardSavedObject; +} + +/** + * Loads, migrates, and returns state from a dashboard saved object. + */ +export const loadSavedDashboardState = async ({ + query, + history, + notifications, + indexPatterns, + savedDashboards, + usageCollection, + savedDashboardId, + initializerContext, + savedObjectsTagging, + dashboardCapabilities, +}: DashboardBuildContext & { savedDashboardId?: string }): Promise< + LoadSavedDashboardStateReturn | undefined +> => { + const { hideWriteControls } = dashboardCapabilities; + const { queryString } = query; + + // BWC - remove for 8.0 + if (savedDashboardId === 'create') { + history.replace({ + ...history.location, // preserve query, + pathname: DashboardConstants.CREATE_NEW_DASHBOARD_URL, + }); + + notifications.toasts.addWarning(getDashboard60Warning()); + return; + } + await indexPatterns.ensureDefaultIndexPattern(); + let savedDashboard: DashboardSavedObject | undefined; + try { + savedDashboard = (await savedDashboards.get(savedDashboardId)) as DashboardSavedObject; + } catch (error) { + // E.g. a corrupt or deleted dashboard + notifications.toasts.addDanger(error.message); + history.push(DashboardConstants.LANDING_PAGE_PATH); + return; + } + if (!savedDashboard) return; + + const savedDashboardState = savedObjectToDashboardState({ + savedDashboard, + usageCollection, + hideWriteControls, + savedObjectsTagging, + version: initializerContext.env.packageInfo.version, + }); + + const isViewMode = hideWriteControls || Boolean(savedDashboard.id); + savedDashboardState.viewMode = isViewMode ? ViewMode.VIEW : ViewMode.EDIT; + savedDashboardState.filters = cleanFiltersForSerialize(savedDashboardState.filters); + savedDashboardState.query = migrateLegacyQuery( + savedDashboardState.query || queryString.getDefaultQuery() + ); + + return { savedDashboardState, savedDashboard }; +}; diff --git a/src/plugins/dashboard/public/application/lib/migrate_app_state.ts b/src/plugins/dashboard/public/application/lib/migrate_app_state.ts index 9f60b3b539e269..fb8ef1b9ba2da1 100644 --- a/src/plugins/dashboard/public/application/lib/migrate_app_state.ts +++ b/src/plugins/dashboard/public/application/lib/migrate_app_state.ts @@ -11,7 +11,7 @@ import { i18n } from '@kbn/i18n'; import { METRIC_TYPE } from '@kbn/analytics'; import { UsageCollectionSetup } from '../../services/usage_collection'; -import { DashboardAppState, SavedDashboardPanel } from '../../types'; +import { RawDashboardState, SavedDashboardPanel } from '../../types'; import { migratePanelsTo730, SavedDashboardPanelTo60, @@ -28,10 +28,10 @@ import { * Once we hit a major version, we can remove support for older style URLs and get rid of this logic. */ export function migrateAppState( - appState: { [key: string]: any } & DashboardAppState, + appState: { [key: string]: any } & RawDashboardState, kibanaVersion: string, usageCollection?: UsageCollectionSetup -): DashboardAppState { +): RawDashboardState { if (!appState.panels) { throw new Error( i18n.translate('dashboard.panel.invalidData', { diff --git a/src/plugins/dashboard/public/application/lib/save_dashboard.ts b/src/plugins/dashboard/public/application/lib/save_dashboard.ts index 684d8b4c5e8d80..960d7d9cc86872 100644 --- a/src/plugins/dashboard/public/application/lib/save_dashboard.ts +++ b/src/plugins/dashboard/public/application/lib/save_dashboard.ts @@ -6,40 +6,110 @@ * Side Public License, v 1. */ -import { TimefilterContract } from '../../services/data'; +import _ from 'lodash'; + +import { convertTimeToUTCString } from '.'; +import { NotificationsStart } from '../../services/core'; +import { DashboardSavedObject } from '../../saved_dashboards'; +import { DashboardRedirect, DashboardState } from '../../types'; import { SavedObjectSaveOpts } from '../../services/saved_objects'; -import { updateSavedDashboard } from './update_saved_dashboard'; -import { DashboardStateManager } from '../dashboard_state_manager'; +import { dashboardSaveToastStrings } from '../../dashboard_strings'; +import { getHasTaggingCapabilitiesGuard } from './dashboard_tagging'; +import { SavedObjectsTaggingApi } from '../../services/saved_objects_tagging_oss'; +import { RefreshInterval, TimefilterContract, esFilters } from '../../services/data'; +import { convertPanelStateToSavedDashboardPanel } from '../../../common/embeddable/embeddable_saved_object_converters'; +import { DashboardSessionStorage } from './dashboard_session_storage'; export type SavedDashboardSaveOpts = SavedObjectSaveOpts & { stayInEditMode?: boolean }; -/** - * Saves the dashboard. - * @param toJson A custom toJson function. Used because the previous code used - * the angularized toJson version, and it was unclear whether there was a reason not to use - * JSON.stringify - * @returns A promise that if resolved, will contain the id of the newly saved - * dashboard. - */ -export function saveDashboard( - toJson: (obj: any) => string, - timeFilter: TimefilterContract, - dashboardStateManager: DashboardStateManager, - saveOptions: SavedDashboardSaveOpts -): Promise { - const savedDashboard = dashboardStateManager.savedDashboard; - const appState = dashboardStateManager.appState; - const hasTaggingCapabilities = dashboardStateManager.hasTaggingCapabilities; - - updateSavedDashboard(savedDashboard, appState, timeFilter, hasTaggingCapabilities, toJson); - - return savedDashboard.save(saveOptions).then((id: string) => { - if (id) { - // reset state only when save() was successful - // e.g. save() could be interrupted if title is duplicated and not confirmed - dashboardStateManager.lastSavedDashboardFilters = dashboardStateManager.getFilterState(); - } - - return id; - }); +interface SaveDashboardProps { + version: string; + redirectTo: DashboardRedirect; + currentState: DashboardState; + timefilter: TimefilterContract; + saveOptions: SavedDashboardSaveOpts; + toasts: NotificationsStart['toasts']; + savedDashboard: DashboardSavedObject; + savedObjectsTagging?: SavedObjectsTaggingApi; + dashboardSessionStorage: DashboardSessionStorage; } + +export const saveDashboard = async ({ + toasts, + version, + redirectTo, + timefilter, + saveOptions, + currentState, + savedDashboard, + savedObjectsTagging, + dashboardSessionStorage, +}: SaveDashboardProps): Promise<{ id?: string; redirected?: boolean; error?: any }> => { + const lastDashboardId = savedDashboard.id; + const hasTaggingCapabilities = getHasTaggingCapabilitiesGuard(savedObjectsTagging); + + const { panels, title, tags, description, timeRestore, options } = currentState; + + const savedDashboardPanels = Object.values(panels).map((panel) => + convertPanelStateToSavedDashboardPanel(panel, version) + ); + + savedDashboard.title = title; + savedDashboard.description = description; + savedDashboard.timeRestore = timeRestore; + savedDashboard.optionsJSON = JSON.stringify(options); + savedDashboard.panelsJSON = JSON.stringify(savedDashboardPanels); + + if (hasTaggingCapabilities(savedDashboard)) { + savedDashboard.setTags(tags); + } + + const { from, to } = timefilter.getTime(); + savedDashboard.timeFrom = savedDashboard.timeRestore ? convertTimeToUTCString(from) : undefined; + savedDashboard.timeTo = savedDashboard.timeRestore ? convertTimeToUTCString(to) : undefined; + + const timeRestoreObj: RefreshInterval = _.pick(timefilter.getRefreshInterval(), [ + 'display', + 'pause', + 'section', + 'value', + ]) as RefreshInterval; + savedDashboard.refreshInterval = savedDashboard.timeRestore ? timeRestoreObj : undefined; + + // only save unpinned filters + const unpinnedFilters = savedDashboard + .getFilters() + .filter((filter) => !esFilters.isFilterPinned(filter)); + savedDashboard.searchSource.setField('filter', unpinnedFilters); + + try { + const newId = await savedDashboard.save(saveOptions); + if (newId) { + toasts.addSuccess({ + title: dashboardSaveToastStrings.getSuccessString(currentState.title), + 'data-test-subj': 'saveDashboardSuccess', + }); + + /** + * If the dashboard id has been changed, redirect to the new ID to keep the url param in sync. + */ + if (newId !== lastDashboardId) { + dashboardSessionStorage.clearState(lastDashboardId); + redirectTo({ + id: newId, + editMode: true, + useReplace: true, + destination: 'dashboard', + }); + return { redirected: true, id: newId }; + } + } + return { id: newId }; + } catch (error) { + toasts.addDanger({ + title: dashboardSaveToastStrings.getFailureString(currentState.title, error.message), + 'data-test-subj': 'saveDashboardFailure', + }); + return { error }; + } +}; diff --git a/src/plugins/dashboard/public/application/lib/session_restoration.test.ts b/src/plugins/dashboard/public/application/lib/session_restoration.test.ts index a6740d8647825c..c8366387471452 100644 --- a/src/plugins/dashboard/public/application/lib/session_restoration.test.ts +++ b/src/plugins/dashboard/public/application/lib/session_restoration.test.ts @@ -6,23 +6,24 @@ * Side Public License, v 1. */ -import { dataPluginMock } from '../../../../data/public/mocks'; -import { createSessionRestorationDataProvider } from './session_restoration'; -import { getAppStateDefaults } from './get_app_state_defaults'; import { getSavedDashboardMock } from '../test_helpers'; -import { SavedObjectTagDecoratorTypeGuard } from '../../../../saved_objects_tagging_oss/public'; -import { ViewMode } from '../../services/embeddable'; +import { dataPluginMock } from '../../../../data/public/mocks'; +import { createSessionRestorationDataProvider, savedObjectToDashboardState } from '.'; describe('createSessionRestorationDataProvider', () => { const mockDataPlugin = dataPluginMock.createStartContract(); + const version = '8.0.0'; const searchSessionInfoProvider = createSessionRestorationDataProvider({ + kibanaVersion: version, data: mockDataPlugin, getAppState: () => - getAppStateDefaults( - ViewMode.VIEW, - getSavedDashboardMock(), - ((() => false) as unknown) as SavedObjectTagDecoratorTypeGuard - ), + savedObjectToDashboardState({ + version, + hideWriteControls: false, + usageCollection: undefined, + savedObjectsTagging: undefined, + savedDashboard: getSavedDashboardMock(), + }), getDashboardTitle: () => 'Dashboard', getDashboardId: () => 'Id', }); diff --git a/src/plugins/dashboard/public/application/lib/session_restoration.ts b/src/plugins/dashboard/public/application/lib/session_restoration.ts deleted file mode 100644 index 231119eef8d2c1..00000000000000 --- a/src/plugins/dashboard/public/application/lib/session_restoration.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { DASHBOARD_APP_URL_GENERATOR, DashboardUrlGeneratorState } from '../../url_generator'; -import { DataPublicPluginStart } from '../../services/data'; -import { DashboardAppState } from '../../types'; - -export function createSessionRestorationDataProvider(deps: { - data: DataPublicPluginStart; - getAppState: () => DashboardAppState; - getDashboardTitle: () => string; - getDashboardId: () => string; -}) { - return { - getName: async () => deps.getDashboardTitle(), - getUrlGeneratorData: async () => { - return { - urlGeneratorId: DASHBOARD_APP_URL_GENERATOR, - initialState: getUrlGeneratorState({ ...deps, shouldRestoreSearchSession: false }), - restoreState: getUrlGeneratorState({ ...deps, shouldRestoreSearchSession: true }), - }; - }, - }; -} - -function getUrlGeneratorState({ - data, - getAppState, - getDashboardId, - shouldRestoreSearchSession, -}: { - data: DataPublicPluginStart; - getAppState: () => DashboardAppState; - getDashboardId: () => string; - shouldRestoreSearchSession: boolean; -}): DashboardUrlGeneratorState { - const appState = getAppState(); - return { - dashboardId: getDashboardId(), - timeRange: shouldRestoreSearchSession - ? data.query.timefilter.timefilter.getAbsoluteTime() - : data.query.timefilter.timefilter.getTime(), - filters: data.query.filterManager.getFilters(), - query: data.query.queryString.formatQuery(appState.query), - savedQuery: appState.savedQuery, - useHash: false, - preserveSavedFilters: false, - viewMode: appState.viewMode, - panels: getDashboardId() ? undefined : appState.panels, - searchSessionId: shouldRestoreSearchSession ? data.search.session.getSessionId() : undefined, - refreshInterval: shouldRestoreSearchSession - ? { - pause: true, // force pause refresh interval when restoring a session - value: 0, - } - : undefined, - }; -} diff --git a/src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts b/src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts new file mode 100644 index 00000000000000..21010158dc46d8 --- /dev/null +++ b/src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts @@ -0,0 +1,201 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import _ from 'lodash'; +import { Subscription } from 'rxjs'; +import { debounceTime, tap } from 'rxjs/operators'; + +import { DashboardContainer } from '../embeddable'; +import { esFilters, Filter, Query } from '../../services/data'; +import { DashboardConstants, DashboardSavedObject } from '../..'; +import { setExpandedPanelId, setFullScreenMode, setPanels, setQuery } from '../state'; +import { diffDashboardContainerInput } from './diff_dashboard_state'; +import { replaceUrlHashQuery } from '../../../../kibana_utils/public'; +import { DashboardBuildContext, DashboardContainerInput } from '../../types'; +import { + getSearchSessionIdFromURL, + getSessionURLObservable, + stateToDashboardContainerInput, +} from '.'; + +type SyncDashboardContainerCommon = DashboardBuildContext & { + dashboardContainer: DashboardContainer; + savedDashboard: DashboardSavedObject; +}; + +type ApplyStateChangesToContainerProps = SyncDashboardContainerCommon & { + force: boolean; +}; + +type ApplyContainerChangesToStateProps = SyncDashboardContainerCommon & { + applyFilters: (query: Query, filters: Filter[]) => void; +}; + +type SyncDashboardContainerProps = SyncDashboardContainerCommon & ApplyContainerChangesToStateProps; + +/** + * Sets up two way binding between dashboard container and redux state. + */ +export const syncDashboardContainerInput = ( + syncDashboardContainerProps: SyncDashboardContainerProps +) => { + const { + history, + dashboardContainer, + $onDashboardStateChange, + $triggerDashboardRefresh, + } = syncDashboardContainerProps; + const subscriptions = new Subscription(); + subscriptions.add( + dashboardContainer + .getInput$() + .subscribe(() => applyContainerChangesToState(syncDashboardContainerProps)) + ); + subscriptions.add($onDashboardStateChange.subscribe(() => $triggerDashboardRefresh.next())); + subscriptions.add( + getSessionURLObservable(history).subscribe(() => { + $triggerDashboardRefresh.next({ force: true }); + }) + ); + + let forceRefresh: boolean = false; + subscriptions.add( + $triggerDashboardRefresh + .pipe( + tap((trigger) => { + forceRefresh = forceRefresh || (trigger?.force ?? false); + }), + debounceTime(DashboardConstants.CHANGE_APPLY_DEBOUNCE) + ) + .subscribe(() => { + applyStateChangesToContainer({ ...syncDashboardContainerProps, force: forceRefresh }); + forceRefresh = false; + }) + ); + + return () => subscriptions.unsubscribe(); +}; + +export const applyContainerChangesToState = ({ + query, + applyFilters, + dashboardContainer, + getLatestDashboardState, + dispatchDashboardStateChange, +}: ApplyContainerChangesToStateProps) => { + const input = dashboardContainer.getInput(); + const latestState = getLatestDashboardState(); + if (Object.keys(latestState).length === 0) { + return; + } + const { filterManager } = query; + if ( + !esFilters.compareFilters( + input.filters, + filterManager.getFilters(), + esFilters.COMPARE_ALL_OPTIONS + ) + ) { + // Add filters modifies the object passed to it, hence the clone deep. + filterManager.addFilters(_.cloneDeep(input.filters)); + applyFilters(latestState.query, input.filters); + } + + if (!_.isEqual(input.panels, latestState.panels)) { + dispatchDashboardStateChange(setPanels(input.panels)); + } + + if (!_.isEqual(input.query, latestState.query)) { + dispatchDashboardStateChange(setQuery(input.query)); + } + + if (!_.isEqual(input.expandedPanelId, latestState.expandedPanelId)) { + dispatchDashboardStateChange(setExpandedPanelId(input.expandedPanelId)); + } + dispatchDashboardStateChange(setFullScreenMode(input.isFullScreenMode)); +}; + +export const applyStateChangesToContainer = ({ + force, + search, + history, + savedDashboard, + dashboardContainer, + kbnUrlStateStorage, + query: queryService, + isEmbeddedExternally, + dashboardCapabilities, + getLatestDashboardState, +}: ApplyStateChangesToContainerProps) => { + const latestState = getLatestDashboardState(); + if (Object.keys(latestState).length === 0) { + return; + } + const currentDashboardStateAsInput = stateToDashboardContainerInput({ + dashboardState: latestState, + isEmbeddedExternally, + dashboardCapabilities, + query: queryService, + savedDashboard, + }); + const differences = diffDashboardContainerInput( + dashboardContainer.getInput(), + currentDashboardStateAsInput + ); + if (force) { + differences.lastReloadRequestTime = Date.now(); + } + + if (Object.keys(differences).length !== 0) { + const shouldRefetch = Object.keys(differences).some( + (changeKey) => !noRefetchKeys.includes(changeKey as keyof DashboardContainerInput) + ); + + const newSearchSessionId: string | undefined = (() => { + // do not update session id if this is irrelevant state change to prevent excessive searches + if (!shouldRefetch) return; + + const sessionApi = search.session; + let searchSessionIdFromURL = getSearchSessionIdFromURL(history); + if (searchSessionIdFromURL) { + if (sessionApi.isRestore() && sessionApi.isCurrentSession(searchSessionIdFromURL)) { + // navigating away from a restored session + kbnUrlStateStorage.kbnUrlControls.updateAsync((nextUrl) => { + if (nextUrl.includes(DashboardConstants.SEARCH_SESSION_ID)) { + return replaceUrlHashQuery(nextUrl, (query) => { + delete query[DashboardConstants.SEARCH_SESSION_ID]; + return query; + }); + } + return nextUrl; + }); + searchSessionIdFromURL = undefined; + } else { + sessionApi.restore(searchSessionIdFromURL); + } + } + + return searchSessionIdFromURL ?? sessionApi.start(); + })(); + + dashboardContainer.updateInput({ + ...differences, + ...(newSearchSessionId && { searchSessionId: newSearchSessionId }), + }); + } +}; + +const noRefetchKeys: Readonly> = [ + 'title', + 'viewMode', + 'useMargins', + 'description', + 'expandedPanelId', + 'isFullScreenMode', + 'isEmbeddedExternally', +] as const; diff --git a/src/plugins/dashboard/public/application/lib/sync_dashboard_filter_state.ts b/src/plugins/dashboard/public/application/lib/sync_dashboard_filter_state.ts new file mode 100644 index 00000000000000..2cfd7da6145ee8 --- /dev/null +++ b/src/plugins/dashboard/public/application/lib/sync_dashboard_filter_state.ts @@ -0,0 +1,157 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import _ from 'lodash'; +import { merge } from 'rxjs'; +import { debounceTime, finalize, map, switchMap, tap } from 'rxjs/operators'; + +import { setQuery } from '../state'; +import { DashboardBuildContext, DashboardState } from '../../types'; +import { DashboardSavedObject } from '../../saved_dashboards'; +import { setFiltersAndQuery } from '../state/dashboard_state_slice'; +import { + syncQueryStateWithUrl, + connectToQueryState, + Filter, + Query, + waitUntilNextSessionCompletes$, + QueryState, +} from '../../services/data'; +import { cleanFiltersForSerialize } from '.'; + +type SyncDashboardFilterStateProps = DashboardBuildContext & { + initialDashboardState: DashboardState; + savedDashboard: DashboardSavedObject; +}; + +/** + * Applies initial state to the query service, and the saved dashboard search source, then + * Sets up syncing and subscriptions between the filter state from the Data plugin + * and the dashboard Redux store. + */ +export const syncDashboardFilterState = ({ + search, + savedDashboard, + kbnUrlStateStorage, + query: queryService, + initialDashboardState, + $checkForUnsavedChanges, + $onDashboardStateChange, + $triggerDashboardRefresh, + dispatchDashboardStateChange, +}: SyncDashboardFilterStateProps) => { + const { filterManager, queryString, timefilter } = queryService; + const { timefilter: timefilterService } = timefilter; + + // apply initial filters to the query service and to the saved dashboard + filterManager.setAppFilters(_.cloneDeep(initialDashboardState.filters)); + savedDashboard.searchSource.setField('filter', initialDashboardState.filters); + + // apply initial query to the query service and to the saved dashboard + queryString.setQuery(initialDashboardState.query); + savedDashboard.searchSource.setField('query', initialDashboardState.query); + + /** + * If a global time range is not set explicitly and the time range was saved with the dashboard, apply + * initial time range and refresh interval to the query service. + */ + if (initialDashboardState.timeRestore) { + const initialGlobalQueryState = kbnUrlStateStorage.get('_g'); + if (!initialGlobalQueryState?.time) { + if (savedDashboard.timeFrom && savedDashboard.timeTo) { + timefilterService.setTime({ + from: savedDashboard.timeFrom, + to: savedDashboard.timeTo, + }); + } + } + if (!initialGlobalQueryState?.refreshInterval) { + if (savedDashboard.refreshInterval) { + timefilterService.setRefreshInterval(savedDashboard.refreshInterval); + } + } + } + + // this callback will be used any time new filters and query need to be applied. + const applyFilters = (query: Query, filters: Filter[]) => { + savedDashboard.searchSource.setField('query', query); + savedDashboard.searchSource.setField('filter', filters); + dispatchDashboardStateChange(setQuery(query)); + }; + + // starts syncing `_g` portion of url with query services + const { stop: stopSyncingQueryServiceStateWithUrl } = syncQueryStateWithUrl( + queryService, + kbnUrlStateStorage + ); + + // starts syncing app filters between dashboard state and filterManager + const intermediateFilterState: { filters: Filter[]; query: Query } = { + query: initialDashboardState.query ?? queryString.getDefaultQuery(), + filters: initialDashboardState.filters ?? [], + }; + const stopSyncingAppFilters = connectToQueryState( + queryService, + { + get: () => intermediateFilterState, + set: ({ filters, query }) => { + intermediateFilterState.filters = cleanFiltersForSerialize(filters ?? []) || []; + intermediateFilterState.query = query || queryString.getDefaultQuery(); + dispatchDashboardStateChange(setFiltersAndQuery(intermediateFilterState)); + }, + state$: $onDashboardStateChange.pipe( + map((appState) => ({ + filters: appState.filters, + query: appState.query, + })) + ), + }, + { + query: true, + filters: true, + } + ); + + // apply filters when the filter manager changes + const filterManagerSubscription = merge(filterManager.getUpdates$(), queryString.getUpdates$()) + .pipe(debounceTime(100)) + .subscribe(() => applyFilters(queryString.getQuery(), filterManager.getFilters())); + + const timeRefreshSubscription = merge( + ...[timefilterService.getRefreshIntervalUpdate$(), timefilterService.getTimeUpdate$()] + ).subscribe(() => { + $triggerDashboardRefresh.next(); + + // manually check for unsaved changes here because the time range is not stored on the dashboardState, + // but it could trigger the unsaved changes badge. + $checkForUnsavedChanges.next(); + }); + + const forceRefreshSubscription = timefilterService + .getAutoRefreshFetch$() + .pipe( + tap(() => { + $triggerDashboardRefresh.next({ force: true }); + }), + switchMap((done) => + // best way on a dashboard to estimate that panels are updated is to rely on search session service state + waitUntilNextSessionCompletes$(search.session).pipe(finalize(done)) + ) + ) + .subscribe(); + + const stopSyncingDashboardFilterState = () => { + filterManagerSubscription.unsubscribe(); + forceRefreshSubscription.unsubscribe(); + timeRefreshSubscription.unsubscribe(); + stopSyncingQueryServiceStateWithUrl(); + stopSyncingAppFilters(); + }; + + return { applyFilters, stopSyncingDashboardFilterState }; +}; diff --git a/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts b/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts new file mode 100644 index 00000000000000..b2873febee0d88 --- /dev/null +++ b/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts @@ -0,0 +1,86 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { uniqBy } from 'lodash'; +import deepEqual from 'fast-deep-equal'; +import { merge, Observable, pipe } from 'rxjs'; +import { distinctUntilChanged, switchMap, startWith, filter, mapTo, map } from 'rxjs/operators'; + +import { DashboardContainer } from '..'; +import { isErrorEmbeddable } from '../../services/embeddable'; +import { IndexPattern, IndexPatternsContract } from '../../services/data'; + +interface SyncDashboardIndexPatternsProps { + dashboardContainer: DashboardContainer; + indexPatterns: IndexPatternsContract; + onUpdateIndexPatterns: (newIndexPatterns: IndexPattern[]) => void; +} + +export const syncDashboardIndexPatterns = ({ + dashboardContainer, + indexPatterns, + onUpdateIndexPatterns, +}: SyncDashboardIndexPatternsProps) => { + const updateIndexPatternsOperator = pipe( + filter((container: DashboardContainer) => !!container && !isErrorEmbeddable(container)), + map((container: DashboardContainer): IndexPattern[] => { + let panelIndexPatterns: IndexPattern[] = []; + Object.values(container.getChildIds()).forEach((id) => { + const embeddableInstance = container.getChild(id); + if (isErrorEmbeddable(embeddableInstance)) return; + const embeddableIndexPatterns = (embeddableInstance.getOutput() as any).indexPatterns; + if (!embeddableIndexPatterns) return; + panelIndexPatterns.push(...embeddableIndexPatterns); + }); + panelIndexPatterns = uniqBy(panelIndexPatterns, 'id'); + return panelIndexPatterns; + }), + distinctUntilChanged((a, b) => + deepEqual( + a.map((ip) => ip && ip.id), + b.map((ip) => ip && ip.id) + ) + ), + // using switchMap for previous task cancellation + switchMap((panelIndexPatterns: IndexPattern[]) => { + return new Observable((observer) => { + if (panelIndexPatterns && panelIndexPatterns.length > 0) { + if (observer.closed) return; + onUpdateIndexPatterns(panelIndexPatterns); + observer.complete(); + } else { + indexPatterns.getDefault().then((defaultIndexPattern) => { + if (observer.closed) return; + onUpdateIndexPatterns([defaultIndexPattern as IndexPattern]); + observer.complete(); + }); + } + }); + }) + ); + + return merge( + // output of dashboard container itself + dashboardContainer.getOutput$(), + // plus output of dashboard container children, + // children may change, so make sure we subscribe/unsubscribe with switchMap + dashboardContainer.getOutput$().pipe( + map(() => dashboardContainer!.getChildIds()), + distinctUntilChanged(deepEqual), + switchMap((newChildIds: string[]) => + merge(...newChildIds.map((childId) => dashboardContainer!.getChild(childId).getOutput$())) + ) + ) + ) + .pipe( + mapTo(dashboardContainer), + startWith(dashboardContainer), // to trigger initial index pattern update + updateIndexPatternsOperator + ) + .subscribe(); +}; diff --git a/src/plugins/dashboard/public/application/lib/update_saved_dashboard.ts b/src/plugins/dashboard/public/application/lib/update_saved_dashboard.ts deleted file mode 100644 index 286414ed30eacf..00000000000000 --- a/src/plugins/dashboard/public/application/lib/update_saved_dashboard.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import _ from 'lodash'; -import type { SavedObjectTagDecoratorTypeGuard } from '../../services/saved_objects_tagging_oss'; -import { RefreshInterval, TimefilterContract, esFilters } from '../../services/data'; -import { FilterUtils } from './filter_utils'; -import { DashboardSavedObject } from '../../saved_dashboards'; -import { DashboardAppState } from '../../types'; - -export function updateSavedDashboard( - savedDashboard: DashboardSavedObject, - appState: DashboardAppState, - timeFilter: TimefilterContract, - hasTaggingCapabilities: SavedObjectTagDecoratorTypeGuard, - toJson: (object: T) => string -) { - savedDashboard.title = appState.title; - savedDashboard.description = appState.description; - savedDashboard.timeRestore = appState.timeRestore; - savedDashboard.panelsJSON = toJson(appState.panels); - savedDashboard.optionsJSON = toJson(appState.options); - - if (hasTaggingCapabilities(savedDashboard)) { - savedDashboard.setTags(appState.tags); - } - - savedDashboard.timeFrom = savedDashboard.timeRestore - ? FilterUtils.convertTimeToUTCString(timeFilter.getTime().from) - : undefined; - savedDashboard.timeTo = savedDashboard.timeRestore - ? FilterUtils.convertTimeToUTCString(timeFilter.getTime().to) - : undefined; - const timeRestoreObj: RefreshInterval = _.pick(timeFilter.getRefreshInterval(), [ - 'display', - 'pause', - 'section', - 'value', - ]) as RefreshInterval; - savedDashboard.refreshInterval = savedDashboard.timeRestore ? timeRestoreObj : undefined; - - // save only unpinned filters - const unpinnedFilters = savedDashboard - .getFilters() - .filter((filter) => !esFilters.isFilterPinned(filter)); - savedDashboard.searchSource.setField('filter', unpinnedFilters); -} diff --git a/src/plugins/dashboard/public/application/listing/confirm_overlays.tsx b/src/plugins/dashboard/public/application/listing/confirm_overlays.tsx index 726d647abe2128..e3f7b32ef82230 100644 --- a/src/plugins/dashboard/public/application/listing/confirm_overlays.tsx +++ b/src/plugins/dashboard/public/application/listing/confirm_overlays.tsx @@ -19,13 +19,10 @@ import { EUI_MODAL_CANCEL_BUTTON, } from '@elastic/eui'; import React from 'react'; + import { OverlayStart } from '../../../../../core/public'; -import { - createConfirmStrings, - discardConfirmStrings, - leaveEditModeConfirmStrings, -} from '../../dashboard_strings'; import { toMountPoint } from '../../services/kibana_react'; +import { createConfirmStrings, discardConfirmStrings } from '../../dashboard_strings'; export type DiscardOrKeepSelection = 'cancel' | 'discard' | 'keep'; @@ -44,76 +41,6 @@ export const confirmDiscardUnsavedChanges = (overlays: OverlayStart, discardCall } }); -export const confirmDiscardOrKeepUnsavedChanges = ( - overlays: OverlayStart -): Promise => { - const titleId = 'confirmDiscardOrKeepTitle'; - const descriptionId = 'confirmDiscardOrKeepDescription'; - - return new Promise((resolve) => { - const session = overlays.openModal( - toMountPoint( - - session.close()}> -
- - -

{leaveEditModeConfirmStrings.getLeaveEditModeTitle()}

-
-
- - - -

{leaveEditModeConfirmStrings.getLeaveEditModeSubtitle()}

-
-
- - - session.close()} - > - {leaveEditModeConfirmStrings.getLeaveEditModeCancelButtonText()} - - { - session.close(); - resolve('discard'); - }} - > - {leaveEditModeConfirmStrings.getLeaveEditModeDiscardButtonText()} - - { - session.close(); - resolve('keep'); - }} - > - {leaveEditModeConfirmStrings.getLeaveEditModeKeepChangesText()} - - -
-
-
- ), - { - 'data-test-subj': 'dashboardDiscardConfirmModal', - maxWidth: 550, - } - ); - }); -}; - export const confirmCreateWithUnsaved = ( overlays: OverlayStart, startBlankCallback: () => void, diff --git a/src/plugins/dashboard/public/application/listing/dashboard_listing.test.tsx b/src/plugins/dashboard/public/application/listing/dashboard_listing.test.tsx index febb03d58d9341..7602b2ed68b62d 100644 --- a/src/plugins/dashboard/public/application/listing/dashboard_listing.test.tsx +++ b/src/plugins/dashboard/public/application/listing/dashboard_listing.test.tsx @@ -6,80 +6,16 @@ * Side Public License, v 1. */ +import React from 'react'; import { mount } from 'enzyme'; -import { - IUiSettingsClient, - PluginInitializerContext, - ScopedHistory, - SimpleSavedObject, -} from '../../../../../core/public'; +import { I18nProvider } from '@kbn/i18n/react'; -import { SavedObjectLoader, SavedObjectLoaderFindOptions } from '../../services/saved_objects'; -import { IndexPatternsContract, SavedQueryService } from '../../services/data'; -import { NavigationPublicPluginStart } from '../../services/navigation'; +import { DashboardAppServices } from '../../types'; +import { SimpleSavedObject } from '../../../../../core/public'; import { KibanaContextProvider } from '../../services/kibana_react'; import { createKbnUrlStateStorage } from '../../services/kibana_utils'; - -import { savedObjectsPluginMock } from '../../../../saved_objects/public/mocks'; import { DashboardListing, DashboardListingProps } from './dashboard_listing'; -import { embeddablePluginMock } from '../../../../embeddable/public/mocks'; -import { visualizationsPluginMock } from '../../../../visualizations/public/mocks'; -import { DashboardAppServices, DashboardAppCapabilities } from '../types'; -import { dataPluginMock } from '../../../../data/public/mocks'; -import { chromeServiceMock, coreMock } from '../../../../../core/public/mocks'; -import { I18nProvider } from '@kbn/i18n/react'; -import React from 'react'; -import { UrlForwardingStart } from '../../../../url_forwarding/public'; -import { DashboardPanelStorage } from '../lib'; - -function makeDefaultServices(): DashboardAppServices { - const core = coreMock.createStart(); - const savedDashboards = {} as SavedObjectLoader; - savedDashboards.find = (search: string, sizeOrOptions: number | SavedObjectLoaderFindOptions) => { - const size = typeof sizeOrOptions === 'number' ? sizeOrOptions : sizeOrOptions.size ?? 10; - const hits = []; - for (let i = 0; i < size; i++) { - hits.push({ - id: `dashboard${i}`, - title: `dashboard${i} - ${search} - title`, - description: `dashboard${i} desc`, - }); - } - return Promise.resolve({ - total: size, - hits, - }); - }; - const dashboardPanelStorage = ({ - getDashboardIdsWithUnsavedChanges: jest - .fn() - .mockResolvedValue(['dashboardUnsavedOne', 'dashboardUnsavedTwo']), - } as unknown) as DashboardPanelStorage; - - return { - savedObjects: savedObjectsPluginMock.createStartContract(), - embeddable: embeddablePluginMock.createInstance().doStart(), - dashboardCapabilities: {} as DashboardAppCapabilities, - initializerContext: {} as PluginInitializerContext, - chrome: chromeServiceMock.createStartContract(), - navigation: {} as NavigationPublicPluginStart, - savedObjectsClient: core.savedObjects.client, - data: dataPluginMock.createStartContract(), - indexPatterns: {} as IndexPatternsContract, - scopedHistory: () => ({} as ScopedHistory), - savedQueryService: {} as SavedQueryService, - setHeaderActionMenu: (mountPoint) => {}, - urlForwarding: {} as UrlForwardingStart, - uiSettings: {} as IUiSettingsClient, - restorePreviousUrl: () => {}, - onAppLeave: (handler) => {}, - allowByValueEmbeddables: true, - dashboardPanelStorage, - savedDashboards, - core, - visualizations: visualizationsPluginMock.createStartContract(), - }; -} +import { makeDefaultServices } from '../test_helpers'; function makeDefaultProps(): DashboardListingProps { return { diff --git a/src/plugins/dashboard/public/application/listing/dashboard_listing.tsx b/src/plugins/dashboard/public/application/listing/dashboard_listing.tsx index e2c11d614d7970..eaa47465660026 100644 --- a/src/plugins/dashboard/public/application/listing/dashboard_listing.tsx +++ b/src/plugins/dashboard/public/application/listing/dashboard_listing.tsx @@ -10,7 +10,7 @@ import { FormattedMessage } from '@kbn/i18n/react'; import { EuiLink, EuiButton, EuiEmptyPrompt } from '@elastic/eui'; import React, { Fragment, useCallback, useEffect, useMemo, useState } from 'react'; import { attemptLoadDashboardByTitle } from '../lib'; -import { DashboardAppServices, DashboardRedirect } from '../types'; +import { DashboardAppServices, DashboardRedirect } from '../../types'; import { getDashboardBreadcrumb, dashboardListingTable } from '../../dashboard_strings'; import { ApplicationStart, SavedObjectsFindOptionsReference } from '../../../../../core/public'; import { syncQueryStateWithUrl } from '../../services/data'; @@ -43,13 +43,13 @@ export const DashboardListing = ({ savedObjectsClient, savedObjectsTagging, dashboardCapabilities, - dashboardPanelStorage, + dashboardSessionStorage, chrome: { setBreadcrumbs }, }, } = useKibana(); const [unsavedDashboardIds, setUnsavedDashboardIds] = useState( - dashboardPanelStorage.getDashboardIdsWithUnsavedChanges() + dashboardSessionStorage.getDashboardIdsWithUnsavedChanges() ); // Set breadcrumbs useEffect @@ -104,19 +104,19 @@ export const DashboardListing = ({ ); const createItem = useCallback(() => { - if (!dashboardPanelStorage.dashboardHasUnsavedEdits()) { + if (!dashboardSessionStorage.dashboardHasUnsavedEdits()) { redirectTo({ destination: 'dashboard' }); } else { confirmCreateWithUnsaved( core.overlays, () => { - dashboardPanelStorage.clearPanels(); + dashboardSessionStorage.clearState(); redirectTo({ destination: 'dashboard' }); }, () => redirectTo({ destination: 'dashboard' }) ); } - }, [dashboardPanelStorage, redirectTo, core.overlays]); + }, [dashboardSessionStorage, redirectTo, core.overlays]); const emptyPrompt = useMemo( () => getNoItemsMessage(hideWriteControls, core.application, createItem), @@ -145,11 +145,11 @@ export const DashboardListing = ({ const deleteItems = useCallback( (dashboards: Array<{ id: string }>) => { - dashboards.map((d) => dashboardPanelStorage.clearPanels(d.id)); - setUnsavedDashboardIds(dashboardPanelStorage.getDashboardIdsWithUnsavedChanges()); + dashboards.map((d) => dashboardSessionStorage.clearState(d.id)); + setUnsavedDashboardIds(dashboardSessionStorage.getDashboardIdsWithUnsavedChanges()); return savedDashboards.delete(dashboards.map((d) => d.id)); }, - [savedDashboards, dashboardPanelStorage] + [savedDashboards, dashboardSessionStorage] ); const editItem = useCallback( @@ -196,7 +196,7 @@ export const DashboardListing = ({ redirectTo={redirectTo} unsavedDashboardIds={unsavedDashboardIds} refreshUnsavedDashboards={() => - setUnsavedDashboardIds(dashboardPanelStorage.getDashboardIdsWithUnsavedChanges()) + setUnsavedDashboardIds(dashboardSessionStorage.getDashboardIdsWithUnsavedChanges()) } /> diff --git a/src/plugins/dashboard/public/application/listing/dashboard_no_match.tsx b/src/plugins/dashboard/public/application/listing/dashboard_no_match.tsx index a649bf37dfae9d..03f7b0e162229c 100644 --- a/src/plugins/dashboard/public/application/listing/dashboard_no_match.tsx +++ b/src/plugins/dashboard/public/application/listing/dashboard_no_match.tsx @@ -6,14 +6,14 @@ * Side Public License, v 1. */ -import React, { useEffect } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import React, { useEffect } from 'react'; import { EuiCallOut } from '@elastic/eui'; - +import { FormattedMessage } from '@kbn/i18n/react'; import { RouteComponentProps } from 'react-router-dom'; + import { useKibana, toMountPoint } from '../../services/kibana_react'; -import { DashboardAppServices } from '../types'; +import { DashboardAppServices } from '../../types'; import { DashboardConstants } from '../..'; let bannerId: string | undefined; diff --git a/src/plugins/dashboard/public/application/listing/dashboard_unsaved_listing.test.tsx b/src/plugins/dashboard/public/application/listing/dashboard_unsaved_listing.test.tsx index 13688b4061be93..8f53c16749fe67 100644 --- a/src/plugins/dashboard/public/application/listing/dashboard_unsaved_listing.test.tsx +++ b/src/plugins/dashboard/public/application/listing/dashboard_unsaved_listing.test.tsx @@ -11,14 +11,14 @@ import { findTestSubject } from '@elastic/eui/lib/test'; import { waitFor } from '@testing-library/react'; import { mount } from 'enzyme'; import React from 'react'; + import { DashboardSavedObject } from '../..'; -import { coreMock } from '../../../../../core/public/mocks'; -import { KibanaContextProvider } from '../../services/kibana_react'; +import { DashboardAppServices } from '../../types'; import { SavedObjectLoader } from '../../services/saved_objects'; -import { DashboardPanelStorage } from '../lib'; -import { DASHBOARD_PANELS_UNSAVED_ID } from '../lib/dashboard_panel_storage'; -import { DashboardAppServices } from '../types'; +import { KibanaContextProvider } from '../../services/kibana_react'; +import { DASHBOARD_PANELS_UNSAVED_ID } from '../lib/dashboard_session_storage'; import { DashboardUnsavedListing, DashboardUnsavedListingProps } from './dashboard_unsaved_listing'; +import { makeDefaultServices } from '../test_helpers'; const mockedDashboards: { [key: string]: DashboardSavedObject } = { dashboardUnsavedOne: { @@ -35,20 +35,16 @@ const mockedDashboards: { [key: string]: DashboardSavedObject } = { } as DashboardSavedObject, }; -function makeDefaultServices(): DashboardAppServices { - const core = coreMock.createStart(); - core.overlays.openConfirm = jest.fn().mockResolvedValue(true); +function makeServices(): DashboardAppServices { + const services = makeDefaultServices(); const savedDashboards = {} as SavedObjectLoader; savedDashboards.get = jest .fn() .mockImplementation((id: string) => Promise.resolve(mockedDashboards[id])); - const dashboardPanelStorage = {} as DashboardPanelStorage; - dashboardPanelStorage.clearPanels = jest.fn(); - return ({ - dashboardPanelStorage, + return { + ...services, savedDashboards, - core, - } as unknown) as DashboardAppServices; + }; } const makeDefaultProps = (): DashboardUnsavedListingProps => ({ @@ -64,7 +60,7 @@ function mountWith({ services?: DashboardAppServices; props?: DashboardUnsavedListingProps; }) { - const services = incomingServices ?? makeDefaultServices(); + const services = incomingServices ?? makeServices(); const props = incomingProps ?? makeDefaultProps(); const wrappingComponent: React.FC<{ children: React.ReactNode; @@ -140,14 +136,14 @@ describe('Unsaved listing', () => { waitFor(() => { component.update(); expect(services.core.overlays.openConfirm).toHaveBeenCalled(); - expect(services.dashboardPanelStorage.clearPanels).toHaveBeenCalledWith( + expect(services.dashboardSessionStorage.clearState).toHaveBeenCalledWith( 'dashboardUnsavedOne' ); }); }); it('removes unsaved changes from any dashboard which errors on fetch', async () => { - const services = makeDefaultServices(); + const services = makeServices(); const props = makeDefaultProps(); services.savedDashboards.get = jest.fn().mockImplementation((id: string) => { if (id === 'failCase1' || id === 'failCase2') { @@ -166,12 +162,12 @@ describe('Unsaved listing', () => { const { component } = mountWith({ services, props }); waitFor(() => { component.update(); - expect(services.dashboardPanelStorage.clearPanels).toHaveBeenCalledWith('failCase1'); - expect(services.dashboardPanelStorage.clearPanels).toHaveBeenCalledWith('failCase2'); + expect(services.dashboardSessionStorage.clearState).toHaveBeenCalledWith('failCase1'); + expect(services.dashboardSessionStorage.clearState).toHaveBeenCalledWith('failCase2'); // clearing panels from dashboard with errors should cause getDashboardIdsWithUnsavedChanges to be called again. expect( - services.dashboardPanelStorage.getDashboardIdsWithUnsavedChanges + services.dashboardSessionStorage.getDashboardIdsWithUnsavedChanges ).toHaveBeenCalledTimes(2); }); }); diff --git a/src/plugins/dashboard/public/application/listing/dashboard_unsaved_listing.tsx b/src/plugins/dashboard/public/application/listing/dashboard_unsaved_listing.tsx index 66e8b2348490a1..acff60d9bac3d8 100644 --- a/src/plugins/dashboard/public/application/listing/dashboard_unsaved_listing.tsx +++ b/src/plugins/dashboard/public/application/listing/dashboard_unsaved_listing.tsx @@ -19,8 +19,8 @@ import React, { useCallback, useEffect, useState } from 'react'; import { DashboardSavedObject } from '../..'; import { dashboardUnsavedListingStrings, getNewDashboardTitle } from '../../dashboard_strings'; import { useKibana } from '../../services/kibana_react'; -import { DASHBOARD_PANELS_UNSAVED_ID } from '../lib/dashboard_panel_storage'; -import { DashboardAppServices, DashboardRedirect } from '../types'; +import { DASHBOARD_PANELS_UNSAVED_ID } from '../lib/dashboard_session_storage'; +import { DashboardAppServices, DashboardRedirect } from '../../types'; import { confirmDiscardUnsavedChanges } from './confirm_overlays'; const DashboardUnsavedItem = ({ @@ -115,7 +115,7 @@ export const DashboardUnsavedListing = ({ }: DashboardUnsavedListingProps) => { const { services: { - dashboardPanelStorage, + dashboardSessionStorage, savedDashboards, core: { overlays }, }, @@ -133,11 +133,11 @@ export const DashboardUnsavedListing = ({ const onDiscard = useCallback( (id?: string) => { confirmDiscardUnsavedChanges(overlays, () => { - dashboardPanelStorage.clearPanels(id); + dashboardSessionStorage.clearState(id); refreshUnsavedDashboards(); }); }, - [overlays, refreshUnsavedDashboards, dashboardPanelStorage] + [overlays, refreshUnsavedDashboards, dashboardSessionStorage] ); useEffect(() => { @@ -161,7 +161,7 @@ export const DashboardUnsavedListing = ({ const newItems = dashboards.reduce((map, dashboard) => { if (typeof dashboard === 'string') { hasError = true; - dashboardPanelStorage.clearPanels(dashboard); + dashboardSessionStorage.clearState(dashboard); return map; } return { @@ -178,7 +178,7 @@ export const DashboardUnsavedListing = ({ return () => { canceled = true; }; - }, [savedDashboards, dashboardPanelStorage, refreshUnsavedDashboards, unsavedDashboardIds]); + }, [savedDashboards, dashboardSessionStorage, refreshUnsavedDashboards, unsavedDashboardIds]); return unsavedDashboardIds.length === 0 ? null : ( <> diff --git a/src/plugins/dashboard/public/application/state/dashboard_state_hooks.ts b/src/plugins/dashboard/public/application/state/dashboard_state_hooks.ts new file mode 100644 index 00000000000000..abc346d4bbaa34 --- /dev/null +++ b/src/plugins/dashboard/public/application/state/dashboard_state_hooks.ts @@ -0,0 +1,12 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux'; +import type { DashboardRootState, DashboardDispatch } from './dashboard_state_store'; + +export const useDashboardDispatch = () => useDispatch(); +export const useDashboardSelector: TypedUseSelectorHook = useSelector; diff --git a/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts b/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts new file mode 100644 index 00000000000000..1acf806ae2f0d7 --- /dev/null +++ b/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts @@ -0,0 +1,112 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { createSlice, PayloadAction } from '@reduxjs/toolkit'; + +import { Filter, Query } from '../../services/data'; +import { ViewMode } from '../../services/embeddable'; +import { DashboardOptions, DashboardPanelMap, DashboardState } from '../../types'; + +export const dashboardStateSlice = createSlice({ + name: 'dashboardState', + initialState: {} as DashboardState, + reducers: { + setDashboardState: (state, action: PayloadAction) => { + return action.payload; + }, + updateState: (state, action: PayloadAction>) => { + state = { ...state, ...action.payload }; + }, + setDashboardOptions: (state, action: PayloadAction) => { + state.options = action.payload; + }, + setStateFromSaveModal: ( + state, + action: PayloadAction<{ + title: string; + description: string; + tags?: string[]; + timeRestore: boolean; + }> + ) => { + state.title = action.payload.title; + state.description = action.payload.description; + state.timeRestore = action.payload.timeRestore; + if (action.payload.tags) { + state.tags = action.payload.tags; + } + }, + setUseMargins: (state, action: PayloadAction) => { + state.options.useMargins = action.payload; + }, + setSyncColors: (state, action: PayloadAction) => { + state.options.syncColors = action.payload; + }, + setHidePanelTitles: (state, action: PayloadAction) => { + state.options.hidePanelTitles = action.payload; + }, + setPanels: (state, action: PayloadAction) => { + state.panels = action.payload; + }, + setExpandedPanelId: (state, action: PayloadAction) => { + state.expandedPanelId = action.payload; + }, + setFullScreenMode: (state, action: PayloadAction) => { + state.fullScreenMode = action.payload; + }, + setSavedQueryId: (state, action: PayloadAction) => { + state.savedQuery = action.payload; + }, + setTimeRestore: (state, action: PayloadAction) => { + state.timeRestore = action.payload; + }, + setDescription: (state, action: PayloadAction) => { + state.description = action.payload; + }, + setViewMode: (state, action: PayloadAction) => { + state.viewMode = action.payload; + }, + setFiltersAndQuery: (state, action: PayloadAction<{ filters: Filter[]; query: Query }>) => { + state.filters = action.payload.filters; + state.query = action.payload.query; + }, + setFilters: (state, action: PayloadAction) => { + state.filters = action.payload; + }, + setTags: (state, action: PayloadAction) => { + state.tags = action.payload; + }, + setTitle: (state, action: PayloadAction) => { + state.description = action.payload; + }, + setQuery: (state, action: PayloadAction) => { + state.query = action.payload; + }, + }, +}); + +export const { + setStateFromSaveModal, + setDashboardOptions, + setExpandedPanelId, + setHidePanelTitles, + setFiltersAndQuery, + setDashboardState, + setFullScreenMode, + setSavedQueryId, + setDescription, + setTimeRestore, + setSyncColors, + setUseMargins, + setViewMode, + setFilters, + setPanels, + setTitle, + setQuery, + setTags, +} = dashboardStateSlice.actions; diff --git a/src/plugins/dashboard/public/application/state/dashboard_state_store.ts b/src/plugins/dashboard/public/application/state/dashboard_state_store.ts new file mode 100644 index 00000000000000..76bc2c2fb1c773 --- /dev/null +++ b/src/plugins/dashboard/public/application/state/dashboard_state_store.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { configureStore } from '@reduxjs/toolkit'; +import { dashboardStateSlice } from './dashboard_state_slice'; + +export const dashboardStateStore = configureStore({ + reducer: { dashboardStateReducer: dashboardStateSlice.reducer }, +}); + +export type DashboardRootState = ReturnType; +export type DashboardDispatch = typeof dashboardStateStore.dispatch; diff --git a/src/plugins/dashboard/public/application/state/index.ts b/src/plugins/dashboard/public/application/state/index.ts new file mode 100644 index 00000000000000..d394876173160d --- /dev/null +++ b/src/plugins/dashboard/public/application/state/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export * from './dashboard_state_slice'; + +export { dashboardStateStore } from './dashboard_state_store'; +export { useDashboardDispatch, useDashboardSelector } from './dashboard_state_hooks'; diff --git a/src/plugins/dashboard/public/application/test_helpers/get_sample_dashboard_input.ts b/src/plugins/dashboard/public/application/test_helpers/get_sample_dashboard_input.ts index fb160568fa4f4d..46be5b3b16d849 100644 --- a/src/plugins/dashboard/public/application/test_helpers/get_sample_dashboard_input.ts +++ b/src/plugins/dashboard/public/application/test_helpers/get_sample_dashboard_input.ts @@ -6,8 +6,9 @@ * Side Public License, v 1. */ +import { DashboardContainerInput } from '../..'; +import { DashboardPanelState } from '../embeddable'; import { ViewMode, EmbeddableInput } from '../../services/embeddable'; -import { DashboardContainerInput, DashboardPanelState } from '../embeddable'; export function getSampleDashboardInput( overrides?: Partial diff --git a/src/plugins/dashboard/public/application/test_helpers/index.ts b/src/plugins/dashboard/public/application/test_helpers/index.ts index d782fb67d039b6..d26eadec8f1c9c 100644 --- a/src/plugins/dashboard/public/application/test_helpers/index.ts +++ b/src/plugins/dashboard/public/application/test_helpers/index.ts @@ -8,3 +8,4 @@ export { getSampleDashboardInput, getSampleDashboardPanel } from './get_sample_dashboard_input'; export { getSavedDashboardMock } from './get_saved_dashboard_mock'; +export { makeDefaultServices } from './make_default_services'; diff --git a/src/plugins/dashboard/public/application/test_helpers/make_default_services.ts b/src/plugins/dashboard/public/application/test_helpers/make_default_services.ts new file mode 100644 index 00000000000000..41da74dbba778a --- /dev/null +++ b/src/plugins/dashboard/public/application/test_helpers/make_default_services.ts @@ -0,0 +1,97 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { DashboardSessionStorage } from '../lib'; +import { dataPluginMock } from '../../../../data/public/mocks'; +import { getSavedDashboardMock } from './get_saved_dashboard_mock'; +import { UrlForwardingStart } from '../../../../url_forwarding/public'; +import { NavigationPublicPluginStart } from '../../services/navigation'; +import { DashboardAppServices, DashboardAppCapabilities } from '../../types'; +import { embeddablePluginMock } from '../../../../embeddable/public/mocks'; +import { IndexPatternsContract, SavedQueryService } from '../../services/data'; +import { savedObjectsPluginMock } from '../../../../saved_objects/public/mocks'; +import { visualizationsPluginMock } from '../../../../visualizations/public/mocks'; +import { PluginInitializerContext, ScopedHistory } from '../../../../../core/public'; +import { SavedObjectLoader, SavedObjectLoaderFindOptions } from '../../services/saved_objects'; +import { + chromeServiceMock, + coreMock, + uiSettingsServiceMock, +} from '../../../../../core/public/mocks'; + +export function makeDefaultServices(): DashboardAppServices { + const core = coreMock.createStart(); + core.overlays.openConfirm = jest.fn().mockResolvedValue(true); + + const savedDashboards = {} as SavedObjectLoader; + savedDashboards.find = (search: string, sizeOrOptions: number | SavedObjectLoaderFindOptions) => { + const size = typeof sizeOrOptions === 'number' ? sizeOrOptions : sizeOrOptions.size ?? 10; + const hits = []; + for (let i = 0; i < size; i++) { + hits.push({ + id: `dashboard${i}`, + title: `dashboard${i} - ${search} - title`, + description: `dashboard${i} desc`, + }); + } + return Promise.resolve({ + total: size, + hits, + }); + }; + savedDashboards.get = jest + .fn() + .mockImplementation((id?: string) => Promise.resolve(getSavedDashboardMock({ id }))); + + const dashboardSessionStorage = ({ + getDashboardIdsWithUnsavedChanges: jest + .fn() + .mockResolvedValue(['dashboardUnsavedOne', 'dashboardUnsavedTwo']), + getState: jest.fn().mockReturnValue(undefined), + setState: jest.fn(), + } as unknown) as DashboardSessionStorage; + dashboardSessionStorage.clearState = jest.fn(); + + const defaultCapabilities: DashboardAppCapabilities = { + show: true, + createNew: true, + saveQuery: true, + createShortUrl: true, + hideWriteControls: false, + storeSearchSession: true, + mapsCapabilities: { save: true }, + visualizeCapabilities: { save: true }, + }; + const initializerContext = { + env: { packageInfo: { version: '8.0.0' } }, + } as PluginInitializerContext; + + return { + visualizations: visualizationsPluginMock.createStartContract(), + savedObjects: savedObjectsPluginMock.createStartContract(), + embeddable: embeddablePluginMock.createInstance().doStart(), + uiSettings: uiSettingsServiceMock.createStartContract(), + chrome: chromeServiceMock.createStartContract(), + navigation: {} as NavigationPublicPluginStart, + savedObjectsClient: core.savedObjects.client, + dashboardCapabilities: defaultCapabilities, + data: dataPluginMock.createStartContract(), + indexPatterns: {} as IndexPatternsContract, + savedQueryService: {} as SavedQueryService, + scopedHistory: () => ({} as ScopedHistory), + setHeaderActionMenu: (mountPoint) => {}, + urlForwarding: {} as UrlForwardingStart, + allowByValueEmbeddables: true, + restorePreviousUrl: () => {}, + onAppLeave: (handler) => {}, + dashboardSessionStorage, + initializerContext, + savedDashboards, + core, + }; +} diff --git a/src/plugins/dashboard/public/application/top_nav/dashboard_top_nav.tsx b/src/plugins/dashboard/public/application/top_nav/dashboard_top_nav.tsx index e1a62fe980f552..1cfa39d5e0e79b 100644 --- a/src/plugins/dashboard/public/application/top_nav/dashboard_top_nav.tsx +++ b/src/plugins/dashboard/public/application/top_nav/dashboard_top_nav.tsx @@ -7,92 +7,94 @@ */ import { METRIC_TYPE } from '@kbn/analytics'; +import { Required } from '@kbn/utility-types'; import { EuiHorizontalRule } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import angular from 'angular'; +import UseUnmount from 'react-use/lib/useUnmount'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; -import UseUnmount from 'react-use/lib/useUnmount'; +import { saveDashboard } from '../lib'; +import { TopNavIds } from './top_nav_ids'; +import { EditorMenu } from './editor_menu'; import { UI_SETTINGS } from '../../../common'; +import { SavedQuery } from '../../services/data'; +import { DashboardSaveModal } from './save_modal'; +import { showCloneModal } from './show_clone_modal'; +import { ShowShareModal } from './show_share_modal'; +import { getTopNavConfig } from './get_top_nav_config'; +import { OverlayRef } from '../../../../../core/public'; +import { useKibana } from '../../services/kibana_react'; +import { showOptionsPopover } from './show_options_popover'; +import { DashboardConstants } from '../../dashboard_constants'; +import { TopNavMenuProps } from '../../../../navigation/public'; +import { confirmDiscardUnsavedChanges } from '../listing/confirm_overlays'; import { BaseVisType, VisTypeAlias } from '../../../../visualizations/public'; +import { DashboardAppState, DashboardSaveOptions, NavAction } from '../../types'; +import { isErrorEmbeddable, openAddPanelFlyout, ViewMode } from '../../services/embeddable'; +import { DashboardAppServices, DashboardEmbedSettings, DashboardRedirect } from '../../types'; +import { getSavedObjectFinder, SaveResult, showSaveModal } from '../../services/saved_objects'; +import { getCreateVisualizationButtonTitle, unsavedChangesBadge } from '../../dashboard_strings'; +import { + setFullScreenMode, + setHidePanelTitles, + setSavedQueryId, + setStateFromSaveModal, + setSyncColors, + setUseMargins, + setViewMode, + useDashboardDispatch, + useDashboardSelector, +} from '../state'; + import { AddFromLibraryButton, + LazyLabsFlyout, PrimaryActionButton, QuickButtonGroup, - SolutionToolbar, QuickButtonProps, + SolutionToolbar, + withSuspense, } from '../../../../presentation_util/public'; -import { useKibana } from '../../services/kibana_react'; -import { IndexPattern, SavedQuery, TimefilterContract } from '../../services/data'; -import { isErrorEmbeddable, openAddPanelFlyout, ViewMode } from '../../services/embeddable'; -import { - getSavedObjectFinder, - SavedObjectSaveOpts, - SaveResult, - showSaveModal, -} from '../../services/saved_objects'; -import { LazyLabsFlyout, withSuspense } from '../../../../presentation_util/public'; - -import { NavAction } from '../../types'; -import { DashboardSavedObject } from '../..'; -import { DashboardStateManager } from '../dashboard_state_manager'; -import { saveDashboard } from '../lib'; -import { - DashboardAppServices, - DashboardEmbedSettings, - DashboardRedirect, - DashboardSaveOptions, -} from '../types'; -import { getTopNavConfig } from './get_top_nav_config'; -import { DashboardSaveModal } from './save_modal'; -import { showCloneModal } from './show_clone_modal'; -import { showOptionsPopover } from './show_options_popover'; -import { TopNavIds } from './top_nav_ids'; -import { ShowShareModal } from './show_share_modal'; -import { confirmDiscardOrKeepUnsavedChanges } from '../listing/confirm_overlays'; -import { OverlayRef } from '../../../../../core/public'; -import { DashboardConstants } from '../../dashboard_constants'; -import { getNewDashboardTitle, unsavedChangesBadge } from '../../dashboard_strings'; -import { DASHBOARD_PANELS_UNSAVED_ID } from '../lib/dashboard_panel_storage'; -import { DashboardContainer } from '..'; -import { EditorMenu } from './editor_menu'; export interface DashboardTopNavState { chromeIsVisible: boolean; addPanelOverlay?: OverlayRef; savedQuery?: SavedQuery; + isSaveInProgress?: boolean; } +type CompleteDashboardAppState = Required< + DashboardAppState, + | 'getLatestDashboardState' + | 'dashboardContainer' + | 'savedDashboard' + | 'indexPatterns' + | 'applyFilters' +>; + +export const isCompleteDashboardAppState = ( + state: DashboardAppState +): state is CompleteDashboardAppState => { + return ( + Boolean(state.getLatestDashboardState) && + Boolean(state.dashboardContainer) && + Boolean(state.savedDashboard) && + Boolean(state.indexPatterns) && + Boolean(state.applyFilters) + ); +}; + export interface DashboardTopNavProps { - onQuerySubmit: (_payload: unknown, isUpdate: boolean | undefined) => void; - dashboardStateManager: DashboardStateManager; - dashboardContainer: DashboardContainer; + dashboardAppState: CompleteDashboardAppState; embedSettings?: DashboardEmbedSettings; - savedDashboard: DashboardSavedObject; - timefilter: TimefilterContract; - indexPatterns: IndexPattern[]; redirectTo: DashboardRedirect; - unsavedChanges: boolean; - clearUnsavedChanges: () => void; - lastDashboardId?: string; - viewMode: ViewMode; } -const Flyout = withSuspense(LazyLabsFlyout, null); +const LabsFlyout = withSuspense(LazyLabsFlyout, null); export function DashboardTopNav({ - dashboardStateManager, - clearUnsavedChanges, - dashboardContainer, - lastDashboardId, - unsavedChanges, - savedDashboard, - onQuerySubmit, + dashboardAppState, embedSettings, - indexPatterns, redirectTo, - timefilter, - viewMode, }: DashboardTopNavProps) { const { core, @@ -102,17 +104,24 @@ export function DashboardTopNav({ embeddable, navigation, uiSettings, - setHeaderActionMenu, + visualizations, + usageCollection, + initializerContext, savedObjectsTagging, + setHeaderActionMenu, dashboardCapabilities, - dashboardPanelStorage, + dashboardSessionStorage, allowByValueEmbeddables, - visualizations, - usageCollection, } = useKibana().services; + const { version: kibanaVersion } = initializerContext.env.packageInfo; + const timefilter = data.query.timefilter.timefilter; + const toasts = core.notifications.toasts; + + const dispatchDashboardStateChange = useDashboardDispatch(); + const dashboardState = useDashboardSelector((state) => state.dashboardStateReducer); + const [mounted, setMounted] = useState(true); const [state, setState] = useState({ chromeIsVisible: false }); - const [isSaveInProgress, setIsSaveInProgress] = useState(false); const [isLabsShown, setIsLabsShown] = useState(false); const lensAlias = visualizations.getAliases().find(({ name }) => name === 'lens'); @@ -130,25 +139,25 @@ export function DashboardTopNav({ const visibleSubscription = chrome.getIsVisible$().subscribe((chromeIsVisible) => { setState((s) => ({ ...s, chromeIsVisible })); }); - const { id, title, getFullEditPath } = savedDashboard; - if (id || allowByValueEmbeddables) { + const { id, title, getFullEditPath } = dashboardAppState.savedDashboard; + if (id && title) { chrome.recentlyAccessed.add( - getFullEditPath(dashboardStateManager.getIsEditMode()), - title || getNewDashboardTitle(), - id || DASHBOARD_PANELS_UNSAVED_ID + getFullEditPath(dashboardState.viewMode === ViewMode.EDIT), + title, + id ); } return () => { visibleSubscription.unsubscribe(); }; - }, [chrome, allowByValueEmbeddables, dashboardStateManager, savedDashboard]); + }, [chrome, allowByValueEmbeddables, dashboardState.viewMode, dashboardAppState.savedDashboard]); const addFromLibrary = useCallback(() => { - if (!isErrorEmbeddable(dashboardContainer)) { + if (!isErrorEmbeddable(dashboardAppState.dashboardContainer)) { setState((s) => ({ ...s, addPanelOverlay: openAddPanelFlyout({ - embeddable: dashboardContainer, + embeddable: dashboardAppState.dashboardContainer, getAllFactories: embeddable.getEmbeddableFactories, getFactory: embeddable.getEmbeddableFactory, notifications: core.notifications, @@ -158,9 +167,9 @@ export function DashboardTopNav({ })); } }, [ + dashboardAppState.dashboardContainer, embeddable.getEmbeddableFactories, embeddable.getEmbeddableFactory, - dashboardContainer, core.notifications, core.savedObjects, core.overlays, @@ -209,291 +218,220 @@ export function DashboardTopNav({ const onChangeViewMode = useCallback( (newMode: ViewMode) => { clearAddPanel(); - const isPageRefresh = newMode === dashboardStateManager.getViewMode(); - const isLeavingEditMode = !isPageRefresh && newMode === ViewMode.VIEW; - const willLoseChanges = isLeavingEditMode && dashboardStateManager.getIsDirty(timefilter); - - function switchViewMode() { - dashboardStateManager.switchViewMode(newMode); - - if (savedDashboard?.id && allowByValueEmbeddables) { - const { getFullEditPath, title, id } = savedDashboard; - chrome.recentlyAccessed.add(getFullEditPath(newMode === ViewMode.EDIT), title, id); - } - } + const willLoseChanges = newMode === ViewMode.VIEW && dashboardAppState.hasUnsavedChanges; if (!willLoseChanges) { - switchViewMode(); + dispatchDashboardStateChange(setViewMode(newMode)); return; } - function discardChanges() { - dashboardStateManager.resetState(); - dashboardStateManager.clearUnsavedPanels(); - - // We need to do a hard reset of the timepicker. appState will not reload like - // it does on 'open' because it's been saved to the url and the getAppState.previouslyStored() check on - // reload will cause it not to sync. - if (dashboardStateManager.getIsTimeSavedWithDashboard()) { - dashboardStateManager.syncTimefilterWithDashboardTime(timefilter); - dashboardStateManager.syncTimefilterWithDashboardRefreshInterval(timefilter); - } - dashboardStateManager.switchViewMode(ViewMode.VIEW); - } - confirmDiscardOrKeepUnsavedChanges(core.overlays).then((selection) => { - if (selection === 'discard') { - discardChanges(); - } - if (selection !== 'cancel') { - switchViewMode(); - } - }); - }, - [ - timefilter, - core.overlays, - clearAddPanel, - savedDashboard, - dashboardStateManager, - allowByValueEmbeddables, - chrome.recentlyAccessed, - ] - ); - - /** - * Saves the dashboard. - * - * @param {object} [saveOptions={}] - * @property {boolean} [saveOptions.confirmOverwrite=false] - If true, attempts to create the source so it - * can confirm an overwrite if a document with the id already exists. - * @property {boolean} [saveOptions.isTitleDuplicateConfirmed=false] - If true, save allowed with duplicate title - * @property {func} [saveOptions.onTitleDuplicate] - function called if duplicate title exists. - * When not provided, confirm modal will be displayed asking user to confirm or cancel save. - * @return {Promise} - * @resolved {String} - The id of the doc - */ - const save = useCallback( - async (saveOptions: SavedObjectSaveOpts) => { - setIsSaveInProgress(true); - return saveDashboard(angular.toJson, timefilter, dashboardStateManager, saveOptions) - .then(function (id) { - if (id) { - core.notifications.toasts.addSuccess({ - title: i18n.translate('dashboard.dashboardWasSavedSuccessMessage', { - defaultMessage: `Dashboard '{dashTitle}' was saved`, - values: { dashTitle: dashboardStateManager.savedDashboard.title }, - }), - 'data-test-subj': 'saveDashboardSuccess', - }); - - dashboardPanelStorage.clearPanels(lastDashboardId); - if (id !== lastDashboardId) { - redirectTo({ - id, - // editMode: true, - destination: 'dashboard', - useReplace: true, - }); - } else { - dashboardStateManager.resetState(); - chrome.docTitle.change(dashboardStateManager.savedDashboard.lastSavedTitle); - } - } - setIsSaveInProgress(false); - return { id }; - }) - .catch((error) => { - core.notifications?.toasts.addDanger({ - title: i18n.translate('dashboard.dashboardWasNotSavedDangerMessage', { - defaultMessage: `Dashboard '{dashTitle}' was not saved. Error: {errorMessage}`, - values: { - dashTitle: dashboardStateManager.savedDashboard.title, - errorMessage: error.message, - }, - }), - 'data-test-subj': 'saveDashboardFailure', - }); - return { error }; - }); + confirmDiscardUnsavedChanges(core.overlays, () => + dashboardAppState.resetToLastSavedState?.() + ); }, - [ - core.notifications.toasts, - dashboardStateManager, - dashboardPanelStorage, - lastDashboardId, - chrome.docTitle, - redirectTo, - timefilter, - ] + [clearAddPanel, core.overlays, dashboardAppState, dispatchDashboardStateChange] ); - const runSave = useCallback(async () => { - const currentTitle = dashboardStateManager.getTitle(); - const currentDescription = dashboardStateManager.getDescription(); - const currentTimeRestore = dashboardStateManager.getTimeRestore(); - - let currentTags: string[] = []; - if (savedObjectsTagging) { - const dashboard = dashboardStateManager.savedDashboard; - if (savedObjectsTagging.ui.hasTagDecoration(dashboard)) { - currentTags = dashboard.getTags(); - } - } - - const onSave = ({ + const runSaveAs = useCallback(async () => { + const currentState = dashboardAppState.getLatestDashboardState(); + const onSave = async ({ + newTags, newTitle, newDescription, newCopyOnSave, newTimeRestore, onTitleDuplicate, isTitleDuplicateConfirmed, - newTags, }: DashboardSaveOptions): Promise => { - dashboardStateManager.setTitle(newTitle); - dashboardStateManager.setDescription(newDescription); - dashboardStateManager.savedDashboard.copyOnSave = newCopyOnSave; - dashboardStateManager.setTimeRestore(newTimeRestore); - if (savedObjectsTagging && newTags) { - dashboardStateManager.setTags(newTags); - } - const saveOptions = { confirmOverwrite: false, isTitleDuplicateConfirmed, onTitleDuplicate, }; + const stateFromSaveModal = { + title: newTitle, + description: newDescription, + timeRestore: newTimeRestore, + tags: [] as string[], + }; + if (savedObjectsTagging && newTags) { + stateFromSaveModal.tags = newTags; + } - return save(saveOptions).then((response: SaveResult) => { - // If the save wasn't successful, put the original values back. - if (!(response as { id: string }).id) { - dashboardStateManager.setTitle(currentTitle); - dashboardStateManager.setDescription(currentDescription); - dashboardStateManager.setTimeRestore(currentTimeRestore); - if (savedObjectsTagging) { - dashboardStateManager.setTags(currentTags); - } - } - return response; + dashboardAppState.savedDashboard.copyOnSave = newCopyOnSave; + const saveResult = await saveDashboard({ + toasts, + timefilter, + redirectTo, + saveOptions, + savedObjectsTagging, + version: kibanaVersion, + dashboardSessionStorage, + savedDashboard: dashboardAppState.savedDashboard, + currentState: { ...currentState, ...stateFromSaveModal }, }); + if (saveResult.id && !saveResult.redirected) { + dispatchDashboardStateChange(setStateFromSaveModal(stateFromSaveModal)); + dashboardAppState.updateLastSavedState?.(); + chrome.docTitle.change(stateFromSaveModal.title); + } + return saveResult.id ? { id: saveResult.id } : { error: saveResult.error }; }; + const lastDashboardId = dashboardAppState.savedDashboard.id; + const currentTags = savedObjectsTagging?.ui.hasTagDecoration(dashboardAppState.savedDashboard) + ? dashboardAppState.savedDashboard.getTags() + : []; const dashboardSaveModal = ( {}} - title={currentTitle} - description={currentDescription} tags={currentTags} + title={currentState.title} + timeRestore={currentState.timeRestore} + description={currentState.description} savedObjectsTagging={savedObjectsTagging} - timeRestore={currentTimeRestore} showCopyOnSave={lastDashboardId ? true : false} /> ); clearAddPanel(); showSaveModal(dashboardSaveModal, core.i18n.Context); }, [ - save, - clearAddPanel, - lastDashboardId, - core.i18n.Context, + dispatchDashboardStateChange, + dashboardSessionStorage, savedObjectsTagging, - dashboardStateManager, + dashboardAppState, + core.i18n.Context, + chrome.docTitle, + clearAddPanel, + kibanaVersion, + timefilter, + redirectTo, + toasts, ]); const runQuickSave = useCallback(async () => { - const currentTitle = dashboardStateManager.getTitle(); - const currentDescription = dashboardStateManager.getDescription(); - const currentTimeRestore = dashboardStateManager.getTimeRestore(); - - let currentTags: string[] = []; - if (savedObjectsTagging) { - const dashboard = dashboardStateManager.savedDashboard; - if (savedObjectsTagging.ui.hasTagDecoration(dashboard)) { - currentTags = dashboard.getTags(); - } - } - - setIsSaveInProgress(true); - save({}).then((response: SaveResult) => { - // If the save wasn't successful, put the original values back. - if (!(response as { id: string }).id) { - dashboardStateManager.setTitle(currentTitle); - dashboardStateManager.setDescription(currentDescription); - dashboardStateManager.setTimeRestore(currentTimeRestore); - if (savedObjectsTagging) { - dashboardStateManager.setTags(currentTags); - } - } else { - clearUnsavedChanges(); - } - setIsSaveInProgress(false); - return response; + setState((s) => ({ ...s, isSaveInProgress: true })); + const currentState = dashboardAppState.getLatestDashboardState(); + const saveResult = await saveDashboard({ + toasts, + timefilter, + redirectTo, + currentState, + saveOptions: {}, + savedObjectsTagging, + version: kibanaVersion, + dashboardSessionStorage, + savedDashboard: dashboardAppState.savedDashboard, }); - }, [save, savedObjectsTagging, dashboardStateManager, clearUnsavedChanges]); + if (saveResult.id && !saveResult.redirected) { + dashboardAppState.updateLastSavedState?.(); + } + // turn off save in progress after the next change check. This prevents the save button from flashing + setTimeout(() => { + if (!mounted) return; + setState((s) => ({ ...s, isSaveInProgress: false })); + }, DashboardConstants.CHANGE_CHECK_DEBOUNCE); + }, [ + dashboardSessionStorage, + savedObjectsTagging, + dashboardAppState, + kibanaVersion, + timefilter, + redirectTo, + mounted, + toasts, + ]); const runClone = useCallback(() => { - const currentTitle = dashboardStateManager.getTitle(); + const currentState = dashboardAppState.getLatestDashboardState(); const onClone = async ( newTitle: string, isTitleDuplicateConfirmed: boolean, onTitleDuplicate: () => void ) => { - dashboardStateManager.savedDashboard.copyOnSave = true; - dashboardStateManager.setTitle(newTitle); + dashboardAppState.savedDashboard.copyOnSave = true; const saveOptions = { confirmOverwrite: false, isTitleDuplicateConfirmed, onTitleDuplicate, }; - return save(saveOptions).then((response: { id?: string } | { error: Error }) => { - // If the save wasn't successful, put the original title back. - if ((response as { error: Error }).error) { - dashboardStateManager.setTitle(currentTitle); - } - return response; + const saveResult = await saveDashboard({ + toasts, + timefilter, + redirectTo, + saveOptions, + savedObjectsTagging, + version: kibanaVersion, + dashboardSessionStorage, + savedDashboard: dashboardAppState.savedDashboard, + currentState: { ...currentState, title: newTitle }, }); + return saveResult.id ? { id: saveResult.id } : { error: saveResult.error }; }; + showCloneModal(onClone, currentState.title); + }, [ + dashboardSessionStorage, + savedObjectsTagging, + dashboardAppState, + kibanaVersion, + redirectTo, + timefilter, + toasts, + ]); - showCloneModal(onClone, currentTitle); - }, [dashboardStateManager, save]); + const showOptions = useCallback( + (anchorElement: HTMLElement) => { + const currentState = dashboardAppState.getLatestDashboardState(); + showOptionsPopover({ + anchorElement, + useMargins: currentState.options.useMargins, + onUseMarginsChange: (isChecked: boolean) => { + dispatchDashboardStateChange(setUseMargins(isChecked)); + }, + syncColors: Boolean(currentState.options.syncColors), + onSyncColorsChange: (isChecked: boolean) => { + dispatchDashboardStateChange(setSyncColors(isChecked)); + }, + hidePanelTitles: currentState.options.hidePanelTitles, + onHidePanelTitlesChange: (isChecked: boolean) => { + dispatchDashboardStateChange(setHidePanelTitles(isChecked)); + }, + }); + }, + [dashboardAppState, dispatchDashboardStateChange] + ); + + const showShare = useCallback( + (anchorElement: HTMLElement) => { + if (!share) return; + const currentState = dashboardAppState.getLatestDashboardState(); + ShowShareModal({ + share, + kibanaVersion, + anchorElement, + dashboardCapabilities, + currentDashboardState: currentState, + savedDashboard: dashboardAppState.savedDashboard, + isDirty: Boolean(dashboardAppState.hasUnsavedChanges), + }); + }, + [dashboardAppState, dashboardCapabilities, share, kibanaVersion] + ); const dashboardTopNavActions = useMemo(() => { const actions = { - [TopNavIds.FULL_SCREEN]: () => { - dashboardStateManager.setFullScreenMode(true); - }, + [TopNavIds.FULL_SCREEN]: () => dispatchDashboardStateChange(setFullScreenMode(true)), [TopNavIds.EXIT_EDIT_MODE]: () => onChangeViewMode(ViewMode.VIEW), [TopNavIds.ENTER_EDIT_MODE]: () => onChangeViewMode(ViewMode.EDIT), - [TopNavIds.SAVE]: runSave, [TopNavIds.QUICK_SAVE]: runQuickSave, + [TopNavIds.OPTIONS]: showOptions, + [TopNavIds.SAVE]: runSaveAs, [TopNavIds.CLONE]: runClone, - [TopNavIds.OPTIONS]: (anchorElement) => { - showOptionsPopover({ - anchorElement, - useMargins: dashboardStateManager.getUseMargins(), - onUseMarginsChange: (isChecked: boolean) => { - dashboardStateManager.setUseMargins(isChecked); - }, - syncColors: dashboardStateManager.getSyncColors(), - onSyncColorsChange: (isChecked: boolean) => { - dashboardStateManager.setSyncColors(isChecked); - }, - hidePanelTitles: dashboardStateManager.getHidePanelTitles(), - onHidePanelTitlesChange: (isChecked: boolean) => { - dashboardStateManager.setHidePanelTitles(isChecked); - }, - }); - }, } as { [key: string]: NavAction }; + if (share) { - actions[TopNavIds.SHARE] = (anchorElement) => - ShowShareModal({ - share, - anchorElement, - savedDashboard, - dashboardStateManager, - dashboardCapabilities, - }); + actions[TopNavIds.SHARE] = showShare; } if (isLabsEnabled) { @@ -503,13 +441,13 @@ export function DashboardTopNav({ } return actions; }, [ - dashboardCapabilities, - dashboardStateManager, + dispatchDashboardStateChange, onChangeViewMode, - savedDashboard, - runClone, - runSave, runQuickSave, + showOptions, + runSaveAs, + showShare, + runClone, share, isLabsEnabled, isLabsShown, @@ -517,43 +455,49 @@ export function DashboardTopNav({ UseUnmount(() => { clearAddPanel(); + setMounted(false); }); - const getNavBarProps = () => { + const getNavBarProps = (): TopNavMenuProps => { + const { hasUnsavedChanges, savedDashboard } = dashboardAppState; const shouldShowNavBarComponent = (forceShow: boolean): boolean => - (forceShow || state.chromeIsVisible) && !dashboardStateManager.getFullScreenMode(); + (forceShow || state.chromeIsVisible) && !dashboardState.fullScreenMode; const shouldShowFilterBar = (forceHide: boolean): boolean => !forceHide && - (data.query.filterManager.getFilters().length > 0 || - !dashboardStateManager.getFullScreenMode()); + (data.query.filterManager.getFilters().length > 0 || !dashboardState.fullScreenMode); - const isFullScreenMode = dashboardStateManager.getFullScreenMode(); - const screenTitle = dashboardStateManager.getTitle(); + const isFullScreenMode = dashboardState.fullScreenMode; const showTopNavMenu = shouldShowNavBarComponent(Boolean(embedSettings?.forceShowTopNavMenu)); const showQueryInput = shouldShowNavBarComponent(Boolean(embedSettings?.forceShowQueryInput)); const showDatePicker = shouldShowNavBarComponent(Boolean(embedSettings?.forceShowDatePicker)); - const showQueryBar = showQueryInput || showDatePicker; const showFilterBar = shouldShowFilterBar(Boolean(embedSettings?.forceHideFilterBar)); + const showQueryBar = showQueryInput || showDatePicker; const showSearchBar = showQueryBar || showFilterBar; + const screenTitle = dashboardState.title; + + const topNav = getTopNavConfig( + dashboardAppState.getLatestDashboardState().viewMode, + dashboardTopNavActions, + { + hideWriteControls: dashboardCapabilities.hideWriteControls, + isDirty: Boolean(dashboardAppState.hasUnsavedChanges), + isSaveInProgress: state.isSaveInProgress, + isNewDashboard: !savedDashboard.id, + isLabsEnabled, + } + ); - const topNav = getTopNavConfig(viewMode, dashboardTopNavActions, { - hideWriteControls: dashboardCapabilities.hideWriteControls, - isNewDashboard: !savedDashboard.id, - isDirty: dashboardStateManager.getIsDirty(timefilter), - isSaveInProgress, - isLabsEnabled, - }); - - const badges = unsavedChanges - ? [ - { - 'data-test-subj': 'dashboardUnsavedChangesBadge', - badgeText: unsavedChangesBadge.getUnsavedChangedBadgeText(), - color: 'secondary', - }, - ] - : undefined; + const badges = + hasUnsavedChanges && dashboardState.viewMode === ViewMode.EDIT + ? [ + { + 'data-test-subj': 'dashboardUnsavedChangesBadge', + badgeText: unsavedChangesBadge.getUnsavedChangedBadgeText(), + color: 'secondary', + }, + ] + : undefined; return { badges, @@ -561,36 +505,25 @@ export function DashboardTopNav({ config: showTopNavMenu ? topNav : undefined, className: isFullScreenMode ? 'kbnTopNavMenu-isFullScreen' : undefined, screenTitle, - showTopNavMenu, showSearchBar, showQueryBar, showQueryInput, showDatePicker, showFilterBar, setMenuMountPoint: embedSettings ? undefined : setHeaderActionMenu, - indexPatterns, + indexPatterns: dashboardAppState.indexPatterns, showSaveQuery: dashboardCapabilities.saveQuery, useDefaultBehaviors: true, - onQuerySubmit, - onSavedQueryUpdated: (savedQuery: SavedQuery) => { - const allFilters = data.query.filterManager.getFilters(); - data.query.filterManager.setFilters(allFilters); - dashboardStateManager.applyFilters(savedQuery.attributes.query, allFilters); - if (savedQuery.attributes.timefilter) { - timefilter.setTime({ - from: savedQuery.attributes.timefilter.from, - to: savedQuery.attributes.timefilter.to, - }); - if (savedQuery.attributes.timefilter.refreshInterval) { - timefilter.setRefreshInterval(savedQuery.attributes.timefilter.refreshInterval); - } + savedQuery: state.savedQuery, + savedQueryId: dashboardState.savedQuery, + onQuerySubmit: (_payload, isUpdate) => { + if (isUpdate === false) { + dashboardAppState.$triggerDashboardRefresh.next({ force: true }); } - setState((s) => ({ ...s, savedQuery })); }, - savedQuery: state.savedQuery, - savedQueryId: dashboardStateManager.getSavedQueryId(), - onSavedQueryIdChange: (newId: string | undefined) => - dashboardStateManager.setSavedQueryId(newId), + onSavedQueryIdChange: (newId: string | undefined) => { + dispatchDashboardStateChange(setSavedQueryId(newId)); + }, }; }; @@ -636,9 +569,9 @@ export function DashboardTopNav({ <> {isLabsEnabled && isLabsShown ? ( - setIsLabsShown(false)} /> + setIsLabsShown(false)} /> ) : null} - {viewMode !== ViewMode.VIEW ? ( + {dashboardState.viewMode !== ViewMode.VIEW ? ( <> @@ -646,9 +579,7 @@ export function DashboardTopNav({ primaryActionButton: ( , ], }} diff --git a/src/plugins/dashboard/public/application/top_nav/editor_menu.tsx b/src/plugins/dashboard/public/application/top_nav/editor_menu.tsx index 5205f5b294c4fc..90cf0fcd571a15 100644 --- a/src/plugins/dashboard/public/application/top_nav/editor_menu.tsx +++ b/src/plugins/dashboard/public/application/top_nav/editor_menu.tsx @@ -18,7 +18,7 @@ import { BaseVisType, VisGroups, VisTypeAlias } from '../../../../visualizations import { SolutionToolbarPopover } from '../../../../presentation_util/public'; import { EmbeddableFactoryDefinition, EmbeddableInput } from '../../services/embeddable'; import { useKibana } from '../../services/kibana_react'; -import { DashboardAppServices } from '../types'; +import { DashboardAppServices } from '../../types'; import { DashboardContainer } from '..'; import { DashboardConstants } from '../../dashboard_constants'; import { dashboardReplacePanelAction } from '../../dashboard_strings'; diff --git a/src/plugins/dashboard/public/application/top_nav/save_modal.tsx b/src/plugins/dashboard/public/application/top_nav/save_modal.tsx index 5b1fbe7374dac6..79ac3917fb9680 100644 --- a/src/plugins/dashboard/public/application/top_nav/save_modal.tsx +++ b/src/plugins/dashboard/public/application/top_nav/save_modal.tsx @@ -12,7 +12,7 @@ import { EuiFormRow, EuiTextArea, EuiSwitch } from '@elastic/eui'; import type { SavedObjectsTaggingApi } from '../../services/saved_objects_tagging_oss'; import { SavedObjectSaveModal } from '../../services/saved_objects'; -import { DashboardSaveOptions } from '../types'; +import { DashboardSaveOptions } from '../../types'; interface Props { onSave: ({ diff --git a/src/plugins/dashboard/public/application/top_nav/show_share_modal.tsx b/src/plugins/dashboard/public/application/top_nav/show_share_modal.tsx index a96b1ebd4f1ff0..239d2bf72b9c11 100644 --- a/src/plugins/dashboard/public/application/top_nav/show_share_modal.tsx +++ b/src/plugins/dashboard/public/application/top_nav/show_share_modal.tsx @@ -14,18 +14,20 @@ import { DashboardSavedObject } from '../..'; import { setStateToKbnUrl, unhashUrl } from '../../services/kibana_utils'; import { SharePluginStart } from '../../services/share'; import { dashboardUrlParams } from '../dashboard_router'; -import { DashboardStateManager } from '../dashboard_state_manager'; import { shareModalStrings } from '../../dashboard_strings'; -import { DashboardAppCapabilities } from '../types'; +import { DashboardAppCapabilities, DashboardState } from '../../types'; +import { stateToRawDashboardState } from '../lib/convert_dashboard_state'; const showFilterBarId = 'showFilterBar'; interface ShowShareModalProps { + isDirty: boolean; + kibanaVersion: string; share: SharePluginStart; anchorElement: HTMLElement; savedDashboard: DashboardSavedObject; + currentDashboardState: DashboardState; dashboardCapabilities: DashboardAppCapabilities; - dashboardStateManager: DashboardStateManager; } export const showPublicUrlSwitch = (anonymousUserCapabilities: Capabilities) => { @@ -38,10 +40,12 @@ export const showPublicUrlSwitch = (anonymousUserCapabilities: Capabilities) => export function ShowShareModal({ share, + isDirty, + kibanaVersion, anchorElement, savedDashboard, dashboardCapabilities, - dashboardStateManager, + currentDashboardState, }: ShowShareModalProps) { const EmbedUrlParamExtension = ({ setParamValue, @@ -101,12 +105,13 @@ export function ShowShareModal({ }; share.toggleShareContextMenu({ + isDirty, anchorElement, allowEmbed: true, allowShortUrl: dashboardCapabilities.createShortUrl, shareableUrl: setStateToKbnUrl( '_a', - dashboardStateManager.getAppState(), + stateToRawDashboardState({ state: currentDashboardState, version: kibanaVersion }), { useHash: false, storeInHashQuery: true }, unhashUrl(window.location.href) ), @@ -115,7 +120,6 @@ export function ShowShareModal({ sharingData: { title: savedDashboard.title, }, - isDirty: dashboardStateManager.getIsDirty(), embedUrlParamExtensions: [ { paramName: 'embed', diff --git a/src/plugins/dashboard/public/application/types.ts b/src/plugins/dashboard/public/application/types.ts deleted file mode 100644 index aae8a1f6eca540..00000000000000 --- a/src/plugins/dashboard/public/application/types.ts +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { - AppMountParameters, - CoreStart, - SavedObjectsClientContract, - ScopedHistory, - ChromeStart, - IUiSettingsClient, - PluginInitializerContext, -} from 'kibana/public'; - -import { SharePluginStart } from '../services/share'; -import { EmbeddableStart } from '../services/embeddable'; -import { UsageCollectionSetup } from '../services/usage_collection'; -import { NavigationPublicPluginStart } from '../services/navigation'; -import { SavedObjectsTaggingApi } from '../services/saved_objects_tagging_oss'; -import { DataPublicPluginStart, IndexPatternsContract } from '../services/data'; -import { SavedObjectLoader, SavedObjectsStart } from '../services/saved_objects'; -import { DashboardPanelStorage } from './lib'; -import { UrlForwardingStart } from '../../../url_forwarding/public'; -import { VisualizationsStart } from '../../../visualizations/public'; - -export type DashboardRedirect = (props: RedirectToProps) => void; -export type RedirectToProps = - | { destination: 'dashboard'; id?: string; useReplace?: boolean; editMode?: boolean } - | { destination: 'listing'; filter?: string; useReplace?: boolean }; - -export interface DashboardEmbedSettings { - forceShowTopNavMenu?: boolean; - forceShowQueryInput?: boolean; - forceShowDatePicker?: boolean; - forceHideFilterBar?: boolean; -} - -export interface DashboardSaveOptions { - newTitle: string; - newTags?: string[]; - newDescription: string; - newCopyOnSave: boolean; - newTimeRestore: boolean; - onTitleDuplicate: () => void; - isTitleDuplicateConfirmed: boolean; -} - -export interface DashboardAppCapabilities { - visualizeCapabilities: { save: boolean }; - mapsCapabilities: { save: boolean }; - hideWriteControls: boolean; - createShortUrl: boolean; - saveQuery: boolean; - createNew: boolean; - show: boolean; - storeSearchSession: boolean; -} - -export interface DashboardAppServices { - core: CoreStart; - chrome: ChromeStart; - share?: SharePluginStart; - embeddable: EmbeddableStart; - data: DataPublicPluginStart; - uiSettings: IUiSettingsClient; - restorePreviousUrl: () => void; - savedObjects: SavedObjectsStart; - allowByValueEmbeddables: boolean; - urlForwarding: UrlForwardingStart; - savedDashboards: SavedObjectLoader; - scopedHistory: () => ScopedHistory; - indexPatterns: IndexPatternsContract; - usageCollection?: UsageCollectionSetup; - navigation: NavigationPublicPluginStart; - dashboardPanelStorage: DashboardPanelStorage; - dashboardCapabilities: DashboardAppCapabilities; - initializerContext: PluginInitializerContext; - onAppLeave: AppMountParameters['onAppLeave']; - savedObjectsTagging?: SavedObjectsTaggingApi; - savedObjectsClient: SavedObjectsClientContract; - setHeaderActionMenu: AppMountParameters['setHeaderActionMenu']; - savedQueryService: DataPublicPluginStart['query']['savedQueries']; - visualizations: VisualizationsStart; -} diff --git a/src/plugins/dashboard/public/dashboard_constants.ts b/src/plugins/dashboard/public/dashboard_constants.ts index 16cb74209dd79e..7d5123ac27cb68 100644 --- a/src/plugins/dashboard/public/dashboard_constants.ts +++ b/src/plugins/dashboard/public/dashboard_constants.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -const DASHBOARD_STATE_STORAGE_KEY = '_a'; +export const DASHBOARD_STATE_STORAGE_KEY = '_a'; export const DashboardConstants = { LANDING_PAGE_PATH: '/list', @@ -17,6 +17,8 @@ export const DashboardConstants = { DASHBOARDS_ID: 'dashboards', DASHBOARD_ID: 'dashboard', SEARCH_SESSION_ID: 'searchSessionId', + CHANGE_CHECK_DEBOUNCE: 100, + CHANGE_APPLY_DEBOUNCE: 50, }; export function createDashboardEditUrl(id?: string, editMode?: boolean) { diff --git a/src/plugins/dashboard/public/dashboard_strings.ts b/src/plugins/dashboard/public/dashboard_strings.ts index 531ff815312cfe..ef158a149c3770 100644 --- a/src/plugins/dashboard/public/dashboard_strings.ts +++ b/src/plugins/dashboard/public/dashboard_strings.ts @@ -215,6 +215,22 @@ export const dashboardReadonlyBadge = { }), }; +export const dashboardSaveToastStrings = { + getSuccessString: (dashTitle: string) => + i18n.translate('dashboard.dashboardWasSavedSuccessMessage', { + defaultMessage: `Dashboard '{dashTitle}' was saved`, + values: { dashTitle }, + }), + getFailureString: (dashTitle: string, errorMessage: string) => + i18n.translate('dashboard.dashboardWasNotSavedDangerMessage', { + defaultMessage: `Dashboard '{dashTitle}' was not saved. Error: {errorMessage}`, + values: { + dashTitle, + errorMessage, + }, + }), +}; + /* Modals */ @@ -359,17 +375,9 @@ export const emptyScreenStrings = { i18n.translate('dashboard.fillDashboardTitle', { defaultMessage: 'This dashboard is empty. Let\u2019s fill it up!', }), - getHowToStartWorkingOnNewDashboardDescription1: () => - i18n.translate('dashboard.howToStartWorkingOnNewDashboardDescription1', { - defaultMessage: 'Click', - }), - getHowToStartWorkingOnNewDashboardDescription2: () => - i18n.translate('dashboard.howToStartWorkingOnNewDashboardDescription2', { - defaultMessage: 'in the menu bar above to start adding panels.', - }), - getHowToStartWorkingOnNewDashboardEditLinkText: () => - i18n.translate('dashboard.howToStartWorkingOnNewDashboardEditLinkText', { - defaultMessage: 'Edit', + getHowToStartWorkingOnNewDashboardDescription: () => + i18n.translate('dashboard.howToStartWorkingOnNewDashboardDescription', { + defaultMessage: 'Click edit in the menu bar above to start adding panels.', }), getHowToStartWorkingOnNewDashboardEditLinkAriaLabel: () => i18n.translate('dashboard.howToStartWorkingOnNewDashboardEditLinkAriaLabel', { @@ -442,3 +450,8 @@ export const dashboardUnsavedListingStrings = { defaultMessage: 'Discard changes', }), }; + +export const getCreateVisualizationButtonTitle = () => + i18n.translate('dashboard.solutionToolbar.addPanelButtonLabel', { + defaultMessage: 'Create visualization', + }); diff --git a/src/plugins/dashboard/public/index.ts b/src/plugins/dashboard/public/index.ts index 1acd1995b7290a..c584b44286e075 100644 --- a/src/plugins/dashboard/public/index.ts +++ b/src/plugins/dashboard/public/index.ts @@ -11,7 +11,6 @@ import { DashboardPlugin } from './plugin'; export { DashboardContainer, - DashboardContainerInput, DashboardContainerFactoryDefinition, DASHBOARD_CONTAINER_TYPE, } from './application'; @@ -29,7 +28,7 @@ export { DashboardUrlGeneratorState, } from './url_generator'; export { DashboardSavedObject } from './saved_dashboards'; -export { SavedDashboardPanel } from './types'; +export { SavedDashboardPanel, DashboardContainerInput } from './types'; export function plugin(initializerContext: PluginInitializerContext) { return new DashboardPlugin(initializerContext); diff --git a/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts b/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts index 1c9125f8a064e4..7c056e04c1cd63 100644 --- a/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts +++ b/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts @@ -14,6 +14,7 @@ import { createDashboardEditUrl } from '../dashboard_constants'; import { extractReferences, injectReferences } from '../../common/saved_dashboard_references'; import { SavedObjectAttributes, SavedObjectReference } from '../../../../core/types'; +import { DashboardOptions } from '../types'; export interface DashboardSavedObject extends SavedObject { id?: string; @@ -97,9 +98,10 @@ export function createSavedDashboardClass( panelsJSON: '[]', optionsJSON: JSON.stringify({ // for BWC reasons we can't default dashboards that already exist without this setting to true. - useMargins: !id, + useMargins: true, + syncColors: false, hidePanelTitles: false, - }), + } as DashboardOptions), version: 1, timeRestore: false, timeTo: undefined, diff --git a/src/plugins/dashboard/public/types.ts b/src/plugins/dashboard/public/types.ts index 9285944bfe5fe7..89c9adb5721426 100644 --- a/src/plugins/dashboard/public/types.ts +++ b/src/plugins/dashboard/public/types.ts @@ -6,109 +6,195 @@ * Side Public License, v 1. */ -import { SavedObject as SavedObjectType, SavedObjectAttributes } from 'src/core/public'; -import { Query, Filter } from './services/data'; -import { ViewMode } from './services/embeddable'; +import { + AppMountParameters, + CoreStart, + SavedObjectsClientContract, + ScopedHistory, + ChromeStart, + IUiSettingsClient, + PluginInitializerContext, +} from 'kibana/public'; -import { SavedDashboardPanel } from '../common/types'; -export { SavedDashboardPanel }; +import { History } from 'history'; +import { AnyAction, Dispatch } from 'redux'; +import { BehaviorSubject, Subject } from 'rxjs'; +import { Query, Filter, IndexPattern, RefreshInterval, TimeRange } from './services/data'; +import { ContainerInput, EmbeddableInput, ViewMode } from './services/embeddable'; +import { SharePluginStart } from './services/share'; +import { EmbeddableStart } from './services/embeddable'; +import { DashboardSessionStorage } from './application/lib'; +import { UrlForwardingStart } from '../../url_forwarding/public'; +import { UsageCollectionSetup } from './services/usage_collection'; +import { NavigationPublicPluginStart } from './services/navigation'; +import { DashboardPanelState, SavedDashboardPanel } from '../common/types'; +import { SavedObjectsTaggingApi } from './services/saved_objects_tagging_oss'; +import { DataPublicPluginStart, IndexPatternsContract } from './services/data'; +import { SavedObjectLoader, SavedObjectsStart } from './services/saved_objects'; +import { IKbnUrlStateStorage } from './services/kibana_utils'; +import { DashboardContainer, DashboardSavedObject } from '.'; +import { VisualizationsStart } from '../../visualizations/public'; -// TODO: Replace Saved object interfaces by the ones Core will provide when it is ready. -export type SavedObjectAttribute = - | string - | number - | boolean - | null - | undefined - | SavedObjectAttributes - | SavedObjectAttributes[]; - -export interface SimpleSavedObject { - attributes: T; - _version?: SavedObjectType['version']; - id: SavedObjectType['id']; - type: SavedObjectType['type']; - migrationVersion: SavedObjectType['migrationVersion']; - error: SavedObjectType['error']; - references: SavedObjectType['references']; - get(key: string): any; - set(key: string, value: any): T; - has(key: string): boolean; - save(): Promise>; - delete(): void; -} +export { SavedDashboardPanel }; -interface FieldSubType { - multi?: { parent: string }; - nested?: { path: string }; +export type NavAction = (anchorElement?: any) => void; +export interface SavedDashboardPanelMap { + [key: string]: SavedDashboardPanel; } -export interface Field { - name: string; - type: string; - // esTypes might be undefined on old index patterns that have not been refreshed since we added - // this prop. It is also undefined on scripted fields. - esTypes?: string[]; - aggregatable: boolean; - filterable: boolean; - searchable: boolean; - subType?: FieldSubType; +export interface DashboardPanelMap { + [key: string]: DashboardPanelState; } -export type NavAction = (anchorElement?: any) => void; - -export interface DashboardAppState { - panels: SavedDashboardPanel[]; - fullScreenMode: boolean; +/** + * DashboardState contains all pieces of tracked state for an individual dashboard + */ +export interface DashboardState { + query: Query; title: string; - description: string; tags: string[]; - timeRestore: boolean; - options: { - hidePanelTitles: boolean; - useMargins: boolean; - syncColors?: boolean; - }; - query: Query | string; filters: Filter[]; viewMode: ViewMode; - expandedPanelId?: string; + description: string; savedQuery?: string; + timeRestore: boolean; + fullScreenMode: boolean; + expandedPanelId?: string; + options: DashboardOptions; + panels: DashboardPanelMap; } -export type DashboardAppStateDefaults = DashboardAppState & { +/** + * RawDashboardState is the dashboard state as directly loaded from the panelJSON + */ +export type RawDashboardState = Omit & { panels: SavedDashboardPanel[] }; + +export interface DashboardContainerInput extends ContainerInput { + dashboardCapabilities?: DashboardAppCapabilities; + refreshConfig?: RefreshInterval; + isEmbeddedExternally?: boolean; + isFullScreenMode: boolean; + expandedPanelId?: string; + timeRange: TimeRange; description?: string; -}; + useMargins: boolean; + syncColors?: boolean; + viewMode: ViewMode; + filters: Filter[]; + title: string; + query: Query; + panels: { + [panelId: string]: DashboardPanelState; + }; +} /** - * Panels are not added to the URL + * DashboardAppState contains all the tools the dashboard application uses to track, + * update, and view its state. */ -export type DashboardAppStateInUrl = Omit & { - panels?: SavedDashboardPanel[]; +export interface DashboardAppState { + hasUnsavedChanges?: boolean; + indexPatterns?: IndexPattern[]; + updateLastSavedState?: () => void; + resetToLastSavedState?: () => void; + savedDashboard?: DashboardSavedObject; + dashboardContainer?: DashboardContainer; + getLatestDashboardState?: () => DashboardState; + $triggerDashboardRefresh: Subject<{ force?: boolean }>; + $onDashboardStateChange: BehaviorSubject; + applyFilters?: (query: Query, filters: Filter[]) => void; +} + +/** + * The shared services and tools used to build a dashboard from a saved object ID. + */ +export type DashboardBuildContext = Pick< + DashboardAppServices, + | 'embeddable' + | 'indexPatterns' + | 'savedDashboards' + | 'usageCollection' + | 'initializerContext' + | 'savedObjectsTagging' + | 'dashboardCapabilities' +> & { + query: DashboardAppServices['data']['query']; + search: DashboardAppServices['data']['search']; + notifications: DashboardAppServices['core']['notifications']; + + history: History; + kibanaVersion: string; + isEmbeddedExternally: boolean; + kbnUrlStateStorage: IKbnUrlStateStorage; + $checkForUnsavedChanges: Subject; + getLatestDashboardState: () => DashboardState; + dispatchDashboardStateChange: Dispatch; + $triggerDashboardRefresh: Subject<{ force?: boolean }>; + $onDashboardStateChange: BehaviorSubject; }; -export interface DashboardAppStateTransitions { - set: ( - state: DashboardAppState - ) => ( - prop: T, - value: DashboardAppState[T] - ) => DashboardAppState; - setOption: ( - state: DashboardAppState - ) => ( - prop: T, - value: DashboardAppState['options'][T] - ) => DashboardAppState; +export interface DashboardOptions { + hidePanelTitles: boolean; + useMargins: boolean; + syncColors: boolean; } -export interface SavedDashboardPanelMap { - [key: string]: SavedDashboardPanel; +export type DashboardRedirect = (props: RedirectToProps) => void; +export type RedirectToProps = + | { destination: 'dashboard'; id?: string; useReplace?: boolean; editMode?: boolean } + | { destination: 'listing'; filter?: string; useReplace?: boolean }; + +export interface DashboardEmbedSettings { + forceHideFilterBar?: boolean; + forceShowTopNavMenu?: boolean; + forceShowQueryInput?: boolean; + forceShowDatePicker?: boolean; +} + +export interface DashboardSaveOptions { + newTitle: string; + newTags?: string[]; + newDescription: string; + newCopyOnSave: boolean; + newTimeRestore: boolean; + onTitleDuplicate: () => void; + isTitleDuplicateConfirmed: boolean; +} + +export interface DashboardAppCapabilities { + show: boolean; + createNew: boolean; + saveQuery: boolean; + createShortUrl: boolean; + hideWriteControls: boolean; + storeSearchSession: boolean; + mapsCapabilities: { save: boolean }; + visualizeCapabilities: { save: boolean }; } -export interface StagedFilter { - field: string; - value: string; - operator: string; - index: string; +export interface DashboardAppServices { + core: CoreStart; + chrome: ChromeStart; + share?: SharePluginStart; + embeddable: EmbeddableStart; + data: DataPublicPluginStart; + uiSettings: IUiSettingsClient; + restorePreviousUrl: () => void; + savedObjects: SavedObjectsStart; + allowByValueEmbeddables: boolean; + urlForwarding: UrlForwardingStart; + savedDashboards: SavedObjectLoader; + scopedHistory: () => ScopedHistory; + visualizations: VisualizationsStart; + indexPatterns: IndexPatternsContract; + usageCollection?: UsageCollectionSetup; + navigation: NavigationPublicPluginStart; + dashboardCapabilities: DashboardAppCapabilities; + initializerContext: PluginInitializerContext; + onAppLeave: AppMountParameters['onAppLeave']; + savedObjectsTagging?: SavedObjectsTaggingApi; + savedObjectsClient: SavedObjectsClientContract; + dashboardSessionStorage: DashboardSessionStorage; + setHeaderActionMenu: AppMountParameters['setHeaderActionMenu']; + savedQueryService: DataPublicPluginStart['query']['savedQueries']; } diff --git a/src/plugins/dashboard/server/usage/dashboard_telemetry.test.ts b/src/plugins/dashboard/server/usage/dashboard_telemetry.test.ts index 1cfa9d862e6b95..60f1f7eb0955c0 100644 --- a/src/plugins/dashboard/server/usage/dashboard_telemetry.test.ts +++ b/src/plugins/dashboard/server/usage/dashboard_telemetry.test.ts @@ -72,6 +72,22 @@ const lensXYSeriesB = ({ visualization: { preferredSeriesType: 'seriesB', }, + datasourceStates: { + indexpattern: { + layers: { + first: { + columns: { + first: { + operationType: 'terms', + }, + second: { + operationType: 'formula', + }, + }, + }, + }, + }, + }, }, }, }, @@ -144,6 +160,7 @@ describe('dashboard telemetry', () => { expect(collectorData.lensByValue.a).toBe(3); expect(collectorData.lensByValue.seriesA).toBe(2); expect(collectorData.lensByValue.seriesB).toBe(1); + expect(collectorData.lensByValue.formula).toBe(1); }); it('handles misshapen lens panels', () => { diff --git a/src/plugins/dashboard/server/usage/dashboard_telemetry.ts b/src/plugins/dashboard/server/usage/dashboard_telemetry.ts index 912dc04d16d092..fb1ddff469f578 100644 --- a/src/plugins/dashboard/server/usage/dashboard_telemetry.ts +++ b/src/plugins/dashboard/server/usage/dashboard_telemetry.ts @@ -27,6 +27,16 @@ interface LensPanel extends SavedDashboardPanel730ToLatest { visualization?: { preferredSeriesType?: string; }; + datasourceStates?: { + indexpattern?: { + layers: Record< + string, + { + columns: Record; + } + >; + }; + }; }; }; }; @@ -109,6 +119,19 @@ export const collectByValueLensInfo: DashboardCollectorFunction = (panels, colle } collectorData.lensByValue[type] = collectorData.lensByValue[type] + 1; + + const hasFormula = Object.values( + lensPanel.embeddableConfig.attributes.state?.datasourceStates?.indexpattern?.layers || {} + ).some((layer) => + Object.values(layer.columns).some((column) => column.operationType === 'formula') + ); + + if (hasFormula && !collectorData.lensByValue.formula) { + collectorData.lensByValue.formula = 0; + } + if (hasFormula) { + collectorData.lensByValue.formula++; + } } } }; diff --git a/src/plugins/data/common/es_query/filters/phrase_filter.ts b/src/plugins/data/common/es_query/filters/phrase_filter.ts index 2a7f2458a27de8..85562435e68d02 100644 --- a/src/plugins/data/common/es_query/filters/phrase_filter.ts +++ b/src/plugins/data/common/es_query/filters/phrase_filter.ts @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import type { estypes } from '@elastic/elasticsearch'; import { get, isPlainObject } from 'lodash'; import { Filter, FilterMeta } from './meta_filter'; import { IIndexPattern, IFieldType } from '../../index_patterns'; @@ -23,7 +23,7 @@ export type PhraseFilter = Filter & { script?: { script: { source?: any; - lang?: string; + lang?: estypes.ScriptLanguage; params: any; }; }; diff --git a/src/plugins/data/common/es_query/filters/range_filter.ts b/src/plugins/data/common/es_query/filters/range_filter.ts index fb8426655583ee..a082b93c0a79a1 100644 --- a/src/plugins/data/common/es_query/filters/range_filter.ts +++ b/src/plugins/data/common/es_query/filters/range_filter.ts @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import type { estypes } from '@elastic/elasticsearch'; import { map, reduce, mapValues, get, keys, pickBy } from 'lodash'; import { Filter, FilterMeta } from './meta_filter'; import { IIndexPattern, IFieldType } from '../../index_patterns'; @@ -63,7 +63,7 @@ export type RangeFilter = Filter & script?: { script: { params: any; - lang: string; + lang: estypes.ScriptLanguage; source: any; }; }; diff --git a/src/plugins/data/common/field_formats/converters/duration.test.ts b/src/plugins/data/common/field_formats/converters/duration.test.ts index 72551f4b7b236f..9ea9919e757de8 100644 --- a/src/plugins/data/common/field_formats/converters/duration.test.ts +++ b/src/plugins/data/common/field_formats/converters/duration.test.ts @@ -130,11 +130,11 @@ describe('Duration Format', () => { fixtures: [ { input: -60, - output: '-60 Seconds', + output: '-60 seconds', }, { input: -32.333, - output: '-32 Seconds', + output: '-32 seconds', }, ], }); @@ -147,15 +147,15 @@ describe('Duration Format', () => { fixtures: [ { input: 1988, - output: '0.00 Milliseconds', + output: '0.00 milliseconds', }, { input: 658, - output: '0.00 Milliseconds', + output: '0.00 milliseconds', }, { input: 3857, - output: '0.00 Milliseconds', + output: '0.00 milliseconds', }, ], }); @@ -168,15 +168,15 @@ describe('Duration Format', () => { fixtures: [ { input: 1988, - output: '1.99 Milliseconds', + output: '1.99 milliseconds', }, { input: 658, - output: '0.66 Milliseconds', + output: '0.66 milliseconds', }, { input: 3857, - output: '3.86 Milliseconds', + output: '3.86 milliseconds', }, ], }); @@ -189,19 +189,19 @@ describe('Duration Format', () => { fixtures: [ { input: 1988, - output: '2.0 Milliseconds', + output: '2.0 milliseconds', }, { input: 0, - output: '0.0 Milliseconds', + output: '0.0 milliseconds', }, { input: 658, - output: '0.7 Milliseconds', + output: '0.7 milliseconds', }, { input: 3857, - output: '3.9 Milliseconds', + output: '3.9 milliseconds', }, ], }); @@ -214,15 +214,15 @@ describe('Duration Format', () => { fixtures: [ { input: 600, - output: '10 Minutes', + output: '10 minutes', }, { input: 30, - output: '30 Seconds', + output: '30 seconds', }, { input: 3000, - output: '50 Minutes', + output: '50 minutes', }, ], }); diff --git a/src/plugins/data/common/field_formats/converters/duration.ts b/src/plugins/data/common/field_formats/converters/duration.ts index c9a7091db84716..71ac022ba5e5cb 100644 --- a/src/plugins/data/common/field_formats/converters/duration.ts +++ b/src/plugins/data/common/field_formats/converters/duration.ts @@ -263,7 +263,7 @@ export class DurationFormat extends FieldFormat { const precise = human || humanPrecise ? formatted : formatted.toFixed(outputPrecision); const type = outputFormats.find(({ method }) => method === outputFormat); - const unitText = useShortSuffix ? type?.shortText : type?.text; + const unitText = useShortSuffix ? type?.shortText : type?.text.toLowerCase(); const suffix = showSuffix && unitText && !human ? `${includeSpace}${unitText}` : ''; @@ -294,7 +294,7 @@ function formatDuration( const getUnitText = (method: string) => { const type = outputFormats.find(({ method: methodT }) => method === methodT); - return useShortSuffix ? type?.shortText : type?.text; + return useShortSuffix ? type?.shortText : type?.text.toLowerCase(); }; for (let i = 0; i < units.length; i++) { diff --git a/src/plugins/data/common/index_patterns/fields/__snapshots__/index_pattern_field.test.ts.snap b/src/plugins/data/common/index_patterns/fields/__snapshots__/index_pattern_field.test.ts.snap index 6b1d01e5ba1429..681aba41a609c0 100644 --- a/src/plugins/data/common/index_patterns/fields/__snapshots__/index_pattern_field.test.ts.snap +++ b/src/plugins/data/common/index_patterns/fields/__snapshots__/index_pattern_field.test.ts.snap @@ -16,7 +16,7 @@ Object { "esTypes": Array [ "keyword", ], - "lang": "lang", + "lang": "java", "name": "name", "readFromDocValues": false, "script": "script", @@ -58,7 +58,7 @@ Object { }, }, "isMapped": undefined, - "lang": "lang", + "lang": "java", "name": "name", "readFromDocValues": false, "runtimeField": Object { diff --git a/src/plugins/data/common/index_patterns/fields/index_pattern_field.test.ts b/src/plugins/data/common/index_patterns/fields/index_pattern_field.test.ts index 48342a9e02a2bd..73f015ca5517c3 100644 --- a/src/plugins/data/common/index_patterns/fields/index_pattern_field.test.ts +++ b/src/plugins/data/common/index_patterns/fields/index_pattern_field.test.ts @@ -24,7 +24,7 @@ describe('Field', function () { name: 'name', type: 'string', script: 'script', - lang: 'lang', + lang: 'java' as const, count: 1, esTypes: ['text'], // note, this will get replaced by the runtime field type aggregatable: true, diff --git a/src/plugins/data/common/index_patterns/fields/types.ts b/src/plugins/data/common/index_patterns/fields/types.ts index 565dd6d9269488..0fb7a46c2cf73d 100644 --- a/src/plugins/data/common/index_patterns/fields/types.ts +++ b/src/plugins/data/common/index_patterns/fields/types.ts @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import type { estypes } from '@elastic/elasticsearch'; import { FieldSpec, IFieldSubType, IndexPattern } from '../..'; /** @@ -16,7 +16,7 @@ export interface IFieldType { name: string; type: string; script?: string; - lang?: string; + lang?: estypes.ScriptLanguage; count?: number; // esTypes might be undefined on old index patterns that have not been refreshed since we added // this prop. It is also undefined on scripted fields. diff --git a/src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts b/src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts index c897cdbce2309a..0c3a9901f8c8ca 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts +++ b/src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts @@ -364,7 +364,6 @@ export class IndexPattern implements IIndexPattern { * @param name Field name * @param runtimeField Runtime field definition */ - addRuntimeField(name: string, runtimeField: RuntimeField) { const existingField = this.getFieldByName(name); if (existingField) { @@ -384,11 +383,41 @@ export class IndexPattern implements IIndexPattern { } /** - * Remove a runtime field - removed from mapped field or removed unmapped - * field as appropriate - * @param name Field name + * Checks if runtime field exists + * @param name + */ + hasRuntimeField(name: string): boolean { + return !!this.runtimeFieldMap[name]; + } + + /** + * Returns runtime field if exists + * @param name + */ + getRuntimeField(name: string): RuntimeField | null { + return this.runtimeFieldMap[name] ?? null; + } + + /** + * Replaces all existing runtime fields with new fields + * @param newFields */ + replaceAllRuntimeFields(newFields: Record) { + const oldRuntimeFieldNames = Object.keys(this.runtimeFieldMap); + oldRuntimeFieldNames.forEach((name) => { + this.removeRuntimeField(name); + }); + Object.entries(newFields).forEach(([name, field]) => { + this.addRuntimeField(name, field); + }); + } + + /** + * Remove a runtime field - removed from mapped field or removed unmapped + * field as appropriate. Doesn't clear associated field attributes. + * @param name - Field name to remove + */ removeRuntimeField(name: string) { const existingField = this.getFieldByName(name); if (existingField) { @@ -396,9 +425,6 @@ export class IndexPattern implements IIndexPattern { // mapped field, remove runtimeField def existingField.runtimeField = undefined; } else { - // runtimeField only - this.setFieldCustomLabel(name, null); - this.deleteFieldFormat(name); this.fields.remove(existingField); } } diff --git a/src/plugins/data/common/index_patterns/types.ts b/src/plugins/data/common/index_patterns/types.ts index 0fcdea1a878ebc..07aa8967b905e4 100644 --- a/src/plugins/data/common/index_patterns/types.ts +++ b/src/plugins/data/common/index_patterns/types.ts @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import type { estypes } from '@elastic/elasticsearch'; import { ToastInputFields, ErrorToastOptions } from 'src/core/public/notifications'; // eslint-disable-next-line import type { SavedObject } from 'src/core/server'; @@ -167,7 +167,7 @@ export type FieldSpecConflictDescriptions = Record; export interface FieldSpecExportFmt { count?: number; script?: string; - lang?: string; + lang?: estypes.ScriptLanguage; conflictDescriptions?: FieldSpecConflictDescriptions; name: string; type: KBN_FIELD_TYPES; @@ -197,7 +197,7 @@ export interface FieldSpec { * Scripted field langauge * Painless is the only valid scripted field language */ - lang?: string; + lang?: estypes.ScriptLanguage; conflictDescriptions?: Record; format?: SerializedFieldFormat; name: string; diff --git a/src/plugins/data/common/search/aggs/agg_configs.ts b/src/plugins/data/common/search/aggs/agg_configs.ts index 6f8a8d38a4a286..8593a0b0ed0fa3 100644 --- a/src/plugins/data/common/search/aggs/agg_configs.ts +++ b/src/plugins/data/common/search/aggs/agg_configs.ts @@ -10,7 +10,7 @@ import moment from 'moment'; import _, { cloneDeep } from 'lodash'; import { i18n } from '@kbn/i18n'; import { Assign } from '@kbn/utility-types'; -import { Aggregate, Bucket } from '@elastic/elasticsearch/api/types'; +import type { estypes } from '@elastic/elasticsearch'; import { IEsSearchResponse, @@ -57,7 +57,9 @@ export interface AggConfigsOptions { export type CreateAggConfigParams = Assign; -export type GenericBucket = Bucket & { [property: string]: Aggregate }; +export type GenericBucket = estypes.AggregationsBucket & { + [property: string]: estypes.AggregationsAggregate; +}; /** * @name AggConfigs @@ -412,7 +414,7 @@ export class AggConfigs { const transformedRawResponse = cloneDeep(response.rawResponse); if (!transformedRawResponse.aggregations) { transformedRawResponse.aggregations = { - doc_count: response.rawResponse.hits?.total as Aggregate, + doc_count: response.rawResponse.hits?.total as estypes.AggregationsAggregate, }; } const aggCursor = transformedRawResponse.aggregations!; diff --git a/src/plugins/data/common/search/aggs/utils/time_splits.ts b/src/plugins/data/common/search/aggs/utils/time_splits.ts index 4ac47efaea3476..75c1c091e07561 100644 --- a/src/plugins/data/common/search/aggs/utils/time_splits.ts +++ b/src/plugins/data/common/search/aggs/utils/time_splits.ts @@ -8,12 +8,7 @@ import moment from 'moment'; import _, { isArray } from 'lodash'; -import { - Aggregate, - FiltersAggregate, - FiltersBucketItem, - MultiBucketAggregate, -} from '@elastic/elasticsearch/api/types'; +import type { estypes } from '@elastic/elasticsearch'; import { AggGroupNames } from '../agg_groups'; import { GenericBucket, AggConfigs, getTime, AggConfig } from '../../../../common'; @@ -156,12 +151,15 @@ import { IBucketAggConfig } from '../buckets'; } // ... * ``` - * - * + * + * * @param aggConfigs The agg configs instance * @param aggCursor The root aggregations object from the response which will be mutated in place */ -export function mergeTimeShifts(aggConfigs: AggConfigs, aggCursor: Record) { +export function mergeTimeShifts( + aggConfigs: AggConfigs, + aggCursor: Record +) { const timeShifts = aggConfigs.getTimeShifts(); const hasMultipleTimeShifts = Object.keys(timeShifts).length > 1; const requestAggs = aggConfigs.getRequestAggs(); @@ -200,7 +198,7 @@ export function mergeTimeShifts(aggConfigs: AggConfigs, aggCursor: Record @@ -212,7 +210,7 @@ export function mergeTimeShifts(aggConfigs: AggConfigs, aggCursor: Record bucketAgg.type.orderBuckets(bucketAgg, a, b)); } else if (baseBuckets && buckets && !isArray(baseBuckets)) { @@ -249,7 +247,10 @@ export function mergeTimeShifts(aggConfigs: AggConfigs, aggCursor: Record, aggIndex: number): undefined => { + const transformTimeShift = ( + cursor: Record, + aggIndex: number + ): undefined => { const shouldSplit = aggConfigs.aggs[aggIndex].type.splitForTimeShift( aggConfigs.aggs[aggIndex], aggConfigs @@ -257,10 +258,8 @@ export function mergeTimeShifts(aggConfigs: AggConfigs, aggCursor: Record; + const timeShiftedBuckets = (cursor.time_offset_split as estypes.AggregationsFiltersAggregate) + .buckets as Record; const subTree = {}; Object.entries(timeShifts).forEach(([key, shift]) => { mergeAggLevel( @@ -301,7 +300,7 @@ export function mergeTimeShifts(aggConfigs: AggConfigs, aggCursor: Record = { export const createSearchSourceMock = (fields?: SearchSourceFields) => new SearchSource(fields, { getConfig: uiSettingsServiceMock.createStartContract().get, - search: jest.fn(), + search: jest + .fn() + .mockReturnValue( + of({ rawResponse: { hits: { hits: [], total: 0 } }, isPartial: false, isRunning: false }) + ), onResponse: jest.fn().mockImplementation((req, res) => res), }); diff --git a/src/plugins/data/common/search/search_source/search_source.ts b/src/plugins/data/common/search/search_source/search_source.ts index 7633382bb87631..19e80c7a487dcb 100644 --- a/src/plugins/data/common/search/search_source/search_source.ts +++ b/src/plugins/data/common/search/search_source/search_source.ts @@ -699,7 +699,7 @@ export class SearchSource { searchRequest.body = searchRequest.body || {}; const { body, index, query, filters, highlightAll } = searchRequest; searchRequest.indexType = this.getIndexType(index); - const metaFields = getConfig(UI_SETTINGS.META_FIELDS); + const metaFields = getConfig(UI_SETTINGS.META_FIELDS) ?? []; // get some special field types from the index pattern const { docvalueFields, scriptFields, storedFields, runtimeFields } = index diff --git a/src/plugins/data/common/search/search_source/types.ts b/src/plugins/data/common/search/search_source/types.ts index 507fda0dc9e474..40e92f45af1436 100644 --- a/src/plugins/data/common/search/search_source/types.ts +++ b/src/plugins/data/common/search/search_source/types.ts @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import type { estypes } from '@elastic/elasticsearch'; import { NameList } from 'elasticsearch'; import { IAggConfigs } from 'src/plugins/data/public'; import { Query } from '../..'; @@ -156,7 +156,7 @@ export interface ShardFailure { type: string; }; reason: string; - lang?: string; + lang?: estypes.ScriptLanguage; script?: string; script_stack?: string[]; type: string; diff --git a/src/plugins/data/kibana.json b/src/plugins/data/kibana.json index 4e9e4c318c9575..e425d0701155bd 100644 --- a/src/plugins/data/kibana.json +++ b/src/plugins/data/kibana.json @@ -3,19 +3,14 @@ "version": "kibana", "server": true, "ui": true, - "requiredPlugins": [ - "bfetch", - "expressions", - "uiActions", - "share", - "inspector" - ], + "requiredPlugins": ["bfetch", "expressions", "uiActions", "share", "inspector"], "serviceFolders": ["search", "index_patterns", "query", "autocomplete", "ui", "field_formats"], "optionalPlugins": ["usageCollection"], "extraPublicDirs": ["common"], - "requiredBundles": [ - "kibanaUtils", - "kibanaReact", - "inspector" - ] + "requiredBundles": ["kibanaUtils", "kibanaReact", "inspector"], + "owner": { + "name": "App Services", + "githubTeam": "kibana-app-services" + }, + "description": "Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters." } diff --git a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.test.ts b/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.test.ts index f1eced06a33ea1..84ed4315ee16f7 100644 --- a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.test.ts +++ b/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.test.ts @@ -41,6 +41,7 @@ describe('Kuery field suggestions', () => { querySuggestionsArgs, mockKueryNode({ prefix, suffix }) ); + // @ts-expect-error indexPatternResponse is not properly typed json const filterableFields = indexPatternResponse.fields.filter(indexPatternsUtils.isFilterable); expect(suggestions.length).toBe(filterableFields.length); diff --git a/src/plugins/data/public/public.api.md b/src/plugins/data/public/public.api.md index 9f5c2ef5fad3df..67534577d99fcf 100644 --- a/src/plugins/data/public/public.api.md +++ b/src/plugins/data/public/public.api.md @@ -7,13 +7,11 @@ import { $Values } from '@kbn/utility-types'; import { Action } from 'history'; import { Adapters as Adapters_2 } from 'src/plugins/inspector/common'; -import { Aggregate } from '@elastic/elasticsearch/api/types'; import { ApiResponse } from '@elastic/elasticsearch/lib/Transport'; import { ApplicationStart } from 'kibana/public'; import { Assign } from '@kbn/utility-types'; import { BfetchPublicSetup } from 'src/plugins/bfetch/public'; import Boom from '@hapi/boom'; -import { Bucket } from '@elastic/elasticsearch/api/types'; import { ConfigDeprecationProvider } from '@kbn/config'; import { CoreSetup } from 'src/core/public'; import { CoreSetup as CoreSetup_2 } from 'kibana/public'; @@ -1245,7 +1243,7 @@ export interface IFieldType { // (undocumented) format?: any; // (undocumented) - lang?: string; + lang?: estypes.ScriptLanguage; // (undocumented) name: string; // (undocumented) @@ -1415,6 +1413,7 @@ export class IndexPattern implements IIndexPattern { typeMeta?: string | undefined; type?: string | undefined; }; + getRuntimeField(name: string): RuntimeField | null; // @deprecated (undocumented) getScriptedFields(): IndexPatternField[]; getSourceFiltering(): { @@ -1422,6 +1421,7 @@ export class IndexPattern implements IIndexPattern { }; // (undocumented) getTimeField(): IndexPatternField | undefined; + hasRuntimeField(name: string): boolean; // (undocumented) id?: string; // @deprecated (undocumented) @@ -1435,6 +1435,7 @@ export class IndexPattern implements IIndexPattern { removeRuntimeField(name: string): void; // @deprecated removeScriptedField(fieldName: string): void; + replaceAllRuntimeFields(newFields: Record): void; resetOriginalSavedObjectBody: () => void; // (undocumented) protected setFieldAttrs(fieldName: string, attrName: K, value: FieldAttrSet[K]): void; @@ -1520,8 +1521,8 @@ export class IndexPatternField implements IFieldType { // (undocumented) get filterable(): boolean; get isMapped(): boolean | undefined; - get lang(): string | undefined; - set lang(lang: string | undefined); + get lang(): "painless" | "expression" | "mustache" | "java" | undefined; + set lang(lang: "painless" | "expression" | "mustache" | "java" | undefined); // (undocumented) get name(): string; // (undocumented) @@ -1545,7 +1546,7 @@ export class IndexPatternField implements IFieldType { toJSON(): { count: number; script: string | undefined; - lang: string | undefined; + lang: "painless" | "expression" | "mustache" | "java" | undefined; conflictDescriptions: Record | undefined; name: string; type: string; @@ -1990,7 +1991,7 @@ export type PhraseFilter = Filter & { script?: { script: { source?: any; - lang?: string; + lang?: estypes.ScriptLanguage; params: any; }; }; @@ -2208,7 +2209,7 @@ export type RangeFilter = Filter & EsRangeFilter & { script?: { script: { params: any; - lang: string; + lang: estypes.ScriptLanguage; source: any; }; }; @@ -2254,7 +2255,7 @@ export interface Reason { reason: string; }; // (undocumented) - lang?: string; + lang?: estypes.ScriptLanguage; // (undocumented) position?: { offset: number; diff --git a/src/plugins/data/public/query/query_string/query_string_manager.mock.ts b/src/plugins/data/public/query/query_string/query_string_manager.mock.ts index 0038ba0e87e06d..976d3ce13e7de7 100644 --- a/src/plugins/data/public/query/query_string/query_string_manager.mock.ts +++ b/src/plugins/data/public/query/query_string/query_string_manager.mock.ts @@ -7,12 +7,13 @@ */ import { QueryStringContract } from '.'; +import { Observable } from 'rxjs'; const createSetupContractMock = () => { const queryStringManagerMock: jest.Mocked = { getQuery: jest.fn(), setQuery: jest.fn(), - getUpdates$: jest.fn(), + getUpdates$: jest.fn(() => new Observable()), getDefaultQuery: jest.fn(), formatQuery: jest.fn(), clearQuery: jest.fn(), diff --git a/src/plugins/data/public/query/timefilter/timefilter_service.mock.ts b/src/plugins/data/public/query/timefilter/timefilter_service.mock.ts index c22f62f45a709f..f1f02a010e98c6 100644 --- a/src/plugins/data/public/query/timefilter/timefilter_service.mock.ts +++ b/src/plugins/data/public/query/timefilter/timefilter_service.mock.ts @@ -21,7 +21,7 @@ const createSetupContractMock = () => { getTimeUpdate$: jest.fn(), getRefreshIntervalUpdate$: jest.fn(), getAutoRefreshFetch$: jest.fn(() => new Observable<() => void>()), - getFetch$: jest.fn(), + getFetch$: jest.fn(() => new Observable<() => void>()), getTime: jest.fn(), setTime: jest.fn(), setRefreshInterval: jest.fn(), diff --git a/src/plugins/data/public/search/errors/painless_error.test.tsx b/src/plugins/data/public/search/errors/painless_error.test.tsx index f07f078ea03a3f..833573786594b2 100644 --- a/src/plugins/data/public/search/errors/painless_error.test.tsx +++ b/src/plugins/data/public/search/errors/painless_error.test.tsx @@ -23,6 +23,7 @@ describe('PainlessError', () => { const e = new PainlessError({ statusCode: 400, message: 'search_phase_execution_exception', + // @ts-expect-error searchPhaseException is not properly typed json attributes: searchPhaseException.error, }); const component = mount(e.getErrorMessage(startMock.application)); diff --git a/src/plugins/data/public/search/errors/types.ts b/src/plugins/data/public/search/errors/types.ts index 445293fe47ea35..13c5d0c242ed00 100644 --- a/src/plugins/data/public/search/errors/types.ts +++ b/src/plugins/data/public/search/errors/types.ts @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import type { estypes } from '@elastic/elasticsearch'; import { KibanaServerError } from '../../../../kibana_utils/common'; export interface FailedShard { @@ -24,7 +24,7 @@ export interface Reason { start: number; end: number; }; - lang?: string; + lang?: estypes.ScriptLanguage; script?: string; caused_by?: { type: string; diff --git a/src/plugins/data/public/search/search_interceptor/search_interceptor.test.ts b/src/plugins/data/public/search/search_interceptor/search_interceptor.test.ts index dfbc912453d6e0..fe66d4b6e99370 100644 --- a/src/plugins/data/public/search/search_interceptor/search_interceptor.test.ts +++ b/src/plugins/data/public/search/search_interceptor/search_interceptor.test.ts @@ -135,6 +135,7 @@ describe('SearchInterceptor', () => { new PainlessError({ statusCode: 400, message: 'search_phase_execution_exception', + // @ts-expect-error searchPhaseException is not properly typed json attributes: searchPhaseException.error, }) ); diff --git a/src/plugins/data/public/ui/shard_failure_modal/shard_failure_types.ts b/src/plugins/data/public/ui/shard_failure_modal/shard_failure_types.ts index c34a47dc1c6dd6..83e4abf55d5256 100644 --- a/src/plugins/data/public/ui/shard_failure_modal/shard_failure_types.ts +++ b/src/plugins/data/public/ui/shard_failure_modal/shard_failure_types.ts @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import type { estypes } from '@elastic/elasticsearch'; export interface ShardFailureRequest { docvalue_fields: string[]; _source: unknown; @@ -24,7 +24,7 @@ export interface ShardFailure { type: string; }; reason: string; - lang?: string; + lang?: estypes.ScriptLanguage; script?: string; script_stack?: string[]; type: string; diff --git a/src/plugins/data/server/autocomplete/value_suggestions_route.ts b/src/plugins/data/server/autocomplete/value_suggestions_route.ts index b2568a5a43611b..8fa14f8cbbd427 100644 --- a/src/plugins/data/server/autocomplete/value_suggestions_route.ts +++ b/src/plugins/data/server/autocomplete/value_suggestions_route.ts @@ -78,7 +78,7 @@ async function getBody( { timeout, terminate_after }: Record, field: IFieldType | string, query: string, - filters: estypes.QueryContainer[] = [] + filters: estypes.QueryDslQueryContainer[] = [] ) { const isFieldObject = (f: any): f is IFieldType => Boolean(f && f.name); diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.ts b/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.ts index c4c1ffa3cf9f91..6db9254b815280 100644 --- a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.ts +++ b/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.ts @@ -69,7 +69,7 @@ import { FieldDescriptor } from '../../../fetcher'; * @return {Array} */ export function readFieldCapsResponse( - fieldCapsResponse: estypes.FieldCapabilitiesResponse + fieldCapsResponse: estypes.FieldCapsResponse ): FieldDescriptor[] { const capsByNameThenType = fieldCapsResponse.fields; diff --git a/src/plugins/data/server/index_patterns/routes.ts b/src/plugins/data/server/index_patterns/routes.ts index 9bff590b54f1c1..d2d8cb82cf646e 100644 --- a/src/plugins/data/server/index_patterns/routes.ts +++ b/src/plugins/data/server/index_patterns/routes.ts @@ -21,6 +21,11 @@ import { registerDeleteScriptedFieldRoute } from './routes/scripted_fields/delet import { registerUpdateScriptedFieldRoute } from './routes/scripted_fields/update_scripted_field'; import type { DataPluginStart, DataPluginStartDependencies } from '../plugin'; import { registerManageDefaultIndexPatternRoutes } from './routes/default_index_pattern'; +import { registerCreateRuntimeFieldRoute } from './routes/runtime_fields/create_runtime_field'; +import { registerGetRuntimeFieldRoute } from './routes/runtime_fields/get_runtime_field'; +import { registerDeleteRuntimeFieldRoute } from './routes/runtime_fields/delete_runtime_field'; +import { registerPutRuntimeFieldRoute } from './routes/runtime_fields/put_runtime_field'; +import { registerUpdateRuntimeFieldRoute } from './routes/runtime_fields/update_runtime_field'; export function registerRoutes( http: HttpServiceSetup, @@ -55,6 +60,13 @@ export function registerRoutes( registerDeleteScriptedFieldRoute(router, getStartServices); registerUpdateScriptedFieldRoute(router, getStartServices); + // Runtime Fields API + registerCreateRuntimeFieldRoute(router, getStartServices); + registerGetRuntimeFieldRoute(router, getStartServices); + registerDeleteRuntimeFieldRoute(router, getStartServices); + registerPutRuntimeFieldRoute(router, getStartServices); + registerUpdateRuntimeFieldRoute(router, getStartServices); + router.get( { path: '/api/index_patterns/_fields_for_wildcard', diff --git a/src/plugins/data/server/index_patterns/routes/create_index_pattern.ts b/src/plugins/data/server/index_patterns/routes/create_index_pattern.ts index d0767334626229..7049903f84e8c2 100644 --- a/src/plugins/data/server/index_patterns/routes/create_index_pattern.ts +++ b/src/plugins/data/server/index_patterns/routes/create_index_pattern.ts @@ -9,7 +9,11 @@ import { schema } from '@kbn/config-schema'; import { IndexPatternSpec } from 'src/plugins/data/common'; import { handleErrors } from './util/handle_errors'; -import { fieldSpecSchema, serializedFieldFormatSchema } from './util/schemas'; +import { + fieldSpecSchema, + runtimeFieldSpecSchema, + serializedFieldFormatSchema, +} from './util/schemas'; import { IRouter, StartServicesAccessor } from '../../../../../core/server'; import type { DataPluginStart, DataPluginStartDependencies } from '../../plugin'; @@ -39,6 +43,7 @@ const indexPatternSpecSchema = schema.object({ ) ), allowNoIndex: schema.maybe(schema.boolean()), + runtimeFieldMap: schema.maybe(schema.recordOf(schema.string(), runtimeFieldSpecSchema)), }); export const registerCreateIndexPatternRoute = ( @@ -66,6 +71,7 @@ export const registerCreateIndexPatternRoute = ( elasticsearchClient ); const body = req.body; + const indexPattern = await indexPatternsService.createAndSave( body.index_pattern as IndexPatternSpec, body.override, diff --git a/src/plugins/data/server/index_patterns/routes/runtime_fields/create_runtime_field.ts b/src/plugins/data/server/index_patterns/routes/runtime_fields/create_runtime_field.ts new file mode 100644 index 00000000000000..faf6d87b6d10bf --- /dev/null +++ b/src/plugins/data/server/index_patterns/routes/runtime_fields/create_runtime_field.ts @@ -0,0 +1,74 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { schema } from '@kbn/config-schema'; +import { handleErrors } from '../util/handle_errors'; +import { runtimeFieldSpecSchema } from '../util/schemas'; +import { IRouter, StartServicesAccessor } from '../../../../../../core/server'; +import type { DataPluginStart, DataPluginStartDependencies } from '../../../plugin'; + +export const registerCreateRuntimeFieldRoute = ( + router: IRouter, + getStartServices: StartServicesAccessor +) => { + router.post( + { + path: '/api/index_patterns/index_pattern/{id}/runtime_field', + validate: { + params: schema.object({ + id: schema.string({ + minLength: 1, + maxLength: 1_000, + }), + }), + body: schema.object({ + name: schema.string({ + minLength: 1, + maxLength: 1_000, + }), + runtimeField: runtimeFieldSpecSchema, + }), + }, + }, + + handleErrors(async (ctx, req, res) => { + const savedObjectsClient = ctx.core.savedObjects.client; + const elasticsearchClient = ctx.core.elasticsearch.client.asCurrentUser; + const [, , { indexPatterns }] = await getStartServices(); + const indexPatternsService = await indexPatterns.indexPatternsServiceFactory( + savedObjectsClient, + elasticsearchClient + ); + const id = req.params.id; + const { name, runtimeField } = req.body; + + const indexPattern = await indexPatternsService.get(id); + + if (indexPattern.fields.getByName(name)) { + throw new Error(`Field [name = ${name}] already exists.`); + } + + indexPattern.addRuntimeField(name, runtimeField); + + const addedField = indexPattern.fields.getByName(name); + if (!addedField) throw new Error(`Could not create a field [name = ${name}].`); + + await indexPatternsService.updateSavedObject(indexPattern); + + const savedField = indexPattern.fields.getByName(name); + if (!savedField) throw new Error(`Could not create a field [name = ${name}].`); + + return res.ok({ + body: { + field: savedField.toSpec(), + index_pattern: indexPattern.toSpec(), + }, + }); + }) + ); +}; diff --git a/src/plugins/data/server/index_patterns/routes/runtime_fields/delete_runtime_field.ts b/src/plugins/data/server/index_patterns/routes/runtime_fields/delete_runtime_field.ts new file mode 100644 index 00000000000000..58b8529d7cf5af --- /dev/null +++ b/src/plugins/data/server/index_patterns/routes/runtime_fields/delete_runtime_field.ts @@ -0,0 +1,64 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { schema } from '@kbn/config-schema'; +import { ErrorIndexPatternFieldNotFound } from '../../error'; +import { handleErrors } from '../util/handle_errors'; +import { IRouter, StartServicesAccessor } from '../../../../../../core/server'; +import type { DataPluginStart, DataPluginStartDependencies } from '../../../plugin'; + +export const registerDeleteRuntimeFieldRoute = ( + router: IRouter, + getStartServices: StartServicesAccessor +) => { + router.delete( + { + path: '/api/index_patterns/index_pattern/{id}/runtime_field/{name}', + validate: { + params: schema.object({ + id: schema.string({ + minLength: 1, + maxLength: 1_000, + }), + name: schema.string({ + minLength: 1, + maxLength: 1_000, + }), + }), + }, + }, + handleErrors(async (ctx, req, res) => { + const savedObjectsClient = ctx.core.savedObjects.client; + const elasticsearchClient = ctx.core.elasticsearch.client.asCurrentUser; + const [, , { indexPatterns }] = await getStartServices(); + const indexPatternsService = await indexPatterns.indexPatternsServiceFactory( + savedObjectsClient, + elasticsearchClient + ); + const id = req.params.id; + const name = req.params.name; + + const indexPattern = await indexPatternsService.get(id); + const field = indexPattern.fields.getByName(name); + + if (!field) { + throw new ErrorIndexPatternFieldNotFound(id, name); + } + + if (!field.runtimeField) { + throw new Error('Only runtime fields can be deleted.'); + } + + indexPattern.removeRuntimeField(name); + + await indexPatternsService.updateSavedObject(indexPattern); + + return res.ok(); + }) + ); +}; diff --git a/src/plugins/data/server/index_patterns/routes/runtime_fields/get_runtime_field.ts b/src/plugins/data/server/index_patterns/routes/runtime_fields/get_runtime_field.ts new file mode 100644 index 00000000000000..6bc2bf396c0b44 --- /dev/null +++ b/src/plugins/data/server/index_patterns/routes/runtime_fields/get_runtime_field.ts @@ -0,0 +1,67 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { schema } from '@kbn/config-schema'; +import { ErrorIndexPatternFieldNotFound } from '../../error'; +import { handleErrors } from '../util/handle_errors'; +import { IRouter, StartServicesAccessor } from '../../../../../../core/server'; +import type { DataPluginStart, DataPluginStartDependencies } from '../../../plugin'; + +export const registerGetRuntimeFieldRoute = ( + router: IRouter, + getStartServices: StartServicesAccessor +) => { + router.get( + { + path: '/api/index_patterns/index_pattern/{id}/runtime_field/{name}', + validate: { + params: schema.object({ + id: schema.string({ + minLength: 1, + maxLength: 1_000, + }), + name: schema.string({ + minLength: 1, + maxLength: 1_000, + }), + }), + }, + }, + + handleErrors(async (ctx, req, res) => { + const savedObjectsClient = ctx.core.savedObjects.client; + const elasticsearchClient = ctx.core.elasticsearch.client.asCurrentUser; + const [, , { indexPatterns }] = await getStartServices(); + const indexPatternsService = await indexPatterns.indexPatternsServiceFactory( + savedObjectsClient, + elasticsearchClient + ); + const id = req.params.id; + const name = req.params.name; + + const indexPattern = await indexPatternsService.get(id); + + const field = indexPattern.fields.getByName(name); + + if (!field) { + throw new ErrorIndexPatternFieldNotFound(id, name); + } + + if (!field.runtimeField) { + throw new Error('Only runtime fields can be retrieved.'); + } + + return res.ok({ + body: { + field: field.toSpec(), + runtimeField: indexPattern.getRuntimeField(name), + }, + }); + }) + ); +}; diff --git a/src/plugins/data/server/index_patterns/routes/runtime_fields/put_runtime_field.ts b/src/plugins/data/server/index_patterns/routes/runtime_fields/put_runtime_field.ts new file mode 100644 index 00000000000000..a5e92fa5a36ecb --- /dev/null +++ b/src/plugins/data/server/index_patterns/routes/runtime_fields/put_runtime_field.ts @@ -0,0 +1,76 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { schema } from '@kbn/config-schema'; +import { handleErrors } from '../util/handle_errors'; +import { runtimeFieldSpecSchema } from '../util/schemas'; +import { IRouter, StartServicesAccessor } from '../../../../../../core/server'; +import type { DataPluginStart, DataPluginStartDependencies } from '../../../plugin'; + +export const registerPutRuntimeFieldRoute = ( + router: IRouter, + getStartServices: StartServicesAccessor +) => { + router.put( + { + path: '/api/index_patterns/index_pattern/{id}/runtime_field', + validate: { + params: schema.object({ + id: schema.string({ + minLength: 1, + maxLength: 1_000, + }), + }), + body: schema.object({ + name: schema.string({ + minLength: 1, + maxLength: 1_000, + }), + runtimeField: runtimeFieldSpecSchema, + }), + }, + }, + handleErrors(async (ctx, req, res) => { + const savedObjectsClient = ctx.core.savedObjects.client; + const elasticsearchClient = ctx.core.elasticsearch.client.asCurrentUser; + const [, , { indexPatterns }] = await getStartServices(); + const indexPatternsService = await indexPatterns.indexPatternsServiceFactory( + savedObjectsClient, + elasticsearchClient + ); + const id = req.params.id; + const { name, runtimeField } = req.body; + + const indexPattern = await indexPatternsService.get(id); + + const oldFieldObject = indexPattern.fields.getByName(name); + + if (oldFieldObject && !oldFieldObject.runtimeField) { + throw new Error('Only runtime fields can be updated'); + } + + if (oldFieldObject) { + indexPattern.removeRuntimeField(name); + } + + indexPattern.addRuntimeField(name, runtimeField); + + await indexPatternsService.updateSavedObject(indexPattern); + + const fieldObject = indexPattern.fields.getByName(name); + if (!fieldObject) throw new Error(`Could not create a field [name = ${name}].`); + + return res.ok({ + body: { + field: fieldObject.toSpec(), + index_pattern: indexPattern.toSpec(), + }, + }); + }) + ); +}; diff --git a/src/plugins/data/server/index_patterns/routes/runtime_fields/update_runtime_field.ts b/src/plugins/data/server/index_patterns/routes/runtime_fields/update_runtime_field.ts new file mode 100644 index 00000000000000..3f3aae46c43882 --- /dev/null +++ b/src/plugins/data/server/index_patterns/routes/runtime_fields/update_runtime_field.ts @@ -0,0 +1,84 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { schema } from '@kbn/config-schema'; +import { RuntimeField } from 'src/plugins/data/common'; +import { ErrorIndexPatternFieldNotFound } from '../../error'; +import { handleErrors } from '../util/handle_errors'; +import { runtimeFieldSpec, runtimeFieldSpecTypeSchema } from '../util/schemas'; +import { IRouter, StartServicesAccessor } from '../../../../../../core/server'; +import type { DataPluginStart, DataPluginStartDependencies } from '../../../plugin'; + +export const registerUpdateRuntimeFieldRoute = ( + router: IRouter, + getStartServices: StartServicesAccessor +) => { + router.post( + { + path: '/api/index_patterns/index_pattern/{id}/runtime_field/{name}', + validate: { + params: schema.object({ + id: schema.string({ + minLength: 1, + maxLength: 1_000, + }), + name: schema.string({ + minLength: 1, + maxLength: 1_000, + }), + }), + body: schema.object({ + name: schema.never(), + runtimeField: schema.object({ + ...runtimeFieldSpec, + // We need to overwrite the below fields on top of `runtimeFieldSpec`, + // because some fields would be optional + type: schema.maybe(runtimeFieldSpecTypeSchema), + }), + }), + }, + }, + handleErrors(async (ctx, req, res) => { + const savedObjectsClient = ctx.core.savedObjects.client; + const elasticsearchClient = ctx.core.elasticsearch.client.asCurrentUser; + const [, , { indexPatterns }] = await getStartServices(); + const indexPatternsService = await indexPatterns.indexPatternsServiceFactory( + savedObjectsClient, + elasticsearchClient + ); + const id = req.params.id; + const name = req.params.name; + const runtimeField = req.body.runtimeField as Partial; + + const indexPattern = await indexPatternsService.get(id); + const existingRuntimeField = indexPattern.getRuntimeField(name); + + if (!existingRuntimeField) { + throw new ErrorIndexPatternFieldNotFound(id, name); + } + + indexPattern.removeRuntimeField(name); + indexPattern.addRuntimeField(name, { + ...existingRuntimeField, + ...runtimeField, + }); + + await indexPatternsService.updateSavedObject(indexPattern); + + const fieldObject = indexPattern.fields.getByName(name); + if (!fieldObject) throw new Error(`Could not create a field [name = ${name}].`); + + return res.ok({ + body: { + field: fieldObject.toSpec(), + index_pattern: indexPattern.toSpec(), + }, + }); + }) + ); +}; diff --git a/src/plugins/data/server/index_patterns/routes/update_index_pattern.ts b/src/plugins/data/server/index_patterns/routes/update_index_pattern.ts index c1509b9b848bef..1c88550c154c56 100644 --- a/src/plugins/data/server/index_patterns/routes/update_index_pattern.ts +++ b/src/plugins/data/server/index_patterns/routes/update_index_pattern.ts @@ -8,7 +8,11 @@ import { schema } from '@kbn/config-schema'; import { handleErrors } from './util/handle_errors'; -import { fieldSpecSchema, serializedFieldFormatSchema } from './util/schemas'; +import { + fieldSpecSchema, + runtimeFieldSpecSchema, + serializedFieldFormatSchema, +} from './util/schemas'; import { IRouter, StartServicesAccessor } from '../../../../../core/server'; import type { DataPluginStart, DataPluginStartDependencies } from '../../plugin'; @@ -28,6 +32,7 @@ const indexPatternUpdateSchema = schema.object({ fieldFormats: schema.maybe(schema.recordOf(schema.string(), serializedFieldFormatSchema)), fields: schema.maybe(schema.recordOf(schema.string(), fieldSpecSchema)), allowNoIndex: schema.maybe(schema.boolean()), + runtimeFieldMap: schema.maybe(schema.recordOf(schema.string(), runtimeFieldSpecSchema)), }); export const registerUpdateIndexPatternRoute = ( @@ -78,6 +83,7 @@ export const registerUpdateIndexPatternRoute = ( type, typeMeta, fields, + runtimeFieldMap, }, } = req.body; @@ -131,6 +137,11 @@ export const registerUpdateIndexPatternRoute = ( ); } + if (runtimeFieldMap !== undefined) { + changeCount++; + indexPattern.replaceAllRuntimeFields(runtimeFieldMap); + } + if (changeCount < 1) { throw new Error('Index pattern change set is empty.'); } diff --git a/src/plugins/data/server/index_patterns/routes/util/schemas.ts b/src/plugins/data/server/index_patterns/routes/util/schemas.ts index d916423c4fc69c..79ee1ffa1ab970 100644 --- a/src/plugins/data/server/index_patterns/routes/util/schemas.ts +++ b/src/plugins/data/server/index_patterns/routes/util/schemas.ts @@ -6,7 +6,8 @@ * Side Public License, v 1. */ -import { schema } from '@kbn/config-schema'; +import { schema, Type } from '@kbn/config-schema'; +import { RUNTIME_FIELD_TYPES, RuntimeType } from '../../../../common'; export const serializedFieldFormatSchema = schema.object({ id: schema.maybe(schema.string()), @@ -52,4 +53,24 @@ export const fieldSpecSchemaFields = { shortDotsEnable: schema.maybe(schema.boolean()), }; -export const fieldSpecSchema = schema.object(fieldSpecSchemaFields); +export const fieldSpecSchema = schema.object(fieldSpecSchemaFields, { + // Allow and ignore unknowns to make fields transient. + // Because `fields` have a bunch of calculated fields + // this allows to retrieve an index pattern and then to re-create by using the retrieved payload + unknowns: 'ignore', +}); + +export const runtimeFieldSpecTypeSchema = schema.oneOf( + RUNTIME_FIELD_TYPES.map((runtimeFieldType) => schema.literal(runtimeFieldType)) as [ + Type + ] +); +export const runtimeFieldSpec = { + type: runtimeFieldSpecTypeSchema, + script: schema.maybe( + schema.object({ + source: schema.string(), + }) + ), +}; +export const runtimeFieldSpecSchema = schema.object(runtimeFieldSpec); diff --git a/src/plugins/data/server/search/routes/call_msearch.ts b/src/plugins/data/server/search/routes/call_msearch.ts index 0c238adf831bd9..4a7db9517c688b 100644 --- a/src/plugins/data/server/search/routes/call_msearch.ts +++ b/src/plugins/data/server/search/routes/call_msearch.ts @@ -8,7 +8,8 @@ import { Observable } from 'rxjs'; import { first } from 'rxjs/operators'; -import { IUiSettingsClient, IScopedClusterClient, SharedGlobalConfig } from 'src/core/server'; +import type { IUiSettingsClient, IScopedClusterClient, SharedGlobalConfig } from 'src/core/server'; +import type { estypes } from '@elastic/elasticsearch'; import type { MsearchRequestBody, MsearchResponse } from '../../../common/search/search_source'; import { getKbnServerError } from '../../../../kibana_utils/server'; @@ -78,7 +79,9 @@ export function getCallMsearch(dependencies: CallMsearchDependencies) { body: { ...response, body: { - responses: response.body.responses?.map((r) => shimHitsTotal(r)), + responses: response.body.responses?.map((r) => + shimHitsTotal(r as estypes.SearchResponse) + ), }, }, }; diff --git a/src/plugins/data/server/search/routes/msearch.test.ts b/src/plugins/data/server/search/routes/msearch.test.ts index 6ae8612cceb1e9..303f83582f737e 100644 --- a/src/plugins/data/server/search/routes/msearch.test.ts +++ b/src/plugins/data/server/search/routes/msearch.test.ts @@ -116,7 +116,7 @@ describe('msearch route', () => { const error: any = mockResponse.customError.mock.calls[0][0]; expect(error.statusCode).toBe(400); - expect(error.body.message).toBe('json_e_o_f_exception'); + expect(error.body.message).toMatch(/json_e_o_f_exception/); expect(error.body.attributes).toBe(jsonEofException.error); }); diff --git a/src/plugins/data/server/search/strategies/eql_search/eql_search_strategy.ts b/src/plugins/data/server/search/strategies/eql_search/eql_search_strategy.ts index 0e3acedfe12f67..91de0fca3674c9 100644 --- a/src/plugins/data/server/search/strategies/eql_search/eql_search_strategy.ts +++ b/src/plugins/data/server/search/strategies/eql_search/eql_search_strategy.ts @@ -54,7 +54,8 @@ export const eqlSearchStrategyProvider = ( }; const promise = id ? client.get({ ...params, id }, request.options) - : client.search(params as EqlSearchStrategyRequest['params'], request.options); + : // @ts-expect-error EqlRequestParams | undefined is not assignable to EqlRequestParams + client.search(params as EqlSearchStrategyRequest['params'], request.options); const response = await shimAbortSignal(promise, options.abortSignal); return toEqlKibanaSearchResponse(response as ApiResponse); }; diff --git a/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.test.ts b/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.test.ts index 216318339622f0..56b26a7ebe02cc 100644 --- a/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.test.ts +++ b/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.test.ts @@ -293,7 +293,7 @@ describe('ES search strategy', () => { expect(mockGetCaller).toBeCalled(); const request = mockGetCaller.mock.calls[0][0]; - expect(request).toEqual({ id, body: { keep_alive: keepAlive } }); + expect(request).toEqual({ id, keep_alive: keepAlive }); }); it('throws normalized error on ElasticsearchClientError', async () => { diff --git a/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts b/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts index ab6162f756ea89..d6af00ada80fa6 100644 --- a/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts +++ b/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts @@ -177,7 +177,7 @@ export const enhancedEsSearchStrategyProvider = ( const client = useInternalUser ? esClient.asInternalUser : esClient.asCurrentUser; await client.asyncSearch.get({ id, - body: { keep_alive: keepAlive }, + keep_alive: keepAlive, }); } catch (e) { throw getKbnServerError(e); diff --git a/src/plugins/data/server/server.api.md b/src/plugins/data/server/server.api.md index f57ba274881033..783bd8d2fcd0e1 100644 --- a/src/plugins/data/server/server.api.md +++ b/src/plugins/data/server/server.api.md @@ -6,10 +6,8 @@ import { $Values } from '@kbn/utility-types'; import { Adapters } from 'src/plugins/inspector/common'; -import { Aggregate } from '@elastic/elasticsearch/api/types'; import { Assign } from '@kbn/utility-types'; import { BfetchServerSetup } from 'src/plugins/bfetch/server'; -import { Bucket } from '@elastic/elasticsearch/api/types'; import { ConfigDeprecationProvider } from '@kbn/config'; import { CoreSetup } from 'src/core/server'; import { CoreSetup as CoreSetup_2 } from 'kibana/server'; @@ -713,7 +711,7 @@ export interface IFieldType { // (undocumented) format?: any; // (undocumented) - lang?: string; + lang?: estypes.ScriptLanguage; // (undocumented) name: string; // (undocumented) @@ -818,6 +816,7 @@ export class IndexPattern implements IIndexPattern { typeMeta?: string | undefined; type?: string | undefined; }; + getRuntimeField(name: string): RuntimeField | null; // @deprecated (undocumented) getScriptedFields(): IndexPatternField[]; getSourceFiltering(): { @@ -825,6 +824,7 @@ export class IndexPattern implements IIndexPattern { }; // (undocumented) getTimeField(): IndexPatternField | undefined; + hasRuntimeField(name: string): boolean; // (undocumented) id?: string; // @deprecated (undocumented) @@ -838,6 +838,7 @@ export class IndexPattern implements IIndexPattern { removeRuntimeField(name: string): void; // @deprecated removeScriptedField(fieldName: string): void; + replaceAllRuntimeFields(newFields: Record): void; resetOriginalSavedObjectBody: () => void; // (undocumented) protected setFieldAttrs(fieldName: string, attrName: K, value: FieldAttrSet[K]): void; @@ -1420,22 +1421,22 @@ export const shimAbortSignal: (promise: TransportRequestPromise, signal?: export function shimHitsTotal(response: estypes.SearchResponse, { legacyHitsTotal }?: ISearchOptions): { hits: { total: any; - hits: estypes.Hit[]; + hits: estypes.SearchHit[]; max_score?: number | undefined; }; took: number; timed_out: boolean; _shards: estypes.ShardStatistics; - aggregations?: Record | undefined; + aggregations?: Record | undefined; _clusters?: estypes.ClusterStatistics | undefined; documents?: unknown[] | undefined; fields?: Record | undefined; max_score?: number | undefined; num_reduce_phases?: number | undefined; - profile?: estypes.Profile | undefined; + profile?: estypes.SearchProfile | undefined; pit_id?: string | undefined; _scroll_id?: string | undefined; - suggest?: Record[]> | undefined; + suggest?: Record[]> | undefined; terminated_early?: boolean | undefined; }; diff --git a/src/plugins/discover/public/__mocks__/index_pattern.ts b/src/plugins/discover/public/__mocks__/index_pattern.ts index 4fbeac80b09723..67aac96889424f 100644 --- a/src/plugins/discover/public/__mocks__/index_pattern.ts +++ b/src/plugins/discover/public/__mocks__/index_pattern.ts @@ -65,6 +65,10 @@ fields.getByName = (name: string) => { return fields.find((field) => field.name === name); }; +fields.getAll = () => { + return fields; +}; + const indexPattern = ({ id: 'the-index-pattern-id', title: 'the-index-pattern-title', diff --git a/src/plugins/discover/public/__mocks__/index_pattern_with_timefield.ts b/src/plugins/discover/public/__mocks__/index_pattern_with_timefield.ts index ad84518af9de3a..f1c3c537dd5e18 100644 --- a/src/plugins/discover/public/__mocks__/index_pattern_with_timefield.ts +++ b/src/plugins/discover/public/__mocks__/index_pattern_with_timefield.ts @@ -56,6 +56,9 @@ const fields = [ fields.getByName = (name: string) => { return fields.find((field) => field.name === name); }; +fields.getAll = () => { + return fields; +}; const indexPattern = ({ id: 'index-pattern-with-timefield-id', @@ -72,5 +75,8 @@ const indexPattern = ({ indexPattern.flattenHit = indexPatterns.flattenHitWrapper(indexPattern, indexPattern.metaFields); indexPattern.isTimeBased = () => !!indexPattern.timeFieldName; +indexPattern.formatField = (hit: Record, fieldName: string) => { + return fieldName === '_source' ? hit._source : indexPattern.flattenHit(hit)[fieldName]; +}; export const indexPatternWithTimefieldMock = indexPattern; diff --git a/src/plugins/discover/public/__mocks__/saved_search.ts b/src/plugins/discover/public/__mocks__/saved_search.ts index 8f07391571987c..6f48c56b0810e4 100644 --- a/src/plugins/discover/public/__mocks__/saved_search.ts +++ b/src/plugins/discover/public/__mocks__/saved_search.ts @@ -7,6 +7,8 @@ */ import { SavedSearch } from '../saved_searches'; +import { createSearchSourceMock } from '../../../data/public/mocks'; +import { indexPatternMock } from './index_pattern'; export const savedSearchMock = ({ id: 'the-saved-search-id', @@ -27,4 +29,5 @@ export const savedSearchMock = ({ ], migrationVersion: { search: '7.5.0' }, error: undefined, + searchSource: createSearchSourceMock({ index: indexPatternMock }), } as unknown) as SavedSearch; diff --git a/src/plugins/discover/public/__mocks__/search_session.ts b/src/plugins/discover/public/__mocks__/search_session.ts new file mode 100644 index 00000000000000..a9037217a303ae --- /dev/null +++ b/src/plugins/discover/public/__mocks__/search_session.ts @@ -0,0 +1,27 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import { createMemoryHistory } from 'history'; +import { dataPluginMock } from '../../../data/public/mocks'; +import { DataPublicPluginStart } from '../../../data/public'; +import { DiscoverSearchSessionManager } from '../application/apps/main/services/discover_search_session'; + +export function createSearchSessionMock() { + const history = createMemoryHistory(); + const session = dataPluginMock.createStartContract().search.session as jest.Mocked< + DataPublicPluginStart['search']['session'] + >; + const searchSessionManager = new DiscoverSearchSessionManager({ + history, + session, + }); + return { + history, + session, + searchSessionManager, + }; +} diff --git a/src/plugins/discover/public/__mocks__/services.ts b/src/plugins/discover/public/__mocks__/services.ts new file mode 100644 index 00000000000000..8a047625303d2a --- /dev/null +++ b/src/plugins/discover/public/__mocks__/services.ts @@ -0,0 +1,63 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import { DiscoverServices } from '../build_services'; +import { dataPluginMock } from '../../../data/public/mocks'; +import { chromeServiceMock, coreMock, docLinksServiceMock } from '../../../../core/public/mocks'; +import { DEFAULT_COLUMNS_SETTING } from '../../common'; +import { savedSearchMock } from './saved_search'; +import { UI_SETTINGS } from '../../../data/common'; +import { TopNavMenu } from '../../../navigation/public'; +const dataPlugin = dataPluginMock.createStartContract(); + +export const discoverServiceMock = ({ + core: coreMock.createStart(), + chrome: chromeServiceMock.createStartContract(), + history: () => ({ + location: { + search: '', + }, + }), + data: dataPlugin, + docLinks: docLinksServiceMock.createStartContract(), + capabilities: { + visualize: { + show: true, + }, + discover: { + save: false, + }, + advancedSettings: { + save: true, + }, + }, + filterManager: dataPlugin.query.filterManager, + uiSettings: { + get: (key: string) => { + if (key === 'fields:popularLimit') { + return 5; + } else if (key === DEFAULT_COLUMNS_SETTING) { + return []; + } else if (key === UI_SETTINGS.META_FIELDS) { + return []; + } + }, + }, + indexPatternFieldEditor: { + openEditor: jest.fn(), + userPermissions: { + editIndexPattern: jest.fn(), + }, + }, + getSavedSearchById: (id?: string) => Promise.resolve(savedSearchMock), + navigation: { + ui: { TopNavMenu }, + }, + metadata: { + branch: 'test', + }, +} as unknown) as DiscoverServices; diff --git a/src/plugins/discover/public/application/angular/create_discover_directive.ts b/src/plugins/discover/public/application/angular/create_discover_directive.ts new file mode 100644 index 00000000000000..ae0d978322bcd0 --- /dev/null +++ b/src/plugins/discover/public/application/angular/create_discover_directive.ts @@ -0,0 +1,16 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import { DiscoverMainApp } from '../apps/main'; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export function createDiscoverDirective(reactDirective: any) { + return reactDirective(DiscoverMainApp, [ + ['indexPattern', { watchDepth: 'reference' }], + ['opts', { watchDepth: 'reference' }], + ]); +} diff --git a/src/plugins/discover/public/application/components/create_discover_grid_directive.tsx b/src/plugins/discover/public/application/angular/create_discover_grid_directive.tsx similarity index 95% rename from src/plugins/discover/public/application/components/create_discover_grid_directive.tsx rename to src/plugins/discover/public/application/angular/create_discover_grid_directive.tsx index 39a9df89260238..1fc8edcb4d0659 100644 --- a/src/plugins/discover/public/application/components/create_discover_grid_directive.tsx +++ b/src/plugins/discover/public/application/angular/create_discover_grid_directive.tsx @@ -7,7 +7,7 @@ */ import React, { useState } from 'react'; import { I18nProvider } from '@kbn/i18n/react'; -import { DiscoverGrid, DiscoverGridProps } from './discover_grid/discover_grid'; +import { DiscoverGrid, DiscoverGridProps } from '../components/discover_grid/discover_grid'; import { getServices } from '../../kibana_services'; import { ElasticSearchHit } from '../doc_views/doc_views_types'; diff --git a/src/plugins/discover/public/application/angular/directives/debounce/debounce.js b/src/plugins/discover/public/application/angular/directives/debounce/debounce.js deleted file mode 100644 index bca1a9c785fd68..00000000000000 --- a/src/plugins/discover/public/application/angular/directives/debounce/debounce.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import _ from 'lodash'; -// Debounce service, angularized version of lodash debounce -// borrowed heavily from https://github.com/shahata/angular-debounce - -export function createDebounceProviderTimeout($timeout) { - return function (func, wait, options) { - let timeout; - let args; - let self; - let result; - options = _.defaults(options || {}, { - leading: false, - trailing: true, - invokeApply: true, - }); - - function debounce() { - self = this; - args = arguments; - - const later = function () { - timeout = null; - if (!options.leading || options.trailing) { - result = func.apply(self, args); - } - }; - - const callNow = options.leading && !timeout; - - if (timeout) { - $timeout.cancel(timeout); - } - timeout = $timeout(later, wait, options.invokeApply); - - if (callNow) { - result = func.apply(self, args); - } - - return result; - } - - debounce.cancel = function () { - $timeout.cancel(timeout); - timeout = null; - }; - - return debounce; - }; -} diff --git a/src/plugins/discover/public/application/angular/directives/debounce/debounce.test.ts b/src/plugins/discover/public/application/angular/directives/debounce/debounce.test.ts deleted file mode 100644 index 0c033fd066eabe..00000000000000 --- a/src/plugins/discover/public/application/angular/directives/debounce/debounce.test.ts +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import sinon, { SinonSpy } from 'sinon'; -import angular, { auto, ITimeoutService } from 'angular'; -import 'angular-mocks'; -import 'angular-sanitize'; -import 'angular-route'; - -// @ts-expect-error -import { createDebounceProviderTimeout } from './debounce'; -import { coreMock } from '../../../../../../../core/public/mocks'; -import { initializeInnerAngularModule } from '../../../../get_inner_angular'; -import { navigationPluginMock } from '../../../../../../navigation/public/mocks'; -import { dataPluginMock } from '../../../../../../data/public/mocks'; -import { initAngularBootstrap } from '../../../../../../kibana_legacy/public'; - -describe('debounce service', function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - let debounce: (fn: () => void, timeout: number, options?: any) => any; - let $timeout: ITimeoutService; - let spy: SinonSpy; - - beforeEach(() => { - spy = sinon.spy(); - - initAngularBootstrap(); - - initializeInnerAngularModule( - 'app/discover', - coreMock.createStart(), - navigationPluginMock.createStartContract(), - dataPluginMock.createStartContract() - ); - - angular.mock.module('app/discover'); - - angular.mock.inject(($injector: auto.IInjectorService, _$timeout_: ITimeoutService) => { - $timeout = _$timeout_; - - debounce = createDebounceProviderTimeout($timeout); - }); - }); - - it('should have a cancel method', function () { - const bouncer = debounce(() => {}, 100); - - expect(bouncer).toHaveProperty('cancel'); - }); - - describe('delayed execution', function () { - const sandbox = sinon.createSandbox(); - - beforeEach(() => sandbox.useFakeTimers()); - afterEach(() => sandbox.restore()); - - it('should delay execution', function () { - const bouncer = debounce(spy, 100); - - bouncer(); - sinon.assert.notCalled(spy); - $timeout.flush(); - sinon.assert.calledOnce(spy); - - spy.resetHistory(); - }); - - it('should fire on leading edge', function () { - const bouncer = debounce(spy, 100, { leading: true }); - - bouncer(); - sinon.assert.calledOnce(spy); - $timeout.flush(); - sinon.assert.calledTwice(spy); - - spy.resetHistory(); - }); - - it('should only fire on leading edge', function () { - const bouncer = debounce(spy, 100, { leading: true, trailing: false }); - - bouncer(); - sinon.assert.calledOnce(spy); - $timeout.flush(); - sinon.assert.calledOnce(spy); - - spy.resetHistory(); - }); - - it('should reset delayed execution', function () { - const cancelSpy = sinon.spy($timeout, 'cancel'); - const bouncer = debounce(spy, 100); - - bouncer(); - sandbox.clock.tick(1); - - bouncer(); - sinon.assert.notCalled(spy); - $timeout.flush(); - sinon.assert.calledOnce(spy); - sinon.assert.calledOnce(cancelSpy); - - spy.resetHistory(); - cancelSpy.resetHistory(); - }); - }); - - describe('cancel', function () { - it('should cancel the $timeout', function () { - const cancelSpy = sinon.spy($timeout, 'cancel'); - const bouncer = debounce(spy, 100); - - bouncer(); - bouncer.cancel(); - sinon.assert.calledOnce(cancelSpy); - // throws if pending timeouts - $timeout.verifyNoPendingTasks(); - - cancelSpy.resetHistory(); - }); - }); -}); diff --git a/src/plugins/discover/public/application/angular/directives/debounce/index.js b/src/plugins/discover/public/application/angular/directives/debounce/index.js deleted file mode 100644 index 774876af70d4c6..00000000000000 --- a/src/plugins/discover/public/application/angular/directives/debounce/index.js +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -export { createDebounceProviderTimeout } from './debounce'; diff --git a/src/plugins/discover/public/application/angular/directives/index.ts b/src/plugins/discover/public/application/angular/directives/index.ts deleted file mode 100644 index 4478d8bb319793..00000000000000 --- a/src/plugins/discover/public/application/angular/directives/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -export { DiscoverUninitialized } from './uninitialized'; -export { DiscoverHistogram } from './histogram'; diff --git a/src/plugins/discover/public/application/angular/discover.js b/src/plugins/discover/public/application/angular/discover.js index c66ca19c967437..aa1344a67fbec9 100644 --- a/src/plugins/discover/public/application/angular/discover.js +++ b/src/plugins/discover/public/application/angular/discover.js @@ -6,47 +6,17 @@ * Side Public License, v 1. */ -import _ from 'lodash'; -import { merge, Subject, Subscription } from 'rxjs'; -import { debounceTime, tap, filter } from 'rxjs/operators'; import { i18n } from '@kbn/i18n'; -import { createSearchSessionRestorationDataProvider, getState, splitState } from './discover_state'; -import { RequestAdapter } from '../../../../inspector/public'; -import { - connectToQueryState, - esFilters, - indexPatterns as indexPatternsUtils, - noSearchSessionStorageCapabilityMessage, - syncQueryStateWithUrl, -} from '../../../../data/public'; -import { getSortArray } from './doc_table'; +import { getState } from '../apps/main/services/discover_state'; import indexTemplateLegacy from './discover_legacy.html'; -import { discoverResponseHandler } from './response_handler'; import { getAngularModule, - getHeaderActionMenuMounter, getServices, getUrlTracker, redirectWhenMissing, - subscribeWithScope, - tabifyAggResponse, } from '../../kibana_services'; import { getRootBreadcrumbs, getSavedSearchBreadcrumbs } from '../helpers/breadcrumbs'; -import { getStateDefaults } from '../helpers/get_state_defaults'; -import { getResultState } from '../helpers/get_result_state'; -import { validateTimeRange } from '../helpers/validate_time_range'; -import { addFatalError } from '../../../../kibana_legacy/public'; -import { - SAMPLE_SIZE_SETTING, - SEARCH_FIELDS_FROM_SOURCE, - SEARCH_ON_PAGE_LOAD_SETTING, -} from '../../../common'; -import { loadIndexPattern, resolveIndexPattern } from '../helpers/resolve_index_pattern'; -import { updateSearchSource } from '../helpers/update_search_source'; -import { calcFieldCounts } from '../helpers/calc_field_counts'; -import { DiscoverSearchSessionManager } from './discover_search_session'; -import { applyAggsToSearchSource, getDimensions } from '../components/histogram'; -import { fetchStatuses } from '../components/constants'; +import { loadIndexPattern, resolveIndexPattern } from '../apps/main/utils/resolve_index_pattern'; const services = getServices(); @@ -56,8 +26,6 @@ const { chrome, data, history: getHistory, - filterManager, - timefilter, toastNotifications, uiSettings: config, } = getServices(); @@ -147,390 +115,29 @@ app.directive('discoverApp', function () { }); function discoverController($route, $scope) { - const { isDefault: isDefaultType } = indexPatternsUtils; - const subscriptions = new Subscription(); - const refetch$ = new Subject(); - - let isChangingIndexPattern = false; const savedSearch = $route.current.locals.savedObjects.savedSearch; - const persistentSearchSource = savedSearch.searchSource; $scope.indexPattern = resolveIndexPattern( $route.current.locals.savedObjects.ip, - persistentSearchSource, + savedSearch.searchSource, toastNotifications ); - $scope.useNewFieldsApi = !config.get(SEARCH_FIELDS_FROM_SOURCE); - - //used for functional testing - $scope.fetchCounter = 0; - - const getTimeField = () => { - return isDefaultType($scope.indexPattern) ? $scope.indexPattern.timeFieldName : undefined; - }; const history = getHistory(); - const searchSessionManager = new DiscoverSearchSessionManager({ - history, - session: data.search.session, - }); - - const stateContainer = getState({ - getStateDefaults: () => - getStateDefaults({ - config, - data, - indexPattern: $scope.indexPattern, - savedSearch, - searchSource: persistentSearchSource, - }), - storeInSessionStorage: config.get('state:storeInSessionStorage'), - history, - toasts: core.notifications.toasts, - uiSettings: config, - }); - - const { - appStateContainer, - startSync: startStateSync, - stopSync: stopStateSync, - setAppState, - replaceUrlAppState, - kbnUrlStateStorage, - getPreviousAppState, - } = stateContainer; - - if (appStateContainer.getState().index !== $scope.indexPattern.id) { - //used index pattern is different than the given by url/state which is invalid - setAppState({ index: $scope.indexPattern.id }); - } - $scope.state = { ...appStateContainer.getState() }; - - // syncs `_g` portion of url with query services - const { stop: stopSyncingGlobalStateWithUrl } = syncQueryStateWithUrl( - data.query, - kbnUrlStateStorage - ); - - // sync initial app filters from state to filterManager - filterManager.setAppFilters(_.cloneDeep(appStateContainer.getState().filters)); - data.query.queryString.setQuery(appStateContainer.getState().query); - - const stopSyncingQueryAppStateWithStateContainer = connectToQueryState( - data.query, - appStateContainer, - { - filters: esFilters.FilterStateStore.APP_STATE, - query: true, - } - ); - const showUnmappedFields = $scope.useNewFieldsApi; - const updateSearchSourceHelper = () => { - const { indexPattern, useNewFieldsApi } = $scope; - const { columns, sort } = $scope.state; - updateSearchSource({ - persistentSearchSource, - volatileSearchSource: $scope.volatileSearchSource, - indexPattern, - services, - sort, - columns, - useNewFieldsApi, - showUnmappedFields, - }); - }; - - const appStateUnsubscribe = appStateContainer.subscribe(async (newState) => { - const { state: newStatePartial } = splitState(newState); - const { state: oldStatePartial } = splitState(getPreviousAppState()); - - if (!_.isEqual(newStatePartial, oldStatePartial)) { - $scope.$evalAsync(async () => { - // NOTE: this is also called when navigating from discover app to context app - if (newStatePartial.index && oldStatePartial.index !== newStatePartial.index) { - //in case of index pattern switch the route has currently to be reloaded, legacy - isChangingIndexPattern = true; - $route.reload(); - return; - } - - $scope.state = { ...newState }; - - // detect changes that should trigger fetching of new data - const changes = ['interval', 'sort'].filter( - (prop) => !_.isEqual(newStatePartial[prop], oldStatePartial[prop]) - ); - - if (oldStatePartial.hideChart && !newStatePartial.hideChart) { - // in case the histogram is hidden, no data is requested - // so when changing this state data needs to be fetched - changes.push(true); - } - - if (changes.length) { - refetch$.next(); - } - }); - } - }); - - // this listener is waiting for such a path http://localhost:5601/app/discover#/ - // which could be set through pressing "New" button in top nav or go to "Discover" plugin from the sidebar - // to reload the page in a right way - const unlistenHistoryBasePath = history.listen(({ pathname, search, hash }) => { - if (!search && !hash && pathname === '/') { - $route.reload(); - } - }); - - data.search.session.enableStorage( - createSearchSessionRestorationDataProvider({ - appStateContainer, - data, - getSavedSearch: () => savedSearch, - }), - { - isDisabled: () => - capabilities.discover.storeSearchSession - ? { disabled: false } - : { - disabled: true, - reasonText: noSearchSessionStorageCapabilityMessage, - }, - } - ); $scope.opts = { - // number of records to fetch, then paginate through - sampleSize: config.get(SAMPLE_SIZE_SETTING), - timefield: getTimeField(), - savedSearch: savedSearch, + savedSearch, + history, services, indexPatternList: $route.current.locals.savedObjects.ip.list, - config: config, - setHeaderActionMenu: getHeaderActionMenuMounter(), - filterManager, - setAppState, - data, - stateContainer, - searchSessionManager, - refetch$, - }; - - const inspectorAdapters = ($scope.opts.inspectorAdapters = { - requests: new RequestAdapter(), - }); - - const shouldSearchOnPageLoad = () => { - // A saved search is created on every page load, so we check the ID to see if we're loading a - // previously saved search or if it is just transient - return ( - config.get(SEARCH_ON_PAGE_LOAD_SETTING) || - savedSearch.id !== undefined || - timefilter.getRefreshInterval().pause === false || - searchSessionManager.hasSearchSessionIdInURL() - ); + navigateTo: (path) => { + $scope.$evalAsync(() => { + history.push(path); + }); + }, }; - $scope.fetchStatus = fetchStatuses.UNINITIALIZED; - $scope.resultState = shouldSearchOnPageLoad() ? 'loading' : 'uninitialized'; - - let abortController; $scope.$on('$destroy', () => { - if (abortController) abortController.abort(); savedSearch.destroy(); - subscriptions.unsubscribe(); - if (!isChangingIndexPattern) { - // HACK: - // do not clear session when changing index pattern due to how state management around it is setup - // it will be cleared by searchSessionManager on controller reload instead - data.search.session.clear(); - } - appStateUnsubscribe(); - stopStateSync(); - stopSyncingGlobalStateWithUrl(); - stopSyncingQueryAppStateWithStateContainer(); - unlistenHistoryBasePath(); - }); - - $scope.opts.getFieldCounts = async () => { - // the field counts aren't set until we have the data back, - // so we wait for the fetch to be done before proceeding - if ($scope.fetchStatus === fetchStatuses.COMPLETE) { - return $scope.fieldCounts; - } - - return await new Promise((resolve) => { - const unwatch = $scope.$watch('fetchStatus', (newValue) => { - if (newValue === fetchStatuses.COMPLETE) { - unwatch(); - resolve($scope.fieldCounts); - } - }); - }); - }; - $scope.opts.navigateTo = (path) => { - $scope.$evalAsync(() => { - history.push(path); - }); - }; - - persistentSearchSource.setField('index', $scope.indexPattern); - - // searchSource which applies time range - const volatileSearchSource = savedSearch.searchSource.create(); - - if (isDefaultType($scope.indexPattern)) { - volatileSearchSource.setField('filter', () => { - return timefilter.createFilter($scope.indexPattern); - }); - } - - volatileSearchSource.setParent(persistentSearchSource); - $scope.volatileSearchSource = volatileSearchSource; - $scope.state.index = $scope.indexPattern.id; - $scope.state.sort = getSortArray($scope.state.sort, $scope.indexPattern); - - $scope.opts.fetch = $scope.fetch = async function () { - $scope.fetchCounter++; - $scope.fetchError = undefined; - if (!validateTimeRange(timefilter.getTime(), toastNotifications)) { - $scope.resultState = 'none'; - } - - // Abort any in-progress requests before fetching again - if (abortController) abortController.abort(); - abortController = new AbortController(); - - const searchSessionId = searchSessionManager.getNextSearchSessionId(); - updateSearchSourceHelper(); - - $scope.opts.chartAggConfigs = applyAggsToSearchSource( - getTimeField() && !$scope.state.hideChart, - volatileSearchSource, - $scope.state.interval, - $scope.indexPattern, - data - ); - - $scope.fetchStatus = fetchStatuses.LOADING; - $scope.resultState = getResultState($scope.fetchStatus, $scope.rows); - - inspectorAdapters.requests.reset(); - return $scope.volatileSearchSource - .fetch$({ - abortSignal: abortController.signal, - sessionId: searchSessionId, - inspector: { - adapter: inspectorAdapters.requests, - title: i18n.translate('discover.inspectorRequestDataTitle', { - defaultMessage: 'data', - }), - description: i18n.translate('discover.inspectorRequestDescription', { - defaultMessage: 'This request queries Elasticsearch to fetch the data for the search.', - }), - }, - }) - .toPromise() - .then(({ rawResponse }) => onResults(rawResponse)) - .catch((error) => { - // If the request was aborted then no need to surface this error in the UI - if (error instanceof Error && error.name === 'AbortError') return; - - $scope.fetchStatus = fetchStatuses.NO_RESULTS; - $scope.fetchError = error; - data.search.showError(error); - }) - .finally(() => { - $scope.resultState = getResultState($scope.fetchStatus, $scope.rows); - $scope.$apply(); - }); - }; - - function onResults(resp) { - if (getTimeField() && !$scope.state.hideChart) { - const tabifiedData = tabifyAggResponse($scope.opts.chartAggConfigs, resp); - $scope.volatileSearchSource.rawResponse = resp; - const dimensions = getDimensions($scope.opts.chartAggConfigs, data); - if (dimensions) { - $scope.histogramData = discoverResponseHandler(tabifiedData, dimensions); - } - } - - $scope.hits = resp.hits.total; - $scope.rows = resp.hits.hits; - - $scope.fieldCounts = calcFieldCounts( - $scope.fieldCounts || {}, - resp.hits.hits, - $scope.indexPattern - ); - $scope.fetchStatus = fetchStatuses.COMPLETE; - } - - $scope.refreshAppState = async () => { - $scope.hits = []; - $scope.rows = []; - $scope.fieldCounts = {}; - await refetch$.next(); - }; - - $scope.resetQuery = function () { - history.push( - $route.current.params.id ? `/view/${encodeURIComponent($route.current.params.id)}` : '/' - ); - $route.reload(); - }; - - $scope.newQuery = function () { - history.push('/'); - }; - - $scope.unmappedFieldsConfig = { - showUnmappedFields, - }; - - // handler emitted by `timefilter.getAutoRefreshFetch$()` - // to notify when data completed loading and to start a new autorefresh loop - let autoRefreshDoneCb; - const fetch$ = merge( - refetch$, - filterManager.getFetches$(), - timefilter.getFetch$(), - timefilter.getAutoRefreshFetch$().pipe( - tap((done) => { - autoRefreshDoneCb = done; - }), - filter(() => $scope.fetchStatus !== fetchStatuses.LOADING) - ), - data.query.queryString.getUpdates$(), - searchSessionManager.newSearchSessionIdFromURL$ - ).pipe(debounceTime(100)); - - subscriptions.add( - subscribeWithScope( - $scope, - fetch$, - { - next: async () => { - try { - await $scope.fetch(); - } finally { - // if there is a saved `autoRefreshDoneCb`, notify auto refresh service that - // the last fetch is completed so it starts the next auto refresh loop if needed - autoRefreshDoneCb?.(); - autoRefreshDoneCb = undefined; - } - }, - }, - (error) => addFatalError(core.fatalErrors, error) - ) - ); - - // Propagate current app state to url, then start syncing and fetching - replaceUrlAppState().then(() => { - startStateSync(); - if (shouldSearchOnPageLoad()) { - refetch$.next(); - } + data.search.session.clear(); }); } diff --git a/src/plugins/discover/public/application/angular/discover_datagrid.html b/src/plugins/discover/public/application/angular/discover_datagrid.html index 42218568a838db..fa1181fd0d6cd6 100644 --- a/src/plugins/discover/public/application/angular/discover_datagrid.html +++ b/src/plugins/discover/public/application/angular/discover_datagrid.html @@ -1,31 +1,11 @@ diff --git a/src/plugins/discover/public/application/angular/discover_legacy.html b/src/plugins/discover/public/application/angular/discover_legacy.html index fa3656d1529d28..025a4490faf1f2 100644 --- a/src/plugins/discover/public/application/angular/discover_legacy.html +++ b/src/plugins/discover/public/application/angular/discover_legacy.html @@ -1,22 +1,7 @@ + > - \ No newline at end of file + diff --git a/src/plugins/discover/public/application/angular/doc_table/actions/columns.test.ts b/src/plugins/discover/public/application/angular/doc_table/actions/columns.test.ts index 43044d08f6ac06..e1aa96f4625de5 100644 --- a/src/plugins/discover/public/application/angular/doc_table/actions/columns.test.ts +++ b/src/plugins/discover/public/application/angular/doc_table/actions/columns.test.ts @@ -11,7 +11,7 @@ import { configMock } from '../../../../__mocks__/config'; import { indexPatternMock } from '../../../../__mocks__/index_pattern'; import { indexPatternsMock } from '../../../../__mocks__/index_patterns'; import { Capabilities } from '../../../../../../../core/types'; -import { AppState } from '../../discover_state'; +import { AppState } from '../../../apps/main/services/discover_state'; function getStateColumnAction(state: {}, setAppState: (state: Partial) => void) { return getStateColumnActions({ diff --git a/src/plugins/discover/public/application/angular/doc_table/actions/columns.ts b/src/plugins/discover/public/application/angular/doc_table/actions/columns.ts index 0907844aa1c54d..9ef5d45947afb0 100644 --- a/src/plugins/discover/public/application/angular/doc_table/actions/columns.ts +++ b/src/plugins/discover/public/application/angular/doc_table/actions/columns.ts @@ -11,7 +11,7 @@ import { IndexPattern, IndexPatternsContract } from '../../../../kibana_services import { AppState as DiscoverState, GetStateReturn as DiscoverGetStateReturn, -} from '../../discover_state'; +} from '../../../apps/main/services/discover_state'; import { AppState as ContextState, GetStateReturn as ContextGetStateReturn, diff --git a/src/plugins/discover/public/application/angular/doc_table/components/row_headers.test.js b/src/plugins/discover/public/application/angular/doc_table/components/row_headers.test.js index 270f366bddbf24..a087ac86971838 100644 --- a/src/plugins/discover/public/application/angular/doc_table/components/row_headers.test.js +++ b/src/plugins/discover/public/application/angular/doc_table/components/row_headers.test.js @@ -19,7 +19,7 @@ import { setScopedHistory, setServices, setDocViewsRegistry } from '../../../../ import { coreMock } from '../../../../../../../core/public/mocks'; import { dataPluginMock } from '../../../../../../data/public/mocks'; import { navigationPluginMock } from '../../../../../../navigation/public/mocks'; -import { getInnerAngularModule } from '../../../../get_inner_angular'; +import { getInnerAngularModule } from '../../get_inner_angular'; import { createBrowserHistory } from 'history'; const fakeRowVals = { diff --git a/src/plugins/discover/public/application/angular/doc_table/create_doc_table_react.tsx b/src/plugins/discover/public/application/angular/doc_table/create_doc_table_react.tsx index b8e8bf1fe7d6ce..681418c1bd7cfe 100644 --- a/src/plugins/discover/public/application/angular/doc_table/create_doc_table_react.tsx +++ b/src/plugins/discover/public/application/angular/doc_table/create_doc_table_react.tsx @@ -13,17 +13,17 @@ import type { estypes } from '@elastic/elasticsearch'; import { EuiButtonEmpty } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { getServices, IIndexPattern } from '../../../kibana_services'; -import { IndexPatternField } from '../../../../../data/common/index_patterns'; -import { SkipBottomButton } from '../../components/skip_bottom_button'; +import { IndexPatternField } from '../../../../../data/common'; +import { SkipBottomButton } from '../../apps/main/components/skip_bottom_button'; export interface DocTableLegacyProps { columns: string[]; searchDescription?: string; searchTitle?: string; onFilter: (field: IndexPatternField | string, value: string, type: '+' | '-') => void; - rows: estypes.Hit[]; + rows: estypes.SearchHit[]; indexPattern: IIndexPattern; - minimumVisibleRows: number; + minimumVisibleRows?: number; onAddColumn?: (column: string) => void; onBackToTop: () => void; onSort?: (sort: string[][]) => void; @@ -119,11 +119,9 @@ export function DocTableLegacy(renderProps: DocTableLegacyProps) { }, [setMinimumVisibleRows, renderProps.rows]); useEffect(() => { - if (minimumVisibleRows > 50) { - setMinimumVisibleRows(50); - } + setMinimumVisibleRows(50); setRows(renderProps.rows); - }, [renderProps.rows, minimumVisibleRows, setMinimumVisibleRows]); + }, [renderProps.rows, setMinimumVisibleRows]); useEffect(() => { if (ref && ref.current && !scope.current) { @@ -133,7 +131,7 @@ export function DocTableLegacy(renderProps: DocTableLegacyProps) { }); } else if (scope && scope.current) { scope.current.renderProps = { ...renderProps, rows, minimumVisibleRows }; - scope.current.$apply(); + scope.current.$applyAsync(); } }, [renderProps, minimumVisibleRows, rows]); diff --git a/src/plugins/discover/public/application/angular/doc_table/doc_table.test.js b/src/plugins/discover/public/application/angular/doc_table/doc_table.test.js index 1765bae07eed72..1db35ddf18089e 100644 --- a/src/plugins/discover/public/application/angular/doc_table/doc_table.test.js +++ b/src/plugins/discover/public/application/angular/doc_table/doc_table.test.js @@ -18,7 +18,7 @@ import { coreMock } from '../../../../../../core/public/mocks'; import { dataPluginMock } from '../../../../../data/public/mocks'; import { navigationPluginMock } from '../../../../../navigation/public/mocks'; import { setScopedHistory, setServices } from '../../../kibana_services'; -import { getInnerAngularModule } from '../../../get_inner_angular'; +import { getInnerAngularModule } from '../get_inner_angular'; let $parentScope; diff --git a/src/plugins/discover/public/get_inner_angular.ts b/src/plugins/discover/public/application/angular/get_inner_angular.ts similarity index 78% rename from src/plugins/discover/public/get_inner_angular.ts rename to src/plugins/discover/public/application/angular/get_inner_angular.ts index c36312a87ce9ad..26d64d5adc8a33 100644 --- a/src/plugins/discover/public/get_inner_angular.ts +++ b/src/plugins/discover/public/application/angular/get_inner_angular.ts @@ -9,29 +9,29 @@ // inner angular imports // these are necessary to bootstrap the local angular. // They can stay even after NP cutover -import './application/index.scss'; +import '../index.scss'; import angular from 'angular'; // required for `ngSanitize` angular module import 'angular-sanitize'; import { EuiIcon } from '@elastic/eui'; import { i18nDirective, i18nFilter, I18nProvider } from '@kbn/i18n/angular'; import { CoreStart, PluginInitializerContext } from 'kibana/public'; -import { DataPublicPluginStart } from '../../data/public'; -import { Storage } from '../../kibana_utils/public'; -import { NavigationPublicPluginStart as NavigationStart } from '../../navigation/public'; -import { createDocTableDirective } from './application/angular/doc_table'; -import { createTableHeaderDirective } from './application/angular/doc_table/components/table_header'; +import { DataPublicPluginStart } from '../../../../data/public'; +import { Storage } from '../../../../kibana_utils/public'; +import { NavigationPublicPluginStart as NavigationStart } from '../../../../navigation/public'; +import { createDocTableDirective } from './doc_table'; +import { createTableHeaderDirective } from './doc_table/components/table_header'; import { createToolBarPagerButtonsDirective, createToolBarPagerTextDirective, -} from './application/angular/doc_table/components/pager'; -import { createContextAppLegacy } from './application/components/context_app/context_app_legacy_directive'; -import { createTableRowDirective } from './application/angular/doc_table/components/table_row'; -import { createPagerFactory } from './application/angular/doc_table/lib/pager/pager_factory'; -import { createInfiniteScrollDirective } from './application/angular/doc_table/infinite_scroll'; -import { createDocViewerDirective } from './application/angular/doc_viewer'; -import { createDiscoverGridDirective } from './application/components/create_discover_grid_directive'; -import { createRenderCompleteDirective } from './application/angular/directives/render_complete'; +} from './doc_table/components/pager'; +import { createContextAppLegacy } from '../components/context_app/context_app_legacy_directive'; +import { createTableRowDirective } from './doc_table/components/table_row'; +import { createPagerFactory } from './doc_table/lib/pager/pager_factory'; +import { createInfiniteScrollDirective } from './doc_table/infinite_scroll'; +import { createDocViewerDirective } from './doc_viewer'; +import { createDiscoverGridDirective } from './create_discover_grid_directive'; +import { createRenderCompleteDirective } from './directives/render_complete'; import { initAngularBootstrap, configureAppAngularModule, @@ -39,10 +39,10 @@ import { PromiseServiceCreator, registerListenEventListener, watchMultiDecorator, -} from '../../kibana_legacy/public'; -import { DiscoverStartPlugins } from './plugin'; -import { getScopedHistory } from './kibana_services'; -import { createDiscoverDirective } from './application/components/create_discover_directive'; +} from '../../../../kibana_legacy/public'; +import { DiscoverStartPlugins } from '../../plugin'; +import { getScopedHistory } from '../../kibana_services'; +import { createDiscoverDirective } from './create_discover_directive'; /** * returns the main inner angular module, it contains all the parts of Angular Discover diff --git a/src/plugins/discover/public/application/angular/helpers/index.ts b/src/plugins/discover/public/application/angular/helpers/index.ts index 1dd194436cdfb0..3d2c0b1c63b332 100644 --- a/src/plugins/discover/public/application/angular/helpers/index.ts +++ b/src/plugins/discover/public/application/angular/helpers/index.ts @@ -6,6 +6,5 @@ * Side Public License, v 1. */ -export { buildPointSeriesData } from './point_series'; export { formatRow, formatTopLevelObject } from './row_formatter'; export { handleSourceColumnState } from './state_helpers'; diff --git a/src/plugins/discover/public/application/angular/index.ts b/src/plugins/discover/public/application/angular/index.ts index b45357439a1eeb..e75add7910b745 100644 --- a/src/plugins/discover/public/application/angular/index.ts +++ b/src/plugins/discover/public/application/angular/index.ts @@ -16,4 +16,3 @@ import './doc'; import './context'; import './doc_viewer'; import './redirect'; -import './directives'; diff --git a/src/plugins/discover/public/application/angular/response_handler.js b/src/plugins/discover/public/application/angular/response_handler.js deleted file mode 100644 index 301fd98f1e34c2..00000000000000 --- a/src/plugins/discover/public/application/angular/response_handler.js +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { getServices } from '../../kibana_services'; -import { buildPointSeriesData } from './helpers'; - -function tableResponseHandler(table, dimensions) { - const converted = { tables: [] }; - const split = dimensions.splitColumn || dimensions.splitRow; - - if (split) { - converted.direction = dimensions.splitRow ? 'row' : 'column'; - const splitColumnIndex = split[0].accessor; - const splitColumnFormatter = getServices().data.fieldFormats.deserialize(split[0].format); - const splitColumn = table.columns[splitColumnIndex]; - const splitMap = {}; - let splitIndex = 0; - - table.rows.forEach((row, rowIndex) => { - const splitValue = row[splitColumn.id]; - - if (!splitMap.hasOwnProperty(splitValue)) { - splitMap[splitValue] = splitIndex++; - const tableGroup = { - $parent: converted, - title: `${splitColumnFormatter.convert(splitValue)}: ${splitColumn.name}`, - name: splitColumn.name, - key: splitValue, - column: splitColumnIndex, - row: rowIndex, - table, - tables: [], - }; - tableGroup.tables.push({ - $parent: tableGroup, - columns: table.columns, - rows: [], - }); - - converted.tables.push(tableGroup); - } - - const tableIndex = splitMap[splitValue]; - converted.tables[tableIndex].tables[0].rows.push(row); - }); - } else { - converted.tables.push({ - columns: table.columns, - rows: table.rows, - }); - } - - return converted; -} - -function convertTableGroup(tableGroup, convertTable) { - const tables = tableGroup.tables; - - if (!tables.length) return; - - const firstChild = tables[0]; - if (firstChild.columns) { - const chart = convertTable(firstChild); - // if chart is within a split, assign group title to its label - if (tableGroup.$parent) { - chart.label = tableGroup.title; - } - return chart; - } - - const out = {}; - let outList; - - tables.forEach(function (table) { - if (!outList) { - const direction = tableGroup.direction === 'row' ? 'rows' : 'columns'; - outList = out[direction] = []; - } - - let output; - if ((output = convertTableGroup(table, convertTable))) { - outList.push(output); - } - }); - - return out; -} - -export const discoverResponseHandler = (response, dimensions) => { - const tableGroup = tableResponseHandler(response, dimensions); - - let converted = convertTableGroup(tableGroup, (table) => { - return buildPointSeriesData(table, dimensions); - }); - if (!converted) { - // mimic a row of tables that doesn't have any tables - // https://github.com/elastic/kibana/blob/7bfb68cd24ed42b1b257682f93c50cd8d73e2520/src/kibana/components/vislib/components/zero_injection/inject_zeros.js#L32 - converted = { rows: [] }; - } - - converted.hits = response.rows.length; - - return converted; -}; diff --git a/src/plugins/discover/public/application/apps/main/components/chart/discover_chart.tsx b/src/plugins/discover/public/application/apps/main/components/chart/discover_chart.tsx new file mode 100644 index 00000000000000..210313aac53662 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/components/chart/discover_chart.tsx @@ -0,0 +1,145 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import React, { useCallback } from 'react'; +import moment from 'moment'; +import { EuiFlexGroup, EuiFlexItem, EuiButtonEmpty, EuiSpacer } from '@elastic/eui'; +import { IUiSettingsClient } from 'kibana/public'; +import { i18n } from '@kbn/i18n'; +import { HitsCounter } from '../hits_counter'; +import { DataPublicPluginStart, IndexPattern, search } from '../../../../../../../data/public'; +import { TimechartHeader } from '../timechart_header'; +import { SavedSearch } from '../../../../../saved_searches'; +import { AppState, GetStateReturn } from '../../services/discover_state'; +import { TimechartBucketInterval } from '../timechart_header/timechart_header'; +import { Chart as IChart } from './point_series'; +import { DiscoverHistogram } from './histogram'; + +const TimechartHeaderMemoized = React.memo(TimechartHeader); +const DiscoverHistogramMemoized = React.memo(DiscoverHistogram); +export function DiscoverChart({ + config, + data, + bucketInterval, + chartData, + hits, + isLegacy, + resetQuery, + savedSearch, + state, + stateContainer, + timefield, +}: { + config: IUiSettingsClient; + data: DataPublicPluginStart; + bucketInterval?: TimechartBucketInterval; + chartData?: IChart; + hits?: number; + indexPattern: IndexPattern; + isLegacy: boolean; + resetQuery: () => void; + savedSearch: SavedSearch; + state: AppState; + stateContainer: GetStateReturn; + timefield?: string; +}) { + const toggleHideChart = useCallback(() => { + stateContainer.setAppState({ hideChart: !state.hideChart }); + }, [state, stateContainer]); + + const onChangeInterval = useCallback( + (interval: string) => { + if (interval) { + stateContainer.setAppState({ interval }); + } + }, + [stateContainer] + ); + + const timefilterUpdateHandler = useCallback( + (ranges: { from: number; to: number }) => { + data.query.timefilter.timefilter.setTime({ + from: moment(ranges.from).toISOString(), + to: moment(ranges.to).toISOString(), + mode: 'absolute', + }); + }, + [data] + ); + + return ( + + + + + + + {!state.hideChart && ( + + + + )} + {timefield && ( + + { + toggleHideChart(); + }} + data-test-subj="discoverChartToggle" + > + {!state.hideChart + ? i18n.translate('discover.hideChart', { + defaultMessage: 'Hide chart', + }) + : i18n.translate('discover.showChart', { + defaultMessage: 'Show chart', + })} + + + )} + + + {!state.hideChart && chartData && ( + +
+
+ +
+
+ +
+ )} +
+ ); +} diff --git a/src/plugins/discover/public/application/angular/directives/histogram.tsx b/src/plugins/discover/public/application/apps/main/components/chart/histogram.tsx similarity index 97% rename from src/plugins/discover/public/application/angular/directives/histogram.tsx rename to src/plugins/discover/public/application/apps/main/components/chart/histogram.tsx index 616a0692dbba42..92b212d5739b52 100644 --- a/src/plugins/discover/public/application/angular/directives/histogram.tsx +++ b/src/plugins/discover/public/application/apps/main/components/chart/histogram.tsx @@ -27,14 +27,14 @@ import { import { IUiSettingsClient } from 'kibana/public'; import { EuiChartThemeType } from '@elastic/eui/dist/eui_charts_theme'; import { Subscription, combineLatest } from 'rxjs'; -import { getServices } from '../../../kibana_services'; -import { Chart as IChart } from '../helpers/point_series'; +import { getServices } from '../../../../../kibana_services'; +import { Chart as IChart } from './point_series'; import { CurrentTime, Endzones, getAdjustedInterval, renderEndzoneTooltip, -} from '../../../../../charts/public'; +} from '../../../../../../../charts/public'; export interface DiscoverHistogramProps { chartData: IChart; diff --git a/src/plugins/discover/public/application/apps/main/components/chart/index.ts b/src/plugins/discover/public/application/apps/main/components/chart/index.ts new file mode 100644 index 00000000000000..d5d5a85d1d0f2c --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/components/chart/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { DiscoverChart } from './discover_chart'; diff --git a/src/plugins/discover/public/application/angular/helpers/point_series.ts b/src/plugins/discover/public/application/apps/main/components/chart/point_series.ts similarity index 90% rename from src/plugins/discover/public/application/angular/helpers/point_series.ts rename to src/plugins/discover/public/application/apps/main/components/chart/point_series.ts index dae70d9b8e55ba..1245b712e6fd7b 100644 --- a/src/plugins/discover/public/application/angular/helpers/point_series.ts +++ b/src/plugins/discover/public/application/apps/main/components/chart/point_series.ts @@ -9,8 +9,7 @@ import { uniq } from 'lodash'; import { Duration, Moment } from 'moment'; import { Unit } from '@elastic/datemath'; - -import { SerializedFieldFormat } from '../../../../../expressions/common/types'; +import { SerializedFieldFormat } from '../../../../../../../expressions/common'; export interface Column { id: string; @@ -26,20 +25,23 @@ export interface Table { rows: Row[]; } +export interface HistogramParamsBounds { + min: Moment; + max: Moment; +} + interface HistogramParams { date: true; interval: Duration; intervalESValue: number; intervalESUnit: Unit; format: string; - bounds: { - min: Moment; - max: Moment; - }; + bounds: HistogramParamsBounds; } export interface Dimension { accessor: 0 | 1; format: SerializedFieldFormat<{ pattern: string }>; + label: string; } export interface Dimensions { @@ -68,7 +70,7 @@ export interface Chart { ordered: Ordered; } -export const buildPointSeriesData = (table: Table, dimensions: Dimensions) => { +export const buildPointSeriesData = (table: Table, dimensions: Dimensions): Chart => { const { x, y } = dimensions; const xAccessor = table.columns[x.accessor].id; const yAccessor = table.columns[y.accessor].id; diff --git a/src/plugins/discover/public/application/components/hits_counter/hits_counter.scss b/src/plugins/discover/public/application/apps/main/components/hits_counter/hits_counter.scss similarity index 100% rename from src/plugins/discover/public/application/components/hits_counter/hits_counter.scss rename to src/plugins/discover/public/application/apps/main/components/hits_counter/hits_counter.scss diff --git a/src/plugins/discover/public/application/components/hits_counter/hits_counter.test.tsx b/src/plugins/discover/public/application/apps/main/components/hits_counter/hits_counter.test.tsx similarity index 100% rename from src/plugins/discover/public/application/components/hits_counter/hits_counter.test.tsx rename to src/plugins/discover/public/application/apps/main/components/hits_counter/hits_counter.test.tsx diff --git a/src/plugins/discover/public/application/components/hits_counter/hits_counter.tsx b/src/plugins/discover/public/application/apps/main/components/hits_counter/hits_counter.tsx similarity index 94% rename from src/plugins/discover/public/application/components/hits_counter/hits_counter.tsx rename to src/plugins/discover/public/application/apps/main/components/hits_counter/hits_counter.tsx index 6ce6129f56b5e9..0850a8ff03d967 100644 --- a/src/plugins/discover/public/application/components/hits_counter/hits_counter.tsx +++ b/src/plugins/discover/public/application/apps/main/components/hits_counter/hits_counter.tsx @@ -12,13 +12,13 @@ import React from 'react'; import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; -import { formatNumWithCommas } from '../../helpers'; +import { formatNumWithCommas } from '../../../../helpers'; export interface HitsCounterProps { /** * the number of query hits */ - hits: number; + hits?: number; /** * displays the reset button */ @@ -30,6 +30,9 @@ export interface HitsCounterProps { } export function HitsCounter({ hits, showResetButton, onResetQuery }: HitsCounterProps) { + if (typeof hits === 'undefined') { + return null; + } return ( rect { + fill-opacity: .5; + stroke-width: 1; + } +} + +.dscHistogram { + display: flex; + height: $euiSize * 12.5; + padding: $euiSizeS; +} + +// new slimmer layout for data grid +.dscHistogramGrid { + display: flex; + height: $euiSize * 8; + padding: $euiSizeS $euiSizeS 0 $euiSizeS; +} + +.dscTable { + // SASSTODO: add a monospace modifier to the doc-table component + .kbnDocTable__row { + font-family: $euiCodeFontFamily; + font-size: $euiFontSizeXS; + } +} + +.dscTable__footer { + background-color: $euiColorLightShade; + padding: $euiSizeXS $euiSizeS; + text-align: center; +} diff --git a/src/plugins/discover/public/application/apps/main/components/layout/discover_layout.test.tsx b/src/plugins/discover/public/application/apps/main/components/layout/discover_layout.test.tsx new file mode 100644 index 00000000000000..2fd394d98281b7 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/components/layout/discover_layout.test.tsx @@ -0,0 +1,76 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { Subject, BehaviorSubject } from 'rxjs'; +import { mountWithIntl } from '@kbn/test/jest'; +import { setHeaderActionMenuMounter } from '../../../../../kibana_services'; +import { DiscoverLayout } from './discover_layout'; +import { esHits } from '../../../../../__mocks__/es_hits'; +import { indexPatternMock } from '../../../../../__mocks__/index_pattern'; +import { savedSearchMock } from '../../../../../__mocks__/saved_search'; +import { createSearchSourceMock } from '../../../../../../../data/common/search/search_source/mocks'; +import { IndexPattern, IndexPatternAttributes } from '../../../../../../../data/common'; +import { SavedObject } from '../../../../../../../../core/types'; +import { indexPatternWithTimefieldMock } from '../../../../../__mocks__/index_pattern_with_timefield'; +import { DiscoverSearchSessionManager } from '../../services/discover_search_session'; +import { GetStateReturn } from '../../services/discover_state'; +import { DiscoverLayoutProps } from './types'; +import { SavedSearchDataSubject } from '../../services/use_saved_search'; +import { discoverServiceMock } from '../../../../../__mocks__/services'; +import { FetchStatus } from '../../../../types'; + +setHeaderActionMenuMounter(jest.fn()); + +function getProps(indexPattern: IndexPattern): DiscoverLayoutProps { + const searchSourceMock = createSearchSourceMock({}); + const services = discoverServiceMock; + services.data.query.timefilter.timefilter.getTime = () => { + return { from: '2020-05-14T11:05:13.590', to: '2020-05-14T11:20:13.590' }; + }; + + const indexPatternList = ([indexPattern].map((ip) => { + return { ...ip, ...{ attributes: { title: ip.title } } }; + }) as unknown) as Array>; + + const savedSearch$ = new BehaviorSubject({ + state: FetchStatus.COMPLETE, + rows: esHits, + fetchCounter: 1, + fieldCounts: {}, + hits: Number(esHits.length), + }) as SavedSearchDataSubject; + + return { + indexPattern, + indexPatternList, + navigateTo: jest.fn(), + resetQuery: jest.fn(), + savedSearch: savedSearchMock, + savedSearchData$: savedSearch$, + savedSearchRefetch$: new Subject(), + searchSessionManager: {} as DiscoverSearchSessionManager, + searchSource: searchSourceMock, + services, + state: { columns: [] }, + stateContainer: {} as GetStateReturn, + }; +} + +describe('Discover component', () => { + test('selected index pattern without time field displays no chart toggle', () => { + const component = mountWithIntl(); + expect(component.find('[data-test-subj="discoverChartToggle"]').exists()).toBeFalsy(); + }); + test('selected index pattern with time field displays chart toggle', () => { + const component = mountWithIntl( + + ); + expect(component.find('[data-test-subj="discoverChartToggle"]').exists()).toBeTruthy(); + }); +}); diff --git a/src/plugins/discover/public/application/apps/main/components/layout/discover_layout.tsx b/src/plugins/discover/public/application/apps/main/components/layout/discover_layout.tsx new file mode 100644 index 00000000000000..0430614d413b6b --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/components/layout/discover_layout.tsx @@ -0,0 +1,461 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import './discover_layout.scss'; +import React, { useState, useRef, useMemo, useCallback, useEffect } from 'react'; +import { + EuiSpacer, + EuiButtonIcon, + EuiFlexGroup, + EuiFlexItem, + EuiHideFor, + EuiHorizontalRule, + EuiPage, + EuiPageBody, + EuiPageContent, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { METRIC_TYPE } from '@kbn/analytics'; +import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; +import classNames from 'classnames'; +import { DiscoverNoResults } from '../no_results'; +import { LoadingSpinner } from '../loading_spinner/loading_spinner'; +import { DocTableLegacy } from '../../../../angular/doc_table/create_doc_table_react'; +import { + esFilters, + IndexPatternField, + indexPatterns as indexPatternsUtils, +} from '../../../../../../../data/public'; +import { DiscoverSidebarResponsive } from '../sidebar'; +import { DiscoverLayoutProps } from './types'; +import { SortPairArr } from '../../../../angular/doc_table/lib/get_sort'; +import { + DOC_HIDE_TIME_COLUMN_SETTING, + DOC_TABLE_LEGACY, + MODIFY_COLUMNS_ON_SWITCH, + SAMPLE_SIZE_SETTING, + SEARCH_FIELDS_FROM_SOURCE, + SORT_DEFAULT_ORDER_SETTING, +} from '../../../../../../common'; +import { popularizeField } from '../../../../helpers/popularize_field'; +import { DocViewFilterFn } from '../../../../doc_views/doc_views_types'; +import { DiscoverGrid } from '../../../../components/discover_grid/discover_grid'; +import { DiscoverTopNav } from '../top_nav/discover_topnav'; +import { ElasticSearchHit } from '../../../../doc_views/doc_views_types'; +import { DiscoverChart } from '../chart'; +import { getResultState } from '../../utils/get_result_state'; +import { InspectorSession } from '../../../../../../../inspector/public'; +import { DiscoverUninitialized } from '../uninitialized/uninitialized'; +import { SavedSearchDataMessage } from '../../services/use_saved_search'; +import { useDataGridColumns } from '../../../../helpers/use_data_grid_columns'; +import { getSwitchIndexPatternAppState } from '../../utils/get_switch_index_pattern_app_state'; +import { FetchStatus } from '../../../../types'; + +const DocTableLegacyMemoized = React.memo(DocTableLegacy); +const SidebarMemoized = React.memo(DiscoverSidebarResponsive); +const DataGridMemoized = React.memo(DiscoverGrid); +const TopNavMemoized = React.memo(DiscoverTopNav); +const DiscoverChartMemoized = React.memo(DiscoverChart); + +interface DiscoverLayoutFetchState extends SavedSearchDataMessage { + state: FetchStatus; + fetchCounter: number; + fieldCounts: Record; + rows: ElasticSearchHit[]; +} + +export function DiscoverLayout({ + indexPattern, + indexPatternList, + navigateTo, + savedSearchRefetch$, + resetQuery, + savedSearchData$, + savedSearch, + searchSessionManager, + searchSource, + services, + state, + stateContainer, +}: DiscoverLayoutProps) { + const { + trackUiMetric, + capabilities, + indexPatterns, + data, + uiSettings: config, + filterManager, + } = services; + + const sampleSize = useMemo(() => config.get(SAMPLE_SIZE_SETTING), [config]); + const [expandedDoc, setExpandedDoc] = useState(undefined); + const [inspectorSession, setInspectorSession] = useState(undefined); + const scrollableDesktop = useRef(null); + const collapseIcon = useRef(null); + + const [fetchState, setFetchState] = useState({ + state: savedSearchData$.getValue().state, + fetchCounter: 0, + fieldCounts: {}, + rows: [], + }); + const { state: fetchStatus, fetchCounter, inspectorAdapters, rows } = fetchState; + + useEffect(() => { + const subscription = savedSearchData$.subscribe((next) => { + if ( + (next.state && next.state !== fetchState.state) || + (next.fetchCounter && next.fetchCounter !== fetchState.fetchCounter) || + (next.rows && next.rows !== fetchState.rows) || + (next.chartData && next.chartData !== fetchState.chartData) + ) { + setFetchState({ ...fetchState, ...next }); + } + }); + return () => { + subscription.unsubscribe(); + }; + }, [savedSearchData$, fetchState]); + + const isMobile = () => { + // collapse icon isn't displayed in mobile view, use it to detect which view is displayed + return collapseIcon && !collapseIcon.current; + }; + const timeField = useMemo(() => { + return indexPatternsUtils.isDefault(indexPattern) ? indexPattern.timeFieldName : undefined; + }, [indexPattern]); + + const [isSidebarClosed, setIsSidebarClosed] = useState(false); + const isLegacy = useMemo(() => services.uiSettings.get(DOC_TABLE_LEGACY), [services]); + const useNewFieldsApi = useMemo(() => !services.uiSettings.get(SEARCH_FIELDS_FROM_SOURCE), [ + services, + ]); + + const unmappedFieldsConfig = useMemo( + () => ({ + showUnmappedFields: useNewFieldsApi, + }), + [useNewFieldsApi] + ); + + const resultState = useMemo(() => getResultState(fetchStatus, rows!), [fetchStatus, rows]); + + const updateQuery = useCallback( + (_payload, isUpdate?: boolean) => { + if (isUpdate === false) { + searchSessionManager.removeSearchSessionIdFromURL({ replace: false }); + savedSearchRefetch$.next(); + } + }, + [savedSearchRefetch$, searchSessionManager] + ); + + const { columns, onAddColumn, onRemoveColumn, onMoveColumn, onSetColumns } = useDataGridColumns({ + capabilities, + config, + indexPattern, + indexPatterns, + setAppState: stateContainer.setAppState, + state, + useNewFieldsApi, + }); + + const onOpenInspector = useCallback(() => { + // prevent overlapping + if (inspectorAdapters) { + setExpandedDoc(undefined); + const session = services.inspector.open(inspectorAdapters, { + title: savedSearch.title, + }); + setInspectorSession(session); + } + }, [setExpandedDoc, inspectorAdapters, savedSearch, services.inspector]); + + useEffect(() => { + return () => { + if (inspectorSession) { + // Close the inspector if this scope is destroyed (e.g. because the user navigates away). + inspectorSession.close(); + } + }; + }, [inspectorSession]); + + const onSort = useCallback( + (sort: string[][]) => { + stateContainer.setAppState({ sort }); + }, + [stateContainer] + ); + + const onAddFilter = useCallback( + (field: IndexPatternField | string, values: string, operation: '+' | '-') => { + const fieldName = typeof field === 'string' ? field : field.name; + popularizeField(indexPattern, fieldName, indexPatterns); + const newFilters = esFilters.generateFilters( + filterManager, + field, + values, + operation, + String(indexPattern.id) + ); + if (trackUiMetric) { + trackUiMetric(METRIC_TYPE.CLICK, 'filter_added'); + } + return filterManager.addFilters(newFilters); + }, + [filterManager, indexPattern, indexPatterns, trackUiMetric] + ); + /** + * Legacy function, remove once legacy grid is removed + */ + const onBackToTop = useCallback(() => { + if (scrollableDesktop && scrollableDesktop.current) { + scrollableDesktop.current.focus(); + } + // Only the desktop one needs to target a specific container + if (!isMobile() && scrollableDesktop.current) { + scrollableDesktop.current.scrollTo(0, 0); + } else if (window) { + window.scrollTo(0, 0); + } + }, [scrollableDesktop]); + + const onResize = useCallback( + (colSettings: { columnId: string; width: number }) => { + const grid = { ...state.grid } || {}; + const newColumns = { ...grid.columns } || {}; + newColumns[colSettings.columnId] = { + width: colSettings.width, + }; + const newGrid = { ...grid, columns: newColumns }; + stateContainer.setAppState({ grid: newGrid }); + }, + [stateContainer, state] + ); + + const onEditRuntimeField = useCallback(() => { + savedSearchRefetch$.next('reset'); + }, [savedSearchRefetch$]); + + const contentCentered = resultState === 'uninitialized'; + const showTimeCol = useMemo( + () => !config.get(DOC_HIDE_TIME_COLUMN_SETTING, false) && !!indexPattern.timeFieldName, + [config, indexPattern.timeFieldName] + ); + + const onChangeIndexPattern = useCallback( + async (id: string) => { + const nextIndexPattern = await indexPatterns.get(id); + if (nextIndexPattern && indexPattern) { + /** + * Without resetting the fetch state, e.g. a time column would be displayed when switching + * from a index pattern without to a index pattern with time filter for a brief moment + * That's because appState is updated before savedSearchData$ + * The following line of code catches this, but should be improved + */ + savedSearchData$.next({ rows: [], state: FetchStatus.LOADING, fieldCounts: {} }); + + const nextAppState = getSwitchIndexPatternAppState( + indexPattern, + nextIndexPattern, + state.columns || [], + (state.sort || []) as SortPairArr[], + config.get(MODIFY_COLUMNS_ON_SWITCH), + config.get(SORT_DEFAULT_ORDER_SETTING) + ); + stateContainer.setAppState(nextAppState); + } + }, + [ + config, + indexPattern, + indexPatterns, + savedSearchData$, + state.columns, + state.sort, + stateContainer, + ] + ); + + return ( + + + + +

+ {savedSearch.title} +

+ + + + + + +
+ + setIsSidebarClosed(!isSidebarClosed)} + data-test-subj="collapseSideBarButton" + aria-controls="discover-sidebar" + aria-expanded={isSidebarClosed ? 'false' : 'true'} + aria-label={i18n.translate('discover.toggleSidebarAriaLabel', { + defaultMessage: 'Toggle sidebar', + })} + buttonRef={collapseIcon} + /> +
+
+
+ + + {resultState === 'none' && ( + + )} + {resultState === 'uninitialized' && ( + savedSearchRefetch$.next()} /> + )} + {resultState === 'loading' && } + {resultState === 'ready' && ( + + + + + + + +
+

+ +

+ {isLegacy && rows && rows.length && ( + + )} + {!isLegacy && rows && rows.length && ( +
+ +
+ )} +
+
+
+ )} +
+
+
+
+
+
+ ); +} diff --git a/src/plugins/discover/public/application/apps/main/components/layout/index.ts b/src/plugins/discover/public/application/apps/main/components/layout/index.ts new file mode 100644 index 00000000000000..592e893cf8ba84 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/components/layout/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { DiscoverLayout } from './discover_layout'; diff --git a/src/plugins/discover/public/application/apps/main/components/layout/types.ts b/src/plugins/discover/public/application/apps/main/components/layout/types.ts new file mode 100644 index 00000000000000..d8d6338fbe41a3 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/components/layout/types.ts @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { + IndexPattern, + IndexPatternAttributes, + SavedObject, +} from '../../../../../../../data/common'; +import { ISearchSource } from '../../../../../../../data/public'; +import { DiscoverSearchSessionManager } from '../../services/discover_search_session'; +import { AppState, GetStateReturn } from '../../services/discover_state'; +import { SavedSearchRefetchSubject, SavedSearchDataSubject } from '../../services/use_saved_search'; +import { DiscoverServices } from '../../../../../build_services'; +import { SavedSearch } from '../../../../../saved_searches'; + +export interface DiscoverLayoutProps { + indexPattern: IndexPattern; + indexPatternList: Array>; + resetQuery: () => void; + navigateTo: (url: string) => void; + savedSearch: SavedSearch; + savedSearchData$: SavedSearchDataSubject; + savedSearchRefetch$: SavedSearchRefetchSubject; + searchSessionManager: DiscoverSearchSessionManager; + searchSource: ISearchSource; + services: DiscoverServices; + state: AppState; + stateContainer: GetStateReturn; +} diff --git a/src/plugins/discover/public/application/components/loading_spinner/loading_spinner.scss b/src/plugins/discover/public/application/apps/main/components/loading_spinner/loading_spinner.scss similarity index 100% rename from src/plugins/discover/public/application/components/loading_spinner/loading_spinner.scss rename to src/plugins/discover/public/application/apps/main/components/loading_spinner/loading_spinner.scss diff --git a/src/plugins/discover/public/application/components/loading_spinner/loading_spinner.test.tsx b/src/plugins/discover/public/application/apps/main/components/loading_spinner/loading_spinner.test.tsx similarity index 100% rename from src/plugins/discover/public/application/components/loading_spinner/loading_spinner.test.tsx rename to src/plugins/discover/public/application/apps/main/components/loading_spinner/loading_spinner.test.tsx diff --git a/src/plugins/discover/public/application/components/loading_spinner/loading_spinner.tsx b/src/plugins/discover/public/application/apps/main/components/loading_spinner/loading_spinner.tsx similarity index 100% rename from src/plugins/discover/public/application/components/loading_spinner/loading_spinner.tsx rename to src/plugins/discover/public/application/apps/main/components/loading_spinner/loading_spinner.tsx diff --git a/src/plugins/discover/public/application/components/no_results/_no_results.scss b/src/plugins/discover/public/application/apps/main/components/no_results/_no_results.scss similarity index 100% rename from src/plugins/discover/public/application/components/no_results/_no_results.scss rename to src/plugins/discover/public/application/apps/main/components/no_results/_no_results.scss diff --git a/src/plugins/discover/public/application/components/no_results/index.ts b/src/plugins/discover/public/application/apps/main/components/no_results/index.ts similarity index 100% rename from src/plugins/discover/public/application/components/no_results/index.ts rename to src/plugins/discover/public/application/apps/main/components/no_results/index.ts diff --git a/src/plugins/discover/public/application/components/no_results/no_results.test.tsx b/src/plugins/discover/public/application/apps/main/components/no_results/no_results.test.tsx similarity index 98% rename from src/plugins/discover/public/application/components/no_results/no_results.test.tsx rename to src/plugins/discover/public/application/apps/main/components/no_results/no_results.test.tsx index 9a115fb5a66b62..e7af82cf9504c7 100644 --- a/src/plugins/discover/public/application/components/no_results/no_results.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/no_results/no_results.test.tsx @@ -12,7 +12,7 @@ import { findTestSubject } from '@elastic/eui/lib/test'; import { DiscoverNoResults, DiscoverNoResultsProps } from './no_results'; -jest.mock('../../../kibana_services', () => { +jest.mock('../../../../../kibana_services', () => { return { getServices: () => ({ docLinks: { diff --git a/src/plugins/discover/public/application/components/no_results/no_results.tsx b/src/plugins/discover/public/application/apps/main/components/no_results/no_results.tsx similarity index 94% rename from src/plugins/discover/public/application/components/no_results/no_results.tsx rename to src/plugins/discover/public/application/apps/main/components/no_results/no_results.tsx index c23de80ec99373..07deb45d1fda24 100644 --- a/src/plugins/discover/public/application/components/no_results/no_results.tsx +++ b/src/plugins/discover/public/application/apps/main/components/no_results/no_results.tsx @@ -9,8 +9,8 @@ import React, { Fragment } from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; import { EuiButton, EuiCallOut, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { getServices } from '../../../kibana_services'; -import { DataPublicPluginStart } from '../../../../../data/public'; +import { getServices } from '../../../../../kibana_services'; +import { DataPublicPluginStart } from '../../../../../../../data/public'; import { getLuceneQueryMessage, getTimeFieldMessage } from './no_results_helper'; import './_no_results.scss'; diff --git a/src/plugins/discover/public/application/components/no_results/no_results_helper.tsx b/src/plugins/discover/public/application/apps/main/components/no_results/no_results_helper.tsx similarity index 100% rename from src/plugins/discover/public/application/components/no_results/no_results_helper.tsx rename to src/plugins/discover/public/application/apps/main/components/no_results/no_results_helper.tsx diff --git a/src/plugins/discover/public/application/components/sidebar/__snapshots__/discover_field_details_footer.test.tsx.snap b/src/plugins/discover/public/application/apps/main/components/sidebar/__snapshots__/discover_field_details_footer.test.tsx.snap similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/__snapshots__/discover_field_details_footer.test.tsx.snap rename to src/plugins/discover/public/application/apps/main/components/sidebar/__snapshots__/discover_field_details_footer.test.tsx.snap diff --git a/src/plugins/discover/public/application/components/sidebar/__snapshots__/discover_index_pattern.test.tsx.snap b/src/plugins/discover/public/application/apps/main/components/sidebar/__snapshots__/discover_index_pattern.test.tsx.snap similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/__snapshots__/discover_index_pattern.test.tsx.snap rename to src/plugins/discover/public/application/apps/main/components/sidebar/__snapshots__/discover_index_pattern.test.tsx.snap diff --git a/src/plugins/discover/public/application/components/sidebar/__snapshots__/discover_index_pattern_management.test.tsx.snap b/src/plugins/discover/public/application/apps/main/components/sidebar/__snapshots__/discover_index_pattern_management.test.tsx.snap similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/__snapshots__/discover_index_pattern_management.test.tsx.snap rename to src/plugins/discover/public/application/apps/main/components/sidebar/__snapshots__/discover_index_pattern_management.test.tsx.snap diff --git a/src/plugins/discover/public/application/components/sidebar/change_indexpattern.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/change_indexpattern.tsx similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/change_indexpattern.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/change_indexpattern.tsx diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field.scss b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.scss similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/discover_field.scss rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.scss diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field.test.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.test.tsx similarity index 91% rename from src/plugins/discover/public/application/components/sidebar/discover_field.test.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.test.tsx index 2041a8dfdc6379..82e37dd2b427cb 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_field.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.test.tsx @@ -8,15 +8,16 @@ import React from 'react'; import { findTestSubject } from '@elastic/eui/lib/test'; -// @ts-expect-error -import stubbedLogstashFields from '../../../__fixtures__/logstash_fields'; import { mountWithIntl } from '@kbn/test/jest'; + +// @ts-expect-error +import stubbedLogstashFields from '../../../../../__fixtures__/logstash_fields'; import { DiscoverField } from './discover_field'; -import { coreMock } from '../../../../../../core/public/mocks'; -import { IndexPatternField } from '../../../../../data/public'; -import { getStubIndexPattern } from '../../../../../data/public/test_utils'; +import { coreMock } from '../../../../../../../../core/public/mocks'; +import { IndexPatternField } from '../../../../../../../data/public'; +import { getStubIndexPattern } from '../../../../../../../data/public/test_utils'; -jest.mock('../../../kibana_services', () => ({ +jest.mock('../../../../../kibana_services', () => ({ getServices: () => ({ history: () => ({ location: { diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx similarity index 99% rename from src/plugins/discover/public/application/components/sidebar/discover_field.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx index a53809cfa2c7ef..e60dabd1d8d8c7 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_field.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx @@ -23,9 +23,9 @@ import { i18n } from '@kbn/i18n'; import { UiCounterMetricType } from '@kbn/analytics'; import classNames from 'classnames'; import { DiscoverFieldDetails } from './discover_field_details'; -import { FieldIcon, FieldButton } from '../../../../../kibana_react/public'; +import { FieldIcon, FieldButton } from '../../../../../../../kibana_react/public'; import { FieldDetails } from './types'; -import { IndexPatternField, IndexPattern } from '../../../../../data/public'; +import { IndexPatternField, IndexPattern } from '../../../../../../../data/public'; import { getFieldTypeName } from './lib/get_field_type_name'; import { DiscoverFieldDetailsFooter } from './discover_field_details_footer'; diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_bucket.scss b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_bucket.scss similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/discover_field_bucket.scss rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_bucket.scss diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_bucket.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_bucket.tsx similarity index 98% rename from src/plugins/discover/public/application/components/sidebar/discover_field_bucket.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_bucket.tsx index e433c3419e24af..7dab8cecf28a96 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_field_bucket.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_bucket.tsx @@ -11,7 +11,7 @@ import { EuiText, EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@e import { i18n } from '@kbn/i18n'; import { StringFieldProgressBar } from './string_progress_bar'; import { Bucket } from './types'; -import { IndexPatternField } from '../../../../../data/public'; +import { IndexPatternField } from '../../../../../../../data/public'; import './discover_field_bucket.scss'; interface Props { diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_details.scss b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.scss similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/discover_field_details.scss rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.scss diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_details.test.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.test.tsx similarity index 88% rename from src/plugins/discover/public/application/components/sidebar/discover_field_details.test.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.test.tsx index f82154af33d1ea..a798abb60b833a 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_field_details.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.test.tsx @@ -8,13 +8,13 @@ import React from 'react'; import { findTestSubject } from '@elastic/eui/lib/test'; -// @ts-expect-error -import stubbedLogstashFields from '../../../__fixtures__/logstash_fields'; import { mountWithIntl } from '@kbn/test/jest'; +// @ts-expect-error +import stubbedLogstashFields from '../../../../../__fixtures__/logstash_fields'; import { DiscoverFieldDetails } from './discover_field_details'; -import { coreMock } from '../../../../../../core/public/mocks'; -import { IndexPatternField } from '../../../../../data/public'; -import { getStubIndexPattern } from '../../../../../data/public/test_utils'; +import { coreMock } from '../../../../../../../../core/public/mocks'; +import { IndexPatternField } from '../../../../../../../data/public'; +import { getStubIndexPattern } from '../../../../../../../data/public/test_utils'; const indexPattern = getStubIndexPattern( 'logstash-*', diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_details.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.tsx similarity index 99% rename from src/plugins/discover/public/application/components/sidebar/discover_field_details.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.tsx index e2ffb79551aab2..d7008ba3e310f3 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_field_details.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.tsx @@ -18,7 +18,7 @@ import { getVisualizeHref, } from './lib/visualize_trigger_utils'; import { Bucket, FieldDetails } from './types'; -import { IndexPatternField, IndexPattern } from '../../../../../data/public'; +import { IndexPatternField, IndexPattern } from '../../../../../../../data/public'; import './discover_field_details.scss'; import { DiscoverFieldDetailsFooter } from './discover_field_details_footer'; diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_details_footer.test.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details_footer.test.tsx similarity index 87% rename from src/plugins/discover/public/application/components/sidebar/discover_field_details_footer.test.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details_footer.test.tsx index 73e906cb62f5fc..aa93b2a6637362 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_field_details_footer.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details_footer.test.tsx @@ -8,12 +8,12 @@ import React from 'react'; import { findTestSubject } from '@elastic/eui/lib/test'; -// @ts-expect-error -import stubbedLogstashFields from '../../../__fixtures__/logstash_fields'; import { mountWithIntl } from '@kbn/test/jest'; -import { coreMock } from '../../../../../../core/public/mocks'; -import { IndexPatternField } from '../../../../../data/public'; -import { getStubIndexPattern } from '../../../../../data/public/test_utils'; +// @ts-expect-error +import stubbedLogstashFields from '../../../../../__fixtures__/logstash_fields'; +import { coreMock } from '../../../../../../../../core/public/mocks'; +import { IndexPatternField } from '../../../../../../../data/public'; +import { getStubIndexPattern } from '../../../../../../../data/public/test_utils'; import { DiscoverFieldDetailsFooter } from './discover_field_details_footer'; const indexPattern = getStubIndexPattern( diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_details_footer.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details_footer.tsx similarity index 91% rename from src/plugins/discover/public/application/components/sidebar/discover_field_details_footer.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details_footer.tsx index bea302087938ab..148dfc67c3e416 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_field_details_footer.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details_footer.tsx @@ -9,8 +9,8 @@ import React from 'react'; import { EuiLink, EuiPopoverFooter, EuiText } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; -import { IndexPatternField } from '../../../../../data/common/index_patterns/fields'; -import { IndexPattern } from '../../../../../data/common/index_patterns/index_patterns'; +import { IndexPatternField } from '../../../../../../../data/common/index_patterns/fields'; +import { IndexPattern } from '../../../../../../../data/common/index_patterns/index_patterns'; import { FieldDetails } from './types'; interface DiscoverFieldDetailsFooterProps { diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_search.scss b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_search.scss similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/discover_field_search.scss rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_search.scss diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_search.test.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_search.test.tsx similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/discover_field_search.test.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_search.test.tsx diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_search.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_search.tsx similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/discover_field_search.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_search.tsx diff --git a/src/plugins/discover/public/application/components/sidebar/discover_index_pattern.test.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.test.tsx similarity index 89% rename from src/plugins/discover/public/application/components/sidebar/discover_index_pattern.test.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.test.tsx index f6d577de564ade..45d6faa9606e10 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_index_pattern.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.test.tsx @@ -15,8 +15,7 @@ import { SavedObject } from 'kibana/server'; import { DiscoverIndexPattern, DiscoverIndexPatternProps } from './discover_index_pattern'; import { EuiSelectable } from '@elastic/eui'; import { IndexPattern, IndexPatternAttributes } from 'src/plugins/data/public'; -import { configMock } from '../../../__mocks__/config'; -import { indexPatternsMock } from '../../../__mocks__/index_patterns'; +import { indexPatternsMock } from '../../../../../__mocks__/index_patterns'; const indexPattern = { id: 'the-index-pattern-id-first', @@ -38,13 +37,11 @@ const indexPattern2 = { } as SavedObject; const defaultProps = { - config: configMock, indexPatternList: [indexPattern1, indexPattern2], selectedIndexPattern: indexPattern, - state: {}, - setAppState: jest.fn(), useNewFieldsApi: true, indexPatterns: indexPatternsMock, + onChangeIndexPattern: jest.fn(), }; function getIndexPatternPickerList(instance: ShallowWrapper) { @@ -72,7 +69,7 @@ describe('DiscoverIndexPattern', () => { const props = ({ indexPatternList: null, selectedIndexPattern: null, - setIndexPattern: jest.fn(), + onChangeIndexPattern: jest.fn(), } as unknown) as DiscoverIndexPatternProps; expect(shallow()).toMatchSnapshot(`""`); @@ -92,10 +89,6 @@ describe('DiscoverIndexPattern', () => { await act(async () => { selectIndexPatternPickerOption(instance, 'test2 title'); }); - expect(defaultProps.setAppState).toHaveBeenCalledWith({ - index: 'the-index-pattern-id', - columns: [], - sort: [], - }); + expect(defaultProps.onChangeIndexPattern).toHaveBeenCalledWith('the-index-pattern-id'); }); }); diff --git a/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx new file mode 100644 index 00000000000000..356c86dded97a9 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx @@ -0,0 +1,77 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { useState, useEffect } from 'react'; +import { I18nProvider } from '@kbn/i18n/react'; +import { SavedObject } from 'kibana/public'; +import { IndexPattern, IndexPatternAttributes } from 'src/plugins/data/public'; + +import { IndexPatternRef } from './types'; +import { ChangeIndexPattern } from './change_indexpattern'; +export interface DiscoverIndexPatternProps { + /** + * list of available index patterns, if length > 1, component offers a "change" link + */ + indexPatternList: Array>; + /** + * Callback function when changing an index pattern + */ + onChangeIndexPattern: (id: string) => void; + /** + * currently selected index pattern, due to angular issues it's undefined at first rendering + */ + selectedIndexPattern: IndexPattern; +} + +/** + * Component allows you to select an index pattern in discovers side bar + */ +export function DiscoverIndexPattern({ + indexPatternList, + onChangeIndexPattern, + selectedIndexPattern, +}: DiscoverIndexPatternProps) { + const options: IndexPatternRef[] = (indexPatternList || []).map((entity) => ({ + id: entity.id, + title: entity.attributes!.title, + })); + const { id: selectedId, title: selectedTitle } = selectedIndexPattern || {}; + + const [selected, setSelected] = useState({ + id: selectedId, + title: selectedTitle || '', + }); + useEffect(() => { + const { id, title } = selectedIndexPattern; + setSelected({ id, title }); + }, [selectedIndexPattern]); + if (!selectedId) { + return null; + } + + return ( + + { + const indexPattern = options.find((pattern) => pattern.id === id); + if (indexPattern) { + onChangeIndexPattern(id); + setSelected(indexPattern); + } + }} + /> + + ); +} diff --git a/src/plugins/discover/public/application/components/sidebar/discover_index_pattern_management.test.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern_management.test.tsx similarity index 90% rename from src/plugins/discover/public/application/components/sidebar/discover_index_pattern_management.test.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern_management.test.tsx index 6f9ff63d69782f..d81ecb79a42211 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_index_pattern_management.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern_management.test.tsx @@ -6,16 +6,16 @@ * Side Public License, v 1. */ -import { getStubIndexPattern } from '../../../../../data/public/index_patterns/index_pattern.stub'; -import { coreMock } from '../../../../../../core/public/mocks'; -import { DiscoverServices } from '../../../build_services'; -// @ts-expect-error -import stubbedLogstashFields from '../../../__fixtures__/logstash_fields'; -import { mountWithIntl } from '@kbn/test/jest'; import React from 'react'; -import { DiscoverIndexPatternManagement } from './discover_index_pattern_management'; +import { mountWithIntl } from '@kbn/test/jest'; import { EuiContextMenuPanel, EuiPopover, EuiContextMenuItem } from '@elastic/eui'; import { findTestSubject } from '@kbn/test/jest'; +import { getStubIndexPattern } from '../../../../../../../data/public/index_patterns/index_pattern.stub'; +import { coreMock } from '../../../../../../../../core/public/mocks'; +import { DiscoverServices } from '../../../../../build_services'; +// @ts-expect-error +import stubbedLogstashFields from '../../../../../__fixtures__/logstash_fields'; +import { DiscoverIndexPatternManagement } from './discover_index_pattern_management'; const mockServices = ({ history: () => ({ diff --git a/src/plugins/discover/public/application/components/sidebar/discover_index_pattern_management.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern_management.tsx similarity index 95% rename from src/plugins/discover/public/application/components/sidebar/discover_index_pattern_management.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern_management.tsx index 9a9dfd579b96d5..125172f47b7c42 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_index_pattern_management.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern_management.tsx @@ -9,8 +9,8 @@ import React, { useState } from 'react'; import { EuiButtonIcon, EuiContextMenuItem, EuiContextMenuPanel, EuiPopover } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { DiscoverServices } from '../../../build_services'; -import { IndexPattern } from '../../../../../data/common/index_patterns/index_patterns'; +import { DiscoverServices } from '../../../../../build_services'; +import { IndexPattern } from '../../../../../../../data/common/index_patterns/index_patterns'; export interface DiscoverIndexPatternManagementProps { /** diff --git a/src/plugins/discover/public/application/components/sidebar/discover_sidebar.scss b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.scss similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/discover_sidebar.scss rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.scss diff --git a/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.test.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.test.tsx new file mode 100644 index 00000000000000..304ab05516f92a --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.test.tsx @@ -0,0 +1,108 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { each, cloneDeep } from 'lodash'; +import { ReactWrapper } from 'enzyme'; +import { findTestSubject } from '@elastic/eui/lib/test'; +// @ts-expect-error +import realHits from '../../../../../__fixtures__/real_hits.js'; +// @ts-expect-error +import stubbedLogstashFields from '../../../../../__fixtures__/logstash_fields'; +import { mountWithIntl } from '@kbn/test/jest'; +import React from 'react'; +import { DiscoverSidebarProps } from './discover_sidebar'; +import { coreMock } from '../../../../../../../../core/public/mocks'; +import { IndexPatternAttributes } from '../../../../../../../data/common'; +import { getStubIndexPattern } from '../../../../../../../data/public/test_utils'; +import { SavedObject } from '../../../../../../../../core/types'; +import { getDefaultFieldFilter } from './lib/field_filter'; +import { DiscoverSidebar } from './discover_sidebar'; +import { ElasticSearchHit } from '../../../../doc_views/doc_views_types'; +import { discoverServiceMock as mockDiscoverServices } from '../../../../../__mocks__/services'; + +jest.mock('../../../../../kibana_services', () => ({ + getServices: () => mockDiscoverServices, +})); + +jest.mock('./lib/get_index_pattern_field_list', () => ({ + getIndexPatternFieldList: jest.fn((indexPattern) => indexPattern.fields), +})); + +function getCompProps(): DiscoverSidebarProps { + const indexPattern = getStubIndexPattern( + 'logstash-*', + (cfg: unknown) => cfg, + 'time', + stubbedLogstashFields(), + coreMock.createSetup() + ); + + // @ts-expect-error _.each() is passing additional args to flattenHit + const hits = (each(cloneDeep(realHits), indexPattern.flattenHit) as Array< + Record + >) as ElasticSearchHit[]; + + const indexPatternList = [ + { id: '0', attributes: { title: 'b' } } as SavedObject, + { id: '1', attributes: { title: 'a' } } as SavedObject, + { id: '2', attributes: { title: 'c' } } as SavedObject, + ]; + + const fieldCounts: Record = {}; + + for (const hit of hits) { + for (const key of Object.keys(indexPattern.flattenHit(hit))) { + fieldCounts[key] = (fieldCounts[key] || 0) + 1; + } + } + return { + columns: ['extension'], + fieldCounts, + hits, + indexPatternList, + onChangeIndexPattern: jest.fn(), + onAddFilter: jest.fn(), + onAddField: jest.fn(), + onRemoveField: jest.fn(), + selectedIndexPattern: indexPattern, + services: mockDiscoverServices, + state: {}, + trackUiMetric: jest.fn(), + fieldFilter: getDefaultFieldFilter(), + setFieldFilter: jest.fn(), + onEditRuntimeField: jest.fn(), + editField: jest.fn(), + }; +} + +describe('discover sidebar', function () { + let props: DiscoverSidebarProps; + let comp: ReactWrapper; + + beforeAll(() => { + props = getCompProps(); + comp = mountWithIntl(); + }); + + it('should have Selected Fields and Available Fields with Popular Fields sections', function () { + const popular = findTestSubject(comp, 'fieldList-popular'); + const selected = findTestSubject(comp, 'fieldList-selected'); + const unpopular = findTestSubject(comp, 'fieldList-unpopular'); + expect(popular.children().length).toBe(1); + expect(unpopular.children().length).toBe(7); + expect(selected.children().length).toBe(1); + }); + it('should allow selecting fields', function () { + findTestSubject(comp, 'fieldToggle-bytes').simulate('click'); + expect(props.onAddField).toHaveBeenCalledWith('bytes'); + }); + it('should allow deselecting fields', function () { + findTestSubject(comp, 'fieldToggle-extension').simulate('click'); + expect(props.onRemoveField).toHaveBeenCalledWith('extension'); + }); +}); diff --git a/src/plugins/discover/public/application/components/sidebar/discover_sidebar.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx similarity index 97% rename from src/plugins/discover/public/application/components/sidebar/discover_sidebar.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx index aaaf72f7706305..0bebec61657b4a 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_sidebar.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx @@ -27,9 +27,9 @@ import { FormattedMessage } from '@kbn/i18n/react'; import { DiscoverField } from './discover_field'; import { DiscoverIndexPattern } from './discover_index_pattern'; import { DiscoverFieldSearch } from './discover_field_search'; -import { FIELDS_LIMIT_SETTING } from '../../../../common'; +import { FIELDS_LIMIT_SETTING } from '../../../../../../common'; import { groupFields } from './lib/group_fields'; -import { IndexPatternField } from '../../../../../data/public'; +import { IndexPatternField } from '../../../../../../../data/public'; import { getDetails } from './lib/get_details'; import { FieldFilterState, getDefaultFieldFilter, setFieldFilterProp } from './lib/field_filter'; import { getIndexPatternFieldList } from './lib/get_index_pattern_field_list'; @@ -68,30 +68,28 @@ export interface DiscoverSidebarProps extends DiscoverSidebarResponsiveProps { export function DiscoverSidebar({ alwaysShowActionButtons = false, columns, - config, fieldCounts, fieldFilter, hits, indexPatternList, - indexPatterns, onAddField, onAddFilter, onRemoveField, selectedIndexPattern, services, - setAppState, setFieldFilter, - state, trackUiMetric, useNewFieldsApi = false, useFlyout = false, unmappedFieldsConfig, onEditRuntimeField, + onChangeIndexPattern, setFieldEditorRef, closeFlyout, editField, }: DiscoverSidebarProps) { const [fields, setFields] = useState(null); + const { indexPatternFieldEditor } = services; const indexPatternFieldEditPermission = indexPatternFieldEditor?.userPermissions.editIndexPattern(); const canEditIndexPatternField = !!indexPatternFieldEditPermission && useNewFieldsApi; @@ -282,12 +280,9 @@ export function DiscoverSidebar({ o.attributes.title)} - indexPatterns={indexPatterns} - state={state} - setAppState={setAppState} + onChangeIndexPattern={onChangeIndexPattern} /> @@ -323,12 +318,9 @@ export function DiscoverSidebar({ o.attributes.title)} - indexPatterns={indexPatterns} - state={state} - setAppState={setAppState} + onChangeIndexPattern={onChangeIndexPattern} /> diff --git a/src/plugins/discover/public/application/components/sidebar/discover_sidebar_responsive.test.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.test.tsx similarity index 84% rename from src/plugins/discover/public/application/components/sidebar/discover_sidebar_responsive.test.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.test.tsx index caa0e436f40910..2ad75806173eb0 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_sidebar_responsive.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.test.tsx @@ -10,23 +10,21 @@ import { each, cloneDeep } from 'lodash'; import { ReactWrapper } from 'enzyme'; import { findTestSubject } from '@elastic/eui/lib/test'; // @ts-expect-error -import realHits from '../../../__fixtures__/real_hits.js'; +import realHits from '../../../../../__fixtures__/real_hits.js'; // @ts-expect-error -import stubbedLogstashFields from '../../../__fixtures__/logstash_fields'; +import stubbedLogstashFields from '../../../../../__fixtures__/logstash_fields'; import { mountWithIntl } from '@kbn/test/jest'; import React from 'react'; -import { coreMock } from '../../../../../../core/public/mocks'; -import { IndexPatternAttributes } from '../../../../../data/common'; -import { getStubIndexPattern } from '../../../../../data/public/test_utils'; -import { SavedObject } from '../../../../../../core/types'; +import { coreMock } from '../../../../../../../../core/public/mocks'; +import { IndexPatternAttributes } from '../../../../../../../data/common'; +import { getStubIndexPattern } from '../../../../../../../data/public/test_utils'; +import { SavedObject } from '../../../../../../../../core/types'; import { DiscoverSidebarResponsive, DiscoverSidebarResponsiveProps, } from './discover_sidebar_responsive'; -import { DiscoverServices } from '../../../build_services'; -import { ElasticSearchHit } from '../../doc_views/doc_views_types'; -import { configMock } from '../../../__mocks__/config'; -import { indexPatternsMock } from '../../../__mocks__/index_patterns'; +import { DiscoverServices } from '../../../../../build_services'; +import { ElasticSearchHit } from '../../../../doc_views/doc_views_types'; import { DiscoverSidebar } from './discover_sidebar'; const mockServices = ({ @@ -52,7 +50,7 @@ const mockServices = ({ }, } as unknown) as DiscoverServices; -jest.mock('../../../kibana_services', () => ({ +jest.mock('../../../../../kibana_services', () => ({ getServices: () => mockServices, })); @@ -89,17 +87,15 @@ function getCompProps(): DiscoverSidebarResponsiveProps { } return { columns: ['extension'], - config: configMock, fieldCounts, hits, indexPatternList, - indexPatterns: indexPatternsMock, + onChangeIndexPattern: jest.fn(), onAddFilter: jest.fn(), onAddField: jest.fn(), onRemoveField: jest.fn(), selectedIndexPattern: indexPattern, services: mockServices, - setAppState: jest.fn(), state: {}, trackUiMetric: jest.fn(), onEditRuntimeField: jest.fn(), diff --git a/src/plugins/discover/public/application/components/sidebar/discover_sidebar_responsive.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx similarity index 91% rename from src/plugins/discover/public/application/components/sidebar/discover_sidebar_responsive.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx index 6b8918e2d99656..cc33601f77728f 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_sidebar_responsive.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx @@ -11,7 +11,6 @@ import { sortBy } from 'lodash'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { UiCounterMetricType } from '@kbn/analytics'; -import { IUiSettingsClient } from 'kibana/public'; import { EuiTitle, EuiHideFor, @@ -28,14 +27,14 @@ import { EuiFlexItem, } from '@elastic/eui'; import { DiscoverIndexPattern } from './discover_index_pattern'; -import { IndexPatternAttributes, IndexPatternsContract } from '../../../../../data/common'; -import { SavedObject } from '../../../../../../core/types'; -import { IndexPatternField, IndexPattern } from '../../../../../data/public'; +import { IndexPatternAttributes } from '../../../../../../../data/common'; +import { SavedObject } from '../../../../../../../../core/types'; +import { IndexPatternField, IndexPattern } from '../../../../../../../data/public'; import { getDefaultFieldFilter } from './lib/field_filter'; import { DiscoverSidebar } from './discover_sidebar'; -import { DiscoverServices } from '../../../build_services'; -import { ElasticSearchHit } from '../../doc_views/doc_views_types'; -import { AppState } from '../../angular/discover_state'; +import { DiscoverServices } from '../../../../../build_services'; +import { ElasticSearchHit } from '../../../../doc_views/doc_views_types'; +import { AppState } from '../../services/discover_state'; import { DiscoverIndexPatternManagement } from './discover_index_pattern_management'; export interface DiscoverSidebarResponsiveProps { @@ -47,10 +46,6 @@ export interface DiscoverSidebarResponsiveProps { * the selected columns displayed in the doc table in discover */ columns: string[]; - /** - * Client of uiSettings - */ - config: IUiSettingsClient; /** * a statistics of the distribution of fields in the given hits */ @@ -63,10 +58,6 @@ export interface DiscoverSidebarResponsiveProps { * List of available index patterns */ indexPatternList: Array>; - /** - * Index patterns service - */ - indexPatterns: IndexPatternsContract; /** * Has been toggled closed */ @@ -79,6 +70,10 @@ export interface DiscoverSidebarResponsiveProps { * Callback function when adding a filter from sidebar */ onAddFilter: (field: IndexPatternField | string, value: string, type: '+' | '-') => void; + /** + * Callback function when changing an index pattern + */ + onChangeIndexPattern: (id: string) => void; /** * Callback function when removing a field * @param fieldName @@ -92,10 +87,6 @@ export interface DiscoverSidebarResponsiveProps { * Discover plugin services; */ services: DiscoverServices; - /** - * Function to set the current state - */ - setAppState: (state: Partial) => void; /** * Discover App state */ @@ -114,7 +105,6 @@ export interface DiscoverSidebarResponsiveProps { * Read from the Fields API */ useNewFieldsApi?: boolean; - /** * an object containing properties for proper handling of unmapped fields */ @@ -215,12 +205,9 @@ export function DiscoverSidebarResponsive(props: DiscoverSidebarResponsiveProps) o.attributes.title)} - indexPatterns={props.indexPatterns} - state={props.state} - setAppState={props.setAppState} /> diff --git a/src/plugins/discover/public/application/components/sidebar/index.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/index.ts similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/index.ts rename to src/plugins/discover/public/application/apps/main/components/sidebar/index.ts diff --git a/src/plugins/discover/public/application/components/sidebar/lib/field_calculator.js b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_calculator.js similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/lib/field_calculator.js rename to src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_calculator.js diff --git a/src/plugins/discover/public/application/components/sidebar/lib/field_calculator.test.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_calculator.test.ts similarity index 94% rename from src/plugins/discover/public/application/components/sidebar/lib/field_calculator.test.ts rename to src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_calculator.test.ts index 2cdd99774c2a8a..501f18116dc6f7 100644 --- a/src/plugins/discover/public/application/components/sidebar/lib/field_calculator.test.ts +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_calculator.test.ts @@ -10,12 +10,12 @@ import _ from 'lodash'; // @ts-expect-error -import realHits from '../../../../__fixtures__/real_hits.js'; +import realHits from '../../../../../../__fixtures__/real_hits.js'; // @ts-expect-error -import stubbedLogstashFields from '../../../../__fixtures__/logstash_fields'; -import { coreMock } from '../../../../../../../core/public/mocks'; -import { IndexPattern } from '../../../../../../data/public'; -import { getStubIndexPattern } from '../../../../../../data/public/test_utils'; +import stubbedLogstashFields from '../../../../../../__fixtures__/logstash_fields'; +import { coreMock } from '../../../../../../../../../core/public/mocks'; +import { IndexPattern } from '../../../../../../../../data/public'; +import { getStubIndexPattern } from '../../../../../../../../data/public/test_utils'; // @ts-expect-error import { fieldCalculator } from './field_calculator'; diff --git a/src/plugins/discover/public/application/components/sidebar/lib/field_filter.test.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.test.ts similarity index 97% rename from src/plugins/discover/public/application/components/sidebar/lib/field_filter.test.ts rename to src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.test.ts index 04217c07f66381..8d7c543157ead7 100644 --- a/src/plugins/discover/public/application/components/sidebar/lib/field_filter.test.ts +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.test.ts @@ -7,7 +7,7 @@ */ import { getDefaultFieldFilter, setFieldFilterProp, isFieldFiltered } from './field_filter'; -import { IndexPatternField } from '../../../../../../data/public'; +import { IndexPatternField } from '../../../../../../../../data/public'; describe('field_filter', function () { it('getDefaultFieldFilter should return default filter state', function () { diff --git a/src/plugins/discover/public/application/components/sidebar/lib/field_filter.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.ts similarity index 96% rename from src/plugins/discover/public/application/components/sidebar/lib/field_filter.ts rename to src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.ts index 8c7e48f173031d..25a8309d3d9634 100644 --- a/src/plugins/discover/public/application/components/sidebar/lib/field_filter.ts +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { IndexPatternField } from '../../../../../../data/public'; +import { IndexPatternField } from '../../../../../../../../data/public'; export interface FieldFilterState { missing: boolean; diff --git a/src/plugins/discover/public/application/components/sidebar/lib/get_details.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_details.ts similarity index 91% rename from src/plugins/discover/public/application/components/sidebar/lib/get_details.ts rename to src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_details.ts index 1e35717d249f8b..ab991f2cfb6563 100644 --- a/src/plugins/discover/public/application/components/sidebar/lib/get_details.ts +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_details.ts @@ -8,8 +8,8 @@ // @ts-expect-error import { fieldCalculator } from './field_calculator'; -import { IndexPattern, IndexPatternField } from '../../../../../../data/public'; -import { ElasticSearchHit } from '../../../doc_views/doc_views_types'; +import { IndexPattern, IndexPatternField } from '../../../../../../../../data/public'; +import { ElasticSearchHit } from '../../../../../doc_views/doc_views_types'; export function getDetails( field: IndexPatternField, diff --git a/src/plugins/discover/public/application/components/sidebar/lib/get_field_type_name.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_field_type_name.ts similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/lib/get_field_type_name.ts rename to src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_field_type_name.ts diff --git a/src/plugins/discover/public/application/components/sidebar/lib/get_index_pattern_field_list.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts similarity index 95% rename from src/plugins/discover/public/application/components/sidebar/lib/get_index_pattern_field_list.ts rename to src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts index 1586c2b26eefe0..8f2e18c64a5ebf 100644 --- a/src/plugins/discover/public/application/components/sidebar/lib/get_index_pattern_field_list.ts +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts @@ -8,7 +8,7 @@ import { difference } from 'lodash'; import { IndexPattern, IndexPatternField } from 'src/plugins/data/public'; -import { isNestedFieldParent } from '../../../helpers/nested_fields'; +import { isNestedFieldParent } from '../../../utils/nested_fields'; export function getIndexPatternFieldList( indexPattern?: IndexPattern, diff --git a/src/plugins/discover/public/application/components/sidebar/lib/get_warnings.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_warnings.ts similarity index 92% rename from src/plugins/discover/public/application/components/sidebar/lib/get_warnings.ts rename to src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_warnings.ts index 05634973fae8c5..60ce5351e2cd3a 100644 --- a/src/plugins/discover/public/application/components/sidebar/lib/get_warnings.ts +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_warnings.ts @@ -7,7 +7,7 @@ */ import { i18n } from '@kbn/i18n'; -import { IndexPatternField } from '../../../../../../data/public'; +import { IndexPatternField } from '../../../../../../../../data/public'; export function getWarnings(field: IndexPatternField) { let warnings = []; diff --git a/src/plugins/discover/public/application/components/sidebar/lib/group_fields.test.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts similarity index 98% rename from src/plugins/discover/public/application/components/sidebar/lib/group_fields.test.ts rename to src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts index e8eb07784cf9fc..58697206356214 100644 --- a/src/plugins/discover/public/application/components/sidebar/lib/group_fields.test.ts +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts @@ -8,7 +8,7 @@ import { groupFields } from './group_fields'; import { getDefaultFieldFilter } from './field_filter'; -import { IndexPatternField } from '../../../../../../data/common/index_patterns/fields'; +import { IndexPatternField } from '../../../../../../../../data/common/index_patterns/fields'; const fields = [ { diff --git a/src/plugins/discover/public/application/components/sidebar/lib/group_fields.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/lib/group_fields.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx diff --git a/src/plugins/discover/public/application/components/sidebar/lib/visualize_trigger_utils.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.ts similarity index 95% rename from src/plugins/discover/public/application/components/sidebar/lib/visualize_trigger_utils.ts rename to src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.ts index 1a6cc38a4259bd..2fabaa0ddd1003 100644 --- a/src/plugins/discover/public/application/components/sidebar/lib/visualize_trigger_utils.ts +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.ts @@ -11,9 +11,9 @@ import { VISUALIZE_GEO_FIELD_TRIGGER, visualizeFieldTrigger, visualizeGeoFieldTrigger, -} from '../../../../../../ui_actions/public'; -import { getUiActions } from '../../../../kibana_services'; -import { IndexPatternField, KBN_FIELD_TYPES } from '../../../../../../data/public'; +} from '../../../../../../../../ui_actions/public'; +import { getUiActions } from '../../../../../../kibana_services'; +import { IndexPatternField, KBN_FIELD_TYPES } from '../../../../../../../../data/public'; function getTriggerConstant(type: string) { return type === KBN_FIELD_TYPES.GEO_POINT || type === KBN_FIELD_TYPES.GEO_SHAPE diff --git a/src/plugins/discover/public/application/components/sidebar/string_progress_bar.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/string_progress_bar.tsx similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/string_progress_bar.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/string_progress_bar.tsx diff --git a/src/plugins/discover/public/application/components/sidebar/types.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/types.ts similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/types.ts rename to src/plugins/discover/public/application/apps/main/components/sidebar/types.ts diff --git a/src/plugins/discover/public/application/components/skip_bottom_button/index.ts b/src/plugins/discover/public/application/apps/main/components/skip_bottom_button/index.ts similarity index 100% rename from src/plugins/discover/public/application/components/skip_bottom_button/index.ts rename to src/plugins/discover/public/application/apps/main/components/skip_bottom_button/index.ts diff --git a/src/plugins/discover/public/application/components/skip_bottom_button/skip_bottom_button.test.tsx b/src/plugins/discover/public/application/apps/main/components/skip_bottom_button/skip_bottom_button.test.tsx similarity index 100% rename from src/plugins/discover/public/application/components/skip_bottom_button/skip_bottom_button.test.tsx rename to src/plugins/discover/public/application/apps/main/components/skip_bottom_button/skip_bottom_button.test.tsx diff --git a/src/plugins/discover/public/application/components/skip_bottom_button/skip_bottom_button.tsx b/src/plugins/discover/public/application/apps/main/components/skip_bottom_button/skip_bottom_button.tsx similarity index 100% rename from src/plugins/discover/public/application/components/skip_bottom_button/skip_bottom_button.tsx rename to src/plugins/discover/public/application/apps/main/components/skip_bottom_button/skip_bottom_button.tsx diff --git a/src/plugins/discover/public/application/components/timechart_header/index.ts b/src/plugins/discover/public/application/apps/main/components/timechart_header/index.ts similarity index 100% rename from src/plugins/discover/public/application/components/timechart_header/index.ts rename to src/plugins/discover/public/application/apps/main/components/timechart_header/index.ts diff --git a/src/plugins/discover/public/application/components/timechart_header/timechart_header.scss b/src/plugins/discover/public/application/apps/main/components/timechart_header/timechart_header.scss similarity index 100% rename from src/plugins/discover/public/application/components/timechart_header/timechart_header.scss rename to src/plugins/discover/public/application/apps/main/components/timechart_header/timechart_header.scss diff --git a/src/plugins/discover/public/application/components/timechart_header/timechart_header.test.tsx b/src/plugins/discover/public/application/apps/main/components/timechart_header/timechart_header.test.tsx similarity index 97% rename from src/plugins/discover/public/application/components/timechart_header/timechart_header.test.tsx rename to src/plugins/discover/public/application/apps/main/components/timechart_header/timechart_header.test.tsx index 0da1fdd92d2cce..a68dc9a3b3756c 100644 --- a/src/plugins/discover/public/application/components/timechart_header/timechart_header.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/timechart_header/timechart_header.test.tsx @@ -12,7 +12,7 @@ import { ReactWrapper } from 'enzyme'; import { TimechartHeader, TimechartHeaderProps } from './timechart_header'; import { EuiIconTip } from '@elastic/eui'; import { findTestSubject } from '@elastic/eui/lib/test'; -import { DataPublicPluginStart } from '../../../../../data/public'; +import { DataPublicPluginStart } from '../../../../../../../data/public'; describe('timechart header', function () { let props: TimechartHeaderProps; diff --git a/src/plugins/discover/public/application/components/timechart_header/timechart_header.tsx b/src/plugins/discover/public/application/apps/main/components/timechart_header/timechart_header.tsx similarity index 95% rename from src/plugins/discover/public/application/components/timechart_header/timechart_header.tsx rename to src/plugins/discover/public/application/apps/main/components/timechart_header/timechart_header.tsx index a2fc17e05a203e..ec94679ece6759 100644 --- a/src/plugins/discover/public/application/components/timechart_header/timechart_header.tsx +++ b/src/plugins/discover/public/application/apps/main/components/timechart_header/timechart_header.tsx @@ -18,8 +18,14 @@ import { import moment from 'moment'; import { i18n } from '@kbn/i18n'; import dateMath from '@elastic/datemath'; -import { DataPublicPluginStart } from '../../../../../data/public'; import './timechart_header.scss'; +import { DataPublicPluginStart } from '../../../../../../../data/public'; + +export interface TimechartBucketInterval { + scaled?: boolean; + description?: string; + scale?: number; +} export interface TimechartHeaderProps { /** @@ -29,11 +35,7 @@ export interface TimechartHeaderProps { /** * Interval for the buckets of the recent request */ - bucketInterval?: { - scaled?: boolean; - description?: string; - scale?: number; - }; + bucketInterval?: TimechartBucketInterval; data: DataPublicPluginStart; /** * Interval Options diff --git a/src/plugins/discover/public/application/components/top_nav/__snapshots__/open_search_panel.test.tsx.snap b/src/plugins/discover/public/application/apps/main/components/top_nav/__snapshots__/open_search_panel.test.tsx.snap similarity index 100% rename from src/plugins/discover/public/application/components/top_nav/__snapshots__/open_search_panel.test.tsx.snap rename to src/plugins/discover/public/application/apps/main/components/top_nav/__snapshots__/open_search_panel.test.tsx.snap diff --git a/src/plugins/discover/public/application/apps/main/components/top_nav/discover_topnav.test.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/discover_topnav.test.tsx new file mode 100644 index 00000000000000..687532cd94f083 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/discover_topnav.test.tsx @@ -0,0 +1,53 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { shallowWithIntl } from '@kbn/test/jest'; +import { indexPatternMock } from '../../../../../__mocks__/index_pattern'; +import { savedSearchMock } from '../../../../../__mocks__/saved_search'; +import { DiscoverTopNav, DiscoverTopNavProps } from './discover_topnav'; +import { TopNavMenuData } from '../../../../../../../navigation/public'; +import { ISearchSource, Query } from '../../../../../../../data/common'; +import { GetStateReturn } from '../../services/discover_state'; +import { setHeaderActionMenuMounter } from '../../../../../kibana_services'; +import { discoverServiceMock } from '../../../../../__mocks__/services'; + +setHeaderActionMenuMounter(jest.fn()); + +function getProps(savePermissions = true): DiscoverTopNavProps { + discoverServiceMock.capabilities.discover!.save = savePermissions; + + return { + stateContainer: {} as GetStateReturn, + indexPattern: indexPatternMock, + savedSearch: savedSearchMock, + navigateTo: jest.fn(), + services: discoverServiceMock, + query: {} as Query, + savedQuery: '', + updateQuery: jest.fn(), + onOpenInspector: jest.fn(), + searchSource: {} as ISearchSource, + }; +} + +describe('Discover topnav component', () => { + test('generated config of TopNavMenu config is correct when discover save permissions are assigned', () => { + const props = getProps(true); + const component = shallowWithIntl(); + const topMenuConfig = component.props().config.map((obj: TopNavMenuData) => obj.id); + expect(topMenuConfig).toEqual(['options', 'new', 'save', 'open', 'share', 'inspect']); + }); + + test('generated config of TopNavMenu config is correct when no discover save permissions are assigned', () => { + const props = getProps(false); + const component = shallowWithIntl(); + const topMenuConfig = component.props().config.map((obj: TopNavMenuData) => obj.id); + expect(topMenuConfig).toEqual(['options', 'new', 'open', 'share', 'inspect']); + }); +}); diff --git a/src/plugins/discover/public/application/apps/main/components/top_nav/discover_topnav.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/discover_topnav.tsx new file mode 100644 index 00000000000000..9afda734010845 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/discover_topnav.tsx @@ -0,0 +1,88 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import React, { useMemo } from 'react'; +import { DiscoverLayoutProps } from '../layout/types'; +import { getTopNavLinks } from './get_top_nav_links'; +import { Query, TimeRange } from '../../../../../../../data/common/query'; +import { getHeaderActionMenuMounter } from '../../../../../kibana_services'; +import { GetStateReturn } from '../../services/discover_state'; + +export type DiscoverTopNavProps = Pick< + DiscoverLayoutProps, + 'indexPattern' | 'navigateTo' | 'savedSearch' | 'services' | 'searchSource' +> & { + onOpenInspector: () => void; + query?: Query; + savedQuery?: string; + updateQuery: (payload: { dateRange: TimeRange; query?: Query }, isUpdate?: boolean) => void; + stateContainer: GetStateReturn; +}; + +export const DiscoverTopNav = ({ + indexPattern, + onOpenInspector, + query, + savedQuery, + stateContainer, + updateQuery, + searchSource, + navigateTo, + savedSearch, + services, +}: DiscoverTopNavProps) => { + const showDatePicker = useMemo(() => indexPattern.isTimeBased(), [indexPattern]); + const { TopNavMenu } = services.navigation.ui; + const topNavMenu = useMemo( + () => + getTopNavLinks({ + indexPattern, + navigateTo, + savedSearch, + services, + state: stateContainer, + onOpenInspector, + searchSource, + }), + [indexPattern, navigateTo, onOpenInspector, searchSource, stateContainer, savedSearch, services] + ); + + const updateSavedQueryId = (newSavedQueryId: string | undefined) => { + const { appStateContainer, setAppState } = stateContainer; + if (newSavedQueryId) { + setAppState({ savedQuery: newSavedQueryId }); + } else { + // remove savedQueryId from state + const newState = { + ...appStateContainer.getState(), + }; + delete newState.savedQuery; + appStateContainer.set(newState); + } + }; + const setMenuMountPoint = useMemo(() => { + return getHeaderActionMenuMounter(); + }, []); + + return ( + + ); +}; diff --git a/src/plugins/discover/public/application/components/top_nav/get_top_nav_links.test.ts b/src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.test.ts similarity index 87% rename from src/plugins/discover/public/application/components/top_nav/get_top_nav_links.test.ts rename to src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.test.ts index 2c50ce61c8afb7..6a6fb8a44a5cfe 100644 --- a/src/plugins/discover/public/application/components/top_nav/get_top_nav_links.test.ts +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.test.ts @@ -8,10 +8,10 @@ import { ISearchSource } from 'src/plugins/data/public'; import { getTopNavLinks } from './get_top_nav_links'; -import { indexPatternMock } from '../../../__mocks__/index_pattern'; -import { savedSearchMock } from '../../../__mocks__/saved_search'; -import { DiscoverServices } from '../../../build_services'; -import { GetStateReturn } from '../../angular/discover_state'; +import { indexPatternMock } from '../../../../../__mocks__/index_pattern'; +import { savedSearchMock } from '../../../../../__mocks__/saved_search'; +import { DiscoverServices } from '../../../../../build_services'; +import { GetStateReturn } from '../../services/discover_state'; const services = ({ capabilities: { @@ -28,7 +28,6 @@ const state = ({} as unknown) as GetStateReturn; test('getTopNavLinks result', () => { const topNavLinks = getTopNavLinks({ - getFieldCounts: jest.fn(), indexPattern: indexPatternMock, navigateTo: jest.fn(), onOpenInspector: jest.fn(), diff --git a/src/plugins/discover/public/application/components/top_nav/get_top_nav_links.ts b/src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.ts similarity index 90% rename from src/plugins/discover/public/application/components/top_nav/get_top_nav_links.ts rename to src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.ts index 38bc831225c682..f19b30cda5f8a3 100644 --- a/src/plugins/discover/public/application/components/top_nav/get_top_nav_links.ts +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.ts @@ -9,20 +9,19 @@ import { i18n } from '@kbn/i18n'; import moment from 'moment'; import { showOpenSearchPanel } from './show_open_search_panel'; -import { getSharingData, showPublicUrlSwitch } from '../../helpers/get_sharing_data'; -import { unhashUrl } from '../../../../../kibana_utils/public'; -import { DiscoverServices } from '../../../build_services'; -import { SavedSearch } from '../../../saved_searches'; +import { getSharingData, showPublicUrlSwitch } from '../../utils/get_sharing_data'; +import { unhashUrl } from '../../../../../../../kibana_utils/public'; +import { DiscoverServices } from '../../../../../build_services'; +import { SavedSearch } from '../../../../../saved_searches'; import { onSaveSearch } from './on_save_search'; -import { GetStateReturn } from '../../angular/discover_state'; -import { IndexPattern, ISearchSource } from '../../../kibana_services'; +import { GetStateReturn } from '../../services/discover_state'; +import { IndexPattern, ISearchSource } from '../../../../../kibana_services'; import { openOptionsPopover } from './open_options_popover'; /** * Helper function to build the top nav links */ export const getTopNavLinks = ({ - getFieldCounts, indexPattern, navigateTo, savedSearch, @@ -31,7 +30,6 @@ export const getTopNavLinks = ({ onOpenInspector, searchSource, }: { - getFieldCounts: () => Promise>; indexPattern: IndexPattern; navigateTo: (url: string) => void; savedSearch: SavedSearch; diff --git a/src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.test.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.test.tsx new file mode 100644 index 00000000000000..e5f44a0fbf2149 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.test.tsx @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { showSaveModal } from '../../../../../../../saved_objects/public'; +jest.mock('../../../../../../../saved_objects/public'); + +import { onSaveSearch } from './on_save_search'; +import { indexPatternMock } from '../../../../../__mocks__/index_pattern'; +import { savedSearchMock } from '../../../../../__mocks__/saved_search'; +import { DiscoverServices } from '../../../../../build_services'; +import { GetStateReturn } from '../../services/discover_state'; +import { i18nServiceMock } from '../../../../../../../../core/public/mocks'; + +test('onSaveSearch', async () => { + const serviceMock = ({ + core: { + i18n: i18nServiceMock.create(), + }, + } as unknown) as DiscoverServices; + const stateMock = ({} as unknown) as GetStateReturn; + + await onSaveSearch({ + indexPattern: indexPatternMock, + navigateTo: jest.fn(), + savedSearch: savedSearchMock, + services: serviceMock, + state: stateMock, + }); + + expect(showSaveModal).toHaveBeenCalled(); +}); diff --git a/src/plugins/discover/public/application/components/top_nav/on_save_search.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx similarity index 89% rename from src/plugins/discover/public/application/components/top_nav/on_save_search.tsx rename to src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx index a0271acec22cfb..f4b969e977254b 100644 --- a/src/plugins/discover/public/application/components/top_nav/on_save_search.tsx +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx @@ -8,13 +8,13 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { SavedObjectSaveModal, showSaveModal } from '../../../../../saved_objects/public'; -import { SavedSearch } from '../../../saved_searches'; -import { IndexPattern } from '../../../../../data/common/index_patterns/index_patterns'; -import { DiscoverServices } from '../../../build_services'; -import { GetStateReturn } from '../../angular/discover_state'; -import { setBreadcrumbsTitle } from '../../helpers/breadcrumbs'; -import { persistSavedSearch } from '../../helpers/persist_saved_search'; +import { SavedObjectSaveModal, showSaveModal } from '../../../../../../../saved_objects/public'; +import { SavedSearch } from '../../../../../saved_searches'; +import { IndexPattern } from '../../../../../../../data/common/index_patterns/index_patterns'; +import { DiscoverServices } from '../../../../../build_services'; +import { GetStateReturn } from '../../services/discover_state'; +import { setBreadcrumbsTitle } from '../../../../helpers/breadcrumbs'; +import { persistSavedSearch } from '../../utils/persist_saved_search'; async function saveDataSource({ indexPattern, diff --git a/src/plugins/discover/public/application/components/top_nav/open_options_popover.scss b/src/plugins/discover/public/application/apps/main/components/top_nav/open_options_popover.scss similarity index 100% rename from src/plugins/discover/public/application/components/top_nav/open_options_popover.scss rename to src/plugins/discover/public/application/apps/main/components/top_nav/open_options_popover.scss diff --git a/src/plugins/discover/public/application/components/top_nav/open_options_popover.test.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/open_options_popover.test.tsx similarity index 93% rename from src/plugins/discover/public/application/components/top_nav/open_options_popover.test.tsx rename to src/plugins/discover/public/application/apps/main/components/top_nav/open_options_popover.test.tsx index 5b3d1656d77e74..28e57aed7b6605 100644 --- a/src/plugins/discover/public/application/components/top_nav/open_options_popover.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/open_options_popover.test.tsx @@ -9,9 +9,9 @@ import React from 'react'; import { mountWithIntl } from '@kbn/test/jest'; import { findTestSubject } from '@elastic/eui/lib/test'; -import { getServices } from '../../../kibana_services'; +import { getServices } from '../../../../../kibana_services'; -jest.mock('../../../kibana_services', () => { +jest.mock('../../../../../kibana_services', () => { const mockUiSettings = new Map(); return { getServices: () => ({ diff --git a/src/plugins/discover/public/application/components/top_nav/open_options_popover.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/open_options_popover.tsx similarity index 77% rename from src/plugins/discover/public/application/components/top_nav/open_options_popover.tsx rename to src/plugins/discover/public/application/apps/main/components/top_nav/open_options_popover.tsx index 280144d400216a..6e90c702c2bfde 100644 --- a/src/plugins/discover/public/application/components/top_nav/open_options_popover.tsx +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/open_options_popover.tsx @@ -11,11 +11,21 @@ import ReactDOM from 'react-dom'; import { I18nStart } from 'kibana/public'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; -import { EuiSpacer, EuiButton, EuiText, EuiWrappingPopover, EuiCode } from '@elastic/eui'; -import { getServices } from '../../../kibana_services'; +import { + EuiSpacer, + EuiButton, + EuiText, + EuiWrappingPopover, + EuiCode, + EuiHorizontalRule, + EuiButtonEmpty, + EuiTextAlign, +} from '@elastic/eui'; import './open_options_popover.scss'; -import { DOC_TABLE_LEGACY } from '../../../../common'; +import { DOC_TABLE_LEGACY } from '../../../../../../common'; +import { getServices } from '../../../../../kibana_services'; +const container = document.createElement('div'); let isOpen = false; interface OptionsPopoverProps { @@ -77,11 +87,29 @@ export function OptionsPopover(props: OptionsPopoverProps) { defaultMessage: 'Get started', })} + + + + {i18n.translate('discover.openOptionsPopover.gotToAllSettings', { + defaultMessage: 'All Discover options', + })} + + ); } +function onClose() { + ReactDOM.unmountComponentAtNode(container); + document.body.removeChild(container); + isOpen = false; +} + export function openOptionsPopover({ I18nContext, anchorElement, @@ -90,17 +118,11 @@ export function openOptionsPopover({ anchorElement: HTMLElement; }) { if (isOpen) { + onClose(); return; } isOpen = true; - const container = document.createElement('div'); - const onClose = () => { - ReactDOM.unmountComponentAtNode(container); - document.body.removeChild(container); - isOpen = false; - }; - document.body.appendChild(container); const element = ( diff --git a/src/plugins/discover/public/application/components/top_nav/open_search_panel.test.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/open_search_panel.test.tsx similarity index 93% rename from src/plugins/discover/public/application/components/top_nav/open_search_panel.test.tsx rename to src/plugins/discover/public/application/apps/main/components/top_nav/open_search_panel.test.tsx index 856d8c5f712362..b34abab728eb19 100644 --- a/src/plugins/discover/public/application/components/top_nav/open_search_panel.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/open_search_panel.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { shallow } from 'enzyme'; -jest.mock('../../../kibana_services', () => { +jest.mock('../../../../../kibana_services', () => { return { getServices: () => ({ core: { uiSettings: {}, savedObjects: {} }, diff --git a/src/plugins/discover/public/application/components/top_nav/open_search_panel.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/open_search_panel.tsx similarity index 95% rename from src/plugins/discover/public/application/components/top_nav/open_search_panel.tsx rename to src/plugins/discover/public/application/apps/main/components/top_nav/open_search_panel.tsx index f6881d1856566a..e63f010a8dffc1 100644 --- a/src/plugins/discover/public/application/components/top_nav/open_search_panel.tsx +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/open_search_panel.tsx @@ -20,8 +20,8 @@ import { EuiFlyoutBody, EuiTitle, } from '@elastic/eui'; -import { SavedObjectFinderUi } from '../../../../../saved_objects/public'; -import { getServices } from '../../../kibana_services'; +import { SavedObjectFinderUi } from '../../../../../../../saved_objects/public'; +import { getServices } from '../../../../../kibana_services'; const SEARCH_OBJECT_TYPE = 'search'; diff --git a/src/plugins/discover/public/application/components/top_nav/show_open_search_panel.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/show_open_search_panel.tsx similarity index 100% rename from src/plugins/discover/public/application/components/top_nav/show_open_search_panel.tsx rename to src/plugins/discover/public/application/apps/main/components/top_nav/show_open_search_panel.tsx diff --git a/src/plugins/discover/public/application/angular/directives/uninitialized.tsx b/src/plugins/discover/public/application/apps/main/components/uninitialized/uninitialized.tsx similarity index 100% rename from src/plugins/discover/public/application/angular/directives/uninitialized.tsx rename to src/plugins/discover/public/application/apps/main/components/uninitialized/uninitialized.tsx diff --git a/src/plugins/discover/public/application/apps/main/discover_main_app.test.tsx b/src/plugins/discover/public/application/apps/main/discover_main_app.test.tsx new file mode 100644 index 00000000000000..0caa5f3f527c67 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/discover_main_app.test.tsx @@ -0,0 +1,46 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import React from 'react'; +import { mountWithIntl } from '@kbn/test/jest'; +import { indexPatternMock } from '../../../__mocks__/index_pattern'; +import { DiscoverMainApp } from './discover_main_app'; +import { discoverServiceMock } from '../../../__mocks__/services'; +import { savedSearchMock } from '../../../__mocks__/saved_search'; +import { createSearchSessionMock } from '../../../__mocks__/search_session'; +import { SavedObject } from '../../../../../../core/types'; +import { IndexPatternAttributes } from '../../../../../data/common'; +import { setHeaderActionMenuMounter } from '../../../kibana_services'; +import { findTestSubject } from '@elastic/eui/lib/test'; + +setHeaderActionMenuMounter(jest.fn()); + +describe('DiscoverMainApp', () => { + test('renders', () => { + const { history } = createSearchSessionMock(); + const indexPatternList = ([indexPatternMock].map((ip) => { + return { ...ip, ...{ attributes: { title: ip.title } } }; + }) as unknown) as Array>; + + const component = mountWithIntl( + + ); + + expect(findTestSubject(component, 'indexPattern-switch-link').text()).toBe( + indexPatternMock.title + ); + }); +}); diff --git a/src/plugins/discover/public/application/apps/main/discover_main_app.tsx b/src/plugins/discover/public/application/apps/main/discover_main_app.tsx new file mode 100644 index 00000000000000..5cc7147b49ff98 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/discover_main_app.tsx @@ -0,0 +1,145 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import React, { useMemo, useCallback, useEffect } from 'react'; +import { History } from 'history'; +import { DiscoverLayout } from './components/layout'; +import { SEARCH_FIELDS_FROM_SOURCE } from '../../../../common'; +import { useSavedSearch as useSavedSearchData } from './services/use_saved_search'; +import { setBreadcrumbsTitle } from '../../helpers/breadcrumbs'; +import { addHelpMenuToAppChrome } from '../../components/help_menu/help_menu_util'; +import { useDiscoverState } from './services/use_discover_state'; +import { useSearchSession } from './services/use_search_session'; +import { useUrl } from './services/use_url'; +import { IndexPattern, IndexPatternAttributes, SavedObject } from '../../../../../data/common'; +import { DiscoverServices } from '../../../build_services'; +import { SavedSearch } from '../../../saved_searches'; + +const DiscoverLayoutMemoized = React.memo(DiscoverLayout); + +export interface DiscoverMainProps { + /** + * Current IndexPattern + */ + indexPattern: IndexPattern; + + opts: { + /** + * Use angular router for navigation + */ + navigateTo: () => void; + /** + * Instance of browser history + */ + history: History; + /** + * List of available index patterns + */ + indexPatternList: Array>; + /** + * Kibana core services used by discover + */ + services: DiscoverServices; + /** + * Current instance of SavedSearch + */ + savedSearch: SavedSearch; + }; +} + +export function DiscoverMainApp(props: DiscoverMainProps) { + const { services, history, navigateTo, indexPatternList } = props.opts; + const { chrome, docLinks, uiSettings: config, data } = services; + + const useNewFieldsApi = useMemo(() => !config.get(SEARCH_FIELDS_FROM_SOURCE), [config]); + + /** + * State related logic + */ + const { + stateContainer, + state, + indexPattern, + searchSource, + savedSearch, + resetSavedSearch, + } = useDiscoverState({ + services, + history, + initialIndexPattern: props.indexPattern, + initialSavedSearch: props.opts.savedSearch, + }); + + /** + * Url / Routing logic + */ + useUrl({ history, resetSavedSearch }); + + /** + * Search session logic + */ + const searchSessionManager = useSearchSession({ services, history, stateContainer, savedSearch }); + + /** + * Data fetching logic + */ + const { data$, refetch$ } = useSavedSearchData({ + indexPattern, + savedSearch, + searchSessionManager, + searchSource, + services, + state, + stateContainer, + useNewFieldsApi, + }); + + /** + * SavedSearch depended initializing + */ + useEffect(() => { + const pageTitleSuffix = savedSearch.id && savedSearch.title ? `: ${savedSearch.title}` : ''; + chrome.docTitle.change(`Discover${pageTitleSuffix}`); + setBreadcrumbsTitle(savedSearch, chrome); + return () => { + data.search.session.clear(); + }; + }, [savedSearch, chrome, docLinks, refetch$, stateContainer, data, config]); + + /** + * Initializing syncing with state and help menu + */ + useEffect(() => { + addHelpMenuToAppChrome(chrome, docLinks); + stateContainer.replaceUrlAppState({}).then(() => { + stateContainer.startSync(); + }); + + return () => stateContainer.stopSync(); + }, [stateContainer, chrome, docLinks]); + + const resetQuery = useCallback(() => { + resetSavedSearch(savedSearch.id); + }, [resetSavedSearch, savedSearch]); + + return ( + + ); +} diff --git a/src/plugins/discover/public/application/apps/main/index.ts b/src/plugins/discover/public/application/apps/main/index.ts new file mode 100644 index 00000000000000..af30b0c9534346 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { DiscoverMainApp } from './discover_main_app'; diff --git a/src/plugins/discover/public/application/angular/discover_search_session.test.ts b/src/plugins/discover/public/application/apps/main/services/discover_search_session.test.ts similarity index 83% rename from src/plugins/discover/public/application/angular/discover_search_session.test.ts rename to src/plugins/discover/public/application/apps/main/services/discover_search_session.test.ts index 8e6fb11acb9633..97c6ada3636d5d 100644 --- a/src/plugins/discover/public/application/angular/discover_search_session.test.ts +++ b/src/plugins/discover/public/application/apps/main/services/discover_search_session.test.ts @@ -6,20 +6,10 @@ * Side Public License, v 1. */ -import { DiscoverSearchSessionManager } from './discover_search_session'; -import { createMemoryHistory } from 'history'; -import { dataPluginMock } from '../../../../data/public/mocks'; -import { DataPublicPluginStart } from '../../../../data/public'; +import { createSearchSessionMock } from '../../../../__mocks__/search_session'; describe('DiscoverSearchSessionManager', () => { - const history = createMemoryHistory(); - const session = dataPluginMock.createStartContract().search.session as jest.Mocked< - DataPublicPluginStart['search']['session'] - >; - const searchSessionManager = new DiscoverSearchSessionManager({ - history, - session, - }); + const { history, session, searchSessionManager } = createSearchSessionMock(); beforeEach(() => { history.push('/'); diff --git a/src/plugins/discover/public/application/angular/discover_search_session.ts b/src/plugins/discover/public/application/apps/main/services/discover_search_session.ts similarity index 93% rename from src/plugins/discover/public/application/angular/discover_search_session.ts rename to src/plugins/discover/public/application/apps/main/services/discover_search_session.ts index a3cdfa42c40dd2..81ab578229d198 100644 --- a/src/plugins/discover/public/application/angular/discover_search_session.ts +++ b/src/plugins/discover/public/application/apps/main/services/discover_search_session.ts @@ -8,13 +8,13 @@ import { History } from 'history'; import { filter } from 'rxjs/operators'; -import { DataPublicPluginStart } from '../../../../data/public'; +import { DataPublicPluginStart } from '../../../../../../data/public'; import { createQueryParamObservable, getQueryParams, removeQueryParam, -} from '../../../../kibana_utils/public'; -import { SEARCH_SESSION_ID_QUERY_PARAM } from '../../url_generator'; +} from '../../../../../../kibana_utils/public'; +import { SEARCH_SESSION_ID_QUERY_PARAM } from '../../../../url_generator'; export interface DiscoverSearchSessionManagerDeps { history: History; diff --git a/src/plugins/discover/public/application/angular/discover_state.test.ts b/src/plugins/discover/public/application/apps/main/services/discover_state.test.ts similarity index 97% rename from src/plugins/discover/public/application/angular/discover_state.test.ts rename to src/plugins/discover/public/application/apps/main/services/discover_state.test.ts index ddb4e874ccc64b..11f6954af97b0e 100644 --- a/src/plugins/discover/public/application/angular/discover_state.test.ts +++ b/src/plugins/discover/public/application/apps/main/services/discover_state.test.ts @@ -13,9 +13,9 @@ import { createSearchSessionRestorationDataProvider, } from './discover_state'; import { createBrowserHistory, History } from 'history'; -import { dataPluginMock } from '../../../../data/public/mocks'; -import { SavedSearch } from '../../saved_searches'; -import { SEARCH_FIELDS_FROM_SOURCE } from '../../../common'; +import { dataPluginMock } from '../../../../../../data/public/mocks'; +import { SavedSearch } from '../../../../saved_searches'; +import { SEARCH_FIELDS_FROM_SOURCE } from '../../../../../common'; let history: History; let state: GetStateReturn; diff --git a/src/plugins/discover/public/application/angular/discover_state.ts b/src/plugins/discover/public/application/apps/main/services/discover_state.ts similarity index 95% rename from src/plugins/discover/public/application/angular/discover_state.ts rename to src/plugins/discover/public/application/apps/main/services/discover_state.ts index f71e3ac651f532..e90e62da16ba99 100644 --- a/src/plugins/discover/public/application/angular/discover_state.ts +++ b/src/plugins/discover/public/application/apps/main/services/discover_state.ts @@ -18,19 +18,19 @@ import { StateContainer, syncState, withNotifyOnErrors, -} from '../../../../kibana_utils/public'; +} from '../../../../../../kibana_utils/public'; import { DataPublicPluginStart, esFilters, Filter, Query, SearchSessionInfoProvider, -} from '../../../../data/public'; -import { migrateLegacyQuery } from '../helpers/migrate_legacy_query'; -import { DiscoverGridSettings } from '../components/discover_grid/types'; -import { DISCOVER_APP_URL_GENERATOR, DiscoverUrlGeneratorState } from '../../url_generator'; -import { SavedSearch } from '../../saved_searches'; -import { handleSourceColumnState } from './helpers'; +} from '../../../../../../data/public'; +import { migrateLegacyQuery } from '../../../helpers/migrate_legacy_query'; +import { DiscoverGridSettings } from '../../../components/discover_grid/types'; +import { DISCOVER_APP_URL_GENERATOR, DiscoverUrlGeneratorState } from '../../../../url_generator'; +import { SavedSearch } from '../../../../saved_searches'; +import { handleSourceColumnState } from '../../../angular/helpers'; export interface AppState { /** diff --git a/src/plugins/discover/public/application/apps/main/services/use_discover_state.test.ts b/src/plugins/discover/public/application/apps/main/services/use_discover_state.test.ts new file mode 100644 index 00000000000000..051a2d2dcd9cc7 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/services/use_discover_state.test.ts @@ -0,0 +1,82 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { renderHook, act } from '@testing-library/react-hooks'; +import { createSearchSessionMock } from '../../../../__mocks__/search_session'; +import { discoverServiceMock } from '../../../../__mocks__/services'; +import { savedSearchMock } from '../../../../__mocks__/saved_search'; +import { useDiscoverState } from './use_discover_state'; +import { indexPatternMock } from '../../../../__mocks__/index_pattern'; +import { SearchSource } from '../../../../../../data/common'; + +describe('test useDiscoverState', () => { + test('return is valid', async () => { + const { history } = createSearchSessionMock(); + + const { result } = renderHook(() => { + return useDiscoverState({ + services: discoverServiceMock, + history, + initialIndexPattern: indexPatternMock, + initialSavedSearch: savedSearchMock, + }); + }); + expect(result.current.state.index).toBe(indexPatternMock.id); + expect(result.current.stateContainer).toBeInstanceOf(Object); + expect(result.current.setState).toBeInstanceOf(Function); + expect(result.current.savedSearch.id).toBe(savedSearchMock.id); + expect(result.current.searchSource).toBeInstanceOf(SearchSource); + }); + + test('setState', async () => { + const { history } = createSearchSessionMock(); + + const { result } = renderHook(() => { + return useDiscoverState({ + services: discoverServiceMock, + history, + initialIndexPattern: indexPatternMock, + initialSavedSearch: savedSearchMock, + }); + }); + await act(async () => { + result.current.setState({ columns: ['123'] }); + }); + expect(result.current.state.columns).toEqual(['123']); + }); + + test('resetSavedSearch', async () => { + const { history } = createSearchSessionMock(); + + const { result, waitForValueToChange } = renderHook(() => { + return useDiscoverState({ + services: discoverServiceMock, + history, + initialIndexPattern: indexPatternMock, + initialSavedSearch: savedSearchMock, + }); + }); + + await act(async () => { + result.current.stateContainer.startSync(); + }); + + const initialColumns = result.current.state.columns; + await act(async () => { + result.current.setState({ columns: ['123'] }); + }); + expect(result.current.state.columns).toEqual(['123']); + + result.current.resetSavedSearch('the-saved-search-id'); + await waitForValueToChange(() => { + return result.current.state; + }); + + expect(result.current.state.columns).toEqual(initialColumns); + }); +}); diff --git a/src/plugins/discover/public/application/apps/main/services/use_discover_state.ts b/src/plugins/discover/public/application/apps/main/services/use_discover_state.ts new file mode 100644 index 00000000000000..a3546d54cd4932 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/services/use_discover_state.ts @@ -0,0 +1,155 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import { useMemo, useEffect, useState, useCallback } from 'react'; +import { cloneDeep } from 'lodash'; +import { History } from 'history'; +import { getState } from './discover_state'; +import { getStateDefaults } from '../utils/get_state_defaults'; +import { + esFilters, + connectToQueryState, + syncQueryStateWithUrl, + IndexPattern, +} from '../../../../../../data/public'; +import { DiscoverServices } from '../../../../build_services'; +import { SavedSearch } from '../../../../saved_searches'; +import { loadIndexPattern } from '../utils/resolve_index_pattern'; + +export function useDiscoverState({ + services, + history, + initialIndexPattern, + initialSavedSearch, +}: { + services: DiscoverServices; + initialSavedSearch: SavedSearch; + history: History; + initialIndexPattern: IndexPattern; +}) { + const { uiSettings: config, data, filterManager } = services; + const [indexPattern, setIndexPattern] = useState(initialIndexPattern); + const [savedSearch, setSavedSearch] = useState(initialSavedSearch); + + const searchSource = useMemo(() => { + savedSearch.searchSource.setField('index', indexPattern); + return savedSearch.searchSource.createChild(); + }, [savedSearch.searchSource, indexPattern]); + + const stateContainer = useMemo( + () => + getState({ + getStateDefaults: () => + getStateDefaults({ + config, + data, + savedSearch, + }), + storeInSessionStorage: config.get('state:storeInSessionStorage'), + history, + toasts: services.core.notifications.toasts, + uiSettings: config, + }), + [config, data, history, savedSearch, services.core.notifications.toasts] + ); + + const { appStateContainer, getPreviousAppState } = stateContainer; + + const [state, setState] = useState(appStateContainer.getState()); + + useEffect(() => { + if (stateContainer.appStateContainer.getState().index !== indexPattern.id) { + // used index pattern is different than the given by url/state which is invalid + stateContainer.setAppState({ index: indexPattern.id }); + } + // sync initial app filters from state to filterManager + const filters = appStateContainer.getState().filters; + if (filters) { + filterManager.setAppFilters(cloneDeep(filters)); + } + const query = appStateContainer.getState().query; + if (query) { + data.query.queryString.setQuery(query); + } + + const stopSyncingQueryAppStateWithStateContainer = connectToQueryState( + data.query, + appStateContainer, + { + filters: esFilters.FilterStateStore.APP_STATE, + query: true, + } + ); + + // syncs `_g` portion of url with query services + const { stop: stopSyncingGlobalStateWithUrl } = syncQueryStateWithUrl( + data.query, + stateContainer.kbnUrlStateStorage + ); + return () => { + stopSyncingQueryAppStateWithStateContainer(); + stopSyncingGlobalStateWithUrl(); + }; + }, [ + appStateContainer, + config, + data.query, + data.search.session, + getPreviousAppState, + indexPattern.id, + filterManager, + services.indexPatterns, + stateContainer, + ]); + + useEffect(() => { + const unsubscribe = stateContainer.appStateContainer.subscribe(async (nextState) => { + // NOTE: this is also called when navigating from discover app to context app + if (nextState.index && state.index !== nextState.index) { + const nextIndexPattern = await loadIndexPattern( + nextState.index, + services.indexPatterns, + config + ); + + if (nextIndexPattern) { + setIndexPattern(nextIndexPattern.loaded); + } + } + setState(nextState); + }); + return () => unsubscribe(); + }, [config, services.indexPatterns, state.index, stateContainer.appStateContainer, setState]); + + const resetSavedSearch = useCallback( + async (id?: string) => { + const newSavedSearch = await services.getSavedSearchById(id); + newSavedSearch.searchSource.setField('index', indexPattern); + const newAppState = getStateDefaults({ + config, + data, + savedSearch: newSavedSearch, + }); + await stateContainer.replaceUrlAppState(newAppState); + setState(newAppState); + if (savedSearch.id !== newSavedSearch.id) { + setSavedSearch(newSavedSearch); + } + }, + [services, indexPattern, config, data, stateContainer, savedSearch.id] + ); + + return { + state, + setState, + stateContainer, + indexPattern, + searchSource, + savedSearch, + resetSavedSearch, + }; +} diff --git a/src/plugins/discover/public/application/apps/main/services/use_saved_search.test.ts b/src/plugins/discover/public/application/apps/main/services/use_saved_search.test.ts new file mode 100644 index 00000000000000..5976c8fea5ea4f --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/services/use_saved_search.test.ts @@ -0,0 +1,91 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import { Subject } from 'rxjs'; +import { renderHook } from '@testing-library/react-hooks'; +import { createSearchSessionMock } from '../../../../__mocks__/search_session'; +import { discoverServiceMock } from '../../../../__mocks__/services'; +import { savedSearchMock } from '../../../../__mocks__/saved_search'; +import { indexPatternMock } from '../../../../__mocks__/index_pattern'; +import { useSavedSearch } from './use_saved_search'; +import { AppState, getState } from './discover_state'; +import { uiSettingsMock } from '../../../../__mocks__/ui_settings'; +import { useDiscoverState } from './use_discover_state'; + +describe('test useSavedSearch', () => { + test('useSavedSearch return is valid', async () => { + const { history, searchSessionManager } = createSearchSessionMock(); + const stateContainer = getState({ + getStateDefaults: () => ({ index: 'the-index-pattern-id' }), + history, + uiSettings: uiSettingsMock, + }); + + const { result } = renderHook(() => { + return useSavedSearch({ + indexPattern: indexPatternMock, + savedSearch: savedSearchMock, + searchSessionManager, + searchSource: savedSearchMock.searchSource.createCopy(), + services: discoverServiceMock, + state: {} as AppState, + stateContainer, + useNewFieldsApi: true, + }); + }); + + expect(result.current.refetch$).toBeInstanceOf(Subject); + expect(result.current.data$.value).toMatchInlineSnapshot(` + Object { + "state": "loading", + } + `); + }); + test('refetch$ triggers a search', async () => { + const { history, searchSessionManager } = createSearchSessionMock(); + const stateContainer = getState({ + getStateDefaults: () => ({ index: 'the-index-pattern-id' }), + history, + uiSettings: uiSettingsMock, + }); + + discoverServiceMock.data.query.timefilter.timefilter.getTime = jest.fn(() => { + return { from: '2021-05-01T20:00:00Z', to: '2021-05-02T20:00:00Z' }; + }); + + const { result: resultState } = renderHook(() => { + return useDiscoverState({ + services: discoverServiceMock, + history, + initialIndexPattern: indexPatternMock, + initialSavedSearch: savedSearchMock, + }); + }); + + const { result, waitForValueToChange } = renderHook(() => { + return useSavedSearch({ + indexPattern: indexPatternMock, + savedSearch: savedSearchMock, + searchSessionManager, + searchSource: resultState.current.searchSource, + services: discoverServiceMock, + state: {} as AppState, + stateContainer, + useNewFieldsApi: true, + }); + }); + + result.current.refetch$.next(); + + await waitForValueToChange(() => { + return result.current.data$.value.state === 'complete'; + }); + + expect(result.current.data$.value.hits).toBe(0); + expect(result.current.data$.value.rows).toEqual([]); + }); +}); diff --git a/src/plugins/discover/public/application/apps/main/services/use_saved_search.ts b/src/plugins/discover/public/application/apps/main/services/use_saved_search.ts new file mode 100644 index 00000000000000..2b0d9517248694 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/services/use_saved_search.ts @@ -0,0 +1,337 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import { useEffect, useRef, useCallback, useMemo } from 'react'; +import { i18n } from '@kbn/i18n'; +import { merge, Subject, BehaviorSubject } from 'rxjs'; +import { debounceTime, tap, filter } from 'rxjs/operators'; +import { isEqual } from 'lodash'; +import { DiscoverServices } from '../../../../build_services'; +import { DiscoverSearchSessionManager } from './discover_search_session'; +import { + IndexPattern, + isCompleteResponse, + SearchSource, + tabifyAggResponse, +} from '../../../../../../data/common'; +import { SavedSearch } from '../../../../saved_searches'; +import { AppState, GetStateReturn } from './discover_state'; +import { ElasticSearchHit } from '../../../doc_views/doc_views_types'; +import { RequestAdapter } from '../../../../../../inspector/public'; +import { AutoRefreshDoneFn, search } from '../../../../../../data/public'; +import { calcFieldCounts } from '../utils/calc_field_counts'; +import { SEARCH_ON_PAGE_LOAD_SETTING } from '../../../../../common'; +import { validateTimeRange } from '../utils/validate_time_range'; +import { updateSearchSource } from '../utils/update_search_source'; +import { SortOrder } from '../../../../saved_searches/types'; +import { getDimensions, getChartAggConfigs } from '../utils'; +import { buildPointSeriesData, Chart } from '../components/chart/point_series'; +import { TimechartBucketInterval } from '../components/timechart_header/timechart_header'; +import { useSingleton } from '../utils/use_singleton'; +import { FetchStatus } from '../../../types'; + +export type SavedSearchDataSubject = BehaviorSubject; +export type SavedSearchRefetchSubject = Subject; + +export interface UseSavedSearch { + refetch$: SavedSearchRefetchSubject; + data$: SavedSearchDataSubject; +} + +export type SavedSearchRefetchMsg = 'reset' | undefined; + +export interface SavedSearchDataMessage { + bucketInterval?: TimechartBucketInterval; + chartData?: Chart; + fetchCounter?: number; + fetchError?: Error; + fieldCounts?: Record; + hits?: number; + inspectorAdapters?: { requests: RequestAdapter }; + rows?: ElasticSearchHit[]; + state: FetchStatus; +} + +/** + * This hook return 2 observables, refetch$ allows to trigger data fetching, data$ to subscribe + * to the data fetching + * @param indexPattern + * @param savedSearch + * @param searchSessionManager + * @param searchSource + * @param services + * @param state + * @param stateContainer + * @param useNewFieldsApi + */ +export const useSavedSearch = ({ + indexPattern, + savedSearch, + searchSessionManager, + searchSource, + services, + state, + stateContainer, + useNewFieldsApi, +}: { + indexPattern: IndexPattern; + savedSearch: SavedSearch; + searchSessionManager: DiscoverSearchSessionManager; + searchSource: SearchSource; + services: DiscoverServices; + state: AppState; + stateContainer: GetStateReturn; + useNewFieldsApi: boolean; +}): UseSavedSearch => { + const { data, filterManager, uiSettings } = services; + const timefilter = data.query.timefilter.timefilter; + + const initFetchState: FetchStatus = useMemo(() => { + // A saved search is created on every page load, so we check the ID to see if we're loading a + // previously saved search or if it is just transient + const shouldSearchOnPageLoad = + uiSettings.get(SEARCH_ON_PAGE_LOAD_SETTING) || + savedSearch.id !== undefined || + timefilter.getRefreshInterval().pause === false || + searchSessionManager.hasSearchSessionIdInURL(); + return shouldSearchOnPageLoad ? FetchStatus.LOADING : FetchStatus.UNINITIALIZED; + }, [uiSettings, savedSearch.id, searchSessionManager, timefilter]); + + /** + * The observable the UI (aka React component) subscribes to get notified about + * the changes in the data fetching process (high level: fetching started, data was received) + */ + const data$: SavedSearchDataSubject = useSingleton( + () => + new BehaviorSubject({ + state: initFetchState, + }) + ); + /** + * The observable to trigger data fetching in UI + * By refetch$.next('reset') rows and fieldcounts are reset to allow e.g. editing of runtime fields + * to be processed correctly + */ + const refetch$ = useSingleton(() => new Subject()); + + /** + * Values that shouldn't trigger re-rendering when changed + */ + const refs = useRef<{ + abortController?: AbortController; + /** + * used to compare a new state against an old one, to evaluate if data needs to be fetched + */ + appState: AppState; + /** + * handler emitted by `timefilter.getAutoRefreshFetch$()` + * to notify when data completed loading and to start a new autorefresh loop + */ + autoRefreshDoneCb?: AutoRefreshDoneFn; + fetchCounter: number; + /** + * needed to right auto refresh behavior, a new auto refresh shouldnt be triggered when + * loading is still ongoing + */ + fetchStatus: FetchStatus; + /** + * needed for merging new with old field counts, high likely legacy, but kept this behavior + * because not 100% sure in this case + */ + fieldCounts: Record; + }>({ + appState: state, + fetchCounter: 0, + fieldCounts: {}, + fetchStatus: initFetchState, + }); + + const fetchAll = useCallback( + (reset = false) => { + if (!validateTimeRange(timefilter.getTime(), services.toastNotifications)) { + return Promise.reject(); + } + const inspectorAdapters = { requests: new RequestAdapter() }; + + if (refs.current.abortController) refs.current.abortController.abort(); + refs.current.abortController = new AbortController(); + const sessionId = searchSessionManager.getNextSearchSessionId(); + + // Let the UI know, data fetching started + const loadingMessage: SavedSearchDataMessage = { + state: FetchStatus.LOADING, + fetchCounter: ++refs.current.fetchCounter, + }; + + if (reset) { + // when runtime field was added, changed, deleted, index pattern was switched + loadingMessage.rows = []; + loadingMessage.fieldCounts = {}; + loadingMessage.chartData = undefined; + loadingMessage.bucketInterval = undefined; + } + data$.next(loadingMessage); + refs.current.fetchStatus = loadingMessage.state; + + const { sort } = stateContainer.appStateContainer.getState(); + updateSearchSource(searchSource, false, { + indexPattern, + services, + sort: sort as SortOrder[], + useNewFieldsApi, + }); + const chartAggConfigs = + indexPattern.timeFieldName && !state.hideChart && state.interval + ? getChartAggConfigs(searchSource, state.interval, data) + : undefined; + + if (!chartAggConfigs) { + searchSource.removeField('aggs'); + } else { + searchSource.setField('aggs', chartAggConfigs.toDsl()); + } + + const searchSourceFetch$ = searchSource.fetch$({ + abortSignal: refs.current.abortController.signal, + sessionId, + inspector: { + adapter: inspectorAdapters.requests, + title: i18n.translate('discover.inspectorRequestDataTitle', { + defaultMessage: 'data', + }), + description: i18n.translate('discover.inspectorRequestDescriptionDocument', { + defaultMessage: 'This request queries Elasticsearch to fetch the data for the search.', + }), + }, + }); + + searchSourceFetch$.pipe(filter((res) => isCompleteResponse(res))).subscribe( + (res) => { + const documents = res.rawResponse.hits.hits; + + const message: SavedSearchDataMessage = { + state: FetchStatus.COMPLETE, + rows: documents, + inspectorAdapters, + fieldCounts: calcFieldCounts( + reset ? {} : refs.current.fieldCounts, + documents, + indexPattern + ), + hits: res.rawResponse.hits.total as number, + }; + + if (chartAggConfigs) { + const bucketAggConfig = chartAggConfigs!.aggs[1]; + const tabifiedData = tabifyAggResponse(chartAggConfigs, res.rawResponse); + const dimensions = getDimensions(chartAggConfigs, data); + if (dimensions) { + if (bucketAggConfig && search.aggs.isDateHistogramBucketAggConfig(bucketAggConfig)) { + message.bucketInterval = bucketAggConfig.buckets?.getInterval(); + } + message.chartData = buildPointSeriesData(tabifiedData, dimensions); + } + } + refs.current.fieldCounts = message.fieldCounts!; + refs.current.fetchStatus = message.state; + data$.next(message); + }, + (error) => { + if (error instanceof Error && error.name === 'AbortError') return; + data.search.showError(error); + refs.current.fetchStatus = FetchStatus.ERROR; + data$.next({ + state: FetchStatus.ERROR, + inspectorAdapters, + fetchError: error, + }); + }, + () => { + refs.current.autoRefreshDoneCb?.(); + refs.current.autoRefreshDoneCb = undefined; + } + ); + }, + [ + timefilter, + services, + stateContainer.appStateContainer, + searchSource, + indexPattern, + useNewFieldsApi, + state.hideChart, + state.interval, + data, + searchSessionManager, + data$, + ] + ); + + /** + * This part takes care of triggering the data fetching by creating and subscribing + * to an observable of various possible changes in state + */ + useEffect(() => { + const fetch$ = merge( + refetch$, + filterManager.getFetches$(), + timefilter.getFetch$(), + timefilter.getAutoRefreshFetch$().pipe( + tap((done) => { + refs.current.autoRefreshDoneCb = done; + }), + filter(() => refs.current.fetchStatus !== FetchStatus.LOADING) + ), + data.query.queryString.getUpdates$(), + searchSessionManager.newSearchSessionIdFromURL$.pipe(filter((sessionId) => !!sessionId)) + ).pipe(debounceTime(100)); + + const subscription = fetch$.subscribe((val) => { + fetchAll(val === 'reset'); + }); + + return () => { + subscription.unsubscribe(); + }; + }, [ + data.query.queryString, + filterManager, + refetch$, + searchSessionManager.newSearchSessionIdFromURL$, + timefilter, + fetchAll, + ]); + + /** + * Track state changes that should trigger a fetch + */ + useEffect(() => { + const prevAppState = refs.current.appState; + + // chart was hidden, now it should be displayed, so data is needed + const chartDisplayChanged = state.hideChart !== prevAppState.hideChart && !state.hideChart; + const chartIntervalChanged = state.interval !== prevAppState.interval; + const docTableSortChanged = !isEqual(state.sort, prevAppState.sort); + const indexPatternChanged = !isEqual(state.index, prevAppState.index); + + refs.current.appState = state; + if (chartDisplayChanged || chartIntervalChanged || docTableSortChanged || indexPatternChanged) { + refetch$.next(indexPatternChanged ? 'reset' : undefined); + } + }, [refetch$, state.interval, state.sort, state]); + + useEffect(() => { + if (initFetchState === FetchStatus.LOADING) { + refetch$.next(); + } + }, [initFetchState, refetch$]); + + return { + refetch$, + data$, + }; +}; diff --git a/src/plugins/discover/public/application/apps/main/services/use_search_session.test.ts b/src/plugins/discover/public/application/apps/main/services/use_search_session.test.ts new file mode 100644 index 00000000000000..8aa6e0764d8ec7 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/services/use_search_session.test.ts @@ -0,0 +1,39 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { useSearchSession } from './use_search_session'; +import { renderHook } from '@testing-library/react-hooks'; +import { createSearchSessionMock } from '../../../../__mocks__/search_session'; +import { discoverServiceMock } from '../../../../__mocks__/services'; +import { savedSearchMock } from '../../../../__mocks__/saved_search'; +import { getState } from './discover_state'; +import { uiSettingsMock } from '../../../../__mocks__/ui_settings'; + +describe('test useSearchSession', () => { + test('getting the next session id', async () => { + const { history } = createSearchSessionMock(); + const stateContainer = getState({ + getStateDefaults: () => ({ index: 'test' }), + history, + uiSettings: uiSettingsMock, + }); + + const nextId = 'id'; + discoverServiceMock.data.search.session.start = jest.fn(() => nextId); + + const { result } = renderHook(() => { + return useSearchSession({ + services: discoverServiceMock, + history, + stateContainer, + savedSearch: savedSearchMock, + }); + }); + expect(result.current.getNextSearchSessionId()).toBe('id'); + }); +}); diff --git a/src/plugins/discover/public/application/apps/main/services/use_search_session.ts b/src/plugins/discover/public/application/apps/main/services/use_search_session.ts new file mode 100644 index 00000000000000..e37e8f6f338394 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/services/use_search_session.ts @@ -0,0 +1,65 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import { useMemo, useEffect } from 'react'; +import { History } from 'history'; +import { DiscoverSearchSessionManager } from './discover_search_session'; +import { createSearchSessionRestorationDataProvider, GetStateReturn } from './discover_state'; +import { noSearchSessionStorageCapabilityMessage } from '../../../../../../data/public'; +import { DiscoverServices } from '../../../../build_services'; +import { SavedSearch } from '../../../../saved_searches'; + +export function useSearchSession({ + services, + history, + stateContainer, + savedSearch, +}: { + services: DiscoverServices; + stateContainer: GetStateReturn; + history: History; + savedSearch: SavedSearch; +}) { + const { data, capabilities } = services; + /** + * Search session logic + */ + const searchSessionManager = useMemo( + () => + new DiscoverSearchSessionManager({ + history, + session: data.search.session, + }), + [data.search.session, history] + ); + + useEffect(() => { + data.search.session.enableStorage( + createSearchSessionRestorationDataProvider({ + appStateContainer: stateContainer.appStateContainer, + data, + getSavedSearch: () => savedSearch, + }), + { + isDisabled: () => + capabilities.discover.storeSearchSession + ? { disabled: false } + : { + disabled: true, + reasonText: noSearchSessionStorageCapabilityMessage, + }, + } + ); + }, [ + capabilities.discover.storeSearchSession, + data, + savedSearch, + stateContainer.appStateContainer, + ]); + + return searchSessionManager; +} diff --git a/src/plugins/discover/public/application/apps/main/services/use_url.test.ts b/src/plugins/discover/public/application/apps/main/services/use_url.test.ts new file mode 100644 index 00000000000000..740ca2bd140d78 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/services/use_url.test.ts @@ -0,0 +1,27 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import { renderHook } from '@testing-library/react-hooks'; +import { createSearchSessionMock } from '../../../../__mocks__/search_session'; +import { useUrl } from './use_url'; + +describe('test useUrl', () => { + test('resetSavedSearch is triggered once path it changed to /', () => { + const { history } = createSearchSessionMock(); + history.push('/view'); + const props = { + history, + resetSavedSearch: jest.fn(), + }; + renderHook(() => useUrl(props)); + history.push('/new'); + expect(props.resetSavedSearch).toHaveBeenCalledTimes(0); + + history.push('/'); + expect(props.resetSavedSearch).toHaveBeenCalledTimes(1); + }); +}); diff --git a/src/plugins/discover/public/application/apps/main/services/use_url.ts b/src/plugins/discover/public/application/apps/main/services/use_url.ts new file mode 100644 index 00000000000000..bc5554c35b36f7 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/services/use_url.ts @@ -0,0 +1,31 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import { useEffect } from 'react'; +import { History } from 'history'; +export function useUrl({ + history, + resetSavedSearch, +}: { + history: History; + resetSavedSearch: (val?: string) => void; +}) { + /** + * Url / Routing logic + */ + useEffect(() => { + // this listener is waiting for such a path http://localhost:5601/app/discover#/ + // which could be set through pressing "New" button in top nav or go to "Discover" plugin from the sidebar + // to reload the page in a right way + const unlistenHistoryBasePath = history.listen(({ pathname, search, hash }) => { + if (!search && !hash && pathname === '/') { + resetSavedSearch(); + } + }); + return () => unlistenHistoryBasePath(); + }, [history, resetSavedSearch]); +} diff --git a/src/plugins/discover/public/application/helpers/calc_field_counts.test.ts b/src/plugins/discover/public/application/apps/main/utils/calc_field_counts.test.ts similarity index 83% rename from src/plugins/discover/public/application/helpers/calc_field_counts.test.ts rename to src/plugins/discover/public/application/apps/main/utils/calc_field_counts.test.ts index cf12b336c5b580..bdea6611d3b7eb 100644 --- a/src/plugins/discover/public/application/helpers/calc_field_counts.test.ts +++ b/src/plugins/discover/public/application/apps/main/utils/calc_field_counts.test.ts @@ -7,14 +7,15 @@ */ import { calcFieldCounts } from './calc_field_counts'; -import { indexPatternMock } from '../../__mocks__/index_pattern'; +import { indexPatternMock } from '../../../../__mocks__/index_pattern'; +import { ElasticSearchHit } from '../../../doc_views/doc_views_types'; describe('calcFieldCounts', () => { test('returns valid field count data', async () => { - const rows = [ + const rows = ([ { _id: 1, _source: { message: 'test1', bytes: 20 } }, { _id: 2, _source: { name: 'test2', extension: 'jpg' } }, - ]; + ] as unknown) as ElasticSearchHit[]; const result = calcFieldCounts({}, rows, indexPatternMock); expect(result).toMatchInlineSnapshot(` Object { @@ -28,10 +29,10 @@ describe('calcFieldCounts', () => { `); }); test('updates field count data', async () => { - const rows = [ + const rows = ([ { _id: 1, _source: { message: 'test1', bytes: 20 } }, { _id: 2, _source: { name: 'test2', extension: 'jpg' } }, - ]; + ] as unknown) as ElasticSearchHit[]; const result = calcFieldCounts({ message: 2 }, rows, indexPatternMock); expect(result).toMatchInlineSnapshot(` Object { diff --git a/src/plugins/discover/public/application/helpers/calc_field_counts.ts b/src/plugins/discover/public/application/apps/main/utils/calc_field_counts.ts similarity index 84% rename from src/plugins/discover/public/application/helpers/calc_field_counts.ts rename to src/plugins/discover/public/application/apps/main/utils/calc_field_counts.ts index edeaa0b9bce52f..43c9a57a70f221 100644 --- a/src/plugins/discover/public/application/helpers/calc_field_counts.ts +++ b/src/plugins/discover/public/application/apps/main/utils/calc_field_counts.ts @@ -6,7 +6,8 @@ * Side Public License, v 1. */ -import { IndexPattern } from '../../kibana_services'; +import { IndexPattern } from '../../../../kibana_services'; +import { ElasticSearchHit } from '../../../doc_views/doc_views_types'; /** * This function is recording stats of the available fields, for usage in sidebar and sharing @@ -14,7 +15,7 @@ import { IndexPattern } from '../../kibana_services'; */ export function calcFieldCounts( counts = {} as Record, - rows: Array>, + rows: ElasticSearchHit[], indexPattern: IndexPattern ) { for (const hit of rows) { diff --git a/src/plugins/discover/public/application/apps/main/utils/get_chart_agg_config.test.ts b/src/plugins/discover/public/application/apps/main/utils/get_chart_agg_config.test.ts new file mode 100644 index 00000000000000..19820508746508 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/utils/get_chart_agg_config.test.ts @@ -0,0 +1,59 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import { indexPatternWithTimefieldMock } from '../../../../__mocks__/index_pattern_with_timefield'; +import { SearchSource } from '../../../../../../data/public'; +import { dataPluginMock } from '../../../../../../data/public/mocks'; +import { getChartAggConfigs } from './get_chart_agg_configs'; + +describe('getChartAggConfigs', () => { + test('is working', () => { + const indexPattern = indexPatternWithTimefieldMock; + const setField = jest.fn(); + const searchSource = ({ + setField, + getField: (name: string) => { + if (name === 'index') { + return indexPattern; + } + }, + removeField: jest.fn(), + } as unknown) as SearchSource; + + const dataMock = dataPluginMock.createStartContract(); + + const aggsConfig = getChartAggConfigs(searchSource, 'auto', dataMock); + + expect(aggsConfig!.aggs).toMatchInlineSnapshot(` + Array [ + Object { + "enabled": true, + "id": "1", + "params": Object {}, + "schema": "metric", + "type": "count", + }, + Object { + "enabled": true, + "id": "2", + "params": Object { + "drop_partials": false, + "extended_bounds": Object {}, + "field": "timestamp", + "interval": "auto", + "min_doc_count": 1, + "scaleMetricValues": false, + "useNormalizedEsInterval": true, + "used_interval": "0ms", + }, + "schema": "segment", + "type": "date_histogram", + }, + ] + `); + }); +}); diff --git a/src/plugins/discover/public/application/apps/main/utils/get_chart_agg_configs.ts b/src/plugins/discover/public/application/apps/main/utils/get_chart_agg_configs.ts new file mode 100644 index 00000000000000..2665254027fd91 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/utils/get_chart_agg_configs.ts @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import { SearchSource } from '../../../../../../data/common'; +import { DataPublicPluginStart } from '../../../../../../data/public'; + +/** + * Helper function to apply or remove aggregations to a given search source used for gaining data + * for Discover's histogram vis + */ +export function getChartAggConfigs( + searchSource: SearchSource, + histogramInterval: string, + data: DataPublicPluginStart +) { + const indexPattern = searchSource.getField('index')!; + const visStateAggs = [ + { + type: 'count', + schema: 'metric', + }, + { + type: 'date_histogram', + schema: 'segment', + params: { + field: indexPattern.timeFieldName!, + interval: histogramInterval, + timeRange: data.query.timefilter.timefilter.getTime(), + }, + }, + ]; + return data.search.aggs.createAggConfigs(indexPattern, visStateAggs); +} diff --git a/src/plugins/discover/public/application/apps/main/utils/get_dimensions.test.ts b/src/plugins/discover/public/application/apps/main/utils/get_dimensions.test.ts new file mode 100644 index 00000000000000..443fc634ba5430 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/utils/get_dimensions.test.ts @@ -0,0 +1,70 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import { dataPluginMock } from '../../../../../../data/public/mocks'; + +import { getDimensions } from './get_dimensions'; +import { indexPatternWithTimefieldMock } from '../../../../__mocks__/index_pattern_with_timefield'; +import { SearchSource, calculateBounds } from '../../../../../../data/common'; +import { getChartAggConfigs } from './get_chart_agg_configs'; + +test('getDimensions', () => { + const indexPattern = indexPatternWithTimefieldMock; + const setField = jest.fn(); + const searchSource = ({ + setField, + removeField: jest.fn(), + getField: (name: string) => { + if (name === 'index') { + return indexPattern; + } + }, + } as unknown) as SearchSource; + + const dataMock = dataPluginMock.createStartContract(); + dataMock.query.timefilter.timefilter.getTime = () => { + return { from: '1991-03-29T08:04:00.694Z', to: '2021-03-29T07:04:00.695Z' }; + }; + dataMock.query.timefilter.timefilter.calculateBounds = (timeRange) => { + return calculateBounds(timeRange); + }; + + const aggsConfig = getChartAggConfigs(searchSource, 'auto', dataMock); + const actual = getDimensions(aggsConfig!, dataMock); + expect(actual).toMatchInlineSnapshot(` + Object { + "x": Object { + "accessor": 0, + "format": Object { + "id": "date", + "params": Object { + "pattern": "HH:mm:ss.SSS", + }, + }, + "label": "timestamp per 0 milliseconds", + "params": Object { + "bounds": Object { + "max": "2021-03-29T07:04:00.695Z", + "min": "1991-03-29T08:04:00.694Z", + }, + "date": true, + "format": "HH:mm:ss.SSS", + "interval": "P0D", + "intervalESUnit": "ms", + "intervalESValue": 0, + }, + }, + "y": Object { + "accessor": 1, + "format": Object { + "id": "number", + }, + "label": "Count", + }, + } + `); +}); diff --git a/src/plugins/discover/public/application/apps/main/utils/get_dimensions.ts b/src/plugins/discover/public/application/apps/main/utils/get_dimensions.ts new file mode 100644 index 00000000000000..40b378f1c16983 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/utils/get_dimensions.ts @@ -0,0 +1,56 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import moment from 'moment'; +import dateMath from '@elastic/datemath'; +import { IAggConfigs } from '../../../../../../data/common'; +import { DataPublicPluginStart, search } from '../../../../../../data/public'; +import { Dimensions, HistogramParamsBounds } from '../components/chart/point_series'; + +export function getDimensions( + aggs: IAggConfigs, + data: DataPublicPluginStart +): Dimensions | undefined { + const [metric, agg] = aggs.aggs; + const { from, to } = data.query.timefilter.timefilter.getTime(); + agg.params.timeRange = { + from: dateMath.parse(from), + to: dateMath.parse(to, { roundUp: true }), + }; + const bounds = agg.params.timeRange + ? (data.query.timefilter.timefilter.calculateBounds( + agg.params.timeRange + ) as HistogramParamsBounds) + : null; + const buckets = search.aggs.isDateHistogramBucketAggConfig(agg) ? agg.buckets : undefined; + + if (!buckets || !bounds) { + return; + } + + const { esUnit, esValue } = buckets.getInterval(); + return { + x: { + accessor: 0, + label: agg.makeLabel(), + format: agg.toSerializedFieldFormat(), + params: { + date: true, + interval: moment.duration(esValue, esUnit), + intervalESValue: esValue, + intervalESUnit: esUnit, + format: buckets.getScaledDateFormat(), + bounds, + }, + }, + y: { + accessor: 1, + format: metric.toSerializedFieldFormat(), + label: metric.makeLabel(), + }, + }; +} diff --git a/src/plugins/discover/public/application/apps/main/utils/get_result_state.test.ts b/src/plugins/discover/public/application/apps/main/utils/get_result_state.test.ts new file mode 100644 index 00000000000000..512bc4240352c7 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/utils/get_result_state.test.ts @@ -0,0 +1,45 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import { getResultState, resultStatuses } from './get_result_state'; +import { ElasticSearchHit } from '../../../doc_views/doc_views_types'; +import { FetchStatus } from '../../../types'; + +describe('getResultState', () => { + test('fetching uninitialized', () => { + const actual = getResultState(FetchStatus.UNINITIALIZED, []); + expect(actual).toBe(resultStatuses.UNINITIALIZED); + }); + + test('fetching complete with no records', () => { + const actual = getResultState(FetchStatus.COMPLETE, []); + expect(actual).toBe(resultStatuses.NO_RESULTS); + }); + + test('fetching ongoing aka loading', () => { + const actual = getResultState(FetchStatus.LOADING, []); + expect(actual).toBe(resultStatuses.LOADING); + }); + + test('fetching ready', () => { + const record = ({ _id: 123 } as unknown) as ElasticSearchHit; + const actual = getResultState(FetchStatus.COMPLETE, [record]); + expect(actual).toBe(resultStatuses.READY); + }); + + test('re-fetching after already data is available', () => { + const record = ({ _id: 123 } as unknown) as ElasticSearchHit; + const actual = getResultState(FetchStatus.LOADING, [record]); + expect(actual).toBe(resultStatuses.READY); + }); + + test('after a fetch error when data was successfully fetched before ', () => { + const record = ({ _id: 123 } as unknown) as ElasticSearchHit; + const actual = getResultState(FetchStatus.ERROR, [record]); + expect(actual).toBe(resultStatuses.READY); + }); +}); diff --git a/src/plugins/discover/public/application/apps/main/utils/get_result_state.ts b/src/plugins/discover/public/application/apps/main/utils/get_result_state.ts new file mode 100644 index 00000000000000..80d25566ea5784 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/utils/get_result_state.ts @@ -0,0 +1,31 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import { ElasticSearchHit } from '../../../doc_views/doc_views_types'; +import { FetchStatus } from '../../../types'; + +export const resultStatuses = { + UNINITIALIZED: 'uninitialized', + LOADING: 'loading', // initial data load + READY: 'ready', // results came back + NO_RESULTS: 'none', // no results came back +}; + +/** + * Returns the current state of the result, depends on fetchStatus and the given fetched rows + * Determines what is displayed in Discover main view (loading view, data view, empty data view, ...) + */ +export function getResultState(fetchStatus: FetchStatus, rows: ElasticSearchHit[]) { + if (fetchStatus === FetchStatus.UNINITIALIZED) { + return resultStatuses.UNINITIALIZED; + } + + const rowsEmpty = !Array.isArray(rows) || rows.length === 0; + if (rowsEmpty && fetchStatus === FetchStatus.LOADING) return resultStatuses.LOADING; + else if (!rowsEmpty) return resultStatuses.READY; + else return resultStatuses.NO_RESULTS; +} diff --git a/src/plugins/discover/public/application/helpers/get_sharing_data.test.ts b/src/plugins/discover/public/application/apps/main/utils/get_sharing_data.test.ts similarity index 96% rename from src/plugins/discover/public/application/helpers/get_sharing_data.test.ts rename to src/plugins/discover/public/application/apps/main/utils/get_sharing_data.test.ts index 6a51c085ebbc98..ffad3d955c1a3c 100644 --- a/src/plugins/discover/public/application/helpers/get_sharing_data.test.ts +++ b/src/plugins/discover/public/application/apps/main/utils/get_sharing_data.test.ts @@ -8,9 +8,9 @@ import { Capabilities, IUiSettingsClient } from 'kibana/public'; import { IndexPattern } from 'src/plugins/data/public'; -import { createSearchSourceMock } from '../../../../data/common/search/search_source/mocks'; -import { DOC_HIDE_TIME_COLUMN_SETTING, SORT_DEFAULT_ORDER_SETTING } from '../../../common'; -import { indexPatternMock } from '../../__mocks__/index_pattern'; +import { createSearchSourceMock } from '../../../../../../data/common/search/search_source/mocks'; +import { DOC_HIDE_TIME_COLUMN_SETTING, SORT_DEFAULT_ORDER_SETTING } from '../../../../../common'; +import { indexPatternMock } from '../../../../__mocks__/index_pattern'; import { getSharingData, showPublicUrlSwitch } from './get_sharing_data'; describe('getSharingData', () => { diff --git a/src/plugins/discover/public/application/helpers/get_sharing_data.ts b/src/plugins/discover/public/application/apps/main/utils/get_sharing_data.ts similarity index 87% rename from src/plugins/discover/public/application/helpers/get_sharing_data.ts rename to src/plugins/discover/public/application/apps/main/utils/get_sharing_data.ts index 47be4b80371522..00473956c57e3a 100644 --- a/src/plugins/discover/public/application/helpers/get_sharing_data.ts +++ b/src/plugins/discover/public/application/apps/main/utils/get_sharing_data.ts @@ -7,11 +7,11 @@ */ import type { Capabilities, IUiSettingsClient } from 'kibana/public'; -import { ISearchSource } from '../../../../data/common'; -import { DOC_HIDE_TIME_COLUMN_SETTING, SORT_DEFAULT_ORDER_SETTING } from '../../../common'; -import type { SavedSearch, SortOrder } from '../../saved_searches/types'; -import { AppState } from '../angular/discover_state'; -import { getSortForSearchSource } from '../angular/doc_table'; +import { ISearchSource } from '../../../../../../data/common'; +import { DOC_HIDE_TIME_COLUMN_SETTING, SORT_DEFAULT_ORDER_SETTING } from '../../../../../common'; +import type { SavedSearch, SortOrder } from '../../../../saved_searches/types'; +import { AppState } from '../services/discover_state'; +import { getSortForSearchSource } from '../../../angular/doc_table'; /** * Preparing data to share the current state as link or CSV/Report diff --git a/src/plugins/discover/public/application/apps/main/utils/get_state_defaults.test.ts b/src/plugins/discover/public/application/apps/main/utils/get_state_defaults.test.ts new file mode 100644 index 00000000000000..17f1802a47327a --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/utils/get_state_defaults.test.ts @@ -0,0 +1,64 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { getStateDefaults } from './get_state_defaults'; +import { createSearchSourceMock, dataPluginMock } from '../../../../../../data/public/mocks'; +import { uiSettingsMock } from '../../../../__mocks__/ui_settings'; +import { indexPatternWithTimefieldMock } from '../../../../__mocks__/index_pattern_with_timefield'; +import { savedSearchMock } from '../../../../__mocks__/saved_search'; +import { indexPatternMock } from '../../../../__mocks__/index_pattern'; + +describe('getStateDefaults', () => { + test('index pattern with timefield', () => { + savedSearchMock.searchSource = createSearchSourceMock({ index: indexPatternWithTimefieldMock }); + const actual = getStateDefaults({ + config: uiSettingsMock, + data: dataPluginMock.createStartContract(), + savedSearch: savedSearchMock, + }); + expect(actual).toMatchInlineSnapshot(` + Object { + "columns": Array [ + "default_column", + ], + "filters": undefined, + "index": "index-pattern-with-timefield-id", + "interval": "auto", + "query": undefined, + "sort": Array [ + Array [ + "timestamp", + "desc", + ], + ], + } + `); + }); + + test('index pattern without timefield', () => { + savedSearchMock.searchSource = createSearchSourceMock({ index: indexPatternMock }); + + const actual = getStateDefaults({ + config: uiSettingsMock, + data: dataPluginMock.createStartContract(), + savedSearch: savedSearchMock, + }); + expect(actual).toMatchInlineSnapshot(` + Object { + "columns": Array [ + "default_column", + ], + "filters": undefined, + "index": "the-index-pattern-id", + "interval": "auto", + "query": undefined, + "sort": Array [], + } + `); + }); +}); diff --git a/src/plugins/discover/public/application/apps/main/utils/get_state_defaults.ts b/src/plugins/discover/public/application/apps/main/utils/get_state_defaults.ts new file mode 100644 index 00000000000000..426272fa8ce1cf --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/utils/get_state_defaults.ts @@ -0,0 +1,59 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { cloneDeep } from 'lodash'; +import { IUiSettingsClient } from 'kibana/public'; +import { DEFAULT_COLUMNS_SETTING, SORT_DEFAULT_ORDER_SETTING } from '../../../../../common'; +import { getSortArray } from '../../../angular/doc_table'; +import { getDefaultSort } from '../../../angular/doc_table/lib/get_default_sort'; +import { SavedSearch } from '../../../../saved_searches'; +import { DataPublicPluginStart } from '../../../../../../data/public'; + +import { AppState } from '../services/discover_state'; + +function getDefaultColumns(savedSearch: SavedSearch, config: IUiSettingsClient) { + if (savedSearch.columns && savedSearch.columns.length > 0) { + return [...savedSearch.columns]; + } + return [...config.get(DEFAULT_COLUMNS_SETTING)]; +} + +export function getStateDefaults({ + config, + data, + savedSearch, +}: { + config: IUiSettingsClient; + data: DataPublicPluginStart; + savedSearch: SavedSearch; +}) { + const searchSource = savedSearch.searchSource; + const indexPattern = savedSearch.searchSource.getField('index'); + const query = searchSource.getField('query') || data.query.queryString.getDefaultQuery(); + const sort = getSortArray(savedSearch.sort, indexPattern!); + const columns = getDefaultColumns(savedSearch, config); + + const defaultState = { + query, + sort: !sort.length + ? getDefaultSort(indexPattern, config.get(SORT_DEFAULT_ORDER_SETTING, 'desc')) + : sort, + columns, + index: indexPattern!.id, + interval: 'auto', + filters: cloneDeep(searchSource.getOwnField('filter')), + } as AppState; + if (savedSearch.grid) { + defaultState.grid = savedSearch.grid; + } + if (savedSearch.hideChart) { + defaultState.hideChart = savedSearch.hideChart; + } + + return defaultState; +} diff --git a/src/plugins/discover/public/application/helpers/get_switch_index_pattern_app_state.test.ts b/src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.test.ts similarity index 98% rename from src/plugins/discover/public/application/helpers/get_switch_index_pattern_app_state.test.ts rename to src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.test.ts index 31addd807b78dc..9f9071ed403ced 100644 --- a/src/plugins/discover/public/application/helpers/get_switch_index_pattern_app_state.test.ts +++ b/src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.test.ts @@ -7,7 +7,7 @@ */ import { getSwitchIndexPatternAppState } from './get_switch_index_pattern_app_state'; -import { IndexPattern } from '../../../../data/common/index_patterns'; +import { IndexPattern } from '../../../../../../data/common/index_patterns'; /** * Helper function returning an index pattern diff --git a/src/plugins/discover/public/application/helpers/get_switch_index_pattern_app_state.ts b/src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.ts similarity index 90% rename from src/plugins/discover/public/application/helpers/get_switch_index_pattern_app_state.ts rename to src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.ts index 9756fc8fd448ba..f7154b26c7ed62 100644 --- a/src/plugins/discover/public/application/helpers/get_switch_index_pattern_app_state.ts +++ b/src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.ts @@ -6,9 +6,9 @@ * Side Public License, v 1. */ -import { getSortArray } from '../angular/doc_table'; -import { SortPairArr } from '../angular/doc_table/lib/get_sort'; -import { IndexPattern } from '../../kibana_services'; +import { getSortArray } from '../../../angular/doc_table'; +import { SortPairArr } from '../../../angular/doc_table/lib/get_sort'; +import { IndexPattern } from '../../../../kibana_services'; /** * Helper function to remove or adapt the currently selected columns/sort to be valid with the next diff --git a/src/plugins/discover/public/application/apps/main/utils/index.ts b/src/plugins/discover/public/application/apps/main/utils/index.ts new file mode 100644 index 00000000000000..a79dea526ec557 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/utils/index.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { getChartAggConfigs } from './get_chart_agg_configs'; +export { getDimensions } from './get_dimensions'; diff --git a/src/plugins/discover/public/application/helpers/nested_fields.ts b/src/plugins/discover/public/application/apps/main/utils/nested_fields.ts similarity index 100% rename from src/plugins/discover/public/application/helpers/nested_fields.ts rename to src/plugins/discover/public/application/apps/main/utils/nested_fields.ts diff --git a/src/plugins/discover/public/application/helpers/persist_saved_search.ts b/src/plugins/discover/public/application/apps/main/utils/persist_saved_search.ts similarity index 75% rename from src/plugins/discover/public/application/helpers/persist_saved_search.ts rename to src/plugins/discover/public/application/apps/main/utils/persist_saved_search.ts index f44d4650da56a2..a5e1e2bb6c2ea6 100644 --- a/src/plugins/discover/public/application/helpers/persist_saved_search.ts +++ b/src/plugins/discover/public/application/apps/main/utils/persist_saved_search.ts @@ -7,12 +7,12 @@ */ import { updateSearchSource } from './update_search_source'; -import { IndexPattern } from '../../../../data/public'; -import { SavedSearch } from '../../saved_searches'; -import { AppState } from '../angular/discover_state'; -import { SortOrder } from '../../saved_searches/types'; -import { SavedObjectSaveOpts } from '../../../../saved_objects/public'; -import { DiscoverServices } from '../../build_services'; +import { IndexPattern } from '../../../../../../data/public'; +import { SavedSearch } from '../../../../saved_searches'; +import { AppState } from '../services/discover_state'; +import { SortOrder } from '../../../../saved_searches/types'; +import { SavedObjectSaveOpts } from '../../../../../../saved_objects/public'; +import { DiscoverServices } from '../../../../build_services'; /** * Helper function to update and persist the given savedSearch @@ -35,12 +35,10 @@ export async function persistSavedSearch( state: AppState; } ) { - updateSearchSource({ - persistentSearchSource: savedSearch.searchSource, + updateSearchSource(savedSearch.searchSource, true, { indexPattern, services, sort: state.sort as SortOrder[], - columns: state.columns || [], useNewFieldsApi: false, }); diff --git a/src/plugins/discover/public/application/helpers/resolve_index_pattern.test.ts b/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.test.ts similarity index 89% rename from src/plugins/discover/public/application/helpers/resolve_index_pattern.test.ts rename to src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.test.ts index 50ff068086b0ac..9ebbeafd28e10e 100644 --- a/src/plugins/discover/public/application/helpers/resolve_index_pattern.test.ts +++ b/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.test.ts @@ -11,9 +11,9 @@ import { getFallbackIndexPatternId, IndexPatternSavedObject, } from './resolve_index_pattern'; -import { indexPatternsMock } from '../../__mocks__/index_patterns'; -import { indexPatternMock } from '../../__mocks__/index_pattern'; -import { configMock } from '../../__mocks__/config'; +import { indexPatternsMock } from '../../../../__mocks__/index_patterns'; +import { indexPatternMock } from '../../../../__mocks__/index_pattern'; +import { configMock } from '../../../../__mocks__/config'; describe('Resolve index pattern tests', () => { test('returns valid data for an existing index pattern', async () => { diff --git a/src/plugins/discover/public/application/helpers/resolve_index_pattern.ts b/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts similarity index 95% rename from src/plugins/discover/public/application/helpers/resolve_index_pattern.ts rename to src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts index 3e22917f3f482f..a5149ea2b3dd7b 100644 --- a/src/plugins/discover/public/application/helpers/resolve_index_pattern.ts +++ b/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts @@ -8,8 +8,8 @@ import { i18n } from '@kbn/i18n'; import { IUiSettingsClient, SavedObject, ToastsStart } from 'kibana/public'; -import { IndexPattern } from '../../kibana_services'; -import { IndexPatternsService, SearchSource } from '../../../../data/common'; +import { IndexPattern } from '../../../../kibana_services'; +import { IndexPatternsContract, SearchSource } from '../../../../../../data/common'; export type IndexPatternSavedObject = SavedObject & { title: string }; @@ -77,7 +77,7 @@ export function getIndexPatternId( */ export async function loadIndexPattern( id: string, - indexPatterns: IndexPatternsService, + indexPatterns: IndexPatternsContract, config: IUiSettingsClient ): Promise { const indexPatternList = ((await indexPatterns.getCache()) as unknown) as IndexPatternSavedObject[]; diff --git a/src/plugins/discover/public/application/apps/main/utils/update_search_source.test.ts b/src/plugins/discover/public/application/apps/main/utils/update_search_source.test.ts new file mode 100644 index 00000000000000..9deabf96732b1e --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/utils/update_search_source.test.ts @@ -0,0 +1,141 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { updateSearchSource } from './update_search_source'; +import { createSearchSourceMock } from '../../../../../../data/common/search/search_source/mocks'; +import { indexPatternMock } from '../../../../__mocks__/index_pattern'; +import { IUiSettingsClient } from 'kibana/public'; +import { DiscoverServices } from '../../../../build_services'; +import { dataPluginMock } from '../../../../../../data/public/mocks'; +import { SAMPLE_SIZE_SETTING } from '../../../../../common'; +import { SortOrder } from '../../../../saved_searches/types'; + +describe('updateSearchSource', () => { + test('updates a given search source', async () => { + const persistentSearchSourceMock = createSearchSourceMock({}); + const volatileSearchSourceMock = createSearchSourceMock({}); + volatileSearchSourceMock.setParent(persistentSearchSourceMock); + const sampleSize = 250; + updateSearchSource(volatileSearchSourceMock, false, { + indexPattern: indexPatternMock, + services: ({ + data: dataPluginMock.createStartContract(), + timefilter: { + createFilter: jest.fn(), + }, + uiSettings: ({ + get: (key: string) => { + if (key === SAMPLE_SIZE_SETTING) { + return sampleSize; + } + return false; + }, + } as unknown) as IUiSettingsClient, + } as unknown) as DiscoverServices, + sort: [] as SortOrder[], + useNewFieldsApi: false, + }); + expect(persistentSearchSourceMock.getField('index')).toEqual(indexPatternMock); + expect(volatileSearchSourceMock.getField('size')).toEqual(sampleSize); + expect(volatileSearchSourceMock.getField('fields')).toBe(undefined); + }); + + test('updates a given search source with the usage of the new fields api', async () => { + const persistentSearchSourceMock = createSearchSourceMock({}); + const volatileSearchSourceMock = createSearchSourceMock({}); + volatileSearchSourceMock.setParent(persistentSearchSourceMock); + const sampleSize = 250; + updateSearchSource(volatileSearchSourceMock, false, { + indexPattern: indexPatternMock, + services: ({ + data: dataPluginMock.createStartContract(), + timefilter: { + createFilter: jest.fn(), + }, + uiSettings: ({ + get: (key: string) => { + if (key === SAMPLE_SIZE_SETTING) { + return sampleSize; + } + return false; + }, + } as unknown) as IUiSettingsClient, + } as unknown) as DiscoverServices, + sort: [] as SortOrder[], + useNewFieldsApi: true, + }); + expect(persistentSearchSourceMock.getField('index')).toEqual(indexPatternMock); + expect(volatileSearchSourceMock.getField('size')).toEqual(sampleSize); + expect(volatileSearchSourceMock.getField('fields')).toEqual([ + { field: '*', include_unmapped: 'true' }, + ]); + expect(volatileSearchSourceMock.getField('fieldsFromSource')).toBe(undefined); + }); + + test('updates a given search source when showUnmappedFields option is set to true', async () => { + const persistentSearchSourceMock = createSearchSourceMock({}); + const volatileSearchSourceMock = createSearchSourceMock({}); + volatileSearchSourceMock.setParent(persistentSearchSourceMock); + const sampleSize = 250; + updateSearchSource(volatileSearchSourceMock, false, { + indexPattern: indexPatternMock, + services: ({ + data: dataPluginMock.createStartContract(), + timefilter: { + createFilter: jest.fn(), + }, + uiSettings: ({ + get: (key: string) => { + if (key === SAMPLE_SIZE_SETTING) { + return sampleSize; + } + return false; + }, + } as unknown) as IUiSettingsClient, + } as unknown) as DiscoverServices, + sort: [] as SortOrder[], + useNewFieldsApi: true, + }); + expect(persistentSearchSourceMock.getField('index')).toEqual(indexPatternMock); + expect(volatileSearchSourceMock.getField('size')).toEqual(sampleSize); + expect(volatileSearchSourceMock.getField('fields')).toEqual([ + { field: '*', include_unmapped: 'true' }, + ]); + expect(volatileSearchSourceMock.getField('fieldsFromSource')).toBe(undefined); + }); + + test('does not explicitly request fieldsFromSource when not using fields API', async () => { + const persistentSearchSourceMock = createSearchSourceMock({}); + const volatileSearchSourceMock = createSearchSourceMock({}); + volatileSearchSourceMock.setParent(persistentSearchSourceMock); + const sampleSize = 250; + updateSearchSource(volatileSearchSourceMock, false, { + indexPattern: indexPatternMock, + services: ({ + data: dataPluginMock.createStartContract(), + timefilter: { + createFilter: jest.fn(), + }, + uiSettings: ({ + get: (key: string) => { + if (key === SAMPLE_SIZE_SETTING) { + return sampleSize; + } + return false; + }, + } as unknown) as IUiSettingsClient, + } as unknown) as DiscoverServices, + sort: [] as SortOrder[], + useNewFieldsApi: false, + }); + expect(persistentSearchSourceMock.getField('index')).toEqual(indexPatternMock); + expect(volatileSearchSourceMock.getField('size')).toEqual(sampleSize); + expect(volatileSearchSourceMock.getField('fields')).toEqual(undefined); + expect(volatileSearchSourceMock.getField('fieldsFromSource')).toBe(undefined); + }); +}); diff --git a/src/plugins/discover/public/application/apps/main/utils/update_search_source.ts b/src/plugins/discover/public/application/apps/main/utils/update_search_source.ts new file mode 100644 index 00000000000000..c72e207102e814 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/utils/update_search_source.ts @@ -0,0 +1,74 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { getSortForSearchSource } from '../../../angular/doc_table'; +import { SAMPLE_SIZE_SETTING, SORT_DEFAULT_ORDER_SETTING } from '../../../../../common'; +import { IndexPattern, ISearchSource } from '../../../../../../data/common'; +import { SortOrder } from '../../../../saved_searches/types'; +import { DiscoverServices } from '../../../../build_services'; +import { indexPatterns as indexPatternsUtils } from '../../../../../../data/public'; + +/** + * Helper function to update the given searchSource before fetching/sharing/persisting + */ +export function updateSearchSource( + searchSource: ISearchSource, + persist = true, + { + indexPattern, + services, + sort, + useNewFieldsApi, + }: { + indexPattern: IndexPattern; + services: DiscoverServices; + sort: SortOrder[]; + useNewFieldsApi: boolean; + } +) { + const { uiSettings, data } = services; + const usedSort = getSortForSearchSource( + sort, + indexPattern, + uiSettings.get(SORT_DEFAULT_ORDER_SETTING) + ); + const usedSearchSource = persist ? searchSource : searchSource.getParent()!; + + usedSearchSource + .setField('index', indexPattern) + .setField('query', data.query.queryString.getQuery() || null) + .setField('filter', data.query.filterManager.getFilters()); + + if (!persist) { + searchSource + .setField('trackTotalHits', true) + .setField('size', uiSettings.get(SAMPLE_SIZE_SETTING)) + .setField('sort', usedSort) + .setField('highlightAll', true) + .setField('version', true) + // Even when searching rollups, we want to use the default strategy so that we get back a + // document-like response. + .setPreferredSearchStrategyId('default'); + + // this is not the default index pattern, it determines that it's not of type rollup + if (indexPatternsUtils.isDefault(indexPattern)) { + searchSource.setField('filter', data.query.timefilter.timefilter.createFilter(indexPattern)); + } + + if (useNewFieldsApi) { + searchSource.removeField('fieldsFromSource'); + const fields: Record = { field: '*' }; + + fields.include_unmapped = 'true'; + + searchSource.setField('fields', [fields]); + } else { + searchSource.removeField('fields'); + } + } +} diff --git a/src/plugins/discover/public/application/apps/main/utils/use_singleton.ts b/src/plugins/discover/public/application/apps/main/utils/use_singleton.ts new file mode 100644 index 00000000000000..bac195896caa3a --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/utils/use_singleton.ts @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import { useRef } from 'react'; + +/** + * Allows lazy initialization of a singleton + * Context: https://reactjs.org/docs/hooks-faq.html#how-to-create-expensive-objects-lazily + * Why not using useMemo: We're using the useMemo here also kind of as a guarantee to + * only instantiate that subject once. Unfortunately useMemo explicitly does not give + * those guarantees: + * https://reactjs.org/docs/hooks-reference.html#usememo + */ +export function useSingleton(initialize: () => T): T { + const ref = useRef(null); + + if (ref.current === null) { + ref.current = initialize(); + } + + return ref.current; +} diff --git a/src/plugins/discover/public/application/helpers/validate_time_range.test.ts b/src/plugins/discover/public/application/apps/main/utils/validate_time_range.test.ts similarity index 94% rename from src/plugins/discover/public/application/helpers/validate_time_range.test.ts rename to src/plugins/discover/public/application/apps/main/utils/validate_time_range.test.ts index cd90be434aa5e0..8d9d9adc4e8dcb 100644 --- a/src/plugins/discover/public/application/helpers/validate_time_range.test.ts +++ b/src/plugins/discover/public/application/apps/main/utils/validate_time_range.test.ts @@ -7,7 +7,7 @@ */ import { validateTimeRange } from './validate_time_range'; -import { notificationServiceMock } from '../../../../../core/public/mocks'; +import { notificationServiceMock } from '../../../../../../../core/public/mocks'; describe('Discover validateTimeRange', () => { test('validates given time ranges correctly', async () => { diff --git a/src/plugins/discover/public/application/helpers/validate_time_range.ts b/src/plugins/discover/public/application/apps/main/utils/validate_time_range.ts similarity index 100% rename from src/plugins/discover/public/application/helpers/validate_time_range.ts rename to src/plugins/discover/public/application/apps/main/utils/validate_time_range.ts diff --git a/src/plugins/discover/public/application/components/constants.ts b/src/plugins/discover/public/application/components/constants.ts deleted file mode 100644 index 42845e83b7435b..00000000000000 --- a/src/plugins/discover/public/application/components/constants.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -export const fetchStatuses = { - UNINITIALIZED: 'uninitialized', - LOADING: 'loading', - COMPLETE: 'complete', - ERROR: 'error', -}; diff --git a/src/plugins/discover/public/application/components/create_discover_directive.ts b/src/plugins/discover/public/application/components/create_discover_directive.ts deleted file mode 100644 index 049c9ac177eeab..00000000000000 --- a/src/plugins/discover/public/application/components/create_discover_directive.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ -import { Discover } from './discover'; - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export function createDiscoverDirective(reactDirective: any) { - return reactDirective(Discover, [ - ['fetch', { watchDepth: 'reference' }], - ['fetchCounter', { watchDepth: 'reference' }], - ['fetchError', { watchDepth: 'reference' }], - ['fieldCounts', { watchDepth: 'reference' }], - ['histogramData', { watchDepth: 'reference' }], - ['hits', { watchDepth: 'reference' }], - ['indexPattern', { watchDepth: 'reference' }], - ['opts', { watchDepth: 'reference' }], - ['resetQuery', { watchDepth: 'reference' }], - ['resultState', { watchDepth: 'reference' }], - ['fetchStatus', { watchDepth: 'reference' }], - ['rows', { watchDepth: 'reference' }], - ['savedSearch', { watchDepth: 'reference' }], - ['searchSource', { watchDepth: 'reference' }], - ['showSaveQuery', { watchDepth: 'reference' }], - ['state', { watchDepth: 'reference' }], - ['topNavMenu', { watchDepth: 'reference' }], - ['updateQuery', { watchDepth: 'reference' }], - ['updateSavedQueryId', { watchDepth: 'reference' }], - ['unmappedFieldsConfig', { watchDepth: 'value' }], - ['refreshAppState', { watchDepth: 'reference' }], - ]); -} diff --git a/src/plugins/discover/public/application/components/discover.scss b/src/plugins/discover/public/application/components/discover.scss deleted file mode 100644 index 02e60700d49d81..00000000000000 --- a/src/plugins/discover/public/application/components/discover.scss +++ /dev/null @@ -1,105 +0,0 @@ -@import '../../../../../core/public/mixins'; - -discover-app { - flex-grow: 1; -} - -.dscPage { - @include euiBreakpoint('m', 'l', 'xl') { - @include kibanaFullBodyHeight(); - } - - flex-direction: column; - overflow: hidden; - padding: 0; - - .dscPageBody { - overflow: hidden; - } -} - -.dscPageBody__inner { - overflow: hidden; - height: 100%; -} - -.dscPageBody__contents { - overflow: hidden; - padding-top: $euiSizeXS / 2; // A little breathing room for the index pattern button -} - -.dscPageContent__wrapper { - padding: 0 $euiSize $euiSize 0; - overflow: hidden; // Ensures horizontal scroll of table - - @include euiBreakpoint('xs', 's') { - padding: 0 $euiSize $euiSize; - } -} - -.dscPageContent { - border: $euiBorderThin; -} - -.dscPageContent, -.dscPageContent__inner { - height: 100%; -} - -.dscPageContent--centered { - height: auto; -} - -.dscResultCount { - padding: $euiSizeS; - min-height: $euiSize * 3; - - @include euiBreakpoint('xs', 's') { - .dscResultCount__toggle { - align-items: flex-end; - } - - .dscResuntCount__title, - .dscResultCount__actions { - margin-bottom: 0 !important; - } - } -} - -.dscTimechart { - display: block; - position: relative; - - // SASSTODO: the visualizing component should have an option or a modifier - .series > rect { - fill-opacity: .5; - stroke-width: 1; - } -} - -.dscHistogram { - display: flex; - height: $euiSize * 12.5; - padding: $euiSizeS; -} - -// new slimmer layout for data grid -.dscHistogramGrid { - display: flex; - height: $euiSize * 8; - padding: $euiSizeS $euiSizeS 0 $euiSizeS; -} - -.dscTable { - // SASSTODO: add a monospace modifier to the doc-table component - .kbnDocTable__row { - font-family: $euiCodeFontFamily; - font-size: $euiFontSizeXS; - } -} - -.dscTable__footer { - background-color: $euiColorLightShade; - padding: $euiSizeXS $euiSizeS; - text-align: center; -} diff --git a/src/plugins/discover/public/application/components/discover.test.tsx b/src/plugins/discover/public/application/components/discover.test.tsx deleted file mode 100644 index d804d608704219..00000000000000 --- a/src/plugins/discover/public/application/components/discover.test.tsx +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; -import { Discover } from './discover'; -import { esHits } from '../../__mocks__/es_hits'; -import { indexPatternMock } from '../../__mocks__/index_pattern'; -import { DiscoverServices } from '../../build_services'; -import { GetStateReturn } from '../angular/discover_state'; -import { savedSearchMock } from '../../__mocks__/saved_search'; -import { createSearchSourceMock } from '../../../../data/common/search/search_source/mocks'; -import { dataPluginMock } from '../../../../data/public/mocks'; -import { createFilterManagerMock } from '../../../../data/public/query/filter_manager/filter_manager.mock'; -import { uiSettingsMock as mockUiSettings } from '../../__mocks__/ui_settings'; -import { IndexPattern, IndexPatternAttributes } from '../../../../data/common/index_patterns'; -import { SavedObject } from '../../../../../core/types'; -import { navigationPluginMock } from '../../../../navigation/public/mocks'; -import { indexPatternWithTimefieldMock } from '../../__mocks__/index_pattern_with_timefield'; -import { calcFieldCounts } from '../helpers/calc_field_counts'; -import { DiscoverProps } from './types'; -import { RequestAdapter } from '../../../../inspector/common'; -import { Subject } from 'rxjs'; -import { DiscoverSearchSessionManager } from '../angular/discover_search_session'; - -const mockNavigation = navigationPluginMock.createStartContract(); - -jest.mock('../../kibana_services', () => { - return { - getServices: () => ({ - metadata: { - branch: 'test', - }, - capabilities: { - discover: { - save: true, - }, - }, - navigation: mockNavigation, - uiSettings: mockUiSettings, - }), - }; -}); - -function getProps(indexPattern: IndexPattern): DiscoverProps { - const searchSourceMock = createSearchSourceMock({}); - const services = ({ - capabilities: { - discover: { - save: true, - }, - }, - uiSettings: mockUiSettings, - } as unknown) as DiscoverServices; - - return { - fetch: jest.fn(), - fetchCounter: 0, - fetchError: undefined, - fetchStatus: 'loading', - fieldCounts: calcFieldCounts({}, esHits, indexPattern), - hits: esHits.length, - indexPattern, - minimumVisibleRows: 10, - onSkipBottomButtonClick: jest.fn(), - opts: { - config: mockUiSettings, - data: dataPluginMock.createStartContract(), - filterManager: createFilterManagerMock(), - getFieldCounts: jest.fn(), - indexPatternList: (indexPattern as unknown) as Array>, - inspectorAdapters: { requests: {} as RequestAdapter }, - navigateTo: jest.fn(), - refetch$: {} as Subject, - sampleSize: 10, - savedSearch: savedSearchMock, - searchSessionManager: {} as DiscoverSearchSessionManager, - setHeaderActionMenu: jest.fn(), - timefield: indexPattern.timeFieldName || '', - setAppState: jest.fn(), - services, - stateContainer: {} as GetStateReturn, - }, - resetQuery: jest.fn(), - resultState: 'ready', - rows: esHits, - searchSource: searchSourceMock, - state: { columns: [] }, - }; -} - -describe('Discover component', () => { - test('selected index pattern without time field displays no chart toggle', () => { - const component = shallowWithIntl(); - expect(component.find('[data-test-subj="discoverChartToggle"]').length).toBe(0); - }); - test('selected index pattern with time field displays chart toggle', () => { - const component = shallowWithIntl(); - expect(component.find('[data-test-subj="discoverChartToggle"]').length).toBe(1); - }); -}); diff --git a/src/plugins/discover/public/application/components/discover.tsx b/src/plugins/discover/public/application/components/discover.tsx deleted file mode 100644 index f962c56cc4690c..00000000000000 --- a/src/plugins/discover/public/application/components/discover.tsx +++ /dev/null @@ -1,462 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ -import './discover.scss'; -import React, { useState, useRef, useMemo, useCallback, useEffect } from 'react'; -import { - EuiButtonEmpty, - EuiButtonIcon, - EuiFlexGroup, - EuiFlexItem, - EuiHideFor, - EuiHorizontalRule, - EuiPage, - EuiPageBody, - EuiPageContent, - EuiSpacer, -} from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import moment from 'moment'; -import { METRIC_TYPE } from '@kbn/analytics'; -import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; -import classNames from 'classnames'; -import { HitsCounter } from './hits_counter'; -import { TimechartHeader } from './timechart_header'; -import { DiscoverHistogram, DiscoverUninitialized } from '../angular/directives'; -import { DiscoverNoResults } from './no_results'; -import { LoadingSpinner } from './loading_spinner/loading_spinner'; -import { DocTableLegacy } from '../angular/doc_table/create_doc_table_react'; -import { esFilters, IndexPatternField, search } from '../../../../data/public'; -import { DiscoverSidebarResponsive } from './sidebar'; -import { DiscoverProps } from './types'; -import { SortPairArr } from '../angular/doc_table/lib/get_sort'; -import { - DOC_HIDE_TIME_COLUMN_SETTING, - DOC_TABLE_LEGACY, - SEARCH_FIELDS_FROM_SOURCE, -} from '../../../common'; -import { popularizeField } from '../helpers/popularize_field'; -import { DocViewFilterFn } from '../doc_views/doc_views_types'; -import { DiscoverGrid } from './discover_grid/discover_grid'; -import { DiscoverTopNav } from './discover_topnav'; -import { ElasticSearchHit } from '../doc_views/doc_views_types'; -import { setBreadcrumbsTitle } from '../helpers/breadcrumbs'; -import { addHelpMenuToAppChrome } from './help_menu/help_menu_util'; -import { InspectorSession } from '../../../../inspector/public'; -import { useDataGridColumns } from '../helpers/use_data_grid_columns'; - -const DocTableLegacyMemoized = React.memo(DocTableLegacy); -const SidebarMemoized = React.memo(DiscoverSidebarResponsive); -const DataGridMemoized = React.memo(DiscoverGrid); -const TopNavMemoized = React.memo(DiscoverTopNav); -const TimechartHeaderMemoized = React.memo(TimechartHeader); -const DiscoverHistogramMemoized = React.memo(DiscoverHistogram); - -export function Discover({ - fetch, - fetchCounter, - fetchError, - fieldCounts, - fetchStatus, - histogramData, - hits, - indexPattern, - minimumVisibleRows, - opts, - resetQuery, - resultState, - rows, - searchSource, - state, - unmappedFieldsConfig, - refreshAppState, -}: DiscoverProps) { - const [expandedDoc, setExpandedDoc] = useState(undefined); - const [inspectorSession, setInspectorSession] = useState(undefined); - const scrollableDesktop = useRef(null); - const collapseIcon = useRef(null); - const isMobile = () => { - // collapse icon isn't displayed in mobile view, use it to detect which view is displayed - return collapseIcon && !collapseIcon.current; - }; - const toggleHideChart = useCallback(() => { - const newState = { ...state, hideChart: !state.hideChart }; - opts.stateContainer.setAppState(newState); - }, [state, opts]); - const hideChart = useMemo(() => state.hideChart, [state]); - const { savedSearch, indexPatternList, config, services, data, setAppState } = opts; - const { trackUiMetric, capabilities, indexPatterns, chrome, docLinks } = services; - - const [isSidebarClosed, setIsSidebarClosed] = useState(false); - const bucketInterval = useMemo(() => { - const bucketAggConfig = opts.chartAggConfigs?.aggs[1]; - return bucketAggConfig && search.aggs.isDateHistogramBucketAggConfig(bucketAggConfig) - ? bucketAggConfig.buckets?.getInterval() - : undefined; - }, [opts.chartAggConfigs]); - - const contentCentered = resultState === 'uninitialized'; - const isLegacy = services.uiSettings.get(DOC_TABLE_LEGACY); - const useNewFieldsApi = !services.uiSettings.get(SEARCH_FIELDS_FROM_SOURCE); - const updateQuery = useCallback( - (_payload, isUpdate?: boolean) => { - if (isUpdate === false) { - opts.searchSessionManager.removeSearchSessionIdFromURL({ replace: false }); - opts.refetch$.next(); - } - }, - [opts] - ); - - const { columns, onAddColumn, onRemoveColumn, onMoveColumn, onSetColumns } = useDataGridColumns({ - capabilities, - config, - indexPattern, - indexPatterns, - setAppState, - state, - useNewFieldsApi, - }); - - useEffect(() => { - const pageTitleSuffix = savedSearch.id && savedSearch.title ? `: ${savedSearch.title}` : ''; - chrome.docTitle.change(`Discover${pageTitleSuffix}`); - - setBreadcrumbsTitle(savedSearch, chrome); - addHelpMenuToAppChrome(chrome, docLinks); - }, [savedSearch, chrome, docLinks]); - - const onOpenInspector = useCallback(() => { - // prevent overlapping - setExpandedDoc(undefined); - const session = services.inspector.open(opts.inspectorAdapters, { - title: savedSearch.title, - }); - setInspectorSession(session); - }, [setExpandedDoc, opts.inspectorAdapters, savedSearch, services.inspector]); - - useEffect(() => { - return () => { - if (inspectorSession) { - // Close the inspector if this scope is destroyed (e.g. because the user navigates away). - inspectorSession.close(); - } - }; - }, [inspectorSession]); - - const onSort = useCallback( - (sort: string[][]) => { - setAppState({ sort }); - }, - [setAppState] - ); - - const onAddFilter = useCallback( - (field: IndexPatternField | string, values: string, operation: '+' | '-') => { - const fieldName = typeof field === 'string' ? field : field.name; - popularizeField(indexPattern, fieldName, indexPatterns); - const newFilters = esFilters.generateFilters( - opts.filterManager, - field, - values, - operation, - String(indexPattern.id) - ); - if (trackUiMetric) { - trackUiMetric(METRIC_TYPE.CLICK, 'filter_added'); - } - return opts.filterManager.addFilters(newFilters); - }, - [opts, indexPattern, indexPatterns, trackUiMetric] - ); - - const onChangeInterval = useCallback( - (interval: string) => { - if (interval) { - setAppState({ interval }); - } - }, - [setAppState] - ); - - const timefilterUpdateHandler = useCallback( - (ranges: { from: number; to: number }) => { - data.query.timefilter.timefilter.setTime({ - from: moment(ranges.from).toISOString(), - to: moment(ranges.to).toISOString(), - mode: 'absolute', - }); - }, - [data] - ); - - const onBackToTop = useCallback(() => { - if (scrollableDesktop && scrollableDesktop.current) { - scrollableDesktop.current.focus(); - } - // Only the desktop one needs to target a specific container - if (!isMobile() && scrollableDesktop.current) { - scrollableDesktop.current.scrollTo(0, 0); - } else if (window) { - window.scrollTo(0, 0); - } - }, [scrollableDesktop]); - - const onResize = useCallback( - (colSettings: { columnId: string; width: number }) => { - const grid = { ...state.grid } || {}; - const newColumns = { ...grid.columns } || {}; - newColumns[colSettings.columnId] = { - width: colSettings.width, - }; - const newGrid = { ...grid, columns: newColumns }; - opts.setAppState({ grid: newGrid }); - }, - [opts, state] - ); - - const onEditRuntimeField = () => { - if (refreshAppState) { - refreshAppState(); - } - }; - - return ( - - - - -

- {savedSearch.title} -

- - - - - - -
- - setIsSidebarClosed(!isSidebarClosed)} - data-test-subj="collapseSideBarButton" - aria-controls="discover-sidebar" - aria-expanded={isSidebarClosed ? 'false' : 'true'} - aria-label={i18n.translate('discover.toggleSidebarAriaLabel', { - defaultMessage: 'Toggle sidebar', - })} - buttonRef={collapseIcon} - /> -
-
-
- - - {resultState === 'none' && ( - - )} - {resultState === 'uninitialized' && } - {resultState === 'loading' && } - {resultState === 'ready' && ( - - - - - 0 ? hits : 0} - showResetButton={!!(savedSearch && savedSearch.id)} - onResetQuery={resetQuery} - /> - - {!hideChart && ( - - - - )} - {opts.timefield && ( - - { - toggleHideChart(); - }} - data-test-subj="discoverChartToggle" - > - {!hideChart - ? i18n.translate('discover.hideChart', { - defaultMessage: 'Hide chart', - }) - : i18n.translate('discover.showChart', { - defaultMessage: 'Show chart', - })} - - - )} - - - {!hideChart && opts.timefield && ( - -
- {opts.chartAggConfigs && histogramData && rows.length !== 0 && ( -
- -
- )} -
- -
- )} - - - - -
-

- -

- {isLegacy && rows && rows.length && ( - - )} - {!isLegacy && rows && rows.length && ( -
- -
- )} -
-
-
- )} -
-
-
-
-
-
- ); -} diff --git a/src/plugins/discover/public/application/components/discover_grid/discover_grid.scss b/src/plugins/discover/public/application/components/discover_grid/discover_grid.scss index 053b405b90acb2..48b99458377ade 100644 --- a/src/plugins/discover/public/application/components/discover_grid/discover_grid.scss +++ b/src/plugins/discover/public/application/components/discover_grid/discover_grid.scss @@ -47,6 +47,9 @@ // We only truncate if the cell is not a control column. .euiDataGridHeader { + // This display property is temporary until https://github.com/elastic/eui/issues/4729 is resolved. + display: flex; + .euiDataGridHeaderCell__content { @include euiTextTruncate; overflow: hidden; diff --git a/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.test.tsx b/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.test.tsx index 63d16af7de478a..60841799b1398b 100644 --- a/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.test.tsx +++ b/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.test.tsx @@ -143,4 +143,24 @@ describe('Discover flyout', function () { expect(props.setExpandedDoc).toHaveBeenCalledTimes(1); expect(props.setExpandedDoc.mock.calls[0][0]._id).toBe('4'); }); + + it('allows navigating with arrow keys through documents', () => { + const props = getProps(); + const component = mountWithIntl(); + findTestSubject(component, 'docTableDetailsFlyout').simulate('keydown', { key: 'ArrowRight' }); + expect(props.setExpandedDoc).toHaveBeenCalledWith(expect.objectContaining({ _id: '2' })); + component.setProps({ ...props, hit: props.hits[1] }); + findTestSubject(component, 'docTableDetailsFlyout').simulate('keydown', { key: 'ArrowLeft' }); + expect(props.setExpandedDoc).toHaveBeenCalledWith(expect.objectContaining({ _id: '1' })); + }); + + it('should not navigate with keypresses when already at the border of documents', () => { + const props = getProps(); + const component = mountWithIntl(); + findTestSubject(component, 'docTableDetailsFlyout').simulate('keydown', { key: 'ArrowLeft' }); + expect(props.setExpandedDoc).not.toHaveBeenCalled(); + component.setProps({ ...props, hit: props.hits[props.hits.length - 1] }); + findTestSubject(component, 'docTableDetailsFlyout').simulate('keydown', { key: 'ArrowRight' }); + expect(props.setExpandedDoc).not.toHaveBeenCalled(); + }); }); diff --git a/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx b/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx index 3894127891041c..aaae9afe6531a5 100644 --- a/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx +++ b/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx @@ -21,6 +21,7 @@ import { EuiPortal, EuiPagination, EuiHideFor, + keys, } from '@elastic/eui'; import { DocViewer } from '../doc_viewer/doc_viewer'; import { IndexPattern } from '../../../kibana_services'; @@ -87,9 +88,25 @@ export function DiscoverGridFlyout({ [hits, setExpandedDoc] ); + const onKeyDown = useCallback( + (ev: React.KeyboardEvent) => { + if (ev.key === keys.ARROW_LEFT || ev.key === keys.ARROW_RIGHT) { + ev.preventDefault(); + ev.stopPropagation(); + setPage(activePage + (ev.key === keys.ARROW_RIGHT ? 1 : -1)); + } + }, + [activePage, setPage] + ); + return ( - + >, - inspectorAdapters: { requests: {} as RequestAdapter }, - navigateTo: jest.fn(), - refetch$: {} as Subject, - sampleSize: 10, - savedSearch: savedSearchMock, - searchSessionManager: {} as DiscoverSearchSessionManager, - services, - setAppState: jest.fn(), - setHeaderActionMenu: jest.fn(), - stateContainer: {} as GetStateReturn, - timefield: indexPattern.timeFieldName || '', - }, - query: {} as Query, - savedQuery: '', - updateQuery: jest.fn(), - onOpenInspector: jest.fn(), - searchSource: {} as ISearchSource, - }; -} - -describe('Discover topnav component', () => { - test('setHeaderActionMenu was called', () => { - const props = getProps(); - mountWithIntl(); - expect(props.opts.setHeaderActionMenu).toHaveBeenCalled(); - }); -}); diff --git a/src/plugins/discover/public/application/components/discover_topnav.tsx b/src/plugins/discover/public/application/components/discover_topnav.tsx deleted file mode 100644 index c5c0df6e6f74a1..00000000000000 --- a/src/plugins/discover/public/application/components/discover_topnav.tsx +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ -import React, { useMemo } from 'react'; -import { DiscoverProps } from './types'; -import { getTopNavLinks } from './top_nav/get_top_nav_links'; -import { Query, TimeRange } from '../../../../data/common/query'; - -export type DiscoverTopNavProps = Pick & { - onOpenInspector: () => void; - query?: Query; - savedQuery?: string; - updateQuery: (payload: { dateRange: TimeRange; query?: Query }, isUpdate?: boolean) => void; -}; - -export const DiscoverTopNav = ({ - indexPattern, - opts, - onOpenInspector, - query, - savedQuery, - updateQuery, - searchSource, -}: DiscoverTopNavProps) => { - const showDatePicker = useMemo(() => indexPattern.isTimeBased(), [indexPattern]); - const { TopNavMenu } = opts.services.navigation.ui; - const topNavMenu = useMemo( - () => - getTopNavLinks({ - getFieldCounts: opts.getFieldCounts, - indexPattern, - navigateTo: opts.navigateTo, - savedSearch: opts.savedSearch, - services: opts.services, - state: opts.stateContainer, - onOpenInspector, - searchSource, - }), - [indexPattern, opts, onOpenInspector, searchSource] - ); - - const updateSavedQueryId = (newSavedQueryId: string | undefined) => { - const { appStateContainer, setAppState } = opts.stateContainer; - if (newSavedQueryId) { - setAppState({ savedQuery: newSavedQueryId }); - } else { - // remove savedQueryId from state - const newState = { - ...appStateContainer.getState(), - }; - delete newState.savedQuery; - appStateContainer.set(newState); - } - }; - return ( - - ); -}; diff --git a/src/plugins/discover/public/application/components/doc/use_es_doc_search.ts b/src/plugins/discover/public/application/components/doc/use_es_doc_search.ts index 6b8e912bbffba4..7a3320d43c8b51 100644 --- a/src/plugins/discover/public/application/components/doc/use_es_doc_search.ts +++ b/src/plugins/discover/public/application/components/doc/use_es_doc_search.ts @@ -33,7 +33,7 @@ export function buildSearchBody( useNewFieldsApi: boolean ): RequestBody | undefined { const computedFields = indexPattern.getComputedFields(); - const runtimeFields = computedFields.runtimeFields as estypes.RuntimeFields; + const runtimeFields = computedFields.runtimeFields as estypes.MappingRuntimeFields; const request: RequestBody = { body: { query: { diff --git a/src/plugins/discover/public/application/components/histogram/apply_aggs_to_search_source.test.ts b/src/plugins/discover/public/application/components/histogram/apply_aggs_to_search_source.test.ts deleted file mode 100644 index 5d2be533065e7a..00000000000000 --- a/src/plugins/discover/public/application/components/histogram/apply_aggs_to_search_source.test.ts +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ -import { indexPatternWithTimefieldMock } from '../../../__mocks__/index_pattern_with_timefield'; -import { SearchSource } from '../../../../../data/public'; -import { dataPluginMock } from '../../../../../data/public/mocks'; -import { applyAggsToSearchSource } from './apply_aggs_to_search_source'; - -describe('applyAggsToSearchSource', () => { - test('enabled = true', () => { - const indexPattern = indexPatternWithTimefieldMock; - const setField = jest.fn(); - const searchSource = ({ - setField, - removeField: jest.fn(), - } as unknown) as SearchSource; - - const dataMock = dataPluginMock.createStartContract(); - - const aggsConfig = applyAggsToSearchSource(true, searchSource, 'auto', indexPattern, dataMock); - - expect(aggsConfig!.aggs).toMatchInlineSnapshot(` - Array [ - Object { - "enabled": true, - "id": "1", - "params": Object {}, - "schema": "metric", - "type": "count", - }, - Object { - "enabled": true, - "id": "2", - "params": Object { - "drop_partials": false, - "extended_bounds": Object {}, - "field": "timestamp", - "interval": "auto", - "min_doc_count": 1, - "scaleMetricValues": false, - "useNormalizedEsInterval": true, - "used_interval": "0ms", - }, - "schema": "segment", - "type": "date_histogram", - }, - ] - `); - - expect(setField).toHaveBeenCalledWith('aggs', expect.any(Function)); - const dslFn = setField.mock.calls[0][1]; - expect(dslFn()).toMatchInlineSnapshot(` - Object { - "2": Object { - "date_histogram": Object { - "field": "timestamp", - "min_doc_count": 1, - "time_zone": "America/New_York", - }, - }, - } - `); - }); - - test('enabled = false', () => { - const indexPattern = indexPatternWithTimefieldMock; - const setField = jest.fn(); - const getField = jest.fn(() => { - return true; - }); - const removeField = jest.fn(); - const searchSource = ({ - getField, - setField, - removeField, - } as unknown) as SearchSource; - - const dataMock = dataPluginMock.createStartContract(); - - const aggsConfig = applyAggsToSearchSource(false, searchSource, 'auto', indexPattern, dataMock); - expect(aggsConfig).toBeFalsy(); - expect(getField).toHaveBeenCalledWith('aggs'); - expect(removeField).toHaveBeenCalledWith('aggs'); - }); -}); diff --git a/src/plugins/discover/public/application/components/histogram/apply_aggs_to_search_source.ts b/src/plugins/discover/public/application/components/histogram/apply_aggs_to_search_source.ts deleted file mode 100644 index c5fb366f81c8cd..00000000000000 --- a/src/plugins/discover/public/application/components/histogram/apply_aggs_to_search_source.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ -import { IndexPattern, SearchSource } from '../../../../../data/common'; -import { DataPublicPluginStart } from '../../../../../data/public'; - -/** - * Helper function to apply or remove aggregations to a given search source used for gaining data - * for Discover's histogram vis - */ -export function applyAggsToSearchSource( - enabled: boolean, - searchSource: SearchSource, - histogramInterval: string, - indexPattern: IndexPattern, - data: DataPublicPluginStart -) { - if (!enabled) { - if (searchSource.getField('aggs')) { - // clean up fields in case it was set before - searchSource.removeField('aggs'); - } - return; - } - const visStateAggs = [ - { - type: 'count', - schema: 'metric', - }, - { - type: 'date_histogram', - schema: 'segment', - params: { - field: indexPattern.timeFieldName!, - interval: histogramInterval, - timeRange: data.query.timefilter.timefilter.getTime(), - }, - }, - ]; - const chartAggConfigs = data.search.aggs.createAggConfigs(indexPattern, visStateAggs); - - searchSource.setField('aggs', function () { - return chartAggConfigs.toDsl(); - }); - return chartAggConfigs; -} diff --git a/src/plugins/discover/public/application/components/histogram/get_dimensions.test.ts b/src/plugins/discover/public/application/components/histogram/get_dimensions.test.ts deleted file mode 100644 index ad7031f3319924..00000000000000 --- a/src/plugins/discover/public/application/components/histogram/get_dimensions.test.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ -import { dataPluginMock } from '../../../../../data/public/mocks'; - -import { getDimensions } from './get_dimensions'; -import { indexPatternWithTimefieldMock } from '../../../__mocks__/index_pattern_with_timefield'; -import { SearchSource } from '../../../../../data/common/search/search_source'; -import { applyAggsToSearchSource } from './apply_aggs_to_search_source'; -import { calculateBounds } from '../../../../../data/common/query/timefilter'; - -test('getDimensions', () => { - const indexPattern = indexPatternWithTimefieldMock; - const setField = jest.fn(); - const searchSource = ({ - setField, - removeField: jest.fn(), - } as unknown) as SearchSource; - - const dataMock = dataPluginMock.createStartContract(); - dataMock.query.timefilter.timefilter.getTime = () => { - return { from: 'now-30y', to: 'now' }; - }; - dataMock.query.timefilter.timefilter.calculateBounds = (timeRange) => { - return calculateBounds(timeRange); - }; - - const aggsConfig = applyAggsToSearchSource(true, searchSource, 'auto', indexPattern, dataMock); - const actual = getDimensions(aggsConfig!, dataMock); - expect(actual).toMatchInlineSnapshot(` - Object { - "x": Object { - "accessor": 0, - "format": Object { - "id": "date", - "params": Object { - "pattern": "HH:mm:ss.SSS", - }, - }, - "label": "timestamp per 0 milliseconds", - "params": Object { - "bounds": undefined, - "date": true, - "format": "HH:mm:ss.SSS", - "interval": "P365D", - "intervalESUnit": "d", - "intervalESValue": 365, - }, - }, - "y": Object { - "accessor": 1, - "format": Object { - "id": "number", - }, - "label": "Count", - }, - } - `); -}); diff --git a/src/plugins/discover/public/application/components/histogram/get_dimensions.ts b/src/plugins/discover/public/application/components/histogram/get_dimensions.ts deleted file mode 100644 index 6743c1c8431b9b..00000000000000 --- a/src/plugins/discover/public/application/components/histogram/get_dimensions.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ -import moment from 'moment'; -import dateMath from '@elastic/datemath'; -import { IAggConfigs, TimeRangeBounds } from '../../../../../data/common'; -import { DataPublicPluginStart, search } from '../../../../../data/public'; - -export function getDimensions(aggs: IAggConfigs, data: DataPublicPluginStart) { - const [metric, agg] = aggs.aggs; - const { from, to } = data.query.timefilter.timefilter.getTime(); - agg.params.timeRange = { - from: dateMath.parse(from), - to: dateMath.parse(to, { roundUp: true }), - }; - const bounds = agg.params.timeRange - ? data.query.timefilter.timefilter.calculateBounds(agg.params.timeRange) - : null; - const buckets = search.aggs.isDateHistogramBucketAggConfig(agg) ? agg.buckets : undefined; - - if (!buckets) { - return; - } - - buckets.setBounds(bounds as TimeRangeBounds); - - const { esUnit, esValue } = buckets.getInterval(); - return { - x: { - accessor: 0, - label: agg.makeLabel(), - format: agg.toSerializedFieldFormat(), - params: { - date: true, - interval: moment.duration(esValue, esUnit), - intervalESValue: esValue, - intervalESUnit: esUnit, - format: buckets.getScaledDateFormat(), - bounds: buckets.getBounds(), - }, - }, - y: { - accessor: 1, - format: metric.toSerializedFieldFormat(), - label: metric.makeLabel(), - }, - }; -} diff --git a/src/plugins/discover/public/application/components/histogram/index.ts b/src/plugins/discover/public/application/components/histogram/index.ts deleted file mode 100644 index 4af75de0a029d8..00000000000000 --- a/src/plugins/discover/public/application/components/histogram/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -export { applyAggsToSearchSource } from './apply_aggs_to_search_source'; -export { getDimensions } from './get_dimensions'; diff --git a/src/plugins/discover/public/application/components/sidebar/discover_index_pattern.tsx b/src/plugins/discover/public/application/components/sidebar/discover_index_pattern.tsx deleted file mode 100644 index 021d5a0252f7ca..00000000000000 --- a/src/plugins/discover/public/application/components/sidebar/discover_index_pattern.tsx +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React, { useState, useEffect, useCallback } from 'react'; -import { IUiSettingsClient, SavedObject } from 'kibana/public'; -import { - IndexPattern, - IndexPatternAttributes, - IndexPatternsContract, -} from 'src/plugins/data/public'; -import { I18nProvider } from '@kbn/i18n/react'; - -import { IndexPatternRef } from './types'; -import { ChangeIndexPattern } from './change_indexpattern'; -import { getSwitchIndexPatternAppState } from '../../helpers/get_switch_index_pattern_app_state'; -import { SortPairArr } from '../../angular/doc_table/lib/get_sort'; -import { MODIFY_COLUMNS_ON_SWITCH, SORT_DEFAULT_ORDER_SETTING } from '../../../../common'; -import { AppState } from '../../angular/discover_state'; -export interface DiscoverIndexPatternProps { - /** - * Client of uiSettings - */ - config: IUiSettingsClient; - /** - * list of available index patterns, if length > 1, component offers a "change" link - */ - indexPatternList: Array>; - /** - * Index patterns service - */ - indexPatterns: IndexPatternsContract; - /** - * currently selected index pattern, due to angular issues it's undefined at first rendering - */ - selectedIndexPattern: IndexPattern; - /** - * Function to set the current state - */ - setAppState: (state: Partial) => void; - /** - * Discover App state - */ - state: AppState; -} - -/** - * Component allows you to select an index pattern in discovers side bar - */ -export function DiscoverIndexPattern({ - config, - indexPatternList, - selectedIndexPattern, - indexPatterns, - state, - setAppState, -}: DiscoverIndexPatternProps) { - const options: IndexPatternRef[] = (indexPatternList || []).map((entity) => ({ - id: entity.id, - title: entity.attributes!.title, - })); - const { id: selectedId, title: selectedTitle } = selectedIndexPattern || {}; - - const setIndexPattern = useCallback( - async (id: string) => { - const nextIndexPattern = await indexPatterns.get(id); - if (nextIndexPattern && selectedIndexPattern) { - const nextAppState = getSwitchIndexPatternAppState( - selectedIndexPattern, - nextIndexPattern, - state.columns || [], - (state.sort || []) as SortPairArr[], - config.get(MODIFY_COLUMNS_ON_SWITCH), - config.get(SORT_DEFAULT_ORDER_SETTING) - ); - setAppState(nextAppState); - } - }, - [selectedIndexPattern, state, config, indexPatterns, setAppState] - ); - - const [selected, setSelected] = useState({ - id: selectedId, - title: selectedTitle || '', - }); - useEffect(() => { - const { id, title } = selectedIndexPattern; - setSelected({ id, title }); - }, [selectedIndexPattern]); - if (!selectedId) { - return null; - } - - return ( - - { - const indexPattern = options.find((pattern) => pattern.id === id); - if (indexPattern) { - setIndexPattern(id); - setSelected(indexPattern); - } - }} - /> - - ); -} diff --git a/src/plugins/discover/public/application/components/sidebar/discover_sidebar.test.tsx b/src/plugins/discover/public/application/components/sidebar/discover_sidebar.test.tsx deleted file mode 100644 index 35d93095a1da31..00000000000000 --- a/src/plugins/discover/public/application/components/sidebar/discover_sidebar.test.tsx +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { each, cloneDeep } from 'lodash'; -import { ReactWrapper } from 'enzyme'; -import { findTestSubject } from '@elastic/eui/lib/test'; -// @ts-expect-error -import realHits from '../../../__fixtures__/real_hits.js'; -// @ts-expect-error -import stubbedLogstashFields from '../../../__fixtures__/logstash_fields'; -import { mountWithIntl } from '@kbn/test/jest'; -import React from 'react'; -import { DiscoverSidebarProps } from './discover_sidebar'; -import { coreMock } from '../../../../../../core/public/mocks'; -import { IndexPatternAttributes } from '../../../../../data/common'; -import { getStubIndexPattern } from '../../../../../data/public/test_utils'; -import { SavedObject } from '../../../../../../core/types'; -import { getDefaultFieldFilter } from './lib/field_filter'; -import { DiscoverSidebar } from './discover_sidebar'; -import { DiscoverServices } from '../../../build_services'; -import { ElasticSearchHit } from '../../doc_views/doc_views_types'; -import { configMock } from '../../../__mocks__/config'; -import { indexPatternsMock } from '../../../__mocks__/index_patterns'; - -const mockServices = ({ - history: () => ({ - location: { - search: '', - }, - }), - capabilities: { - visualize: { - show: true, - }, - discover: { - save: false, - }, - }, - uiSettings: { - get: (key: string) => { - if (key === 'fields:popularLimit') { - return 5; - } - }, - }, - indexPatternFieldEditor: { - openEditor: jest.fn(), - userPermissions: { - editIndexPattern: jest.fn(), - }, - }, -} as unknown) as DiscoverServices; - -jest.mock('../../../kibana_services', () => ({ - getServices: () => mockServices, -})); - -jest.mock('./lib/get_index_pattern_field_list', () => ({ - getIndexPatternFieldList: jest.fn((indexPattern) => indexPattern.fields), -})); - -function getCompProps(): DiscoverSidebarProps { - const indexPattern = getStubIndexPattern( - 'logstash-*', - (cfg: unknown) => cfg, - 'time', - stubbedLogstashFields(), - coreMock.createSetup() - ); - - // @ts-expect-error _.each() is passing additional args to flattenHit - const hits = (each(cloneDeep(realHits), indexPattern.flattenHit) as Array< - Record - >) as ElasticSearchHit[]; - - const indexPatternList = [ - { id: '0', attributes: { title: 'b' } } as SavedObject, - { id: '1', attributes: { title: 'a' } } as SavedObject, - { id: '2', attributes: { title: 'c' } } as SavedObject, - ]; - - const fieldCounts: Record = {}; - - for (const hit of hits) { - for (const key of Object.keys(indexPattern.flattenHit(hit))) { - fieldCounts[key] = (fieldCounts[key] || 0) + 1; - } - } - return { - config: configMock, - columns: ['extension'], - fieldCounts, - hits, - indexPatternList, - indexPatterns: indexPatternsMock, - onAddFilter: jest.fn(), - onAddField: jest.fn(), - onRemoveField: jest.fn(), - selectedIndexPattern: indexPattern, - services: mockServices, - state: {}, - trackUiMetric: jest.fn(), - fieldFilter: getDefaultFieldFilter(), - setFieldFilter: jest.fn(), - setAppState: jest.fn(), - onEditRuntimeField: jest.fn(), - editField: jest.fn(), - }; -} - -describe('discover sidebar', function () { - let props: DiscoverSidebarProps; - let comp: ReactWrapper; - - beforeAll(() => { - props = getCompProps(); - comp = mountWithIntl(); - }); - - it('should have Selected Fields and Available Fields with Popular Fields sections', function () { - const popular = findTestSubject(comp, 'fieldList-popular'); - const selected = findTestSubject(comp, 'fieldList-selected'); - const unpopular = findTestSubject(comp, 'fieldList-unpopular'); - expect(popular.children().length).toBe(1); - expect(unpopular.children().length).toBe(7); - expect(selected.children().length).toBe(1); - }); - it('should allow selecting fields', function () { - findTestSubject(comp, 'fieldToggle-bytes').simulate('click'); - expect(props.onAddField).toHaveBeenCalledWith('bytes'); - }); - it('should allow deselecting fields', function () { - findTestSubject(comp, 'fieldToggle-extension').simulate('click'); - expect(props.onRemoveField).toHaveBeenCalledWith('extension'); - }); -}); diff --git a/src/plugins/discover/public/application/components/table/table.tsx b/src/plugins/discover/public/application/components/table/table.tsx index 093b445267241b..7a100d24c386e0 100644 --- a/src/plugins/discover/public/application/components/table/table.tsx +++ b/src/plugins/discover/public/application/components/table/table.tsx @@ -10,7 +10,7 @@ import React, { useState, useEffect, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; import { DocViewTableRow } from './table_row'; import { trimAngularSpan } from './table_helper'; -import { isNestedFieldParent } from '../../helpers/nested_fields'; +import { isNestedFieldParent } from '../../apps/main/utils/nested_fields'; import { DocViewRenderProps } from '../../doc_views/doc_views_types'; const COLLAPSE_LINE_LENGTH = 350; diff --git a/src/plugins/discover/public/application/components/top_nav/on_save_search.test.tsx b/src/plugins/discover/public/application/components/top_nav/on_save_search.test.tsx deleted file mode 100644 index ed79d16fd5ff1c..00000000000000 --- a/src/plugins/discover/public/application/components/top_nav/on_save_search.test.tsx +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { showSaveModal } from '../../../../../saved_objects/public'; -jest.mock('../../../../../saved_objects/public'); - -import { onSaveSearch } from './on_save_search'; -import { indexPatternMock } from '../../../__mocks__/index_pattern'; -import { savedSearchMock } from '../../../__mocks__/saved_search'; -import { DiscoverServices } from '../../../build_services'; -import { GetStateReturn } from '../../angular/discover_state'; -import { i18nServiceMock } from '../../../../../../core/public/mocks'; - -test('onSaveSearch', async () => { - const serviceMock = ({ - core: { - i18n: i18nServiceMock.create(), - }, - } as unknown) as DiscoverServices; - const stateMock = ({} as unknown) as GetStateReturn; - - await onSaveSearch({ - indexPattern: indexPatternMock, - navigateTo: jest.fn(), - savedSearch: savedSearchMock, - services: serviceMock, - state: stateMock, - }); - - expect(showSaveModal).toHaveBeenCalled(); -}); diff --git a/src/plugins/discover/public/application/components/types.ts b/src/plugins/discover/public/application/components/types.ts deleted file mode 100644 index 93620bc1d6bca5..00000000000000 --- a/src/plugins/discover/public/application/components/types.ts +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { IUiSettingsClient, MountPoint, SavedObject } from 'kibana/public'; -import { Subject } from 'rxjs'; -import { Chart } from '../angular/helpers/point_series'; -import { IndexPattern } from '../../../../data/common/index_patterns/index_patterns'; -import { ElasticSearchHit } from '../doc_views/doc_views_types'; -import { AggConfigs } from '../../../../data/common/search/aggs'; - -import { - DataPublicPluginStart, - FilterManager, - IndexPatternAttributes, - ISearchSource, -} from '../../../../data/public'; -import { SavedSearch } from '../../saved_searches'; -import { AppState, GetStateReturn } from '../angular/discover_state'; -import { RequestAdapter } from '../../../../inspector/common'; -import { DiscoverServices } from '../../build_services'; -import { DiscoverSearchSessionManager } from '../angular/discover_search_session'; - -export interface DiscoverProps { - /** - * Function to fetch documents from Elasticsearch - */ - fetch: () => void; - /** - * Counter how often data was fetched (used for testing) - */ - fetchCounter: number; - /** - * Error in case of a failing document fetch - */ - fetchError?: Error; - /** - * Statistics by fields calculated using the fetched documents - */ - fieldCounts: Record; - /** - * Current state of data fetching - */ - fetchStatus: string; - /** - * Histogram aggregation data - */ - histogramData?: Chart; - /** - * Number of documents found by recent fetch - */ - hits: number; - /** - * Current IndexPattern - */ - indexPattern: IndexPattern; - /** - * Value needed for legacy "infinite" loading functionality - * Determins how much records are rendered using the legacy table - * Increased when scrolling down - */ - minimumVisibleRows: number; - /** - * Function to scroll down the legacy table to the bottom - */ - onSkipBottomButtonClick: () => void; - opts: { - /** - * Date histogram aggregation config - */ - chartAggConfigs?: AggConfigs; - /** - * Client of uiSettings - */ - config: IUiSettingsClient; - /** - * returns field statistics based on the loaded data sample - */ - getFieldCounts: () => Promise>; - /** - * Use angular router for navigation - */ - navigateTo: () => void; - /** - * Inspect, for analyzing requests and responses - */ - inspectorAdapters: { requests: RequestAdapter }; - /** - * Data plugin - */ - data: DataPublicPluginStart; - /** - * Data plugin filter manager - */ - filterManager: FilterManager; - /** - * List of available index patterns - */ - indexPatternList: Array>; - /** - * Refetch observable - */ - refetch$: Subject; - /** - * Kibana core services used by discover - */ - services: DiscoverServices; - /** - * Helps with state management of search session - */ - searchSessionManager: DiscoverSearchSessionManager; - /** - * The number of documents that can be displayed in the table/grid - */ - sampleSize: number; - /** - * Current instance of SavedSearch - */ - savedSearch: SavedSearch; - /** - * Function to set the header menu - */ - setHeaderActionMenu: (menuMount: MountPoint | undefined) => void; - /** - * Timefield of the currently used index pattern - */ - timefield: string; - /** - * Function to set the current state - */ - setAppState: (state: Partial) => void; - /** - * State container providing globalState, appState and functions - */ - stateContainer: GetStateReturn; - }; - /** - * Function to reset the current query - */ - resetQuery: () => void; - /** - * Current state of the actual query, one of 'uninitialized', 'loading' ,'ready', 'none' - */ - resultState: string; - /** - * Array of document of the recent successful search request - */ - rows: ElasticSearchHit[]; - /** - * Instance of SearchSource, the high level search API - */ - searchSource: ISearchSource; - /** - * Current app state of URL - */ - state: AppState; - /** - * An object containing properties for unmapped fields behavior - */ - unmappedFieldsConfig?: { - /** - * determines whether to display unmapped fields - */ - showUnmappedFields: boolean; - }; - - refreshAppState?: () => void; -} diff --git a/src/plugins/discover/public/application/helpers/columns.test.ts b/src/plugins/discover/public/application/helpers/columns.test.ts index df3884ab98bcff..6b6125193b5f37 100644 --- a/src/plugins/discover/public/application/helpers/columns.test.ts +++ b/src/plugins/discover/public/application/helpers/columns.test.ts @@ -43,4 +43,9 @@ describe('getDisplayedColumns', () => { ] `); }); + test('returns the same instance of ["_source"] over multiple calls', async () => { + const result = getDisplayedColumns([], indexPatternWithTimefieldMock); + const result2 = getDisplayedColumns([], indexPatternWithTimefieldMock); + expect(result).toBe(result2); + }); }); diff --git a/src/plugins/discover/public/application/helpers/columns.ts b/src/plugins/discover/public/application/helpers/columns.ts index 426059060f329b..6e77717c5cf054 100644 --- a/src/plugins/discover/public/application/helpers/columns.ts +++ b/src/plugins/discover/public/application/helpers/columns.ts @@ -8,6 +8,11 @@ import { IndexPattern } from '../../../../data/common'; +// We store this outside the function as a constant, so we're not creating a new array every time +// the function is returning this. A changing array might cause the data grid to think it got +// new columns, and thus performing worse than using the same array over multiple renders. +const SOURCE_ONLY = ['_source']; + /** * Function to provide fallback when * 1) no columns are given @@ -19,5 +24,5 @@ export function getDisplayedColumns(stateColumns: string[] = [], indexPattern: I // check if all columns where removed except the configured timeField (this can't be removed) !(stateColumns.length === 1 && stateColumns[0] === indexPattern.timeFieldName) ? stateColumns - : ['_source']; + : SOURCE_ONLY; } diff --git a/src/plugins/discover/public/application/helpers/get_result_state.test.ts b/src/plugins/discover/public/application/helpers/get_result_state.test.ts deleted file mode 100644 index 98e2b854ca5abe..00000000000000 --- a/src/plugins/discover/public/application/helpers/get_result_state.test.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ -import { getResultState, resultStatuses } from './get_result_state'; -import { fetchStatuses } from '../components/constants'; -import { ElasticSearchHit } from '../doc_views/doc_views_types'; - -describe('getResultState', () => { - test('fetching uninitialized', () => { - const actual = getResultState(fetchStatuses.UNINITIALIZED, []); - expect(actual).toBe(resultStatuses.UNINITIALIZED); - }); - - test('fetching complete with no records', () => { - const actual = getResultState(fetchStatuses.COMPLETE, []); - expect(actual).toBe(resultStatuses.NO_RESULTS); - }); - - test('fetching ongoing aka loading', () => { - const actual = getResultState(fetchStatuses.LOADING, []); - expect(actual).toBe(resultStatuses.LOADING); - }); - - test('fetching ready', () => { - const record = ({ _id: 123 } as unknown) as ElasticSearchHit; - const actual = getResultState(fetchStatuses.COMPLETE, [record]); - expect(actual).toBe(resultStatuses.READY); - }); - - test('re-fetching after already data is available', () => { - const record = ({ _id: 123 } as unknown) as ElasticSearchHit; - const actual = getResultState(fetchStatuses.LOADING, [record]); - expect(actual).toBe(resultStatuses.READY); - }); - - test('after a fetch error when data was successfully fetched before ', () => { - const record = ({ _id: 123 } as unknown) as ElasticSearchHit; - const actual = getResultState(fetchStatuses.ERROR, [record]); - expect(actual).toBe(resultStatuses.READY); - }); -}); diff --git a/src/plugins/discover/public/application/helpers/get_result_state.ts b/src/plugins/discover/public/application/helpers/get_result_state.ts deleted file mode 100644 index 6f69832f369fd1..00000000000000 --- a/src/plugins/discover/public/application/helpers/get_result_state.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ -import { ElasticSearchHit } from '../doc_views/doc_views_types'; -import { fetchStatuses } from '../components/constants'; - -export const resultStatuses = { - UNINITIALIZED: 'uninitialized', - LOADING: 'loading', // initial data load - READY: 'ready', // results came back - NO_RESULTS: 'none', // no results came back -}; - -/** - * Returns the current state of the result, depends on fetchStatus and the given fetched rows - * Determines what is displayed in Discover main view (loading view, data view, empty data view, ...) - */ -export function getResultState(fetchStatus: string, rows: ElasticSearchHit[]) { - if (fetchStatus === fetchStatuses.UNINITIALIZED) { - return resultStatuses.UNINITIALIZED; - } - - const rowsEmpty = !Array.isArray(rows) || rows.length === 0; - if (rowsEmpty && fetchStatus === fetchStatuses.LOADING) return resultStatuses.LOADING; - else if (!rowsEmpty) return resultStatuses.READY; - else return resultStatuses.NO_RESULTS; -} diff --git a/src/plugins/discover/public/application/helpers/get_state_defaults.test.ts b/src/plugins/discover/public/application/helpers/get_state_defaults.test.ts deleted file mode 100644 index 7ce5b9286c775c..00000000000000 --- a/src/plugins/discover/public/application/helpers/get_state_defaults.test.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { getStateDefaults } from './get_state_defaults'; -import { createSearchSourceMock, dataPluginMock } from '../../../../data/public/mocks'; -import { uiSettingsMock } from '../../__mocks__/ui_settings'; -import { indexPatternWithTimefieldMock } from '../../__mocks__/index_pattern_with_timefield'; -import { savedSearchMock } from '../../__mocks__/saved_search'; -import { indexPatternMock } from '../../__mocks__/index_pattern'; - -describe('getStateDefaults', () => { - test('index pattern with timefield', () => { - const actual = getStateDefaults({ - config: uiSettingsMock, - data: dataPluginMock.createStartContract(), - indexPattern: indexPatternWithTimefieldMock, - savedSearch: savedSearchMock, - searchSource: createSearchSourceMock({ index: indexPatternWithTimefieldMock }), - }); - expect(actual).toMatchInlineSnapshot(` - Object { - "columns": Array [ - "default_column", - ], - "filters": undefined, - "index": "index-pattern-with-timefield-id", - "interval": "auto", - "query": undefined, - "sort": Array [ - Array [ - "timestamp", - "desc", - ], - ], - } - `); - }); - - test('index pattern without timefield', () => { - const actual = getStateDefaults({ - config: uiSettingsMock, - data: dataPluginMock.createStartContract(), - indexPattern: indexPatternMock, - savedSearch: savedSearchMock, - searchSource: createSearchSourceMock({ index: indexPatternMock }), - }); - expect(actual).toMatchInlineSnapshot(` - Object { - "columns": Array [ - "default_column", - ], - "filters": undefined, - "index": "the-index-pattern-id", - "interval": "auto", - "query": undefined, - "sort": Array [], - } - `); - }); -}); diff --git a/src/plugins/discover/public/application/helpers/get_state_defaults.ts b/src/plugins/discover/public/application/helpers/get_state_defaults.ts deleted file mode 100644 index 3e012a1f85fd6b..00000000000000 --- a/src/plugins/discover/public/application/helpers/get_state_defaults.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { cloneDeep } from 'lodash'; -import { IUiSettingsClient } from 'kibana/public'; -import { DEFAULT_COLUMNS_SETTING, SORT_DEFAULT_ORDER_SETTING } from '../../../common'; -import { getSortArray } from '../angular/doc_table'; -import { getDefaultSort } from '../angular/doc_table/lib/get_default_sort'; -import { SavedSearch } from '../../saved_searches'; -import { SearchSource } from '../../../../data/common/search/search_source'; -import { DataPublicPluginStart, IndexPattern } from '../../../../data/public'; - -import { AppState } from '../angular/discover_state'; - -function getDefaultColumns(savedSearch: SavedSearch, config: IUiSettingsClient) { - if (savedSearch.columns && savedSearch.columns.length > 0) { - return [...savedSearch.columns]; - } - return [...config.get(DEFAULT_COLUMNS_SETTING)]; -} - -export function getStateDefaults({ - config, - data, - indexPattern, - savedSearch, - searchSource, -}: { - config: IUiSettingsClient; - data: DataPublicPluginStart; - indexPattern: IndexPattern; - savedSearch: SavedSearch; - searchSource: SearchSource; -}) { - const query = searchSource.getField('query') || data.query.queryString.getDefaultQuery(); - const sort = getSortArray(savedSearch.sort, indexPattern); - const columns = getDefaultColumns(savedSearch, config); - - const defaultState = { - query, - sort: !sort.length - ? getDefaultSort(indexPattern, config.get(SORT_DEFAULT_ORDER_SETTING, 'desc')) - : sort, - columns, - index: indexPattern.id, - interval: 'auto', - filters: cloneDeep(searchSource.getOwnField('filter')), - } as AppState; - if (savedSearch.grid) { - defaultState.grid = savedSearch.grid; - } - if (savedSearch.hideChart) { - defaultState.hideChart = savedSearch.hideChart; - } - - return defaultState; -} diff --git a/src/plugins/discover/public/application/helpers/update_search_source.test.ts b/src/plugins/discover/public/application/helpers/update_search_source.test.ts deleted file mode 100644 index d4e52c4e7d4fe8..00000000000000 --- a/src/plugins/discover/public/application/helpers/update_search_source.test.ts +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { updateSearchSource } from './update_search_source'; -import { createSearchSourceMock } from '../../../../data/common/search/search_source/mocks'; -import { indexPatternMock } from '../../__mocks__/index_pattern'; -import { IUiSettingsClient } from 'kibana/public'; -import { DiscoverServices } from '../../build_services'; -import { dataPluginMock } from '../../../../data/public/mocks'; -import { SAMPLE_SIZE_SETTING } from '../../../common'; -import { SortOrder } from '../../saved_searches/types'; - -describe('updateSearchSource', () => { - test('updates a given search source', async () => { - const persistentSearchSourceMock = createSearchSourceMock({}); - const volatileSearchSourceMock = createSearchSourceMock({}); - const sampleSize = 250; - updateSearchSource({ - persistentSearchSource: persistentSearchSourceMock, - volatileSearchSource: volatileSearchSourceMock, - indexPattern: indexPatternMock, - services: ({ - data: dataPluginMock.createStartContract(), - uiSettings: ({ - get: (key: string) => { - if (key === SAMPLE_SIZE_SETTING) { - return sampleSize; - } - return false; - }, - } as unknown) as IUiSettingsClient, - } as unknown) as DiscoverServices, - sort: [] as SortOrder[], - columns: [], - useNewFieldsApi: false, - }); - expect(persistentSearchSourceMock.getField('index')).toEqual(indexPatternMock); - expect(volatileSearchSourceMock.getField('size')).toEqual(sampleSize); - expect(volatileSearchSourceMock.getField('fields')).toBe(undefined); - }); - - test('updates a given search source with the usage of the new fields api', async () => { - const persistentSearchSourceMock = createSearchSourceMock({}); - const volatileSearchSourceMock = createSearchSourceMock({}); - const sampleSize = 250; - updateSearchSource({ - persistentSearchSource: persistentSearchSourceMock, - volatileSearchSource: volatileSearchSourceMock, - indexPattern: indexPatternMock, - services: ({ - data: dataPluginMock.createStartContract(), - uiSettings: ({ - get: (key: string) => { - if (key === SAMPLE_SIZE_SETTING) { - return sampleSize; - } - return false; - }, - } as unknown) as IUiSettingsClient, - } as unknown) as DiscoverServices, - sort: [] as SortOrder[], - columns: [], - useNewFieldsApi: true, - }); - expect(persistentSearchSourceMock.getField('index')).toEqual(indexPatternMock); - expect(volatileSearchSourceMock.getField('size')).toEqual(sampleSize); - expect(volatileSearchSourceMock.getField('fields')).toEqual([{ field: '*' }]); - expect(volatileSearchSourceMock.getField('fieldsFromSource')).toBe(undefined); - }); - - test('requests unmapped fields when the flag is provided, using the new fields api', async () => { - const persistentSearchSourceMock = createSearchSourceMock({}); - const volatileSearchSourceMock = createSearchSourceMock({}); - const sampleSize = 250; - updateSearchSource({ - persistentSearchSource: persistentSearchSourceMock, - volatileSearchSource: volatileSearchSourceMock, - indexPattern: indexPatternMock, - services: ({ - data: dataPluginMock.createStartContract(), - uiSettings: ({ - get: (key: string) => { - if (key === SAMPLE_SIZE_SETTING) { - return sampleSize; - } - return false; - }, - } as unknown) as IUiSettingsClient, - } as unknown) as DiscoverServices, - sort: [] as SortOrder[], - columns: [], - useNewFieldsApi: true, - showUnmappedFields: true, - }); - expect(persistentSearchSourceMock.getField('index')).toEqual(indexPatternMock); - expect(volatileSearchSourceMock.getField('size')).toEqual(sampleSize); - expect(volatileSearchSourceMock.getField('fields')).toEqual([ - { field: '*', include_unmapped: 'true' }, - ]); - expect(volatileSearchSourceMock.getField('fieldsFromSource')).toBe(undefined); - }); - - test('updates a given search source when showUnmappedFields option is set to true', async () => { - const persistentSearchSourceMock = createSearchSourceMock({}); - const volatileSearchSourceMock = createSearchSourceMock({}); - const sampleSize = 250; - updateSearchSource({ - persistentSearchSource: persistentSearchSourceMock, - volatileSearchSource: volatileSearchSourceMock, - indexPattern: indexPatternMock, - services: ({ - data: dataPluginMock.createStartContract(), - uiSettings: ({ - get: (key: string) => { - if (key === SAMPLE_SIZE_SETTING) { - return sampleSize; - } - return false; - }, - } as unknown) as IUiSettingsClient, - } as unknown) as DiscoverServices, - sort: [] as SortOrder[], - columns: [], - useNewFieldsApi: true, - showUnmappedFields: true, - }); - expect(persistentSearchSourceMock.getField('index')).toEqual(indexPatternMock); - expect(volatileSearchSourceMock.getField('size')).toEqual(sampleSize); - expect(volatileSearchSourceMock.getField('fields')).toEqual([ - { field: '*', include_unmapped: 'true' }, - ]); - expect(volatileSearchSourceMock.getField('fieldsFromSource')).toBe(undefined); - }); - - test('does not explicitly request fieldsFromSource when not using fields API', async () => { - const persistentSearchSourceMock = createSearchSourceMock({}); - const volatileSearchSourceMock = createSearchSourceMock({}); - const sampleSize = 250; - updateSearchSource({ - persistentSearchSource: persistentSearchSourceMock, - volatileSearchSource: volatileSearchSourceMock, - indexPattern: indexPatternMock, - services: ({ - data: dataPluginMock.createStartContract(), - uiSettings: ({ - get: (key: string) => { - if (key === SAMPLE_SIZE_SETTING) { - return sampleSize; - } - return false; - }, - } as unknown) as IUiSettingsClient, - } as unknown) as DiscoverServices, - sort: [] as SortOrder[], - columns: [], - useNewFieldsApi: false, - showUnmappedFields: false, - }); - expect(persistentSearchSourceMock.getField('index')).toEqual(indexPatternMock); - expect(volatileSearchSourceMock.getField('size')).toEqual(sampleSize); - expect(volatileSearchSourceMock.getField('fields')).toEqual(undefined); - expect(volatileSearchSourceMock.getField('fieldsFromSource')).toBe(undefined); - }); -}); diff --git a/src/plugins/discover/public/application/helpers/update_search_source.ts b/src/plugins/discover/public/application/helpers/update_search_source.ts deleted file mode 100644 index 07529ac8cb0d68..00000000000000 --- a/src/plugins/discover/public/application/helpers/update_search_source.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { getSortForSearchSource } from '../angular/doc_table'; -import { SAMPLE_SIZE_SETTING, SORT_DEFAULT_ORDER_SETTING } from '../../../common'; -import { IndexPattern, ISearchSource } from '../../../../data/common/'; -import { SortOrder } from '../../saved_searches/types'; -import { DiscoverServices } from '../../build_services'; - -/** - * Helper function to update the given searchSource before fetching/sharing/persisting - */ -export function updateSearchSource({ - indexPattern, - services, - sort, - columns, - useNewFieldsApi, - showUnmappedFields, - persistentSearchSource, - volatileSearchSource, -}: { - indexPattern: IndexPattern; - services: DiscoverServices; - sort: SortOrder[]; - columns: string[]; - useNewFieldsApi: boolean; - showUnmappedFields?: boolean; - persistentSearchSource: ISearchSource; - volatileSearchSource?: ISearchSource; -}) { - const { uiSettings, data } = services; - const usedSort = getSortForSearchSource( - sort, - indexPattern, - uiSettings.get(SORT_DEFAULT_ORDER_SETTING) - ); - - persistentSearchSource - .setField('index', indexPattern) - .setField('query', data.query.queryString.getQuery() || null) - .setField('filter', data.query.filterManager.getFilters()); - - if (volatileSearchSource) { - volatileSearchSource - .setField('size', uiSettings.get(SAMPLE_SIZE_SETTING)) - .setField('sort', usedSort) - .setField('highlightAll', true) - .setField('version', true) - // Even when searching rollups, we want to use the default strategy so that we get back a - // document-like response. - .setPreferredSearchStrategyId('default'); - - if (useNewFieldsApi) { - volatileSearchSource.removeField('fieldsFromSource'); - const fields: Record = { field: '*' }; - if (showUnmappedFields) { - fields.include_unmapped = 'true'; - } - volatileSearchSource.setField('fields', [fields]); - } else { - volatileSearchSource.removeField('fields'); - } - } -} diff --git a/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts b/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts index c913b9abd1b433..418cbf6eac9cdb 100644 --- a/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts +++ b/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts @@ -13,7 +13,7 @@ import { IndexPattern, IndexPatternsContract } from '../../kibana_services'; import { AppState as DiscoverState, GetStateReturn as DiscoverGetStateReturn, -} from '../angular/discover_state'; +} from '../apps/main/services/discover_state'; import { AppState as ContextState, GetStateReturn as ContextGetStateReturn, diff --git a/src/plugins/discover/public/application/types.ts b/src/plugins/discover/public/application/types.ts new file mode 100644 index 00000000000000..4d7f47182e98a3 --- /dev/null +++ b/src/plugins/discover/public/application/types.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export enum FetchStatus { + UNINITIALIZED = 'uninitialized', + LOADING = 'loading', + COMPLETE = 'complete', + ERROR = 'error', +} diff --git a/src/plugins/discover/public/build_services.ts b/src/plugins/discover/public/build_services.ts index 19ee06aa517985..b42bf6a81742c6 100644 --- a/src/plugins/discover/public/build_services.ts +++ b/src/plugins/discover/public/build_services.ts @@ -56,7 +56,7 @@ export interface DiscoverServices { urlForwarding: UrlForwardingStart; timefilter: TimefilterContract; toastNotifications: ToastsStart; - getSavedSearchById: (id: string) => Promise; + getSavedSearchById: (id?: string) => Promise; getSavedSearchUrlById: (id: string) => Promise; getEmbeddableInjector: () => Promise; uiSettings: IUiSettingsClient; @@ -87,7 +87,7 @@ export async function buildServices( theme: plugins.charts.theme, filterManager: plugins.data.query.filterManager, getEmbeddableInjector, - getSavedSearchById: async (id: string) => savedObjectService.get(id), + getSavedSearchById: async (id?: string) => savedObjectService.get(id), getSavedSearchUrlById: async (id: string) => savedObjectService.urlFor(id), history: getHistory, indexPatterns: plugins.data.indexPatterns, diff --git a/src/plugins/discover/public/plugin.tsx b/src/plugins/discover/public/plugin.tsx index 3f55ab76372bc4..139b23d28a1d43 100644 --- a/src/plugins/discover/public/plugin.tsx +++ b/src/plugins/discover/public/plugin.tsx @@ -329,7 +329,7 @@ export class DiscoverPlugin return; } // this is used by application mount and tests - const { getInnerAngularModule } = await import('./get_inner_angular'); + const { getInnerAngularModule } = await import('./application/angular/get_inner_angular'); const module = getInnerAngularModule( innerAngularName, core, @@ -400,7 +400,9 @@ export class DiscoverPlugin } const { core, plugins } = await this.initializeServices(); getServices().kibanaLegacy.loadFontAwesome(); - const { getInnerAngularModuleEmbeddable } = await import('./get_inner_angular'); + const { getInnerAngularModuleEmbeddable } = await import( + './application/angular/get_inner_angular' + ); getInnerAngularModuleEmbeddable(embeddableAngularName, core, plugins); const mountpoint = document.createElement('div'); this.embeddableInjector = angular.bootstrap(mountpoint, [embeddableAngularName]); diff --git a/src/plugins/discover/public/shared/index.ts b/src/plugins/discover/public/shared/index.ts index b1e4d9d87000ec..c82ac074db1114 100644 --- a/src/plugins/discover/public/shared/index.ts +++ b/src/plugins/discover/public/shared/index.ts @@ -10,5 +10,5 @@ * Allows the getSharingData function to be lazy loadable */ export async function loadSharingDataHelpers() { - return await import('../application/helpers/get_sharing_data'); + return await import('../application/apps/main/utils/get_sharing_data'); } diff --git a/src/plugins/discover/public/url_generator.ts b/src/plugins/discover/public/url_generator.ts index 21bdbf225d6aa5..63dea20fecc0a1 100644 --- a/src/plugins/discover/public/url_generator.ts +++ b/src/plugins/discover/public/url_generator.ts @@ -6,16 +6,10 @@ * Side Public License, v 1. */ -import { - TimeRange, - Filter, - Query, - esFilters, - QueryState, - RefreshInterval, -} from '../../data/public'; +import type { UrlGeneratorsDefinition } from '../../share/public'; +import type { TimeRange, Filter, Query, QueryState, RefreshInterval } from '../../data/public'; +import { esFilters } from '../../data/public'; import { setStateToKbnUrl } from '../../kibana_utils/public'; -import { UrlGeneratorsDefinition } from '../../share/public'; export const DISCOVER_APP_URL_GENERATOR = 'DISCOVER_APP_URL_GENERATOR'; @@ -71,10 +65,12 @@ export interface DiscoverUrlGeneratorState { * Used interval of the histogram */ interval?: string; + /** * Array of the used sorting [[field,direction],...] */ sort?: string[][]; + /** * id of the used saved query */ diff --git a/src/plugins/embeddable/common/lib/migrate.ts b/src/plugins/embeddable/common/lib/migrate.ts index 0a9cd0760eb2ce..fb8ea5cf2cd84e 100644 --- a/src/plugins/embeddable/common/lib/migrate.ts +++ b/src/plugins/embeddable/common/lib/migrate.ts @@ -26,9 +26,11 @@ export const getMigrateFunction = (embeddables: CommonEmbeddableStartContract) = updatedInput.enhancements = {}; Object.keys(enhancements).forEach((key) => { if (!enhancements[key]) return; - (updatedInput.enhancements! as Record)[key] = embeddables - .getEnhancement(key) - .migrations[version](enhancements[key] as SerializableState); + const enhancementDefinition = embeddables.getEnhancement(key); + const migratedEnhancement = enhancementDefinition?.migrations?.[version] + ? enhancementDefinition.migrations[version](enhancements[key] as SerializableState) + : enhancements[key]; + (updatedInput.enhancements! as Record)[key] = migratedEnhancement; }); return updatedInput; diff --git a/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx b/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx index 3e6d28e0664698..9eb743a3911c2c 100644 --- a/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx +++ b/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { get } from 'lodash'; +import { get, omit } from 'lodash'; import { I18nStart, NotificationsStart } from 'src/core/public'; import { SavedObjectSaveModal, OnSaveProps, SaveResult } from '../../../../saved_objects/public'; import { @@ -150,12 +150,10 @@ export class AttributeService< const wrappedInput = (await this.wrapAttributes(newAttributes, true)) as RefType; // Remove unneeded attributes from the original input. - delete (input as { [ATTRIBUTE_SERVICE_KEY]?: SavedObjectAttributes })[ - ATTRIBUTE_SERVICE_KEY - ]; + const newInput = omit(input, ATTRIBUTE_SERVICE_KEY); // Combine input and wrapped input to preserve any passed in explicit Input. - resolve({ ...input, ...wrappedInput }); + resolve({ ...newInput, ...wrappedInput }); return { id: wrappedInput.savedObjectId }; } catch (error) { reject(error); diff --git a/src/plugins/embeddable/public/plugin.test.ts b/src/plugins/embeddable/public/plugin.test.ts index 2e7d8c73cfc6da..53302e8e6870ce 100644 --- a/src/plugins/embeddable/public/plugin.test.ts +++ b/src/plugins/embeddable/public/plugin.test.ts @@ -184,4 +184,12 @@ describe('embeddable enhancements', () => { embeddableState.enhancements.test ); }); + + test('doesnt fail if there is no migration function registered for specific version', () => { + expect(() => { + start.migrate(embeddableState, '7.10.0'); + }).not.toThrow(); + + expect(start.migrate(embeddableState, '7.10.0')).toEqual(embeddableState); + }); }); diff --git a/src/plugins/expressions/common/executor/executor.test.ts b/src/plugins/expressions/common/executor/executor.test.ts index 6175c9e170a906..3c24a3c24e01bc 100644 --- a/src/plugins/expressions/common/executor/executor.test.ts +++ b/src/plugins/expressions/common/executor/executor.test.ts @@ -52,12 +52,6 @@ describe('Executor', () => { executor.registerFunction(expressionFunctions.clog); }); - test('can register all functions', () => { - const executor = new Executor(); - for (const functionDefinition of expressionFunctions.functionSpecs) - executor.registerFunction(functionDefinition); - }); - test('can retrieve all functions', () => { const executor = new Executor(); executor.registerFunction(expressionFunctions.clog); @@ -67,12 +61,24 @@ describe('Executor', () => { test('can retrieve all functions - 2', () => { const executor = new Executor(); - for (const functionDefinition of expressionFunctions.functionSpecs) + const functionSpecs = [ + expressionFunctions.clog, + expressionFunctions.font, + expressionFunctions.variableSet, + expressionFunctions.variable, + expressionFunctions.theme, + expressionFunctions.cumulativeSum, + expressionFunctions.derivative, + expressionFunctions.movingAverage, + expressionFunctions.mapColumn, + expressionFunctions.math, + ]; + for (const functionDefinition of functionSpecs) { executor.registerFunction(functionDefinition); + } const functions = executor.getFunctions(); - expect(Object.keys(functions).sort()).toEqual( - expressionFunctions.functionSpecs.map((spec) => spec.name).sort() - ); + + expect(Object.keys(functions).sort()).toEqual(functionSpecs.map((spec) => spec.name).sort()); }); }); diff --git a/src/plugins/expressions/common/executor/executor.ts b/src/plugins/expressions/common/executor/executor.ts index 1eea51a0e1ec45..a307172aff9737 100644 --- a/src/plugins/expressions/common/executor/executor.ts +++ b/src/plugins/expressions/common/executor/executor.ts @@ -19,7 +19,6 @@ import { ExpressionType } from '../expression_types/expression_type'; import { AnyExpressionTypeDefinition } from '../expression_types/types'; import { ExpressionAstExpression, ExpressionAstFunction } from '../ast'; import { ExpressionValueError, typeSpecs } from '../expression_types/specs'; -import { functionSpecs } from '../expression_functions/specs'; import { getByAlias } from '../util'; import { SavedObjectReference } from '../../../../core/types'; import { PersistableStateService, SerializableState } from '../../../kibana_utils/common'; @@ -85,7 +84,7 @@ export class Executor = Record { const executor = new Executor(state); for (const type of typeSpecs) executor.registerType(type); - for (const func of functionSpecs) executor.registerFunction(func); + return executor; } diff --git a/src/plugins/expressions/common/expression_functions/specs/index.ts b/src/plugins/expressions/common/expression_functions/specs/index.ts index 9408b3a4337120..20a6f9aac45674 100644 --- a/src/plugins/expressions/common/expression_functions/specs/index.ts +++ b/src/plugins/expressions/common/expression_functions/specs/index.ts @@ -6,31 +6,6 @@ * Side Public License, v 1. */ -import { clog } from './clog'; -import { font } from './font'; -import { variableSet } from './var_set'; -import { variable } from './var'; -import { AnyExpressionFunctionDefinition } from '../types'; -import { theme } from './theme'; -import { cumulativeSum } from './cumulative_sum'; -import { derivative } from './derivative'; -import { movingAverage } from './moving_average'; -import { mapColumn } from './map_column'; -import { math } from './math'; - -export const functionSpecs: AnyExpressionFunctionDefinition[] = [ - clog, - font, - variableSet, - variable, - theme, - cumulativeSum, - derivative, - movingAverage, - mapColumn, - math, -]; - export * from './clog'; export * from './font'; export * from './var_set'; @@ -39,5 +14,6 @@ export * from './theme'; export * from './cumulative_sum'; export * from './derivative'; export * from './moving_average'; +export * from './ui_setting'; export { mapColumn, MapColumnArguments } from './map_column'; export { math, MathArguments, MathInput } from './math'; diff --git a/src/plugins/expressions/common/expression_functions/specs/map_column.ts b/src/plugins/expressions/common/expression_functions/specs/map_column.ts index 7939441ff0d602..d6af19d9dbf531 100644 --- a/src/plugins/expressions/common/expression_functions/specs/map_column.ts +++ b/src/plugins/expressions/common/expression_functions/specs/map_column.ts @@ -10,7 +10,7 @@ import { Observable } from 'rxjs'; import { take } from 'rxjs/operators'; import { i18n } from '@kbn/i18n'; import { ExpressionFunctionDefinition } from '../types'; -import { Datatable, getType } from '../../expression_types'; +import { Datatable, DatatableColumn, getType } from '../../expression_types'; export interface MapColumnArguments { id?: string | null; @@ -110,10 +110,10 @@ export const mapColumn: ExpressionFunctionDefinition< return Promise.all(rowPromises).then((rows) => { const type = rows.length ? getType(rows[0][columnId]) : 'null'; - const newColumn = { + const newColumn: DatatableColumn = { id: columnId, name: args.name, - meta: { type }, + meta: { type, params: { id: type } }, }; if (args.copyMetaFrom) { const metaSourceFrom = columns.find(({ id }) => id === args.copyMetaFrom); diff --git a/src/plugins/expressions/common/expression_functions/specs/tests/map_column.test.ts b/src/plugins/expressions/common/expression_functions/specs/tests/map_column.test.ts index f5c1f3838f66c7..bb4e6303e90b7d 100644 --- a/src/plugins/expressions/common/expression_functions/specs/tests/map_column.test.ts +++ b/src/plugins/expressions/common/expression_functions/specs/tests/map_column.test.ts @@ -29,7 +29,11 @@ describe('mapColumn', () => { expect(result.type).toBe('datatable'); expect(result.columns).toEqual([ ...testTable.columns, - { id: 'pricePlusTwo', name: 'pricePlusTwo', meta: { type: 'number' } }, + { + id: 'pricePlusTwo', + name: 'pricePlusTwo', + meta: { type: 'number', params: { id: 'number' } }, + }, ]); expect(result.columns[result.columns.length - 1]).toHaveProperty('name', 'pricePlusTwo'); expect(result.rows[arbitraryRowIndex]).toHaveProperty('pricePlusTwo'); diff --git a/src/plugins/expressions/common/expression_functions/specs/tests/ui_setting.test.ts b/src/plugins/expressions/common/expression_functions/specs/tests/ui_setting.test.ts new file mode 100644 index 00000000000000..fb2c87588a4d47 --- /dev/null +++ b/src/plugins/expressions/common/expression_functions/specs/tests/ui_setting.test.ts @@ -0,0 +1,78 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +jest.mock('../../../../common'); + +import { IUiSettingsClient } from 'src/core/public'; +import { getUiSettingFn } from '../ui_setting'; + +describe('uiSetting', () => { + describe('fn', () => { + let getStartDependencies: jest.MockedFunction< + Parameters[0]['getStartDependencies'] + >; + let uiSetting: ReturnType; + let uiSettings: jest.Mocked; + + beforeEach(() => { + uiSettings = ({ + get: jest.fn(), + } as unknown) as jest.Mocked; + getStartDependencies = (jest.fn(async () => ({ + uiSettings, + })) as unknown) as typeof getStartDependencies; + + uiSetting = getUiSettingFn({ getStartDependencies }); + }); + + it('should return a value', () => { + uiSettings.get.mockReturnValueOnce('value'); + + expect(uiSetting.fn(null, { parameter: 'something' }, {} as any)).resolves.toEqual({ + type: 'ui_setting', + key: 'something', + value: 'value', + }); + }); + + it('should pass a default value', async () => { + await uiSetting.fn(null, { parameter: 'something', default: 'default' }, {} as any); + + expect(uiSettings.get).toHaveBeenCalledWith('something', 'default'); + }); + + it('should throw an error when parameter does not exist', () => { + uiSettings.get.mockImplementationOnce(() => { + throw new Error(); + }); + + expect(uiSetting.fn(null, { parameter: 'something' }, {} as any)).rejects.toEqual( + new Error('Invalid parameter "something".') + ); + }); + + it('should get a request instance on the server-side', async () => { + const request = {}; + await uiSetting.fn(null, { parameter: 'something' }, { + getKibanaRequest: () => request, + } as any); + + const [[getKibanaRequest]] = getStartDependencies.mock.calls; + + expect(getKibanaRequest()).toBe(request); + }); + + it('should throw an error if request is not provided on the server-side', async () => { + await uiSetting.fn(null, { parameter: 'something' }, {} as any); + + const [[getKibanaRequest]] = getStartDependencies.mock.calls; + + expect(getKibanaRequest).toThrow(); + }); + }); +}); diff --git a/src/plugins/expressions/common/expression_functions/specs/ui_setting.ts b/src/plugins/expressions/common/expression_functions/specs/ui_setting.ts new file mode 100644 index 00000000000000..8e352e12d49c59 --- /dev/null +++ b/src/plugins/expressions/common/expression_functions/specs/ui_setting.ts @@ -0,0 +1,94 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import type { KibanaRequest } from 'src/core/server'; +import { i18n } from '@kbn/i18n'; +import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common'; +import { UiSetting } from '../../expression_types/specs/ui_setting'; + +interface UiSettingsClient { + get(key: string, defaultValue?: T): T | Promise; +} + +interface UiSettingStartDependencies { + uiSettings: UiSettingsClient; +} + +interface UiSettingFnArguments { + getStartDependencies(getKibanaRequest: () => KibanaRequest): Promise; +} + +export interface UiSettingArguments { + default?: unknown; + parameter: string; +} + +export type ExpressionFunctionUiSetting = ExpressionFunctionDefinition< + 'uiSetting', + unknown, + UiSettingArguments, + Promise +>; + +export function getUiSettingFn({ + getStartDependencies, +}: UiSettingFnArguments): ExpressionFunctionUiSetting { + return { + name: 'uiSetting', + help: i18n.translate('expressions.functions.uiSetting.help', { + defaultMessage: 'Returns a UI settings parameter value.', + }), + args: { + default: { + help: i18n.translate('expressions.functions.uiSetting.args.default', { + defaultMessage: 'A default value in case of the parameter is not set.', + }), + }, + parameter: { + aliases: ['_'], + help: i18n.translate('expressions.functions.uiSetting.args.parameter', { + defaultMessage: 'The parameter name.', + }), + required: true, + types: ['string'], + }, + }, + async fn(input, { default: defaultValue, parameter }, { getKibanaRequest }) { + const { uiSettings } = await getStartDependencies(() => { + const request = getKibanaRequest?.(); + if (!request) { + throw new Error( + i18n.translate('expressions.functions.uiSetting.error.kibanaRequest', { + defaultMessage: + 'A KibanaRequest is required to get UI settings on the server. ' + + 'Please provide a request object to the expression execution params.', + }) + ); + } + + return request; + }); + + try { + return { + type: 'ui_setting', + key: parameter, + value: await uiSettings.get(parameter, defaultValue), + }; + } catch { + throw new Error( + i18n.translate('expressions.functions.uiSetting.error.parameter', { + defaultMessage: 'Invalid parameter "{parameter}".', + values: { parameter }, + }) + ); + } + }, + }; +} diff --git a/src/plugins/expressions/common/expression_types/specs/index.ts b/src/plugins/expressions/common/expression_types/specs/index.ts index 70427f8b337d89..c990d74672fcc4 100644 --- a/src/plugins/expressions/common/expression_types/specs/index.ts +++ b/src/plugins/expressions/common/expression_types/specs/index.ts @@ -21,6 +21,7 @@ import { shape } from './shape'; import { string } from './string'; import { style } from './style'; import { AnyExpressionTypeDefinition } from '../types'; +import { uiSetting } from './ui_setting'; export const typeSpecs: AnyExpressionTypeDefinition[] = [ boolean, @@ -37,6 +38,7 @@ export const typeSpecs: AnyExpressionTypeDefinition[] = [ shape, string, style, + uiSetting, ]; export * from './boolean'; @@ -53,3 +55,4 @@ export * from './render'; export * from './shape'; export * from './string'; export * from './style'; +export * from './ui_setting'; diff --git a/src/plugins/expressions/common/expression_types/specs/tests/ui_setting.test.ts b/src/plugins/expressions/common/expression_types/specs/tests/ui_setting.test.ts new file mode 100644 index 00000000000000..a0a3d0d396b6e6 --- /dev/null +++ b/src/plugins/expressions/common/expression_types/specs/tests/ui_setting.test.ts @@ -0,0 +1,79 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { UiSetting, uiSetting } from '../ui_setting'; + +function createUiSetting(value: unknown, key = 'something'): UiSetting { + return { + key, + value, + type: 'ui_setting', + }; +} + +describe('uiSetting', () => { + describe('to', () => { + describe('render', () => { + it.each` + value | expected + ${{ a: 'b' }} | ${JSON.stringify({ a: 'b' })} + ${null} | ${''} + ${'something'} | ${'something'} + `('should render "$value" as "$expected"', ({ expected, value }) => { + expect(uiSetting.to?.render(createUiSetting(value), {})).toHaveProperty( + 'value.text', + expected + ); + }); + }); + + describe('datatable', () => { + it('should use parameter name as a datatable column', () => { + expect(uiSetting.to?.datatable(createUiSetting('value', 'column'), {})).toHaveProperty( + 'columns.0', + expect.objectContaining({ id: 'column', name: 'column' }) + ); + }); + + it.each` + value | type + ${null} | ${'null'} + ${undefined} | ${'null'} + ${'something'} | ${'string'} + ${['123']} | ${'string'} + ${123} | ${'number'} + ${[123]} | ${'number'} + ${true} | ${'boolean'} + ${{ a: 'b' }} | ${'object'} + ${[]} | ${'unknown'} + `('should determine $type type', ({ value, type }) => { + expect(uiSetting.to?.datatable(createUiSetting(value, 'column'), {})).toHaveProperty( + 'columns.0.meta.type', + type + ); + }); + + it('should put a value into a row', () => { + expect(uiSetting.to?.datatable(createUiSetting('value'), {})).toHaveProperty( + 'rows.0.something', + 'value' + ); + }); + + it('should put an array value into multiple rows', () => { + expect(uiSetting.to?.datatable(createUiSetting(['a', 'b']), {})).toHaveProperty( + 'rows', + expect.arrayContaining([ + expect.objectContaining({ something: 'a' }), + expect.objectContaining({ something: 'b' }), + ]) + ); + }); + }); + }); +}); diff --git a/src/plugins/expressions/common/expression_types/specs/ui_setting.ts b/src/plugins/expressions/common/expression_types/specs/ui_setting.ts new file mode 100644 index 00000000000000..aaea92e89a8325 --- /dev/null +++ b/src/plugins/expressions/common/expression_types/specs/ui_setting.ts @@ -0,0 +1,65 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Datatable, DatatableColumnType } from './datatable'; +import { ExpressionTypeDefinition, ExpressionValueBoxed } from '../types'; +import { ExpressionValueRender } from './render'; + +const name = 'ui_setting'; + +function getType(value: unknown): DatatableColumnType { + if (value == null) { + return 'null'; + } + + if (Array.isArray(value)) { + return value.length ? getType(value[0]) : 'unknown'; + } + + if (['boolean', 'number', 'object', 'string'].includes(typeof value)) { + return typeof value as DatatableColumnType; + } + + return 'unknown'; +} + +export type UiSetting = ExpressionValueBoxed<'ui_setting', { key: string; value: unknown }>; + +export const uiSetting: ExpressionTypeDefinition<'ui_setting', UiSetting> = { + name, + to: { + boolean({ value }) { + return Boolean(value); + }, + number({ value }) { + return Number(value); + }, + string({ value }) { + return String(value ?? ''); + }, + render({ value }): ExpressionValueRender<{ text: string }> { + return { + type: 'render', + as: 'text', + value: { + text: + typeof value === 'object' && value !== null + ? JSON.stringify(value) + : String(value ?? ''), + }, + }; + }, + datatable({ key, value }): Datatable { + return { + type: 'datatable', + columns: [{ id: key, name: key, meta: { type: getType(value) } }], + rows: (Array.isArray(value) ? value : [value]).map((cell) => ({ [key]: cell })), + }; + }, + }, +}; diff --git a/src/plugins/expressions/common/service/expressions_services.ts b/src/plugins/expressions/common/service/expressions_services.ts index d57c1748954abf..a8839c9b0d71e1 100644 --- a/src/plugins/expressions/common/service/expressions_services.ts +++ b/src/plugins/expressions/common/service/expressions_services.ts @@ -19,6 +19,18 @@ import { AnyExpressionFunctionDefinition } from '../expression_functions'; import { SavedObjectReference } from '../../../../core/types'; import { PersistableStateService, SerializableState } from '../../../kibana_utils/common'; import { Adapters } from '../../../inspector/common/adapters'; +import { + clog, + font, + variableSet, + variable, + theme, + cumulativeSum, + derivative, + movingAverage, + mapColumn, + math, +} from '../expression_functions'; /** * The public contract that `ExpressionsService` provides to other plugins @@ -269,7 +281,7 @@ export class ExpressionsService implements PersistableStateService { const executor = this.executor.fork(); const renderers = this.renderers; - const fork = new ExpressionsService({ executor, renderers }); + const fork = new (this.constructor as typeof ExpressionsService)({ executor, renderers }); return fork; }; @@ -318,7 +330,22 @@ export class ExpressionsService implements PersistableStateService) { + return getCommonUiSettingFn({ + async getStartDependencies() { + const [{ uiSettings }] = await getStartServices(); + + return { uiSettings }; + }, + }); +} diff --git a/src/plugins/expressions/public/plugin.test.ts b/src/plugins/expressions/public/plugin.test.ts index b83c92f5d1a96b..93353ebbb51b61 100644 --- a/src/plugins/expressions/public/plugin.test.ts +++ b/src/plugins/expressions/public/plugin.test.ts @@ -8,7 +8,7 @@ import { expressionsPluginMock } from './mocks'; import { add } from '../common/test_helpers/expression_functions/add'; -import { ExpressionsService } from '../common'; +import { ExpressionsService } from './services'; describe('ExpressionsPublicPlugin', () => { test('can instantiate from mocks', async () => { diff --git a/src/plugins/expressions/public/plugin.ts b/src/plugins/expressions/public/plugin.ts index 2410ad87413129..37d519ac451336 100644 --- a/src/plugins/expressions/public/plugin.ts +++ b/src/plugins/expressions/public/plugin.ts @@ -6,9 +6,15 @@ * Side Public License, v 1. */ +import { pick } from 'lodash'; import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from 'src/core/public'; -import { ExpressionsService, ExpressionsServiceSetup, ExpressionsServiceStart } from '../common'; -import { setRenderersRegistry, setNotifications, setExpressionsService } from './services'; +import { ExpressionsServiceSetup, ExpressionsServiceStart } from '../common'; +import { + ExpressionsService, + setRenderersRegistry, + setNotifications, + setExpressionsService, +} from './services'; import { ReactExpressionRenderer } from './react_expression_renderer'; import { ExpressionLoader, IExpressionLoader, loader } from './loader'; import { render, ExpressionRenderHandler } from './render'; @@ -51,7 +57,7 @@ export class ExpressionsPublicPlugin implements Plugin) => Record; diff --git a/src/plugins/expressions/public/services.ts b/src/plugins/expressions/public/services.ts deleted file mode 100644 index a700e54d77e190..00000000000000 --- a/src/plugins/expressions/public/services.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { NotificationsStart } from 'kibana/public'; -import { createGetterSetter } from '../../kibana_utils/public'; -import { ExpressionsService, ExpressionRendererRegistry } from '../common'; - -export const [getNotifications, setNotifications] = createGetterSetter( - 'Notifications' -); - -export const [ - getRenderersRegistry, - setRenderersRegistry, -] = createGetterSetter('Renderers registry'); - -export const [ - getExpressionsService, - setExpressionsService, -] = createGetterSetter('ExpressionsService'); diff --git a/src/plugins/expressions/public/services/expressions_services.ts b/src/plugins/expressions/public/services/expressions_services.ts new file mode 100644 index 00000000000000..388af81629c31d --- /dev/null +++ b/src/plugins/expressions/public/services/expressions_services.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { CoreSetup } from 'src/core/public'; +import { ExpressionsService as CommonExpressionsService } from '../../common'; +import { getUiSettingFn } from '../expression_functions'; + +export class ExpressionsService extends CommonExpressionsService { + setup({ getStartServices }: Pick) { + this.registerFunction(getUiSettingFn({ getStartServices })); + + return super.setup(); + } +} diff --git a/src/plugins/expressions/public/services/index.ts b/src/plugins/expressions/public/services/index.ts new file mode 100644 index 00000000000000..db473037a0a4a6 --- /dev/null +++ b/src/plugins/expressions/public/services/index.ts @@ -0,0 +1,27 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { NotificationsStart } from 'kibana/public'; +import { createGetterSetter } from '../../../kibana_utils/public'; +import { ExpressionsService, ExpressionRendererRegistry } from '../../common'; + +export const [getNotifications, setNotifications] = createGetterSetter( + 'Notifications' +); + +export const [ + getRenderersRegistry, + setRenderersRegistry, +] = createGetterSetter('Renderers registry'); + +export const [ + getExpressionsService, + setExpressionsService, +] = createGetterSetter('ExpressionsService'); + +export * from './expressions_services'; diff --git a/src/plugins/expressions/server/expression_functions/index.ts b/src/plugins/expressions/server/expression_functions/index.ts new file mode 100644 index 00000000000000..eb36291c613c67 --- /dev/null +++ b/src/plugins/expressions/server/expression_functions/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export * from './ui_setting'; diff --git a/src/plugins/expressions/server/expression_functions/ui_setting.ts b/src/plugins/expressions/server/expression_functions/ui_setting.ts new file mode 100644 index 00000000000000..0d3d5b1c1f997b --- /dev/null +++ b/src/plugins/expressions/server/expression_functions/ui_setting.ts @@ -0,0 +1,22 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { CoreSetup } from 'src/core/server'; +import { getUiSettingFn as getCommonUiSettingFn } from '../../common'; + +export function getUiSettingFn({ getStartServices }: Pick) { + return getCommonUiSettingFn({ + async getStartDependencies(getKibanaRequest) { + const [{ savedObjects, uiSettings }] = await getStartServices(); + const savedObjectsClient = savedObjects.getScopedClient(getKibanaRequest()); + const uiSettingsClient = uiSettings.asScopedToClient(savedObjectsClient); + + return { uiSettings: uiSettingsClient }; + }, + }); +} diff --git a/src/plugins/expressions/server/plugin.ts b/src/plugins/expressions/server/plugin.ts index 2c638d496ece62..2e45daf6e0f8c0 100644 --- a/src/plugins/expressions/server/plugin.ts +++ b/src/plugins/expressions/server/plugin.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import { pick } from 'lodash'; import { CoreStart, CoreSetup, Plugin, PluginInitializerContext } from 'src/core/server'; import { ExpressionsService, ExpressionsServiceSetup, ExpressionsServiceStart } from '../common'; @@ -24,7 +25,7 @@ export class ExpressionsServerPlugin environment: 'server', }); - const setup = this.expressions.setup(); + const setup = this.expressions.setup(pick(core, 'getStartServices')); return Object.freeze(setup); } diff --git a/src/plugins/expressions/server/services/expressions_services.ts b/src/plugins/expressions/server/services/expressions_services.ts new file mode 100644 index 00000000000000..914745436f1518 --- /dev/null +++ b/src/plugins/expressions/server/services/expressions_services.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { CoreSetup } from 'src/core/server'; +import { ExpressionsService as CommonExpressionsService } from '../../common'; +import { getUiSettingFn } from '../expression_functions'; + +export class ExpressionsService extends CommonExpressionsService { + setup({ getStartServices }: Pick) { + this.registerFunction(getUiSettingFn({ getStartServices })); + + return super.setup(); + } +} diff --git a/src/plugins/expressions/server/services/index.ts b/src/plugins/expressions/server/services/index.ts new file mode 100644 index 00000000000000..c239c4efdb02cc --- /dev/null +++ b/src/plugins/expressions/server/services/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export * from './expressions_services'; diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/confirmation_modal/confirmation_modal.test.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/confirmation_modal/confirmation_modal.test.tsx index 96f78a088fff49..bacab18d285095 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/confirmation_modal/confirmation_modal.test.tsx +++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/confirmation_modal/confirmation_modal.test.tsx @@ -15,6 +15,7 @@ describe('DeleteScritpedFieldConfirmationModal', () => { test('should render normally', () => { const component = shallow( {}} hideDeleteConfirmationModal={() => {}} diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.test.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.test.tsx index 83ac96f6c1695b..5a9f4eb8711816 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.test.tsx +++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.test.tsx @@ -15,6 +15,7 @@ import { IIndexPattern } from 'src/plugins/data/public'; const getIndexPatternMock = (mockedFields: any = {}) => ({ ...mockedFields } as IIndexPattern); +// @ts-expect-error invalid lang type const items: ScriptedFieldItem[] = [{ name: '1', lang: 'Elastic', script: '' }]; describe('Table', () => { diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_field_table.test.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_field_table.test.tsx index 08a5f22723628c..e6aa87172ca0b7 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_field_table.test.tsx +++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_field_table.test.tsx @@ -155,6 +155,7 @@ describe('ScriptedFieldsTable', () => { ); await component.update(); // Fire `componentWillMount()` + // @ts-expect-error lang is not valid component.instance().startDeleteField({ name: 'ScriptedField', lang: '', script: '' }); await component.update(); @@ -179,6 +180,7 @@ describe('ScriptedFieldsTable', () => { ); await component.update(); // Fire `componentWillMount()` + // @ts-expect-error lang is not valid component.instance().startDeleteField({ name: 'ScriptedField', lang: '', script: '' }); await component.update(); diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx index 77ba2f734d3fea..7fd5170b669f7c 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx +++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx @@ -65,7 +65,7 @@ export class ScriptedFieldsTable extends Component< const supportedLangs = getSupportedScriptingLanguages(); for (const field of fields) { - const lang: string = field.lang; + const lang = field.lang; if (deprecatedLangs.includes(lang) || !supportedLangs.includes(lang)) { deprecatedLangsInUse.push(lang); } diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/types.ts b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/types.ts index 3348f5eb052eb7..5c6adc824d225e 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/types.ts +++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/types.ts @@ -5,10 +5,10 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import type { estypes } from '@elastic/elasticsearch'; /** @internal **/ export interface ScriptedFieldItem { name: string; - lang: string; + lang: estypes.ScriptLanguage; script: string; } diff --git a/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx b/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx index f0da57a5f9b6f3..b05ddaed064cdc 100644 --- a/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx +++ b/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import type { estypes } from '@elastic/elasticsearch'; import React, { PureComponent, Fragment } from 'react'; import { intersection, union, get } from 'lodash'; @@ -100,7 +100,7 @@ export interface FieldEditorState { isReady: boolean; isCreating: boolean; isDeprecatedLang: boolean; - scriptingLangs: string[]; + scriptingLangs: estypes.ScriptLanguage[]; fieldTypes: string[]; fieldTypeFormats: FieldTypeFormat[]; existingFieldNames: string[]; @@ -131,8 +131,8 @@ export class FieldEditor extends PureComponent { + onLangChange = (lang: estypes.ScriptLanguage) => { const { spec } = this.state; const fieldTypes = get(FIELD_TYPES_BY_LANG, lang, DEFAULT_FIELD_TYPES); spec.lang = lang; @@ -373,7 +374,7 @@ export class FieldEditor extends PureComponent { - this.onLangChange(e.target.value); + this.onLangChange(e.target.value as estypes.ScriptLanguage); }} /> diff --git a/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/__snapshots__/empty_state.test.tsx.snap b/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/__snapshots__/empty_state.test.tsx.snap index 645694371f9059..1310488c65fab8 100644 --- a/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/__snapshots__/empty_state.test.tsx.snap +++ b/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/__snapshots__/empty_state.test.tsx.snap @@ -59,7 +59,6 @@ exports[`EmptyState should render normally 1`] = `
} - isDisabled={false} onClick={[Function]} title={ { docLinks={docLinks} onRefresh={() => {}} navigateToApp={async () => {}} - getMlCardState={() => MlCardState.ENABLED} canSave={true} /> ); @@ -48,7 +46,6 @@ describe('EmptyState', () => { docLinks={docLinks} onRefresh={onRefreshHandler} navigateToApp={async () => {}} - getMlCardState={() => MlCardState.ENABLED} canSave={true} /> ); diff --git a/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/empty_state.tsx b/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/empty_state.tsx index 438eb8a031993f..240e732752916c 100644 --- a/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/empty_state.tsx +++ b/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/empty_state.tsx @@ -8,7 +8,6 @@ import './empty_state.scss'; import React from 'react'; -import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { DocLinksStart, ApplicationStart } from 'kibana/public'; import { @@ -28,60 +27,18 @@ import { } from '@elastic/eui'; import { useHistory } from 'react-router-dom'; import { reactRouterNavigate } from '../../../../../../plugins/kibana_react/public'; -import { MlCardState } from '../../../types'; export const EmptyState = ({ onRefresh, navigateToApp, docLinks, - getMlCardState, canSave, }: { onRefresh: () => void; navigateToApp: ApplicationStart['navigateToApp']; docLinks: DocLinksStart; - getMlCardState: () => MlCardState; canSave: boolean; }) => { - const mlCard = ( - - navigateToApp('ml', { path: '#/filedatavisualizer' })} - className="inpEmptyState__card" - betaBadgeLabel={ - getMlCardState() === MlCardState.ENABLED - ? undefined - : i18n.translate( - 'indexPatternManagement.createIndexPattern.emptyState.basicLicenseLabel', - { - defaultMessage: 'Basic', - } - ) - } - betaBadgeTooltipContent={i18n.translate( - 'indexPatternManagement.createIndexPattern.emptyState.basicLicenseDescription', - { - defaultMessage: 'This feature requires a Basic license.', - } - )} - isDisabled={getMlCardState() === MlCardState.DISABLED} - icon={} - title={ - - } - description={ - - } - /> - - ); - const createAnyway = ( - {getMlCardState() !== MlCardState.HIDDEN ? mlCard : <>} + + navigateToApp('home', { path: '#/tutorial_directory/fileDataViz' })} + className="inpEmptyState__card" + icon={} + title={ + + } + description={ + + } + /> + { application, http, data, - getMlCardState, } = useKibana().services; const [indexPatterns, setIndexPatterns] = useState([]); const [creationOptions, setCreationOptions] = useState([]); @@ -182,7 +181,6 @@ export const IndexPatternTable = ({ canSave, history }: Props) => { onRefresh={loadSources} docLinks={docLinks} navigateToApp={application.navigateToApp} - getMlCardState={getMlCardState} canSave={canSave} /> ); diff --git a/src/plugins/index_pattern_management/public/index.ts b/src/plugins/index_pattern_management/public/index.ts index 94611705a93908..726c055d1b8c34 100644 --- a/src/plugins/index_pattern_management/public/index.ts +++ b/src/plugins/index_pattern_management/public/index.ts @@ -30,5 +30,3 @@ export { IndexPatternCreationOption, IndexPatternListConfig, } from './service'; - -export { MlCardState } from './types'; diff --git a/src/plugins/index_pattern_management/public/management_app/mount_management_section.tsx b/src/plugins/index_pattern_management/public/management_app/mount_management_section.tsx index 355f529fe0f759..ec5b7c74020a5a 100644 --- a/src/plugins/index_pattern_management/public/management_app/mount_management_section.tsx +++ b/src/plugins/index_pattern_management/public/management_app/mount_management_section.tsx @@ -23,7 +23,7 @@ import { CreateIndexPatternWizardWithRouter, } from '../components'; import { IndexPatternManagementStartDependencies, IndexPatternManagementStart } from '../plugin'; -import { IndexPatternManagmentContext, MlCardState } from '../types'; +import { IndexPatternManagmentContext } from '../types'; const readOnlyBadge = { text: i18n.translate('indexPatternManagement.indexPatterns.badge.readOnly.text', { @@ -37,8 +37,7 @@ const readOnlyBadge = { export async function mountManagementSection( getStartServices: StartServicesAccessor, - params: ManagementAppMountParams, - getMlCardState: () => MlCardState + params: ManagementAppMountParams ) { const [ { chrome, application, uiSettings, notifications, overlays, http, docLinks }, @@ -63,7 +62,6 @@ export async function mountManagementSection( indexPatternFieldEditor, indexPatternManagementStart: indexPatternManagementStart as IndexPatternManagementStart, setBreadcrumbs: params.setBreadcrumbs, - getMlCardState, fieldFormatEditors: indexPatternFieldEditor.fieldFormatEditors, }; diff --git a/src/plugins/index_pattern_management/public/mocks.ts b/src/plugins/index_pattern_management/public/mocks.ts index 3462131e50463b..6c709fb14f08d7 100644 --- a/src/plugins/index_pattern_management/public/mocks.ts +++ b/src/plugins/index_pattern_management/public/mocks.ts @@ -26,9 +26,6 @@ const createSetupContract = (): IndexPatternManagementSetup => ({ list: { addListConfig: jest.fn(), } as any, - environment: { - update: jest.fn(), - }, }); const createStartContract = (): IndexPatternManagementStart => ({ @@ -93,7 +90,6 @@ const createIndexPatternManagmentContext = (): { indexPatternFieldEditor, indexPatternManagementStart: createStartContract(), setBreadcrumbs: () => {}, - getMlCardState: () => 2, fieldFormatEditors: indexPatternFieldEditor.fieldFormatEditors, }; }; diff --git a/src/plugins/index_pattern_management/public/plugin.ts b/src/plugins/index_pattern_management/public/plugin.ts index ed92172c8b91ca..e3c156927bface 100644 --- a/src/plugins/index_pattern_management/public/plugin.ts +++ b/src/plugins/index_pattern_management/public/plugin.ts @@ -77,9 +77,7 @@ export class IndexPatternManagementPlugin mount: async (params) => { const { mountManagementSection } = await import('./management_app'); - return mountManagementSection(core.getStartServices, params, () => - this.indexPatternManagementService.environmentService.getEnvironment().ml() - ); + return mountManagementSection(core.getStartServices, params); }, }); diff --git a/src/plugins/index_pattern_management/public/scripting_languages/index.ts b/src/plugins/index_pattern_management/public/scripting_languages/index.ts index c6b2f3c4b6b27a..aeb38c8172be02 100644 --- a/src/plugins/index_pattern_management/public/scripting_languages/index.ts +++ b/src/plugins/index_pattern_management/public/scripting_languages/index.ts @@ -5,15 +5,15 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import type { estypes } from '@elastic/elasticsearch'; import { i18n } from '@kbn/i18n'; import { HttpStart, NotificationsStart } from 'src/core/public'; -export function getSupportedScriptingLanguages(): string[] { +export function getSupportedScriptingLanguages(): estypes.ScriptLanguage[] { return ['painless']; } -export function getDeprecatedScriptingLanguages(): string[] { +export function getDeprecatedScriptingLanguages(): estypes.ScriptLanguage[] { return []; } diff --git a/src/plugins/index_pattern_management/public/service/environment/environment.mock.ts b/src/plugins/index_pattern_management/public/service/environment/environment.mock.ts deleted file mode 100644 index 1eaab2eaccc111..00000000000000 --- a/src/plugins/index_pattern_management/public/service/environment/environment.mock.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import type { PublicMethodsOf } from '@kbn/utility-types'; -import { EnvironmentService, EnvironmentServiceSetup } from './environment'; -import { MlCardState } from '../../types'; - -const createSetupMock = (): jest.Mocked => { - const setup = { - update: jest.fn(), - }; - return setup; -}; - -const createMock = (): jest.Mocked> => { - const service = { - setup: jest.fn(), - getEnvironment: jest.fn(() => ({ - ml: () => MlCardState.ENABLED, - })), - }; - service.setup.mockImplementation(createSetupMock); - return service; -}; - -export const environmentServiceMock = { - createSetup: createSetupMock, - create: createMock, -}; diff --git a/src/plugins/index_pattern_management/public/service/environment/environment.test.ts b/src/plugins/index_pattern_management/public/service/environment/environment.test.ts deleted file mode 100644 index 9e571374b4784f..00000000000000 --- a/src/plugins/index_pattern_management/public/service/environment/environment.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { EnvironmentService } from './environment'; -import { MlCardState } from '../../types'; - -describe('EnvironmentService', () => { - describe('setup', () => { - test('allows multiple update calls', () => { - const setup = new EnvironmentService().setup(); - expect(() => { - setup.update({ ml: () => MlCardState.ENABLED }); - }).not.toThrow(); - }); - }); - - describe('getEnvironment', () => { - test('returns default values', () => { - const service = new EnvironmentService(); - expect(service.getEnvironment().ml()).toEqual(MlCardState.DISABLED); - }); - - test('returns last state of update calls', () => { - let cardState = MlCardState.DISABLED; - const service = new EnvironmentService(); - const setup = service.setup(); - setup.update({ ml: () => cardState }); - expect(service.getEnvironment().ml()).toEqual(MlCardState.DISABLED); - cardState = MlCardState.ENABLED; - expect(service.getEnvironment().ml()).toEqual(MlCardState.ENABLED); - }); - }); -}); diff --git a/src/plugins/index_pattern_management/public/service/environment/environment.ts b/src/plugins/index_pattern_management/public/service/environment/environment.ts deleted file mode 100644 index 7bf0c1eb52068a..00000000000000 --- a/src/plugins/index_pattern_management/public/service/environment/environment.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { MlCardState } from '../../types'; - -/** @public */ -export interface Environment { - /** - * Flag whether ml features should be advertised - */ - readonly ml: () => MlCardState; -} - -export class EnvironmentService { - private environment = { - ml: () => MlCardState.DISABLED, - }; - - public setup() { - return { - /** - * Update the environment to influence how available features are presented. - * @param update - */ - update: (update: Partial) => { - this.environment = Object.assign({}, this.environment, update); - }, - }; - } - - public getEnvironment() { - return this.environment; - } -} - -export type EnvironmentServiceSetup = ReturnType; diff --git a/src/plugins/index_pattern_management/public/service/environment/index.ts b/src/plugins/index_pattern_management/public/service/environment/index.ts deleted file mode 100644 index ab5297ed0e14c0..00000000000000 --- a/src/plugins/index_pattern_management/public/service/environment/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -export { EnvironmentService, Environment, EnvironmentServiceSetup } from './environment'; diff --git a/src/plugins/index_pattern_management/public/service/index_pattern_management_service.ts b/src/plugins/index_pattern_management/public/service/index_pattern_management_service.ts index 15be7f11892e49..f30ccfcb9f3ed7 100644 --- a/src/plugins/index_pattern_management/public/service/index_pattern_management_service.ts +++ b/src/plugins/index_pattern_management/public/service/index_pattern_management_service.ts @@ -9,7 +9,6 @@ import { HttpSetup } from '../../../../core/public'; import { IndexPatternCreationManager, IndexPatternCreationConfig } from './creation'; import { IndexPatternListManager, IndexPatternListConfig } from './list'; -import { EnvironmentService } from './environment'; interface SetupDependencies { httpClient: HttpSetup; } @@ -22,12 +21,10 @@ interface SetupDependencies { export class IndexPatternManagementService { indexPatternCreationManager: IndexPatternCreationManager; indexPatternListConfig: IndexPatternListManager; - environmentService: EnvironmentService; constructor() { this.indexPatternCreationManager = new IndexPatternCreationManager(); this.indexPatternListConfig = new IndexPatternListManager(); - this.environmentService = new EnvironmentService(); } public setup({ httpClient }: SetupDependencies) { @@ -40,7 +37,6 @@ export class IndexPatternManagementService { return { creation: creationManagerSetup, list: indexPatternListConfigSetup, - environment: this.environmentService.setup(), }; } diff --git a/src/plugins/index_pattern_management/public/types.ts b/src/plugins/index_pattern_management/public/types.ts index 58a138df633fd3..a61eeb99b25a57 100644 --- a/src/plugins/index_pattern_management/public/types.ts +++ b/src/plugins/index_pattern_management/public/types.ts @@ -33,14 +33,7 @@ export interface IndexPatternManagmentContext { indexPatternFieldEditor: IndexPatternFieldEditorStart; indexPatternManagementStart: IndexPatternManagementStart; setBreadcrumbs: ManagementAppMountParams['setBreadcrumbs']; - getMlCardState: () => MlCardState; fieldFormatEditors: IndexPatternFieldEditorStart['fieldFormatEditors']; } export type IndexPatternManagmentContextValue = KibanaReactContextValue; - -export enum MlCardState { - HIDDEN, - DISABLED, - ENABLED, -} diff --git a/src/plugins/kibana_react/public/app_links/redirect_app_link.tsx b/src/plugins/kibana_react/public/app_links/redirect_app_link.tsx index d9ea8be9f5cdd8..744a186a201cad 100644 --- a/src/plugins/kibana_react/public/app_links/redirect_app_link.tsx +++ b/src/plugins/kibana_react/public/app_links/redirect_app_link.tsx @@ -12,7 +12,7 @@ import useObservable from 'react-use/lib/useObservable'; import { ApplicationStart } from 'src/core/public'; import { createNavigateToUrlClickHandler } from './click_handler'; -interface RedirectCrossAppLinksProps { +interface RedirectCrossAppLinksProps extends React.HTMLAttributes { application: ApplicationStart; className?: string; 'data-test-subj'?: string; diff --git a/src/plugins/kibana_react/public/code_editor/__snapshots__/code_editor.test.tsx.snap b/src/plugins/kibana_react/public/code_editor/__snapshots__/code_editor.test.tsx.snap index a779ef540d72ec..d4fb5a708e4405 100644 --- a/src/plugins/kibana_react/public/code_editor/__snapshots__/code_editor.test.tsx.snap +++ b/src/plugins/kibana_react/public/code_editor/__snapshots__/code_editor.test.tsx.snap @@ -11,6 +11,7 @@ exports[`is rendered 1`] = ` onChange={[Function]} options={ Object { + "matchBrackets": "never", "minimap": Object { "enabled": false, }, @@ -39,6 +40,7 @@ exports[`is rendered 1`] = ` nodeType="div" onResize={[Function]} querySelector={null} + refreshMode="debounce" refreshRate={1000} skipOnMount={false} targetDomEl={null} diff --git a/src/plugins/kibana_react/public/code_editor/code_editor.tsx b/src/plugins/kibana_react/public/code_editor/code_editor.tsx index 55e10e7861e518..251f05950da227 100644 --- a/src/plugins/kibana_react/public/code_editor/code_editor.tsx +++ b/src/plugins/kibana_react/public/code_editor/code_editor.tsx @@ -187,10 +187,16 @@ export class CodeEditor extends React.Component { wordBasedSuggestions: false, wordWrap: 'on', wrappingIndent: 'indent', + matchBrackets: 'never', ...options, }} /> - + ); } diff --git a/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts b/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts index e033da875080f4..1fa7d8e846c9da 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts @@ -142,6 +142,7 @@ export const applicationUsageSchema = { metrics: commonSchema, infra: commonSchema, // It's a forward app so we'll likely never report it fleet: commonSchema, + integrations: commonSchema, ingestManager: commonSchema, lens: commonSchema, maps: commonSchema, diff --git a/src/plugins/management/public/components/landing/landing.tsx b/src/plugins/management/public/components/landing/landing.tsx index 5e361cfaff87d2..4683185a5a7831 100644 --- a/src/plugins/management/public/components/landing/landing.tsx +++ b/src/plugins/management/public/components/landing/landing.tsx @@ -8,15 +8,7 @@ import React from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; - -import { - EuiHorizontalRule, - EuiIcon, - EuiPageContent, - EuiSpacer, - EuiText, - EuiTitle, -} from '@elastic/eui'; +import { EuiEmptyPrompt, EuiHorizontalRule, EuiPageContent } from '@elastic/eui'; interface ManagementLandingPageProps { version: string; @@ -27,39 +19,37 @@ export const ManagementLandingPage = ({ version, setBreadcrumbs }: ManagementLan setBreadcrumbs(); return ( - -
-
- - - -

- -

-
- + + - -
- - - - -

- -

-
-
+ + } + body={ + <> +

+ +

+ +

+ +

+ + } + />
); }; diff --git a/src/plugins/management/public/components/management_app/management_app.tsx b/src/plugins/management/public/components/management_app/management_app.tsx index 350e2f3de0cdf6..23d0a290837475 100644 --- a/src/plugins/management/public/components/management_app/management_app.tsx +++ b/src/plugins/management/public/components/management_app/management_app.tsx @@ -5,20 +5,23 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ +import './management_app.scss'; import React, { useState, useEffect, useCallback } from 'react'; import { AppMountParameters, ChromeBreadcrumb, ScopedHistory } from 'kibana/public'; import { I18nProvider } from '@kbn/i18n/react'; -import { EuiPage } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; import { ManagementSection, MANAGEMENT_BREADCRUMB } from '../../utils'; import { ManagementRouter } from './management_router'; -import { ManagementSidebarNav } from '../management_sidebar_nav'; -import { reactRouterNavigate } from '../../../../kibana_react/public'; +import { managementSidebarNav } from '../management_sidebar_nav/management_sidebar_nav'; +import { + KibanaPageTemplate, + KibanaPageTemplateProps, + reactRouterNavigate, +} from '../../../../kibana_react/public'; import { SectionsServiceStart } from '../../types'; -import './management_app.scss'; - interface ManagementAppProps { appBasePath: string; history: AppMountParameters['history']; @@ -64,10 +67,30 @@ export const ManagementApp = ({ dependencies, history }: ManagementAppProps) => return null; } + const solution: KibanaPageTemplateProps['solutionNav'] = { + name: i18n.translate('management.nav.label', { + defaultMessage: 'Management', + }), + icon: 'managementApp', + 'data-test-subj': 'mgtSideBarNav', + items: managementSidebarNav({ + selectedId, + sections, + history, + }), + }; + return ( - - + sections={sections} dependencies={dependencies} /> - + ); }; diff --git a/src/plugins/management/public/components/management_app/management_router.tsx b/src/plugins/management/public/components/management_app/management_router.tsx index b3f978d5c6cd2e..5ec1253ba77efd 100644 --- a/src/plugins/management/public/components/management_app/management_router.tsx +++ b/src/plugins/management/public/components/management_app/management_router.tsx @@ -8,7 +8,6 @@ import React, { memo } from 'react'; import { Route, Router, Switch } from 'react-router-dom'; -import { EuiPageBody } from '@elastic/eui'; import { AppMountParameters, ChromeBreadcrumb, ScopedHistory } from 'kibana/public'; import { ManagementAppWrapper } from '../management_app_wrapper'; import { ManagementLandingPage } from '../landing'; @@ -26,36 +25,34 @@ interface ManagementRouterProps { export const ManagementRouter = memo( ({ dependencies, history, setBreadcrumbs, onAppMounted, sections }: ManagementRouterProps) => ( - - - {sections.map((section) => - section - .getAppsEnabled() - .map((app) => ( - ( - - )} - /> - )) - )} - ( - + {sections.map((section) => + section + .getAppsEnabled() + .map((app) => ( + ( + + )} /> - )} - /> - - + )) + )} + ( + + )} + /> + ) ); diff --git a/src/plugins/management/public/components/management_app_wrapper/management_app_wrapper.tsx b/src/plugins/management/public/components/management_app_wrapper/management_app_wrapper.tsx index 8e0043937303f2..72bfe609c141a5 100644 --- a/src/plugins/management/public/components/management_app_wrapper/management_app_wrapper.tsx +++ b/src/plugins/management/public/components/management_app_wrapper/management_app_wrapper.tsx @@ -9,8 +9,10 @@ import React, { createRef, Component } from 'react'; import { ChromeBreadcrumb, AppMountParameters, ScopedHistory } from 'kibana/public'; +import classNames from 'classnames'; import { ManagementApp } from '../../utils'; import { Unmount } from '../../types'; +import { APP_WRAPPER_CLASS } from '../../../../../../src/core/public'; interface ManagementSectionWrapperProps { app: ManagementApp; @@ -53,6 +55,12 @@ export class ManagementAppWrapper extends Component; + return ( +
+ ); } } diff --git a/src/plugins/management/public/components/management_sidebar_nav/index.ts b/src/plugins/management/public/components/management_sidebar_nav/index.ts index 5bb80adf3e8bac..9cee992a179480 100644 --- a/src/plugins/management/public/components/management_sidebar_nav/index.ts +++ b/src/plugins/management/public/components/management_sidebar_nav/index.ts @@ -6,4 +6,4 @@ * Side Public License, v 1. */ -export { ManagementSidebarNav } from './management_sidebar_nav'; +export { managementSidebarNav } from './management_sidebar_nav'; diff --git a/src/plugins/management/public/components/management_sidebar_nav/management_sidebar_nav.tsx b/src/plugins/management/public/components/management_sidebar_nav/management_sidebar_nav.tsx index 1b40bfcca3c63f..bf1b81061f6a98 100644 --- a/src/plugins/management/public/components/management_sidebar_nav/management_sidebar_nav.tsx +++ b/src/plugins/management/public/components/management_sidebar_nav/management_sidebar_nav.tsx @@ -6,24 +6,13 @@ * Side Public License, v 1. */ -import React, { useState } from 'react'; -import { i18n } from '@kbn/i18n'; +import React from 'react'; import { sortBy } from 'lodash'; -import { - EuiIcon, - EuiSideNav, - EuiScreenReaderOnly, - EuiSideNavItemType, - EuiFlexGroup, - EuiFlexItem, - EuiToolTip, -} from '@elastic/eui'; +import { EuiIcon, EuiSideNavItemType, EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/eui'; import { AppMountParameters } from 'kibana/public'; import { ManagementApp, ManagementSection } from '../../utils'; -import './management_sidebar_nav.scss'; - import { ManagementItem } from '../../utils/management_item'; import { reactRouterNavigate } from '../../../../kibana_react/public'; @@ -33,24 +22,12 @@ interface ManagementSidebarNavProps { selectedId: string; } -const headerLabel = i18n.translate('management.nav.label', { - defaultMessage: 'Management', -}); - -const navMenuLabel = i18n.translate('management.nav.menu', { - defaultMessage: 'Management menu', -}); - /** @internal **/ -export const ManagementSidebarNav = ({ +export const managementSidebarNav = ({ selectedId, sections, history, }: ManagementSidebarNavProps) => { - const HEADER_ID = 'stack-management-nav-header'; - const [isSideNavOpenOnMobile, setIsSideNavOpenOnMobile] = useState(false); - const toggleOpenOnMobile = () => setIsSideNavOpenOnMobile(!isSideNavOpenOnMobile); - const sectionsToNavItems = (managementSections: ManagementSection[]) => { const sortedManagementSections = sortBy(managementSections, 'order'); @@ -83,11 +60,11 @@ export const ManagementSidebarNav = ({ const TooltipWrapper = ({ text, tip }: TooltipWrapperProps) => ( - + {text} - + @@ -109,19 +86,5 @@ export const ManagementSidebarNav = ({ }; }; - return ( - <> - -

{headerLabel}

-
- - - ); + return sectionsToNavItems(sections); }; diff --git a/src/plugins/share/common/url_service/__tests__/locators.test.ts b/src/plugins/share/common/url_service/__tests__/locators.test.ts new file mode 100644 index 00000000000000..45d727df7de48c --- /dev/null +++ b/src/plugins/share/common/url_service/__tests__/locators.test.ts @@ -0,0 +1,165 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { of } from 'src/plugins/kibana_utils/common'; +import { testLocator, TestLocatorState, urlServiceTestSetup } from './setup'; + +describe('locators', () => { + test('can start locators service', () => { + const { + service: { locators }, + } = urlServiceTestSetup(); + + expect(typeof locators).toBe('object'); + expect(typeof locators.create).toBe('function'); + expect(typeof locators.get).toBe('function'); + }); + + test('returns "undefined" for unregistered locator', () => { + const { + service: { locators }, + } = urlServiceTestSetup(); + + expect(locators.get(testLocator.id)).toBe(undefined); + }); + + test('can register a locator', () => { + const { + service: { locators }, + } = urlServiceTestSetup(); + + locators.create(testLocator); + expect(typeof locators.get(testLocator.id)).toBe('object'); + }); + + test('getLocation() returns KibanaLocation generated by the locator', async () => { + const { + service: { locators }, + } = urlServiceTestSetup(); + + locators.create(testLocator); + + const locator = locators.get(testLocator.id); + const location = await locator?.getLocation({ + savedObjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', + pageNumber: 21, + showFlyout: true, + }); + + expect(location).toEqual({ + app: 'test_app', + route: '/my-object/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx?page=21', + state: { isFlyoutOpen: true }, + }); + }); + + describe('.navigate()', () => { + test('throws if navigation method is not implemented', async () => { + const { + service: { locators }, + } = urlServiceTestSetup(); + const locator = locators.create(testLocator); + const [, error] = await of( + locator.navigate({ + pageNumber: 1, + savedObjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', + showFlyout: false, + }) + ); + + expect(error).toBeInstanceOf(Error); + expect(error.message).toBe('not implemented'); + }); + + test('navigates user when .navigate() method is called', async () => { + const { + service: { locators }, + deps, + } = urlServiceTestSetup({ + navigate: jest.fn(async () => {}), + }); + const locator = locators.create(testLocator); + const [, error] = await of( + locator.navigate({ + pageNumber: 1, + savedObjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', + showFlyout: false, + }) + ); + + expect(error).toBe(undefined); + expect(deps.navigate).toHaveBeenCalledTimes(1); + expect(deps.navigate).toHaveBeenCalledWith( + { + app: 'test_app', + route: '/my-object/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx?page=1', + state: { + isFlyoutOpen: false, + }, + }, + { replace: false } + ); + }); + + test('can specify "replace" navigation parameter', async () => { + const { + service: { locators }, + deps, + } = urlServiceTestSetup({ + navigate: jest.fn(async () => {}), + }); + const locator = locators.create(testLocator); + + await locator.navigate( + { + pageNumber: 1, + savedObjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', + showFlyout: false, + }, + { + replace: false, + } + ); + + expect(deps.navigate).toHaveBeenCalledTimes(1); + expect(deps.navigate).toHaveBeenCalledWith( + { + app: 'test_app', + route: '/my-object/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx?page=1', + state: { + isFlyoutOpen: false, + }, + }, + { replace: false } + ); + + await locator.navigate( + { + pageNumber: 2, + savedObjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', + showFlyout: false, + }, + { + replace: true, + } + ); + + expect(deps.navigate).toHaveBeenCalledTimes(2); + expect(deps.navigate).toHaveBeenCalledWith( + { + app: 'test_app', + route: '/my-object/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx?page=2', + state: { + isFlyoutOpen: false, + }, + }, + { replace: true } + ); + }); + }); +}); diff --git a/src/plugins/share/common/url_service/__tests__/setup.ts b/src/plugins/share/common/url_service/__tests__/setup.ts new file mode 100644 index 00000000000000..ad13bb8d8d2160 --- /dev/null +++ b/src/plugins/share/common/url_service/__tests__/setup.ts @@ -0,0 +1,42 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { SerializableState } from 'src/plugins/kibana_utils/common'; +import { LocatorDefinition } from '../locators'; +import { UrlService, UrlServiceDependencies } from '../url_service'; + +export interface TestLocatorState extends SerializableState { + savedObjectId: string; + showFlyout: boolean; + pageNumber: number; +} + +export const testLocator: LocatorDefinition = { + id: 'TEST_LOCATOR', + getLocation: async ({ savedObjectId, pageNumber, showFlyout }) => { + return { + app: 'test_app', + route: `/my-object/${savedObjectId}?page=${pageNumber}`, + state: { + isFlyoutOpen: showFlyout, + }, + }; + }, +}; + +export const urlServiceTestSetup = (partialDeps: Partial = {}) => { + const deps: UrlServiceDependencies = { + navigate: async () => { + throw new Error('not implemented'); + }, + ...partialDeps, + }; + const service = new UrlService(deps); + + return { service, deps }; +}; diff --git a/src/plugins/share/common/url_service/index.ts b/src/plugins/share/common/url_service/index.ts new file mode 100644 index 00000000000000..84f74356bcf186 --- /dev/null +++ b/src/plugins/share/common/url_service/index.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export * from './url_service'; +export * from './locators'; diff --git a/src/plugins/share/common/url_service/locators/index.ts b/src/plugins/share/common/url_service/locators/index.ts new file mode 100644 index 00000000000000..f9f87215eb4db5 --- /dev/null +++ b/src/plugins/share/common/url_service/locators/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export * from './types'; +export * from './locator'; +export * from './locator_client'; diff --git a/src/plugins/share/common/url_service/locators/locator.ts b/src/plugins/share/common/url_service/locators/locator.ts new file mode 100644 index 00000000000000..68c3b05a7f4111 --- /dev/null +++ b/src/plugins/share/common/url_service/locators/locator.ts @@ -0,0 +1,69 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { SavedObjectReference } from 'kibana/server'; +import type { PersistableState, SerializableState } from 'src/plugins/kibana_utils/common'; +import type { + LocatorDefinition, + LocatorPublic, + KibanaLocation, + LocatorNavigationParams, +} from './types'; + +export interface LocatorDependencies { + navigate: (location: KibanaLocation, params?: LocatorNavigationParams) => Promise; +} + +export class Locator

implements PersistableState

, LocatorPublic

{ + public readonly migrations: PersistableState

['migrations']; + + constructor( + public readonly definition: LocatorDefinition

, + protected readonly deps: LocatorDependencies + ) { + this.migrations = definition.migrations || {}; + } + + // PersistableState

------------------------------------------------------- + + public readonly telemetry: PersistableState

['telemetry'] = ( + state: P, + stats: Record + ): Record => { + return this.definition.telemetry ? this.definition.telemetry(state, stats) : stats; + }; + + public readonly inject: PersistableState

['inject'] = ( + state: P, + references: SavedObjectReference[] + ): P => { + return this.definition.inject ? this.definition.inject(state, references) : state; + }; + + public readonly extract: PersistableState

['extract'] = ( + state: P + ): { state: P; references: SavedObjectReference[] } => { + return this.definition.extract ? this.definition.extract(state) : { state, references: [] }; + }; + + // LocatorPublic

---------------------------------------------------------- + + public async getLocation(params: P): Promise { + return await this.definition.getLocation(params); + } + + public async navigate( + params: P, + { replace = false }: LocatorNavigationParams = {} + ): Promise { + const location = await this.getLocation(params); + await this.deps.navigate(location, { + replace, + }); + } +} diff --git a/src/plugins/share/common/url_service/locators/locator_client.ts b/src/plugins/share/common/url_service/locators/locator_client.ts new file mode 100644 index 00000000000000..168cc02d03ff15 --- /dev/null +++ b/src/plugins/share/common/url_service/locators/locator_client.ts @@ -0,0 +1,47 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { SerializableState } from 'src/plugins/kibana_utils/common'; +import type { LocatorDependencies } from './locator'; +import type { LocatorDefinition, LocatorPublic, ILocatorClient } from './types'; +import { Locator } from './locator'; + +export type LocatorClientDependencies = LocatorDependencies; + +export class LocatorClient implements ILocatorClient { + /** + * Collection of registered locators. + */ + protected locators: Map> = new Map(); + + constructor(protected readonly deps: LocatorClientDependencies) {} + + /** + * Creates and register a URL locator. + * + * @param definition A definition of URL locator. + * @returns A public interface of URL locator. + */ + public create

(definition: LocatorDefinition

): LocatorPublic

{ + const locator = new Locator

(definition, this.deps); + + this.locators.set(definition.id, locator); + + return locator; + } + + /** + * Returns a previously registered URL locator. + * + * @param id ID of a URL locator. + * @returns A public interface of a registered URL locator. + */ + public get

(id: string): undefined | LocatorPublic

{ + return this.locators.get(id); + } +} diff --git a/src/plugins/share/common/url_service/locators/types.ts b/src/plugins/share/common/url_service/locators/types.ts new file mode 100644 index 00000000000000..d811ae0fd4aa23 --- /dev/null +++ b/src/plugins/share/common/url_service/locators/types.ts @@ -0,0 +1,91 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { PersistableState, SerializableState } from 'src/plugins/kibana_utils/common'; + +/** + * URL locator registry. + */ +export interface ILocatorClient { + /** + * Create and register a new locator. + * + * @param urlGenerator Definition of the new locator. + */ + create

(locatorDefinition: LocatorDefinition

): LocatorPublic

; + + /** + * Retrieve a previously registered locator. + * + * @param id Unique ID of the locator. + */ + get

(id: string): undefined | LocatorPublic

; +} + +/** + * A convenience interface used to define and register a locator. + */ +export interface LocatorDefinition

+ extends Partial> { + /** + * Unique ID of the locator. Should be constant and unique across Kibana. + */ + id: string; + + /** + * Returns a deep link, including location state, which can be used for + * navigation in Kibana. + * + * @param params Parameters from which to generate a Kibana location. + */ + getLocation(params: P): Promise; +} + +/** + * Public interface of a registered locator. + */ +export interface LocatorPublic

{ + /** + * Returns a relative URL to the client-side redirect endpoint using this + * locator. (This method is necessary for compatibility with URL generators.) + */ + getLocation(params: P): Promise; + + /** + * Navigate using the `core.application.navigateToApp()` method to a Kibana + * location generated by this locator. This method is available only on the + * browser. + */ + navigate(params: P, navigationParams?: LocatorNavigationParams): Promise; +} + +export interface LocatorNavigationParams { + replace?: boolean; +} + +/** + * This interface represents a location in Kibana to which one can navigate + * using the `core.application.navigateToApp()` method. + */ +export interface KibanaLocation { + /** + * Kibana application ID. + */ + app: string; + + /** + * A URL route within a Kibana application. + */ + route: string; + + /** + * A serializable location state object, which the app can use to determine + * what should be displayed on the screen. + */ + state: S; +} diff --git a/src/plugins/share/common/url_service/url_service.ts b/src/plugins/share/common/url_service/url_service.ts new file mode 100644 index 00000000000000..0c3a0aabb750bc --- /dev/null +++ b/src/plugins/share/common/url_service/url_service.ts @@ -0,0 +1,23 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { LocatorClient, LocatorClientDependencies } from './locators'; + +export type UrlServiceDependencies = LocatorClientDependencies; + +/** + * Common URL Service client interface for server-side and client-side. + */ +export class UrlService { + /** + * Client to work with locators. + */ + locators: LocatorClient = new LocatorClient(this.deps); + + constructor(protected readonly deps: UrlServiceDependencies) {} +} diff --git a/src/plugins/share/public/plugin.ts b/src/plugins/share/public/plugin.ts index 14d74e055cbd9a..eb7c46cdaef867 100644 --- a/src/plugins/share/public/plugin.ts +++ b/src/plugins/share/public/plugin.ts @@ -18,6 +18,7 @@ import { UrlGeneratorsSetup, UrlGeneratorsStart, } from './url_generators/url_generator_service'; +import { UrlService } from '../common/url_service'; export interface ShareSetupDependencies { securityOss?: SecurityOssPluginSetup; @@ -27,16 +28,60 @@ export interface ShareStartDependencies { securityOss?: SecurityOssPluginStart; } +/** @public */ +export type SharePluginSetup = ShareMenuRegistrySetup & { + /** + * @deprecated + * + * URL Generators are deprecated use UrlService instead. + */ + urlGenerators: UrlGeneratorsSetup; + + /** + * Utilities to work with URL locators and short URLs. + */ + url: UrlService; +}; + +/** @public */ +export type SharePluginStart = ShareMenuManagerStart & { + /** + * @deprecated + * + * URL Generators are deprecated use UrlService instead. + */ + urlGenerators: UrlGeneratorsStart; + + /** + * Utilities to work with URL locators and short URLs. + */ + url: UrlService; +}; + export class SharePlugin implements Plugin { private readonly shareMenuRegistry = new ShareMenuRegistry(); private readonly shareContextMenu = new ShareMenuManager(); private readonly urlGeneratorsService = new UrlGeneratorsService(); + private url?: UrlService; public setup(core: CoreSetup, plugins: ShareSetupDependencies): SharePluginSetup { core.application.register(createShortUrlRedirectApp(core, window.location)); + + this.url = new UrlService({ + navigate: async (location, { replace = false } = {}) => { + const [start] = await core.getStartServices(); + await start.application.navigateToApp(location.app, { + path: location.route, + state: location.state, + replace, + }); + }, + }); + return { ...this.shareMenuRegistry.setup(), urlGenerators: this.urlGeneratorsService.setup(core), + url: this.url, }; } @@ -48,16 +93,7 @@ export class SharePlugin implements Plugin { plugins.securityOss?.anonymousAccess ), urlGenerators: this.urlGeneratorsService.start(core), + url: this.url!, }; } } - -/** @public */ -export type SharePluginSetup = ShareMenuRegistrySetup & { - urlGenerators: UrlGeneratorsSetup; -}; - -/** @public */ -export type SharePluginStart = ShareMenuManagerStart & { - urlGenerators: UrlGeneratorsStart; -}; diff --git a/src/plugins/share/public/url_generators/README.md b/src/plugins/share/public/url_generators/README.md index 39ee5f2901e916..f948354aad9593 100644 --- a/src/plugins/share/public/url_generators/README.md +++ b/src/plugins/share/public/url_generators/README.md @@ -1,3 +1,9 @@ +# URL Generators are deprecated + +__Below is documentation of URL Generators, which are now deprecated and will be removed in favor of URL locators in 7.14.__ + +--- + ## URL Generator Services Developers who maintain pages in Kibana that other developers may want to link to diff --git a/src/plugins/share/public/url_generators/url_generator_service.ts b/src/plugins/share/public/url_generators/url_generator_service.ts index 982f0692102df6..5a8e7a1b5c17a8 100644 --- a/src/plugins/share/public/url_generators/url_generator_service.ts +++ b/src/plugins/share/public/url_generators/url_generator_service.ts @@ -13,10 +13,20 @@ import { UrlGeneratorInternal } from './url_generator_internal'; import { UrlGeneratorContract } from './url_generator_contract'; export interface UrlGeneratorsStart { + /** + * @deprecated + * + * URL Generators are deprecated, use URL locators in UrlService instead. + */ getUrlGenerator: (urlGeneratorId: T) => UrlGeneratorContract; } export interface UrlGeneratorsSetup { + /** + * @deprecated + * + * URL Generators are deprecated, use URL locators in UrlService instead. + */ registerUrlGenerator: ( generator: UrlGeneratorsDefinition ) => UrlGeneratorContract; diff --git a/src/plugins/share/server/plugin.ts b/src/plugins/share/server/plugin.ts index 744a4148215c3e..6e3c68935f77bf 100644 --- a/src/plugins/share/server/plugin.ts +++ b/src/plugins/share/server/plugin.ts @@ -12,11 +12,30 @@ import { CoreSetup, Plugin, PluginInitializerContext } from 'kibana/server'; import { createRoutes } from './routes/create_routes'; import { url } from './saved_objects'; import { CSV_SEPARATOR_SETTING, CSV_QUOTE_VALUES_SETTING } from '../common/constants'; +import { UrlService } from '../common/url_service'; + +/** @public */ +export interface SharePluginSetup { + url: UrlService; +} + +/** @public */ +export interface SharePluginStart { + url: UrlService; +} + +export class SharePlugin implements Plugin { + private url?: UrlService; -export class SharePlugin implements Plugin { constructor(private readonly initializerContext: PluginInitializerContext) {} public setup(core: CoreSetup) { + this.url = new UrlService({ + navigate: async () => { + throw new Error('Locator .navigate() does not work on server.'); + }, + }); + createRoutes(core, this.initializerContext.logger.get()); core.savedObjects.registerType(url); core.uiSettings.register({ @@ -41,10 +60,18 @@ export class SharePlugin implements Plugin { schema: schema.boolean(), }, }); + + return { + url: this.url, + }; } public start() { this.initializerContext.logger.get().debug('Starting plugin'); + + return { + url: this.url!, + }; } public stop() { diff --git a/src/plugins/telemetry/schema/oss_plugins.json b/src/plugins/telemetry/schema/oss_plugins.json index 1d37c25f52fd49..7b6c4ba9788f14 100644 --- a/src/plugins/telemetry/schema/oss_plugins.json +++ b/src/plugins/telemetry/schema/oss_plugins.json @@ -3184,6 +3184,137 @@ } } }, + "integrations": { + "properties": { + "appId": { + "type": "keyword", + "_meta": { + "description": "The application being tracked" + } + }, + "viewId": { + "type": "keyword", + "_meta": { + "description": "Always `main`" + } + }, + "clicks_total": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application since we started counting them" + } + }, + "clicks_7_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application over the last 7 days" + } + }, + "clicks_30_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application over the last 30 days" + } + }, + "clicks_90_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application over the last 90 days" + } + }, + "minutes_on_screen_total": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen since we started counting them." + } + }, + "minutes_on_screen_7_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen over the last 7 days" + } + }, + "minutes_on_screen_30_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen over the last 30 days" + } + }, + "minutes_on_screen_90_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen over the last 90 days" + } + }, + "views": { + "type": "array", + "items": { + "properties": { + "appId": { + "type": "keyword", + "_meta": { + "description": "The application being tracked" + } + }, + "viewId": { + "type": "keyword", + "_meta": { + "description": "The application view being tracked" + } + }, + "clicks_total": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application sub view since we started counting them" + } + }, + "clicks_7_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the active application sub view over the last 7 days" + } + }, + "clicks_30_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the active application sub view over the last 30 days" + } + }, + "clicks_90_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the active application sub view over the last 90 days" + } + }, + "minutes_on_screen_total": { + "type": "float", + "_meta": { + "description": "Minutes the application sub view is active and on-screen since we started counting them." + } + }, + "minutes_on_screen_7_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen active application sub view over the last 7 days" + } + }, + "minutes_on_screen_30_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen active application sub view over the last 30 days" + } + }, + "minutes_on_screen_90_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen active application sub view over the last 90 days" + } + } + } + } + } + } + }, "ingestManager": { "properties": { "appId": { diff --git a/src/plugins/telemetry/server/telemetry_collection/get_local_stats.test.ts b/src/plugins/telemetry/server/telemetry_collection/get_local_stats.test.ts index 7fd6ca4080d6af..bacfa5e77107fe 100644 --- a/src/plugins/telemetry/server/telemetry_collection/get_local_stats.test.ts +++ b/src/plugins/telemetry/server/telemetry_collection/get_local_stats.test.ts @@ -188,7 +188,7 @@ describe('get_local_stats', () => { describe('handleLocalStats', () => { it('returns expected object without xpack or kibana data', () => { const result = handleLocalStats( - clusterInfo as estypes.RootNodeInfoResponse, + clusterInfo as estypes.InfoResponse, clusterStatsWithNodesUsage, void 0, void 0, @@ -205,7 +205,7 @@ describe('get_local_stats', () => { it('returns expected object with xpack', () => { const result = handleLocalStats( - clusterInfo as estypes.RootNodeInfoResponse, + clusterInfo as estypes.InfoResponse, clusterStatsWithNodesUsage, void 0, void 0, diff --git a/src/plugins/telemetry/server/telemetry_collection/get_local_stats.ts b/src/plugins/telemetry/server/telemetry_collection/get_local_stats.ts index 7fdcb50b704afe..7860949e098aa1 100644 --- a/src/plugins/telemetry/server/telemetry_collection/get_local_stats.ts +++ b/src/plugins/telemetry/server/telemetry_collection/get_local_stats.ts @@ -28,7 +28,7 @@ import { getDataTelemetry, DATA_TELEMETRY_ID, DataTelemetryPayload } from './get */ export function handleLocalStats( // eslint-disable-next-line @typescript-eslint/naming-convention - { cluster_name, cluster_uuid, version }: estypes.RootNodeInfoResponse, + { cluster_name, cluster_uuid, version }: estypes.InfoResponse, { _nodes, cluster_name: clusterName, ...clusterStats }: ClusterStats, kibana: KibanaUsageStats | undefined, dataTelemetry: DataTelemetryPayload | undefined, diff --git a/src/plugins/telemetry/server/telemetry_collection/get_nodes_usage.ts b/src/plugins/telemetry/server/telemetry_collection/get_nodes_usage.ts index c35b8a3d24498e..0d58d80ed59653 100644 --- a/src/plugins/telemetry/server/telemetry_collection/get_nodes_usage.ts +++ b/src/plugins/telemetry/server/telemetry_collection/get_nodes_usage.ts @@ -14,7 +14,7 @@ import { TIMEOUT } from './constants'; * Data returned by GET /_nodes/usage, but flattened as an array of {@link estypes.NodeUsageInformation} * with the node ID set in the field `node_id`. */ -export interface NodeUsage extends estypes.NodeUsageInformation { +export interface NodeUsage extends estypes.NodesUsageNodeUsage { /** * The Node ID as reported by ES */ diff --git a/src/plugins/telemetry/tsconfig.json b/src/plugins/telemetry/tsconfig.json index 3b043b8aab895e..710e209537b8e3 100644 --- a/src/plugins/telemetry/tsconfig.json +++ b/src/plugins/telemetry/tsconfig.json @@ -8,7 +8,14 @@ "declarationMap": true, "isolatedModules": true }, - "include": ["public/**/**/*", "server/**/**/*", "common/**/*", "../../../typings/**/*"], + "include": [ + "public/**/**/*", + "server/**/**/*", + "common/**/*", + "../../../typings/**/*", + "schema/oss_plugins.json", + "schema/oss_root.json", + ], "references": [ { "path": "../../core/tsconfig.json" }, { "path": "../../plugins/kibana_react/tsconfig.json" }, diff --git a/src/plugins/timelion/public/components/timelion_deprecation.tsx b/src/plugins/timelion/public/components/timelion_deprecation.tsx index efcef88b3d0a26..117aabed6773cb 100644 --- a/src/plugins/timelion/public/components/timelion_deprecation.tsx +++ b/src/plugins/timelion/public/components/timelion_deprecation.tsx @@ -19,7 +19,7 @@ export const TimelionDeprecation = ({ links }: DocLinksStart) => { title={ diff --git a/src/plugins/timelion/server/deprecations.ts b/src/plugins/timelion/server/deprecations.ts index e65d72cb460dfb..3c344e1d4a8d80 100644 --- a/src/plugins/timelion/server/deprecations.ts +++ b/src/plugins/timelion/server/deprecations.ts @@ -30,7 +30,7 @@ export const showWarningMessageIfTimelionSheetWasFound = async ( const count = await getTimelionSheetsCount(savedObjectsClient); if (count > 0) { logger.warn( - 'Deprecated since 7.0, the Timelion app will be removed in the last 7.x minor version. To continue using your Timelion worksheets, migrate them to a dashboard. See https://www.elastic.co/guide/en/kibana/current/create-panels-with-timelion.html.' + 'Deprecated since 7.0, the Timelion app will be removed in 7.16. To continue using your Timelion worksheets, migrate them to a dashboard. See https://www.elastic.co/guide/en/kibana/current/create-panels-with-timelion.html.' ); } }; @@ -49,7 +49,7 @@ export async function getDeprecations({ if (count > 0) { deprecations.push({ - message: `You have ${count} Timelion worksheets. The Timelion app will be removed in the last 7.x minor version. To continue using your Timelion worksheets, migrate them to a dashboard.`, + message: `You have ${count} Timelion worksheets. The Timelion app will be removed in 7.16. To continue using your Timelion worksheets, migrate them to a dashboard.`, documentationUrl: 'https://www.elastic.co/guide/en/kibana/current/create-panels-with-timelion.html', level: 'warning', diff --git a/src/plugins/vis_type_timeseries/common/fields_utils.test.ts b/src/plugins/vis_type_timeseries/common/fields_utils.test.ts index 9550697e228512..f056c38b0c0c30 100644 --- a/src/plugins/vis_type_timeseries/common/fields_utils.test.ts +++ b/src/plugins/vis_type_timeseries/common/fields_utils.test.ts @@ -12,7 +12,7 @@ import type { FieldSpec } from '../../data/common'; describe('fields_utils', () => { describe('toSanitizedFieldType', () => { const mockedField = { - lang: 'lang', + lang: 'painless', conflictDescriptions: {}, aggregatable: true, name: 'name', diff --git a/src/plugins/vis_type_vega/public/data_model/types.ts b/src/plugins/vis_type_vega/public/data_model/types.ts index 255bd9774f9df8..9e3cf0a5421c1c 100644 --- a/src/plugins/vis_type_vega/public/data_model/types.ts +++ b/src/plugins/vis_type_vega/public/data_model/types.ts @@ -17,7 +17,7 @@ import { EmsFileParser } from './ems_file_parser'; import { UrlParser } from './url_parser'; interface Body { - aggs?: Record; + aggs?: Record; query?: Query; timeout?: string; } diff --git a/src/plugins/vis_type_xy/public/config/get_axis.ts b/src/plugins/vis_type_xy/public/config/get_axis.ts index 91647f02e2a1e6..08b17c882eea6b 100644 --- a/src/plugins/vis_type_xy/public/config/get_axis.ts +++ b/src/plugins/vis_type_xy/public/config/get_axis.ts @@ -169,7 +169,7 @@ function getAxisDomain( const { min, max, defaultYExtents, boundsMargin } = scale; const fit = defaultYExtents; - const padding = boundsMargin; + const padding = boundsMargin || undefined; if (!isNil(min) && !isNil(max)) { return { fit, padding, min, max }; diff --git a/test/accessibility/apps/dashboard.ts b/test/accessibility/apps/dashboard.ts index 08d577b3df08cd..20b18583d0d72f 100644 --- a/test/accessibility/apps/dashboard.ts +++ b/test/accessibility/apps/dashboard.ts @@ -110,13 +110,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('Exit out of edit mode', async () => { - await PageObjects.dashboard.clickDiscardChanges(false); + await PageObjects.dashboard.clickCancelOutOfEditMode(false); await a11y.testAppSnapshot(); }); it('Discard changes', async () => { - await testSubjects.exists('dashboardDiscardConfirmDiscard'); - await testSubjects.click('dashboardDiscardConfirmDiscard'); + await PageObjects.common.clickConfirmOnModal(); await PageObjects.dashboard.getIsInViewMode(); await a11y.testAppSnapshot(); }); diff --git a/test/accessibility/apps/discover.ts b/test/accessibility/apps/discover.ts index 67abe15ea537a7..6705598ef6e74d 100644 --- a/test/accessibility/apps/discover.ts +++ b/test/accessibility/apps/discover.ts @@ -19,8 +19,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('Discover a11y tests', () => { before(async () => { - await esArchiver.load('discover'); - await esArchiver.loadIfNeeded('logstash_functional'); + await esArchiver.load('test/functional/fixtures/es_archiver/discover'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); await kibanaServer.uiSettings.update({ defaultIndex: 'logstash-*', 'doc_table:legacy': true, @@ -30,7 +30,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); after(async () => { - await esArchiver.unload('logstash_functional'); + await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional'); }); it('Discover main page', async () => { diff --git a/test/accessibility/apps/management.ts b/test/accessibility/apps/management.ts index 82b34793622987..692b140ade7eec 100644 --- a/test/accessibility/apps/management.ts +++ b/test/accessibility/apps/management.ts @@ -16,8 +16,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('Management', () => { before(async () => { - await esArchiver.load('discover'); - await esArchiver.loadIfNeeded('logstash_functional'); + await esArchiver.load('test/functional/fixtures/es_archiver/discover'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); await kibanaServer.uiSettings.update({ defaultIndex: 'logstash-*', }); @@ -25,7 +25,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); after(async () => { - await esArchiver.unload('logstash_functional'); + await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional'); }); it('main view', async () => { diff --git a/test/accessibility/apps/visualize.ts b/test/accessibility/apps/visualize.ts index e493b288eaa89d..6478907fcb96a6 100644 --- a/test/accessibility/apps/visualize.ts +++ b/test/accessibility/apps/visualize.ts @@ -15,7 +15,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('Visualize', () => { before(async () => { - await esArchiver.loadIfNeeded('discover'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/discover'); await PageObjects.common.navigateToApp('visualize'); }); diff --git a/test/accessibility/ftr_provider_context.d.ts b/test/accessibility/ftr_provider_context.d.ts deleted file mode 100644 index 4c827393e1ef3b..00000000000000 --- a/test/accessibility/ftr_provider_context.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { GenericFtrProviderContext } from '@kbn/test'; - -import { pageObjects } from './page_objects'; -import { services } from './services'; - -export type FtrProviderContext = GenericFtrProviderContext; diff --git a/test/accessibility/ftr_provider_context.ts b/test/accessibility/ftr_provider_context.ts new file mode 100644 index 00000000000000..a1a29f50b77611 --- /dev/null +++ b/test/accessibility/ftr_provider_context.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { GenericFtrProviderContext, GenericFtrService } from '@kbn/test'; + +import { pageObjects } from './page_objects'; +import { services } from './services'; + +export type FtrProviderContext = GenericFtrProviderContext; +export class FtrService extends GenericFtrService {} diff --git a/test/accessibility/services/a11y/a11y.ts b/test/accessibility/services/a11y/a11y.ts index ea205e8121eba0..4b01b0dd3b9531 100644 --- a/test/accessibility/services/a11y/a11y.ts +++ b/test/accessibility/services/a11y/a11y.ts @@ -9,7 +9,7 @@ import chalk from 'chalk'; import testSubjectToCss from '@kbn/test-subj-selector'; -import { FtrProviderContext } from '../../ftr_provider_context'; +import { FtrService } from '../../ftr_provider_context'; import { AxeReport, printResult } from './axe_report'; // @ts-ignore JS that is run in browser as is import { analyzeWithAxe, analyzeWithAxeWithClient } from './analyze_with_axe'; @@ -33,86 +33,84 @@ export const normalizeResult = (report: any) => { return report.result as false | AxeReport; }; -export function A11yProvider({ getService }: FtrProviderContext) { - const browser = getService('browser'); - const Wd = getService('__webdriver__'); - - /** - * Accessibility testing service using the Axe (https://www.deque.com/axe/) - * toolset to validate a11y rules similar to ESLint. In order to test against - * the rules we must load up the UI and feed a full HTML snapshot into Axe. - */ - return new (class Accessibility { - public async testAppSnapshot(options: TestOptions = {}) { - const context = this.getAxeContext(true, options.excludeTestSubj); - const report = await this.captureAxeReport(context); - await this.testAxeReport(report); - } +/** + * Accessibility testing service using the Axe (https://www.deque.com/axe/) + * toolset to validate a11y rules similar to ESLint. In order to test against + * the rules we must load up the UI and feed a full HTML snapshot into Axe. + */ +export class AccessibilityService extends FtrService { + private readonly browser = this.ctx.getService('browser'); + private readonly Wd = this.ctx.getService('__webdriver__'); + + public async testAppSnapshot(options: TestOptions = {}) { + const context = this.getAxeContext(true, options.excludeTestSubj); + const report = await this.captureAxeReport(context); + this.assertValidAxeReport(report); + } - public async testGlobalSnapshot(options: TestOptions = {}) { - const context = this.getAxeContext(false, options.excludeTestSubj); - const report = await this.captureAxeReport(context); - await this.testAxeReport(report); - } + public async testGlobalSnapshot(options: TestOptions = {}) { + const context = this.getAxeContext(false, options.excludeTestSubj); + const report = await this.captureAxeReport(context); + this.assertValidAxeReport(report); + } - private getAxeContext(global: boolean, excludeTestSubj?: string | string[]): AxeContext { - return { - include: global ? undefined : [testSubjectToCss('appA11yRoot')], - exclude: ([] as string[]) - .concat(excludeTestSubj || []) - .map((ts) => [testSubjectToCss(ts)]) - .concat([['[role="graphics-document"][aria-roledescription="visualization"]']]), - }; - } + private getAxeContext(global: boolean, excludeTestSubj?: string | string[]): AxeContext { + return { + include: global ? undefined : [testSubjectToCss('appA11yRoot')], + exclude: ([] as string[]) + .concat(excludeTestSubj || []) + .map((ts) => [testSubjectToCss(ts)]) + .concat([['[role="graphics-document"][aria-roledescription="visualization"]']]), + }; + } - private testAxeReport(report: AxeReport) { - const errorMsgs = []; + private assertValidAxeReport(report: AxeReport) { + const errorMsgs = []; - for (const result of report.violations) { - errorMsgs.push(printResult(chalk.red('VIOLATION'), result)); - } + for (const result of report.violations) { + errorMsgs.push(printResult(chalk.red('VIOLATION'), result)); + } - if (errorMsgs.length) { - throw new Error(`a11y report:\n${errorMsgs.join('\n')}`); - } + if (errorMsgs.length) { + throw new Error(`a11y report:\n${errorMsgs.join('\n')}`); } + } - private async captureAxeReport(context: AxeContext): Promise { - const axeOptions = { - reporter: 'v2', - runOnly: ['wcag2a', 'wcag2aa'], - rules: { - 'color-contrast': { - enabled: false, // disabled because we have too many failures - }, - bypass: { - enabled: false, // disabled because it's too flaky - }, + private async captureAxeReport(context: AxeContext): Promise { + const axeOptions = { + reporter: 'v2', + runOnly: ['wcag2a', 'wcag2aa'], + rules: { + 'color-contrast': { + enabled: false, // disabled because we have too many failures }, - }; - - await (Wd.driver.manage() as any).setTimeouts({ - ...(await (Wd.driver.manage() as any).getTimeouts()), - script: 600000, - }); + bypass: { + enabled: false, // disabled because it's too flaky + }, + }, + }; - const report = normalizeResult( - await browser.executeAsync(analyzeWithAxe, context, axeOptions) - ); + await this.Wd.driver.manage().setTimeouts({ + ...(await this.Wd.driver.manage().getTimeouts()), + script: 600000, + }); - if (report !== false) { - return report; - } + const report = normalizeResult( + await this.browser.executeAsync(analyzeWithAxe, context, axeOptions) + ); - const withClientReport = normalizeResult( - await browser.executeAsync(analyzeWithAxeWithClient, context, axeOptions) - ); + if (report !== false) { + return report; + } - if (withClientReport === false) { - throw new Error('Attempted to analyze with axe but failed to load axe client'); - } + const withClientReport = normalizeResult( + await this.browser.executeAsync(analyzeWithAxeWithClient, context, axeOptions) + ); - return withClientReport; + if (withClientReport === false) { + throw new Error('Attempted to analyze with axe but failed to load axe client'); } - })(); + + return withClientReport; + } } diff --git a/test/accessibility/services/a11y/index.ts b/test/accessibility/services/a11y/index.ts index 79912dd99d326f..642b170c4e0771 100644 --- a/test/accessibility/services/a11y/index.ts +++ b/test/accessibility/services/a11y/index.ts @@ -6,4 +6,4 @@ * Side Public License, v 1. */ -export { A11yProvider } from './a11y'; +export * from './a11y'; diff --git a/test/accessibility/services/index.ts b/test/accessibility/services/index.ts index ec3bf534590b34..ef5674d4011fbb 100644 --- a/test/accessibility/services/index.ts +++ b/test/accessibility/services/index.ts @@ -7,9 +7,9 @@ */ import { services as kibanaFunctionalServices } from '../../functional/services'; -import { A11yProvider } from './a11y'; +import { AccessibilityService } from './a11y'; export const services = { ...kibanaFunctionalServices, - a11y: A11yProvider, + a11y: AccessibilityService, }; diff --git a/test/api_integration/apis/index_patterns/es_errors/errors.js b/test/api_integration/apis/index_patterns/es_errors/errors.js index fab59ef256a050..1a48b391ae87d8 100644 --- a/test/api_integration/apis/index_patterns/es_errors/errors.js +++ b/test/api_integration/apis/index_patterns/es_errors/errors.js @@ -27,12 +27,14 @@ export default function ({ getService }) { let indexNotFoundError; let docNotFoundError; before(async () => { - await esArchiver.load('index_patterns/basic_index'); + await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index'); indexNotFoundError = await getIndexNotFoundError(es); docNotFoundError = await getDocNotFoundError(es); }); after(async () => { - await esArchiver.unload('index_patterns/basic_index'); + await esArchiver.unload( + 'test/api_integration/fixtures/es_archiver/index_patterns/basic_index' + ); }); describe('isEsIndexNotFoundError()', () => { diff --git a/test/api_integration/apis/index_patterns/fields_api/update_fields/main.ts b/test/api_integration/apis/index_patterns/fields_api/update_fields/main.ts index c75b6c607f56e3..16861f3c28051e 100644 --- a/test/api_integration/apis/index_patterns/fields_api/update_fields/main.ts +++ b/test/api_integration/apis/index_patterns/fields_api/update_fields/main.ts @@ -18,10 +18,11 @@ export default function ({ getService }: FtrProviderContext) { let indexPattern: any; before(async () => { - await esArchiver.load('index_patterns/basic_index'); + await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index'); indexPattern = ( await supertest.post('/api/index_patterns/index_pattern').send({ + override: true, index_pattern: { title: basicIndex, }, @@ -30,7 +31,9 @@ export default function ({ getService }: FtrProviderContext) { }); after(async () => { - await esArchiver.unload('index_patterns/basic_index'); + await esArchiver.unload( + 'test/api_integration/fixtures/es_archiver/index_patterns/basic_index' + ); if (indexPattern) { await supertest.delete('/api/index_patterns/index_pattern/' + indexPattern.id); diff --git a/test/api_integration/apis/index_patterns/fields_for_time_pattern_route/pattern.js b/test/api_integration/apis/index_patterns/fields_for_time_pattern_route/pattern.js index e14086f9d973a8..8d72cbd2fb37f5 100644 --- a/test/api_integration/apis/index_patterns/fields_for_time_pattern_route/pattern.js +++ b/test/api_integration/apis/index_patterns/fields_for_time_pattern_route/pattern.js @@ -13,8 +13,12 @@ export default function ({ getService }) { const esArchiver = getService('esArchiver'); describe('pattern', () => { - before(() => esArchiver.load('index_patterns/daily_index')); - after(() => esArchiver.unload('index_patterns/daily_index')); + before(() => + esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/daily_index') + ); + after(() => + esArchiver.unload('test/api_integration/fixtures/es_archiver/index_patterns/daily_index') + ); it('matches indices with compatible patterns', () => supertest diff --git a/test/api_integration/apis/index_patterns/fields_for_time_pattern_route/query_params.js b/test/api_integration/apis/index_patterns/fields_for_time_pattern_route/query_params.js index 3ccf6a7791f6c3..481f433deeb730 100644 --- a/test/api_integration/apis/index_patterns/fields_for_time_pattern_route/query_params.js +++ b/test/api_integration/apis/index_patterns/fields_for_time_pattern_route/query_params.js @@ -13,8 +13,12 @@ export default function ({ getService }) { const esArchiver = getService('esArchiver'); describe('query params', () => { - before(() => esArchiver.load('index_patterns/daily_index')); - after(() => esArchiver.unload('index_patterns/daily_index')); + before(() => + esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/daily_index') + ); + after(() => + esArchiver.unload('test/api_integration/fixtures/es_archiver/index_patterns/daily_index') + ); it('requires `pattern` query param', () => supertest diff --git a/test/api_integration/apis/index_patterns/fields_for_wildcard_route/conflicts.js b/test/api_integration/apis/index_patterns/fields_for_wildcard_route/conflicts.js index a06c37ea84b4cd..f050e2a0626d36 100644 --- a/test/api_integration/apis/index_patterns/fields_for_wildcard_route/conflicts.js +++ b/test/api_integration/apis/index_patterns/fields_for_wildcard_route/conflicts.js @@ -13,8 +13,12 @@ export default function ({ getService }) { const esArchiver = getService('esArchiver'); describe('conflicts', () => { - before(() => esArchiver.load('index_patterns/conflicts')); - after(() => esArchiver.unload('index_patterns/conflicts')); + before(() => + esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/conflicts') + ); + after(() => + esArchiver.unload('test/api_integration/fixtures/es_archiver/index_patterns/conflicts') + ); it('flags fields with mismatched types as conflicting', () => supertest diff --git a/test/api_integration/apis/index_patterns/fields_for_wildcard_route/params.js b/test/api_integration/apis/index_patterns/fields_for_wildcard_route/params.js index 61b795ed67d332..5b82473721be8c 100644 --- a/test/api_integration/apis/index_patterns/fields_for_wildcard_route/params.js +++ b/test/api_integration/apis/index_patterns/fields_for_wildcard_route/params.js @@ -12,8 +12,12 @@ export default function ({ getService }) { const randomness = getService('randomness'); describe('params', () => { - before(() => esArchiver.load('index_patterns/basic_index')); - after(() => esArchiver.unload('index_patterns/basic_index')); + before(() => + esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index') + ); + after(() => + esArchiver.unload('test/api_integration/fixtures/es_archiver/index_patterns/basic_index') + ); it('requires a pattern query param', () => supertest.get('/api/index_patterns/_fields_for_wildcard').query({}).expect(400)); diff --git a/test/api_integration/apis/index_patterns/fields_for_wildcard_route/response.js b/test/api_integration/apis/index_patterns/fields_for_wildcard_route/response.js index 87c5aa535ccd98..913db9aee9c0f8 100644 --- a/test/api_integration/apis/index_patterns/fields_for_wildcard_route/response.js +++ b/test/api_integration/apis/index_patterns/fields_for_wildcard_route/response.js @@ -67,8 +67,12 @@ export default function ({ getService }) { ]; describe('fields_for_wildcard_route response', () => { - before(() => esArchiver.load('index_patterns/basic_index')); - after(() => esArchiver.unload('index_patterns/basic_index')); + before(() => + esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index') + ); + after(() => + esArchiver.unload('test/api_integration/fixtures/es_archiver/index_patterns/basic_index') + ); it('returns a flattened version of the fields in es', async () => { await supertest diff --git a/test/api_integration/apis/index_patterns/index.js b/test/api_integration/apis/index_patterns/index.js index 9c1e1bba0ab9a5..656b4e506fa23d 100644 --- a/test/api_integration/apis/index_patterns/index.js +++ b/test/api_integration/apis/index_patterns/index.js @@ -15,5 +15,7 @@ export default function ({ loadTestFile }) { loadTestFile(require.resolve('./scripted_fields_crud')); loadTestFile(require.resolve('./fields_api')); loadTestFile(require.resolve('./default_index_pattern')); + loadTestFile(require.resolve('./runtime_fields_crud')); + loadTestFile(require.resolve('./integration')); }); } diff --git a/test/api_integration/apis/index_patterns/index_pattern_crud/create_index_pattern/main.ts b/test/api_integration/apis/index_patterns/index_pattern_crud/create_index_pattern/main.ts index 91f165dbdda7cc..500a642f60850e 100644 --- a/test/api_integration/apis/index_patterns/index_pattern_crud/create_index_pattern/main.ts +++ b/test/api_integration/apis/index_patterns/index_pattern_crud/create_index_pattern/main.ts @@ -78,11 +78,15 @@ export default function ({ getService }: FtrProviderContext) { describe('creating fields', () => { before(async () => { - await esArchiver.load('index_patterns/basic_index'); + await esArchiver.load( + 'test/api_integration/fixtures/es_archiver/index_patterns/basic_index' + ); }); after(async () => { - await esArchiver.unload('index_patterns/basic_index'); + await esArchiver.unload( + 'test/api_integration/fixtures/es_archiver/index_patterns/basic_index' + ); }); it('can specify optional fields attribute when creating an index pattern', async () => { @@ -113,7 +117,7 @@ export default function ({ getService }: FtrProviderContext) { expect(response.body.index_pattern.fields.bar.type).to.be('boolean'); }); - it('Can add scripted fields, other fields created from es index', async () => { + it('can add scripted fields, other fields created from es index', async () => { const title = `basic_index*`; const response = await supertest.post('/api/index_patterns/index_pattern').send({ override: true, @@ -155,6 +159,32 @@ export default function ({ getService }: FtrProviderContext) { expect(response.body.index_pattern.fields.bar.esTypes[0]).to.be('test-type'); expect(response.body.index_pattern.fields.bar.scripted).to.be(true); }); + + it('can add runtime fields', async () => { + const title = `basic_index*`; + const response = await supertest.post('/api/index_patterns/index_pattern').send({ + override: true, + index_pattern: { + title, + runtimeFieldMap: { + runtimeFoo: { + type: 'keyword', + script: { + source: 'emit(doc["foo"].value)', + }, + }, + }, + }, + }); + + expect(response.status).to.be(200); + expect(response.body.index_pattern.title).to.be(title); + + expect(response.body.index_pattern.runtimeFieldMap.runtimeFoo.type).to.be('keyword'); + expect(response.body.index_pattern.runtimeFieldMap.runtimeFoo.script.source).to.be( + 'emit(doc["foo"].value)' + ); + }); }); it('can specify optional typeMeta attribute when creating an index pattern', async () => { diff --git a/test/api_integration/apis/index_patterns/index_pattern_crud/create_index_pattern/validation.ts b/test/api_integration/apis/index_patterns/index_pattern_crud/create_index_pattern/validation.ts index 2f62ea231b7229..598001644eedbe 100644 --- a/test/api_integration/apis/index_patterns/index_pattern_crud/create_index_pattern/validation.ts +++ b/test/api_integration/apis/index_patterns/index_pattern_crud/create_index_pattern/validation.ts @@ -64,5 +64,25 @@ export default function ({ getService }: FtrProviderContext) { '[request body.refresh_fields]: expected value of type [boolean] but got [number]' ); }); + + it('returns an error when unknown runtime field type', async () => { + const title = `basic_index*`; + const response = await supertest.post('/api/index_patterns/index_pattern').send({ + override: true, + index_pattern: { + title, + runtimeFieldMap: { + runtimeFoo: { + type: 'wrong-type', + script: { + source: 'emit(doc["foo"].value)', + }, + }, + }, + }, + }); + + expect(response.status).to.be(400); + }); }); } diff --git a/test/api_integration/apis/index_patterns/index_pattern_crud/update_index_pattern/main.ts b/test/api_integration/apis/index_patterns/index_pattern_crud/update_index_pattern/main.ts index cd34724e6cda35..7532278d7eb128 100644 --- a/test/api_integration/apis/index_patterns/index_pattern_crud/update_index_pattern/main.ts +++ b/test/api_integration/apis/index_patterns/index_pattern_crud/update_index_pattern/main.ts @@ -284,5 +284,53 @@ export default function ({ getService }: FtrProviderContext) { expect(response3.body.index_pattern.intervalName).to.be('intervalName2'); expect(response3.body.index_pattern.typeMeta.baz).to.be('qux'); }); + + it('can update runtime fields', async () => { + const title = `basic_index*`; + const response1 = await supertest.post('/api/index_patterns/index_pattern').send({ + override: true, + index_pattern: { + title, + runtimeFieldMap: { + runtimeFoo: { + type: 'keyword', + script: { + source: 'emit(doc["foo"].value)', + }, + }, + }, + }, + }); + + expect(response1.status).to.be(200); + expect(response1.body.index_pattern.title).to.be(title); + + expect(response1.body.index_pattern.runtimeFieldMap.runtimeFoo.type).to.be('keyword'); + expect(response1.body.index_pattern.runtimeFieldMap.runtimeFoo.script.source).to.be( + 'emit(doc["foo"].value)' + ); + + const id = response1.body.index_pattern.id; + const response2 = await supertest.post('/api/index_patterns/index_pattern/' + id).send({ + index_pattern: { + runtimeFieldMap: { + runtimeBar: { + type: 'keyword', + script: { + source: 'emit(doc["foo"].value)', + }, + }, + }, + }, + }); + + expect(response2.body.index_pattern.runtimeFieldMap.runtimeBar.type).to.be('keyword'); + expect(response2.body.index_pattern.runtimeFieldMap.runtimeFoo).to.be(undefined); + + const response3 = await supertest.get('/api/index_patterns/index_pattern/' + id); + + expect(response3.body.index_pattern.runtimeFieldMap.runtimeBar.type).to.be('keyword'); + expect(response3.body.index_pattern.runtimeFieldMap.runtimeFoo).to.be(undefined); + }); }); } diff --git a/test/api_integration/apis/index_patterns/integration/index.ts b/test/api_integration/apis/index_patterns/integration/index.ts new file mode 100644 index 00000000000000..6fd5f644ae8949 --- /dev/null +++ b/test/api_integration/apis/index_patterns/integration/index.ts @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { FtrProviderContext } from '../../../ftr_provider_context'; + +/** + * Test usage of different index patterns APIs in combination + */ +export default function ({ loadTestFile }: FtrProviderContext) { + describe('integration', () => { + loadTestFile(require.resolve('./integration')); + }); +} diff --git a/test/api_integration/apis/index_patterns/integration/integration.ts b/test/api_integration/apis/index_patterns/integration/integration.ts new file mode 100644 index 00000000000000..22f07553733235 --- /dev/null +++ b/test/api_integration/apis/index_patterns/integration/integration.ts @@ -0,0 +1,119 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import expect from '@kbn/expect'; +import _ from 'lodash'; +import { FtrProviderContext } from '../../../ftr_provider_context'; + +/** + * Test usage of different index patterns APIs in combination + */ +export default function ({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + const esArchiver = getService('esArchiver'); + + describe('integration', () => { + before(async () => { + await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index'); + }); + + after(async () => { + await esArchiver.unload( + 'test/api_integration/fixtures/es_archiver/index_patterns/basic_index' + ); + }); + + it('create an index pattern, add a runtime field, add a field formatter, then re-create the same index pattern', async () => { + const title = `basic_index*`; + const response1 = await supertest.post('/api/index_patterns/index_pattern').send({ + override: true, + index_pattern: { + title, + }, + }); + const id = response1.body.index_pattern.id; + const response2 = await supertest + .post(`/api/index_patterns/index_pattern/${id}/runtime_field`) + .send({ + name: 'runtimeBar', + runtimeField: { + type: 'long', + script: { + source: "emit(doc['field_name'].value)", + }, + }, + }); + + expect(response2.status).to.be(200); + + const response3 = await supertest + .post(`/api/index_patterns/index_pattern/${response1.body.index_pattern.id}/fields`) + .send({ + fields: { + runtimeBar: { + count: 123, + customLabel: 'test', + }, + }, + }); + + expect(response3.status).to.be(200); + + const response4 = await supertest + .post(`/api/index_patterns/index_pattern/${response1.body.index_pattern.id}/fields`) + .send({ + fields: { + runtimeBar: { + format: { + id: 'duration', + params: { inputFormat: 'milliseconds', outputFormat: 'humanizePrecise' }, + }, + }, + }, + }); + + expect(response4.status).to.be(200); + + const response5 = await supertest.get( + '/api/index_patterns/index_pattern/' + response1.body.index_pattern.id + ); + + expect(response5.status).to.be(200); + + const resultIndexPattern = response5.body.index_pattern; + + const runtimeField = resultIndexPattern.fields.runtimeBar; + expect(runtimeField.name).to.be('runtimeBar'); + expect(runtimeField.runtimeField.type).to.be('long'); + expect(runtimeField.runtimeField.script.source).to.be("emit(doc['field_name'].value)"); + expect(runtimeField.scripted).to.be(false); + + expect(resultIndexPattern.fieldFormats.runtimeBar.id).to.be('duration'); + expect(resultIndexPattern.fieldFormats.runtimeBar.params.inputFormat).to.be('milliseconds'); + expect(resultIndexPattern.fieldFormats.runtimeBar.params.outputFormat).to.be( + 'humanizePrecise' + ); + + expect(resultIndexPattern.fieldAttrs.runtimeBar.count).to.be(123); + expect(resultIndexPattern.fieldAttrs.runtimeBar.customLabel).to.be('test'); + + // check that retrieved object is transient and a clone can be created + const response6 = await supertest.post('/api/index_patterns/index_pattern').send({ + override: true, + index_pattern: resultIndexPattern, + }); + + expect(response6.status).to.be(200); + const recreatedIndexPattern = response6.body.index_pattern; + + expect(_.omit(recreatedIndexPattern, 'version')).to.eql( + _.omit(resultIndexPattern, 'version') + ); + }); + }); +} diff --git a/test/api_integration/apis/index_patterns/runtime_fields_crud/create_runtime_field/errors.ts b/test/api_integration/apis/index_patterns/runtime_fields_crud/create_runtime_field/errors.ts new file mode 100644 index 00000000000000..8ce9e3b36b5c8d --- /dev/null +++ b/test/api_integration/apis/index_patterns/runtime_fields_crud/create_runtime_field/errors.ts @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../../ftr_provider_context'; + +export default function ({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + + describe('errors', () => { + it('returns an error field object is not provided', async () => { + const title = `foo-${Date.now()}-${Math.random()}*`; + const response1 = await supertest.post('/api/index_patterns/index_pattern').send({ + index_pattern: { + title, + }, + }); + const id = response1.body.index_pattern.id; + const response2 = await supertest + .post(`/api/index_patterns/index_pattern/${id}/runtime_field`) + .send({}); + + expect(response2.status).to.be(400); + expect(response2.body.statusCode).to.be(400); + expect(response2.body.message).to.be( + '[request body.name]: expected value of type [string] but got [undefined]' + ); + }); + }); +} diff --git a/test/api_integration/apis/index_patterns/runtime_fields_crud/create_runtime_field/index.ts b/test/api_integration/apis/index_patterns/runtime_fields_crud/create_runtime_field/index.ts new file mode 100644 index 00000000000000..2cb90ca087f497 --- /dev/null +++ b/test/api_integration/apis/index_patterns/runtime_fields_crud/create_runtime_field/index.ts @@ -0,0 +1,16 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { FtrProviderContext } from '../../../../ftr_provider_context'; + +export default function ({ loadTestFile }: FtrProviderContext) { + describe('create_runtime_field', () => { + loadTestFile(require.resolve('./errors')); + loadTestFile(require.resolve('./main')); + }); +} diff --git a/test/api_integration/apis/index_patterns/runtime_fields_crud/create_runtime_field/main.ts b/test/api_integration/apis/index_patterns/runtime_fields_crud/create_runtime_field/main.ts new file mode 100644 index 00000000000000..e262b9d838e97a --- /dev/null +++ b/test/api_integration/apis/index_patterns/runtime_fields_crud/create_runtime_field/main.ts @@ -0,0 +1,95 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../../ftr_provider_context'; + +export default function ({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + const esArchiver = getService('esArchiver'); + + describe('main', () => { + before(async () => { + await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index'); + }); + + after(async () => { + await esArchiver.unload( + 'test/api_integration/fixtures/es_archiver/index_patterns/basic_index' + ); + }); + + it('can create a new runtime field', async () => { + const title = `basic_index*`; + const response1 = await supertest.post('/api/index_patterns/index_pattern').send({ + override: true, + index_pattern: { + title, + }, + }); + const id = response1.body.index_pattern.id; + const response2 = await supertest + .post(`/api/index_patterns/index_pattern/${id}/runtime_field`) + .send({ + name: 'runtimeBar', + runtimeField: { + type: 'long', + script: { + source: "emit(doc['field_name'].value)", + }, + }, + }); + + expect(response2.status).to.be(200); + expect(response2.body.field.name).to.be('runtimeBar'); + expect(response2.body.field.runtimeField.type).to.be('long'); + expect(response2.body.field.runtimeField.script.source).to.be( + "emit(doc['field_name'].value)" + ); + expect(response2.body.field.scripted).to.be(false); + }); + + it('newly created runtime field is available in the index_pattern object', async () => { + const title = `basic_index`; + const response1 = await supertest.post('/api/index_patterns/index_pattern').send({ + override: true, + index_pattern: { + title, + }, + }); + + await supertest + .post(`/api/index_patterns/index_pattern/${response1.body.index_pattern.id}/runtime_field`) + .send({ + name: 'runtimeBar', + runtimeField: { + type: 'long', + script: { + source: "emit(doc['field_name'].value)", + }, + }, + }); + + const response2 = await supertest.get( + '/api/index_patterns/index_pattern/' + response1.body.index_pattern.id + ); + + expect(response2.status).to.be(200); + + const field = response2.body.index_pattern.fields.runtimeBar; + + expect(field.name).to.be('runtimeBar'); + expect(field.runtimeField.type).to.be('long'); + expect(field.runtimeField.script.source).to.be("emit(doc['field_name'].value)"); + expect(field.scripted).to.be(false); + await supertest.delete( + '/api/index_patterns/index_pattern/' + response1.body.index_pattern.id + ); + }); + }); +} diff --git a/test/api_integration/apis/index_patterns/runtime_fields_crud/delete_runtime_field/errors.ts b/test/api_integration/apis/index_patterns/runtime_fields_crud/delete_runtime_field/errors.ts new file mode 100644 index 00000000000000..b41a630889ff8a --- /dev/null +++ b/test/api_integration/apis/index_patterns/runtime_fields_crud/delete_runtime_field/errors.ts @@ -0,0 +1,81 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../../ftr_provider_context'; + +export default function ({ getService }: FtrProviderContext) { + const esArchiver = getService('esArchiver'); + const supertest = getService('supertest'); + + describe('errors', () => { + const basicIndex = 'b*sic_index'; + let indexPattern: any; + + before(async () => { + await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index'); + + indexPattern = ( + await supertest.post('/api/index_patterns/index_pattern').send({ + index_pattern: { + title: basicIndex, + }, + }) + ).body.index_pattern; + }); + + after(async () => { + await esArchiver.unload( + 'test/api_integration/fixtures/es_archiver/index_patterns/basic_index' + ); + + if (indexPattern) { + await supertest.delete('/api/index_patterns/index_pattern/' + indexPattern.id); + } + }); + + it('returns 404 error on non-existing index_pattern', async () => { + const id = `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx-${Date.now()}`; + const response = await supertest.delete( + `/api/index_patterns/index_pattern/${id}/runtime_field/foo` + ); + + expect(response.status).to.be(404); + }); + + it('returns 404 error on non-existing runtime field', async () => { + const response1 = await supertest.delete( + `/api/index_patterns/index_pattern/${indexPattern.id}/runtime_field/test` + ); + + expect(response1.status).to.be(404); + }); + + it('returns error when attempting to delete a field which is not a runtime field', async () => { + const response2 = await supertest.delete( + `/api/index_patterns/index_pattern/${indexPattern.id}/runtime_field/foo` + ); + + expect(response2.status).to.be(400); + expect(response2.body.statusCode).to.be(400); + expect(response2.body.message).to.be('Only runtime fields can be deleted.'); + }); + + it('returns error when ID is too long', async () => { + const id = `xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx`; + const response = await supertest.delete( + `/api/index_patterns/index_pattern/${id}/runtime_field/foo` + ); + + expect(response.status).to.be(400); + expect(response.body.message).to.be( + '[request params.id]: value has length [1759] but it must have a maximum length of [1000].' + ); + }); + }); +} diff --git a/test/api_integration/apis/index_patterns/runtime_fields_crud/delete_runtime_field/index.ts b/test/api_integration/apis/index_patterns/runtime_fields_crud/delete_runtime_field/index.ts new file mode 100644 index 00000000000000..a14201e750ddaf --- /dev/null +++ b/test/api_integration/apis/index_patterns/runtime_fields_crud/delete_runtime_field/index.ts @@ -0,0 +1,16 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { FtrProviderContext } from '../../../../ftr_provider_context'; + +export default function ({ loadTestFile }: FtrProviderContext) { + describe('delete_runtime_field', () => { + loadTestFile(require.resolve('./errors')); + loadTestFile(require.resolve('./main')); + }); +} diff --git a/test/api_integration/apis/index_patterns/runtime_fields_crud/delete_runtime_field/main.ts b/test/api_integration/apis/index_patterns/runtime_fields_crud/delete_runtime_field/main.ts new file mode 100644 index 00000000000000..3c74aa336e440c --- /dev/null +++ b/test/api_integration/apis/index_patterns/runtime_fields_crud/delete_runtime_field/main.ts @@ -0,0 +1,66 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../../ftr_provider_context'; + +export default function ({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + const esArchiver = getService('esArchiver'); + + describe('main', () => { + before(async () => { + await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index'); + }); + + after(async () => { + await esArchiver.unload( + 'test/api_integration/fixtures/es_archiver/index_patterns/basic_index' + ); + }); + + it('can delete a runtime field', async () => { + const title = `basic_index*`; + const response1 = await supertest.post('/api/index_patterns/index_pattern').send({ + override: true, + index_pattern: { + title, + runtimeFieldMap: { + runtimeBar: { + type: 'long', + script: { + source: "emit(doc['field_name'].value)", + }, + }, + }, + }, + }); + + const response2 = await supertest.get( + '/api/index_patterns/index_pattern/' + response1.body.index_pattern.id + ); + + expect(typeof response2.body.index_pattern.fields.runtimeBar).to.be('object'); + + const response3 = await supertest.delete( + `/api/index_patterns/index_pattern/${response1.body.index_pattern.id}/runtime_field/runtimeBar` + ); + + expect(response3.status).to.be(200); + + const response4 = await supertest.get( + '/api/index_patterns/index_pattern/' + response1.body.index_pattern.id + ); + + expect(typeof response4.body.index_pattern.fields.runtimeBar).to.be('undefined'); + await supertest.delete( + '/api/index_patterns/index_pattern/' + response1.body.index_pattern.id + ); + }); + }); +} diff --git a/test/api_integration/apis/index_patterns/runtime_fields_crud/get_runtime_field/errors.ts b/test/api_integration/apis/index_patterns/runtime_fields_crud/get_runtime_field/errors.ts new file mode 100644 index 00000000000000..3608089e4641a2 --- /dev/null +++ b/test/api_integration/apis/index_patterns/runtime_fields_crud/get_runtime_field/errors.ts @@ -0,0 +1,81 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../../ftr_provider_context'; + +export default function ({ getService }: FtrProviderContext) { + const esArchiver = getService('esArchiver'); + const supertest = getService('supertest'); + + describe('errors', () => { + const basicIndex = '*asic_index'; + let indexPattern: any; + + before(async () => { + await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index'); + + indexPattern = ( + await supertest.post('/api/index_patterns/index_pattern').send({ + index_pattern: { + title: basicIndex, + }, + }) + ).body.index_pattern; + }); + + after(async () => { + await esArchiver.unload( + 'test/api_integration/fixtures/es_archiver/index_patterns/basic_index' + ); + + if (indexPattern) { + await supertest.delete('/api/index_patterns/index_pattern/' + indexPattern.id); + } + }); + + it('returns 404 error on non-existing index_pattern', async () => { + const id = `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx-${Date.now()}`; + const response = await supertest.get( + `/api/index_patterns/index_pattern/${id}/runtime_field/foo` + ); + + expect(response.status).to.be(404); + }); + + it('returns 404 error on non-existing runtime field', async () => { + const response1 = await supertest.get( + `/api/index_patterns/index_pattern/${indexPattern.id}/runtime_field/sf` + ); + + expect(response1.status).to.be(404); + }); + + it('returns error when ID is too long', async () => { + const id = `xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx`; + const response = await supertest.get( + `/api/index_patterns/index_pattern/${id}/runtime_field/foo` + ); + + expect(response.status).to.be(400); + expect(response.body.message).to.be( + '[request params.id]: value has length [1759] but it must have a maximum length of [1000].' + ); + }); + + it('returns error when attempting to fetch a field which is not a runtime field', async () => { + const response2 = await supertest.get( + `/api/index_patterns/index_pattern/${indexPattern.id}/runtime_field/foo` + ); + + expect(response2.status).to.be(400); + expect(response2.body.statusCode).to.be(400); + expect(response2.body.message).to.be('Only runtime fields can be retrieved.'); + }); + }); +} diff --git a/test/api_integration/apis/index_patterns/runtime_fields_crud/get_runtime_field/index.ts b/test/api_integration/apis/index_patterns/runtime_fields_crud/get_runtime_field/index.ts new file mode 100644 index 00000000000000..2e48ba64841eeb --- /dev/null +++ b/test/api_integration/apis/index_patterns/runtime_fields_crud/get_runtime_field/index.ts @@ -0,0 +1,16 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { FtrProviderContext } from '../../../../ftr_provider_context'; + +export default function ({ loadTestFile }: FtrProviderContext) { + describe('get_runtime_field', () => { + loadTestFile(require.resolve('./errors')); + loadTestFile(require.resolve('./main')); + }); +} diff --git a/test/api_integration/apis/index_patterns/runtime_fields_crud/get_runtime_field/main.ts b/test/api_integration/apis/index_patterns/runtime_fields_crud/get_runtime_field/main.ts new file mode 100644 index 00000000000000..fa0283d69d8e3b --- /dev/null +++ b/test/api_integration/apis/index_patterns/runtime_fields_crud/get_runtime_field/main.ts @@ -0,0 +1,71 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../../ftr_provider_context'; + +export default function ({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + const esArchiver = getService('esArchiver'); + + describe('main', () => { + before(async () => { + await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index'); + }); + + after(async () => { + await esArchiver.unload( + 'test/api_integration/fixtures/es_archiver/index_patterns/basic_index' + ); + }); + + it('can fetch a runtime field', async () => { + const title = `basic_index*`; + const response1 = await supertest.post('/api/index_patterns/index_pattern').send({ + override: true, + index_pattern: { + title, + runtimeFieldMap: { + runtimeFoo: { + type: 'keyword', + script: { + source: "emit(doc['field_name'].value)", + }, + }, + runtimeBar: { + type: 'keyword', + script: { + source: "emit(doc['field_name'].value)", + }, + }, + }, + }, + }); + + expect(response1.status).to.be(200); + + const response2 = await supertest.get( + '/api/index_patterns/index_pattern/' + + response1.body.index_pattern.id + + '/runtime_field/runtimeFoo' + ); + + expect(response2.status).to.be(200); + expect(typeof response2.body.field).to.be('object'); + expect(response2.body.field.name).to.be('runtimeFoo'); + expect(response2.body.field.type).to.be('string'); + expect(response2.body.field.scripted).to.be(false); + expect(response2.body.field.runtimeField.script.source).to.be( + "emit(doc['field_name'].value)" + ); + await supertest.delete( + '/api/index_patterns/index_pattern/' + response1.body.index_pattern.id + ); + }); + }); +} diff --git a/test/api_integration/apis/index_patterns/runtime_fields_crud/index.ts b/test/api_integration/apis/index_patterns/runtime_fields_crud/index.ts new file mode 100644 index 00000000000000..7a727a3e867550 --- /dev/null +++ b/test/api_integration/apis/index_patterns/runtime_fields_crud/index.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { FtrProviderContext } from '../../../ftr_provider_context'; + +export default function ({ loadTestFile }: FtrProviderContext) { + describe('runtime_fields_crud', () => { + loadTestFile(require.resolve('./create_runtime_field')); + loadTestFile(require.resolve('./get_runtime_field')); + loadTestFile(require.resolve('./delete_runtime_field')); + loadTestFile(require.resolve('./put_runtime_field')); + loadTestFile(require.resolve('./update_runtime_field')); + }); +} diff --git a/test/api_integration/apis/index_patterns/runtime_fields_crud/put_runtime_field/errors.ts b/test/api_integration/apis/index_patterns/runtime_fields_crud/put_runtime_field/errors.ts new file mode 100644 index 00000000000000..9faca08238033e --- /dev/null +++ b/test/api_integration/apis/index_patterns/runtime_fields_crud/put_runtime_field/errors.ts @@ -0,0 +1,69 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../../ftr_provider_context'; + +export default function ({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + const esArchiver = getService('esArchiver'); + + describe('errors', () => { + before(async () => { + await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index'); + }); + + after(async () => { + await esArchiver.unload( + 'test/api_integration/fixtures/es_archiver/index_patterns/basic_index' + ); + }); + + it('returns 404 error on non-existing index_pattern', async () => { + const id = `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx-${Date.now()}`; + const response = await supertest + .put(`/api/index_patterns/index_pattern/${id}/runtime_field`) + .send({ + name: 'runtimeBar', + runtimeField: { + type: 'long', + script: { + source: "emit(doc['field_name'].value)", + }, + }, + }); + + expect(response.status).to.be(404); + }); + + it('returns error on non-runtime field update attempt', async () => { + const title = `basic_index`; + const response1 = await supertest.post('/api/index_patterns/index_pattern').send({ + override: true, + index_pattern: { + title, + }, + }); + + const response2 = await supertest + .put(`/api/index_patterns/index_pattern/${response1.body.index_pattern.id}/runtime_field`) + .send({ + name: 'bar', + runtimeField: { + type: 'long', + script: { + source: "emit(doc['field_name'].value)", + }, + }, + }); + + expect(response2.status).to.be(400); + expect(response2.body.message).to.be('Only runtime fields can be updated'); + }); + }); +} diff --git a/test/api_integration/apis/index_patterns/runtime_fields_crud/put_runtime_field/index.ts b/test/api_integration/apis/index_patterns/runtime_fields_crud/put_runtime_field/index.ts new file mode 100644 index 00000000000000..724f18e57f3efd --- /dev/null +++ b/test/api_integration/apis/index_patterns/runtime_fields_crud/put_runtime_field/index.ts @@ -0,0 +1,16 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { FtrProviderContext } from '../../../../ftr_provider_context'; + +export default function ({ loadTestFile }: FtrProviderContext) { + describe('put_runtime_field', () => { + loadTestFile(require.resolve('./errors')); + loadTestFile(require.resolve('./main')); + }); +} diff --git a/test/api_integration/apis/index_patterns/runtime_fields_crud/put_runtime_field/main.ts b/test/api_integration/apis/index_patterns/runtime_fields_crud/put_runtime_field/main.ts new file mode 100644 index 00000000000000..92d8c6fd6d3c25 --- /dev/null +++ b/test/api_integration/apis/index_patterns/runtime_fields_crud/put_runtime_field/main.ts @@ -0,0 +1,122 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../../ftr_provider_context'; + +export default function ({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + const esArchiver = getService('esArchiver'); + + describe('main', () => { + before(async () => { + await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index'); + }); + + after(async () => { + await esArchiver.unload( + 'test/api_integration/fixtures/es_archiver/index_patterns/basic_index' + ); + }); + + it('can overwrite an existing field', async () => { + const title = `basic_index`; + const response1 = await supertest.post('/api/index_patterns/index_pattern').send({ + override: true, + index_pattern: { + title, + runtimeFieldMap: { + runtimeFoo: { + type: 'keyword', + script: { + source: "doc['field_name'].value", + }, + }, + runtimeBar: { + type: 'keyword', + script: { + source: "doc['field_name'].value", + }, + }, + }, + }, + }); + + const response2 = await supertest + .put(`/api/index_patterns/index_pattern/${response1.body.index_pattern.id}/runtime_field`) + .send({ + name: 'runtimeFoo', + runtimeField: { + type: 'long', + script: { + source: "doc['field_name'].value", + }, + }, + }); + + expect(response2.status).to.be(200); + + const response3 = await supertest.get( + '/api/index_patterns/index_pattern/' + + response1.body.index_pattern.id + + '/runtime_field/runtimeFoo' + ); + + expect(response3.status).to.be(200); + expect(response3.body.field.type).to.be('number'); + + const response4 = await supertest.get( + '/api/index_patterns/index_pattern/' + + response1.body.index_pattern.id + + '/runtime_field/runtimeBar' + ); + + expect(response4.status).to.be(200); + expect(response4.body.field.type).to.be('string'); + }); + + it('can add a new runtime field', async () => { + const title = `basic_index`; + const response1 = await supertest.post('/api/index_patterns/index_pattern').send({ + override: true, + index_pattern: { + title, + runtimeFieldMap: { + runtimeFoo: { + type: 'keyword', + script: { + source: "doc['field_name'].value", + }, + }, + }, + }, + }); + + await supertest + .put(`/api/index_patterns/index_pattern/${response1.body.index_pattern.id}/runtime_field`) + .send({ + name: 'runtimeBar', + runtimeField: { + type: 'long', + script: { + source: "doc['field_name'].value", + }, + }, + }); + + const response2 = await supertest.get( + '/api/index_patterns/index_pattern/' + + response1.body.index_pattern.id + + '/runtime_field/runtimeBar' + ); + + expect(response2.status).to.be(200); + expect(typeof response2.body.field.runtimeField).to.be('object'); + }); + }); +} diff --git a/test/api_integration/apis/index_patterns/runtime_fields_crud/update_runtime_field/errors.ts b/test/api_integration/apis/index_patterns/runtime_fields_crud/update_runtime_field/errors.ts new file mode 100644 index 00000000000000..3980821c0fd096 --- /dev/null +++ b/test/api_integration/apis/index_patterns/runtime_fields_crud/update_runtime_field/errors.ts @@ -0,0 +1,51 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../../ftr_provider_context'; + +export default function ({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + + describe('errors', () => { + it('returns 404 error on non-existing index_pattern', async () => { + const id = `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx-${Date.now()}`; + const response = await supertest + .post(`/api/index_patterns/index_pattern/${id}/runtime_field/foo`) + .send({ + runtimeField: { + script: { + source: "doc['something_new'].value", + }, + }, + }); + + expect(response.status).to.be(404); + }); + + it('returns error when field name is specified', async () => { + const id = `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx-${Date.now()}`; + const response = await supertest + .post(`/api/index_patterns/index_pattern/${id}/runtime_field/foo`) + .send({ + name: 'foo', + runtimeField: { + script: { + source: "doc['something_new'].value", + }, + }, + }); + + expect(response.status).to.be(400); + expect(response.body.statusCode).to.be(400); + expect(response.body.message).to.be( + "[request body.name]: a value wasn't expected to be present" + ); + }); + }); +} diff --git a/test/api_integration/apis/index_patterns/runtime_fields_crud/update_runtime_field/index.ts b/test/api_integration/apis/index_patterns/runtime_fields_crud/update_runtime_field/index.ts new file mode 100644 index 00000000000000..f5d556ca9994ab --- /dev/null +++ b/test/api_integration/apis/index_patterns/runtime_fields_crud/update_runtime_field/index.ts @@ -0,0 +1,16 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { FtrProviderContext } from '../../../../ftr_provider_context'; + +export default function ({ loadTestFile }: FtrProviderContext) { + describe('update_runtime_field', () => { + loadTestFile(require.resolve('./errors')); + loadTestFile(require.resolve('./main')); + }); +} diff --git a/test/api_integration/apis/index_patterns/runtime_fields_crud/update_runtime_field/main.ts b/test/api_integration/apis/index_patterns/runtime_fields_crud/update_runtime_field/main.ts new file mode 100644 index 00000000000000..6b924570a0e45b --- /dev/null +++ b/test/api_integration/apis/index_patterns/runtime_fields_crud/update_runtime_field/main.ts @@ -0,0 +1,76 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../../ftr_provider_context'; + +export default function ({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + const esArchiver = getService('esArchiver'); + + describe('main', () => { + before(async () => { + await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index'); + }); + + after(async () => { + await esArchiver.unload( + 'test/api_integration/fixtures/es_archiver/index_patterns/basic_index' + ); + }); + + it('can update an existing field', async () => { + const title = `basic_index`; + const response1 = await supertest.post('/api/index_patterns/index_pattern').send({ + override: true, + index_pattern: { + title, + runtimeFieldMap: { + runtimeFoo: { + type: 'keyword', + script: { + source: "doc['field_name'].value", + }, + }, + runtimeBar: { + type: 'keyword', + script: { + source: "doc['field_name'].value", + }, + }, + }, + }, + }); + + const response2 = await supertest + .post( + `/api/index_patterns/index_pattern/${response1.body.index_pattern.id}/runtime_field/runtimeFoo` + ) + .send({ + runtimeField: { + script: { + source: "doc['something_new'].value", + }, + }, + }); + + expect(response2.status).to.be(200); + + const response3 = await supertest.get( + '/api/index_patterns/index_pattern/' + + response1.body.index_pattern.id + + '/runtime_field/runtimeFoo' + ); + + expect(response3.status).to.be(200); + expect(response3.body.field.type).to.be('string'); + expect(response3.body.field.runtimeField.type).to.be('keyword'); + expect(response3.body.field.runtimeField.script.source).to.be("doc['something_new'].value"); + }); + }); +} diff --git a/test/api_integration/apis/index_patterns/scripted_fields_crud/create_scripted_field/main.ts b/test/api_integration/apis/index_patterns/scripted_fields_crud/create_scripted_field/main.ts index a5ed61d8ab9af1..663deae1d34769 100644 --- a/test/api_integration/apis/index_patterns/scripted_fields_crud/create_scripted_field/main.ts +++ b/test/api_integration/apis/index_patterns/scripted_fields_crud/create_scripted_field/main.ts @@ -15,11 +15,13 @@ export default function ({ getService }: FtrProviderContext) { describe('main', () => { before(async () => { - await esArchiver.load('index_patterns/basic_index'); + await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index'); }); after(async () => { - await esArchiver.unload('index_patterns/basic_index'); + await esArchiver.unload( + 'test/api_integration/fixtures/es_archiver/index_patterns/basic_index' + ); }); it('can create a new scripted field', async () => { @@ -52,6 +54,7 @@ export default function ({ getService }: FtrProviderContext) { it('newly created scripted field is materialized in the index_pattern object', async () => { const title = `basic_index`; const response1 = await supertest.post('/api/index_patterns/index_pattern').send({ + override: true, index_pattern: { title, }, diff --git a/test/api_integration/apis/index_patterns/scripted_fields_crud/delete_scripted_field/errors.ts b/test/api_integration/apis/index_patterns/scripted_fields_crud/delete_scripted_field/errors.ts index f0787500d505c4..2b35f1ec50e918 100644 --- a/test/api_integration/apis/index_patterns/scripted_fields_crud/delete_scripted_field/errors.ts +++ b/test/api_integration/apis/index_patterns/scripted_fields_crud/delete_scripted_field/errors.ts @@ -18,7 +18,7 @@ export default function ({ getService }: FtrProviderContext) { let indexPattern: any; before(async () => { - await esArchiver.load('index_patterns/basic_index'); + await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index'); indexPattern = ( await supertest.post('/api/index_patterns/index_pattern').send({ @@ -30,7 +30,9 @@ export default function ({ getService }: FtrProviderContext) { }); after(async () => { - await esArchiver.unload('index_patterns/basic_index'); + await esArchiver.unload( + 'test/api_integration/fixtures/es_archiver/index_patterns/basic_index' + ); if (indexPattern) { await supertest.delete('/api/index_patterns/index_pattern/' + indexPattern.id); diff --git a/test/api_integration/apis/index_patterns/scripted_fields_crud/delete_scripted_field/main.ts b/test/api_integration/apis/index_patterns/scripted_fields_crud/delete_scripted_field/main.ts index 40f57cd914a2f4..b9ce3e84d53904 100644 --- a/test/api_integration/apis/index_patterns/scripted_fields_crud/delete_scripted_field/main.ts +++ b/test/api_integration/apis/index_patterns/scripted_fields_crud/delete_scripted_field/main.ts @@ -15,16 +15,19 @@ export default function ({ getService }: FtrProviderContext) { describe('main', () => { before(async () => { - await esArchiver.load('index_patterns/basic_index'); + await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index'); }); after(async () => { - await esArchiver.unload('index_patterns/basic_index'); + await esArchiver.unload( + 'test/api_integration/fixtures/es_archiver/index_patterns/basic_index' + ); }); it('can remove a scripted field', async () => { const title = `basic_index`; const response1 = await supertest.post('/api/index_patterns/index_pattern').send({ + override: true, index_pattern: { title, fields: { diff --git a/test/api_integration/apis/index_patterns/scripted_fields_crud/get_scripted_field/errors.ts b/test/api_integration/apis/index_patterns/scripted_fields_crud/get_scripted_field/errors.ts index ef2fbc5258d668..be9d213a328453 100644 --- a/test/api_integration/apis/index_patterns/scripted_fields_crud/get_scripted_field/errors.ts +++ b/test/api_integration/apis/index_patterns/scripted_fields_crud/get_scripted_field/errors.ts @@ -18,7 +18,7 @@ export default function ({ getService }: FtrProviderContext) { let indexPattern: any; before(async () => { - await esArchiver.load('index_patterns/basic_index'); + await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index'); indexPattern = ( await supertest.post('/api/index_patterns/index_pattern').send({ @@ -30,7 +30,9 @@ export default function ({ getService }: FtrProviderContext) { }); after(async () => { - await esArchiver.unload('index_patterns/basic_index'); + await esArchiver.unload( + 'test/api_integration/fixtures/es_archiver/index_patterns/basic_index' + ); if (indexPattern) { await supertest.delete('/api/index_patterns/index_pattern/' + indexPattern.id); diff --git a/test/api_integration/apis/index_patterns/scripted_fields_crud/get_scripted_field/main.ts b/test/api_integration/apis/index_patterns/scripted_fields_crud/get_scripted_field/main.ts index 7fff720e5195f3..c38c3a01708a74 100644 --- a/test/api_integration/apis/index_patterns/scripted_fields_crud/get_scripted_field/main.ts +++ b/test/api_integration/apis/index_patterns/scripted_fields_crud/get_scripted_field/main.ts @@ -15,16 +15,19 @@ export default function ({ getService }: FtrProviderContext) { describe('main', () => { before(async () => { - await esArchiver.load('index_patterns/basic_index'); + await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index'); }); after(async () => { - await esArchiver.unload('index_patterns/basic_index'); + await esArchiver.unload( + 'test/api_integration/fixtures/es_archiver/index_patterns/basic_index' + ); }); it('can fetch a scripted field', async () => { const title = `basic_index`; const response1 = await supertest.post('/api/index_patterns/index_pattern').send({ + override: true, index_pattern: { title, fields: { diff --git a/test/api_integration/apis/index_patterns/scripted_fields_crud/put_scripted_field/main.ts b/test/api_integration/apis/index_patterns/scripted_fields_crud/put_scripted_field/main.ts index dec20961b0de09..16b19583068187 100644 --- a/test/api_integration/apis/index_patterns/scripted_fields_crud/put_scripted_field/main.ts +++ b/test/api_integration/apis/index_patterns/scripted_fields_crud/put_scripted_field/main.ts @@ -15,16 +15,19 @@ export default function ({ getService }: FtrProviderContext) { describe('main', () => { before(async () => { - await esArchiver.load('index_patterns/basic_index'); + await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index'); }); after(async () => { - await esArchiver.unload('index_patterns/basic_index'); + await esArchiver.unload( + 'test/api_integration/fixtures/es_archiver/index_patterns/basic_index' + ); }); it('can overwrite an existing field', async () => { const title = `basic_index`; const response1 = await supertest.post('/api/index_patterns/index_pattern').send({ + override: true, index_pattern: { title, fields: { diff --git a/test/api_integration/apis/index_patterns/scripted_fields_crud/update_scripted_field/main.ts b/test/api_integration/apis/index_patterns/scripted_fields_crud/update_scripted_field/main.ts index ac6b11522124ba..4ffc98e0660bca 100644 --- a/test/api_integration/apis/index_patterns/scripted_fields_crud/update_scripted_field/main.ts +++ b/test/api_integration/apis/index_patterns/scripted_fields_crud/update_scripted_field/main.ts @@ -15,16 +15,19 @@ export default function ({ getService }: FtrProviderContext) { describe('main', () => { before(async () => { - await esArchiver.load('index_patterns/basic_index'); + await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index'); }); after(async () => { - await esArchiver.unload('index_patterns/basic_index'); + await esArchiver.unload( + 'test/api_integration/fixtures/es_archiver/index_patterns/basic_index' + ); }); it('can update an existing field', async () => { const title = `basic_index`; const response1 = await supertest.post('/api/index_patterns/index_pattern').send({ + override: true, index_pattern: { title, fields: { diff --git a/test/api_integration/apis/kql_telemetry/kql_telemetry.ts b/test/api_integration/apis/kql_telemetry/kql_telemetry.ts index 09e36b9078792a..5770ed0866a900 100644 --- a/test/api_integration/apis/kql_telemetry/kql_telemetry.ts +++ b/test/api_integration/apis/kql_telemetry/kql_telemetry.ts @@ -17,8 +17,16 @@ export default function ({ getService }: FtrProviderContext) { const es = getService('es'); describe('telemetry API', () => { - before(() => kibanaServer.importExport.load('saved_objects/basic')); - after(() => kibanaServer.importExport.unload('saved_objects/basic')); + before(async () => { + await kibanaServer.importExport.load( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); + }); + after(async () => { + await kibanaServer.importExport.unload( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); + }); it('should increment the opt *in* counter in the .kibana/kql-telemetry document', async () => { await supertest diff --git a/test/api_integration/apis/saved_objects/bulk_create.ts b/test/api_integration/apis/saved_objects/bulk_create.ts index 1f76567e973b22..5867b8125303a5 100644 --- a/test/api_integration/apis/saved_objects/bulk_create.ts +++ b/test/api_integration/apis/saved_objects/bulk_create.ts @@ -39,7 +39,10 @@ export default function ({ getService }: FtrProviderContext) { before(async () => { KIBANA_VERSION = await getKibanaVersion(getService); await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_ID }); - await kibanaServer.importExport.load('saved_objects/basic', { space: SPACE_ID }); + await kibanaServer.importExport.load( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json', + { space: SPACE_ID } + ); }); after(() => kibanaServer.spaces.delete(SPACE_ID)); diff --git a/test/api_integration/apis/saved_objects/bulk_get.ts b/test/api_integration/apis/saved_objects/bulk_get.ts index 81e86913aaf86f..e349482960678b 100644 --- a/test/api_integration/apis/saved_objects/bulk_get.ts +++ b/test/api_integration/apis/saved_objects/bulk_get.ts @@ -34,10 +34,16 @@ export default function ({ getService }: FtrProviderContext) { before(async () => { KIBANA_VERSION = await getKibanaVersion(getService); - await kibanaServer.importExport.load('saved_objects/basic'); + await kibanaServer.importExport.load( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); }); - after(() => kibanaServer.importExport.unload('saved_objects/basic')); + after(async () => { + await kibanaServer.importExport.unload( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); + }); it('should return 200 with individual responses', async () => await supertest diff --git a/test/api_integration/apis/saved_objects/bulk_update.ts b/test/api_integration/apis/saved_objects/bulk_update.ts index 8740652fc39538..cf402bf2f62217 100644 --- a/test/api_integration/apis/saved_objects/bulk_update.ts +++ b/test/api_integration/apis/saved_objects/bulk_update.ts @@ -15,8 +15,16 @@ export default function ({ getService }: FtrProviderContext) { const kibanaServer = getService('kibanaServer'); describe('bulkUpdate', () => { - before(() => kibanaServer.importExport.load('saved_objects/basic')); - after(() => kibanaServer.importExport.unload('saved_objects/basic')); + before(async () => { + await kibanaServer.importExport.load( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); + }); + after(async () => { + await kibanaServer.importExport.unload( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); + }); it('should return 200', async () => { const response = await supertest diff --git a/test/api_integration/apis/saved_objects/create.ts b/test/api_integration/apis/saved_objects/create.ts index dfa7ceb503dfd4..00018e47c9dd36 100644 --- a/test/api_integration/apis/saved_objects/create.ts +++ b/test/api_integration/apis/saved_objects/create.ts @@ -19,10 +19,16 @@ export default function ({ getService }: FtrProviderContext) { before(async () => { KIBANA_VERSION = await getKibanaVersion(getService); - await kibanaServer.importExport.load('saved_objects/basic'); + await kibanaServer.importExport.load( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); }); - after(() => kibanaServer.importExport.unload('saved_objects/basic')); + after(async () => { + await kibanaServer.importExport.unload( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); + }); it('should return 200', async () => { await supertest diff --git a/test/api_integration/apis/saved_objects/delete.ts b/test/api_integration/apis/saved_objects/delete.ts index 9a4525df1b5f75..fc38050deabffe 100644 --- a/test/api_integration/apis/saved_objects/delete.ts +++ b/test/api_integration/apis/saved_objects/delete.ts @@ -14,8 +14,16 @@ export default function ({ getService }: FtrProviderContext) { const kibanaServer = getService('kibanaServer'); describe('delete', () => { - before(() => kibanaServer.importExport.load('saved_objects/basic')); - after(() => kibanaServer.importExport.unload('saved_objects/basic')); + before(async () => { + await kibanaServer.importExport.load( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); + }); + after(async () => { + await kibanaServer.importExport.unload( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); + }); it('should return 200 when deleting a doc', async () => await supertest diff --git a/test/api_integration/apis/saved_objects/export.ts b/test/api_integration/apis/saved_objects/export.ts index c42afd4e773c53..6314fbbe675d0e 100644 --- a/test/api_integration/apis/saved_objects/export.ts +++ b/test/api_integration/apis/saved_objects/export.ts @@ -24,7 +24,10 @@ export default function ({ getService }: FtrProviderContext) { before(async () => { KIBANA_VERSION = await getKibanaVersion(getService); await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_ID }); - await kibanaServer.importExport.load('saved_objects/basic', { space: SPACE_ID }); + await kibanaServer.importExport.load( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json', + { space: SPACE_ID } + ); }); after(() => kibanaServer.spaces.delete(SPACE_ID)); diff --git a/test/api_integration/apis/saved_objects/find.ts b/test/api_integration/apis/saved_objects/find.ts index 02fa2d325f1713..a38043c7c93524 100644 --- a/test/api_integration/apis/saved_objects/find.ts +++ b/test/api_integration/apis/saved_objects/find.ts @@ -18,12 +18,18 @@ export default function ({ getService }: FtrProviderContext) { describe('find', () => { before(async () => { await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_ID }); - await kibanaServer.importExport.load('saved_objects/basic', { space: SPACE_ID }); + await kibanaServer.importExport.load( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json', + { space: SPACE_ID } + ); await kibanaServer.spaces.create({ id: `${SPACE_ID}-foo`, name: `${SPACE_ID}-foo` }); - await kibanaServer.importExport.load('saved_objects/basic/foo-ns', { - space: `${SPACE_ID}-foo`, - }); + await kibanaServer.importExport.load( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic/foo-ns.json', + { + space: `${SPACE_ID}-foo`, + } + ); }); after(async () => { @@ -255,10 +261,18 @@ export default function ({ getService }: FtrProviderContext) { }); describe('`has_reference` and `has_reference_operator` parameters', () => { - before(() => kibanaServer.importExport.load('saved_objects/references', { space: SPACE_ID })); - after(() => - kibanaServer.importExport.unload('saved_objects/references', { space: SPACE_ID }) - ); + before(async () => { + await kibanaServer.importExport.load( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/references.json', + { space: SPACE_ID } + ); + }); + after(async () => { + await kibanaServer.importExport.unload( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/references.json', + { space: SPACE_ID } + ); + }); it('search for a reference', async () => { await supertest @@ -319,12 +333,18 @@ export default function ({ getService }: FtrProviderContext) { }); describe('searching for special characters', () => { - before(() => - kibanaServer.importExport.load('saved_objects/find_edgecases', { space: SPACE_ID }) - ); - after(() => - kibanaServer.importExport.unload('saved_objects/find_edgecases', { space: SPACE_ID }) - ); + before(async () => { + await kibanaServer.importExport.load( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/find_edgecases.json', + { space: SPACE_ID } + ); + }); + after(async () => { + await kibanaServer.importExport.unload( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/find_edgecases.json', + { space: SPACE_ID } + ); + }); it('can search for objects with dashes', async () => await supertest diff --git a/test/api_integration/apis/saved_objects/get.ts b/test/api_integration/apis/saved_objects/get.ts index 77d7b4faacb414..8122308e449303 100644 --- a/test/api_integration/apis/saved_objects/get.ts +++ b/test/api_integration/apis/saved_objects/get.ts @@ -19,9 +19,15 @@ export default function ({ getService }: FtrProviderContext) { before(async () => { KIBANA_VERSION = await getKibanaVersion(getService); - await kibanaServer.importExport.load('saved_objects/basic'); + await kibanaServer.importExport.load( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); + }); + after(async () => { + await kibanaServer.importExport.unload( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); }); - after(() => kibanaServer.importExport.unload('saved_objects/basic')); it('should return 200', async () => await supertest diff --git a/test/api_integration/apis/saved_objects/import.ts b/test/api_integration/apis/saved_objects/import.ts index 8d3c0b7bbcea3f..c899f082ec4d3f 100644 --- a/test/api_integration/apis/saved_objects/import.ts +++ b/test/api_integration/apis/saved_objects/import.ts @@ -43,8 +43,16 @@ export default function ({ getService }: FtrProviderContext) { }; describe('with basic data existing', () => { - before(() => kibanaServer.importExport.load('saved_objects/basic')); - after(() => kibanaServer.importExport.unload('saved_objects/basic')); + before(async () => { + await kibanaServer.importExport.load( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); + }); + after(async () => { + await kibanaServer.importExport.unload( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); + }); it('should return 415 when no file passed in', async () => { await supertest diff --git a/test/api_integration/apis/saved_objects/migrations.ts b/test/api_integration/apis/saved_objects/migrations.ts index d009a66e9df55f..0877998ca6c1f3 100644 --- a/test/api_integration/apis/saved_objects/migrations.ts +++ b/test/api_integration/apis/saved_objects/migrations.ts @@ -87,7 +87,7 @@ export default ({ getService }: FtrProviderContext) => { const mappingProperties = { foo: { properties: { name: { type: 'text' } } }, bar: { properties: { mynum: { type: 'integer' } } }, - }; + } as const; const savedObjectTypes: SavedObjectsType[] = [ { @@ -221,7 +221,7 @@ export default ({ getService }: FtrProviderContext) => { const mappingProperties = { foo: { properties: { name: { type: 'text' } } }, bar: { properties: { mynum: { type: 'integer' } } }, - }; + } as const; let savedObjectTypes: SavedObjectsType[] = [ { @@ -357,7 +357,7 @@ export default ({ getService }: FtrProviderContext) => { const mappingProperties = { 'fleet-agent-event': { properties: { name: { type: 'text' } } }, bar: { properties: { mynum: { type: 'integer' } } }, - }; + } as const; let savedObjectTypes: SavedObjectsType[] = [ FLEET_AGENT_EVENT_TYPE, @@ -417,7 +417,7 @@ export default ({ getService }: FtrProviderContext) => { const mappingProperties = { foo: { properties: { name: { type: 'text' } } }, - }; + } as const; const savedObjectTypes: SavedObjectsType[] = [ { @@ -510,7 +510,7 @@ export default ({ getService }: FtrProviderContext) => { foo: { properties: { name: { type: 'text' } } }, bar: { properties: { nomnom: { type: 'integer' } } }, baz: { properties: { title: { type: 'keyword' } } }, - }; + } as const; const savedObjectTypes: SavedObjectsType[] = [ { @@ -677,7 +677,7 @@ async function createIndex({ coreMigrationVersion: { type: 'keyword', }, - }; + } as const; await esClient.indices.create({ index, body: { mappings: { dynamic: 'strict', properties } }, diff --git a/test/api_integration/apis/saved_objects/resolve.ts b/test/api_integration/apis/saved_objects/resolve.ts index fcfef0aeb6b582..a00a44f98223d0 100644 --- a/test/api_integration/apis/saved_objects/resolve.ts +++ b/test/api_integration/apis/saved_objects/resolve.ts @@ -22,8 +22,16 @@ export default function ({ getService }: FtrProviderContext) { }); describe('with kibana index', () => { - before(() => kibanaServer.importExport.load('saved_objects/basic')); - after(() => kibanaServer.importExport.unload('saved_objects/basic')); + before(async () => { + await kibanaServer.importExport.load( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); + }); + after(async () => { + await kibanaServer.importExport.unload( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); + }); it('should return 200', async () => await supertest diff --git a/test/api_integration/apis/saved_objects/resolve_import_errors.ts b/test/api_integration/apis/saved_objects/resolve_import_errors.ts index 43ff01d321f9fa..7ca61a26a11c1e 100644 --- a/test/api_integration/apis/saved_objects/resolve_import_errors.ts +++ b/test/api_integration/apis/saved_objects/resolve_import_errors.ts @@ -36,7 +36,10 @@ export default function ({ getService }: FtrProviderContext) { describe('with basic data existing', () => { before(async () => { await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_ID }); - await kibanaServer.importExport.load('saved_objects/basic', { space: SPACE_ID }); + await kibanaServer.importExport.load( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json', + { space: SPACE_ID } + ); }); after(() => kibanaServer.spaces.delete(SPACE_ID)); diff --git a/test/api_integration/apis/saved_objects/update.ts b/test/api_integration/apis/saved_objects/update.ts index 75b8651ee64a7c..1c73d0788e51ca 100644 --- a/test/api_integration/apis/saved_objects/update.ts +++ b/test/api_integration/apis/saved_objects/update.ts @@ -14,8 +14,16 @@ export default function ({ getService }: FtrProviderContext) { const kibanaServer = getService('kibanaServer'); describe('update', () => { - before(() => kibanaServer.importExport.load('saved_objects/basic')); - after(() => kibanaServer.importExport.unload('saved_objects/basic')); + before(async () => { + await kibanaServer.importExport.load( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); + }); + after(async () => { + await kibanaServer.importExport.unload( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); + }); it('should return 200', async () => { await supertest .put(`/api/saved_objects/visualization/dd7caf20-9efd-11e7-acb3-3dab96693fab`) diff --git a/test/api_integration/apis/saved_objects_management/find.ts b/test/api_integration/apis/saved_objects_management/find.ts index df39e9b5c2a369..6e36303cc1fe07 100644 --- a/test/api_integration/apis/saved_objects_management/find.ts +++ b/test/api_integration/apis/saved_objects_management/find.ts @@ -25,8 +25,16 @@ export default function ({ getService }: FtrProviderContext) { }); describe('with kibana index', () => { - before(() => kibanaServer.importExport.load('saved_objects/basic')); - after(() => kibanaServer.importExport.unload('saved_objects/basic')); + before(async () => { + await kibanaServer.importExport.load( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); + }); + after(async () => { + await kibanaServer.importExport.unload( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); + }); it('should return 200 with individual responses', async () => await supertest @@ -85,8 +93,16 @@ export default function ({ getService }: FtrProviderContext) { }); describe('`hasReference` and `hasReferenceOperator` parameters', () => { - before(() => kibanaServer.importExport.load('saved_objects/references')); - after(() => kibanaServer.importExport.unload('saved_objects/references')); + before(async () => { + await kibanaServer.importExport.load( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/references.json' + ); + }); + after(async () => { + await kibanaServer.importExport.unload( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/references.json' + ); + }); it('search for a reference', async () => { await supertest @@ -145,8 +161,14 @@ export default function ({ getService }: FtrProviderContext) { }); describe('meta attributes injected properly', () => { - before(() => esArchiver.load('management/saved_objects/search')); - after(() => esArchiver.unload('management/saved_objects/search')); + before(() => + esArchiver.load('test/api_integration/fixtures/es_archiver/management/saved_objects/search') + ); + after(() => + esArchiver.unload( + 'test/api_integration/fixtures/es_archiver/management/saved_objects/search' + ) + ); it('should inject meta attributes for searches', async () => await supertest diff --git a/test/api_integration/apis/saved_objects_management/get.ts b/test/api_integration/apis/saved_objects_management/get.ts index eb0b832cb2ed14..3b49a28ca40223 100644 --- a/test/api_integration/apis/saved_objects_management/get.ts +++ b/test/api_integration/apis/saved_objects_management/get.ts @@ -18,8 +18,16 @@ export default function ({ getService }: FtrProviderContext) { const existingObject = 'visualization/dd7caf20-9efd-11e7-acb3-3dab96693fab'; const nonexistentObject = 'wigwags/foo'; - before(() => kibanaServer.importExport.load('saved_objects/basic')); - after(() => kibanaServer.importExport.unload('saved_objects/basic')); + before(async () => { + await kibanaServer.importExport.load( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); + }); + after(async () => { + await kibanaServer.importExport.unload( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); + }); it('should return 200 for object that exists and inject metadata', async () => await supertest diff --git a/test/api_integration/apis/saved_objects_management/relationships.ts b/test/api_integration/apis/saved_objects_management/relationships.ts index ffc97b13859571..aa488942edbeb7 100644 --- a/test/api_integration/apis/saved_objects_management/relationships.ts +++ b/test/api_integration/apis/saved_objects_management/relationships.ts @@ -43,8 +43,16 @@ export default function ({ getService }: FtrProviderContext) { }); describe('relationships', () => { - before(() => kibanaServer.importExport.load('management/saved_objects/relationships')); - after(() => kibanaServer.importExport.unload('management/saved_objects/relationships')); + before(async () => { + await kibanaServer.importExport.load( + 'test/api_integration/fixtures/kbn_archiver/management/saved_objects/relationships.json' + ); + }); + after(async () => { + await kibanaServer.importExport.unload( + 'test/api_integration/fixtures/kbn_archiver/management/saved_objects/relationships.json' + ); + }); const baseApiUrl = `/api/kibana/management/saved_objects/relationships`; const defaultTypes = ['visualization', 'index-pattern', 'search', 'dashboard']; diff --git a/test/api_integration/apis/saved_objects_management/scroll_count.ts b/test/api_integration/apis/saved_objects_management/scroll_count.ts index 78fd316eb4ecb6..088b26d8205da4 100644 --- a/test/api_integration/apis/saved_objects_management/scroll_count.ts +++ b/test/api_integration/apis/saved_objects_management/scroll_count.ts @@ -19,10 +19,14 @@ export default function ({ getService }: FtrProviderContext) { describe('scroll_count', () => { before(async () => { - await esArchiver.load('management/saved_objects/scroll_count'); + await esArchiver.load( + 'test/api_integration/fixtures/es_archiver/management/saved_objects/scroll_count' + ); }); after(async () => { - await esArchiver.unload('management/saved_objects/scroll_count'); + await esArchiver.unload( + 'test/api_integration/fixtures/es_archiver/management/saved_objects/scroll_count' + ); }); it('returns the count for each included types', async () => { diff --git a/test/api_integration/apis/search/bsearch.ts b/test/api_integration/apis/search/bsearch.ts index 11fb74200d7ddf..f80bc1d0d9dfa4 100644 --- a/test/api_integration/apis/search/bsearch.ts +++ b/test/api_integration/apis/search/bsearch.ts @@ -193,13 +193,11 @@ export default function ({ getService }: FtrProviderContext) { describe('painless', () => { before(async () => { - await esArchiver.loadIfNeeded( - '../../../functional/fixtures/es_archiver/logstash_functional' - ); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); }); after(async () => { - await esArchiver.unload('../../../functional/fixtures/es_archiver/logstash_functional'); + await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional'); }); it('should return 400 "search_phase_execution_exception" for Painless error in "es" strategy', async () => { const resp = await supertest.post(`/internal/bsearch`).send({ diff --git a/test/api_integration/apis/search/search.ts b/test/api_integration/apis/search/search.ts index 7ef82cd5467ab5..96e7f6ab7161b1 100644 --- a/test/api_integration/apis/search/search.ts +++ b/test/api_integration/apis/search/search.ts @@ -18,11 +18,11 @@ export default function ({ getService }: FtrProviderContext) { describe('search', () => { before(async () => { await esArchiver.emptyKibanaIndex(); - await esArchiver.loadIfNeeded('../../../functional/fixtures/es_archiver/logstash_functional'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); }); after(async () => { - await esArchiver.unload('../../../functional/fixtures/es_archiver/logstash_functional'); + await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional'); }); describe('post', () => { it('should return 200 when correctly formatted searches are provided', async () => { diff --git a/test/api_integration/apis/search/verify_error.ts b/test/api_integration/apis/search/verify_error.ts index d6b729f59d8d4e..1973fe4e4ab361 100644 --- a/test/api_integration/apis/search/verify_error.ts +++ b/test/api_integration/apis/search/verify_error.ts @@ -16,7 +16,7 @@ export const verifyErrorResponse = ( ) => { expect(r.statusCode).to.be(expectedCode); if (message) { - expect(r.message).to.be(message); + expect(r.message).to.include.string(message); } if (shouldHaveAttrs) { expect(r).to.have.property('attributes'); diff --git a/test/api_integration/apis/shorten/index.js b/test/api_integration/apis/shorten/index.js index 9af979b6af95d7..86c39426205ad3 100644 --- a/test/api_integration/apis/shorten/index.js +++ b/test/api_integration/apis/shorten/index.js @@ -13,8 +13,16 @@ export default function ({ getService }) { const kibanaServer = getService('kibanaServer'); describe('url shortener', () => { - before(() => kibanaServer.importExport.load('saved_objects/basic')); - after(() => kibanaServer.importExport.unload('saved_objects/basic')); + before(async () => { + await kibanaServer.importExport.load( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); + }); + after(async () => { + await kibanaServer.importExport.unload( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); + }); it('generates shortened urls', async () => { const resp = await supertest diff --git a/test/api_integration/apis/stats/stats.js b/test/api_integration/apis/stats/stats.js index 2ba14e29a3d1a8..61936a73da38da 100644 --- a/test/api_integration/apis/stats/stats.js +++ b/test/api_integration/apis/stats/stats.js @@ -47,8 +47,16 @@ export default function ({ getService }) { const kibanaServer = getService('kibanaServer'); describe('kibana stats api', () => { - before(() => kibanaServer.importExport.load('saved_objects/basic')); - after(() => kibanaServer.importExport.unload('saved_objects/basic')); + before(async () => { + await kibanaServer.importExport.load( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); + }); + after(async () => { + await kibanaServer.importExport.unload( + 'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json' + ); + }); describe('basic', () => { it('should return the stats without cluster_uuid with no query string params', () => { diff --git a/test/api_integration/apis/suggestions/suggestions.js b/test/api_integration/apis/suggestions/suggestions.js index b3c8ae238450ca..292e3f599d81a1 100644 --- a/test/api_integration/apis/suggestions/suggestions.js +++ b/test/api_integration/apis/suggestions/suggestions.js @@ -13,12 +13,18 @@ export default function ({ getService }) { describe('Suggestions API', function () { before(async () => { - await esArchiver.load('index_patterns/basic_index'); - await kibanaServer.importExport.load('index_patterns/basic_kibana'); + await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index'); + await kibanaServer.importExport.load( + 'test/api_integration/fixtures/kbn_archiver/index_patterns/basic_kibana.json' + ); }); after(async () => { - await esArchiver.unload('index_patterns/basic_index'); - await kibanaServer.importExport.unload('index_patterns/basic_kibana'); + await esArchiver.unload( + 'test/api_integration/fixtures/es_archiver/index_patterns/basic_index' + ); + await kibanaServer.importExport.unload( + 'test/api_integration/fixtures/kbn_archiver/index_patterns/basic_kibana.json' + ); }); it('should return 200 with special characters', () => diff --git a/test/api_integration/fixtures/es_archiver/management/saved_objects/scroll_count/mappings.json b/test/api_integration/fixtures/es_archiver/management/saved_objects/scroll_count/mappings.json index 8270c573e4c1e7..d2177481130a2c 100644 --- a/test/api_integration/fixtures/es_archiver/management/saved_objects/scroll_count/mappings.json +++ b/test/api_integration/fixtures/es_archiver/management/saved_objects/scroll_count/mappings.json @@ -1,7 +1,10 @@ { "type": "index", "value": { - "index": ".kibana", + "aliases": { + ".kibana": {} + }, + "index": ".kibana_1", "settings": { "index": { "number_of_shards": "1", diff --git a/test/api_integration/fixtures/es_archiver/management/saved_objects/search/mappings.json b/test/api_integration/fixtures/es_archiver/management/saved_objects/search/mappings.json index c670508247b1a2..7a6d752eafb08e 100644 --- a/test/api_integration/fixtures/es_archiver/management/saved_objects/search/mappings.json +++ b/test/api_integration/fixtures/es_archiver/management/saved_objects/search/mappings.json @@ -1,7 +1,10 @@ { "type": "index", "value": { - "index": ".kibana", + "aliases": { + ".kibana": {} + }, + "index": ".kibana_1", "settings": { "index": { "number_of_shards": "1", diff --git a/test/api_integration/fixtures/es_archiver/saved_objects/ui_counters/mappings.json b/test/api_integration/fixtures/es_archiver/saved_objects/ui_counters/mappings.json index 39902f8a9211a6..99f2f999db9881 100644 --- a/test/api_integration/fixtures/es_archiver/saved_objects/ui_counters/mappings.json +++ b/test/api_integration/fixtures/es_archiver/saved_objects/ui_counters/mappings.json @@ -1,7 +1,10 @@ { "type": "index", "value": { - "index": ".kibana", + "aliases": { + ".kibana": {} + }, + "index": ".kibana_1", "settings": { "index": { "number_of_shards": "1", diff --git a/test/api_integration/fixtures/es_archiver/saved_objects/usage_counters/mappings.json b/test/api_integration/fixtures/es_archiver/saved_objects/usage_counters/mappings.json index 14ed147b2da8e7..c2ec5c88810876 100644 --- a/test/api_integration/fixtures/es_archiver/saved_objects/usage_counters/mappings.json +++ b/test/api_integration/fixtures/es_archiver/saved_objects/usage_counters/mappings.json @@ -1,7 +1,10 @@ { "type": "index", "value": { - "index": ".kibana", + "aliases": { + ".kibana": {} + }, + "index": ".kibana_1", "settings": { "index": { "number_of_shards": "1", diff --git a/test/api_integration/fixtures/es_archiver/search/count/mappings.json b/test/api_integration/fixtures/es_archiver/search/count/mappings.json index b62c5da05c2e6b..41d5c07e932394 100644 --- a/test/api_integration/fixtures/es_archiver/search/count/mappings.json +++ b/test/api_integration/fixtures/es_archiver/search/count/mappings.json @@ -1,7 +1,10 @@ { "type": "index", "value": { - "index": ".kibana", + "aliases": { + ".kibana": {} + }, + "index": ".kibana_1", "settings": { "index": { "number_of_shards": "1", diff --git a/test/common/services/es_archiver.ts b/test/common/services/es_archiver.ts index 742ba74c0dcafa..d99a2e8d102364 100644 --- a/test/common/services/es_archiver.ts +++ b/test/common/services/es_archiver.ts @@ -19,15 +19,8 @@ export function EsArchiverProvider({ getService }: FtrProviderContext): EsArchiv const kibanaServer = getService('kibanaServer'); const retry = getService('retry'); - if (!config.get('esArchiver')) { - throw new Error(`esArchiver can't be used unless you specify it's config in your config file`); - } - - const dataDir = config.get('esArchiver.directory'); - const esArchiver = new EsArchiver({ client, - dataDir, log, kbnClient: kibanaServer, }); diff --git a/test/common/services/kibana_server/extend_es_archiver.js b/test/common/services/kibana_server/extend_es_archiver.js deleted file mode 100644 index 9a06dd7b749699..00000000000000 --- a/test/common/services/kibana_server/extend_es_archiver.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -const ES_ARCHIVER_LOAD_METHODS = ['load', 'loadIfNeeded', 'unload', 'emptyKibanaIndex']; -const KIBANA_INDEX = '.kibana'; - -export function extendEsArchiver({ esArchiver, kibanaServer, retry, defaults }) { - // only extend the esArchiver if there are default uiSettings to restore - if (!defaults) { - return; - } - - ES_ARCHIVER_LOAD_METHODS.forEach((method) => { - const originalMethod = esArchiver[method]; - - esArchiver[method] = async (...args) => { - // esArchiver methods return a stats object, with information about the indexes created - const stats = await originalMethod.apply(esArchiver, args); - - const statsKeys = Object.keys(stats); - const kibanaKeys = statsKeys.filter( - // this also matches stats keys like '.kibana_1' and '.kibana_2,.kibana_1' - (key) => key.includes(KIBANA_INDEX) && stats[key].created - ); - - // if the kibana index was created by the esArchiver then update the uiSettings - // with the defaults to make sure that they are always in place initially - if (kibanaKeys.length > 0) { - await retry.try(async () => { - await kibanaServer.uiSettings.update(defaults); - }); - } - - return stats; - }; - }); -} diff --git a/test/common/services/kibana_server/extend_es_archiver.ts b/test/common/services/kibana_server/extend_es_archiver.ts new file mode 100644 index 00000000000000..98c28960bf5230 --- /dev/null +++ b/test/common/services/kibana_server/extend_es_archiver.ts @@ -0,0 +1,55 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { ProvidedType } from '@kbn/test'; + +import type { EsArchiverProvider } from '../es_archiver'; +import type { RetryService } from '../retry'; +import type { KibanaServerProvider } from './kibana_server'; + +const ES_ARCHIVER_LOAD_METHODS = ['load', 'loadIfNeeded', 'unload', 'emptyKibanaIndex'] as const; +const KIBANA_INDEX = '.kibana'; + +interface Options { + esArchiver: ProvidedType; + kibanaServer: ProvidedType; + retry: RetryService; + defaults: Record; +} + +export function extendEsArchiver({ esArchiver, kibanaServer, retry, defaults }: Options) { + // only extend the esArchiver if there are default uiSettings to restore + if (!defaults) { + return; + } + + ES_ARCHIVER_LOAD_METHODS.forEach((method) => { + const originalMethod = esArchiver[method]; + + esArchiver[method] = async (...args: unknown[]) => { + // esArchiver methods return a stats object, with information about the indexes created + const stats = await originalMethod.apply(esArchiver, args as any); + + const statsKeys = Object.keys(stats); + const kibanaKeys = statsKeys.filter( + // this also matches stats keys like '.kibana_1' and '.kibana_2,.kibana_1' + (key) => key.includes(KIBANA_INDEX) && stats[key].created + ); + + // if the kibana index was created by the esArchiver then update the uiSettings + // with the defaults to make sure that they are always in place initially + if (kibanaKeys.length > 0) { + await retry.try(async () => { + await kibanaServer.uiSettings.update(defaults); + }); + } + + return stats; + }; + }); +} diff --git a/test/common/services/kibana_server/index.ts b/test/common/services/kibana_server/index.ts index 7f727179032f2c..2a749de2b4ce86 100644 --- a/test/common/services/kibana_server/index.ts +++ b/test/common/services/kibana_server/index.ts @@ -7,5 +7,4 @@ */ export { KibanaServerProvider } from './kibana_server'; -// @ts-ignore export { extendEsArchiver } from './extend_es_archiver'; diff --git a/test/common/services/kibana_server/kibana_server.ts b/test/common/services/kibana_server/kibana_server.ts index 63803bd511bd14..f20fa4cafa55e2 100644 --- a/test/common/services/kibana_server/kibana_server.ts +++ b/test/common/services/kibana_server/kibana_server.ts @@ -22,7 +22,6 @@ export function KibanaServerProvider({ getService }: FtrProviderContext): KbnCli url, certificateAuthorities: config.get('servers.kibana.certificateAuthorities'), uiSettingDefaults: defaults, - importExportDir: config.get('kbnArchiver.directory'), }); if (defaults) { diff --git a/test/common/services/saved_object_info.ts b/test/common/services/saved_object_info.ts index 1558b364f53916..2be17636508942 100644 --- a/test/common/services/saved_object_info.ts +++ b/test/common/services/saved_object_info.ts @@ -8,7 +8,7 @@ import { inspect } from 'util'; -import { TermsAggregate } from '@elastic/elasticsearch/api/types'; +import type { estypes } from '@elastic/elasticsearch'; import { FtrService } from '../ftr_provider_context'; @@ -32,7 +32,7 @@ export class SavedObjectInfoService extends FtrService { }); const agg = body.aggregations?.savedobjs as - | TermsAggregate<{ key: string; doc_count: number }> + | estypes.AggregationsTermsAggregate<{ key: string; doc_count: number }> | undefined; if (!agg?.buckets) { diff --git a/test/examples/config.js b/test/examples/config.js index 1ee095fbdedeb0..d47748e5f22a97 100644 --- a/test/examples/config.js +++ b/test/examples/config.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import path, { resolve } from 'path'; +import { resolve } from 'path'; import { services } from '../plugin_functional/services'; import fs from 'fs'; import { KIBANA_ROOT } from '@kbn/test'; @@ -28,6 +28,7 @@ export default async function ({ readConfigFile }) { require.resolve('./state_sync'), require.resolve('./routing'), require.resolve('./expressions_explorer'), + require.resolve('./index_pattern_field_editor_example'), ], services: { ...functionalConfig.get('services'), @@ -47,9 +48,6 @@ export default async function ({ readConfigFile }) { serverArgs: ['xpack.security.enabled=false'], }, apps: functionalConfig.get('apps'), - esArchiver: { - directory: path.resolve(__dirname, '../es_archives'), - }, screenshots: functionalConfig.get('screenshots'), junit: { reportName: 'Example plugin functional tests', diff --git a/test/examples/embeddables/dashboard.ts b/test/examples/embeddables/dashboard.ts index 69788ebad2af2f..77ad5a5da9eeb9 100644 --- a/test/examples/embeddables/dashboard.ts +++ b/test/examples/embeddables/dashboard.ts @@ -102,8 +102,10 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide describe('dashboard container', () => { before(async () => { - await esArchiver.loadIfNeeded('../functional/fixtures/es_archiver/dashboard/current/data'); - await esArchiver.loadIfNeeded('../functional/fixtures/es_archiver/dashboard/current/kibana'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/dashboard/current/data'); + await esArchiver.loadIfNeeded( + 'test/functional/fixtures/es_archiver/dashboard/current/kibana' + ); await PageObjects.common.navigateToApp('dashboardEmbeddableExamples'); await testSubjects.click('dashboardEmbeddableByValue'); await updateInput(JSON.stringify(testDashboardInput, null, 4)); diff --git a/test/examples/index_pattern_field_editor_example/index.ts b/test/examples/index_pattern_field_editor_example/index.ts new file mode 100644 index 00000000000000..0cd23a33c84762 --- /dev/null +++ b/test/examples/index_pattern_field_editor_example/index.ts @@ -0,0 +1,38 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { PluginFunctionalProviderContext } from 'test/plugin_functional/services'; + +// eslint-disable-next-line import/no-default-export +export default function ({ + getService, + getPageObjects, + loadTestFile, +}: PluginFunctionalProviderContext) { + const browser = getService('browser'); + const es = getService('es'); + const PageObjects = getPageObjects(['common', 'header', 'settings']); + + describe('index pattern field editor example', function () { + this.tags('ciGroup2'); + before(async () => { + await browser.setWindowSize(1300, 900); + await es.transport.request({ + path: '/blogs/_doc', + method: 'POST', + body: { user: 'matt', message: 20 }, + }); + + await PageObjects.settings.navigateTo(); + await PageObjects.settings.createIndexPattern('blogs', null); + await PageObjects.common.navigateToApp('indexPatternFieldEditorExample'); + }); + + loadTestFile(require.resolve('./index_pattern_field_editor_example')); + }); +} diff --git a/test/examples/index_pattern_field_editor_example/index_pattern_field_editor_example.ts b/test/examples/index_pattern_field_editor_example/index_pattern_field_editor_example.ts new file mode 100644 index 00000000000000..5744c8e64f5c11 --- /dev/null +++ b/test/examples/index_pattern_field_editor_example/index_pattern_field_editor_example.ts @@ -0,0 +1,24 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { PluginFunctionalProviderContext } from 'test/plugin_functional/services'; + +// eslint-disable-next-line import/no-default-export +export default function ({ getService }: PluginFunctionalProviderContext) { + const testSubjects = getService('testSubjects'); + + describe('', () => { + it('finds an index pattern', async () => { + await testSubjects.existOrFail('indexPatternTitle'); + }); + it('opens the field editor', async () => { + await testSubjects.click('addField'); + await testSubjects.existOrFail('flyoutTitle'); + }); + }); +} diff --git a/test/functional/apps/context/_date_nanos.js b/test/functional/apps/context/_date_nanos.js index f5408661b9c6ef..35e38abc6fdb72 100644 --- a/test/functional/apps/context/_date_nanos.js +++ b/test/functional/apps/context/_date_nanos.js @@ -22,7 +22,7 @@ export default function ({ getService, getPageObjects }) { describe('context view for date_nanos', () => { before(async function () { await security.testUser.setRoles(['kibana_admin', 'kibana_date_nanos']); - await esArchiver.loadIfNeeded('date_nanos'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/date_nanos'); await kibanaServer.uiSettings.replace({ defaultIndex: TEST_INDEX_PATTERN }); await kibanaServer.uiSettings.update({ 'context:defaultSize': `${TEST_DEFAULT_CONTEXT_SIZE}`, @@ -32,7 +32,7 @@ export default function ({ getService, getPageObjects }) { after(async function unloadMakelogs() { await security.testUser.restoreDefaults(); - await esArchiver.unload('date_nanos'); + await esArchiver.unload('test/functional/fixtures/es_archiver/date_nanos'); }); it('displays predessors - anchor - successors in right order ', async function () { diff --git a/test/functional/apps/context/_date_nanos_custom_timestamp.js b/test/functional/apps/context/_date_nanos_custom_timestamp.js index b837c55d821ac1..a933c2f20b1633 100644 --- a/test/functional/apps/context/_date_nanos_custom_timestamp.js +++ b/test/functional/apps/context/_date_nanos_custom_timestamp.js @@ -22,7 +22,7 @@ export default function ({ getService, getPageObjects }) { describe('context view for date_nanos with custom timestamp', () => { before(async function () { await security.testUser.setRoles(['kibana_admin', 'kibana_date_nanos_custom']); - await esArchiver.loadIfNeeded('date_nanos_custom'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/date_nanos_custom'); await kibanaServer.uiSettings.replace({ defaultIndex: TEST_INDEX_PATTERN }); await kibanaServer.uiSettings.update({ 'context:defaultSize': `${TEST_DEFAULT_CONTEXT_SIZE}`, @@ -43,7 +43,7 @@ export default function ({ getService, getPageObjects }) { after(async function () { await security.testUser.restoreDefaults(); - await esArchiver.unload('date_nanos_custom'); + await esArchiver.unload('test/functional/fixtures/es_archiver/date_nanos_custom'); }); }); } diff --git a/test/functional/apps/context/index.js b/test/functional/apps/context/index.js index 245f88a337dce2..7612dae338d9f0 100644 --- a/test/functional/apps/context/index.js +++ b/test/functional/apps/context/index.js @@ -17,14 +17,14 @@ export default function ({ getService, getPageObjects, loadTestFile }) { before(async function () { await browser.setWindowSize(1200, 800); - await esArchiver.loadIfNeeded('logstash_functional'); - await esArchiver.load('visualize'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); + await esArchiver.load('test/functional/fixtures/es_archiver/visualize'); await kibanaServer.uiSettings.replace({ defaultIndex: 'logstash-*' }); await PageObjects.common.navigateToApp('discover'); }); after(function unloadMakelogs() { - return esArchiver.unload('logstash_functional'); + return esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional'); }); loadTestFile(require.resolve('./_context_navigation')); diff --git a/test/functional/apps/dashboard/copy_panel_to.ts b/test/functional/apps/dashboard/copy_panel_to.ts index 641d520801c4dc..8877e5e47bd95d 100644 --- a/test/functional/apps/dashboard/copy_panel_to.ts +++ b/test/functional/apps/dashboard/copy_panel_to.ts @@ -40,7 +40,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('dashboard panel copy to', function viewEditModeTests() { before(async function () { - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/create_and_add_embeddables.ts b/test/functional/apps/dashboard/create_and_add_embeddables.ts index 3de3b2f843f554..62ce68e026f72a 100644 --- a/test/functional/apps/dashboard/create_and_add_embeddables.ts +++ b/test/functional/apps/dashboard/create_and_add_embeddables.ts @@ -22,7 +22,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('create and add embeddables', () => { before(async () => { - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/dashboard_back_button.ts b/test/functional/apps/dashboard/dashboard_back_button.ts index 7e0bf92e3292aa..1e901cdbd48bee 100644 --- a/test/functional/apps/dashboard/dashboard_back_button.ts +++ b/test/functional/apps/dashboard/dashboard_back_button.ts @@ -17,7 +17,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('dashboard back button', () => { before(async () => { - await esArchiver.loadIfNeeded('dashboard/current/kibana'); + await esArchiver.loadIfNeeded( + 'test/functional/fixtures/es_archiver/dashboard/current/kibana' + ); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/dashboard_error_handling.ts b/test/functional/apps/dashboard/dashboard_error_handling.ts index 5d3d8bd251d63c..89c2d420299350 100644 --- a/test/functional/apps/dashboard/dashboard_error_handling.ts +++ b/test/functional/apps/dashboard/dashboard_error_handling.ts @@ -19,7 +19,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { */ describe('dashboard error handling', () => { before(async () => { - await esArchiver.loadIfNeeded('dashboard/current/kibana'); + await esArchiver.loadIfNeeded( + 'test/functional/fixtures/es_archiver/dashboard/current/kibana' + ); await PageObjects.common.navigateToApp('dashboard'); }); diff --git a/test/functional/apps/dashboard/dashboard_filter_bar.ts b/test/functional/apps/dashboard/dashboard_filter_bar.ts index c2d6cc4c38b6be..e1a15009afe514 100644 --- a/test/functional/apps/dashboard/dashboard_filter_bar.ts +++ b/test/functional/apps/dashboard/dashboard_filter_bar.ts @@ -31,7 +31,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('dashboard filter bar', () => { before(async () => { - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/dashboard_filtering.ts b/test/functional/apps/dashboard/dashboard_filtering.ts index 86c57efec818b5..acb04b4946fad2 100644 --- a/test/functional/apps/dashboard/dashboard_filtering.ts +++ b/test/functional/apps/dashboard/dashboard_filtering.ts @@ -54,7 +54,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }; before(async () => { - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader', 'animals']); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', diff --git a/test/functional/apps/dashboard/dashboard_grid.ts b/test/functional/apps/dashboard/dashboard_grid.ts index 809fb6fc140014..fecec34fd91e36 100644 --- a/test/functional/apps/dashboard/dashboard_grid.ts +++ b/test/functional/apps/dashboard/dashboard_grid.ts @@ -19,7 +19,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('dashboard grid', function () { before(async () => { - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/dashboard_options.ts b/test/functional/apps/dashboard/dashboard_options.ts index 1f62256a3fdb59..5702286bba6b68 100644 --- a/test/functional/apps/dashboard/dashboard_options.ts +++ b/test/functional/apps/dashboard/dashboard_options.ts @@ -20,7 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { let originalTitles: string[] = []; before(async () => { - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/dashboard_query_bar.ts b/test/functional/apps/dashboard/dashboard_query_bar.ts index bf8300defc445a..07fa3355c6fbac 100644 --- a/test/functional/apps/dashboard/dashboard_query_bar.ts +++ b/test/functional/apps/dashboard/dashboard_query_bar.ts @@ -20,7 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('dashboard query bar', () => { before(async () => { - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); @@ -30,7 +30,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('causes panels to reload when refresh is clicked', async () => { - await esArchiver.unload('dashboard/current/data'); + await esArchiver.unload('test/functional/fixtures/es_archiver/dashboard/current/data'); await queryBar.clickQuerySubmitButton(); await retry.tryForTime(5000, async () => { diff --git a/test/functional/apps/dashboard/dashboard_saved_query.ts b/test/functional/apps/dashboard/dashboard_saved_query.ts index bdf97e8ced1407..015a00a713bdcf 100644 --- a/test/functional/apps/dashboard/dashboard_saved_query.ts +++ b/test/functional/apps/dashboard/dashboard_saved_query.ts @@ -21,7 +21,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('dashboard saved queries', function describeIndexTests() { before(async function () { - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/dashboard_snapshots.ts b/test/functional/apps/dashboard/dashboard_snapshots.ts index c93636aeb63c67..3aba671c0a4b29 100644 --- a/test/functional/apps/dashboard/dashboard_snapshots.ts +++ b/test/functional/apps/dashboard/dashboard_snapshots.ts @@ -25,7 +25,7 @@ export default function ({ describe('dashboard snapshots', function describeIndexTests() { before(async function () { - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/dashboard_state.ts b/test/functional/apps/dashboard/dashboard_state.ts index 0f7722925293b1..047681e1a8ace7 100644 --- a/test/functional/apps/dashboard/dashboard_state.ts +++ b/test/functional/apps/dashboard/dashboard_state.ts @@ -34,6 +34,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const dashboardPanelActions = getService('dashboardPanelActions'); const dashboardAddPanel = getService('dashboardAddPanel'); + const enableNewChartLibraryDebug = async () => { + if (await PageObjects.visChart.isNewChartsLibraryEnabled()) { + await elasticChart.setNewChartUiDebugFlag(); + await queryBar.submitQuery(); + } + }; + describe('dashboard state', function describeIndexTests() { // Used to track flag before and after reset let isNewChartsLibraryEnabled = false; @@ -84,10 +91,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.loadSavedDashboard(dashboarName); - if (await PageObjects.visChart.isNewChartsLibraryEnabled()) { - await elasticChart.setNewChartUiDebugFlag(); - await queryBar.submitQuery(); - } + await enableNewChartLibraryDebug(); const colorChoiceRetained = await PageObjects.visChart.doesSelectedLegendColorExist( overwriteColor @@ -149,11 +153,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('Saved search will update when the query is changed in the URL', async () => { const currentQuery = await queryBar.getQueryString(); expect(currentQuery).to.equal(''); - const currentUrl = await browser.getCurrentUrl(); - const newUrl = currentUrl.replace('query:%27%27', 'query:%27abc12345678910%27'); - // Don't add the timestamp to the url or it will cause a hard refresh and we want to test a - // soft refresh. - await browser.get(newUrl.toString(), false); + const currentUrl = await getUrlFromShare(); + const newUrl = currentUrl.replace(`query:''`, `query:'abc12345678910'`); + + // We need to add a timestamp to the URL because URL changes now only work with a hard refresh. + await browser.get(newUrl.toString()); await PageObjects.header.waitUntilLoadingHasFinished(); const headers = await PageObjects.discover.getColumnHeaders(); @@ -200,20 +204,34 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { return sharedUrl; }; + const hardRefresh = async (newUrl: string) => { + // We need to add a timestamp to the URL because URL changes now only work with a hard refresh. + await browser.get(newUrl.toString()); + const alert = await browser.getAlert(); + await alert?.accept(); + await enableNewChartLibraryDebug(); + await PageObjects.dashboard.waitForRenderComplete(); + }; + describe('Directly modifying url updates dashboard state', () => { - it('for query parameter', async function () { + before(async () => { await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.clickNewDashboard(); + await PageObjects.timePicker.setHistoricalDataRange(); + }); + it('for query parameter', async function () { const currentQuery = await queryBar.getQueryString(); expect(currentQuery).to.equal(''); - const currentUrl = await browser.getCurrentUrl(); - const newUrl = currentUrl.replace('query:%27%27', 'query:%27hi%27'); - // Don't add the timestamp to the url or it will cause a hard refresh and we want to test a - // soft refresh. - await browser.get(newUrl.toString(), false); + const currentUrl = await getUrlFromShare(); + const newUrl = currentUrl.replace(`query:''`, `query:'hi:hello'`); + + // We need to add a timestamp to the URL because URL changes now only work with a hard refresh. + await browser.get(newUrl.toString()); const newQuery = await queryBar.getQueryString(); - expect(newQuery).to.equal('hi'); + expect(newQuery).to.equal('hi:hello'); + await queryBar.clearQuery(); + await queryBar.clickQuerySubmitButton(); }); it('for panel size parameters', async function () { @@ -224,7 +242,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { `w:${DEFAULT_PANEL_WIDTH}`, `w:${DEFAULT_PANEL_WIDTH * 2}` ); - await browser.get(newUrl.toString(), false); + await hardRefresh(newUrl); + await retry.try(async () => { const newPanelDimensions = await PageObjects.dashboard.getPanelDimensions(); if (newPanelDimensions.length < 0) { @@ -247,7 +266,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.dashboard.waitForRenderComplete(); const currentUrl = await getUrlFromShare(); const newUrl = currentUrl.replace(/panels:\!\(.*\),query/, 'panels:!(),query'); - await browser.get(newUrl.toString(), false); + await hardRefresh(newUrl); await retry.try(async () => { const newPanelCount = await PageObjects.dashboard.getPanelCount(); @@ -257,10 +276,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('for embeddable config color parameters on a visualization', () => { let originalPieSliceStyle = ''; - it('updates a pie slice color on a soft refresh', async function () { - await dashboardAddPanel.addVisualization(PIE_CHART_VIS_NAME); + before(async () => { + await dashboardAddPanel.addVisualization(PIE_CHART_VIS_NAME); + await enableNewChartLibraryDebug(); originalPieSliceStyle = await pieChart.getPieSliceStyle(`80,000`); + }); + + it('updates a pie slice color on a hard refresh', async function () { await PageObjects.visChart.openLegendOptionColors( '80,000', `[data-title="${PIE_CHART_VIS_NAME}"]` @@ -268,7 +291,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visChart.selectNewLegendColorChoice('#F9D9F9'); const currentUrl = await getUrlFromShare(); const newUrl = currentUrl.replace('F9D9F9', 'FFFFFF'); - await browser.get(newUrl.toString(), false); + await hardRefresh(newUrl); await PageObjects.header.waitUntilLoadingHasFinished(); await retry.try(async () => { @@ -296,7 +319,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const newUrl = isNewChartsLibraryEnabled ? currentUrl.replace(`'80000':%23FFFFFF`, '') : currentUrl.replace(`vis:(colors:('80,000':%23FFFFFF))`, ''); - await browser.get(newUrl.toString(), false); + + await hardRefresh(newUrl); await PageObjects.header.waitUntilLoadingHasFinished(); await retry.try(async () => { diff --git a/test/functional/apps/dashboard/dashboard_unsaved_listing.ts b/test/functional/apps/dashboard/dashboard_unsaved_listing.ts index 1cdc4bbff2c532..2b2d96e8d723a3 100644 --- a/test/functional/apps/dashboard/dashboard_unsaved_listing.ts +++ b/test/functional/apps/dashboard/dashboard_unsaved_listing.ts @@ -36,7 +36,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }; before(async () => { - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/dashboard_unsaved_state.ts b/test/functional/apps/dashboard/dashboard_unsaved_state.ts index fd203cd8c1356d..6b71dd34b76f88 100644 --- a/test/functional/apps/dashboard/dashboard_unsaved_state.ts +++ b/test/functional/apps/dashboard/dashboard_unsaved_state.ts @@ -23,7 +23,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // FLAKY: https://github.com/elastic/kibana/issues/91191 describe.skip('dashboard unsaved panels', () => { before(async () => { - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/data_shared_attributes.ts b/test/functional/apps/dashboard/data_shared_attributes.ts index 2d6396be80f462..34fd4ddb346ed1 100644 --- a/test/functional/apps/dashboard/data_shared_attributes.ts +++ b/test/functional/apps/dashboard/data_shared_attributes.ts @@ -21,7 +21,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { let originalPanelTitles: string[]; before(async () => { - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/edit_embeddable_redirects.ts b/test/functional/apps/dashboard/edit_embeddable_redirects.ts index be540e18a503f9..02f178a5153a22 100644 --- a/test/functional/apps/dashboard/edit_embeddable_redirects.ts +++ b/test/functional/apps/dashboard/edit_embeddable_redirects.ts @@ -19,7 +19,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('edit embeddable redirects', () => { before(async () => { - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/edit_visualizations.js b/test/functional/apps/dashboard/edit_visualizations.js index b2f21aefcf79cc..507d4b8308d4c5 100644 --- a/test/functional/apps/dashboard/edit_visualizations.js +++ b/test/functional/apps/dashboard/edit_visualizations.js @@ -44,7 +44,7 @@ export default function ({ getService, getPageObjects }) { describe('edit visualizations from dashboard', () => { before(async () => { - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/embed_mode.ts b/test/functional/apps/dashboard/embed_mode.ts index b96e9572625731..943a6b3bdb469d 100644 --- a/test/functional/apps/dashboard/embed_mode.ts +++ b/test/functional/apps/dashboard/embed_mode.ts @@ -28,7 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ]; before(async () => { - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/embeddable_data_grid.ts b/test/functional/apps/dashboard/embeddable_data_grid.ts index a9e0039de1f79f..66aca561383c31 100644 --- a/test/functional/apps/dashboard/embeddable_data_grid.ts +++ b/test/functional/apps/dashboard/embeddable_data_grid.ts @@ -21,9 +21,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('dashboard embeddable data grid', () => { before(async () => { - await esArchiver.loadIfNeeded('logstash_functional'); - await esArchiver.loadIfNeeded('dashboard/current/data'); - await esArchiver.loadIfNeeded('dashboard/current/kibana'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/dashboard/current/data'); + await esArchiver.loadIfNeeded( + 'test/functional/fixtures/es_archiver/dashboard/current/kibana' + ); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', 'doc_table:legacy': false, diff --git a/test/functional/apps/dashboard/embeddable_library.ts b/test/functional/apps/dashboard/embeddable_library.ts index 20fe9aeb1387a2..d66f6e834c367f 100644 --- a/test/functional/apps/dashboard/embeddable_library.ts +++ b/test/functional/apps/dashboard/embeddable_library.ts @@ -21,7 +21,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('embeddable library', () => { before(async () => { - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/embeddable_rendering.ts b/test/functional/apps/dashboard/embeddable_rendering.ts index 11807831dc3524..e045b1a1e3f5eb 100644 --- a/test/functional/apps/dashboard/embeddable_rendering.ts +++ b/test/functional/apps/dashboard/embeddable_rendering.ts @@ -94,7 +94,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe.skip('dashboard embeddable rendering', function describeIndexTests() { before(async () => { await security.testUser.setRoles(['kibana_admin', 'animals', 'test_logstash_reader']); - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/empty_dashboard.ts b/test/functional/apps/dashboard/empty_dashboard.ts index 2cfa6d73dcb728..46a8545b79596b 100644 --- a/test/functional/apps/dashboard/empty_dashboard.ts +++ b/test/functional/apps/dashboard/empty_dashboard.ts @@ -21,7 +21,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('empty dashboard', () => { before(async () => { - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/full_screen_mode.ts b/test/functional/apps/dashboard/full_screen_mode.ts index 1f63dcdafdcce2..02669759f68ea9 100644 --- a/test/functional/apps/dashboard/full_screen_mode.ts +++ b/test/functional/apps/dashboard/full_screen_mode.ts @@ -20,7 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('full screen mode', () => { before(async () => { - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/index.ts b/test/functional/apps/dashboard/index.ts index 9f9422ddaec64a..4b83b2ac92deb9 100644 --- a/test/functional/apps/dashboard/index.ts +++ b/test/functional/apps/dashboard/index.ts @@ -15,21 +15,21 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { async function loadCurrentData() { await browser.setWindowSize(1300, 900); - await esArchiver.unload('logstash_functional'); - await esArchiver.loadIfNeeded('dashboard/current/data'); + await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/dashboard/current/data'); } async function unloadCurrentData() { - await esArchiver.unload('dashboard/current/data'); + await esArchiver.unload('test/functional/fixtures/es_archiver/dashboard/current/data'); } async function loadLogstash() { await browser.setWindowSize(1200, 900); - await esArchiver.loadIfNeeded('logstash_functional'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); } async function unloadLogstash() { - await esArchiver.unload('logstash_functional'); + await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional'); } describe('dashboard app', function () { diff --git a/test/functional/apps/dashboard/legacy_urls.ts b/test/functional/apps/dashboard/legacy_urls.ts index 9c7f472b287a72..96c7a5aac3f4bc 100644 --- a/test/functional/apps/dashboard/legacy_urls.ts +++ b/test/functional/apps/dashboard/legacy_urls.ts @@ -33,7 +33,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('legacy urls', function describeIndexTests() { before(async function () { await security.testUser.setRoles(['kibana_admin', 'animals']); - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await PageObjects.common.navigateToApp('dashboard'); await PageObjects.dashboard.clickNewDashboard(); await dashboardAddPanel.addVisualization('Rendering-Test:-animal-sounds-pie'); diff --git a/test/functional/apps/dashboard/panel_expand_toggle.ts b/test/functional/apps/dashboard/panel_expand_toggle.ts index 45642542cc0aca..00500450595ebf 100644 --- a/test/functional/apps/dashboard/panel_expand_toggle.ts +++ b/test/functional/apps/dashboard/panel_expand_toggle.ts @@ -12,7 +12,6 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const retry = getService('retry'); - const browser = getService('browser'); const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); const dashboardPanelActions = getService('dashboardPanelActions'); @@ -20,7 +19,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('expanding a panel', () => { before(async () => { - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); @@ -53,18 +52,5 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(panelCountAfterMaxThenMinimize).to.be(panelCount); }); }); - - it('minimizes using the browser back button', async () => { - const panelCount = await PageObjects.dashboard.getPanelCount(); - - await dashboardPanelActions.openContextMenu(); - await dashboardPanelActions.clickExpandPanelToggle(); - - await browser.goBack(); - await retry.try(async () => { - const panelCountAfterMaxThenMinimize = await PageObjects.dashboard.getPanelCount(); - expect(panelCountAfterMaxThenMinimize).to.be(panelCount); - }); - }); }); } diff --git a/test/functional/apps/dashboard/saved_search_embeddable.ts b/test/functional/apps/dashboard/saved_search_embeddable.ts index 098f6ccc00d94a..5bcec338aad1eb 100644 --- a/test/functional/apps/dashboard/saved_search_embeddable.ts +++ b/test/functional/apps/dashboard/saved_search_embeddable.ts @@ -19,9 +19,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('dashboard saved search embeddable', () => { before(async () => { - await esArchiver.loadIfNeeded('logstash_functional'); - await esArchiver.loadIfNeeded('dashboard/current/data'); - await esArchiver.loadIfNeeded('dashboard/current/kibana'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/dashboard/current/data'); + await esArchiver.loadIfNeeded( + 'test/functional/fixtures/es_archiver/dashboard/current/kibana' + ); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/share.ts b/test/functional/apps/dashboard/share.ts index 8191b5efb51f61..77a858b22ec790 100644 --- a/test/functional/apps/dashboard/share.ts +++ b/test/functional/apps/dashboard/share.ts @@ -16,7 +16,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('share dashboard', () => { before(async () => { - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/time_zones.ts b/test/functional/apps/dashboard/time_zones.ts index a4a586cb635d5c..e5c532537b6f04 100644 --- a/test/functional/apps/dashboard/time_zones.ts +++ b/test/functional/apps/dashboard/time_zones.ts @@ -27,7 +27,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { this.tags('includeFirefox'); before(async () => { - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/url_field_formatter.ts b/test/functional/apps/dashboard/url_field_formatter.ts index f930987f16d5f8..8a4371a0adf774 100644 --- a/test/functional/apps/dashboard/url_field_formatter.ts +++ b/test/functional/apps/dashboard/url_field_formatter.ts @@ -39,7 +39,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // FLAKY: https://github.com/elastic/kibana/issues/79463 describe.skip('Changing field formatter to Url', () => { before(async function () { - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/view_edit.ts b/test/functional/apps/dashboard/view_edit.ts index 99a78ebd069c5d..b29b07f9df4e4b 100644 --- a/test/functional/apps/dashboard/view_edit.ts +++ b/test/functional/apps/dashboard/view_edit.ts @@ -15,14 +15,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); const dashboardAddPanel = getService('dashboardAddPanel'); - const testSubjects = getService('testSubjects'); const PageObjects = getPageObjects(['dashboard', 'header', 'common', 'visualize', 'timePicker']); const dashboardName = 'dashboard with filter'; const filterBar = getService('filterBar'); describe('dashboard view edit mode', function viewEditModeTests() { before(async () => { - await esArchiver.load('dashboard/current/kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); @@ -33,7 +32,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('create new dashboard opens in edit mode', async function () { await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.clickNewDashboard(); - await PageObjects.dashboard.clickCancelOutOfEditMode(); + const isInViewMode = await PageObjects.dashboard.getIsInViewMode(); + expect(isInViewMode).to.be(false); }); it('existing dashboard opens in view mode', async function () { @@ -72,7 +72,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'Sep 19, 2013 @ 06:31:44.000', 'Sep 19, 2013 @ 06:31:44.000' ); - await PageObjects.dashboard.clickDiscardChanges(); + await PageObjects.dashboard.clickCancelOutOfEditMode(); const newTime = await PageObjects.timePicker.getTimeConfig(); @@ -85,7 +85,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await queryBar.setQuery(`${originalQuery}and extra stuff`); await queryBar.submitQuery(); - await PageObjects.dashboard.clickDiscardChanges(); + await PageObjects.dashboard.clickCancelOutOfEditMode(); const query = await queryBar.getQueryString(); expect(query).to.equal(originalQuery); @@ -105,7 +105,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { hasFilter = await filterBar.hasFilter('animal', 'dog'); expect(hasFilter).to.be(false); - await PageObjects.dashboard.clickDiscardChanges(); + await PageObjects.dashboard.clickCancelOutOfEditMode(); hasFilter = await filterBar.hasFilter('animal', 'dog'); expect(hasFilter).to.be(true); @@ -122,13 +122,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { redirectToOrigin: true, }); - await PageObjects.dashboard.clickDiscardChanges(false); + await PageObjects.dashboard.clickCancelOutOfEditMode(false); // for this sleep see https://github.com/elastic/kibana/issues/22299 await PageObjects.common.sleep(500); // confirm lose changes - await testSubjects.exists('dashboardDiscardConfirmDiscard'); - await testSubjects.click('dashboardDiscardConfirmDiscard'); + await PageObjects.common.clickConfirmOnModal(); const panelCount = await PageObjects.dashboard.getPanelCount(); expect(panelCount).to.eql(originalPanelCount); @@ -138,7 +137,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const originalPanelCount = await PageObjects.dashboard.getPanelCount(); await dashboardAddPanel.addVisualization('new viz panel'); - await PageObjects.dashboard.clickDiscardChanges(); + await PageObjects.dashboard.clickCancelOutOfEditMode(); const panelCount = await PageObjects.dashboard.getPanelCount(); expect(panelCount).to.eql(originalPanelCount); @@ -158,10 +157,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'Sep 19, 2015 @ 06:31:44.000', 'Sep 19, 2015 @ 06:31:44.000' ); - await PageObjects.dashboard.clickDiscardChanges(false); + await PageObjects.dashboard.clickCancelOutOfEditMode(false); - await testSubjects.exists('dashboardDiscardConfirmCancel'); - await testSubjects.click('dashboardDiscardConfirmCancel'); + await PageObjects.common.clickCancelOnModal(); await PageObjects.dashboard.saveDashboard(dashboardName, { storeTimeWithDashboard: true, }); @@ -188,10 +186,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ); const newTime = await PageObjects.timePicker.getTimeConfig(); - await PageObjects.dashboard.clickDiscardChanges(false); + await PageObjects.dashboard.clickCancelOutOfEditMode(false); - await testSubjects.exists('dashboardDiscardConfirmCancel'); - await testSubjects.click('dashboardDiscardConfirmCancel'); + await PageObjects.common.clickCancelOnModal(); await PageObjects.dashboard.saveDashboard(dashboardName, { storeTimeWithDashboard: true }); await PageObjects.dashboard.loadSavedDashboard(dashboardName); diff --git a/test/functional/apps/discover/_data_grid.ts b/test/functional/apps/discover/_data_grid.ts index 366865b53fb0dc..efd97fce3f7f5d 100644 --- a/test/functional/apps/discover/_data_grid.ts +++ b/test/functional/apps/discover/_data_grid.ts @@ -24,8 +24,8 @@ export default function ({ before(async function () { await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); - await kibanaServer.importExport.load('discover'); - await esArchiver.loadIfNeeded('logstash_functional'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); await kibanaServer.uiSettings.replace(defaultSettings); await PageObjects.common.navigateToApp('discover'); await PageObjects.timePicker.setDefaultAbsoluteRange(); diff --git a/test/functional/apps/discover/_data_grid_context.ts b/test/functional/apps/discover/_data_grid_context.ts index ee60660ae4a9eb..3d9e01e1dee19d 100644 --- a/test/functional/apps/discover/_data_grid_context.ts +++ b/test/functional/apps/discover/_data_grid_context.ts @@ -36,8 +36,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('discover data grid context tests', () => { before(async () => { await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); - await kibanaServer.importExport.load('discover'); - await esArchiver.loadIfNeeded('logstash_functional'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); await kibanaServer.uiSettings.update(defaultSettings); await PageObjects.common.navigateToApp('discover'); diff --git a/test/functional/apps/discover/_data_grid_doc_navigation.ts b/test/functional/apps/discover/_data_grid_doc_navigation.ts index 2225cb5871f344..e3e8a20b693f85 100644 --- a/test/functional/apps/discover/_data_grid_doc_navigation.ts +++ b/test/functional/apps/discover/_data_grid_doc_navigation.ts @@ -21,8 +21,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('discover data grid doc link', function () { beforeEach(async function () { - await esArchiver.loadIfNeeded('logstash_functional'); - await esArchiver.loadIfNeeded('discover'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/discover'); await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); await kibanaServer.uiSettings.update(defaultSettings); await PageObjects.common.navigateToApp('discover'); diff --git a/test/functional/apps/discover/_data_grid_doc_table.ts b/test/functional/apps/discover/_data_grid_doc_table.ts index f0d6abb23d30fb..00e6a5025e2af6 100644 --- a/test/functional/apps/discover/_data_grid_doc_table.ts +++ b/test/functional/apps/discover/_data_grid_doc_table.ts @@ -28,8 +28,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async function () { log.debug('load kibana index with default index pattern'); await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); - await kibanaServer.importExport.load('discover'); - await esArchiver.loadIfNeeded('logstash_functional'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); await kibanaServer.uiSettings.replace(defaultSettings); await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); await PageObjects.common.navigateToApp('discover'); diff --git a/test/functional/apps/discover/_data_grid_field_data.ts b/test/functional/apps/discover/_data_grid_field_data.ts index 5d73192c1608cf..94e8e942f86ba2 100644 --- a/test/functional/apps/discover/_data_grid_field_data.ts +++ b/test/functional/apps/discover/_data_grid_field_data.ts @@ -23,8 +23,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { this.tags('includeFirefox'); before(async function () { await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); - await kibanaServer.importExport.load('discover'); - await esArchiver.loadIfNeeded('logstash_functional'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); await kibanaServer.uiSettings.update(defaultSettings); await PageObjects.common.navigateToApp('discover'); diff --git a/test/functional/apps/discover/_date_nanos.ts b/test/functional/apps/discover/_date_nanos.ts index 09970b3719c4eb..81327d0744bfe1 100644 --- a/test/functional/apps/discover/_date_nanos.ts +++ b/test/functional/apps/discover/_date_nanos.ts @@ -20,7 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('date_nanos', function () { before(async function () { - await esArchiver.loadIfNeeded('date_nanos'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/date_nanos'); await kibanaServer.uiSettings.replace({ defaultIndex: 'date-nanos' }); await security.testUser.setRoles(['kibana_admin', 'kibana_date_nanos']); await PageObjects.common.navigateToApp('discover'); @@ -29,7 +29,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { after(async function unloadMakelogs() { await security.testUser.restoreDefaults(); - await esArchiver.unload('date_nanos'); + await esArchiver.unload('test/functional/fixtures/es_archiver/date_nanos'); }); it('should show a timestamp with nanoseconds in the first result row', async function () { diff --git a/test/functional/apps/discover/_date_nanos_mixed.ts b/test/functional/apps/discover/_date_nanos_mixed.ts index a3402cc733431a..7d4104c3ac3444 100644 --- a/test/functional/apps/discover/_date_nanos_mixed.ts +++ b/test/functional/apps/discover/_date_nanos_mixed.ts @@ -20,7 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('date_nanos_mixed', function () { before(async function () { - await esArchiver.loadIfNeeded('date_nanos_mixed'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/date_nanos_mixed'); await kibanaServer.uiSettings.replace({ defaultIndex: 'timestamp-*' }); await security.testUser.setRoles(['kibana_admin', 'kibana_date_nanos_mixed']); await PageObjects.common.navigateToApp('discover'); @@ -29,7 +29,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { after(async () => { await security.testUser.restoreDefaults(); - esArchiver.unload('date_nanos_mixed'); + esArchiver.unload('test/functional/fixtures/es_archiver/date_nanos_mixed'); }); it('shows a list of records of indices with date & date_nanos fields in the right order', async function () { diff --git a/test/functional/apps/discover/_discover.ts b/test/functional/apps/discover/_discover.ts index 8ed54f88afea3a..dce6bfba9cd99c 100644 --- a/test/functional/apps/discover/_discover.ts +++ b/test/functional/apps/discover/_discover.ts @@ -29,10 +29,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async function () { log.debug('load kibana index with default index pattern'); - await kibanaServer.importExport.load('discover'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); // and load a set of makelogs data - await esArchiver.loadIfNeeded('logstash_functional'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); await kibanaServer.uiSettings.replace(defaultSettings); await PageObjects.common.navigateToApp('discover'); await PageObjects.timePicker.setDefaultAbsoluteRange(); @@ -327,10 +327,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const intervalS = 5; await PageObjects.timePicker.startAutoRefresh(intervalS); - // check inspector panel request stats for timestamp - await inspector.open(); - const getRequestTimestamp = async () => { + // check inspector panel request stats for timestamp + await inspector.open(); const requestStats = await inspector.getTableData(); const requestStatsRow = requestStats.filter( (r) => r && r[0] && r[0].includes('Request timestamp') @@ -338,6 +337,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { if (!requestStatsRow || !requestStatsRow[0] || !requestStatsRow[0][1]) { return ''; } + await inspector.close(); return requestStatsRow[0][1]; }; diff --git a/test/functional/apps/discover/_discover_fields_api.ts b/test/functional/apps/discover/_discover_fields_api.ts index 0a6029a9f10e85..614a0794ffb3b2 100644 --- a/test/functional/apps/discover/_discover_fields_api.ts +++ b/test/functional/apps/discover/_discover_fields_api.ts @@ -23,8 +23,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async function () { log.debug('load kibana index with default index pattern'); await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); - await kibanaServer.importExport.load('discover'); - await esArchiver.loadIfNeeded('logstash_functional'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); await kibanaServer.uiSettings.replace(defaultSettings); log.debug('discover'); await PageObjects.common.navigateToApp('discover'); diff --git a/test/functional/apps/discover/_discover_histogram.ts b/test/functional/apps/discover/_discover_histogram.ts index e41422555f81d3..d4b3758fd9b8c9 100644 --- a/test/functional/apps/discover/_discover_histogram.ts +++ b/test/functional/apps/discover/_discover_histogram.ts @@ -25,16 +25,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('discover histogram', function describeIndexTests() { before(async () => { - await esArchiver.loadIfNeeded('logstash_functional'); - await esArchiver.load('long_window_logstash'); - await esArchiver.load('long_window_logstash_index_pattern'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); + await esArchiver.load('test/functional/fixtures/es_archiver/long_window_logstash'); + await esArchiver.load( + 'test/functional/fixtures/es_archiver/long_window_logstash_index_pattern' + ); await security.testUser.setRoles(['kibana_admin', 'long_window_logstash']); await kibanaServer.uiSettings.replace(defaultSettings); await PageObjects.common.navigateToApp('discover'); }); after(async () => { - await esArchiver.unload('long_window_logstash'); - await esArchiver.unload('long_window_logstash_index_pattern'); + await esArchiver.unload('test/functional/fixtures/es_archiver/long_window_logstash'); + await esArchiver.unload( + 'test/functional/fixtures/es_archiver/long_window_logstash_index_pattern' + ); await security.testUser.restoreDefaults(); }); diff --git a/test/functional/apps/discover/_doc_navigation.ts b/test/functional/apps/discover/_doc_navigation.ts index 90d3c4eca423a6..771dac4d40a64f 100644 --- a/test/functional/apps/discover/_doc_navigation.ts +++ b/test/functional/apps/discover/_doc_navigation.ts @@ -21,8 +21,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('doc link in discover', function contextSize() { before(async () => { - await esArchiver.loadIfNeeded('logstash_functional'); - await esArchiver.loadIfNeeded('discover'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/discover'); await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); await kibanaServer.uiSettings.update({ 'doc_table:legacy': true, diff --git a/test/functional/apps/discover/_doc_table.ts b/test/functional/apps/discover/_doc_table.ts index 6f298a364abfa7..b5a40030b26016 100644 --- a/test/functional/apps/discover/_doc_table.ts +++ b/test/functional/apps/discover/_doc_table.ts @@ -30,10 +30,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async function () { log.debug('load kibana index with default index pattern'); await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); - await kibanaServer.importExport.load('discover'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); // and load a set of makelogs data - await esArchiver.loadIfNeeded('logstash_functional'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); await kibanaServer.uiSettings.replace(defaultSettings); await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); log.debug('discover doc table'); diff --git a/test/functional/apps/discover/_errors.ts b/test/functional/apps/discover/_errors.ts index 8b8877016b103e..f127c39fd5d9a5 100644 --- a/test/functional/apps/discover/_errors.ts +++ b/test/functional/apps/discover/_errors.ts @@ -16,14 +16,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('errors', function describeIndexTests() { before(async function () { - await esArchiver.loadIfNeeded('logstash_functional'); - await esArchiver.load('invalid_scripted_field'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); + await esArchiver.load('test/functional/fixtures/es_archiver/invalid_scripted_field'); await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); await PageObjects.common.navigateToApp('discover'); }); after(async function () { - await esArchiver.load('empty_kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/empty_kibana'); }); describe('invalid scripted field error', () => { diff --git a/test/functional/apps/discover/_field_data.ts b/test/functional/apps/discover/_field_data.ts index 1831fb9aa73b1f..338d17ba31ff49 100644 --- a/test/functional/apps/discover/_field_data.ts +++ b/test/functional/apps/discover/_field_data.ts @@ -24,8 +24,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { this.tags('includeFirefox'); before(async function () { await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); - await kibanaServer.importExport.load('discover'); - await esArchiver.loadIfNeeded('logstash_functional'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); await kibanaServer.uiSettings.replace({ defaultIndex: 'logstash-*', 'discover:searchFieldsFromSource': true, diff --git a/test/functional/apps/discover/_field_data_with_fields_api.ts b/test/functional/apps/discover/_field_data_with_fields_api.ts index 319722e0c88422..110e255d18c756 100644 --- a/test/functional/apps/discover/_field_data_with_fields_api.ts +++ b/test/functional/apps/discover/_field_data_with_fields_api.ts @@ -24,8 +24,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { this.tags('includeFirefox'); before(async function () { await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); - await kibanaServer.importExport.load('discover'); - await esArchiver.loadIfNeeded('logstash_functional'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); await kibanaServer.uiSettings.replace({ defaultIndex: 'logstash-*', 'discover:searchFieldsFromSource': false, diff --git a/test/functional/apps/discover/_filter_editor.ts b/test/functional/apps/discover/_filter_editor.ts index b94ba3cda40440..8bcb4382bb3bf3 100644 --- a/test/functional/apps/discover/_filter_editor.ts +++ b/test/functional/apps/discover/_filter_editor.ts @@ -25,10 +25,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async function () { log.debug('load kibana index with default index pattern'); await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); - await kibanaServer.importExport.load('discover'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); // and load a set of makelogs data - await esArchiver.loadIfNeeded('logstash_functional'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); await kibanaServer.uiSettings.replace(defaultSettings); log.debug('discover filter editor'); await PageObjects.common.navigateToApp('discover'); diff --git a/test/functional/apps/discover/_huge_fields.ts b/test/functional/apps/discover/_huge_fields.ts index b3e63e482e7341..c7fe0a94b6019b 100644 --- a/test/functional/apps/discover/_huge_fields.ts +++ b/test/functional/apps/discover/_huge_fields.ts @@ -19,7 +19,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe.skip('test large number of fields in sidebar', function () { before(async function () { await security.testUser.setRoles(['kibana_admin', 'test_testhuge_reader'], false); - await esArchiver.loadIfNeeded('large_fields'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/large_fields'); await PageObjects.settings.navigateTo(); await kibanaServer.uiSettings.update({ 'timepicker:timeDefaults': `{ "from": "2016-10-05T00:00:00", "to": "2016-10-06T00:00:00"}`, @@ -41,7 +41,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { after(async () => { await security.testUser.restoreDefaults(); - await esArchiver.unload('large_fields'); + await esArchiver.unload('test/functional/fixtures/es_archiver/large_fields'); await kibanaServer.uiSettings.replace({}); }); }); diff --git a/test/functional/apps/discover/_indexpattern_with_unmapped_fields.ts b/test/functional/apps/discover/_indexpattern_with_unmapped_fields.ts index 06933e828db7e1..e986429a15d264 100644 --- a/test/functional/apps/discover/_indexpattern_with_unmapped_fields.ts +++ b/test/functional/apps/discover/_indexpattern_with_unmapped_fields.ts @@ -18,7 +18,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('index pattern with unmapped fields', () => { before(async () => { - await esArchiver.loadIfNeeded('unmapped_fields'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/unmapped_fields'); await kibanaServer.uiSettings.replace({ defaultIndex: 'test-index-unmapped-fields', 'discover:searchFieldsFromSource': false, @@ -31,7 +31,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); after(async () => { - await esArchiver.unload('unmapped_fields'); + await esArchiver.unload('test/functional/fixtures/es_archiver/unmapped_fields'); }); it('unmapped fields exist on a new saved search', async () => { diff --git a/test/functional/apps/discover/_indexpattern_without_timefield.ts b/test/functional/apps/discover/_indexpattern_without_timefield.ts index cef02a0f54f052..ff3ad0daf69db1 100644 --- a/test/functional/apps/discover/_indexpattern_without_timefield.ts +++ b/test/functional/apps/discover/_indexpattern_without_timefield.ts @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { @@ -13,19 +13,29 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); const security = getService('security'); + const testSubjects = getService('testSubjects'); const PageObjects = getPageObjects(['common', 'timePicker', 'discover']); describe('indexpattern without timefield', () => { before(async () => { await security.testUser.setRoles(['kibana_admin', 'kibana_timefield']); - await esArchiver.loadIfNeeded('index_pattern_without_timefield'); - await kibanaServer.uiSettings.replace({ defaultIndex: 'without-timefield' }); + await esArchiver.loadIfNeeded( + 'test/functional/fixtures/es_archiver/index_pattern_without_timefield' + ); + await kibanaServer.uiSettings.replace({ + defaultIndex: 'without-timefield', + 'timepicker:timeDefaults': '{ "from": "2019-01-18T19:37:13.000Z", "to": "now"}', + }); await PageObjects.common.navigateToApp('discover'); }); after(async () => { await security.testUser.restoreDefaults(); - await esArchiver.unload('index_pattern_without_timefield'); + await kibanaServer.uiSettings.unset('timepicker:timeDefaults'); + await kibanaServer.uiSettings.unset('defaultIndex'); + await esArchiver.unload( + 'test/functional/fixtures/es_archiver/index_pattern_without_timefield' + ); }); it('should not display a timepicker', async () => { @@ -34,6 +44,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { } }); + it('should adapt sidebar fields when switching', async () => { + await PageObjects.discover.selectIndexPattern('with-timefield'); + const timefieldExistsWithTimefield = await testSubjects.exists('field-@timestamp'); + expect(timefieldExistsWithTimefield).to.be(true); + await PageObjects.discover.selectIndexPattern('without-timefield'); + await PageObjects.discover.waitForDocTableLoadingComplete(); + const timefieldExistsWithoutTimefield = await testSubjects.exists('field-@timestamp'); + expect(timefieldExistsWithoutTimefield).to.be(false); + }); + it('should display a timepicker after switching to an index pattern with timefield', async () => { await PageObjects.discover.selectIndexPattern('with-timefield'); if (!(await PageObjects.timePicker.timePickerExists())) { diff --git a/test/functional/apps/discover/_inspector.ts b/test/functional/apps/discover/_inspector.ts index ca8539df9a9260..17f358ec748714 100644 --- a/test/functional/apps/discover/_inspector.ts +++ b/test/functional/apps/discover/_inspector.ts @@ -20,7 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const STATS_ROW_VALUE_INDEX = 1; function getHitCount(requestStats: string[][]): string | undefined { const hitsCountStatsRow = requestStats.find((statsRow) => { - return statsRow[STATS_ROW_NAME_INDEX] === 'Hits (total)'; + return statsRow[STATS_ROW_NAME_INDEX] === 'Hits'; }); if (!hitsCountStatsRow) { @@ -34,8 +34,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async () => { await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); - await kibanaServer.importExport.load('discover'); - await esArchiver.loadIfNeeded('logstash_functional'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); // delete .kibana index and update configDoc await kibanaServer.uiSettings.replace({ defaultIndex: 'logstash-*', @@ -61,7 +61,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await inspector.open(); const requestStats = await inspector.getTableData(); - expect(getHitCount(requestStats)).to.be('14004'); + expect(getHitCount(requestStats)).to.be('500'); }); }); } diff --git a/test/functional/apps/discover/_large_string.ts b/test/functional/apps/discover/_large_string.ts index 0f6be04212a623..de3f0f2c40ae10 100644 --- a/test/functional/apps/discover/_large_string.ts +++ b/test/functional/apps/discover/_large_string.ts @@ -23,8 +23,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async function () { await security.testUser.setRoles(['kibana_admin', 'kibana_large_strings']); - await kibanaServer.importExport.load('testlargestring'); - await esArchiver.loadIfNeeded('hamlet'); + await kibanaServer.importExport.load( + 'test/functional/fixtures/kbn_archiver/testlargestring.json' + ); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/hamlet'); await kibanaServer.uiSettings.replace({ defaultIndex: 'testlargestring' }); }); @@ -68,7 +70,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { after(async () => { await security.testUser.restoreDefaults(); - await esArchiver.unload('hamlet'); + await esArchiver.unload('test/functional/fixtures/es_archiver/hamlet'); await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); }); }); diff --git a/test/functional/apps/discover/_runtime_fields_editor.ts b/test/functional/apps/discover/_runtime_fields_editor.ts index 62045e3c9a6b17..648fa3efe337c0 100644 --- a/test/functional/apps/discover/_runtime_fields_editor.ts +++ b/test/functional/apps/discover/_runtime_fields_editor.ts @@ -31,10 +31,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await fieldEditor.save(); }; - describe('discover integration with runtime fields editor', function describeIndexTests() { + describe.skip('discover integration with runtime fields editor', function describeIndexTests() { before(async function () { - await esArchiver.load('discover'); - await esArchiver.loadIfNeeded('logstash_functional'); + await esArchiver.load('test/functional/fixtures/es_archiver/discover'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); await kibanaServer.uiSettings.replace(defaultSettings); log.debug('discover'); await PageObjects.common.navigateToApp('discover'); @@ -56,7 +56,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('allows creation of a new field', async function () { await createRuntimeField('runtimefield'); await PageObjects.header.waitUntilLoadingHasFinished(); - expect((await PageObjects.discover.getAllFieldNames()).includes('runtimefield')).to.be(true); + await retry.waitFor('fieldNames to include runtimefield', async () => { + const fieldNames = await PageObjects.discover.getAllFieldNames(); + return fieldNames.includes('runtimefield'); + }); }); it('allows editing of a newly created field', async function () { @@ -65,10 +68,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await fieldEditor.save(); await fieldEditor.confirmSave(); await PageObjects.header.waitUntilLoadingHasFinished(); - expect((await PageObjects.discover.getAllFieldNames()).includes('runtimefield')).to.be(false); - expect((await PageObjects.discover.getAllFieldNames()).includes('runtimefield edited')).to.be( - true - ); + + await retry.waitFor('fieldNames to include edits', async () => { + const fieldNames = await PageObjects.discover.getAllFieldNames(); + return fieldNames.includes('runtimefield edited'); + }); }); it('allows creation of a new field and use it in a saved search', async function () { @@ -94,9 +98,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.discover.removeField('delete'); await fieldEditor.confirmDelete(); await PageObjects.header.waitUntilLoadingHasFinished(); - expect((await PageObjects.discover.getAllFieldNames()).includes('delete')).to.be(false); + await retry.waitFor('fieldNames to include edits', async () => { + const fieldNames = await PageObjects.discover.getAllFieldNames(); + return !fieldNames.includes('delete'); + }); }); + // flaky https://github.com/elastic/kibana/issues/100966 it('doc view includes runtime fields', async function () { // navigate to doc view const table = await PageObjects.discover.getDocTable(); diff --git a/test/functional/apps/discover/_saved_queries.ts b/test/functional/apps/discover/_saved_queries.ts index acf78802fa18f7..20f2cab907d9bf 100644 --- a/test/functional/apps/discover/_saved_queries.ts +++ b/test/functional/apps/discover/_saved_queries.ts @@ -30,10 +30,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async function () { log.debug('load kibana index with default index pattern'); await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); - await kibanaServer.importExport.load('discover'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); // and load a set of makelogs data - await esArchiver.loadIfNeeded('logstash_functional'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); await kibanaServer.uiSettings.replace(defaultSettings); log.debug('discover'); await PageObjects.common.navigateToApp('discover'); diff --git a/test/functional/apps/discover/_shared_links.ts b/test/functional/apps/discover/_shared_links.ts index 512e05e4b2d792..62364739db311b 100644 --- a/test/functional/apps/discover/_shared_links.ts +++ b/test/functional/apps/discover/_shared_links.ts @@ -38,8 +38,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { log.debug('load kibana index with default index pattern'); await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); - await kibanaServer.importExport.load('discover'); - await esArchiver.loadIfNeeded('logstash_functional'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); await kibanaServer.uiSettings.replace({ 'state:storeInSessionStorage': storeStateInSessionStorage, diff --git a/test/functional/apps/discover/_sidebar.ts b/test/functional/apps/discover/_sidebar.ts index f4b806976fc5d7..d8701261126c46 100644 --- a/test/functional/apps/discover/_sidebar.ts +++ b/test/functional/apps/discover/_sidebar.ts @@ -16,8 +16,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('discover sidebar', function describeIndexTests() { before(async function () { - await esArchiver.loadIfNeeded('logstash_functional'); - await esArchiver.loadIfNeeded('discover'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/discover'); await kibanaServer.uiSettings.replace({ defaultIndex: 'logstash-*', }); diff --git a/test/functional/apps/discover/_source_filters.ts b/test/functional/apps/discover/_source_filters.ts index 4161f7f289dbfd..f3793dc3e02887 100644 --- a/test/functional/apps/discover/_source_filters.ts +++ b/test/functional/apps/discover/_source_filters.ts @@ -24,10 +24,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); log.debug('load kibana index with default index pattern'); - await esArchiver.load('visualize_source-filters'); + await esArchiver.load('test/functional/fixtures/es_archiver/visualize_source-filters'); // and load a set of makelogs data - await esArchiver.loadIfNeeded('logstash_functional'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); await kibanaServer.uiSettings.update({ 'discover:searchFieldsFromSource': false, diff --git a/test/functional/apps/discover/index.ts b/test/functional/apps/discover/index.ts index db76cd1c20c380..869fb625e87960 100644 --- a/test/functional/apps/discover/index.ts +++ b/test/functional/apps/discover/index.ts @@ -20,7 +20,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { }); after(function unloadMakelogs() { - return esArchiver.unload('logstash_functional'); + return esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional'); }); loadTestFile(require.resolve('./_saved_queries')); diff --git a/test/functional/apps/getting_started/_shakespeare.ts b/test/functional/apps/getting_started/_shakespeare.ts index 4bc1f54852b821..945c1fdcbdcf4e 100644 --- a/test/functional/apps/getting_started/_shakespeare.ts +++ b/test/functional/apps/getting_started/_shakespeare.ts @@ -46,9 +46,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ); isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled(); await security.testUser.setRoles(['kibana_admin', 'test_shakespeare_reader']); - await esArchiver.load('empty_kibana', { skipExisting: true }); + await esArchiver.load('test/functional/fixtures/es_archiver/empty_kibana', { + skipExisting: true, + }); log.debug('Load shakespeare data'); - await esArchiver.loadIfNeeded('getting_started/shakespeare'); + await esArchiver.loadIfNeeded( + 'test/functional/fixtures/es_archiver/getting_started/shakespeare' + ); if (isNewChartsLibraryEnabled) { await kibanaServer.uiSettings.update({ diff --git a/test/functional/apps/home/_navigation.ts b/test/functional/apps/home/_navigation.ts index 401f33b789c859..a57ce0596abac9 100644 --- a/test/functional/apps/home/_navigation.ts +++ b/test/functional/apps/home/_navigation.ts @@ -17,8 +17,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('Kibana browser back navigation should work', function describeIndexTests() { before(async () => { - await esArchiver.loadIfNeeded('discover'); - await esArchiver.loadIfNeeded('logstash_functional'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/discover'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); }); it('detect navigate back issues', async () => { diff --git a/test/functional/apps/management/_field_formatter.js b/test/functional/apps/management/_field_formatter.js index 49b6c162caa416..383b4faecc40c0 100644 --- a/test/functional/apps/management/_field_formatter.js +++ b/test/functional/apps/management/_field_formatter.js @@ -18,7 +18,7 @@ export default function ({ getService, getPageObjects }) { before(async function () { await browser.setWindowSize(1200, 800); - await esArchiver.load('discover'); + await esArchiver.load('test/functional/fixtures/es_archiver/discover'); await kibanaServer.uiSettings.replace({}); await kibanaServer.uiSettings.update({}); }); diff --git a/test/functional/apps/management/_handle_alias.js b/test/functional/apps/management/_handle_alias.js index 6c90556d77cf05..891e59d84a04bc 100644 --- a/test/functional/apps/management/_handle_alias.js +++ b/test/functional/apps/management/_handle_alias.js @@ -18,8 +18,8 @@ export default function ({ getService, getPageObjects }) { describe('Index patterns on aliases', function () { before(async function () { await security.testUser.setRoles(['kibana_admin', 'test_alias_reader']); - await esArchiver.loadIfNeeded('alias'); - await esArchiver.load('empty_kibana'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/alias'); + await esArchiver.load('test/functional/fixtures/es_archiver/empty_kibana'); await es.indices.updateAliases({ body: { actions: [ @@ -71,7 +71,7 @@ export default function ({ getService, getPageObjects }) { after(async () => { await security.testUser.restoreDefaults(); - await esArchiver.unload('alias'); + await esArchiver.unload('test/functional/fixtures/es_archiver/alias'); }); }); } diff --git a/test/functional/apps/management/_handle_version_conflict.js b/test/functional/apps/management/_handle_version_conflict.js index 2daad1e457a6be..82723ad7ce9671 100644 --- a/test/functional/apps/management/_handle_version_conflict.js +++ b/test/functional/apps/management/_handle_version_conflict.js @@ -30,7 +30,7 @@ export default function ({ getService, getPageObjects }) { describe('index version conflict', function describeIndexTests() { before(async function () { await browser.setWindowSize(1200, 800); - await esArchiver.load('discover'); + await esArchiver.load('test/functional/fixtures/es_archiver/discover'); }); it('Should be able to surface version conflict notification while creating scripted field', async function () { diff --git a/test/functional/apps/management/_import_objects.ts b/test/functional/apps/management/_import_objects.ts index d9eb945be77771..0278955c577a10 100644 --- a/test/functional/apps/management/_import_objects.ts +++ b/test/functional/apps/management/_import_objects.ts @@ -27,14 +27,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('import objects', function describeIndexTests() { describe('.ndjson file', () => { beforeEach(async function () { - await esArchiver.load('management'); + await esArchiver.load('test/functional/fixtures/es_archiver/management'); await kibanaServer.uiSettings.replace({}); await PageObjects.settings.navigateTo(); await PageObjects.settings.clickKibanaSavedObjects(); }); afterEach(async function () { - await esArchiver.unload('management'); + await esArchiver.unload('test/functional/fixtures/es_archiver/management'); }); it('should import saved objects', async function () { @@ -213,14 +213,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('.json file', () => { beforeEach(async function () { - await esArchiver.load('saved_objects_imports'); + await esArchiver.load('test/functional/fixtures/es_archiver/saved_objects_imports'); await kibanaServer.uiSettings.replace({}); await PageObjects.settings.navigateTo(); await PageObjects.settings.clickKibanaSavedObjects(); }); afterEach(async function () { - await esArchiver.unload('saved_objects_imports'); + await esArchiver.unload('test/functional/fixtures/es_archiver/saved_objects_imports'); }); it('should import saved objects', async function () { diff --git a/test/functional/apps/management/_index_patterns_empty.ts b/test/functional/apps/management/_index_patterns_empty.ts index 3a09340f06ba04..038039275b8430 100644 --- a/test/functional/apps/management/_index_patterns_empty.ts +++ b/test/functional/apps/management/_index_patterns_empty.ts @@ -20,14 +20,14 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { describe('index pattern empty view', () => { before(async () => { await esArchiver.emptyKibanaIndex(); - await esArchiver.unload('logstash_functional'); - await esArchiver.unload('makelogs'); + await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional'); + await esArchiver.unload('test/functional/fixtures/es_archiver/makelogs'); await kibanaServer.uiSettings.replace({}); await PageObjects.settings.navigateTo(); }); after(async () => { - await esArchiver.loadIfNeeded('makelogs'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/makelogs'); await es.transport.request({ path: '/logstash-a', method: 'DELETE', diff --git a/test/functional/apps/management/_kibana_settings.js b/test/functional/apps/management/_kibana_settings.js index 43f6631efb5c13..cfe4e88cda21de 100644 --- a/test/functional/apps/management/_kibana_settings.js +++ b/test/functional/apps/management/_kibana_settings.js @@ -37,14 +37,9 @@ export default function ({ getService, getPageObjects }) { describe('state:storeInSessionStorage', () => { async function getStateFromUrl() { const currentUrl = await browser.getCurrentUrl(); - let match = currentUrl.match(/(.*)?_g=(.*)&_a=(.*)/); - if (match) return [match[2], match[3]]; - match = currentUrl.match(/(.*)?_a=(.*)&_g=(.*)/); - if (match) return [match[3], match[2]]; - - if (!match) { - throw new Error('State in url is missing or malformed: ' + currentUrl); - } + const match = currentUrl.match(/(.*)?_g=(.*)/); + if (match) return match[2]; + throw new Error('State in url is missing or malformed: ' + currentUrl); } it('defaults to null', async () => { @@ -59,12 +54,11 @@ export default function ({ getService, getPageObjects }) { await PageObjects.common.navigateToApp('dashboard'); await PageObjects.dashboard.clickNewDashboard(); await PageObjects.timePicker.setDefaultAbsoluteRange(); - const [globalState, appState] = await getStateFromUrl(); + const globalState = await getStateFromUrl(); // We don't have to be exact, just need to ensure it's greater than when the hashed variation is being used, // which is less than 20 characters. expect(globalState.length).to.be.greaterThan(20); - expect(appState.length).to.be.greaterThan(20); }); it('setting to true change is preserved', async function () { @@ -81,12 +75,11 @@ export default function ({ getService, getPageObjects }) { await PageObjects.common.navigateToApp('dashboard'); await PageObjects.dashboard.clickNewDashboard(); await PageObjects.timePicker.setDefaultAbsoluteRange(); - const [globalState, appState] = await getStateFromUrl(); + const globalState = await getStateFromUrl(); // We don't have to be exact, just need to ensure it's less than the unhashed version, which will be // greater than 20 characters with the default state plus a time. expect(globalState.length).to.be.lessThan(20); - expect(appState.length).to.be.lessThan(20); }); it("changing 'state:storeInSessionStorage' also takes effect without full page reload", async () => { @@ -95,11 +88,10 @@ export default function ({ getService, getPageObjects }) { await PageObjects.settings.clickKibanaSettings(); await PageObjects.settings.toggleAdvancedSettingCheckbox('state:storeInSessionStorage'); await PageObjects.header.clickDashboard(); - const [globalState, appState] = await getStateFromUrl(); + const globalState = await getStateFromUrl(); // We don't have to be exact, just need to ensure it's greater than when the hashed variation is being used, // which is less than 20 characters. expect(globalState.length).to.be.greaterThan(20); - expect(appState.length).to.be.greaterThan(20); }); }); diff --git a/test/functional/apps/management/_mgmt_import_saved_objects.js b/test/functional/apps/management/_mgmt_import_saved_objects.js index 8697dc49de46a9..84e57a798c006f 100644 --- a/test/functional/apps/management/_mgmt_import_saved_objects.js +++ b/test/functional/apps/management/_mgmt_import_saved_objects.js @@ -19,12 +19,12 @@ export default function ({ getService, getPageObjects }) { describe('mgmt saved objects', function describeIndexTests() { beforeEach(async function () { await esArchiver.emptyKibanaIndex(); - await esArchiver.load('discover'); + await esArchiver.load('test/functional/fixtures/es_archiver/discover'); await PageObjects.settings.navigateTo(); }); afterEach(async function () { - await esArchiver.unload('discover'); + await esArchiver.unload('test/functional/fixtures/es_archiver/discover'); }); it('should import saved objects mgmt', async function () { diff --git a/test/functional/apps/management/_runtime_fields.js b/test/functional/apps/management/_runtime_fields.js index 44abf07b38ac65..105e1a394fecbc 100644 --- a/test/functional/apps/management/_runtime_fields.js +++ b/test/functional/apps/management/_runtime_fields.js @@ -23,7 +23,7 @@ export default function ({ getService, getPageObjects }) { before(async function () { await browser.setWindowSize(1200, 800); - await esArchiver.load('discover'); + await esArchiver.load('test/functional/fixtures/es_archiver/discover'); // delete .kibana index and then wait for Kibana to re-create it await kibanaServer.uiSettings.replace({}); await kibanaServer.uiSettings.update({}); diff --git a/test/functional/apps/management/_scripted_fields.js b/test/functional/apps/management/_scripted_fields.js index c7a4c8c51bf44a..2ff9e55c59ebbc 100644 --- a/test/functional/apps/management/_scripted_fields.js +++ b/test/functional/apps/management/_scripted_fields.js @@ -46,7 +46,7 @@ export default function ({ getService, getPageObjects }) { before(async function () { await browser.setWindowSize(1200, 800); - await esArchiver.load('discover'); + await esArchiver.load('test/functional/fixtures/es_archiver/discover'); // delete .kibana index and then wait for Kibana to re-create it await kibanaServer.uiSettings.replace({}); await kibanaServer.uiSettings.update({ 'doc_table:legacy': true }); diff --git a/test/functional/apps/management/_scripted_fields_filter.js b/test/functional/apps/management/_scripted_fields_filter.js index 7ed15a6cddbca3..6ced089936e5e9 100644 --- a/test/functional/apps/management/_scripted_fields_filter.js +++ b/test/functional/apps/management/_scripted_fields_filter.js @@ -20,14 +20,14 @@ export default function ({ getService, getPageObjects }) { before(async function () { // delete .kibana index and then wait for Kibana to re-create it await browser.setWindowSize(1200, 800); - await esArchiver.load('management'); + await esArchiver.load('test/functional/fixtures/es_archiver/management'); await kibanaServer.uiSettings.replace({ defaultIndex: 'f1e4c910-a2e6-11e7-bb30-233be9be6a15', }); }); after(async function () { - await esArchiver.load('empty_kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/empty_kibana'); }); const scriptedPainlessFieldName = 'ram_pain1'; diff --git a/test/functional/apps/management/_test_huge_fields.js b/test/functional/apps/management/_test_huge_fields.js index dcfb8cf8b4c6b9..c8710a79e4fc82 100644 --- a/test/functional/apps/management/_test_huge_fields.js +++ b/test/functional/apps/management/_test_huge_fields.js @@ -21,7 +21,7 @@ export default function ({ getService, getPageObjects }) { before(async function () { await security.testUser.setRoles(['kibana_admin', 'test_testhuge_reader'], false); await esArchiver.emptyKibanaIndex(); - await esArchiver.loadIfNeeded('large_fields'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/large_fields'); await PageObjects.settings.navigateTo(); await PageObjects.settings.createIndexPattern('testhuge', 'date'); }); @@ -33,7 +33,7 @@ export default function ({ getService, getPageObjects }) { after(async () => { await security.testUser.restoreDefaults(); - await esArchiver.unload('large_fields'); + await esArchiver.unload('test/functional/fixtures/es_archiver/large_fields'); }); }); } diff --git a/test/functional/apps/management/index.ts b/test/functional/apps/management/index.ts index ac0df0aa90c4df..c8049d2db4b28b 100644 --- a/test/functional/apps/management/index.ts +++ b/test/functional/apps/management/index.ts @@ -13,12 +13,12 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { describe('management', function () { before(async () => { - await esArchiver.unload('logstash_functional'); - await esArchiver.loadIfNeeded('makelogs'); + await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/makelogs'); }); after(async () => { - await esArchiver.unload('makelogs'); + await esArchiver.unload('test/functional/fixtures/es_archiver/makelogs'); }); describe('', function () { diff --git a/test/functional/apps/saved_objects_management/edit_saved_object.ts b/test/functional/apps/saved_objects_management/edit_saved_object.ts index 89889088bd73ba..a90e9274166859 100644 --- a/test/functional/apps/saved_objects_management/edit_saved_object.ts +++ b/test/functional/apps/saved_objects_management/edit_saved_object.ts @@ -57,11 +57,15 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { describe('saved objects edition page', () => { beforeEach(async () => { - await esArchiver.load('saved_objects_management/edit_saved_object'); + await esArchiver.load( + 'test/functional/fixtures/es_archiver/saved_objects_management/edit_saved_object' + ); }); afterEach(async () => { - await esArchiver.unload('saved_objects_management/edit_saved_object'); + await esArchiver.unload( + 'test/functional/fixtures/es_archiver/saved_objects_management/edit_saved_object' + ); }); it('allows to update the saved object when submitting', async () => { diff --git a/test/functional/apps/saved_objects_management/show_relationships.ts b/test/functional/apps/saved_objects_management/show_relationships.ts index 92c65323333d01..26fd2a00430f18 100644 --- a/test/functional/apps/saved_objects_management/show_relationships.ts +++ b/test/functional/apps/saved_objects_management/show_relationships.ts @@ -15,11 +15,15 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { describe('saved objects relationships flyout', () => { beforeEach(async () => { - await esArchiver.load('saved_objects_management/show_relationships'); + await esArchiver.load( + 'test/functional/fixtures/es_archiver/saved_objects_management/show_relationships' + ); }); afterEach(async () => { - await esArchiver.unload('saved_objects_management/show_relationships'); + await esArchiver.unload( + 'test/functional/fixtures/es_archiver/saved_objects_management/show_relationships' + ); }); it('displays the invalid references', async () => { diff --git a/test/functional/apps/timelion/index.js b/test/functional/apps/timelion/index.js index 8fba1a5ae2e5bc..b81a0e70d8a6d7 100644 --- a/test/functional/apps/timelion/index.js +++ b/test/functional/apps/timelion/index.js @@ -18,7 +18,7 @@ export default function ({ getService, loadTestFile }) { before(async function () { log.debug('Starting timelion before method'); await browser.setWindowSize(1280, 800); - await esArchiver.loadIfNeeded('logstash_functional'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); await kibanaServer.uiSettings.replace({ defaultIndex: 'logstash-*' }); }); diff --git a/test/functional/apps/visualize/_area_chart.ts b/test/functional/apps/visualize/_area_chart.ts index 99f65458bb6063..be777607c78361 100644 --- a/test/functional/apps/visualize/_area_chart.ts +++ b/test/functional/apps/visualize/_area_chart.ts @@ -34,8 +34,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ); describe('area charts', function indexPatternCreation() { + let isNewChartsLibraryEnabled = false; before(async () => { - await PageObjects.visualize.initTests(); + isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled(); + await PageObjects.visualize.initTests(isNewChartsLibraryEnabled); }); const initAreaChart = async () => { log.debug('navigateToApp visualize'); diff --git a/test/functional/apps/visualize/_histogram_request_start.ts b/test/functional/apps/visualize/_histogram_request_start.ts index 8b5c31701d025b..28ebb25744d3fb 100644 --- a/test/functional/apps/visualize/_histogram_request_start.ts +++ b/test/functional/apps/visualize/_histogram_request_start.ts @@ -26,10 +26,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('histogram agg onSearchRequestStart', function () { before(async function () { // loading back default data - await esArchiver.load('empty_kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/empty_kibana'); - await esArchiver.loadIfNeeded('logstash_functional'); - await esArchiver.loadIfNeeded('long_window_logstash'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/long_window_logstash'); await PageObjects.visualize.initTests(); log.debug('navigateToApp visualize'); diff --git a/test/functional/apps/visualize/_line_chart_split_chart.ts b/test/functional/apps/visualize/_line_chart_split_chart.ts index 91c1db533cee9b..9b1c12de9666e4 100644 --- a/test/functional/apps/visualize/_line_chart_split_chart.ts +++ b/test/functional/apps/visualize/_line_chart_split_chart.ts @@ -25,6 +25,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ]); describe('line charts - split chart', function () { + let isNewChartsLibraryEnabled = false; const initLineChart = async function () { log.debug('navigateToApp visualize'); await PageObjects.visualize.navigateToNewAggBasedVisualization(); @@ -44,7 +45,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }; before(async () => { - await PageObjects.visualize.initTests(); + isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled(); + await PageObjects.visualize.initTests(isNewChartsLibraryEnabled); await initLineChart(); }); diff --git a/test/functional/apps/visualize/_line_chart_split_series.ts b/test/functional/apps/visualize/_line_chart_split_series.ts index 6630690b89c2c1..1c4b34b855cdea 100644 --- a/test/functional/apps/visualize/_line_chart_split_series.ts +++ b/test/functional/apps/visualize/_line_chart_split_series.ts @@ -25,6 +25,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ]); describe('line charts - split series', function () { + let isNewChartsLibraryEnabled = false; const initLineChart = async function () { log.debug('navigateToApp visualize'); await PageObjects.visualize.navigateToNewAggBasedVisualization(); @@ -42,7 +43,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }; before(async () => { - await PageObjects.visualize.initTests(); + isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled(); + await PageObjects.visualize.initTests(isNewChartsLibraryEnabled); await initLineChart(); }); diff --git a/test/functional/apps/visualize/_pie_chart.ts b/test/functional/apps/visualize/_pie_chart.ts index 8f76e2765e42c9..744ba3caa719e4 100644 --- a/test/functional/apps/visualize/_pie_chart.ts +++ b/test/functional/apps/visualize/_pie_chart.ts @@ -15,8 +15,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const filterBar = getService('filterBar'); const pieChart = getService('pieChart'); const inspector = getService('inspector'); - const browser = getService('browser'); - const kibanaServer = getService('kibanaServer'); const PageObjects = getPageObjects([ 'common', @@ -33,13 +31,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const vizName1 = 'Visualization PieChart'; before(async function () { isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled(); - await PageObjects.visualize.initTests(); - if (isNewChartsLibraryEnabled) { - await kibanaServer.uiSettings.update({ - 'visualization:visualize:legacyChartsLibrary': false, - }); - await browser.refresh(); - } + await PageObjects.visualize.initTests(isNewChartsLibraryEnabled); + log.debug('navigateToApp visualize'); await PageObjects.visualize.navigateToNewAggBasedVisualization(); log.debug('clickPieChart'); diff --git a/test/functional/apps/visualize/_point_series_options.ts b/test/functional/apps/visualize/_point_series_options.ts index b81feaf29e1945..ee64fdf7ddda3b 100644 --- a/test/functional/apps/visualize/_point_series_options.ts +++ b/test/functional/apps/visualize/_point_series_options.ts @@ -60,9 +60,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.clickGo(); } - describe('vlad point series', function describeIndexTests() { + describe('point series', function describeIndexTests() { + let isNewChartsLibraryEnabled = false; before(async () => { - await PageObjects.visualize.initTests(); + isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled(); + await PageObjects.visualize.initTests(isNewChartsLibraryEnabled); await initChart(); }); diff --git a/test/functional/apps/visualize/_tsvb_chart.ts b/test/functional/apps/visualize/_tsvb_chart.ts index 690db676cb3686..1d4d4fee0175eb 100644 --- a/test/functional/apps/visualize/_tsvb_chart.ts +++ b/test/functional/apps/visualize/_tsvb_chart.ts @@ -127,7 +127,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('switch index patterns', () => { before(async () => { - await esArchiver.loadIfNeeded('index_pattern_without_timefield'); + await esArchiver.loadIfNeeded( + 'test/functional/fixtures/es_archiver/index_pattern_without_timefield' + ); }); beforeEach(async () => { @@ -146,7 +148,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { after(async () => { await security.testUser.restoreDefaults(); - await esArchiver.load('empty_kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/empty_kibana'); await PageObjects.visualize.initTests(); }); diff --git a/test/functional/apps/visualize/_vertical_bar_chart.ts b/test/functional/apps/visualize/_vertical_bar_chart.ts index 1fe0d2f9a955bd..a728757a485e1a 100644 --- a/test/functional/apps/visualize/_vertical_bar_chart.ts +++ b/test/functional/apps/visualize/_vertical_bar_chart.ts @@ -19,8 +19,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['visualize', 'visEditor', 'visChart', 'timePicker']); describe('vertical bar chart', function () { + let isNewChartsLibraryEnabled = false; before(async () => { - await PageObjects.visualize.initTests(); + isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled(); + await PageObjects.visualize.initTests(isNewChartsLibraryEnabled); }); const vizName1 = 'Visualization VerticalBarChart'; diff --git a/test/functional/apps/visualize/_vertical_bar_chart_nontimeindex.ts b/test/functional/apps/visualize/_vertical_bar_chart_nontimeindex.ts index 5f066e96c6e7cf..97817315b5801f 100644 --- a/test/functional/apps/visualize/_vertical_bar_chart_nontimeindex.ts +++ b/test/functional/apps/visualize/_vertical_bar_chart_nontimeindex.ts @@ -18,6 +18,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('vertical bar chart with index without time filter', function () { const vizName1 = 'Visualization VerticalBarChart without time filter'; + let isNewChartsLibraryEnabled = false; const initBarChart = async () => { log.debug('navigateToApp visualize'); @@ -40,7 +41,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }; before(async () => { - await PageObjects.visualize.initTests(); + isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled(); + await PageObjects.visualize.initTests(isNewChartsLibraryEnabled); await initBarChart(); }); diff --git a/test/functional/apps/visualize/index.ts b/test/functional/apps/visualize/index.ts index 1e0e12a7d31bba..cecd206abd1db0 100644 --- a/test/functional/apps/visualize/index.ts +++ b/test/functional/apps/visualize/index.ts @@ -18,10 +18,10 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { before(async () => { log.debug('Starting visualize before method'); await browser.setWindowSize(1280, 800); - await esArchiver.load('empty_kibana'); + await esArchiver.load('test/functional/fixtures/es_archiver/empty_kibana'); - await esArchiver.loadIfNeeded('logstash_functional'); - await esArchiver.loadIfNeeded('long_window_logstash'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/long_window_logstash'); }); // TODO: Remove when vislib is removed diff --git a/test/functional/apps/visualize/input_control_vis/input_control_range.ts b/test/functional/apps/visualize/input_control_vis/input_control_range.ts index 97e746ba4a4c0b..566e6f033d2fd6 100644 --- a/test/functional/apps/visualize/input_control_vis/input_control_range.ts +++ b/test/functional/apps/visualize/input_control_vis/input_control_range.ts @@ -22,7 +22,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async () => { await PageObjects.visualize.initTests(); await security.testUser.setRoles(['kibana_admin', 'kibana_sample_admin']); - await esArchiver.load('kibana_sample_data_flights_index_pattern'); + await esArchiver.load( + 'test/functional/fixtures/es_archiver/kibana_sample_data_flights_index_pattern' + ); await visualize.navigateToNewVisualization(); await visualize.clickInputControlVis(); }); @@ -50,7 +52,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); after(async () => { - await esArchiver.unload('kibana_sample_data_flights_index_pattern'); + await esArchiver.unload( + 'test/functional/fixtures/es_archiver/kibana_sample_data_flights_index_pattern' + ); await security.testUser.restoreDefaults(); }); }); diff --git a/test/functional/apps/visualize/legacy/index.ts b/test/functional/apps/visualize/legacy/index.ts index 914559e5cea925..d474287860b25e 100644 --- a/test/functional/apps/visualize/legacy/index.ts +++ b/test/functional/apps/visualize/legacy/index.ts @@ -21,9 +21,9 @@ export default function ({ getPageObjects, getService, loadTestFile }: FtrProvid await PageObjects.visualize.initTests(); log.debug('Starting visualize legacy before method'); await browser.setWindowSize(1280, 800); - await esArchiver.loadIfNeeded('logstash_functional'); - await esArchiver.loadIfNeeded('long_window_logstash'); - await kibanaServer.importExport.load('visualize'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/long_window_logstash'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/visualize.json'); await kibanaServer.uiSettings.replace({ defaultIndex: 'logstash-*', [UI_SETTINGS.FORMAT_BYTES_DEFAULT_PATTERN]: '0,0.[000]b', diff --git a/test/functional/fixtures/es_archiver/dashboard/legacy/mappings.json b/test/functional/fixtures/es_archiver/dashboard/legacy/mappings.json index a89fe1dfacfc83..45b2508d380330 100644 --- a/test/functional/fixtures/es_archiver/dashboard/legacy/mappings.json +++ b/test/functional/fixtures/es_archiver/dashboard/legacy/mappings.json @@ -1,7 +1,10 @@ { "type": "index", "value": { - "index": ".kibana", + "aliases": { + ".kibana": {} + }, + "index": ".kibana_1", "mappings": { "properties": { "config": { diff --git a/test/functional/fixtures/es_archiver/deprecations_service/mappings.json b/test/functional/fixtures/es_archiver/deprecations_service/mappings.json index 5f7c7e0e7b7dca..41cddecef0c419 100644 --- a/test/functional/fixtures/es_archiver/deprecations_service/mappings.json +++ b/test/functional/fixtures/es_archiver/deprecations_service/mappings.json @@ -1,7 +1,10 @@ { "type": "index", "value": { - "index": ".kibana", + "aliases": { + ".kibana": {} + }, + "index": ".kibana_1", "mappings": { "properties": { "config": { diff --git a/test/functional/fixtures/es_archiver/discover/mappings.json b/test/functional/fixtures/es_archiver/discover/mappings.json index 53bbe8a5baa5bd..519af2dd75b9e1 100644 --- a/test/functional/fixtures/es_archiver/discover/mappings.json +++ b/test/functional/fixtures/es_archiver/discover/mappings.json @@ -1,7 +1,10 @@ { "type": "index", "value": { - "index": ".kibana", + "aliases": { + ".kibana": {} + }, + "index": ".kibana_1", "mappings": { "properties": { "config": { diff --git a/test/functional/fixtures/es_archiver/empty_kibana/mappings.json b/test/functional/fixtures/es_archiver/empty_kibana/mappings.json index 403a891ba11757..264096beb11ee5 100644 --- a/test/functional/fixtures/es_archiver/empty_kibana/mappings.json +++ b/test/functional/fixtures/es_archiver/empty_kibana/mappings.json @@ -1,7 +1,10 @@ { "type": "index", "value": { - "index": ".kibana", + "aliases": { + ".kibana": {} + }, + "index": ".kibana_1", "mappings": { "properties": { "config": { diff --git a/test/functional/fixtures/es_archiver/index_pattern_without_timefield/data.json b/test/functional/fixtures/es_archiver/index_pattern_without_timefield/data.json index 9493408a30040d..0888079ec7c52c 100644 --- a/test/functional/fixtures/es_archiver/index_pattern_without_timefield/data.json +++ b/test/functional/fixtures/es_archiver/index_pattern_without_timefield/data.json @@ -5,7 +5,7 @@ "index": ".kibana", "source": { "index-pattern": { - "fields": "[{\"name\":\"referer\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"agent\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:image:width\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"xss.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"headings.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:description\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.user.lastname\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:tag.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"geo.dest\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:image\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:section.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"utc_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:card\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.char\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"clientip\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image:height\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"host\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"machine.ram\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"links\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"id\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@tags.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"phpmemory\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:card.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"ip\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:modified_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:site_name.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"request.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:tag\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"agent.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"spaces\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:site.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"headings\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"relatedContent.og:image.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"request\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"index.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"extension\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"memory\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"relatedContent.twitter:site\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:description\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"geo.coordinates\",\"type\":\"geo_point\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"meta.related\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:title.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:title.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"response.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@message.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"machine.os\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:section\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"xss\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"links.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:title\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"geo.srcdest\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"extension.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"machine.os.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@tags\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"host.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:type.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"geo.src\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"spaces.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image:height.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:description.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:site_name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:title\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"@message\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:image.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@timestamp\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"response\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.user.firstname\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:image:width.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:description.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:published_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false}]", + "fields": "[]", "title": "without-timefield" }, "type": "index-pattern" @@ -20,7 +20,6 @@ "index": "without-timefield", "source": { "@message" : "5", - "@timestamp": "2019-09-22T23:50:13.253Z", "referer": "http://twitter.com/error/takuya-onishi", "request": "/uploads/dafydd-williams.jpg", "response": "200", @@ -37,7 +36,7 @@ "index": ".kibana", "source": { "index-pattern": { - "fields": "[{\"name\":\"referer\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"agent\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:image:width\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"xss.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"headings.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:description\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.user.lastname\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:tag.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"geo.dest\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:image\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:section.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"utc_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:card\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.char\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"clientip\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image:height\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"host\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"machine.ram\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"links\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"id\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@tags.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"phpmemory\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:card.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"ip\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:modified_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:site_name.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"request.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:tag\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"agent.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"spaces\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:site.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"headings\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"relatedContent.og:image.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"request\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"index.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"extension\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"memory\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"relatedContent.twitter:site\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:description\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"geo.coordinates\",\"type\":\"geo_point\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"meta.related\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:title.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:title.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"response.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@message.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"machine.os\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:section\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"xss\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"links.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:title\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"geo.srcdest\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"extension.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"machine.os.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@tags\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"host.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:type.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"geo.src\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"spaces.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image:height.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:description.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:site_name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:title\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"@message\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:image.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@timestamp\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"response\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.user.firstname\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:image:width.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:description.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:published_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false}]", + "fields": "[]", "title": "with-timefield", "timeFieldName": "@timestamp" }, diff --git a/test/functional/fixtures/es_archiver/index_pattern_without_timefield/mappings.json b/test/functional/fixtures/es_archiver/index_pattern_without_timefield/mappings.json index 00961119239511..dd41e01592a7b6 100644 --- a/test/functional/fixtures/es_archiver/index_pattern_without_timefield/mappings.json +++ b/test/functional/fixtures/es_archiver/index_pattern_without_timefield/mappings.json @@ -2,13 +2,6 @@ "type": "index", "value": { "index": "without-timefield", - "mappings": { - "properties": { - "@timestamp": { - "type": "date" - } - } - }, "settings": { "index": { "number_of_replicas": "0", diff --git a/test/functional/fixtures/es_archiver/invalid_scripted_field/mappings.json b/test/functional/fixtures/es_archiver/invalid_scripted_field/mappings.json index 0024c6943ed1c0..63cc283f96d328 100644 --- a/test/functional/fixtures/es_archiver/invalid_scripted_field/mappings.json +++ b/test/functional/fixtures/es_archiver/invalid_scripted_field/mappings.json @@ -1,7 +1,10 @@ { "type": "index", "value": { - "index": ".kibana", + "aliases": { + ".kibana": {} + }, + "index": ".kibana_1", "mappings": { "dynamic": "strict", "properties": { diff --git a/test/functional/fixtures/es_archiver/management/mappings.json b/test/functional/fixtures/es_archiver/management/mappings.json index a89fe1dfacfc83..45b2508d380330 100644 --- a/test/functional/fixtures/es_archiver/management/mappings.json +++ b/test/functional/fixtures/es_archiver/management/mappings.json @@ -1,7 +1,10 @@ { "type": "index", "value": { - "index": ".kibana", + "aliases": { + ".kibana": {} + }, + "index": ".kibana_1", "mappings": { "properties": { "config": { diff --git a/test/functional/fixtures/es_archiver/mgmt/mappings.json b/test/functional/fixtures/es_archiver/mgmt/mappings.json index 28198102d3d686..aefbd9d0ccc8a8 100644 --- a/test/functional/fixtures/es_archiver/mgmt/mappings.json +++ b/test/functional/fixtures/es_archiver/mgmt/mappings.json @@ -2,8 +2,9 @@ "type": "index", "value": { "aliases": { + ".kibana": {} }, - "index": ".kibana", + "index": ".kibana_1", "mappings": { "dynamic": "strict", "properties": { diff --git a/test/functional/fixtures/es_archiver/saved_objects_imports/mappings.json b/test/functional/fixtures/es_archiver/saved_objects_imports/mappings.json index a89fe1dfacfc83..45b2508d380330 100644 --- a/test/functional/fixtures/es_archiver/saved_objects_imports/mappings.json +++ b/test/functional/fixtures/es_archiver/saved_objects_imports/mappings.json @@ -1,7 +1,10 @@ { "type": "index", "value": { - "index": ".kibana", + "aliases": { + ".kibana": {} + }, + "index": ".kibana_1", "mappings": { "properties": { "config": { diff --git a/test/functional/fixtures/es_archiver/saved_objects_management/edit_saved_object/mappings.json b/test/functional/fixtures/es_archiver/saved_objects_management/edit_saved_object/mappings.json index 6a416126d7f263..05ca4d8e8307e5 100644 --- a/test/functional/fixtures/es_archiver/saved_objects_management/edit_saved_object/mappings.json +++ b/test/functional/fixtures/es_archiver/saved_objects_management/edit_saved_object/mappings.json @@ -1,7 +1,10 @@ { "type": "index", "value": { - "index": ".kibana", + "aliases": { + ".kibana": {} + }, + "index": ".kibana_1", "settings": { "index": { "number_of_shards": "1", diff --git a/test/functional/fixtures/es_archiver/saved_objects_management/export_transform/mappings.json b/test/functional/fixtures/es_archiver/saved_objects_management/export_transform/mappings.json index 43b851e817fa81..653e6399548135 100644 --- a/test/functional/fixtures/es_archiver/saved_objects_management/export_transform/mappings.json +++ b/test/functional/fixtures/es_archiver/saved_objects_management/export_transform/mappings.json @@ -1,7 +1,10 @@ { "type": "index", "value": { - "index": ".kibana", + "aliases": { + ".kibana": {} + }, + "index": ".kibana_1", "settings": { "index": { "number_of_shards": "1", diff --git a/test/functional/fixtures/es_archiver/saved_objects_management/hidden_saved_objects/mappings.json b/test/functional/fixtures/es_archiver/saved_objects_management/hidden_saved_objects/mappings.json index 1de768d290d35d..a158deb527cc83 100644 --- a/test/functional/fixtures/es_archiver/saved_objects_management/hidden_saved_objects/mappings.json +++ b/test/functional/fixtures/es_archiver/saved_objects_management/hidden_saved_objects/mappings.json @@ -1,7 +1,10 @@ { "type": "index", "value": { - "index": ".kibana", + "aliases": { + ".kibana": {} + }, + "index": ".kibana_1", "settings": { "index": { "number_of_shards": "1", diff --git a/test/functional/fixtures/es_archiver/saved_objects_management/hidden_types/mappings.json b/test/functional/fixtures/es_archiver/saved_objects_management/hidden_types/mappings.json index a9abae009cb59b..61763f55c1b6a6 100644 --- a/test/functional/fixtures/es_archiver/saved_objects_management/hidden_types/mappings.json +++ b/test/functional/fixtures/es_archiver/saved_objects_management/hidden_types/mappings.json @@ -1,7 +1,10 @@ { "type": "index", "value": { - "index": ".kibana", + "aliases": { + ".kibana": {} + }, + "index": ".kibana_1", "settings": { "index": { "number_of_shards": "1", diff --git a/test/functional/fixtures/es_archiver/saved_objects_management/nested_export_transform/mappings.json b/test/functional/fixtures/es_archiver/saved_objects_management/nested_export_transform/mappings.json index 43b851e817fa81..653e6399548135 100644 --- a/test/functional/fixtures/es_archiver/saved_objects_management/nested_export_transform/mappings.json +++ b/test/functional/fixtures/es_archiver/saved_objects_management/nested_export_transform/mappings.json @@ -1,7 +1,10 @@ { "type": "index", "value": { - "index": ".kibana", + "aliases": { + ".kibana": {} + }, + "index": ".kibana_1", "settings": { "index": { "number_of_shards": "1", diff --git a/test/functional/fixtures/es_archiver/saved_objects_management/show_relationships/mappings.json b/test/functional/fixtures/es_archiver/saved_objects_management/show_relationships/mappings.json index a5478a5805d501..aba581867bb8a9 100644 --- a/test/functional/fixtures/es_archiver/saved_objects_management/show_relationships/mappings.json +++ b/test/functional/fixtures/es_archiver/saved_objects_management/show_relationships/mappings.json @@ -1,7 +1,10 @@ { "type": "index", "value": { - "index": ".kibana", + "aliases": { + ".kibana": {} + }, + "index": ".kibana_1", "settings": { "index": { "number_of_shards": "1", diff --git a/test/functional/fixtures/es_archiver/timelion/mappings.json b/test/functional/fixtures/es_archiver/timelion/mappings.json index a89fe1dfacfc83..45b2508d380330 100644 --- a/test/functional/fixtures/es_archiver/timelion/mappings.json +++ b/test/functional/fixtures/es_archiver/timelion/mappings.json @@ -1,7 +1,10 @@ { "type": "index", "value": { - "index": ".kibana", + "aliases": { + ".kibana": {} + }, + "index": ".kibana_1", "mappings": { "properties": { "config": { diff --git a/test/functional/fixtures/es_archiver/visualize/mappings.json b/test/functional/fixtures/es_archiver/visualize/mappings.json index 464f6751eac5ca..59ec24853e2270 100644 --- a/test/functional/fixtures/es_archiver/visualize/mappings.json +++ b/test/functional/fixtures/es_archiver/visualize/mappings.json @@ -1,7 +1,10 @@ { "type": "index", "value": { - "index": ".kibana", + "aliases": { + ".kibana": {} + }, + "index": ".kibana_1", "mappings": { "properties": { "config": { diff --git a/test/functional/fixtures/es_archiver/visualize_embedding/mappings.json b/test/functional/fixtures/es_archiver/visualize_embedding/mappings.json index a89fe1dfacfc83..45b2508d380330 100644 --- a/test/functional/fixtures/es_archiver/visualize_embedding/mappings.json +++ b/test/functional/fixtures/es_archiver/visualize_embedding/mappings.json @@ -1,7 +1,10 @@ { "type": "index", "value": { - "index": ".kibana", + "aliases": { + ".kibana": {} + }, + "index": ".kibana_1", "mappings": { "properties": { "config": { diff --git a/test/functional/fixtures/es_archiver/visualize_source-filters/mappings.json b/test/functional/fixtures/es_archiver/visualize_source-filters/mappings.json index a89fe1dfacfc83..45b2508d380330 100644 --- a/test/functional/fixtures/es_archiver/visualize_source-filters/mappings.json +++ b/test/functional/fixtures/es_archiver/visualize_source-filters/mappings.json @@ -1,7 +1,10 @@ { "type": "index", "value": { - "index": ".kibana", + "aliases": { + ".kibana": {} + }, + "index": ".kibana_1", "mappings": { "properties": { "config": { diff --git a/test/functional/fixtures/es_archiver/visualize_source_filters/mappings.json b/test/functional/fixtures/es_archiver/visualize_source_filters/mappings.json index 0f17621dbf5291..5ac113e7e4b743 100644 --- a/test/functional/fixtures/es_archiver/visualize_source_filters/mappings.json +++ b/test/functional/fixtures/es_archiver/visualize_source_filters/mappings.json @@ -1,7 +1,10 @@ { "type": "index", "value": { - "index": ".kibana", + "aliases": { + ".kibana": {} + }, + "index": ".kibana_1", "mappings": { "properties": { "config": { diff --git a/test/functional/page_objects/common_page.ts b/test/functional/page_objects/common_page.ts index bc60b8ce5f19c2..49d56d6f437847 100644 --- a/test/functional/page_objects/common_page.ts +++ b/test/functional/page_objects/common_page.ts @@ -11,470 +11,465 @@ import expect from '@kbn/expect'; // @ts-ignore import fetch from 'node-fetch'; import { getUrl } from '@kbn/test'; -import { FtrProviderContext } from '../ftr_provider_context'; - -export function CommonPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const log = getService('log'); - const config = getService('config'); - const browser = getService('browser'); - const retry = getService('retry'); - const find = getService('find'); - const globalNav = getService('globalNav'); - const testSubjects = getService('testSubjects'); - const PageObjects = getPageObjects(['login']); - - const defaultTryTimeout = config.get('timeouts.try'); - const defaultFindTimeout = config.get('timeouts.find'); - - interface NavigateProps { - appConfig: {}; - ensureCurrentUrl: boolean; - shouldLoginIfPrompted: boolean; - useActualUrl: boolean; - insertTimestamp: boolean; - } - - class CommonPage { - /** - * Logins to Kibana as default user and navigates to provided app - * @param appUrl Kibana URL - */ - private async loginIfPrompted(appUrl: string, insertTimestamp: boolean) { - // Disable the welcome screen. This is relevant for environments - // which don't allow to use the yml setting, e.g. cloud production. - // It is done here so it applies to logins but also to a login re-use. - await browser.setLocalStorageItem('home:welcome:show', 'false'); - - let currentUrl = await browser.getCurrentUrl(); - log.debug(`currentUrl = ${currentUrl}\n appUrl = ${appUrl}`); - await testSubjects.find('kibanaChrome', 6 * defaultFindTimeout); // 60 sec waiting - const loginPage = currentUrl.includes('/login'); - const wantedLoginPage = appUrl.includes('/login') || appUrl.includes('/logout'); - - if (loginPage && !wantedLoginPage) { - log.debug('Found login page'); - if (config.get('security.disableTestUser')) { - await PageObjects.login.login( - config.get('servers.kibana.username'), - config.get('servers.kibana.password') - ); - } else { - await PageObjects.login.login('test_user', 'changeme'); - } - - await find.byCssSelector( - '[data-test-subj="kibanaChrome"] nav:not(.ng-hide)', - 6 * defaultFindTimeout +import { FtrService } from '../ftr_provider_context'; + +interface NavigateProps { + appConfig: {}; + ensureCurrentUrl: boolean; + shouldLoginIfPrompted: boolean; + useActualUrl: boolean; + insertTimestamp: boolean; +} +export class CommonPageObject extends FtrService { + private readonly log = this.ctx.getService('log'); + private readonly config = this.ctx.getService('config'); + private readonly browser = this.ctx.getService('browser'); + private readonly retry = this.ctx.getService('retry'); + private readonly find = this.ctx.getService('find'); + private readonly globalNav = this.ctx.getService('globalNav'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly loginPage = this.ctx.getPageObject('login'); + + private readonly defaultTryTimeout = this.config.get('timeouts.try'); + private readonly defaultFindTimeout = this.config.get('timeouts.find'); + + /** + * Logins to Kibana as default user and navigates to provided app + * @param appUrl Kibana URL + */ + private async loginIfPrompted(appUrl: string, insertTimestamp: boolean) { + // Disable the welcome screen. This is relevant for environments + // which don't allow to use the yml setting, e.g. cloud production. + // It is done here so it applies to logins but also to a login re-use. + await this.browser.setLocalStorageItem('home:welcome:show', 'false'); + + let currentUrl = await this.browser.getCurrentUrl(); + this.log.debug(`currentUrl = ${currentUrl}\n appUrl = ${appUrl}`); + await this.testSubjects.find('kibanaChrome', 6 * this.defaultFindTimeout); // 60 sec waiting + const loginPage = currentUrl.includes('/login'); + const wantedLoginPage = appUrl.includes('/login') || appUrl.includes('/logout'); + + if (loginPage && !wantedLoginPage) { + this.log.debug('Found login page'); + if (this.config.get('security.disableTestUser')) { + await this.loginPage.login( + this.config.get('servers.kibana.username'), + this.config.get('servers.kibana.password') ); - await browser.get(appUrl, insertTimestamp); - currentUrl = await browser.getCurrentUrl(); - log.debug(`Finished login process currentUrl = ${currentUrl}`); + } else { + await this.loginPage.login('test_user', 'changeme'); } - return currentUrl; - } - private async navigate(navigateProps: NavigateProps) { - const { - appConfig, - ensureCurrentUrl, - shouldLoginIfPrompted, - useActualUrl, - insertTimestamp, - } = navigateProps; - const appUrl = getUrl.noAuth(config.get('servers.kibana'), appConfig); - - await retry.try(async () => { - if (useActualUrl) { - log.debug(`navigateToActualUrl ${appUrl}`); - await browser.get(appUrl); - } else { - log.debug(`navigateToUrl ${appUrl}`); - await browser.get(appUrl, insertTimestamp); - } + await this.find.byCssSelector( + '[data-test-subj="kibanaChrome"] nav:not(.ng-hide)', + 6 * this.defaultFindTimeout + ); + await this.browser.get(appUrl, insertTimestamp); + currentUrl = await this.browser.getCurrentUrl(); + this.log.debug(`Finished login process currentUrl = ${currentUrl}`); + } + return currentUrl; + } - // accept alert if it pops up - const alert = await browser.getAlert(); - await alert?.accept(); + private async navigate(navigateProps: NavigateProps) { + const { + appConfig, + ensureCurrentUrl, + shouldLoginIfPrompted, + useActualUrl, + insertTimestamp, + } = navigateProps; + const appUrl = getUrl.noAuth(this.config.get('servers.kibana'), appConfig); + + await this.retry.try(async () => { + if (useActualUrl) { + this.log.debug(`navigateToActualUrl ${appUrl}`); + await this.browser.get(appUrl); + } else { + this.log.debug(`navigateToUrl ${appUrl}`); + await this.browser.get(appUrl, insertTimestamp); + } - const currentUrl = shouldLoginIfPrompted - ? await this.loginIfPrompted(appUrl, insertTimestamp) - : await browser.getCurrentUrl(); + // accept alert if it pops up + const alert = await this.browser.getAlert(); + await alert?.accept(); - if (ensureCurrentUrl && !currentUrl.includes(appUrl)) { - throw new Error(`expected ${currentUrl}.includes(${appUrl})`); - } - }); - } + const currentUrl = shouldLoginIfPrompted + ? await this.loginIfPrompted(appUrl, insertTimestamp) + : await this.browser.getCurrentUrl(); - /** - * Navigates browser using the pathname from the appConfig and subUrl as the hash - * @param appName As defined in the apps config, e.g. 'home' - * @param subUrl The route after the hash (#), e.g. '/tutorial_directory/sampleData' - * @param args additional arguments - */ - public async navigateToUrl( - appName: string, - subUrl?: string, - { - basePath = '', - ensureCurrentUrl = true, - shouldLoginIfPrompted = true, - useActualUrl = false, - insertTimestamp = true, - shouldUseHashForSubUrl = true, - } = {} - ) { - const appConfig: { pathname: string; hash?: string } = { - pathname: `${basePath}${config.get(['apps', appName]).pathname}`, - }; - - if (shouldUseHashForSubUrl) { - appConfig.hash = useActualUrl ? subUrl : `/${appName}/${subUrl}`; - } else { - appConfig.pathname += `/${subUrl}`; + if (ensureCurrentUrl && !currentUrl.includes(appUrl)) { + throw new Error(`expected ${currentUrl}.includes(${appUrl})`); } + }); + } - await this.navigate({ - appConfig, - ensureCurrentUrl, - shouldLoginIfPrompted, - useActualUrl, - insertTimestamp, - }); + /** + * Navigates browser using the pathname from the appConfig and subUrl as the hash + * @param appName As defined in the apps config, e.g. 'home' + * @param subUrl The route after the hash (#), e.g. '/tutorial_directory/sampleData' + * @param args additional arguments + */ + public async navigateToUrl( + appName: string, + subUrl?: string, + { + basePath = '', + ensureCurrentUrl = true, + shouldLoginIfPrompted = true, + useActualUrl = false, + insertTimestamp = true, + shouldUseHashForSubUrl = true, + } = {} + ) { + const appConfig: { pathname: string; hash?: string } = { + pathname: `${basePath}${this.config.get(['apps', appName]).pathname}`, + }; + + if (shouldUseHashForSubUrl) { + appConfig.hash = useActualUrl ? subUrl : `/${appName}/${subUrl}`; + } else { + appConfig.pathname += `/${subUrl}`; } - /** - * Navigates browser using the pathname from the appConfig and subUrl as the extended path. - * This was added to be able to test an application that uses browser history over hash history. - * @param appName As defined in the apps config, e.g. 'home' - * @param subUrl The route after the appUrl, e.g. '/tutorial_directory/sampleData' - * @param args additional arguments - */ - public async navigateToUrlWithBrowserHistory( - appName: string, - subUrl?: string, - search?: string, - { - basePath = '', - ensureCurrentUrl = true, - shouldLoginIfPrompted = true, - useActualUrl = true, - insertTimestamp = true, - } = {} - ) { - const appConfig = { - // subUrl following the basePath, assumes no hashes. Ex: 'app/endpoint/management' - pathname: `${basePath}${config.get(['apps', appName]).pathname}${subUrl}`, - search, - }; - - await this.navigate({ - appConfig, - ensureCurrentUrl, - shouldLoginIfPrompted, - useActualUrl, - insertTimestamp, - }); - } + await this.navigate({ + appConfig, + ensureCurrentUrl, + shouldLoginIfPrompted, + useActualUrl, + insertTimestamp, + }); + } - /** - * Navigates browser using only the pathname from the appConfig - * @param appName As defined in the apps config, e.g. 'kibana' - * @param hash The route after the hash (#), e.g. 'management/kibana/settings' - * @param args additional arguments - */ - async navigateToActualUrl( - appName: string, - hash?: string, - { basePath = '', ensureCurrentUrl = true, shouldLoginIfPrompted = true } = {} - ) { - await this.navigateToUrl(appName, hash, { - basePath, - ensureCurrentUrl, - shouldLoginIfPrompted, - useActualUrl: true, - }); - } + /** + * Navigates browser using the pathname from the appConfig and subUrl as the extended path. + * This was added to be able to test an application that uses browser history over hash history. + * @param appName As defined in the apps config, e.g. 'home' + * @param subUrl The route after the appUrl, e.g. '/tutorial_directory/sampleData' + * @param args additional arguments + */ + public async navigateToUrlWithBrowserHistory( + appName: string, + subUrl?: string, + search?: string, + { + basePath = '', + ensureCurrentUrl = true, + shouldLoginIfPrompted = true, + useActualUrl = true, + insertTimestamp = true, + } = {} + ) { + const appConfig = { + // subUrl following the basePath, assumes no hashes. Ex: 'app/endpoint/management' + pathname: `${basePath}${this.config.get(['apps', appName]).pathname}${subUrl}`, + search, + }; + + await this.navigate({ + appConfig, + ensureCurrentUrl, + shouldLoginIfPrompted, + useActualUrl, + insertTimestamp, + }); + } - async sleep(sleepMilliseconds: number) { - log.debug(`... sleep(${sleepMilliseconds}) start`); - await delay(sleepMilliseconds); - log.debug(`... sleep(${sleepMilliseconds}) end`); - } + /** + * Navigates browser using only the pathname from the appConfig + * @param appName As defined in the apps config, e.g. 'kibana' + * @param hash The route after the hash (#), e.g. 'management/kibana/settings' + * @param args additional arguments + */ + async navigateToActualUrl( + appName: string, + hash?: string, + { basePath = '', ensureCurrentUrl = true, shouldLoginIfPrompted = true } = {} + ) { + await this.navigateToUrl(appName, hash, { + basePath, + ensureCurrentUrl, + shouldLoginIfPrompted, + useActualUrl: true, + }); + } - async navigateToApp( - appName: string, - { basePath = '', shouldLoginIfPrompted = true, hash = '', insertTimestamp = true } = {} - ) { - let appUrl: string; - if (config.has(['apps', appName])) { - // Legacy applications - const appConfig = config.get(['apps', appName]); - appUrl = getUrl.noAuth(config.get('servers.kibana'), { - pathname: `${basePath}${appConfig.pathname}`, - hash: hash || appConfig.hash, - }); - } else { - appUrl = getUrl.noAuth(config.get('servers.kibana'), { - pathname: `${basePath}/app/${appName}`, - hash, - }); - } + async sleep(sleepMilliseconds: number) { + this.log.debug(`... sleep(${sleepMilliseconds}) start`); + await delay(sleepMilliseconds); + this.log.debug(`... sleep(${sleepMilliseconds}) end`); + } - log.debug('navigating to ' + appName + ' url: ' + appUrl); - - await retry.tryForTime(defaultTryTimeout * 2, async () => { - let lastUrl = await retry.try(async () => { - // since we're using hash URLs, always reload first to force re-render - log.debug('navigate to: ' + appUrl); - await browser.get(appUrl, insertTimestamp); - // accept alert if it pops up - const alert = await browser.getAlert(); - await alert?.accept(); - await this.sleep(700); - log.debug('returned from get, calling refresh'); - await browser.refresh(); - let currentUrl = shouldLoginIfPrompted - ? await this.loginIfPrompted(appUrl, insertTimestamp) - : await browser.getCurrentUrl(); - - if (currentUrl.includes('app/kibana')) { - await testSubjects.find('kibanaChrome'); - } - - currentUrl = (await browser.getCurrentUrl()).replace(/\/\/\w+:\w+@/, '//'); - - const navSuccessful = currentUrl - .replace(':80/', '/') - .replace(':443/', '/') - .startsWith(appUrl); - - if (!navSuccessful) { - const msg = `App failed to load: ${appName} in ${defaultFindTimeout}ms appUrl=${appUrl} currentUrl=${currentUrl}`; - log.debug(msg); - throw new Error(msg); - } - return currentUrl; - }); - - await retry.tryForTime(defaultFindTimeout, async () => { - await this.sleep(501); - const currentUrl = await browser.getCurrentUrl(); - log.debug('in navigateTo url = ' + currentUrl); - if (lastUrl !== currentUrl) { - lastUrl = currentUrl; - throw new Error('URL changed, waiting for it to settle'); - } - }); + async navigateToApp( + appName: string, + { basePath = '', shouldLoginIfPrompted = true, hash = '', insertTimestamp = true } = {} + ) { + let appUrl: string; + if (this.config.has(['apps', appName])) { + // Legacy applications + const appConfig = this.config.get(['apps', appName]); + appUrl = getUrl.noAuth(this.config.get('servers.kibana'), { + pathname: `${basePath}${appConfig.pathname}`, + hash: hash || appConfig.hash, + }); + } else { + appUrl = getUrl.noAuth(this.config.get('servers.kibana'), { + pathname: `${basePath}/app/${appName}`, + hash, }); } - async waitUntilUrlIncludes(path: string) { - await retry.try(async () => { - const url = await browser.getCurrentUrl(); - if (!url.includes(path)) { - throw new Error('Url not found'); + this.log.debug('navigating to ' + appName + ' url: ' + appUrl); + + await this.retry.tryForTime(this.defaultTryTimeout * 2, async () => { + let lastUrl = await this.retry.try(async () => { + // since we're using hash URLs, always reload first to force re-render + this.log.debug('navigate to: ' + appUrl); + await this.browser.get(appUrl, insertTimestamp); + // accept alert if it pops up + const alert = await this.browser.getAlert(); + await alert?.accept(); + await this.sleep(700); + this.log.debug('returned from get, calling refresh'); + await this.browser.refresh(); + let currentUrl = shouldLoginIfPrompted + ? await this.loginIfPrompted(appUrl, insertTimestamp) + : await this.browser.getCurrentUrl(); + + if (currentUrl.includes('app/kibana')) { + await this.testSubjects.find('kibanaChrome'); } - }); - } - async getSharedItemTitleAndDescription() { - const cssSelector = '[data-shared-item][data-title][data-description]'; - const element = await find.byCssSelector(cssSelector); + currentUrl = (await this.browser.getCurrentUrl()).replace(/\/\/\w+:\w+@/, '//'); - return { - title: await element.getAttribute('data-title'), - description: await element.getAttribute('data-description'), - }; - } + const navSuccessful = currentUrl + .replace(':80/', '/') + .replace(':443/', '/') + .startsWith(appUrl); - async getSharedItemContainers() { - const cssSelector = '[data-shared-items-container]'; - return find.allByCssSelector(cssSelector); - } + if (!navSuccessful) { + const msg = `App failed to load: ${appName} in ${this.defaultFindTimeout}ms appUrl=${appUrl} currentUrl=${currentUrl}`; + this.log.debug(msg); + throw new Error(msg); + } + return currentUrl; + }); - async ensureModalOverlayHidden() { - return retry.try(async () => { - const shown = await testSubjects.exists('confirmModalTitleText'); - if (shown) { - throw new Error('Modal overlay is showing'); + await this.retry.tryForTime(this.defaultFindTimeout, async () => { + await this.sleep(501); + const currentUrl = await this.browser.getCurrentUrl(); + this.log.debug('in navigateTo url = ' + currentUrl); + if (lastUrl !== currentUrl) { + lastUrl = currentUrl; + throw new Error('URL changed, waiting for it to settle'); } }); - } + }); + } - async clickConfirmOnModal(ensureHidden = true) { - log.debug('Clicking modal confirm'); - // make sure this data-test-subj 'confirmModalTitleText' exists because we're going to wait for it to be gone later - await testSubjects.exists('confirmModalTitleText'); - await testSubjects.click('confirmModalConfirmButton'); - if (ensureHidden) { - await this.ensureModalOverlayHidden(); + async waitUntilUrlIncludes(path: string) { + await this.retry.try(async () => { + const url = await this.browser.getCurrentUrl(); + if (!url.includes(path)) { + throw new Error('Url not found'); } - } + }); + } - async pressEnterKey() { - await browser.pressKeys(browser.keys.ENTER); - } + async getSharedItemTitleAndDescription() { + const cssSelector = '[data-shared-item][data-title][data-description]'; + const element = await this.find.byCssSelector(cssSelector); - async pressTabKey() { - await browser.pressKeys(browser.keys.TAB); - } + return { + title: await element.getAttribute('data-title'), + description: await element.getAttribute('data-description'), + }; + } - // Pause the browser at a certain place for debugging - // Not meant for usage in CI, only for dev-usage - async pause() { - return browser.pause(); - } + async getSharedItemContainers() { + const cssSelector = '[data-shared-items-container]'; + return this.find.allByCssSelector(cssSelector); + } - /** - * Clicks cancel button on modal - * @param overlayWillStay pass in true if your test will show multiple modals in succession - */ - async clickCancelOnModal(overlayWillStay = true) { - log.debug('Clicking modal cancel'); - await testSubjects.click('confirmModalCancelButton'); - if (!overlayWillStay) { - await this.ensureModalOverlayHidden(); + async ensureModalOverlayHidden() { + return this.retry.try(async () => { + const shown = await this.testSubjects.exists('confirmModalTitleText'); + if (shown) { + throw new Error('Modal overlay is showing'); } - } + }); + } - async expectConfirmModalOpenState(state: boolean) { - log.debug(`expectConfirmModalOpenState(${state})`); - // we use retry here instead of a simple .exists() check because the modal - // fades in/out, which takes time, and we really only care that at some point - // the modal is either open or closed - await retry.try(async () => { - const actualState = await testSubjects.exists('confirmModalCancelButton'); - expect(actualState).to.equal( - state, - state ? 'Confirm modal should be present' : 'Confirm modal should be hidden' - ); - }); + async clickConfirmOnModal(ensureHidden = true) { + this.log.debug('Clicking modal confirm'); + // make sure this data-test-subj 'confirmModalTitleText' exists because we're going to wait for it to be gone later + await this.testSubjects.exists('confirmModalTitleText'); + await this.testSubjects.click('confirmModalConfirmButton'); + if (ensureHidden) { + await this.ensureModalOverlayHidden(); } + } - async isChromeVisible() { - const globalNavShown = await globalNav.exists(); - return globalNavShown; - } + async pressEnterKey() { + await this.browser.pressKeys(this.browser.keys.ENTER); + } - async isChromeHidden() { - const globalNavShown = await globalNav.exists(); - return !globalNavShown; - } + async pressTabKey() { + await this.browser.pressKeys(this.browser.keys.TAB); + } - async waitForTopNavToBeVisible() { - await retry.try(async () => { - const isNavVisible = await testSubjects.exists('top-nav'); - if (!isNavVisible) { - throw new Error('Local nav not visible yet'); - } - }); + // Pause the browser at a certain place for debugging + // Not meant for usage in CI, only for dev-usage + async pause() { + return this.browser.pause(); + } + + /** + * Clicks cancel button on modal + * @param overlayWillStay pass in true if your test will show multiple modals in succession + */ + async clickCancelOnModal(overlayWillStay = true) { + this.log.debug('Clicking modal cancel'); + await this.testSubjects.click('confirmModalCancelButton'); + if (!overlayWillStay) { + await this.ensureModalOverlayHidden(); } + } - async closeToast() { - const toast = await find.byCssSelector('.euiToast', 6 * defaultFindTimeout); - await toast.moveMouseTo(); - const title = await (await find.byCssSelector('.euiToastHeader__title')).getVisibleText(); + async expectConfirmModalOpenState(state: boolean) { + this.log.debug(`expectConfirmModalOpenState(${state})`); + // we use retry here instead of a simple .exists() check because the modal + // fades in/out, which takes time, and we really only care that at some point + // the modal is either open or closed + await this.retry.try(async () => { + const actualState = await this.testSubjects.exists('confirmModalCancelButton'); + expect(actualState).to.equal( + state, + state ? 'Confirm modal should be present' : 'Confirm modal should be hidden' + ); + }); + } - await find.clickByCssSelector('.euiToast__closeButton'); - return title; - } + async isChromeVisible() { + const globalNavShown = await this.globalNav.exists(); + return globalNavShown; + } - async closeToastIfExists() { - const toastShown = await find.existsByCssSelector('.euiToast'); - if (toastShown) { - try { - await find.clickByCssSelector('.euiToast__closeButton'); - } catch (err) { - // ignore errors, toast clear themselves after timeout - } - } - } + async isChromeHidden() { + const globalNavShown = await this.globalNav.exists(); + return !globalNavShown; + } - async clearAllToasts() { - const toasts = await find.allByCssSelector('.euiToast'); - for (const toastElement of toasts) { - try { - await toastElement.moveMouseTo(); - const closeBtn = await toastElement.findByCssSelector('.euiToast__closeButton'); - await closeBtn.click(); - } catch (err) { - // ignore errors, toast clear themselves after timeout - } + async waitForTopNavToBeVisible() { + await this.retry.try(async () => { + const isNavVisible = await this.testSubjects.exists('top-nav'); + if (!isNavVisible) { + throw new Error('Local nav not visible yet'); } - } + }); + } - async getJsonBodyText() { - if (await find.existsByCssSelector('a[id=rawdata-tab]', defaultFindTimeout)) { - // Firefox has 3 tabs and requires navigation to see Raw output - await find.clickByCssSelector('a[id=rawdata-tab]'); - } - const msgElements = await find.allByCssSelector('body pre'); - if (msgElements.length > 0) { - return await msgElements[0].getVisibleText(); - } else { - // Sometimes Firefox renders Timelion page without tabs and with div#json - const jsonElement = await find.byCssSelector('body div#json'); - return await jsonElement.getVisibleText(); + async closeToast() { + const toast = await this.find.byCssSelector('.euiToast', 6 * this.defaultFindTimeout); + await toast.moveMouseTo(); + const title = await (await this.find.byCssSelector('.euiToastHeader__title')).getVisibleText(); + + await this.find.clickByCssSelector('.euiToast__closeButton'); + return title; + } + + async closeToastIfExists() { + const toastShown = await this.find.existsByCssSelector('.euiToast'); + if (toastShown) { + try { + await this.find.clickByCssSelector('.euiToast__closeButton'); + } catch (err) { + // ignore errors, toast clear themselves after timeout } } + } - async getBodyText() { - const body = await find.byCssSelector('body'); - return await body.getVisibleText(); + async clearAllToasts() { + const toasts = await this.find.allByCssSelector('.euiToast'); + for (const toastElement of toasts) { + try { + await toastElement.moveMouseTo(); + const closeBtn = await toastElement.findByCssSelector('.euiToast__closeButton'); + await closeBtn.click(); + } catch (err) { + // ignore errors, toast clear themselves after timeout + } } + } - async waitForSaveModalToClose() { - log.debug('Waiting for save modal to close'); - await retry.try(async () => { - if (await testSubjects.exists('savedObjectSaveModal')) { - throw new Error('save modal still open'); - } - }); + async getJsonBodyText() { + if (await this.find.existsByCssSelector('a[id=rawdata-tab]', this.defaultFindTimeout)) { + // Firefox has 3 tabs and requires navigation to see Raw output + await this.find.clickByCssSelector('a[id=rawdata-tab]'); } - - async setFileInputPath(path: string) { - log.debug(`Setting the path '${path}' on the file input`); - const input = await find.byCssSelector('.euiFilePicker__input'); - await input.type(path); + const msgElements = await this.find.allByCssSelector('body pre'); + if (msgElements.length > 0) { + return await msgElements[0].getVisibleText(); + } else { + // Sometimes Firefox renders Timelion page without tabs and with div#json + const jsonElement = await this.find.byCssSelector('body div#json'); + return await jsonElement.getVisibleText(); } + } - async scrollKibanaBodyTop() { - await browser.setScrollToById('kibana-body', 0, 0); - } + async getBodyText() { + const body = await this.find.byCssSelector('body'); + return await body.getVisibleText(); + } - /** - * Dismiss Banner if available. - */ - async dismissBanner() { - if (await testSubjects.exists('global-banner-item')) { - const button = await find.byButtonText('Dismiss'); - await button.click(); + async waitForSaveModalToClose() { + this.log.debug('Waiting for save modal to close'); + await this.retry.try(async () => { + if (await this.testSubjects.exists('savedObjectSaveModal')) { + throw new Error('save modal still open'); } - } + }); + } - /** - * Get visible text of the Welcome Banner - */ - async getWelcomeText() { - return await testSubjects.getVisibleText('global-banner-item'); - } + async setFileInputPath(path: string) { + this.log.debug(`Setting the path '${path}' on the file input`); + const input = await this.find.byCssSelector('.euiFilePicker__input'); + await input.type(path); + } + + async scrollKibanaBodyTop() { + await this.browser.setScrollToById('kibana-body', 0, 0); + } - /** - * Clicks on an element, and validates that the desired effect has taken place - * by confirming the existence of a validator - */ - async clickAndValidate( - clickTarget: string, - validator: string, - isValidatorCssString: boolean = false, - topOffset?: number - ) { - await testSubjects.click(clickTarget, undefined, topOffset); - const validate = isValidatorCssString ? find.byCssSelector : testSubjects.exists; - await validate(validator); + /** + * Dismiss Banner if available. + */ + async dismissBanner() { + if (await this.testSubjects.exists('global-banner-item')) { + const button = await this.find.byButtonText('Dismiss'); + await button.click(); } } - return new CommonPage(); + /** + * Get visible text of the Welcome Banner + */ + async getWelcomeText() { + return await this.testSubjects.getVisibleText('global-banner-item'); + } + + /** + * Clicks on an element, and validates that the desired effect has taken place + * by confirming the existence of a validator + */ + async clickAndValidate( + clickTarget: string, + validator: string, + isValidatorCssString: boolean = false, + topOffset?: number + ) { + await this.testSubjects.click(clickTarget, undefined, topOffset); + const validate = isValidatorCssString ? this.find.byCssSelector : this.testSubjects.exists; + await validate(validator); + } } diff --git a/test/functional/page_objects/console_page.ts b/test/functional/page_objects/console_page.ts index 6fb554e6d34a0c..77c87f6066e854 100644 --- a/test/functional/page_objects/console_page.ts +++ b/test/functional/page_objects/console_page.ts @@ -7,102 +7,98 @@ */ import { Key } from 'selenium-webdriver'; -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; import { WebElementWrapper } from '../services/lib/web_element_wrapper'; -export function ConsolePageProvider({ getService }: FtrProviderContext) { - const testSubjects = getService('testSubjects'); - const retry = getService('retry'); - const find = getService('find'); +export class ConsolePageObject extends FtrService { + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly retry = this.ctx.getService('retry'); + private readonly find = this.ctx.getService('find'); - class ConsolePage { - public async getVisibleTextFromAceEditor(editor: WebElementWrapper) { - const lines = await editor.findAllByClassName('ace_line_group'); - const linesText = await Promise.all(lines.map(async (line) => await line.getVisibleText())); - return linesText.join('\n'); - } + public async getVisibleTextFromAceEditor(editor: WebElementWrapper) { + const lines = await editor.findAllByClassName('ace_line_group'); + const linesText = await Promise.all(lines.map(async (line) => await line.getVisibleText())); + return linesText.join('\n'); + } - public async getRequestEditor() { - return await testSubjects.find('request-editor'); - } + public async getRequestEditor() { + return await this.testSubjects.find('request-editor'); + } - public async getRequest() { - const requestEditor = await this.getRequestEditor(); - return await this.getVisibleTextFromAceEditor(requestEditor); - } + public async getRequest() { + const requestEditor = await this.getRequestEditor(); + return await this.getVisibleTextFromAceEditor(requestEditor); + } - public async getResponse() { - const responseEditor = await testSubjects.find('response-editor'); - return await this.getVisibleTextFromAceEditor(responseEditor); - } + public async getResponse() { + const responseEditor = await this.testSubjects.find('response-editor'); + return await this.getVisibleTextFromAceEditor(responseEditor); + } - public async clickPlay() { - await testSubjects.click('sendRequestButton'); - } + public async clickPlay() { + await this.testSubjects.click('sendRequestButton'); + } - public async collapseHelp() { - await testSubjects.click('help-close-button'); - } + public async collapseHelp() { + await this.testSubjects.click('help-close-button'); + } - public async openSettings() { - await testSubjects.click('consoleSettingsButton'); - } + public async openSettings() { + await this.testSubjects.click('consoleSettingsButton'); + } - public async setFontSizeSetting(newSize: number) { - await this.openSettings(); + public async setFontSizeSetting(newSize: number) { + await this.openSettings(); - // while the settings form opens/loads this may fail, so retry for a while - await retry.try(async () => { - const fontSizeInput = await testSubjects.find('setting-font-size-input'); - await fontSizeInput.clearValue({ withJS: true }); - await fontSizeInput.click(); - await fontSizeInput.type(String(newSize)); - }); + // while the settings form opens/loads this may fail, so retry for a while + await this.retry.try(async () => { + const fontSizeInput = await this.testSubjects.find('setting-font-size-input'); + await fontSizeInput.clearValue({ withJS: true }); + await fontSizeInput.click(); + await fontSizeInput.type(String(newSize)); + }); - await testSubjects.click('settings-save-button'); - } + await this.testSubjects.click('settings-save-button'); + } - public async getFontSize(editor: WebElementWrapper) { - const aceLine = await editor.findByClassName('ace_line'); - return await aceLine.getComputedStyle('font-size'); - } + public async getFontSize(editor: WebElementWrapper) { + const aceLine = await editor.findByClassName('ace_line'); + return await aceLine.getComputedStyle('font-size'); + } - public async getRequestFontSize() { - return await this.getFontSize(await this.getRequestEditor()); - } + public async getRequestFontSize() { + return await this.getFontSize(await this.getRequestEditor()); + } - public async getEditor() { - return testSubjects.find('console-application'); - } + public async getEditor() { + return this.testSubjects.find('console-application'); + } - public async dismissTutorial() { - try { - const closeButton = await testSubjects.find('help-close-button'); - await closeButton.click(); - } catch (e) { - // Ignore because it is probably not there. - } + public async dismissTutorial() { + try { + const closeButton = await this.testSubjects.find('help-close-button'); + await closeButton.click(); + } catch (e) { + // Ignore because it is probably not there. } + } - public async promptAutocomplete() { - // This focusses the cursor on the bottom of the text area - const editor = await this.getEditor(); - const content = await editor.findByCssSelector('.ace_content'); - await content.click(); - const textArea = await testSubjects.find('console-textarea'); - // There should be autocomplete for this on all license levels - await textArea.pressKeys('\nGET s'); - await textArea.pressKeys([Key.CONTROL, Key.SPACE]); - } + public async promptAutocomplete() { + // This focusses the cursor on the bottom of the text area + const editor = await this.getEditor(); + const content = await editor.findByCssSelector('.ace_content'); + await content.click(); + const textArea = await this.testSubjects.find('console-textarea'); + // There should be autocomplete for this on all license levels + await textArea.pressKeys('\nGET s'); + await textArea.pressKeys([Key.CONTROL, Key.SPACE]); + } - public async hasAutocompleter(): Promise { - try { - return Boolean(await find.byCssSelector('.ace_autocomplete')); - } catch (e) { - return false; - } + public async hasAutocompleter(): Promise { + try { + return Boolean(await this.find.byCssSelector('.ace_autocomplete')); + } catch (e) { + return false; } } - - return new ConsolePage(); } diff --git a/test/functional/page_objects/context_page.ts b/test/functional/page_objects/context_page.ts index b758423d9346dd..05ea89cb65b3d0 100644 --- a/test/functional/page_objects/context_page.ts +++ b/test/functional/page_objects/context_page.ts @@ -8,93 +8,91 @@ import rison from 'rison-node'; import { getUrl } from '@kbn/test'; -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; const DEFAULT_INITIAL_STATE = { columns: ['@message'], }; -export function ContextPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const browser = getService('browser'); - const config = getService('config'); - const retry = getService('retry'); - const testSubjects = getService('testSubjects'); - const PageObjects = getPageObjects(['header', 'common']); - const log = getService('log'); +export class ContextPageObject extends FtrService { + private readonly browser = this.ctx.getService('browser'); + private readonly config = this.ctx.getService('config'); + private readonly retry = this.ctx.getService('retry'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly header = this.ctx.getPageObject('header'); + private readonly common = this.ctx.getPageObject('common'); + private readonly log = this.ctx.getService('log'); - class ContextPage { - public async navigateTo(indexPattern: string, anchorId: string, overrideInitialState = {}) { - const initialState = rison.encode({ - ...DEFAULT_INITIAL_STATE, - ...overrideInitialState, - }); - const appUrl = getUrl.noAuth(config.get('servers.kibana'), { - ...config.get('apps.context'), - hash: `${config.get('apps.context.hash')}/${indexPattern}/${anchorId}?_a=${initialState}`, - }); + public async navigateTo(indexPattern: string, anchorId: string, overrideInitialState = {}) { + const initialState = rison.encode({ + ...DEFAULT_INITIAL_STATE, + ...overrideInitialState, + }); + const contextHash = this.config.get('apps.context.hash'); + const appUrl = getUrl.noAuth(this.config.get('servers.kibana'), { + ...this.config.get('apps.context'), + hash: `${contextHash}/${indexPattern}/${anchorId}?_a=${initialState}`, + }); - log.debug(`browser.get(${appUrl})`); + this.log.debug(`browser.get(${appUrl})`); - await browser.get(appUrl); - await PageObjects.header.awaitGlobalLoadingIndicatorHidden(); - await this.waitUntilContextLoadingHasFinished(); - // For lack of a better way, using a sleep to ensure page is loaded before proceeding - await PageObjects.common.sleep(1000); - } - - public async getPredecessorCountPicker() { - return await testSubjects.find('predecessorsCountPicker'); - } + await this.browser.get(appUrl); + await this.header.awaitGlobalLoadingIndicatorHidden(); + await this.waitUntilContextLoadingHasFinished(); + // For lack of a better way, using a sleep to ensure page is loaded before proceeding + await this.common.sleep(1000); + } - public async getSuccessorCountPicker() { - return await testSubjects.find('successorsCountPicker'); - } + public async getPredecessorCountPicker() { + return await this.testSubjects.find('predecessorsCountPicker'); + } - public async getPredecessorLoadMoreButton() { - return await testSubjects.find('predecessorsLoadMoreButton'); - } + public async getSuccessorCountPicker() { + return await this.testSubjects.find('successorsCountPicker'); + } - public async getSuccessorLoadMoreButton() { - return await testSubjects.find('successorsLoadMoreButton'); - } + public async getPredecessorLoadMoreButton() { + return await this.testSubjects.find('predecessorsLoadMoreButton'); + } - public async clickPredecessorLoadMoreButton() { - log.debug('Click Predecessor Load More Button'); - await retry.try(async () => { - const predecessorButton = await this.getPredecessorLoadMoreButton(); - await predecessorButton.click(); - }); - await this.waitUntilContextLoadingHasFinished(); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + public async getSuccessorLoadMoreButton() { + return await this.testSubjects.find('successorsLoadMoreButton'); + } - public async clickSuccessorLoadMoreButton() { - log.debug('Click Successor Load More Button'); - await retry.try(async () => { - const sucessorButton = await this.getSuccessorLoadMoreButton(); - await sucessorButton.click(); - }); - await this.waitUntilContextLoadingHasFinished(); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + public async clickPredecessorLoadMoreButton() { + this.log.debug('Click Predecessor Load More Button'); + await this.retry.try(async () => { + const predecessorButton = await this.getPredecessorLoadMoreButton(); + await predecessorButton.click(); + }); + await this.waitUntilContextLoadingHasFinished(); + await this.header.waitUntilLoadingHasFinished(); + } - public async waitUntilContextLoadingHasFinished() { - return await retry.try(async () => { - const successorLoadMoreButton = await this.getSuccessorLoadMoreButton(); - const predecessorLoadMoreButton = await this.getPredecessorLoadMoreButton(); - if ( - !( - (await successorLoadMoreButton.isEnabled()) && - (await successorLoadMoreButton.isDisplayed()) && - (await predecessorLoadMoreButton.isEnabled()) && - (await predecessorLoadMoreButton.isDisplayed()) - ) - ) { - throw new Error('loading context rows'); - } - }); - } + public async clickSuccessorLoadMoreButton() { + this.log.debug('Click Successor Load More Button'); + await this.retry.try(async () => { + const sucessorButton = await this.getSuccessorLoadMoreButton(); + await sucessorButton.click(); + }); + await this.waitUntilContextLoadingHasFinished(); + await this.header.waitUntilLoadingHasFinished(); } - return new ContextPage(); + public async waitUntilContextLoadingHasFinished() { + return await this.retry.try(async () => { + const successorLoadMoreButton = await this.getSuccessorLoadMoreButton(); + const predecessorLoadMoreButton = await this.getPredecessorLoadMoreButton(); + if ( + !( + (await successorLoadMoreButton.isEnabled()) && + (await successorLoadMoreButton.isDisplayed()) && + (await predecessorLoadMoreButton.isEnabled()) && + (await predecessorLoadMoreButton.isDisplayed()) + ) + ) { + throw new Error('loading context rows'); + } + }); + } } diff --git a/test/functional/page_objects/dashboard_page.ts b/test/functional/page_objects/dashboard_page.ts index ba75ab75cc6e89..ecba9549cea02b 100644 --- a/test/functional/page_objects/dashboard_page.ts +++ b/test/functional/page_objects/dashboard_page.ts @@ -9,668 +9,668 @@ export const PIE_CHART_VIS_NAME = 'Visualization PieChart'; export const AREA_CHART_VIS_NAME = 'Visualization漢字 AreaChart'; export const LINE_CHART_VIS_NAME = 'Visualization漢字 LineChart'; -import { FtrProviderContext } from '../ftr_provider_context'; - -export function DashboardPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const log = getService('log'); - const find = getService('find'); - const retry = getService('retry'); - const browser = getService('browser'); - const globalNav = getService('globalNav'); - const esArchiver = getService('esArchiver'); - const kibanaServer = getService('kibanaServer'); - const testSubjects = getService('testSubjects'); - const dashboardAddPanel = getService('dashboardAddPanel'); - const renderable = getService('renderable'); - const listingTable = getService('listingTable'); - const elasticChart = getService('elasticChart'); - const PageObjects = getPageObjects(['common', 'header', 'visualize', 'discover']); - - interface SaveDashboardOptions { - /** - * @default true - */ - waitDialogIsClosed?: boolean; - exitFromEditMode?: boolean; - needsConfirm?: boolean; - storeTimeWithDashboard?: boolean; - saveAsNew?: boolean; - tags?: string[]; - } - - class DashboardPage { - async initTests({ kibanaIndex = 'dashboard/legacy', defaultIndex = 'logstash-*' } = {}) { - log.debug('load kibana index with visualizations and log data'); - await esArchiver.load(kibanaIndex); - await kibanaServer.uiSettings.replace({ defaultIndex }); - await PageObjects.common.navigateToApp('dashboard'); - } - - public async preserveCrossAppState() { - const url = await browser.getCurrentUrl(); - await browser.get(url, false); - await PageObjects.header.waitUntilLoadingHasFinished(); - } - - public async clickFullScreenMode() { - log.debug(`clickFullScreenMode`); - await testSubjects.click('dashboardFullScreenMode'); - await testSubjects.exists('exitFullScreenModeLogo'); - await this.waitForRenderComplete(); - } - - public async exitFullScreenMode() { - log.debug(`exitFullScreenMode`); - const logoButton = await this.getExitFullScreenLogoButton(); - await logoButton.moveMouseTo(); - await this.clickExitFullScreenTextButton(); - } - - public async fullScreenModeMenuItemExists() { - return await testSubjects.exists('dashboardFullScreenMode'); - } +import { FtrService } from '../ftr_provider_context'; + +interface SaveDashboardOptions { + /** + * @default true + */ + waitDialogIsClosed?: boolean; + exitFromEditMode?: boolean; + needsConfirm?: boolean; + storeTimeWithDashboard?: boolean; + saveAsNew?: boolean; + tags?: string[]; +} - public async exitFullScreenTextButtonExists() { - return await testSubjects.exists('exitFullScreenModeText'); - } +export class DashboardPageObject extends FtrService { + private readonly log = this.ctx.getService('log'); + private readonly find = this.ctx.getService('find'); + private readonly retry = this.ctx.getService('retry'); + private readonly browser = this.ctx.getService('browser'); + private readonly globalNav = this.ctx.getService('globalNav'); + private readonly esArchiver = this.ctx.getService('esArchiver'); + private readonly kibanaServer = this.ctx.getService('kibanaServer'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly dashboardAddPanel = this.ctx.getService('dashboardAddPanel'); + private readonly renderable = this.ctx.getService('renderable'); + private readonly listingTable = this.ctx.getService('listingTable'); + private readonly elasticChart = this.ctx.getService('elasticChart'); + private readonly common = this.ctx.getPageObject('common'); + private readonly header = this.ctx.getPageObject('header'); + private readonly visualize = this.ctx.getPageObject('visualize'); + private readonly discover = this.ctx.getPageObject('discover'); + + async initTests({ + kibanaIndex = 'test/functional/fixtures/es_archiver/dashboard/legacy', + defaultIndex = 'logstash-*', + } = {}) { + this.log.debug('load kibana index with visualizations and log data'); + await this.esArchiver.load(kibanaIndex); + await this.kibanaServer.uiSettings.replace({ defaultIndex }); + await this.common.navigateToApp('dashboard'); + } - public async getExitFullScreenTextButton() { - return await testSubjects.find('exitFullScreenModeText'); - } + public async preserveCrossAppState() { + const url = await this.browser.getCurrentUrl(); + await this.browser.get(url, false); + await this.header.waitUntilLoadingHasFinished(); + } - public async exitFullScreenLogoButtonExists() { - return await testSubjects.exists('exitFullScreenModeLogo'); - } + public async clickFullScreenMode() { + this.log.debug(`clickFullScreenMode`); + await this.testSubjects.click('dashboardFullScreenMode'); + await this.testSubjects.exists('exitFullScreenModeLogo'); + await this.waitForRenderComplete(); + } - public async getExitFullScreenLogoButton() { - return await testSubjects.find('exitFullScreenModeLogo'); - } + public async exitFullScreenMode() { + this.log.debug(`exitFullScreenMode`); + const logoButton = await this.getExitFullScreenLogoButton(); + await logoButton.moveMouseTo(); + await this.clickExitFullScreenTextButton(); + } - public async clickExitFullScreenLogoButton() { - await testSubjects.click('exitFullScreenModeLogo'); - await this.waitForRenderComplete(); - } + public async fullScreenModeMenuItemExists() { + return await this.testSubjects.exists('dashboardFullScreenMode'); + } - public async clickExitFullScreenTextButton() { - await testSubjects.click('exitFullScreenModeText'); - await this.waitForRenderComplete(); - } + public async exitFullScreenTextButtonExists() { + return await this.testSubjects.exists('exitFullScreenModeText'); + } - public async getDashboardIdFromCurrentUrl() { - const currentUrl = await browser.getCurrentUrl(); - const id = this.getDashboardIdFromUrl(currentUrl); + public async getExitFullScreenTextButton() { + return await this.testSubjects.find('exitFullScreenModeText'); + } - log.debug(`Dashboard id extracted from ${currentUrl} is ${id}`); + public async exitFullScreenLogoButtonExists() { + return await this.testSubjects.exists('exitFullScreenModeLogo'); + } - return id; - } + public async getExitFullScreenLogoButton() { + return await this.testSubjects.find('exitFullScreenModeLogo'); + } - public getDashboardIdFromUrl(url: string) { - const urlSubstring = '#/view/'; - const startOfIdIndex = url.indexOf(urlSubstring) + urlSubstring.length; - const endIndex = url.indexOf('?'); - const id = url.substring(startOfIdIndex, endIndex < 0 ? url.length : endIndex); - return id; - } + public async clickExitFullScreenLogoButton() { + await this.testSubjects.click('exitFullScreenModeLogo'); + await this.waitForRenderComplete(); + } - public async expectUnsavedChangesListingExists(title: string) { - log.debug(`Expect Unsaved Changes Listing Exists for `, title); - await testSubjects.existOrFail(`edit-unsaved-${title.split(' ').join('-')}`); - } + public async clickExitFullScreenTextButton() { + await this.testSubjects.click('exitFullScreenModeText'); + await this.waitForRenderComplete(); + } - public async expectUnsavedChangesDoesNotExist(title: string) { - log.debug(`Expect Unsaved Changes Listing Does Not Exist for `, title); - await testSubjects.missingOrFail(`edit-unsaved-${title.split(' ').join('-')}`); - } + public async getDashboardIdFromCurrentUrl() { + const currentUrl = await this.browser.getCurrentUrl(); + const id = this.getDashboardIdFromUrl(currentUrl); - public async clickUnsavedChangesContinueEditing(title: string) { - log.debug(`Click Unsaved Changes Continue Editing `, title); - await testSubjects.existOrFail(`edit-unsaved-${title.split(' ').join('-')}`); - await testSubjects.click(`edit-unsaved-${title.split(' ').join('-')}`); - } + this.log.debug(`Dashboard id extracted from ${currentUrl} is ${id}`); - public async clickUnsavedChangesDiscard(title: string, confirmDiscard = true) { - log.debug(`Click Unsaved Changes Discard for `, title); - await testSubjects.existOrFail(`discard-unsaved-${title.split(' ').join('-')}`); - await testSubjects.click(`discard-unsaved-${title.split(' ').join('-')}`); - if (confirmDiscard) { - await PageObjects.common.clickConfirmOnModal(); - } else { - await PageObjects.common.clickCancelOnModal(); - } - } + return id; + } - /** - * Returns true if already on the dashboard landing page (that page doesn't have a link to itself). - * @returns {Promise} - */ - public async onDashboardLandingPage() { - log.debug(`onDashboardLandingPage`); - return await listingTable.onListingPage('dashboard'); - } + public getDashboardIdFromUrl(url: string) { + const urlSubstring = '#/view/'; + const startOfIdIndex = url.indexOf(urlSubstring) + urlSubstring.length; + const endIndex = url.indexOf('?'); + const id = url.substring(startOfIdIndex, endIndex < 0 ? url.length : endIndex); + return id; + } - public async expectExistsDashboardLandingPage() { - log.debug(`expectExistsDashboardLandingPage`); - await testSubjects.existOrFail('dashboardLandingPage'); - } + public async expectUnsavedChangesListingExists(title: string) { + this.log.debug(`Expect Unsaved Changes Listing Exists for `, title); + await this.testSubjects.existOrFail(`edit-unsaved-${title.split(' ').join('-')}`); + } - public async clickDashboardBreadcrumbLink() { - log.debug('clickDashboardBreadcrumbLink'); - await testSubjects.click('breadcrumb dashboardListingBreadcrumb first'); - } + public async expectUnsavedChangesDoesNotExist(title: string) { + this.log.debug(`Expect Unsaved Changes Listing Does Not Exist for `, title); + await this.testSubjects.missingOrFail(`edit-unsaved-${title.split(' ').join('-')}`); + } - public async expectOnDashboard(dashboardTitle: string) { - await retry.waitFor( - 'last breadcrumb to have dashboard title', - async () => (await globalNav.getLastBreadcrumb()) === dashboardTitle - ); - } + public async clickUnsavedChangesContinueEditing(title: string) { + this.log.debug(`Click Unsaved Changes Continue Editing `, title); + await this.testSubjects.existOrFail(`edit-unsaved-${title.split(' ').join('-')}`); + await this.testSubjects.click(`edit-unsaved-${title.split(' ').join('-')}`); + } - public async gotoDashboardLandingPage(ignorePageLeaveWarning = true) { - log.debug('gotoDashboardLandingPage'); - const onPage = await this.onDashboardLandingPage(); - if (!onPage) { - await this.clickDashboardBreadcrumbLink(); - await retry.try(async () => { - const warning = await testSubjects.exists('confirmModalTitleText'); - if (warning) { - await testSubjects.click( - ignorePageLeaveWarning ? 'confirmModalConfirmButton' : 'confirmModalCancelButton' - ); - } - }); - await this.expectExistsDashboardLandingPage(); - } + public async clickUnsavedChangesDiscard(title: string, confirmDiscard = true) { + this.log.debug(`Click Unsaved Changes Discard for `, title); + await this.testSubjects.existOrFail(`discard-unsaved-${title.split(' ').join('-')}`); + await this.testSubjects.click(`discard-unsaved-${title.split(' ').join('-')}`); + if (confirmDiscard) { + await this.common.clickConfirmOnModal(); + } else { + await this.common.clickCancelOnModal(); } + } - public async clickClone() { - log.debug('Clicking clone'); - await testSubjects.click('dashboardClone'); - } + /** + * Returns true if already on the dashboard landing page (that page doesn't have a link to itself). + * @returns {Promise} + */ + public async onDashboardLandingPage() { + this.log.debug(`onDashboardLandingPage`); + return await this.listingTable.onListingPage('dashboard'); + } - public async getCloneTitle() { - return await testSubjects.getAttribute('clonedDashboardTitle', 'value'); - } + public async expectExistsDashboardLandingPage() { + this.log.debug(`expectExistsDashboardLandingPage`); + await this.testSubjects.existOrFail('dashboardLandingPage'); + } - public async confirmClone() { - log.debug('Confirming clone'); - await testSubjects.click('cloneConfirmButton'); - } + public async clickDashboardBreadcrumbLink() { + this.log.debug('clickDashboardBreadcrumbLink'); + await this.testSubjects.click('breadcrumb dashboardListingBreadcrumb first'); + } - public async cancelClone() { - log.debug('Canceling clone'); - await testSubjects.click('cloneCancelButton'); - } + public async expectOnDashboard(dashboardTitle: string) { + await this.retry.waitFor( + 'last breadcrumb to have dashboard title', + async () => (await this.globalNav.getLastBreadcrumb()) === dashboardTitle + ); + } - public async setClonedDashboardTitle(title: string) { - await testSubjects.setValue('clonedDashboardTitle', title); + public async gotoDashboardLandingPage(ignorePageLeaveWarning = true) { + this.log.debug('gotoDashboardLandingPage'); + const onPage = await this.onDashboardLandingPage(); + if (!onPage) { + await this.clickDashboardBreadcrumbLink(); + await this.retry.try(async () => { + const warning = await this.testSubjects.exists('confirmModalTitleText'); + if (warning) { + await this.testSubjects.click( + ignorePageLeaveWarning ? 'confirmModalConfirmButton' : 'confirmModalCancelButton' + ); + } + }); + await this.expectExistsDashboardLandingPage(); } + } - /** - * Asserts that the duplicate title warning is either displayed or not displayed. - * @param { displayed: boolean } - */ - public async expectDuplicateTitleWarningDisplayed({ displayed = true }) { - if (displayed) { - await testSubjects.existOrFail('titleDupicateWarnMsg'); - } else { - await testSubjects.missingOrFail('titleDupicateWarnMsg'); - } - } + public async clickClone() { + this.log.debug('Clicking clone'); + await this.testSubjects.click('dashboardClone'); + } - /** - * Asserts that the toolbar pagination (count and arrows) is either displayed or not displayed. + public async getCloneTitle() { + return await this.testSubjects.getAttribute('clonedDashboardTitle', 'value'); + } - */ - public async expectToolbarPaginationDisplayed() { - const isLegacyDefault = PageObjects.discover.useLegacyTable(); - if (isLegacyDefault) { - const subjects = ['btnPrevPage', 'btnNextPage', 'toolBarPagerText']; - await Promise.all(subjects.map(async (subj) => await testSubjects.existOrFail(subj))); - } else { - const subjects = ['pagination-button-previous', 'pagination-button-next']; + public async confirmClone() { + this.log.debug('Confirming clone'); + await this.testSubjects.click('cloneConfirmButton'); + } - await Promise.all(subjects.map(async (subj) => await testSubjects.existOrFail(subj))); - const paginationListExists = await find.existsByCssSelector('.euiPagination__list'); - if (!paginationListExists) { - throw new Error(`expected discover data grid pagination list to exist`); - } - } - } + public async cancelClone() { + this.log.debug('Canceling clone'); + await this.testSubjects.click('cloneCancelButton'); + } - public async switchToEditMode() { - log.debug('Switching to edit mode'); - await testSubjects.click('dashboardEditMode'); - // wait until the count of dashboard panels equals the count of toggle menu icons - await retry.waitFor('in edit mode', async () => { - const panels = await testSubjects.findAll('embeddablePanel', 2500); - const menuIcons = await testSubjects.findAll('embeddablePanelToggleMenuIcon', 2500); - return panels.length === menuIcons.length; - }); - } + public async setClonedDashboardTitle(title: string) { + await this.testSubjects.setValue('clonedDashboardTitle', title); + } - public async getIsInViewMode() { - log.debug('getIsInViewMode'); - return await testSubjects.exists('dashboardEditMode'); + /** + * Asserts that the duplicate title warning is either displayed or not displayed. + * @param { displayed: boolean } + */ + public async expectDuplicateTitleWarningDisplayed({ displayed = true }) { + if (displayed) { + await this.testSubjects.existOrFail('titleDupicateWarnMsg'); + } else { + await this.testSubjects.missingOrFail('titleDupicateWarnMsg'); } + } - public async clickCancelOutOfEditMode(accept = true) { - log.debug('clickCancelOutOfEditMode'); - await testSubjects.click('dashboardViewOnlyMode'); - if (accept) { - const confirmation = await testSubjects.exists('dashboardDiscardConfirmKeep'); - if (confirmation) { - await testSubjects.click('dashboardDiscardConfirmKeep'); - } + /** + * Asserts that the toolbar pagination (count and arrows) is either displayed or not displayed. + + */ + public async expectToolbarPaginationDisplayed() { + const isLegacyDefault = this.discover.useLegacyTable(); + if (isLegacyDefault) { + const subjects = ['btnPrevPage', 'btnNextPage', 'toolBarPagerText']; + await Promise.all(subjects.map(async (subj) => await this.testSubjects.existOrFail(subj))); + } else { + const subjects = ['pagination-button-previous', 'pagination-button-next']; + + await Promise.all(subjects.map(async (subj) => await this.testSubjects.existOrFail(subj))); + const paginationListExists = await this.find.existsByCssSelector('.euiPagination__list'); + if (!paginationListExists) { + throw new Error(`expected discover data grid pagination list to exist`); } } + } - public async clickDiscardChanges(accept = true) { - log.debug('clickDiscardChanges'); - await testSubjects.click('dashboardViewOnlyMode'); - if (accept) { - const confirmation = await testSubjects.exists('dashboardDiscardConfirmDiscard'); - if (confirmation) { - await testSubjects.click('dashboardDiscardConfirmDiscard'); - } - } - } + public async switchToEditMode() { + this.log.debug('Switching to edit mode'); + if (await this.testSubjects.exists('dashboardEditMode')) { + // if the dashboard is not already in edit mode + await this.testSubjects.click('dashboardEditMode'); + } + // wait until the count of dashboard panels equals the count of toggle menu icons + await this.retry.waitFor('in edit mode', async () => { + const panels = await this.testSubjects.findAll('embeddablePanel', 2500); + const menuIcons = await this.testSubjects.findAll('embeddablePanelToggleMenuIcon', 2500); + return panels.length === menuIcons.length; + }); + } - public async clickQuickSave() { - await this.expectQuickSaveButtonEnabled(); - log.debug('clickQuickSave'); - await testSubjects.click('dashboardQuickSaveMenuItem'); - } + public async getIsInViewMode() { + this.log.debug('getIsInViewMode'); + return await this.testSubjects.exists('dashboardEditMode'); + } - public async clickNewDashboard(continueEditing = false) { - await listingTable.clickNewButton('createDashboardPromptButton'); - if (await testSubjects.exists('dashboardCreateConfirm')) { - if (continueEditing) { - await testSubjects.click('dashboardCreateConfirmContinue'); - } else { - await testSubjects.click('dashboardCreateConfirmStartOver'); - } + public async clickCancelOutOfEditMode(accept = true) { + this.log.debug('clickCancelOutOfEditMode'); + if (await this.getIsInViewMode()) return; + await this.retry.waitFor('leave edit mode button enabled', async () => { + const leaveEditModeButton = await this.testSubjects.find('dashboardViewOnlyMode'); + const isDisabled = await leaveEditModeButton.getAttribute('disabled'); + return !isDisabled; + }); + await this.testSubjects.click('dashboardViewOnlyMode'); + if (accept) { + const confirmation = await this.testSubjects.exists('confirmModalTitleText'); + if (confirmation) { + await this.common.clickConfirmOnModal(); } - // make sure the dashboard page is shown - await this.waitForRenderComplete(); } + } + + public async clickQuickSave() { + await this.expectQuickSaveButtonEnabled(); + this.log.debug('clickQuickSave'); + await this.testSubjects.click('dashboardQuickSaveMenuItem'); + } - public async clickNewDashboardExpectWarning(continueEditing = false) { - await listingTable.clickNewButton('createDashboardPromptButton'); - await testSubjects.existOrFail('dashboardCreateConfirm'); + public async clickNewDashboard(continueEditing = false) { + await this.listingTable.clickNewButton('createDashboardPromptButton'); + if (await this.testSubjects.exists('dashboardCreateConfirm')) { if (continueEditing) { - await testSubjects.click('dashboardCreateConfirmContinue'); + await this.testSubjects.click('dashboardCreateConfirmContinue'); } else { - await testSubjects.click('dashboardCreateConfirmStartOver'); + await this.testSubjects.click('dashboardCreateConfirmStartOver'); } - // make sure the dashboard page is shown - await this.waitForRenderComplete(); - } - - public async clickCreateDashboardPrompt() { - await testSubjects.click('createDashboardPromptButton'); } + // make sure the dashboard page is shown + await this.waitForRenderComplete(); + } - public async getCreateDashboardPromptExists() { - return await testSubjects.exists('createDashboardPromptButton'); + public async clickNewDashboardExpectWarning(continueEditing = false) { + await this.listingTable.clickNewButton('createDashboardPromptButton'); + await this.testSubjects.existOrFail('dashboardCreateConfirm'); + if (continueEditing) { + await this.testSubjects.click('dashboardCreateConfirmContinue'); + } else { + await this.testSubjects.click('dashboardCreateConfirmStartOver'); } + // make sure the dashboard page is shown + await this.waitForRenderComplete(); + } - public async isOptionsOpen() { - log.debug('isOptionsOpen'); - return await testSubjects.exists('dashboardOptionsMenu'); - } + public async clickCreateDashboardPrompt() { + await this.testSubjects.click('createDashboardPromptButton'); + } - public async openOptions() { - log.debug('openOptions'); - const isOpen = await this.isOptionsOpen(); - if (!isOpen) { - return await testSubjects.click('dashboardOptionsButton'); - } - } + public async getCreateDashboardPromptExists() { + return await this.testSubjects.exists('createDashboardPromptButton'); + } - // avoids any 'Object with id x not found' errors when switching tests. - public async clearSavedObjectsFromAppLinks() { - await PageObjects.header.clickVisualize(); - await PageObjects.visualize.gotoLandingPage(); - await PageObjects.header.clickDashboard(); - await this.gotoDashboardLandingPage(); - } + public async isOptionsOpen() { + this.log.debug('isOptionsOpen'); + return await this.testSubjects.exists('dashboardOptionsMenu'); + } - public async isMarginsOn() { - log.debug('isMarginsOn'); - await this.openOptions(); - return await testSubjects.getAttribute('dashboardMarginsCheckbox', 'checked'); + public async openOptions() { + this.log.debug('openOptions'); + const isOpen = await this.isOptionsOpen(); + if (!isOpen) { + return await this.testSubjects.click('dashboardOptionsButton'); } + } - public async useMargins(on = true) { - await this.openOptions(); - const isMarginsOn = await this.isMarginsOn(); - if (isMarginsOn !== 'on') { - return await testSubjects.click('dashboardMarginsCheckbox'); - } - } + // avoids any 'Object with id x not found' errors when switching tests. + public async clearSavedObjectsFromAppLinks() { + await this.header.clickVisualize(); + await this.visualize.gotoLandingPage(); + await this.header.clickDashboard(); + await this.gotoDashboardLandingPage(); + } - public async isColorSyncOn() { - log.debug('isColorSyncOn'); - await this.openOptions(); - return await testSubjects.getAttribute('dashboardSyncColorsCheckbox', 'checked'); - } + public async isMarginsOn() { + this.log.debug('isMarginsOn'); + await this.openOptions(); + return await this.testSubjects.getAttribute('dashboardMarginsCheckbox', 'checked'); + } - public async useColorSync(on = true) { - await this.openOptions(); - const isColorSyncOn = await this.isColorSyncOn(); - if (isColorSyncOn !== 'on') { - return await testSubjects.click('dashboardSyncColorsCheckbox'); - } + public async useMargins(on = true) { + await this.openOptions(); + const isMarginsOn = await this.isMarginsOn(); + if (isMarginsOn !== 'on') { + return await this.testSubjects.click('dashboardMarginsCheckbox'); } + } - public async gotoDashboardEditMode(dashboardName: string) { - await this.loadSavedDashboard(dashboardName); - await this.switchToEditMode(); - } + public async isColorSyncOn() { + this.log.debug('isColorSyncOn'); + await this.openOptions(); + return await this.testSubjects.getAttribute('dashboardSyncColorsCheckbox', 'checked'); + } - public async renameDashboard(dashboardName: string) { - log.debug(`Naming dashboard ` + dashboardName); - await testSubjects.click('dashboardRenameButton'); - await testSubjects.setValue('savedObjectTitle', dashboardName); + public async useColorSync(on = true) { + await this.openOptions(); + const isColorSyncOn = await this.isColorSyncOn(); + if (isColorSyncOn !== 'on') { + return await this.testSubjects.click('dashboardSyncColorsCheckbox'); } + } - /** - * Save the current dashboard with the specified name and options and - * verify that the save was successful, close the toast and return the - * toast message - * - * @param dashboardName {String} - * @param saveOptions {{storeTimeWithDashboard: boolean, saveAsNew: boolean, needsConfirm: false, waitDialogIsClosed: boolean }} - */ - public async saveDashboard( - dashboardName: string, - saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true, exitFromEditMode: true } - ) { - await retry.try(async () => { - await this.enterDashboardTitleAndClickSave(dashboardName, saveOptions); - - if (saveOptions.needsConfirm) { - await this.ensureDuplicateTitleCallout(); - await this.clickSave(); - } + public async gotoDashboardEditMode(dashboardName: string) { + await this.loadSavedDashboard(dashboardName); + await this.switchToEditMode(); + } - // Confirm that the Dashboard has actually been saved - await testSubjects.existOrFail('saveDashboardSuccess'); - }); - const message = await PageObjects.common.closeToast(); - await PageObjects.header.waitUntilLoadingHasFinished(); - await PageObjects.common.waitForSaveModalToClose(); + public async renameDashboard(dashboardName: string) { + this.log.debug(`Naming dashboard ` + dashboardName); + await this.testSubjects.click('dashboardRenameButton'); + await this.testSubjects.setValue('savedObjectTitle', dashboardName); + } - const isInViewMode = await testSubjects.exists('dashboardEditMode'); - if (saveOptions.exitFromEditMode && !isInViewMode) { - await this.clickCancelOutOfEditMode(); + /** + * Save the current dashboard with the specified name and options and + * verify that the save was successful, close the toast and return the + * toast message + * + * @param dashboardName {String} + * @param saveOptions {{storeTimeWithDashboard: boolean, saveAsNew: boolean, needsConfirm: false, waitDialogIsClosed: boolean }} + */ + public async saveDashboard( + dashboardName: string, + saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true, exitFromEditMode: true } + ) { + await this.retry.try(async () => { + await this.enterDashboardTitleAndClickSave(dashboardName, saveOptions); + + if (saveOptions.needsConfirm) { + await this.ensureDuplicateTitleCallout(); + await this.clickSave(); } - await PageObjects.header.waitUntilLoadingHasFinished(); - return message; - } + // Confirm that the Dashboard has actually been saved + await this.testSubjects.existOrFail('saveDashboardSuccess'); + }); + const message = await this.common.closeToast(); + await this.header.waitUntilLoadingHasFinished(); + await this.common.waitForSaveModalToClose(); - public async cancelSave() { - log.debug('Canceling save'); - await testSubjects.click('saveCancelButton'); + const isInViewMode = await this.testSubjects.exists('dashboardEditMode'); + if (saveOptions.exitFromEditMode && !isInViewMode) { + await this.clickCancelOutOfEditMode(); } + await this.header.waitUntilLoadingHasFinished(); - public async clickSave() { - log.debug('DashboardPage.clickSave'); - await testSubjects.click('confirmSaveSavedObjectButton'); - } + return message; + } - /** - * - * @param dashboardTitle {String} - * @param saveOptions {{storeTimeWithDashboard: boolean, saveAsNew: boolean, waitDialogIsClosed: boolean}} - */ - public async enterDashboardTitleAndClickSave( - dashboardTitle: string, - saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true } - ) { - await testSubjects.click('dashboardSaveMenuItem'); - const modalDialog = await testSubjects.find('savedObjectSaveModal'); - - log.debug('entering new title'); - await testSubjects.setValue('savedObjectTitle', dashboardTitle); - - if (saveOptions.storeTimeWithDashboard !== undefined) { - await this.setStoreTimeWithDashboard(saveOptions.storeTimeWithDashboard); - } + public async cancelSave() { + this.log.debug('Canceling save'); + await this.testSubjects.click('saveCancelButton'); + } - const saveAsNewCheckboxExists = await testSubjects.exists('saveAsNewCheckbox'); - if (saveAsNewCheckboxExists) { - await this.setSaveAsNewCheckBox(Boolean(saveOptions.saveAsNew)); - } + public async clickSave() { + this.log.debug('DashboardPage.clickSave'); + await this.testSubjects.click('confirmSaveSavedObjectButton'); + } - if (saveOptions.tags) { - await this.selectDashboardTags(saveOptions.tags); - } + /** + * + * @param dashboardTitle {String} + * @param saveOptions {{storeTimeWithDashboard: boolean, saveAsNew: boolean, waitDialogIsClosed: boolean}} + */ + public async enterDashboardTitleAndClickSave( + dashboardTitle: string, + saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true } + ) { + await this.testSubjects.click('dashboardSaveMenuItem'); + const modalDialog = await this.testSubjects.find('savedObjectSaveModal'); - await this.clickSave(); - if (saveOptions.waitDialogIsClosed) { - await testSubjects.waitForDeleted(modalDialog); - } + this.log.debug('entering new title'); + await this.testSubjects.setValue('savedObjectTitle', dashboardTitle); + + if (saveOptions.storeTimeWithDashboard !== undefined) { + await this.setStoreTimeWithDashboard(saveOptions.storeTimeWithDashboard); } - public async ensureDuplicateTitleCallout() { - await testSubjects.existOrFail('titleDupicateWarnMsg'); + const saveAsNewCheckboxExists = await this.testSubjects.exists('saveAsNewCheckbox'); + if (saveAsNewCheckboxExists) { + await this.setSaveAsNewCheckBox(Boolean(saveOptions.saveAsNew)); } - public async selectDashboardTags(tagNames: string[]) { - await testSubjects.click('savedObjectTagSelector'); - for (const tagName of tagNames) { - await testSubjects.click(`tagSelectorOption-${tagName.replace(' ', '_')}`); - } - await testSubjects.click('savedObjectTitle'); + if (saveOptions.tags) { + await this.selectDashboardTags(saveOptions.tags); } - /** - * @param dashboardTitle {String} - */ - public async enterDashboardTitleAndPressEnter(dashboardTitle: string) { - await testSubjects.click('dashboardSaveMenuItem'); - const modalDialog = await testSubjects.find('savedObjectSaveModal'); + await this.clickSave(); + if (saveOptions.waitDialogIsClosed) { + await this.testSubjects.waitForDeleted(modalDialog); + } + } - log.debug('entering new title'); - await testSubjects.setValue('savedObjectTitle', dashboardTitle); + public async ensureDuplicateTitleCallout() { + await this.testSubjects.existOrFail('titleDupicateWarnMsg'); + } - await PageObjects.common.pressEnterKey(); - await testSubjects.waitForDeleted(modalDialog); + public async selectDashboardTags(tagNames: string[]) { + await this.testSubjects.click('savedObjectTagSelector'); + for (const tagName of tagNames) { + await this.testSubjects.click(`tagSelectorOption-${tagName.replace(' ', '_')}`); } + await this.testSubjects.click('savedObjectTitle'); + } - // use the search filter box to narrow the results down to a single - // entry, or at least to a single page of results - public async loadSavedDashboard(dashboardName: string) { - log.debug(`Load Saved Dashboard ${dashboardName}`); + /** + * @param dashboardTitle {String} + */ + public async enterDashboardTitleAndPressEnter(dashboardTitle: string) { + await this.testSubjects.click('dashboardSaveMenuItem'); + const modalDialog = await this.testSubjects.find('savedObjectSaveModal'); - await this.gotoDashboardLandingPage(); + this.log.debug('entering new title'); + await this.testSubjects.setValue('savedObjectTitle', dashboardTitle); - await listingTable.searchForItemWithName(dashboardName); - await retry.try(async () => { - await listingTable.clickItemLink('dashboard', dashboardName); - await PageObjects.header.waitUntilLoadingHasFinished(); - // check Dashboard landing page is not present - await testSubjects.missingOrFail('dashboardLandingPage', { timeout: 10000 }); - }); - } + await this.common.pressEnterKey(); + await this.testSubjects.waitForDeleted(modalDialog); + } - public async getPanelTitles() { - log.debug('in getPanelTitles'); - const titleObjects = await testSubjects.findAll('dashboardPanelTitle'); - return await Promise.all(titleObjects.map(async (title) => await title.getVisibleText())); - } + // use the search filter box to narrow the results down to a single + // entry, or at least to a single page of results + public async loadSavedDashboard(dashboardName: string) { + this.log.debug(`Load Saved Dashboard ${dashboardName}`); - public async getPanelDimensions() { - const panels = await find.allByCssSelector('.react-grid-item'); // These are gridster-defined elements and classes - return await Promise.all( - panels.map(async (panel) => { - const size = await panel.getSize(); - return { - width: size.width, - height: size.height, - }; - }) - ); - } + await this.gotoDashboardLandingPage(); - public async getPanelCount() { - log.debug('getPanelCount'); - const panels = await testSubjects.findAll('embeddablePanel'); - return panels.length; - } + await this.listingTable.searchForItemWithName(dashboardName); + await this.retry.try(async () => { + await this.listingTable.clickItemLink('dashboard', dashboardName); + await this.header.waitUntilLoadingHasFinished(); + // check Dashboard landing page is not present + await this.testSubjects.missingOrFail('dashboardLandingPage', { timeout: 10000 }); + }); + } - public getTestVisualizations() { - return [ - { name: PIE_CHART_VIS_NAME, description: 'PieChart' }, - { name: 'Visualization☺ VerticalBarChart', description: 'VerticalBarChart' }, - { name: AREA_CHART_VIS_NAME, description: 'AreaChart' }, - { name: 'Visualization☺漢字 DataTable', description: 'DataTable' }, - { name: LINE_CHART_VIS_NAME, description: 'LineChart' }, - { name: 'Visualization TileMap', description: 'TileMap' }, - { name: 'Visualization MetricChart', description: 'MetricChart' }, - ]; - } + public async getPanelTitles() { + this.log.debug('in getPanelTitles'); + const titleObjects = await this.testSubjects.findAll('dashboardPanelTitle'); + return await Promise.all(titleObjects.map(async (title) => await title.getVisibleText())); + } - public getTestVisualizationNames() { - return this.getTestVisualizations().map((visualization) => visualization.name); - } + public async getPanelDimensions() { + const panels = await this.find.allByCssSelector('.react-grid-item'); // These are gridster-defined elements and classes + return await Promise.all( + panels.map(async (panel) => { + const size = await panel.getSize(); + return { + width: size.width, + height: size.height, + }; + }) + ); + } - public getTestVisualizationDescriptions() { - return this.getTestVisualizations().map((visualization) => visualization.description); - } + public async getPanelCount() { + this.log.debug('getPanelCount'); + const panels = await this.testSubjects.findAll('embeddablePanel'); + return panels.length; + } - public async getDashboardPanels() { - return await testSubjects.findAll('embeddablePanel'); - } + public getTestVisualizations() { + return [ + { name: PIE_CHART_VIS_NAME, description: 'PieChart' }, + { name: 'Visualization☺ VerticalBarChart', description: 'VerticalBarChart' }, + { name: AREA_CHART_VIS_NAME, description: 'AreaChart' }, + { name: 'Visualization☺漢字 DataTable', description: 'DataTable' }, + { name: LINE_CHART_VIS_NAME, description: 'LineChart' }, + { name: 'Visualization TileMap', description: 'TileMap' }, + { name: 'Visualization MetricChart', description: 'MetricChart' }, + ]; + } - public async addVisualizations(visualizations: string[]) { - await dashboardAddPanel.addVisualizations(visualizations); - } + public getTestVisualizationNames() { + return this.getTestVisualizations().map((visualization) => visualization.name); + } - public async setSaveAsNewCheckBox(checked: boolean) { - log.debug('saveAsNewCheckbox: ' + checked); - let saveAsNewCheckbox = await testSubjects.find('saveAsNewCheckbox'); - const isAlreadyChecked = (await saveAsNewCheckbox.getAttribute('aria-checked')) === 'true'; - if (isAlreadyChecked !== checked) { - log.debug('Flipping save as new checkbox'); - saveAsNewCheckbox = await testSubjects.find('saveAsNewCheckbox'); - await retry.try(() => saveAsNewCheckbox.click()); - } - } + public getTestVisualizationDescriptions() { + return this.getTestVisualizations().map((visualization) => visualization.description); + } - public async setStoreTimeWithDashboard(checked: boolean) { - log.debug('Storing time with dashboard: ' + checked); - let storeTimeCheckbox = await testSubjects.find('storeTimeWithDashboard'); - const isAlreadyChecked = (await storeTimeCheckbox.getAttribute('aria-checked')) === 'true'; - if (isAlreadyChecked !== checked) { - log.debug('Flipping store time checkbox'); - storeTimeCheckbox = await testSubjects.find('storeTimeWithDashboard'); - await retry.try(() => storeTimeCheckbox.click()); - } - } + public async getDashboardPanels() { + return await this.testSubjects.findAll('embeddablePanel'); + } - public async getSharedItemsCount() { - log.debug('in getSharedItemsCount'); - const attributeName = 'data-shared-items-count'; - const element = await find.byCssSelector(`[${attributeName}]`); - if (element) { - return await element.getAttribute(attributeName); - } + public async addVisualizations(visualizations: string[]) { + await this.dashboardAddPanel.addVisualizations(visualizations); + } - throw new Error('no element'); + public async setSaveAsNewCheckBox(checked: boolean) { + this.log.debug('saveAsNewCheckbox: ' + checked); + let saveAsNewCheckbox = await this.testSubjects.find('saveAsNewCheckbox'); + const isAlreadyChecked = (await saveAsNewCheckbox.getAttribute('aria-checked')) === 'true'; + if (isAlreadyChecked !== checked) { + this.log.debug('Flipping save as new checkbox'); + saveAsNewCheckbox = await this.testSubjects.find('saveAsNewCheckbox'); + await this.retry.try(() => saveAsNewCheckbox.click()); } + } - public async waitForRenderComplete() { - log.debug('waitForRenderComplete'); - const count = await this.getSharedItemsCount(); - // eslint-disable-next-line radix - await renderable.waitForRender(parseInt(count)); + public async setStoreTimeWithDashboard(checked: boolean) { + this.log.debug('Storing time with dashboard: ' + checked); + let storeTimeCheckbox = await this.testSubjects.find('storeTimeWithDashboard'); + const isAlreadyChecked = (await storeTimeCheckbox.getAttribute('aria-checked')) === 'true'; + if (isAlreadyChecked !== checked) { + this.log.debug('Flipping store time checkbox'); + storeTimeCheckbox = await this.testSubjects.find('storeTimeWithDashboard'); + await this.retry.try(() => storeTimeCheckbox.click()); } + } - public async getSharedContainerData() { - log.debug('getSharedContainerData'); - const sharedContainer = await find.byCssSelector('[data-shared-items-container]'); - return { - title: await sharedContainer.getAttribute('data-title'), - description: await sharedContainer.getAttribute('data-description'), - count: await sharedContainer.getAttribute('data-shared-items-count'), - }; + public async getSharedItemsCount() { + this.log.debug('in getSharedItemsCount'); + const attributeName = 'data-shared-items-count'; + const element = await this.find.byCssSelector(`[${attributeName}]`); + if (element) { + return await element.getAttribute(attributeName); } - public async getPanelSharedItemData() { - log.debug('in getPanelSharedItemData'); - const sharedItemscontainer = await find.byCssSelector('[data-shared-items-count]'); - const $ = await sharedItemscontainer.parseDomContent(); - return $('[data-shared-item]') - .toArray() - .map((item) => { - return { - title: $(item).attr('data-title'), - description: $(item).attr('data-description'), - }; - }); - } + throw new Error('no element'); + } - public async checkHideTitle() { - log.debug('ensure that you can click on hide title checkbox'); - await this.openOptions(); - return await testSubjects.click('dashboardPanelTitlesCheckbox'); - } + public async waitForRenderComplete() { + this.log.debug('waitForRenderComplete'); + const count = await this.getSharedItemsCount(); + // eslint-disable-next-line radix + await this.renderable.waitForRender(parseInt(count)); + } - public async expectMissingSaveOption() { - await testSubjects.missingOrFail('dashboardSaveMenuItem'); - } + public async getSharedContainerData() { + this.log.debug('getSharedContainerData'); + const sharedContainer = await this.find.byCssSelector('[data-shared-items-container]'); + return { + title: await sharedContainer.getAttribute('data-title'), + description: await sharedContainer.getAttribute('data-description'), + count: await sharedContainer.getAttribute('data-shared-items-count'), + }; + } - public async expectMissingQuickSaveOption() { - await testSubjects.missingOrFail('dashboardQuickSaveMenuItem'); - } - public async expectExistsQuickSaveOption() { - await testSubjects.existOrFail('dashboardQuickSaveMenuItem'); - } + public async getPanelSharedItemData() { + this.log.debug('in getPanelSharedItemData'); + const sharedItemscontainer = await this.find.byCssSelector('[data-shared-items-count]'); + const $ = await sharedItemscontainer.parseDomContent(); + return $('[data-shared-item]') + .toArray() + .map((item) => { + return { + title: $(item).attr('data-title'), + description: $(item).attr('data-description'), + }; + }); + } - public async expectQuickSaveButtonEnabled() { - log.debug('expectQuickSaveButtonEnabled'); - const quickSaveButton = await testSubjects.find('dashboardQuickSaveMenuItem'); - const isDisabled = await quickSaveButton.getAttribute('disabled'); - if (isDisabled) { - throw new Error('Quick save button disabled'); - } - } + public async checkHideTitle() { + this.log.debug('ensure that you can click on hide title checkbox'); + await this.openOptions(); + return await this.testSubjects.click('dashboardPanelTitlesCheckbox'); + } - public async getNotLoadedVisualizations(vizList: string[]) { - const checkList = []; - for (const name of vizList) { - const isPresent = await testSubjects.exists( - `embeddablePanelHeading-${name.replace(/\s+/g, '')}`, - { timeout: 10000 } - ); - checkList.push({ name, isPresent }); - } + public async expectMissingSaveOption() { + await this.testSubjects.missingOrFail('dashboardSaveMenuItem'); + } + + public async expectMissingQuickSaveOption() { + await this.testSubjects.missingOrFail('dashboardQuickSaveMenuItem'); + } + public async expectExistsQuickSaveOption() { + await this.testSubjects.existOrFail('dashboardQuickSaveMenuItem'); + } - return checkList.filter((viz) => viz.isPresent === false).map((viz) => viz.name); + public async expectQuickSaveButtonEnabled() { + this.log.debug('expectQuickSaveButtonEnabled'); + const quickSaveButton = await this.testSubjects.find('dashboardQuickSaveMenuItem'); + const isDisabled = await quickSaveButton.getAttribute('disabled'); + if (isDisabled) { + throw new Error('Quick save button disabled'); } + } - public async getPanelDrilldownCount(panelIndex = 0): Promise { - log.debug('getPanelDrilldownCount'); - const panel = (await this.getDashboardPanels())[panelIndex]; - try { - const count = await panel.findByTestSubject( - 'embeddablePanelNotification-ACTION_PANEL_NOTIFICATIONS' - ); - return Number.parseInt(await count.getVisibleText(), 10); - } catch (e) { - // if not found then this is 0 (we don't show badge with 0) - return 0; - } + public async getNotLoadedVisualizations(vizList: string[]) { + const checkList = []; + for (const name of vizList) { + const isPresent = await this.testSubjects.exists( + `embeddablePanelHeading-${name.replace(/\s+/g, '')}`, + { timeout: 10000 } + ); + checkList.push({ name, isPresent }); } - public async getPanelChartDebugState(panelIndex: number) { - return await elasticChart.getChartDebugData(undefined, panelIndex); + return checkList.filter((viz) => viz.isPresent === false).map((viz) => viz.name); + } + + public async getPanelDrilldownCount(panelIndex = 0): Promise { + this.log.debug('getPanelDrilldownCount'); + const panel = (await this.getDashboardPanels())[panelIndex]; + try { + const count = await panel.findByTestSubject( + 'embeddablePanelNotification-ACTION_PANEL_NOTIFICATIONS' + ); + return Number.parseInt(await count.getVisibleText(), 10); + } catch (e) { + // if not found then this is 0 (we don't show badge with 0) + return 0; } } - return new DashboardPage(); + public async getPanelChartDebugState(panelIndex: number) { + return await this.elasticChart.getChartDebugData(undefined, panelIndex); + } } diff --git a/test/functional/page_objects/discover_page.ts b/test/functional/page_objects/discover_page.ts index 436d22d659aec6..41c4441a1c95de 100644 --- a/test/functional/page_objects/discover_page.ts +++ b/test/functional/page_objects/discover_page.ts @@ -6,511 +6,510 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; - -export function DiscoverPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const retry = getService('retry'); - const testSubjects = getService('testSubjects'); - const find = getService('find'); - const flyout = getService('flyout'); - const { header } = getPageObjects(['header']); - const browser = getService('browser'); - const globalNav = getService('globalNav'); - const elasticChart = getService('elasticChart'); - const docTable = getService('docTable'); - const config = getService('config'); - const defaultFindTimeout = config.get('timeouts.find'); - const dataGrid = getService('dataGrid'); - const kibanaServer = getService('kibanaServer'); - - class DiscoverPage { - public async getChartTimespan() { - const el = await find.byCssSelector('[data-test-subj="discoverIntervalDateRange"]'); - return await el.getVisibleText(); - } +import { FtrService } from '../ftr_provider_context'; + +export class DiscoverPageObject extends FtrService { + private readonly retry = this.ctx.getService('retry'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly find = this.ctx.getService('find'); + private readonly flyout = this.ctx.getService('flyout'); + private readonly header = this.ctx.getPageObject('header'); + private readonly browser = this.ctx.getService('browser'); + private readonly globalNav = this.ctx.getService('globalNav'); + private readonly elasticChart = this.ctx.getService('elasticChart'); + private readonly docTable = this.ctx.getService('docTable'); + private readonly config = this.ctx.getService('config'); + private readonly dataGrid = this.ctx.getService('dataGrid'); + private readonly kibanaServer = this.ctx.getService('kibanaServer'); + + private readonly defaultFindTimeout = this.config.get('timeouts.find'); + + public async getChartTimespan() { + const el = await this.find.byCssSelector('[data-test-subj="discoverIntervalDateRange"]'); + return await el.getVisibleText(); + } - public async getDocTable() { - const isLegacyDefault = await this.useLegacyTable(); - if (isLegacyDefault) { - return docTable; - } else { - return dataGrid; - } + public async getDocTable() { + const isLegacyDefault = await this.useLegacyTable(); + if (isLegacyDefault) { + return this.docTable; + } else { + return this.dataGrid; } + } - public async findFieldByName(name: string) { - const fieldSearch = await testSubjects.find('fieldFilterSearchInput'); - await fieldSearch.type(name); - } + public async findFieldByName(name: string) { + const fieldSearch = await this.testSubjects.find('fieldFilterSearchInput'); + await fieldSearch.type(name); + } - public async clearFieldSearchInput() { - const fieldSearch = await testSubjects.find('fieldFilterSearchInput'); - await fieldSearch.clearValue(); - } + public async clearFieldSearchInput() { + const fieldSearch = await this.testSubjects.find('fieldFilterSearchInput'); + await fieldSearch.clearValue(); + } - public async saveSearch(searchName: string) { - await this.clickSaveSearchButton(); - // preventing an occasional flakiness when the saved object wasn't set and the form can't be submitted - await retry.waitFor( - `saved search title is set to ${searchName} and save button is clickable`, - async () => { - const saveButton = await testSubjects.find('confirmSaveSavedObjectButton'); - await testSubjects.setValue('savedObjectTitle', searchName); - return (await saveButton.getAttribute('disabled')) !== 'true'; - } - ); - await testSubjects.click('confirmSaveSavedObjectButton'); - await header.waitUntilLoadingHasFinished(); - // LeeDr - this additional checking for the saved search name was an attempt - // to cause this method to wait for the reloading of the page to complete so - // that the next action wouldn't have to retry. But it doesn't really solve - // that issue. But it does typically take about 3 retries to - // complete with the expected searchName. - await retry.waitFor(`saved search was persisted with name ${searchName}`, async () => { - return (await this.getCurrentQueryName()) === searchName; - }); - } + public async saveSearch(searchName: string) { + await this.clickSaveSearchButton(); + // preventing an occasional flakiness when the saved object wasn't set and the form can't be submitted + await this.retry.waitFor( + `saved search title is set to ${searchName} and save button is clickable`, + async () => { + const saveButton = await this.testSubjects.find('confirmSaveSavedObjectButton'); + await this.testSubjects.setValue('savedObjectTitle', searchName); + return (await saveButton.getAttribute('disabled')) !== 'true'; + } + ); + await this.testSubjects.click('confirmSaveSavedObjectButton'); + await this.header.waitUntilLoadingHasFinished(); + // LeeDr - this additional checking for the saved search name was an attempt + // to cause this method to wait for the reloading of the page to complete so + // that the next action wouldn't have to retry. But it doesn't really solve + // that issue. But it does typically take about 3 retries to + // complete with the expected searchName. + await this.retry.waitFor(`saved search was persisted with name ${searchName}`, async () => { + return (await this.getCurrentQueryName()) === searchName; + }); + } - public async inputSavedSearchTitle(searchName: string) { - await testSubjects.setValue('savedObjectTitle', searchName); - } + public async inputSavedSearchTitle(searchName: string) { + await this.testSubjects.setValue('savedObjectTitle', searchName); + } - public async clickConfirmSavedSearch() { - await testSubjects.click('confirmSaveSavedObjectButton'); - } + public async clickConfirmSavedSearch() { + await this.testSubjects.click('confirmSaveSavedObjectButton'); + } - public async openAddFilterPanel() { - await testSubjects.click('addFilter'); - } + public async openAddFilterPanel() { + await this.testSubjects.click('addFilter'); + } - public async waitUntilSearchingHasFinished() { - await testSubjects.missingOrFail('loadingSpinner', { timeout: defaultFindTimeout * 10 }); + public async waitUntilSearchingHasFinished() { + await this.testSubjects.missingOrFail('loadingSpinner', { + timeout: this.defaultFindTimeout * 10, + }); + } + + public async getColumnHeaders() { + const isLegacy = await this.useLegacyTable(); + if (isLegacy) { + return await this.docTable.getHeaderFields('embeddedSavedSearchDocTable'); } + const table = await this.getDocTable(); + return await table.getHeaderFields(); + } - public async getColumnHeaders() { - const isLegacy = await this.useLegacyTable(); - if (isLegacy) { - return await docTable.getHeaderFields('embeddedSavedSearchDocTable'); - } - const table = await this.getDocTable(); - return await table.getHeaderFields(); + public async openLoadSavedSearchPanel() { + let isOpen = await this.testSubjects.exists('loadSearchForm'); + if (isOpen) { + return; } - public async openLoadSavedSearchPanel() { - let isOpen = await testSubjects.exists('loadSearchForm'); - if (isOpen) { - return; - } + // We need this try loop here because previous actions in Discover like + // saving a search cause reloading of the page and the "Open" menu item goes stale. + await this.retry.waitFor('saved search panel is opened', async () => { + await this.clickLoadSavedSearchButton(); + await this.header.waitUntilLoadingHasFinished(); + isOpen = await this.testSubjects.exists('loadSearchForm'); + return isOpen === true; + }); + } - // We need this try loop here because previous actions in Discover like - // saving a search cause reloading of the page and the "Open" menu item goes stale. - await retry.waitFor('saved search panel is opened', async () => { - await this.clickLoadSavedSearchButton(); - await header.waitUntilLoadingHasFinished(); - isOpen = await testSubjects.exists('loadSearchForm'); - return isOpen === true; - }); - } + public async closeLoadSaveSearchPanel() { + await this.flyout.ensureClosed('loadSearchForm'); + } - public async closeLoadSaveSearchPanel() { - await flyout.ensureClosed('loadSearchForm'); - } + public async hasSavedSearch(searchName: string) { + const searchLink = await this.find.byButtonText(searchName); + return await searchLink.isDisplayed(); + } - public async hasSavedSearch(searchName: string) { - const searchLink = await find.byButtonText(searchName); - return await searchLink.isDisplayed(); - } + public async loadSavedSearch(searchName: string) { + await this.openLoadSavedSearchPanel(); + await this.testSubjects.click(`savedObjectTitle${searchName.split(' ').join('-')}`); + await this.header.waitUntilLoadingHasFinished(); + } - public async loadSavedSearch(searchName: string) { - await this.openLoadSavedSearchPanel(); - await testSubjects.click(`savedObjectTitle${searchName.split(' ').join('-')}`); - await header.waitUntilLoadingHasFinished(); - } + public async clickNewSearchButton() { + await this.testSubjects.click('discoverNewButton'); + await this.header.waitUntilLoadingHasFinished(); + } - public async clickNewSearchButton() { - await testSubjects.click('discoverNewButton'); - await header.waitUntilLoadingHasFinished(); - } + public async clickSaveSearchButton() { + await this.testSubjects.click('discoverSaveButton'); + } - public async clickSaveSearchButton() { - await testSubjects.click('discoverSaveButton'); - } + public async clickLoadSavedSearchButton() { + await this.testSubjects.moveMouseTo('discoverOpenButton'); + await this.testSubjects.click('discoverOpenButton'); + } - public async clickLoadSavedSearchButton() { - await testSubjects.moveMouseTo('discoverOpenButton'); - await testSubjects.click('discoverOpenButton'); - } + public async clickResetSavedSearchButton() { + await this.testSubjects.moveMouseTo('resetSavedSearch'); + await this.testSubjects.click('resetSavedSearch'); + await this.header.waitUntilLoadingHasFinished(); + } - public async clickResetSavedSearchButton() { - await testSubjects.moveMouseTo('resetSavedSearch'); - await testSubjects.click('resetSavedSearch'); - await header.waitUntilLoadingHasFinished(); - } + public async closeLoadSavedSearchPanel() { + await this.testSubjects.click('euiFlyoutCloseButton'); + } - public async closeLoadSavedSearchPanel() { - await testSubjects.click('euiFlyoutCloseButton'); - } + public async clickHistogramBar() { + await this.elasticChart.waitForRenderComplete(); + const el = await this.elasticChart.getCanvas(); - public async clickHistogramBar() { - await elasticChart.waitForRenderComplete(); - const el = await elasticChart.getCanvas(); + await this.browser.getActions().move({ x: 0, y: 0, origin: el._webElement }).click().perform(); + } - await browser.getActions().move({ x: 0, y: 0, origin: el._webElement }).click().perform(); - } + public async brushHistogram() { + await this.elasticChart.waitForRenderComplete(); + const el = await this.elasticChart.getCanvas(); - public async brushHistogram() { - await elasticChart.waitForRenderComplete(); - const el = await elasticChart.getCanvas(); + await this.browser.dragAndDrop( + { location: el, offset: { x: -300, y: 20 } }, + { location: el, offset: { x: -100, y: 30 } } + ); + } - await browser.dragAndDrop( - { location: el, offset: { x: -300, y: 20 } }, - { location: el, offset: { x: -100, y: 30 } } - ); - } + public async getCurrentQueryName() { + return await this.globalNav.getLastBreadcrumb(); + } - public async getCurrentQueryName() { - return await globalNav.getLastBreadcrumb(); - } + public async getChartInterval() { + const selectedValue = await this.testSubjects.getAttribute('discoverIntervalSelect', 'value'); + const selectedOption = await this.find.byCssSelector(`option[value="${selectedValue}"]`); + return selectedOption.getVisibleText(); + } - public async getChartInterval() { - const selectedValue = await testSubjects.getAttribute('discoverIntervalSelect', 'value'); - const selectedOption = await find.byCssSelector(`option[value="${selectedValue}"]`); - return selectedOption.getVisibleText(); - } + public async getChartIntervalWarningIcon() { + await this.header.waitUntilLoadingHasFinished(); + return await this.find.existsByCssSelector('.euiToolTipAnchor'); + } - public async getChartIntervalWarningIcon() { - await header.waitUntilLoadingHasFinished(); - return await find.existsByCssSelector('.euiToolTipAnchor'); - } + public async setChartInterval(interval: string) { + const optionElement = await this.find.byCssSelector(`option[label="${interval}"]`, 5000); + await optionElement.click(); + return await this.header.waitUntilLoadingHasFinished(); + } - public async setChartInterval(interval: string) { - const optionElement = await find.byCssSelector(`option[label="${interval}"]`, 5000); - await optionElement.click(); - return await header.waitUntilLoadingHasFinished(); - } + public async getHitCount() { + await this.header.waitUntilLoadingHasFinished(); + return await this.testSubjects.getVisibleText('discoverQueryHits'); + } - public async getHitCount() { - await header.waitUntilLoadingHasFinished(); - return await testSubjects.getVisibleText('discoverQueryHits'); - } + public async getDocHeader() { + const table = await this.getDocTable(); + const docHeader = await table.getHeaders(); + return docHeader.join(); + } - public async getDocHeader() { - const table = await this.getDocTable(); - const docHeader = await table.getHeaders(); - return docHeader.join(); - } + public async getDocTableRows() { + await this.header.waitUntilLoadingHasFinished(); + const table = await this.getDocTable(); + return await table.getBodyRows(); + } - public async getDocTableRows() { - await header.waitUntilLoadingHasFinished(); - const table = await this.getDocTable(); - return await table.getBodyRows(); - } + public async useLegacyTable() { + return (await this.kibanaServer.uiSettings.get('doc_table:legacy')) !== false; + } - public async useLegacyTable() { - return (await kibanaServer.uiSettings.get('doc_table:legacy')) !== false; + public async getDocTableIndex(index: number) { + const isLegacyDefault = await this.useLegacyTable(); + if (isLegacyDefault) { + const row = await this.find.byCssSelector(`tr.kbnDocTable__row:nth-child(${index})`); + return await row.getVisibleText(); } - public async getDocTableIndex(index: number) { - const isLegacyDefault = await this.useLegacyTable(); - if (isLegacyDefault) { - const row = await find.byCssSelector(`tr.kbnDocTable__row:nth-child(${index})`); - return await row.getVisibleText(); - } + const row = await this.dataGrid.getRow({ rowIndex: index - 1 }); + const result = await Promise.all(row.map(async (cell) => await cell.getVisibleText())); + // Remove control columns + return result.slice(2).join(' '); + } - const row = await dataGrid.getRow({ rowIndex: index - 1 }); - const result = await Promise.all(row.map(async (cell) => await cell.getVisibleText())); - // Remove control columns - return result.slice(2).join(' '); - } + public async getDocTableIndexLegacy(index: number) { + const row = await this.find.byCssSelector(`tr.kbnDocTable__row:nth-child(${index})`); + return await row.getVisibleText(); + } - public async getDocTableIndexLegacy(index: number) { - const row = await find.byCssSelector(`tr.kbnDocTable__row:nth-child(${index})`); - return await row.getVisibleText(); + public async getDocTableField(index: number, cellIdx: number = -1) { + const isLegacyDefault = await this.useLegacyTable(); + const usedDefaultCellIdx = isLegacyDefault ? 0 : 2; + const usedCellIdx = cellIdx === -1 ? usedDefaultCellIdx : cellIdx; + if (isLegacyDefault) { + const fields = await this.find.allByCssSelector( + `tr.kbnDocTable__row:nth-child(${index}) [data-test-subj='docTableField']` + ); + return await fields[usedCellIdx].getVisibleText(); } + const row = await this.dataGrid.getRow({ rowIndex: index - 1 }); + const result = await Promise.all(row.map(async (cell) => await cell.getVisibleText())); + return result[usedCellIdx]; + } - public async getDocTableField(index: number, cellIdx: number = -1) { - const isLegacyDefault = await this.useLegacyTable(); - const usedDefaultCellIdx = isLegacyDefault ? 0 : 2; - const usedCellIdx = cellIdx === -1 ? usedDefaultCellIdx : cellIdx; - if (isLegacyDefault) { - const fields = await find.allByCssSelector( - `tr.kbnDocTable__row:nth-child(${index}) [data-test-subj='docTableField']` - ); - return await fields[usedCellIdx].getVisibleText(); - } - const row = await dataGrid.getRow({ rowIndex: index - 1 }); - const result = await Promise.all(row.map(async (cell) => await cell.getVisibleText())); - return result[usedCellIdx]; - } + public async skipToEndOfDocTable() { + // add the focus to the button to make it appear + const skipButton = await this.testSubjects.find('discoverSkipTableButton'); + // force focus on it, to make it interactable + skipButton.focus(); + // now click it! + return skipButton.click(); + } - public async skipToEndOfDocTable() { - // add the focus to the button to make it appear - const skipButton = await testSubjects.find('discoverSkipTableButton'); - // force focus on it, to make it interactable - skipButton.focus(); - // now click it! - return skipButton.click(); - } + /** + * When scrolling down the legacy table there's a link to scroll up + * So this is done by this function + */ + public async backToTop() { + const skipButton = await this.testSubjects.find('discoverBackToTop'); + return skipButton.click(); + } - /** - * When scrolling down the legacy table there's a link to scroll up - * So this is done by this function - */ - public async backToTop() { - const skipButton = await testSubjects.find('discoverBackToTop'); - return skipButton.click(); - } + public async getDocTableFooter() { + return await this.testSubjects.find('discoverDocTableFooter'); + } - public async getDocTableFooter() { - return await testSubjects.find('discoverDocTableFooter'); + public async clickDocSortDown() { + const isLegacyDefault = await this.useLegacyTable(); + if (isLegacyDefault) { + await this.find.clickByCssSelector('.fa-sort-down'); + } else { + await this.dataGrid.clickDocSortAsc(); } + } - public async clickDocSortDown() { - const isLegacyDefault = await this.useLegacyTable(); - if (isLegacyDefault) { - await find.clickByCssSelector('.fa-sort-down'); - } else { - await dataGrid.clickDocSortAsc(); - } + public async clickDocSortUp() { + const isLegacyDefault = await this.useLegacyTable(); + if (isLegacyDefault) { + await this.find.clickByCssSelector('.fa-sort-up'); + } else { + await this.dataGrid.clickDocSortDesc(); } + } - public async clickDocSortUp() { - const isLegacyDefault = await this.useLegacyTable(); - if (isLegacyDefault) { - await find.clickByCssSelector('.fa-sort-up'); - } else { - await dataGrid.clickDocSortDesc(); - } - } + public async isShowingDocViewer() { + return await this.testSubjects.exists('kbnDocViewer'); + } - public async isShowingDocViewer() { - return await testSubjects.exists('kbnDocViewer'); - } + public async getMarks() { + const table = await this.docTable.getTable(); + const marks = await table.findAllByTagName('mark'); + return await Promise.all(marks.map((mark) => mark.getVisibleText())); + } - public async getMarks() { - const table = await docTable.getTable(); - const marks = await table.findAllByTagName('mark'); - return await Promise.all(marks.map((mark) => mark.getVisibleText())); - } + public async toggleSidebarCollapse() { + return await this.testSubjects.click('collapseSideBarButton'); + } - public async toggleSidebarCollapse() { - return await testSubjects.click('collapseSideBarButton'); - } + public async getAllFieldNames() { + const sidebar = await this.testSubjects.find('discover-sidebar'); + const $ = await sidebar.parseDomContent(); + return $('.dscSidebarField__name') + .toArray() + .map((field) => $(field).text()); + } - public async getAllFieldNames() { - const sidebar = await testSubjects.find('discover-sidebar'); - const $ = await sidebar.parseDomContent(); - return $('.dscSidebarField__name') - .toArray() - .map((field) => $(field).text()); - } + public async editField(field: string) { + await this.retry.try(async () => { + await this.testSubjects.click(`field-${field}`); + await this.testSubjects.click(`discoverFieldListPanelEdit-${field}`); + await this.find.byClassName('indexPatternFieldEditor__form'); + }); + } - public async editField(field: string) { - await retry.try(async () => { - await testSubjects.click(`field-${field}`); - await testSubjects.click(`discoverFieldListPanelEdit-${field}`); - await find.byClassName('indexPatternFieldEditor__form'); - }); - } + public async removeField(field: string) { + await this.testSubjects.click(`field-${field}`); + await this.testSubjects.click(`discoverFieldListPanelDelete-${field}`); + await this.testSubjects.existOrFail('runtimeFieldDeleteConfirmModal'); + } - public async removeField(field: string) { - await testSubjects.click(`field-${field}`); - await testSubjects.click(`discoverFieldListPanelDelete-${field}`); - await testSubjects.existOrFail('runtimeFieldDeleteConfirmModal'); - } + public async clickIndexPatternActions() { + await this.retry.try(async () => { + await this.testSubjects.click('discoverIndexPatternActions'); + await this.testSubjects.existOrFail('discover-addRuntimeField-popover'); + }); + } - public async clickIndexPatternActions() { - await retry.try(async () => { - await testSubjects.click('discoverIndexPatternActions'); - await testSubjects.existOrFail('discover-addRuntimeField-popover'); - }); - } + public async clickAddNewField() { + await this.retry.try(async () => { + await this.testSubjects.click('indexPattern-add-field'); + await this.find.byClassName('indexPatternFieldEditor__form'); + }); + } - public async clickAddNewField() { - await retry.try(async () => { - await testSubjects.click('indexPattern-add-field'); - await find.byClassName('indexPatternFieldEditor__form'); - }); - } + public async hasNoResults() { + return await this.testSubjects.exists('discoverNoResults'); + } - public async hasNoResults() { - return await testSubjects.exists('discoverNoResults'); - } + public async hasNoResultsTimepicker() { + return await this.testSubjects.exists('discoverNoResultsTimefilter'); + } - public async hasNoResultsTimepicker() { - return await testSubjects.exists('discoverNoResultsTimefilter'); - } + public async clickFieldListItem(field: string) { + return await this.testSubjects.click(`field-${field}`); + } - public async clickFieldListItem(field: string) { - return await testSubjects.click(`field-${field}`); + public async clickFieldSort(field: string, text = 'Sort New-Old') { + const isLegacyDefault = await this.useLegacyTable(); + if (isLegacyDefault) { + return await this.testSubjects.click(`docTableHeaderFieldSort_${field}`); } + return await this.dataGrid.clickDocSortAsc(field, text); + } - public async clickFieldSort(field: string, text = 'Sort New-Old') { - const isLegacyDefault = await this.useLegacyTable(); - if (isLegacyDefault) { - return await testSubjects.click(`docTableHeaderFieldSort_${field}`); - } - return await dataGrid.clickDocSortAsc(field, text); - } + public async clickFieldListItemToggle(field: string) { + await this.testSubjects.moveMouseTo(`field-${field}`); + await this.testSubjects.click(`fieldToggle-${field}`); + } - public async clickFieldListItemToggle(field: string) { - await testSubjects.moveMouseTo(`field-${field}`); - await testSubjects.click(`fieldToggle-${field}`); - } + public async clickFieldListItemAdd(field: string) { + // a filter check may make sense here, but it should be properly handled to make + // it work with the _score and _source fields as well + await this.clickFieldListItemToggle(field); + } - public async clickFieldListItemAdd(field: string) { - // a filter check may make sense here, but it should be properly handled to make - // it work with the _score and _source fields as well - await this.clickFieldListItemToggle(field); + public async clickFieldListItemRemove(field: string) { + if (!(await this.testSubjects.exists('fieldList-selected'))) { + return; } - - public async clickFieldListItemRemove(field: string) { - if (!(await testSubjects.exists('fieldList-selected'))) { - return; - } - const selectedList = await testSubjects.find('fieldList-selected'); - if (await testSubjects.descendantExists(`field-${field}`, selectedList)) { - await this.clickFieldListItemToggle(field); - } + const selectedList = await this.testSubjects.find('fieldList-selected'); + if (await this.testSubjects.descendantExists(`field-${field}`, selectedList)) { + await this.clickFieldListItemToggle(field); } + } - public async clickFieldListItemVisualize(fieldName: string) { - const field = await testSubjects.find(`field-${fieldName}-showDetails`); - const isActive = await field.elementHasClass('dscSidebarItem--active'); + public async clickFieldListItemVisualize(fieldName: string) { + const field = await this.testSubjects.find(`field-${fieldName}-showDetails`); + const isActive = await field.elementHasClass('dscSidebarItem--active'); - if (!isActive) { - // expand the field to show the "Visualize" button - await field.click(); - } - - await testSubjects.click(`fieldVisualize-${fieldName}`); + if (!isActive) { + // expand the field to show the "Visualize" button + await field.click(); } - public async expectFieldListItemVisualize(field: string) { - await testSubjects.existOrFail(`fieldVisualize-${field}`); - } + await this.testSubjects.click(`fieldVisualize-${fieldName}`); + } - public async expectMissingFieldListItemVisualize(field: string) { - await testSubjects.missingOrFail(`fieldVisualize-${field}`); - } + public async expectFieldListItemVisualize(field: string) { + await this.testSubjects.existOrFail(`fieldVisualize-${field}`); + } - public async clickFieldListPlusFilter(field: string, value: string) { - const plusFilterTestSubj = `plus-${field}-${value}`; - if (!(await testSubjects.exists(plusFilterTestSubj))) { - // field has to be open - await this.clickFieldListItem(field); - } - // testSubjects.find doesn't handle spaces in the data-test-subj value - await testSubjects.click(plusFilterTestSubj); - await header.waitUntilLoadingHasFinished(); - } + public async expectMissingFieldListItemVisualize(field: string) { + await this.testSubjects.missingOrFail(`fieldVisualize-${field}`); + } - public async clickFieldListMinusFilter(field: string, value: string) { - // this method requires the field details to be open from clickFieldListItem() - // testSubjects.find doesn't handle spaces in the data-test-subj value - await testSubjects.click(`minus-${field}-${value}`); - await header.waitUntilLoadingHasFinished(); + public async clickFieldListPlusFilter(field: string, value: string) { + const plusFilterTestSubj = `plus-${field}-${value}`; + if (!(await this.testSubjects.exists(plusFilterTestSubj))) { + // field has to be open + await this.clickFieldListItem(field); } + // this.testSubjects.find doesn't handle spaces in the data-test-subj value + await this.testSubjects.click(plusFilterTestSubj); + await this.header.waitUntilLoadingHasFinished(); + } - public async selectIndexPattern(indexPattern: string) { - await testSubjects.click('indexPattern-switch-link'); - await find.setValue('[data-test-subj="indexPattern-switcher"] input', indexPattern); - await find.clickByCssSelector( - `[data-test-subj="indexPattern-switcher"] [title="${indexPattern}"]` - ); - await header.waitUntilLoadingHasFinished(); - } + public async clickFieldListMinusFilter(field: string, value: string) { + // this method requires the field details to be open from clickFieldListItem() + // this.testSubjects.find doesn't handle spaces in the data-test-subj value + await this.testSubjects.click(`minus-${field}-${value}`); + await this.header.waitUntilLoadingHasFinished(); + } - public async removeHeaderColumn(name: string) { - const isLegacyDefault = await this.useLegacyTable(); - if (isLegacyDefault) { - await testSubjects.moveMouseTo(`docTableHeader-${name}`); - await testSubjects.click(`docTableRemoveHeader-${name}`); - } else { - await dataGrid.clickRemoveColumn(name); - } - } + public async selectIndexPattern(indexPattern: string) { + await this.testSubjects.click('indexPattern-switch-link'); + await this.find.setValue('[data-test-subj="indexPattern-switcher"] input', indexPattern); + await this.find.clickByCssSelector( + `[data-test-subj="indexPattern-switcher"] [title="${indexPattern}"]` + ); + await this.header.waitUntilLoadingHasFinished(); + } - public async openSidebarFieldFilter() { - await testSubjects.click('toggleFieldFilterButton'); - await testSubjects.existOrFail('filterSelectionPanel'); + public async removeHeaderColumn(name: string) { + const isLegacyDefault = await this.useLegacyTable(); + if (isLegacyDefault) { + await this.testSubjects.moveMouseTo(`docTableHeader-${name}`); + await this.testSubjects.click(`docTableRemoveHeader-${name}`); + } else { + await this.dataGrid.clickRemoveColumn(name); } + } - public async closeSidebarFieldFilter() { - await testSubjects.click('toggleFieldFilterButton'); - await testSubjects.missingOrFail('filterSelectionPanel'); - } + public async openSidebarFieldFilter() { + await this.testSubjects.click('toggleFieldFilterButton'); + await this.testSubjects.existOrFail('filterSelectionPanel'); + } - public async waitForChartLoadingComplete(renderCount: number) { - await elasticChart.waitForRenderingCount(renderCount, 'discoverChart'); - } + public async closeSidebarFieldFilter() { + await this.testSubjects.click('toggleFieldFilterButton'); + await this.testSubjects.missingOrFail('filterSelectionPanel'); + } - public async waitForDocTableLoadingComplete() { - await testSubjects.waitForAttributeToChange( - 'discoverDocTable', - 'data-render-complete', - 'true' - ); - } - public async getNrOfFetches() { - const el = await find.byCssSelector('[data-fetch-counter]'); - const nr = await el.getAttribute('data-fetch-counter'); - return Number(nr); - } + public async waitForChartLoadingComplete(renderCount: number) { + await this.elasticChart.waitForRenderingCount(renderCount, 'discoverChart'); + } - /** - * Check if Discover app is currently rendered on the screen. - */ - public async isDiscoverAppOnScreen(): Promise { - const result = await find.allByCssSelector('discover-app'); - return result.length === 1; - } + public async waitForDocTableLoadingComplete() { + await this.testSubjects.waitForAttributeToChange( + 'discoverDocTable', + 'data-render-complete', + 'true' + ); + } + public async getNrOfFetches() { + const el = await this.find.byCssSelector('[data-fetch-counter]'); + const nr = await el.getAttribute('data-fetch-counter'); + return Number(nr); + } - /** - * Wait until Discover app is rendered on the screen. - */ - public async waitForDiscoverAppOnScreen() { - await retry.waitFor('Discover app on screen', async () => { - return await this.isDiscoverAppOnScreen(); - }); - } + /** + * Check if Discover app is currently rendered on the screen. + */ + public async isDiscoverAppOnScreen(): Promise { + const result = await this.find.allByCssSelector('discover-app'); + return result.length === 1; + } - public async showAllFilterActions() { - await testSubjects.click('showFilterActions'); - } + /** + * Wait until Discover app is rendered on the screen. + */ + public async waitForDiscoverAppOnScreen() { + await this.retry.waitFor('Discover app on screen', async () => { + return await this.isDiscoverAppOnScreen(); + }); + } - public async clickSavedQueriesPopOver() { - await testSubjects.click('saved-query-management-popover-button'); - } + public async showAllFilterActions() { + await this.testSubjects.click('showFilterActions'); + } - public async clickCurrentSavedQuery() { - await testSubjects.click('saved-query-management-save-button'); - } + public async clickSavedQueriesPopOver() { + await this.testSubjects.click('saved-query-management-popover-button'); + } - public async setSaveQueryFormTitle(savedQueryName: string) { - await testSubjects.setValue('saveQueryFormTitle', savedQueryName); - } + public async clickCurrentSavedQuery() { + await this.testSubjects.click('saved-query-management-save-button'); + } - public async toggleIncludeFilters() { - await testSubjects.click('saveQueryFormIncludeFiltersOption'); - } + public async setSaveQueryFormTitle(savedQueryName: string) { + await this.testSubjects.setValue('saveQueryFormTitle', savedQueryName); + } - public async saveCurrentSavedQuery() { - await testSubjects.click('savedQueryFormSaveButton'); - } + public async toggleIncludeFilters() { + await this.testSubjects.click('saveQueryFormIncludeFiltersOption'); + } - public async deleteSavedQuery() { - await testSubjects.click('delete-saved-query-TEST-button'); - } + public async saveCurrentSavedQuery() { + await this.testSubjects.click('savedQueryFormSaveButton'); + } - public async confirmDeletionOfSavedQuery() { - await testSubjects.click('confirmModalConfirmButton'); - } + public async deleteSavedQuery() { + await this.testSubjects.click('delete-saved-query-TEST-button'); + } - public async clearSavedQuery() { - await testSubjects.click('saved-query-management-clear-button'); - } + public async confirmDeletionOfSavedQuery() { + await this.testSubjects.click('confirmModalConfirmButton'); } - return new DiscoverPage(); + public async clearSavedQuery() { + await this.testSubjects.click('saved-query-management-clear-button'); + } } diff --git a/test/functional/page_objects/error_page.ts b/test/functional/page_objects/error_page.ts index 99c17c632720a1..b0166e3753dd55 100644 --- a/test/functional/page_objects/error_page.ts +++ b/test/functional/page_objects/error_page.ts @@ -7,28 +7,24 @@ */ import expect from '@kbn/expect'; -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; -export function ErrorPageProvider({ getPageObjects }: FtrProviderContext) { - const { common } = getPageObjects(['common']); +export class ErrorPageObject extends FtrService { + private readonly common = this.ctx.getPageObject('common'); - class ErrorPage { - public async expectForbidden() { - const messageText = await common.getBodyText(); - expect(messageText).to.contain('You do not have permission to access the requested page'); - } - - public async expectNotFound() { - const messageText = await common.getJsonBodyText(); - expect(messageText).to.eql( - JSON.stringify({ - statusCode: 404, - error: 'Not Found', - message: 'Not Found', - }) - ); - } + public async expectForbidden() { + const messageText = await this.common.getBodyText(); + expect(messageText).to.contain('You do not have permission to access the requested page'); } - return new ErrorPage(); + public async expectNotFound() { + const messageText = await this.common.getJsonBodyText(); + expect(messageText).to.eql( + JSON.stringify({ + statusCode: 404, + error: 'Not Found', + message: 'Not Found', + }) + ); + } } diff --git a/test/functional/page_objects/header_page.ts b/test/functional/page_objects/header_page.ts index c5a796a1eb13be..8597a4b4ee2fbb 100644 --- a/test/functional/page_objects/header_page.ts +++ b/test/functional/page_objects/header_page.ts @@ -6,92 +6,88 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; -export function HeaderPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const config = getService('config'); - const log = getService('log'); - const retry = getService('retry'); - const testSubjects = getService('testSubjects'); - const appsMenu = getService('appsMenu'); - const PageObjects = getPageObjects(['common']); +export class HeaderPageObject extends FtrService { + private readonly config = this.ctx.getService('config'); + private readonly log = this.ctx.getService('log'); + private readonly retry = this.ctx.getService('retry'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly appsMenu = this.ctx.getService('appsMenu'); + private readonly common = this.ctx.getPageObject('common'); - const defaultFindTimeout = config.get('timeouts.find'); + private readonly defaultFindTimeout = this.config.get('timeouts.find'); - class HeaderPage { - public async clickDiscover(ignoreAppLeaveWarning = false) { - await appsMenu.clickLink('Discover', { category: 'kibana' }); - await this.onAppLeaveWarning(ignoreAppLeaveWarning); - await PageObjects.common.waitForTopNavToBeVisible(); - await this.awaitGlobalLoadingIndicatorHidden(); - } + public async clickDiscover(ignoreAppLeaveWarning = false) { + await this.appsMenu.clickLink('Discover', { category: 'kibana' }); + await this.onAppLeaveWarning(ignoreAppLeaveWarning); + await this.common.waitForTopNavToBeVisible(); + await this.awaitGlobalLoadingIndicatorHidden(); + } - public async clickVisualize(ignoreAppLeaveWarning = false) { - await appsMenu.clickLink('Visualize Library', { category: 'kibana' }); - await this.onAppLeaveWarning(ignoreAppLeaveWarning); - await this.awaitGlobalLoadingIndicatorHidden(); - await retry.waitFor('Visualize app to be loaded', async () => { - const isNavVisible = await testSubjects.exists('top-nav'); - return isNavVisible; - }); - } + public async clickVisualize(ignoreAppLeaveWarning = false) { + await this.appsMenu.clickLink('Visualize Library', { category: 'kibana' }); + await this.onAppLeaveWarning(ignoreAppLeaveWarning); + await this.awaitGlobalLoadingIndicatorHidden(); + await this.retry.waitFor('Visualize app to be loaded', async () => { + const isNavVisible = await this.testSubjects.exists('top-nav'); + return isNavVisible; + }); + } - public async clickDashboard() { - await appsMenu.clickLink('Dashboard', { category: 'kibana' }); - await retry.waitFor('dashboard app to be loaded', async () => { - const isNavVisible = await testSubjects.exists('top-nav'); - const isLandingPageVisible = await testSubjects.exists('dashboardLandingPage'); - return isNavVisible || isLandingPageVisible; - }); - await this.awaitGlobalLoadingIndicatorHidden(); - } + public async clickDashboard() { + await this.appsMenu.clickLink('Dashboard', { category: 'kibana' }); + await this.retry.waitFor('dashboard app to be loaded', async () => { + const isNavVisible = await this.testSubjects.exists('top-nav'); + const isLandingPageVisible = await this.testSubjects.exists('dashboardLandingPage'); + return isNavVisible || isLandingPageVisible; + }); + await this.awaitGlobalLoadingIndicatorHidden(); + } - public async clickStackManagement() { - await appsMenu.clickLink('Stack Management', { category: 'management' }); - await this.awaitGlobalLoadingIndicatorHidden(); - } + public async clickStackManagement() { + await this.appsMenu.clickLink('Stack Management', { category: 'management' }); + await this.awaitGlobalLoadingIndicatorHidden(); + } - public async waitUntilLoadingHasFinished() { - try { - await this.isGlobalLoadingIndicatorVisible(); - } catch (exception) { - if (exception.name === 'ElementNotVisible') { - // selenium might just have been too slow to catch it - } else { - throw exception; - } + public async waitUntilLoadingHasFinished() { + try { + await this.isGlobalLoadingIndicatorVisible(); + } catch (exception) { + if (exception.name === 'ElementNotVisible') { + // selenium might just have been too slow to catch it + } else { + throw exception; } - await this.awaitGlobalLoadingIndicatorHidden(); - } - - public async isGlobalLoadingIndicatorVisible() { - log.debug('isGlobalLoadingIndicatorVisible'); - return await testSubjects.exists('globalLoadingIndicator', { timeout: 1500 }); } + await this.awaitGlobalLoadingIndicatorHidden(); + } - public async awaitGlobalLoadingIndicatorHidden() { - await testSubjects.existOrFail('globalLoadingIndicator-hidden', { - allowHidden: true, - timeout: defaultFindTimeout * 10, - }); - } + public async isGlobalLoadingIndicatorVisible() { + this.log.debug('isGlobalLoadingIndicatorVisible'); + return await this.testSubjects.exists('globalLoadingIndicator', { timeout: 1500 }); + } - public async awaitKibanaChrome() { - log.debug('awaitKibanaChrome'); - await testSubjects.find('kibanaChrome', defaultFindTimeout * 10); - } + public async awaitGlobalLoadingIndicatorHidden() { + await this.testSubjects.existOrFail('globalLoadingIndicator-hidden', { + allowHidden: true, + timeout: this.defaultFindTimeout * 10, + }); + } - public async onAppLeaveWarning(ignoreWarning = false) { - await retry.try(async () => { - const warning = await testSubjects.exists('confirmModalTitleText'); - if (warning) { - await testSubjects.click( - ignoreWarning ? 'confirmModalConfirmButton' : 'confirmModalCancelButton' - ); - } - }); - } + public async awaitKibanaChrome() { + this.log.debug('awaitKibanaChrome'); + await this.testSubjects.find('kibanaChrome', this.defaultFindTimeout * 10); } - return new HeaderPage(); + public async onAppLeaveWarning(ignoreWarning = false) { + await this.retry.try(async () => { + const warning = await this.testSubjects.exists('confirmModalTitleText'); + if (warning) { + await this.testSubjects.click( + ignoreWarning ? 'confirmModalConfirmButton' : 'confirmModalCancelButton' + ); + } + }); + } } diff --git a/test/functional/page_objects/home_page.ts b/test/functional/page_objects/home_page.ts index f03f74ef8c61d9..33de6a33c50f54 100644 --- a/test/functional/page_objects/home_page.ts +++ b/test/functional/page_objects/home_page.ts @@ -6,138 +6,134 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; -export function HomePageProvider({ getService, getPageObjects }: FtrProviderContext) { - const testSubjects = getService('testSubjects'); - const retry = getService('retry'); - const find = getService('find'); - const PageObjects = getPageObjects(['common']); +export class HomePageObject extends FtrService { + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly retry = this.ctx.getService('retry'); + private readonly find = this.ctx.getService('find'); + private readonly common = this.ctx.getPageObject('common'); - class HomePage { - async clickSynopsis(title: string) { - await testSubjects.click(`homeSynopsisLink${title}`); - } - - async doesSynopsisExist(title: string) { - return await testSubjects.exists(`homeSynopsisLink${title}`); - } + async clickSynopsis(title: string) { + await this.testSubjects.click(`homeSynopsisLink${title}`); + } - async doesSampleDataSetExist(id: string) { - return await testSubjects.exists(`sampleDataSetCard${id}`); - } + async doesSynopsisExist(title: string) { + return await this.testSubjects.exists(`homeSynopsisLink${title}`); + } - async isSampleDataSetInstalled(id: string) { - return !(await testSubjects.exists(`addSampleDataSet${id}`)); - } + async doesSampleDataSetExist(id: string) { + return await this.testSubjects.exists(`sampleDataSetCard${id}`); + } - async getVisibileSolutions() { - const solutionPanels = await testSubjects.findAll('~homSolutionPanel', 2000); - const panelAttributes = await Promise.all( - solutionPanels.map((panel) => panel.getAttribute('data-test-subj')) - ); - return panelAttributes.map((attributeValue) => attributeValue.split('homSolutionPanel_')[1]); - } + async isSampleDataSetInstalled(id: string) { + return !(await this.testSubjects.exists(`addSampleDataSet${id}`)); + } - async addSampleDataSet(id: string) { - const isInstalled = await this.isSampleDataSetInstalled(id); - if (!isInstalled) { - await testSubjects.click(`addSampleDataSet${id}`); - await this._waitForSampleDataLoadingAction(id); - } - } + async getVisibileSolutions() { + const solutionPanels = await this.testSubjects.findAll('~homSolutionPanel', 2000); + const panelAttributes = await Promise.all( + solutionPanels.map((panel) => panel.getAttribute('data-test-subj')) + ); + return panelAttributes.map((attributeValue) => attributeValue.split('homSolutionPanel_')[1]); + } - async removeSampleDataSet(id: string) { - // looks like overkill but we're hitting flaky cases where we click but it doesn't remove - await testSubjects.waitForEnabled(`removeSampleDataSet${id}`); - // https://github.com/elastic/kibana/issues/65949 - // Even after waiting for the "Remove" button to be enabled we still have failures - // where it appears the click just didn't work. - await PageObjects.common.sleep(1010); - await testSubjects.click(`removeSampleDataSet${id}`); + async addSampleDataSet(id: string) { + const isInstalled = await this.isSampleDataSetInstalled(id); + if (!isInstalled) { + await this.testSubjects.click(`addSampleDataSet${id}`); await this._waitForSampleDataLoadingAction(id); } + } - // loading action is either uninstall and install - async _waitForSampleDataLoadingAction(id: string) { - const sampleDataCard = await testSubjects.find(`sampleDataSetCard${id}`); - await retry.try(async () => { - // waitForDeletedByCssSelector needs to be inside retry because it will timeout at least once - // before action is complete - await sampleDataCard.waitForDeletedByCssSelector('.euiLoadingSpinner'); - }); - } + async removeSampleDataSet(id: string) { + // looks like overkill but we're hitting flaky cases where we click but it doesn't remove + await this.testSubjects.waitForEnabled(`removeSampleDataSet${id}`); + // https://github.com/elastic/kibana/issues/65949 + // Even after waiting for the "Remove" button to be enabled we still have failures + // where it appears the click just didn't work. + await this.common.sleep(1010); + await this.testSubjects.click(`removeSampleDataSet${id}`); + await this._waitForSampleDataLoadingAction(id); + } - async launchSampleDashboard(id: string) { - await this.launchSampleDataSet(id); - await find.clickByLinkText('Dashboard'); - } + // loading action is either uninstall and install + async _waitForSampleDataLoadingAction(id: string) { + const sampleDataCard = await this.testSubjects.find(`sampleDataSetCard${id}`); + await this.retry.try(async () => { + // waitForDeletedByCssSelector needs to be inside retry because it will timeout at least once + // before action is complete + await sampleDataCard.waitForDeletedByCssSelector('.euiLoadingSpinner'); + }); + } - async launchSampleDataSet(id: string) { - await this.addSampleDataSet(id); - await testSubjects.click(`launchSampleDataSet${id}`); - } + async launchSampleDashboard(id: string) { + await this.launchSampleDataSet(id); + await this.find.clickByLinkText('Dashboard'); + } - async clickAllKibanaPlugins() { - await testSubjects.click('allPlugins'); - } + async launchSampleDataSet(id: string) { + await this.addSampleDataSet(id); + await this.testSubjects.click(`launchSampleDataSet${id}`); + } - async clickVisualizeExplorePlugins() { - await testSubjects.click('tab-data'); - } + async clickAllKibanaPlugins() { + await this.testSubjects.click('allPlugins'); + } - async clickAdminPlugin() { - await testSubjects.click('tab-admin'); - } + async clickVisualizeExplorePlugins() { + await this.testSubjects.click('tab-data'); + } - async clickOnConsole() { - await this.clickSynopsis('console'); - } - async clickOnLogo() { - await testSubjects.click('logo'); - } + async clickAdminPlugin() { + await this.testSubjects.click('tab-admin'); + } - async clickOnAddData() { - await this.clickSynopsis('home_tutorial_directory'); - } + async clickOnConsole() { + await this.clickSynopsis('console'); + } + async clickOnLogo() { + await this.testSubjects.click('logo'); + } - // clicks on Active MQ logs - async clickOnLogsTutorial() { - await this.clickSynopsis('activemqlogs'); - } + async clickOnAddData() { + await this.clickSynopsis('home_tutorial_directory'); + } - // clicks on cloud tutorial link - async clickOnCloudTutorial() { - await testSubjects.click('onCloudTutorial'); - } + // clicks on Active MQ logs + async clickOnLogsTutorial() { + await this.clickSynopsis('activemqlogs'); + } - // click on side nav toggle button to see all of side nav - async clickOnToggleNavButton() { - await testSubjects.click('toggleNavButton'); - } + // clicks on cloud tutorial link + async clickOnCloudTutorial() { + await this.testSubjects.click('onCloudTutorial'); + } - // collapse the observability side nav details - async collapseObservabibilitySideNav() { - await testSubjects.click('collapsibleNavGroup-observability'); - } + // click on side nav toggle button to see all of side nav + async clickOnToggleNavButton() { + await this.testSubjects.click('toggleNavButton'); + } - // dock the side nav - async dockTheSideNav() { - await testSubjects.click('collapsible-nav-lock'); - } + // collapse the observability side nav details + async collapseObservabibilitySideNav() { + await this.testSubjects.click('collapsibleNavGroup-observability'); + } - async loadSavedObjects() { - await retry.try(async () => { - await testSubjects.click('loadSavedObjects'); - const successMsgExists = await testSubjects.exists('loadSavedObjects_success', { - timeout: 5000, - }); - if (!successMsgExists) { - throw new Error('Failed to load saved objects'); - } - }); - } + // dock the side nav + async dockTheSideNav() { + await this.testSubjects.click('collapsible-nav-lock'); } - return new HomePage(); + async loadSavedObjects() { + await this.retry.try(async () => { + await this.testSubjects.click('loadSavedObjects'); + const successMsgExists = await this.testSubjects.exists('loadSavedObjects_success', { + timeout: 5000, + }); + if (!successMsgExists) { + throw new Error('Failed to load saved objects'); + } + }); + } } diff --git a/test/functional/page_objects/index.ts b/test/functional/page_objects/index.ts index 413e0aef1444b5..7c06344c1a1ad5 100644 --- a/test/functional/page_objects/index.ts +++ b/test/functional/page_objects/index.ts @@ -6,54 +6,54 @@ * Side Public License, v 1. */ -import { CommonPageProvider } from './common_page'; -import { ConsolePageProvider } from './console_page'; -import { ContextPageProvider } from './context_page'; -import { DashboardPageProvider } from './dashboard_page'; -import { DiscoverPageProvider } from './discover_page'; -import { ErrorPageProvider } from './error_page'; -import { HeaderPageProvider } from './header_page'; -import { HomePageProvider } from './home_page'; -import { NewsfeedPageProvider } from './newsfeed_page'; -import { SettingsPageProvider } from './settings_page'; -import { SharePageProvider } from './share_page'; -import { LoginPageProvider } from './login_page'; -import { TimePickerProvider } from './time_picker'; -import { TimelionPageProvider } from './timelion_page'; -import { VisualBuilderPageProvider } from './visual_builder_page'; -import { VisualizePageProvider } from './visualize_page'; -import { VisualizeEditorPageProvider } from './visualize_editor_page'; -import { VisualizeChartPageProvider } from './visualize_chart_page'; -import { TileMapPageProvider } from './tile_map_page'; -import { TimeToVisualizePageProvider } from './time_to_visualize_page'; -import { TagCloudPageProvider } from './tag_cloud_page'; -import { VegaChartPageProvider } from './vega_chart_page'; -import { SavedObjectsPageProvider } from './management/saved_objects_page'; -import { LegacyDataTableVisProvider } from './legacy/data_table_vis'; +import { CommonPageObject } from './common_page'; +import { ConsolePageObject } from './console_page'; +import { ContextPageObject } from './context_page'; +import { DashboardPageObject } from './dashboard_page'; +import { DiscoverPageObject } from './discover_page'; +import { ErrorPageObject } from './error_page'; +import { HeaderPageObject } from './header_page'; +import { HomePageObject } from './home_page'; +import { NewsfeedPageObject } from './newsfeed_page'; +import { SettingsPageObject } from './settings_page'; +import { SharePageObject } from './share_page'; +import { LoginPageObject } from './login_page'; +import { TimePickerPageObject } from './time_picker'; +import { TimelionPageObject } from './timelion_page'; +import { VisualBuilderPageObject } from './visual_builder_page'; +import { VisualizePageObject } from './visualize_page'; +import { VisualizeEditorPageObject } from './visualize_editor_page'; +import { VisualizeChartPageObject } from './visualize_chart_page'; +import { TileMapPageObject } from './tile_map_page'; +import { TimeToVisualizePageObject } from './time_to_visualize_page'; +import { TagCloudPageObject } from './tag_cloud_page'; +import { VegaChartPageObject } from './vega_chart_page'; +import { SavedObjectsPageObject } from './management/saved_objects_page'; +import { LegacyDataTableVisPageObject } from './legacy/data_table_vis'; export const pageObjects = { - common: CommonPageProvider, - console: ConsolePageProvider, - context: ContextPageProvider, - dashboard: DashboardPageProvider, - discover: DiscoverPageProvider, - error: ErrorPageProvider, - header: HeaderPageProvider, - home: HomePageProvider, - newsfeed: NewsfeedPageProvider, - settings: SettingsPageProvider, - share: SharePageProvider, - legacyDataTableVis: LegacyDataTableVisProvider, - login: LoginPageProvider, - timelion: TimelionPageProvider, - timePicker: TimePickerProvider, - visualBuilder: VisualBuilderPageProvider, - visualize: VisualizePageProvider, - visEditor: VisualizeEditorPageProvider, - visChart: VisualizeChartPageProvider, - tileMap: TileMapPageProvider, - timeToVisualize: TimeToVisualizePageProvider, - tagCloud: TagCloudPageProvider, - vegaChart: VegaChartPageProvider, - savedObjects: SavedObjectsPageProvider, + common: CommonPageObject, + console: ConsolePageObject, + context: ContextPageObject, + dashboard: DashboardPageObject, + discover: DiscoverPageObject, + error: ErrorPageObject, + header: HeaderPageObject, + home: HomePageObject, + newsfeed: NewsfeedPageObject, + settings: SettingsPageObject, + share: SharePageObject, + legacyDataTableVis: LegacyDataTableVisPageObject, + login: LoginPageObject, + timelion: TimelionPageObject, + timePicker: TimePickerPageObject, + visualBuilder: VisualBuilderPageObject, + visualize: VisualizePageObject, + visEditor: VisualizeEditorPageObject, + visChart: VisualizeChartPageObject, + tileMap: TileMapPageObject, + timeToVisualize: TimeToVisualizePageObject, + tagCloud: TagCloudPageObject, + vegaChart: VegaChartPageObject, + savedObjects: SavedObjectsPageObject, }; diff --git a/test/functional/page_objects/legacy/data_table_vis.ts b/test/functional/page_objects/legacy/data_table_vis.ts index ef787263f2ab9d..122409f28de900 100644 --- a/test/functional/page_objects/legacy/data_table_vis.ts +++ b/test/functional/page_objects/legacy/data_table_vis.ts @@ -6,80 +6,79 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from 'test/functional/ftr_provider_context'; -import { WebElementWrapper } from 'test/functional/services/lib/web_element_wrapper'; +import { FtrService } from '../../ftr_provider_context'; +import { WebElementWrapper } from '../../services/lib/web_element_wrapper'; -export function LegacyDataTableVisProvider({ getService, getPageObjects }: FtrProviderContext) { - const testSubjects = getService('testSubjects'); - const retry = getService('retry'); +export class LegacyDataTableVisPageObject extends FtrService { + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly retry = this.ctx.getService('retry'); - class LegacyDataTableVis { - /** - * Converts the table data into nested array - * [ [cell1_in_row1, cell2_in_row1], [cell1_in_row2, cell2_in_row2] ] - * @param element table - */ - private async getDataFromElement(element: WebElementWrapper): Promise { - const $ = await element.parseDomContent(); - return $('tr') - .toArray() - .map((row) => - $(row) - .find('td') - .toArray() - .map((cell) => - $(cell) - .text() - .replace(/ /g, '') - .trim() - ) - ); - } - - public async getTableVisContent({ stripEmptyRows = true } = {}) { - return await retry.try(async () => { - const container = await testSubjects.find('tableVis'); - const allTables = await testSubjects.findAllDescendant('paginated-table-body', container); + /** + * Converts the table data into nested array + * [ [cell1_in_row1, cell2_in_row1], [cell1_in_row2, cell2_in_row2] ] + * @param element table + */ + private async getDataFromElement(element: WebElementWrapper): Promise { + const $ = await element.parseDomContent(); + return $('tr') + .toArray() + .map((row) => + $(row) + .find('td') + .toArray() + .map((cell) => + $(cell) + .text() + .replace(/ /g, '') + .trim() + ) + ); + } - if (allTables.length === 0) { - return []; - } + public async getTableVisContent({ stripEmptyRows = true } = {}) { + return await this.retry.try(async () => { + const container = await this.testSubjects.find('tableVis'); + const allTables = await this.testSubjects.findAllDescendant( + 'paginated-table-body', + container + ); - const allData = await Promise.all( - allTables.map(async (t) => { - let data = await this.getDataFromElement(t); - if (stripEmptyRows) { - data = data.filter( - (row) => row.length > 0 && row.some((cell) => cell.trim().length > 0) - ); - } - return data; - }) - ); + if (allTables.length === 0) { + return []; + } - if (allTables.length === 1) { - // If there was only one table we return only the data for that table - // This prevents an unnecessary array around that single table, which - // is the case we have in most tests. - return allData[0]; - } + const allData = await Promise.all( + allTables.map(async (t) => { + let data = await this.getDataFromElement(t); + if (stripEmptyRows) { + data = data.filter( + (row) => row.length > 0 && row.some((cell) => cell.trim().length > 0) + ); + } + return data; + }) + ); - return allData; - }); - } + if (allTables.length === 1) { + // If there was only one table we return only the data for that table + // This prevents an unnecessary array around that single table, which + // is the case we have in most tests. + return allData[0]; + } - public async filterOnTableCell(columnIndex: number, rowIndex: number) { - await retry.try(async () => { - const tableVis = await testSubjects.find('tableVis'); - const cell = await tableVis.findByCssSelector( - `tbody tr:nth-child(${rowIndex}) td:nth-child(${columnIndex})` - ); - await cell.moveMouseTo(); - const filterBtn = await testSubjects.findDescendant('filterForCellValue', cell); - await filterBtn.click(); - }); - } + return allData; + }); } - return new LegacyDataTableVis(); + public async filterOnTableCell(columnIndex: number, rowIndex: number) { + await this.retry.try(async () => { + const tableVis = await this.testSubjects.find('tableVis'); + const cell = await tableVis.findByCssSelector( + `tbody tr:nth-child(${rowIndex}) td:nth-child(${columnIndex})` + ); + await cell.moveMouseTo(); + const filterBtn = await this.testSubjects.findDescendant('filterForCellValue', cell); + await filterBtn.click(); + }); + } } diff --git a/test/functional/page_objects/login_page.ts b/test/functional/page_objects/login_page.ts index 606ddf4643c405..5318a2b2d0c154 100644 --- a/test/functional/page_objects/login_page.ts +++ b/test/functional/page_objects/login_page.ts @@ -7,65 +7,61 @@ */ import { delay } from 'bluebird'; -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; -export function LoginPageProvider({ getService }: FtrProviderContext) { - const testSubjects = getService('testSubjects'); - const log = getService('log'); - const find = getService('find'); +export class LoginPageObject extends FtrService { + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly log = this.ctx.getService('log'); + private readonly find = this.ctx.getService('find'); - const regularLogin = async (user: string, pwd: string) => { - await testSubjects.setValue('loginUsername', user); - await testSubjects.setValue('loginPassword', pwd); - await testSubjects.click('loginSubmit'); - await find.waitForDeletedByCssSelector('.kibanaWelcomeLogo'); - await find.byCssSelector('[data-test-subj="kibanaChrome"]', 60000); // 60 sec waiting - }; - - const samlLogin = async (user: string, pwd: string) => { - try { - await find.clickByButtonText('Login using SAML'); - await find.setValue('input[name="email"]', user); - await find.setValue('input[type="password"]', pwd); - await find.clickByCssSelector('.auth0-label-submit'); - await find.byCssSelector('[data-test-subj="kibanaChrome"]', 60000); // 60 sec waiting - } catch (err) { - log.debug(`${err} \nFailed to find Auth0 login page, trying the Auth0 last login page`); - await find.clickByCssSelector('.auth0-lock-social-button'); + async login(user: string, pwd: string) { + const loginType = process.env.VM || ''; + if (loginType.includes('oidc') || loginType.includes('saml')) { + await this.samlLogin(user, pwd); + return; } - }; - class LoginPage { - async login(user: string, pwd: string) { - const loginType = process.env.VM || ''; - if (loginType.includes('oidc') || loginType.includes('saml')) { - await samlLogin(user, pwd); - return; - } + await this.regularLogin(user, pwd); + } - await regularLogin(user, pwd); - } + async logoutLogin(user: string, pwd: string) { + await this.logout(); + await this.sleep(3002); + await this.login(user, pwd); + } - async logoutLogin(user: string, pwd: string) { - await this.logout(); - await this.sleep(3002); - await this.login(user, pwd); - } + async logout() { + await this.testSubjects.click('userMenuButton'); + await this.sleep(500); + await this.testSubjects.click('logoutLink'); + this.log.debug('### found and clicked log out--------------------------'); + await this.sleep(8002); + } - async logout() { - await testSubjects.click('userMenuButton'); - await this.sleep(500); - await testSubjects.click('logoutLink'); - log.debug('### found and clicked log out--------------------------'); - await this.sleep(8002); - } + async sleep(sleepMilliseconds: number) { + this.log.debug(`... sleep(${sleepMilliseconds}) start`); + await delay(sleepMilliseconds); + this.log.debug(`... sleep(${sleepMilliseconds}) end`); + } - async sleep(sleepMilliseconds: number) { - log.debug(`... sleep(${sleepMilliseconds}) start`); - await delay(sleepMilliseconds); - log.debug(`... sleep(${sleepMilliseconds}) end`); - } + private async regularLogin(user: string, pwd: string) { + await this.testSubjects.setValue('loginUsername', user); + await this.testSubjects.setValue('loginPassword', pwd); + await this.testSubjects.click('loginSubmit'); + await this.find.waitForDeletedByCssSelector('.kibanaWelcomeLogo'); + await this.find.byCssSelector('[data-test-subj="kibanaChrome"]', 60000); // 60 sec waiting } - return new LoginPage(); + private async samlLogin(user: string, pwd: string) { + try { + await this.find.clickByButtonText('Login using SAML'); + await this.find.setValue('input[name="email"]', user); + await this.find.setValue('input[type="password"]', pwd); + await this.find.clickByCssSelector('.auth0-label-submit'); + await this.find.byCssSelector('[data-test-subj="kibanaChrome"]', 60000); // 60 sec waiting + } catch (err) { + this.log.debug(`${err} \nFailed to find Auth0 login page, trying the Auth0 last login page`); + await this.find.clickByCssSelector('.auth0-lock-social-button'); + } + } } diff --git a/test/functional/page_objects/management/saved_objects_page.ts b/test/functional/page_objects/management/saved_objects_page.ts index fc4de6ed7f82f8..9f48a6f57c8d81 100644 --- a/test/functional/page_objects/management/saved_objects_page.ts +++ b/test/functional/page_objects/management/saved_objects_page.ts @@ -8,328 +8,325 @@ import { keyBy } from 'lodash'; import { map as mapAsync } from 'bluebird'; -import { FtrProviderContext } from '../../ftr_provider_context'; - -export function SavedObjectsPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const log = getService('log'); - const retry = getService('retry'); - const browser = getService('browser'); - const find = getService('find'); - const testSubjects = getService('testSubjects'); - const PageObjects = getPageObjects(['header', 'common']); - - class SavedObjectsPage { - async searchForObject(objectName: string) { - const searchBox = await testSubjects.find('savedObjectSearchBar'); - await searchBox.clearValue(); - await searchBox.type(objectName); - await searchBox.pressKeys(browser.keys.ENTER); - await PageObjects.header.waitUntilLoadingHasFinished(); - await this.waitTableIsLoaded(); - } - - async getCurrentSearchValue() { - const searchBox = await testSubjects.find('savedObjectSearchBar'); - return await searchBox.getAttribute('value'); - } +import { FtrService } from '../../ftr_provider_context'; + +export class SavedObjectsPageObject extends FtrService { + private readonly log = this.ctx.getService('log'); + private readonly retry = this.ctx.getService('retry'); + private readonly browser = this.ctx.getService('browser'); + private readonly find = this.ctx.getService('find'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly common = this.ctx.getPageObject('common'); + private readonly header = this.ctx.getPageObject('header'); + + async searchForObject(objectName: string) { + const searchBox = await this.testSubjects.find('savedObjectSearchBar'); + await searchBox.clearValue(); + await searchBox.type(objectName); + await searchBox.pressKeys(this.browser.keys.ENTER); + await this.header.waitUntilLoadingHasFinished(); + await this.waitTableIsLoaded(); + } - async importFile(path: string, overwriteAll = true) { - log.debug(`importFile(${path})`); + async getCurrentSearchValue() { + const searchBox = await this.testSubjects.find('savedObjectSearchBar'); + return await searchBox.getAttribute('value'); + } - log.debug(`Clicking importObjects`); - await testSubjects.click('importObjects'); - await PageObjects.common.setFileInputPath(path); + async importFile(path: string, overwriteAll = true) { + this.log.debug(`importFile(${path})`); - if (!overwriteAll) { - log.debug(`Toggling overwriteAll`); - const radio = await testSubjects.find( - 'savedObjectsManagement-importModeControl-overwriteRadioGroup' - ); - // a radio button consists of a div tag that contains an input, a div, and a label - // we can't click the input directly, need to go up one level and click the parent div - const div = await radio.findByXpath("//div[input[@id='overwriteDisabled']]"); - await div.click(); - } else { - log.debug(`Leaving overwriteAll alone`); - } - await testSubjects.click('importSavedObjectsImportBtn'); - log.debug(`done importing the file`); + this.log.debug(`Clicking importObjects`); + await this.testSubjects.click('importObjects'); + await this.common.setFileInputPath(path); - // Wait for all the saves to happen - await PageObjects.header.waitUntilLoadingHasFinished(); + if (!overwriteAll) { + this.log.debug(`Toggling overwriteAll`); + const radio = await this.testSubjects.find( + 'savedObjectsManagement-importModeControl-overwriteRadioGroup' + ); + // a radio button consists of a div tag that contains an input, a div, and a label + // we can't click the input directly, need to go up one level and click the parent div + const div = await radio.findByXpath("//div[input[@id='overwriteDisabled']]"); + await div.click(); + } else { + this.log.debug(`Leaving overwriteAll alone`); } + await this.testSubjects.click('importSavedObjectsImportBtn'); + this.log.debug(`done importing the file`); - async checkImportSucceeded() { - await testSubjects.existOrFail('importSavedObjectsSuccess', { timeout: 20000 }); - } + // Wait for all the saves to happen + await this.header.waitUntilLoadingHasFinished(); + } - async checkNoneImported() { - await testSubjects.existOrFail('importSavedObjectsSuccessNoneImported', { timeout: 20000 }); - } + async checkImportSucceeded() { + await this.testSubjects.existOrFail('importSavedObjectsSuccess', { timeout: 20000 }); + } - async checkImportConflictsWarning() { - await testSubjects.existOrFail('importSavedObjectsConflictsWarning', { timeout: 20000 }); - } + async checkNoneImported() { + await this.testSubjects.existOrFail('importSavedObjectsSuccessNoneImported', { + timeout: 20000, + }); + } - async checkImportLegacyWarning() { - await testSubjects.existOrFail('importSavedObjectsLegacyWarning', { timeout: 20000 }); - } + async checkImportConflictsWarning() { + await this.testSubjects.existOrFail('importSavedObjectsConflictsWarning', { timeout: 20000 }); + } - async checkImportFailedWarning() { - await testSubjects.existOrFail('importSavedObjectsFailedWarning', { timeout: 20000 }); - } + async checkImportLegacyWarning() { + await this.testSubjects.existOrFail('importSavedObjectsLegacyWarning', { timeout: 20000 }); + } - async checkImportError() { - await testSubjects.existOrFail('importSavedObjectsErrorText', { timeout: 20000 }); - } + async checkImportFailedWarning() { + await this.testSubjects.existOrFail('importSavedObjectsFailedWarning', { timeout: 20000 }); + } - async getImportErrorText() { - return await testSubjects.getVisibleText('importSavedObjectsErrorText'); - } + async checkImportError() { + await this.testSubjects.existOrFail('importSavedObjectsErrorText', { timeout: 20000 }); + } - async clickImportDone() { - await testSubjects.click('importSavedObjectsDoneBtn'); - await this.waitTableIsLoaded(); - } + async getImportErrorText() { + return await this.testSubjects.getVisibleText('importSavedObjectsErrorText'); + } - async clickConfirmChanges() { - await testSubjects.click('importSavedObjectsConfirmBtn'); - } + async clickImportDone() { + await this.testSubjects.click('importSavedObjectsDoneBtn'); + await this.waitTableIsLoaded(); + } - async waitTableIsLoaded() { - return retry.try(async () => { - const isLoaded = await find.existsByDisplayedByCssSelector( - '*[data-test-subj="savedObjectsTable"] :not(.euiBasicTable-loading)' - ); + async clickConfirmChanges() { + await this.testSubjects.click('importSavedObjectsConfirmBtn'); + } - if (isLoaded) { - return true; - } else { - throw new Error('Waiting'); - } - }); - } + async waitTableIsLoaded() { + return this.retry.try(async () => { + const isLoaded = await this.find.existsByDisplayedByCssSelector( + '*[data-test-subj="savedObjectsTable"] :not(.euiBasicTable-loading)' + ); - async clickRelationshipsByTitle(title: string) { - const table = keyBy(await this.getElementsInTable(), 'title'); - // should we check if table size > 0 and log error if not? - if (table[title].menuElement) { - log.debug(`we found a context menu element for (${title}) so click it`); - await table[title].menuElement?.click(); - // Wait for context menu to render - const menuPanel = await find.byCssSelector('.euiContextMenuPanel'); - await (await menuPanel.findByTestSubject('savedObjectsTableAction-relationships')).click(); + if (isLoaded) { + return true; } else { - log.debug( - `we didn't find a menu element so should be a relastionships element for (${title}) to click` - ); - // or the action elements are on the row without the menu - await table[title].relationshipsElement?.click(); + throw new Error('Waiting'); } - } + }); + } - async setOverriddenIndexPatternValue(oldName: string, newName: string) { - const select = await testSubjects.find(`managementChangeIndexSelection-${oldName}`); - const option = await testSubjects.findDescendant(`indexPatternOption-${newName}`, select); - await option.click(); + async clickRelationshipsByTitle(title: string) { + const table = keyBy(await this.getElementsInTable(), 'title'); + // should we check if table size > 0 and log error if not? + if (table[title].menuElement) { + this.log.debug(`we found a context menu element for (${title}) so click it`); + await table[title].menuElement?.click(); + // Wait for context menu to render + const menuPanel = await this.find.byCssSelector('.euiContextMenuPanel'); + await (await menuPanel.findByTestSubject('savedObjectsTableAction-relationships')).click(); + } else { + this.log.debug( + `we didn't find a menu element so should be a relastionships element for (${title}) to click` + ); + // or the action elements are on the row without the menu + await table[title].relationshipsElement?.click(); } + } - async clickCopyToSpaceByTitle(title: string) { - const table = keyBy(await this.getElementsInTable(), 'title'); - // should we check if table size > 0 and log error if not? - if (table[title].menuElement) { - log.debug(`we found a context menu element for (${title}) so click it`); - await table[title].menuElement?.click(); - // Wait for context menu to render - const menuPanel = await find.byCssSelector('.euiContextMenuPanel'); - await ( - await menuPanel.findByTestSubject('savedObjectsTableAction-copy_saved_objects_to_space') - ).click(); - } else { - log.debug( - `we didn't find a menu element so should be a "copy to space" element for (${title}) to click` - ); - // or the action elements are on the row without the menu - await table[title].copySaveObjectsElement?.click(); - } - } + async setOverriddenIndexPatternValue(oldName: string, newName: string) { + const select = await this.testSubjects.find(`managementChangeIndexSelection-${oldName}`); + const option = await this.testSubjects.findDescendant(`indexPatternOption-${newName}`, select); + await option.click(); + } - async clickInspectByTitle(title: string) { - const table = keyBy(await this.getElementsInTable(), 'title'); - if (table[title].menuElement) { - await table[title].menuElement?.click(); - // Wait for context menu to render - const menuPanel = await find.byCssSelector('.euiContextMenuPanel'); - const panelButton = await menuPanel.findByTestSubject('savedObjectsTableAction-inspect'); - await panelButton.click(); - } else { - // or the action elements are on the row without the menu - await table[title].copySaveObjectsElement?.click(); - } + async clickCopyToSpaceByTitle(title: string) { + const table = keyBy(await this.getElementsInTable(), 'title'); + // should we check if table size > 0 and log error if not? + if (table[title].menuElement) { + this.log.debug(`we found a context menu element for (${title}) so click it`); + await table[title].menuElement?.click(); + // Wait for context menu to render + const menuPanel = await this.find.byCssSelector('.euiContextMenuPanel'); + await ( + await menuPanel.findByTestSubject('savedObjectsTableAction-copy_saved_objects_to_space') + ).click(); + } else { + this.log.debug( + `we didn't find a menu element so should be a "copy to space" element for (${title}) to click` + ); + // or the action elements are on the row without the menu + await table[title].copySaveObjectsElement?.click(); } + } - async clickCheckboxByTitle(title: string) { - const table = keyBy(await this.getElementsInTable(), 'title'); - // should we check if table size > 0 and log error if not? - await table[title].checkbox.click(); + async clickInspectByTitle(title: string) { + const table = keyBy(await this.getElementsInTable(), 'title'); + if (table[title].menuElement) { + await table[title].menuElement?.click(); + // Wait for context menu to render + const menuPanel = await this.find.byCssSelector('.euiContextMenuPanel'); + const panelButton = await menuPanel.findByTestSubject('savedObjectsTableAction-inspect'); + await panelButton.click(); + } else { + // or the action elements are on the row without the menu + await table[title].copySaveObjectsElement?.click(); } + } - async getObjectTypeByTitle(title: string) { - const table = keyBy(await this.getElementsInTable(), 'title'); - // should we check if table size > 0 and log error if not? - return table[title].objectType; - } + async clickCheckboxByTitle(title: string) { + const table = keyBy(await this.getElementsInTable(), 'title'); + // should we check if table size > 0 and log error if not? + await table[title].checkbox.click(); + } - async getElementsInTable() { - const rows = await testSubjects.findAll('~savedObjectsTableRow'); - return mapAsync(rows, async (row) => { - const checkbox = await row.findByCssSelector('[data-test-subj*="checkboxSelectRow"]'); - // return the object type aria-label="index patterns" - const objectType = await row.findByTestSubject('objectType'); - const titleElement = await row.findByTestSubject('savedObjectsTableRowTitle'); - // not all rows have inspect button - Advanced Settings objects don't - // Advanced Settings has 2 actions, - // data-test-subj="savedObjectsTableAction-relationships" - // data-test-subj="savedObjectsTableAction-copy_saved_objects_to_space" - // Some other objects have the ... - // data-test-subj="euiCollapsedItemActionsButton" - // Maybe some objects still have the inspect element visible? - // !!! Also note that since we don't have spaces on OSS, the actions for the same object can be different depending on OSS or not - let menuElement = null; - let inspectElement = null; - let relationshipsElement = null; - let copySaveObjectsElement = null; - const actions = await row.findByClassName('euiTableRowCell--hasActions'); - // getting the innerHTML and checking if it 'includes' a string is faster than a timeout looking for each element - const actionsHTML = await actions.getAttribute('innerHTML'); - if (actionsHTML.includes('euiCollapsedItemActionsButton')) { - menuElement = await row.findByTestSubject('euiCollapsedItemActionsButton'); - } - if (actionsHTML.includes('savedObjectsTableAction-inspect')) { - inspectElement = await row.findByTestSubject('savedObjectsTableAction-inspect'); - } - if (actionsHTML.includes('savedObjectsTableAction-relationships')) { - relationshipsElement = await row.findByTestSubject( - 'savedObjectsTableAction-relationships' - ); - } - if (actionsHTML.includes('savedObjectsTableAction-copy_saved_objects_to_space')) { - copySaveObjectsElement = await row.findByTestSubject( - 'savedObjectsTableAction-copy_saved_objects_to_space' - ); - } - return { - checkbox, - objectType: await objectType.getAttribute('aria-label'), - titleElement, - title: await titleElement.getVisibleText(), - menuElement, - inspectElement, - relationshipsElement, - copySaveObjectsElement, - }; - }); - } + async getObjectTypeByTitle(title: string) { + const table = keyBy(await this.getElementsInTable(), 'title'); + // should we check if table size > 0 and log error if not? + return table[title].objectType; + } - async getRowTitles() { - await this.waitTableIsLoaded(); - const table = await testSubjects.find('savedObjectsTable'); - const $ = await table.parseDomContent(); - return $.findTestSubjects('savedObjectsTableRowTitle') - .toArray() - .map((cell) => $(cell).find('.euiTableCellContent').text()); - } + async getElementsInTable() { + const rows = await this.testSubjects.findAll('~savedObjectsTableRow'); + return mapAsync(rows, async (row) => { + const checkbox = await row.findByCssSelector('[data-test-subj*="checkboxSelectRow"]'); + // return the object type aria-label="index patterns" + const objectType = await row.findByTestSubject('objectType'); + const titleElement = await row.findByTestSubject('savedObjectsTableRowTitle'); + // not all rows have inspect button - Advanced Settings objects don't + // Advanced Settings has 2 actions, + // data-test-subj="savedObjectsTableAction-relationships" + // data-test-subj="savedObjectsTableAction-copy_saved_objects_to_space" + // Some other objects have the ... + // data-test-subj="euiCollapsedItemActionsButton" + // Maybe some objects still have the inspect element visible? + // !!! Also note that since we don't have spaces on OSS, the actions for the same object can be different depending on OSS or not + let menuElement = null; + let inspectElement = null; + let relationshipsElement = null; + let copySaveObjectsElement = null; + const actions = await row.findByClassName('euiTableRowCell--hasActions'); + // getting the innerHTML and checking if it 'includes' a string is faster than a timeout looking for each element + const actionsHTML = await actions.getAttribute('innerHTML'); + if (actionsHTML.includes('euiCollapsedItemActionsButton')) { + menuElement = await row.findByTestSubject('euiCollapsedItemActionsButton'); + } + if (actionsHTML.includes('savedObjectsTableAction-inspect')) { + inspectElement = await row.findByTestSubject('savedObjectsTableAction-inspect'); + } + if (actionsHTML.includes('savedObjectsTableAction-relationships')) { + relationshipsElement = await row.findByTestSubject('savedObjectsTableAction-relationships'); + } + if (actionsHTML.includes('savedObjectsTableAction-copy_saved_objects_to_space')) { + copySaveObjectsElement = await row.findByTestSubject( + 'savedObjectsTableAction-copy_saved_objects_to_space' + ); + } + return { + checkbox, + objectType: await objectType.getAttribute('aria-label'), + titleElement, + title: await titleElement.getVisibleText(), + menuElement, + inspectElement, + relationshipsElement, + copySaveObjectsElement, + }; + }); + } - async getRelationshipFlyout() { - const rows = await testSubjects.findAll('relationshipsTableRow'); - return mapAsync(rows, async (row) => { - const objectType = await row.findByTestSubject('relationshipsObjectType'); - const relationship = await row.findByTestSubject('directRelationship'); - const titleElement = await row.findByTestSubject('relationshipsTitle'); - const inspectElement = await row.findByTestSubject('relationshipsTableAction-inspect'); - return { - objectType: await objectType.getAttribute('aria-label'), - relationship: await relationship.getVisibleText(), - titleElement, - title: await titleElement.getVisibleText(), - inspectElement, - }; - }); - } + async getRowTitles() { + await this.waitTableIsLoaded(); + const table = await this.testSubjects.find('savedObjectsTable'); + const $ = await table.parseDomContent(); + return $.findTestSubjects('savedObjectsTableRowTitle') + .toArray() + .map((cell) => $(cell).find('.euiTableCellContent').text()); + } - async getInvalidRelations() { - const rows = await testSubjects.findAll('invalidRelationshipsTableRow'); - return mapAsync(rows, async (row) => { - const objectType = await row.findByTestSubject('relationshipsObjectType'); - const objectId = await row.findByTestSubject('relationshipsObjectId'); - const relationship = await row.findByTestSubject('directRelationship'); - const error = await row.findByTestSubject('relationshipsError'); + async getRelationshipFlyout() { + const rows = await this.testSubjects.findAll('relationshipsTableRow'); + return mapAsync(rows, async (row) => { + const objectType = await row.findByTestSubject('relationshipsObjectType'); + const relationship = await row.findByTestSubject('directRelationship'); + const titleElement = await row.findByTestSubject('relationshipsTitle'); + const inspectElement = await row.findByTestSubject('relationshipsTableAction-inspect'); + return { + objectType: await objectType.getAttribute('aria-label'), + relationship: await relationship.getVisibleText(), + titleElement, + title: await titleElement.getVisibleText(), + inspectElement, + }; + }); + } + + async getInvalidRelations() { + const rows = await this.testSubjects.findAll('invalidRelationshipsTableRow'); + return mapAsync(rows, async (row) => { + const objectType = await row.findByTestSubject('relationshipsObjectType'); + const objectId = await row.findByTestSubject('relationshipsObjectId'); + const relationship = await row.findByTestSubject('directRelationship'); + const error = await row.findByTestSubject('relationshipsError'); + return { + type: await objectType.getVisibleText(), + id: await objectId.getVisibleText(), + relationship: await relationship.getVisibleText(), + error: await error.getVisibleText(), + }; + }); + } + + async getTableSummary() { + const table = await this.testSubjects.find('savedObjectsTable'); + const $ = await table.parseDomContent(); + return $('tbody tr') + .toArray() + .map((row) => { return { - type: await objectType.getVisibleText(), - id: await objectId.getVisibleText(), - relationship: await relationship.getVisibleText(), - error: await error.getVisibleText(), + title: $(row).find('td:nth-child(3) .euiTableCellContent').text(), + canViewInApp: Boolean($(row).find('td:nth-child(3) a').length), }; }); - } + } - async getTableSummary() { - const table = await testSubjects.find('savedObjectsTable'); - const $ = await table.parseDomContent(); - return $('tbody tr') - .toArray() - .map((row) => { - return { - title: $(row).find('td:nth-child(3) .euiTableCellContent').text(), - canViewInApp: Boolean($(row).find('td:nth-child(3) a').length), - }; - }); - } + async clickTableSelectAll() { + await this.testSubjects.click('checkboxSelectAll'); + } - async clickTableSelectAll() { - await testSubjects.click('checkboxSelectAll'); - } + async canBeDeleted() { + return await this.testSubjects.isEnabled('savedObjectsManagementDelete'); + } - async canBeDeleted() { - return await testSubjects.isEnabled('savedObjectsManagementDelete'); + async clickDelete({ confirmDelete = true }: { confirmDelete?: boolean } = {}) { + await this.testSubjects.click('savedObjectsManagementDelete'); + if (confirmDelete) { + await this.testSubjects.click('confirmModalConfirmButton'); + await this.waitTableIsLoaded(); } + } - async clickDelete({ confirmDelete = true }: { confirmDelete?: boolean } = {}) { - await testSubjects.click('savedObjectsManagementDelete'); - if (confirmDelete) { - await testSubjects.click('confirmModalConfirmButton'); - await this.waitTableIsLoaded(); - } - } + async getImportWarnings() { + const elements = await this.testSubjects.findAll('importSavedObjectsWarning'); + return Promise.all( + elements.map(async (element) => { + const message = await element + .findByClassName('euiCallOutHeader__title') + .then((titleEl) => titleEl.getVisibleText()); + const buttons = await element.findAllByClassName('euiButton'); + return { + message, + type: buttons.length ? 'action_required' : 'simple', + }; + }) + ); + } - async getImportWarnings() { - const elements = await testSubjects.findAll('importSavedObjectsWarning'); - return Promise.all( - elements.map(async (element) => { - const message = await element - .findByClassName('euiCallOutHeader__title') - .then((titleEl) => titleEl.getVisibleText()); - const buttons = await element.findAllByClassName('euiButton'); - return { - message, - type: buttons.length ? 'action_required' : 'simple', - }; - }) - ); + async getImportErrorsCount() { + this.log.debug(`Toggling overwriteAll`); + const errorCountNode = await this.testSubjects.find('importSavedObjectsErrorsCount'); + const errorCountText = await errorCountNode.getVisibleText(); + const match = errorCountText.match(/(\d)+/); + if (!match) { + throw Error(`unable to parse error count from text ${errorCountText}`); } - async getImportErrorsCount() { - log.debug(`Toggling overwriteAll`); - const errorCountNode = await testSubjects.find('importSavedObjectsErrorsCount'); - const errorCountText = await errorCountNode.getVisibleText(); - const match = errorCountText.match(/(\d)+/); - if (!match) { - throw Error(`unable to parse error count from text ${errorCountText}`); - } - - return +match[1]; - } + return +match[1]; } - - return new SavedObjectsPage(); } diff --git a/test/functional/page_objects/newsfeed_page.ts b/test/functional/page_objects/newsfeed_page.ts index 1fa9bb5b900020..3a4bbee9245528 100644 --- a/test/functional/page_objects/newsfeed_page.ts +++ b/test/functional/page_objects/newsfeed_page.ts @@ -6,58 +6,54 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; - -export function NewsfeedPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const log = getService('log'); - const find = getService('find'); - const retry = getService('retry'); - const flyout = getService('flyout'); - const testSubjects = getService('testSubjects'); - const PageObjects = getPageObjects(['common']); - - class NewsfeedPage { - async resetPage() { - await PageObjects.common.navigateToUrl('home', '', { useActualUrl: true }); - } - - async closeNewsfeedPanel() { - await flyout.ensureClosed('NewsfeedFlyout'); - log.debug('clickNewsfeed icon'); - await retry.waitFor('newsfeed flyout', async () => { - if (await testSubjects.exists('NewsfeedFlyout')) { - await testSubjects.click('NewsfeedFlyout > euiFlyoutCloseButton'); - return false; - } - return true; - }); - } +import { FtrService } from '../ftr_provider_context'; + +export class NewsfeedPageObject extends FtrService { + private readonly log = this.ctx.getService('log'); + private readonly find = this.ctx.getService('find'); + private readonly retry = this.ctx.getService('retry'); + private readonly flyout = this.ctx.getService('flyout'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly common = this.ctx.getPageObject('common'); + + async resetPage() { + await this.common.navigateToUrl('home', '', { useActualUrl: true }); + } - async openNewsfeedPanel() { - log.debug('clickNewsfeed icon'); - return await testSubjects.exists('NewsfeedFlyout'); - } + async closeNewsfeedPanel() { + await this.flyout.ensureClosed('NewsfeedFlyout'); + this.log.debug('clickNewsfeed icon'); + await this.retry.waitFor('newsfeed flyout', async () => { + if (await this.testSubjects.exists('NewsfeedFlyout')) { + await this.testSubjects.click('NewsfeedFlyout > euiFlyoutCloseButton'); + return false; + } + return true; + }); + } - async getRedButtonSign() { - return await find.existsByCssSelector('.euiHeaderSectionItemButton__notification--dot'); - } + async openNewsfeedPanel() { + this.log.debug('clickNewsfeed icon'); + return await this.testSubjects.exists('NewsfeedFlyout'); + } - async getNewsfeedList() { - const list = await testSubjects.find('NewsfeedFlyout'); - const cells = await list.findAllByTestSubject('newsHeadAlert'); + async getRedButtonSign() { + return await this.find.existsByCssSelector('.euiHeaderSectionItemButton__notification--dot'); + } - const objects = []; - for (const cell of cells) { - objects.push(await cell.getVisibleText()); - } + async getNewsfeedList() { + const list = await this.testSubjects.find('NewsfeedFlyout'); + const cells = await list.findAllByTestSubject('newsHeadAlert'); - return objects; + const objects = []; + for (const cell of cells) { + objects.push(await cell.getVisibleText()); } - async openNewsfeedEmptyPanel() { - return await testSubjects.exists('emptyNewsfeed'); - } + return objects; } - return new NewsfeedPage(); + async openNewsfeedEmptyPanel() { + return await this.testSubjects.exists('emptyNewsfeed'); + } } diff --git a/test/functional/page_objects/settings_page.ts b/test/functional/page_objects/settings_page.ts index 699165a51ca8c9..7d7da79b4a3974 100644 --- a/test/functional/page_objects/settings_page.ts +++ b/test/functional/page_objects/settings_page.ts @@ -8,731 +8,730 @@ import { map as mapAsync } from 'bluebird'; import expect from '@kbn/expect'; -import { FtrProviderContext } from '../ftr_provider_context'; - -export function SettingsPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const log = getService('log'); - const retry = getService('retry'); - const browser = getService('browser'); - const find = getService('find'); - const flyout = getService('flyout'); - const testSubjects = getService('testSubjects'); - const comboBox = getService('comboBox'); - const PageObjects = getPageObjects(['header', 'common', 'savedObjects']); - - class SettingsPage { - async clickNavigation() { - await find.clickDisplayedByCssSelector('.app-link:nth-child(5) a'); - } +import { FtrService } from '../ftr_provider_context'; + +export class SettingsPageObject extends FtrService { + private readonly log = this.ctx.getService('log'); + private readonly retry = this.ctx.getService('retry'); + private readonly browser = this.ctx.getService('browser'); + private readonly find = this.ctx.getService('find'); + private readonly flyout = this.ctx.getService('flyout'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly comboBox = this.ctx.getService('comboBox'); + private readonly header = this.ctx.getPageObject('header'); + private readonly common = this.ctx.getPageObject('common'); + private readonly savedObjects = this.ctx.getPageObject('savedObjects'); + + async clickNavigation() { + await this.find.clickDisplayedByCssSelector('.app-link:nth-child(5) a'); + } - async clickLinkText(text: string) { - await find.clickByDisplayedLinkText(text); - } + async clickLinkText(text: string) { + await this.find.clickByDisplayedLinkText(text); + } - async clickKibanaSettings() { - await testSubjects.click('settings'); - await PageObjects.header.waitUntilLoadingHasFinished(); - await testSubjects.existOrFail('managementSettingsTitle'); - } + async clickKibanaSettings() { + await this.testSubjects.click('settings'); + await this.header.waitUntilLoadingHasFinished(); + await this.testSubjects.existOrFail('managementSettingsTitle'); + } - async clickKibanaSavedObjects() { - await testSubjects.click('objects'); - await PageObjects.savedObjects.waitTableIsLoaded(); - } + async clickKibanaSavedObjects() { + await this.testSubjects.click('objects'); + await this.savedObjects.waitTableIsLoaded(); + } - async clickKibanaIndexPatterns() { - log.debug('clickKibanaIndexPatterns link'); - await testSubjects.click('indexPatterns'); + async clickKibanaIndexPatterns() { + this.log.debug('clickKibanaIndexPatterns link'); + await this.testSubjects.click('indexPatterns'); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + await this.header.waitUntilLoadingHasFinished(); + } - async getAdvancedSettings(propertyName: string) { - log.debug('in getAdvancedSettings'); - return await testSubjects.getAttribute(`advancedSetting-editField-${propertyName}`, 'value'); - } + async getAdvancedSettings(propertyName: string) { + this.log.debug('in getAdvancedSettings'); + return await this.testSubjects.getAttribute( + `advancedSetting-editField-${propertyName}`, + 'value' + ); + } - async expectDisabledAdvancedSetting(propertyName: string) { - expect( - await testSubjects.getAttribute(`advancedSetting-editField-${propertyName}`, 'disabled') - ).to.eql('true'); - } + async expectDisabledAdvancedSetting(propertyName: string) { + expect( + await this.testSubjects.getAttribute(`advancedSetting-editField-${propertyName}`, 'disabled') + ).to.eql('true'); + } - async getAdvancedSettingCheckbox(propertyName: string) { - log.debug('in getAdvancedSettingCheckbox'); - return await testSubjects.getAttribute( - `advancedSetting-editField-${propertyName}`, - 'checked' - ); - } + async getAdvancedSettingCheckbox(propertyName: string) { + this.log.debug('in getAdvancedSettingCheckbox'); + return await this.testSubjects.getAttribute( + `advancedSetting-editField-${propertyName}`, + 'checked' + ); + } - async clearAdvancedSettings(propertyName: string) { - await testSubjects.click(`advancedSetting-resetField-${propertyName}`); - await PageObjects.header.waitUntilLoadingHasFinished(); - await testSubjects.click(`advancedSetting-saveButton`); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + async clearAdvancedSettings(propertyName: string) { + await this.testSubjects.click(`advancedSetting-resetField-${propertyName}`); + await this.header.waitUntilLoadingHasFinished(); + await this.testSubjects.click(`advancedSetting-saveButton`); + await this.header.waitUntilLoadingHasFinished(); + } - async setAdvancedSettingsSelect(propertyName: string, propertyValue: string) { - await find.clickByCssSelector( - `[data-test-subj="advancedSetting-editField-${propertyName}"] option[value="${propertyValue}"]` - ); - await PageObjects.header.waitUntilLoadingHasFinished(); - await testSubjects.click(`advancedSetting-saveButton`); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + async setAdvancedSettingsSelect(propertyName: string, propertyValue: string) { + await this.find.clickByCssSelector( + `[data-test-subj="advancedSetting-editField-${propertyName}"] option[value="${propertyValue}"]` + ); + await this.header.waitUntilLoadingHasFinished(); + await this.testSubjects.click(`advancedSetting-saveButton`); + await this.header.waitUntilLoadingHasFinished(); + } - async setAdvancedSettingsInput(propertyName: string, propertyValue: string) { - const input = await testSubjects.find(`advancedSetting-editField-${propertyName}`); - await input.clearValue(); - await input.type(propertyValue); - await testSubjects.click(`advancedSetting-saveButton`); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + async setAdvancedSettingsInput(propertyName: string, propertyValue: string) { + const input = await this.testSubjects.find(`advancedSetting-editField-${propertyName}`); + await input.clearValue(); + await input.type(propertyValue); + await this.testSubjects.click(`advancedSetting-saveButton`); + await this.header.waitUntilLoadingHasFinished(); + } - async setAdvancedSettingsTextArea(propertyName: string, propertyValue: string) { - const wrapper = await testSubjects.find(`advancedSetting-editField-${propertyName}`); - const textarea = await wrapper.findByTagName('textarea'); - await textarea.focus(); - // only way to properly replace the value of the ace editor is via the JS api - await browser.execute( - (editor: string, value: string) => { - return (window as any).ace.edit(editor).setValue(value); - }, - `advancedSetting-editField-${propertyName}-editor`, - propertyValue - ); - await testSubjects.click(`advancedSetting-saveButton`); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + async setAdvancedSettingsTextArea(propertyName: string, propertyValue: string) { + const wrapper = await this.testSubjects.find(`advancedSetting-editField-${propertyName}`); + const textarea = await wrapper.findByTagName('textarea'); + await textarea.focus(); + // only way to properly replace the value of the ace editor is via the JS api + await this.browser.execute( + (editor: string, value: string) => { + return (window as any).ace.edit(editor).setValue(value); + }, + `advancedSetting-editField-${propertyName}-editor`, + propertyValue + ); + await this.testSubjects.click(`advancedSetting-saveButton`); + await this.header.waitUntilLoadingHasFinished(); + } - async toggleAdvancedSettingCheckbox(propertyName: string) { - await testSubjects.click(`advancedSetting-editField-${propertyName}`); - await PageObjects.header.waitUntilLoadingHasFinished(); - await testSubjects.click(`advancedSetting-saveButton`); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + async toggleAdvancedSettingCheckbox(propertyName: string) { + await this.testSubjects.click(`advancedSetting-editField-${propertyName}`); + await this.header.waitUntilLoadingHasFinished(); + await this.testSubjects.click(`advancedSetting-saveButton`); + await this.header.waitUntilLoadingHasFinished(); + } - async navigateTo() { - await PageObjects.common.navigateToApp('settings'); - } + async navigateTo() { + await this.common.navigateToApp('settings'); + } - async getIndexPatternField() { - return await testSubjects.find('createIndexPatternNameInput'); - } + async getIndexPatternField() { + return await this.testSubjects.find('createIndexPatternNameInput'); + } - async clickTimeFieldNameField() { - return await testSubjects.click('createIndexPatternTimeFieldSelect'); - } + async clickTimeFieldNameField() { + return await this.testSubjects.click('createIndexPatternTimeFieldSelect'); + } - async getTimeFieldNameField() { - return await testSubjects.find('createIndexPatternTimeFieldSelect'); - } + async getTimeFieldNameField() { + return await this.testSubjects.find('createIndexPatternTimeFieldSelect'); + } - async selectTimeFieldOption(selection: string) { - // open dropdown - await this.clickTimeFieldNameField(); - // close dropdown, keep focus - await this.clickTimeFieldNameField(); - await PageObjects.header.waitUntilLoadingHasFinished(); - return await retry.try(async () => { - log.debug(`selectTimeFieldOption(${selection})`); - const timeFieldOption = await this.getTimeFieldOption(selection); - await timeFieldOption.click(); - const selected = await timeFieldOption.isSelected(); - if (!selected) throw new Error('option not selected: ' + selected); - }); - } + async selectTimeFieldOption(selection: string) { + // open dropdown + await this.clickTimeFieldNameField(); + // close dropdown, keep focus + await this.clickTimeFieldNameField(); + await this.header.waitUntilLoadingHasFinished(); + return await this.retry.try(async () => { + this.log.debug(`selectTimeFieldOption(${selection})`); + const timeFieldOption = await this.getTimeFieldOption(selection); + await timeFieldOption.click(); + const selected = await timeFieldOption.isSelected(); + if (!selected) throw new Error('option not selected: ' + selected); + }); + } - async getTimeFieldOption(selection: string) { - return await find.displayedByCssSelector('option[value="' + selection + '"]'); - } + async getTimeFieldOption(selection: string) { + return await this.find.displayedByCssSelector('option[value="' + selection + '"]'); + } - async getCreateIndexPatternButton() { - return await testSubjects.find('createIndexPatternButton'); - } + async getCreateIndexPatternButton() { + return await this.testSubjects.find('createIndexPatternButton'); + } - async getCreateButton() { - return await find.displayedByCssSelector('[type="submit"]'); - } + async getCreateButton() { + return await this.find.displayedByCssSelector('[type="submit"]'); + } - async clickDefaultIndexButton() { - await testSubjects.click('setDefaultIndexPatternButton'); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + async clickDefaultIndexButton() { + await this.testSubjects.click('setDefaultIndexPatternButton'); + await this.header.waitUntilLoadingHasFinished(); + } - async clickDeletePattern() { - await testSubjects.click('deleteIndexPatternButton'); - } + async clickDeletePattern() { + await this.testSubjects.click('deleteIndexPatternButton'); + } - async getIndexPageHeading() { - return await testSubjects.getVisibleText('indexPatternTitle'); - } + async getIndexPageHeading() { + return await this.testSubjects.getVisibleText('indexPatternTitle'); + } - async getConfigureHeader() { - return await find.byCssSelector('h1'); - } + async getConfigureHeader() { + return await this.find.byCssSelector('h1'); + } - async getTableHeader() { - return await find.allByCssSelector('table.euiTable thead tr th'); - } + async getTableHeader() { + return await this.find.allByCssSelector('table.euiTable thead tr th'); + } - async sortBy(columnName: string) { - const chartTypes = await find.allByCssSelector('table.euiTable thead tr th button'); + async sortBy(columnName: string) { + const chartTypes = await this.find.allByCssSelector('table.euiTable thead tr th button'); - async function getChartType(chart: Record) { - const chartString = await chart.getVisibleText(); - if (chartString === columnName) { - await chart.click(); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + const getChartType = async (chart: Record) => { + const chartString = await chart.getVisibleText(); + if (chartString === columnName) { + await chart.click(); + await this.header.waitUntilLoadingHasFinished(); } + }; - const getChartTypesPromises = chartTypes.map(getChartType); - return Promise.all(getChartTypesPromises); - } + const getChartTypesPromises = chartTypes.map(getChartType); + return Promise.all(getChartTypesPromises); + } - async getTableRow(rowNumber: number, colNumber: number) { - // passing in zero-based index, but adding 1 for css 1-based indexes - return await find.byCssSelector( - 'table.euiTable tbody tr:nth-child(' + - (rowNumber + 1) + - ') td.euiTableRowCell:nth-child(' + - (colNumber + 1) + - ')' - ); - } + async getTableRow(rowNumber: number, colNumber: number) { + // passing in zero-based index, but adding 1 for css 1-based indexes + return await this.find.byCssSelector( + 'table.euiTable tbody tr:nth-child(' + + (rowNumber + 1) + + ') td.euiTableRowCell:nth-child(' + + (colNumber + 1) + + ')' + ); + } - async getFieldsTabCount() { - return retry.try(async () => { - const text = await testSubjects.getVisibleText('tab-indexedFields'); - return text.split(' ')[1].replace(/\((.*)\)/, '$1'); - }); - } + async getFieldsTabCount() { + return this.retry.try(async () => { + const text = await this.testSubjects.getVisibleText('tab-indexedFields'); + return text.split(' ')[1].replace(/\((.*)\)/, '$1'); + }); + } - async getScriptedFieldsTabCount() { - return await retry.try(async () => { - const text = await testSubjects.getVisibleText('tab-scriptedFields'); - return text.split(' ')[2].replace(/\((.*)\)/, '$1'); - }); - } + async getScriptedFieldsTabCount() { + return await this.retry.try(async () => { + const text = await this.testSubjects.getVisibleText('tab-scriptedFields'); + return text.split(' ')[2].replace(/\((.*)\)/, '$1'); + }); + } - async getFieldNames() { - const fieldNameCells = await testSubjects.findAll('editIndexPattern > indexedFieldName'); - return await mapAsync(fieldNameCells, async (cell) => { - return (await cell.getVisibleText()).trim(); - }); - } + async getFieldNames() { + const fieldNameCells = await this.testSubjects.findAll('editIndexPattern > indexedFieldName'); + return await mapAsync(fieldNameCells, async (cell) => { + return (await cell.getVisibleText()).trim(); + }); + } - async getFieldTypes() { - const fieldNameCells = await testSubjects.findAll('editIndexPattern > indexedFieldType'); - return await mapAsync(fieldNameCells, async (cell) => { - return (await cell.getVisibleText()).trim(); - }); - } + async getFieldTypes() { + const fieldNameCells = await this.testSubjects.findAll('editIndexPattern > indexedFieldType'); + return await mapAsync(fieldNameCells, async (cell) => { + return (await cell.getVisibleText()).trim(); + }); + } - async getScriptedFieldLangs() { - const fieldNameCells = await testSubjects.findAll('editIndexPattern > scriptedFieldLang'); - return await mapAsync(fieldNameCells, async (cell) => { - return (await cell.getVisibleText()).trim(); - }); - } + async getScriptedFieldLangs() { + const fieldNameCells = await this.testSubjects.findAll('editIndexPattern > scriptedFieldLang'); + return await mapAsync(fieldNameCells, async (cell) => { + return (await cell.getVisibleText()).trim(); + }); + } - async setFieldTypeFilter(type: string) { - await find.clickByCssSelector( - 'select[data-test-subj="indexedFieldTypeFilterDropdown"] > option[value="' + type + '"]' - ); - } + async setFieldTypeFilter(type: string) { + await this.find.clickByCssSelector( + 'select[data-test-subj="indexedFieldTypeFilterDropdown"] > option[value="' + type + '"]' + ); + } - async setScriptedFieldLanguageFilter(language: string) { - await find.clickByCssSelector( - 'select[data-test-subj="scriptedFieldLanguageFilterDropdown"] > option[value="' + - language + - '"]' - ); - } + async setScriptedFieldLanguageFilter(language: string) { + await this.find.clickByCssSelector( + 'select[data-test-subj="scriptedFieldLanguageFilterDropdown"] > option[value="' + + language + + '"]' + ); + } - async filterField(name: string) { - const input = await testSubjects.find('indexPatternFieldFilter'); - await input.clearValue(); - await input.type(name); - } + async filterField(name: string) { + const input = await this.testSubjects.find('indexPatternFieldFilter'); + await input.clearValue(); + await input.type(name); + } - async openControlsByName(name: string) { - await this.filterField(name); - const tableFields = await ( - await find.byCssSelector( - 'table.euiTable tbody tr.euiTableRow td.euiTableRowCell:first-child' - ) - ).getVisibleText(); - - await find.clickByCssSelector( - `table.euiTable tbody tr.euiTableRow:nth-child(${tableFields.indexOf(name) + 1}) - td:nth-last-child(2) button` - ); - } + async openControlsByName(name: string) { + await this.filterField(name); + const tableFields = await ( + await this.find.byCssSelector( + 'table.euiTable tbody tr.euiTableRow td.euiTableRowCell:first-child' + ) + ).getVisibleText(); + + await this.find.clickByCssSelector( + `table.euiTable tbody tr.euiTableRow:nth-child(${tableFields.indexOf(name) + 1}) + td:nth-last-child(2) button` + ); + } - async increasePopularity() { - await testSubjects.setValue('editorFieldCount', '1', { clearWithKeyboard: true }); - } + async increasePopularity() { + await this.testSubjects.setValue('editorFieldCount', '1', { clearWithKeyboard: true }); + } - async getPopularity() { - return await testSubjects.getAttribute('editorFieldCount', 'value'); - } + async getPopularity() { + return await this.testSubjects.getAttribute('editorFieldCount', 'value'); + } - async controlChangeCancel() { - await testSubjects.click('fieldCancelButton'); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + async controlChangeCancel() { + await this.testSubjects.click('fieldCancelButton'); + await this.header.waitUntilLoadingHasFinished(); + } - async controlChangeSave() { - await testSubjects.click('fieldSaveButton'); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + async controlChangeSave() { + await this.testSubjects.click('fieldSaveButton'); + await this.header.waitUntilLoadingHasFinished(); + } - async hasIndexPattern(name: string) { - return await find.existsByLinkText(name); - } + async hasIndexPattern(name: string) { + return await this.find.existsByLinkText(name); + } - async clickIndexPatternByName(name: string) { - const indexLink = await find.byXPath(`//a[descendant::*[text()='${name}']]`); - await indexLink.click(); - } + async clickIndexPatternByName(name: string) { + const indexLink = await this.find.byXPath(`//a[descendant::*[text()='${name}']]`); + await indexLink.click(); + } - async clickIndexPatternLogstash() { - await this.clickIndexPatternByName('logstash-*'); - } + async clickIndexPatternLogstash() { + await this.clickIndexPatternByName('logstash-*'); + } - async getIndexPatternList() { - await testSubjects.existOrFail('indexPatternTable', { timeout: 5000 }); - return await find.allByCssSelector( - '[data-test-subj="indexPatternTable"] .euiTable .euiTableRow' - ); - } + async getIndexPatternList() { + await this.testSubjects.existOrFail('indexPatternTable', { timeout: 5000 }); + return await this.find.allByCssSelector( + '[data-test-subj="indexPatternTable"] .euiTable .euiTableRow' + ); + } - async getAllIndexPatternNames() { - const indexPatterns = await this.getIndexPatternList(); - return await mapAsync(indexPatterns, async (index) => { - return await index.getVisibleText(); - }); - } + async getAllIndexPatternNames() { + const indexPatterns = await this.getIndexPatternList(); + return await mapAsync(indexPatterns, async (index) => { + return await index.getVisibleText(); + }); + } - async isIndexPatternListEmpty() { - return !(await testSubjects.exists('indexPatternTable', { timeout: 5000 })); - } + async isIndexPatternListEmpty() { + return !(await this.testSubjects.exists('indexPatternTable', { timeout: 5000 })); + } - async removeLogstashIndexPatternIfExist() { - if (!(await this.isIndexPatternListEmpty())) { - await this.clickIndexPatternLogstash(); - await this.removeIndexPattern(); - } + async removeLogstashIndexPatternIfExist() { + if (!(await this.isIndexPatternListEmpty())) { + await this.clickIndexPatternLogstash(); + await this.removeIndexPattern(); } + } - async createIndexPattern( - indexPatternName: string, - // null to bypass default value - timefield: string | null = '@timestamp', - isStandardIndexPattern = true - ) { - await retry.try(async () => { - await PageObjects.header.waitUntilLoadingHasFinished(); - await this.clickKibanaIndexPatterns(); - const exists = await this.hasIndexPattern(indexPatternName); - - if (exists) { - await this.clickIndexPatternByName(indexPatternName); - return; - } + async createIndexPattern( + indexPatternName: string, + // null to bypass default value + timefield: string | null = '@timestamp', + isStandardIndexPattern = true + ) { + await this.retry.try(async () => { + await this.header.waitUntilLoadingHasFinished(); + await this.clickKibanaIndexPatterns(); + const exists = await this.hasIndexPattern(indexPatternName); + + if (exists) { + await this.clickIndexPatternByName(indexPatternName); + return; + } - await PageObjects.header.waitUntilLoadingHasFinished(); - await this.clickAddNewIndexPatternButton(); - if (!isStandardIndexPattern) { - await this.clickCreateNewRollupButton(); - } - await PageObjects.header.waitUntilLoadingHasFinished(); - await retry.try(async () => { - await this.setIndexPatternField(indexPatternName); - }); - - const btn = await this.getCreateIndexPatternGoToStep2Button(); - await retry.waitFor(`index pattern Go To Step 2 button to be enabled`, async () => { - return await btn.isEnabled(); - }); - await btn.click(); - - await PageObjects.common.sleep(2000); - if (timefield) { - await this.selectTimeFieldOption(timefield); - } - await (await this.getCreateIndexPatternButton()).click(); + await this.header.waitUntilLoadingHasFinished(); + await this.clickAddNewIndexPatternButton(); + if (!isStandardIndexPattern) { + await this.clickCreateNewRollupButton(); + } + await this.header.waitUntilLoadingHasFinished(); + await this.retry.try(async () => { + await this.setIndexPatternField(indexPatternName); }); - await PageObjects.header.waitUntilLoadingHasFinished(); - await retry.try(async () => { - const currentUrl = await browser.getCurrentUrl(); - log.info('currentUrl', currentUrl); - if (!currentUrl.match(/indexPatterns\/.+\?/)) { - throw new Error('Index pattern not created'); - } else { - log.debug('Index pattern created: ' + currentUrl); - } + + const btn = await this.getCreateIndexPatternGoToStep2Button(); + await this.retry.waitFor(`index pattern Go To Step 2 button to be enabled`, async () => { + return await btn.isEnabled(); }); + await btn.click(); - return await this.getIndexPatternIdFromUrl(); - } + await this.common.sleep(2000); + if (timefield) { + await this.selectTimeFieldOption(timefield); + } + await (await this.getCreateIndexPatternButton()).click(); + }); + await this.header.waitUntilLoadingHasFinished(); + await this.retry.try(async () => { + const currentUrl = await this.browser.getCurrentUrl(); + this.log.info('currentUrl', currentUrl); + if (!currentUrl.match(/indexPatterns\/.+\?/)) { + throw new Error('Index pattern not created'); + } else { + this.log.debug('Index pattern created: ' + currentUrl); + } + }); - async clickAddNewIndexPatternButton() { - await PageObjects.common.scrollKibanaBodyTop(); - await testSubjects.click('createIndexPatternButton'); - } + return await this.getIndexPatternIdFromUrl(); + } - async clickCreateNewRollupButton() { - await testSubjects.click('createRollupIndexPatternButton'); - } + async clickAddNewIndexPatternButton() { + await this.common.scrollKibanaBodyTop(); + await this.testSubjects.click('createIndexPatternButton'); + } - async getIndexPatternIdFromUrl() { - const currentUrl = await browser.getCurrentUrl(); - const indexPatternId = currentUrl.match(/.*\/(.*)/)![1]; + async clickCreateNewRollupButton() { + await this.testSubjects.click('createRollupIndexPatternButton'); + } - log.debug('index pattern ID: ', indexPatternId); + async getIndexPatternIdFromUrl() { + const currentUrl = await this.browser.getCurrentUrl(); + const indexPatternId = currentUrl.match(/.*\/(.*)/)![1]; - return indexPatternId; - } + this.log.debug('index pattern ID: ', indexPatternId); - async setIndexPatternField(indexPatternName = 'logstash-*') { - log.debug(`setIndexPatternField(${indexPatternName})`); - const field = await this.getIndexPatternField(); - await field.clearValue(); - if ( - indexPatternName.charAt(0) === '*' && - indexPatternName.charAt(indexPatternName.length - 1) === '*' - ) { - // this is a special case when the index pattern name starts with '*' - // like '*:makelogs-*' where the UI will not append * - await field.type(indexPatternName, { charByChar: true }); - } else if (indexPatternName.charAt(indexPatternName.length - 1) === '*') { - // the common case where the UI will append '*' automatically so we won't type it - const tempName = indexPatternName.slice(0, -1); - await field.type(tempName, { charByChar: true }); - } else { - // case where we don't want the * appended so we'll remove it if it was added - await field.type(indexPatternName, { charByChar: true }); - const tempName = await field.getAttribute('value'); - if (tempName.length > indexPatternName.length) { - await field.type(browser.keys.DELETE, { charByChar: true }); - } + return indexPatternId; + } + + async setIndexPatternField(indexPatternName = 'logstash-*') { + this.log.debug(`setIndexPatternField(${indexPatternName})`); + const field = await this.getIndexPatternField(); + await field.clearValue(); + if ( + indexPatternName.charAt(0) === '*' && + indexPatternName.charAt(indexPatternName.length - 1) === '*' + ) { + // this is a special case when the index pattern name starts with '*' + // like '*:makelogs-*' where the UI will not append * + await field.type(indexPatternName, { charByChar: true }); + } else if (indexPatternName.charAt(indexPatternName.length - 1) === '*') { + // the common case where the UI will append '*' automatically so we won't type it + const tempName = indexPatternName.slice(0, -1); + await field.type(tempName, { charByChar: true }); + } else { + // case where we don't want the * appended so we'll remove it if it was added + await field.type(indexPatternName, { charByChar: true }); + const tempName = await field.getAttribute('value'); + if (tempName.length > indexPatternName.length) { + await field.type(this.browser.keys.DELETE, { charByChar: true }); } - const currentName = await field.getAttribute('value'); - log.debug(`setIndexPatternField set to ${currentName}`); - expect(currentName).to.eql(indexPatternName); } + const currentName = await field.getAttribute('value'); + this.log.debug(`setIndexPatternField set to ${currentName}`); + expect(currentName).to.eql(indexPatternName); + } - async getCreateIndexPatternGoToStep2Button() { - return await testSubjects.find('createIndexPatternGoToStep2Button'); - } + async getCreateIndexPatternGoToStep2Button() { + return await this.testSubjects.find('createIndexPatternGoToStep2Button'); + } - async removeIndexPattern() { - let alertText; - await retry.try(async () => { - log.debug('click delete index pattern button'); - await this.clickDeletePattern(); - }); - await retry.try(async () => { - log.debug('getAlertText'); - alertText = await testSubjects.getVisibleText('confirmModalTitleText'); - }); - await retry.try(async () => { - log.debug('acceptConfirmation'); - await testSubjects.click('confirmModalConfirmButton'); - }); - await retry.try(async () => { - const currentUrl = await browser.getCurrentUrl(); - if (currentUrl.match(/index_patterns\/.+\?/)) { - throw new Error('Index pattern not removed'); - } - }); - return alertText; - } + async removeIndexPattern() { + let alertText; + await this.retry.try(async () => { + this.log.debug('click delete index pattern button'); + await this.clickDeletePattern(); + }); + await this.retry.try(async () => { + this.log.debug('getAlertText'); + alertText = await this.testSubjects.getVisibleText('confirmModalTitleText'); + }); + await this.retry.try(async () => { + this.log.debug('acceptConfirmation'); + await this.testSubjects.click('confirmModalConfirmButton'); + }); + await this.retry.try(async () => { + const currentUrl = await this.browser.getCurrentUrl(); + if (currentUrl.match(/index_patterns\/.+\?/)) { + throw new Error('Index pattern not removed'); + } + }); + return alertText; + } - async clickFieldsTab() { - log.debug('click Fields tab'); - await testSubjects.click('tab-indexedFields'); - } + async clickFieldsTab() { + this.log.debug('click Fields tab'); + await this.testSubjects.click('tab-indexedFields'); + } - async clickScriptedFieldsTab() { - log.debug('click Scripted Fields tab'); - await testSubjects.click('tab-scriptedFields'); - } + async clickScriptedFieldsTab() { + this.log.debug('click Scripted Fields tab'); + await this.testSubjects.click('tab-scriptedFields'); + } - async clickSourceFiltersTab() { - log.debug('click Source Filters tab'); - await testSubjects.click('tab-sourceFilters'); - } + async clickSourceFiltersTab() { + this.log.debug('click Source Filters tab'); + await this.testSubjects.click('tab-sourceFilters'); + } - async editScriptedField(name: string) { - await this.filterField(name); - await find.clickByCssSelector('.euiTableRowCell--hasActions button:first-child'); - } + async editScriptedField(name: string) { + await this.filterField(name); + await this.find.clickByCssSelector('.euiTableRowCell--hasActions button:first-child'); + } - async addScriptedField( - name: string, - language: string, - type: string, - format: Record, - popularity: string, - script: string - ) { - await this.clickAddScriptedField(); - await this.setScriptedFieldName(name); - if (language) await this.setScriptedFieldLanguage(language); - if (type) await this.setScriptedFieldType(type); - if (format) { - await this.setFieldFormat(format.format); - // null means leave - default - which has no other settings - // Url adds Type, Url Template, and Label Template - // Date adds moment.js format pattern (Default: "MMMM Do YYYY, HH:mm:ss.SSS") - // String adds Transform - switch (format.format) { - case 'url': - await this.setScriptedFieldUrlType(format.type); - await this.setScriptedFieldUrlTemplate(format.template); - await this.setScriptedFieldUrlLabelTemplate(format.labelTemplate); - break; - case 'date': - await this.setScriptedFieldDatePattern(format.datePattern); - break; - case 'string': - await this.setScriptedFieldStringTransform(format.stringTransform); - break; - } + async addScriptedField( + name: string, + language: string, + type: string, + format: Record, + popularity: string, + script: string + ) { + await this.clickAddScriptedField(); + await this.setScriptedFieldName(name); + if (language) await this.setScriptedFieldLanguage(language); + if (type) await this.setScriptedFieldType(type); + if (format) { + await this.setFieldFormat(format.format); + // null means leave - default - which has no other settings + // Url adds Type, Url Template, and Label Template + // Date adds moment.js format pattern (Default: "MMMM Do YYYY, HH:mm:ss.SSS") + // String adds Transform + switch (format.format) { + case 'url': + await this.setScriptedFieldUrlType(format.type); + await this.setScriptedFieldUrlTemplate(format.template); + await this.setScriptedFieldUrlLabelTemplate(format.labelTemplate); + break; + case 'date': + await this.setScriptedFieldDatePattern(format.datePattern); + break; + case 'string': + await this.setScriptedFieldStringTransform(format.stringTransform); + break; } - if (popularity) await this.setScriptedFieldPopularity(popularity); - await this.setScriptedFieldScript(script); - await this.clickSaveScriptedField(); } + if (popularity) await this.setScriptedFieldPopularity(popularity); + await this.setScriptedFieldScript(script); + await this.clickSaveScriptedField(); + } - async addRuntimeField(name: string, type: string, script: string) { - await this.clickAddField(); - await this.setFieldName(name); - await this.setFieldType(type); - if (script) { - await this.setFieldScript(script); - } - await this.clickSaveField(); - await this.closeIndexPatternFieldEditor(); + async addRuntimeField(name: string, type: string, script: string) { + await this.clickAddField(); + await this.setFieldName(name); + await this.setFieldType(type); + if (script) { + await this.setFieldScript(script); } + await this.clickSaveField(); + await this.closeIndexPatternFieldEditor(); + } - public async confirmSave() { - await testSubjects.setValue('saveModalConfirmText', 'change'); - await testSubjects.click('confirmModalConfirmButton'); - } + public async confirmSave() { + await this.testSubjects.setValue('saveModalConfirmText', 'change'); + await this.testSubjects.click('confirmModalConfirmButton'); + } - public async confirmDelete() { - await testSubjects.setValue('deleteModalConfirmText', 'remove'); - await testSubjects.click('confirmModalConfirmButton'); - } + public async confirmDelete() { + await this.testSubjects.setValue('deleteModalConfirmText', 'remove'); + await this.testSubjects.click('confirmModalConfirmButton'); + } - async closeIndexPatternFieldEditor() { - await retry.waitFor('field editor flyout to close', async () => { - return !(await testSubjects.exists('euiFlyoutCloseButton')); - }); - } + async closeIndexPatternFieldEditor() { + await this.retry.waitFor('field editor flyout to close', async () => { + return !(await this.testSubjects.exists('euiFlyoutCloseButton')); + }); + } - async clickAddField() { - log.debug('click Add Field'); - await testSubjects.click('addField'); - } + async clickAddField() { + this.log.debug('click Add Field'); + await this.testSubjects.click('addField'); + } - async clickSaveField() { - log.debug('click Save'); - await testSubjects.click('fieldSaveButton'); - } + async clickSaveField() { + this.log.debug('click Save'); + await this.testSubjects.click('fieldSaveButton'); + } - async setFieldName(name: string) { - log.debug('set field name = ' + name); - await testSubjects.setValue('nameField', name); - } + async setFieldName(name: string) { + this.log.debug('set field name = ' + name); + await this.testSubjects.setValue('nameField', name); + } - async setFieldType(type: string) { - log.debug('set type = ' + type); - await testSubjects.setValue('typeField', type); - } + async setFieldType(type: string) { + this.log.debug('set type = ' + type); + await this.testSubjects.setValue('typeField', type); + } - async setFieldScript(script: string) { - log.debug('set script = ' + script); - const formatRow = await testSubjects.find('valueRow'); - const formatRowToggle = ( - await formatRow.findAllByCssSelector('[data-test-subj="toggle"]') - )[0]; - - await formatRowToggle.click(); - const getMonacoTextArea = async () => (await formatRow.findAllByCssSelector('textarea'))[0]; - retry.waitFor('monaco editor is ready', async () => !!(await getMonacoTextArea())); - const monacoTextArea = await getMonacoTextArea(); - await monacoTextArea.focus(); - browser.pressKeys(script); - } + async setFieldScript(script: string) { + this.log.debug('set script = ' + script); + const formatRow = await this.testSubjects.find('valueRow'); + const formatRowToggle = (await formatRow.findAllByCssSelector('[data-test-subj="toggle"]'))[0]; + + await formatRowToggle.click(); + const getMonacoTextArea = async () => (await formatRow.findAllByCssSelector('textarea'))[0]; + this.retry.waitFor('monaco editor is ready', async () => !!(await getMonacoTextArea())); + const monacoTextArea = await getMonacoTextArea(); + await monacoTextArea.focus(); + this.browser.pressKeys(script); + } - async changeFieldScript(script: string) { - log.debug('set script = ' + script); - const formatRow = await testSubjects.find('valueRow'); - const getMonacoTextArea = async () => (await formatRow.findAllByCssSelector('textarea'))[0]; - retry.waitFor('monaco editor is ready', async () => !!(await getMonacoTextArea())); - const monacoTextArea = await getMonacoTextArea(); - await monacoTextArea.focus(); - browser.pressKeys(browser.keys.DELETE.repeat(30)); - browser.pressKeys(script); - } + async changeFieldScript(script: string) { + this.log.debug('set script = ' + script); + const formatRow = await this.testSubjects.find('valueRow'); + const getMonacoTextArea = async () => (await formatRow.findAllByCssSelector('textarea'))[0]; + this.retry.waitFor('monaco editor is ready', async () => !!(await getMonacoTextArea())); + const monacoTextArea = await getMonacoTextArea(); + await monacoTextArea.focus(); + this.browser.pressKeys(this.browser.keys.DELETE.repeat(30)); + this.browser.pressKeys(script); + } - async clickAddScriptedField() { - log.debug('click Add Scripted Field'); - await testSubjects.click('addScriptedFieldLink'); - } + async clickAddScriptedField() { + this.log.debug('click Add Scripted Field'); + await this.testSubjects.click('addScriptedFieldLink'); + } - async clickSaveScriptedField() { - log.debug('click Save Scripted Field'); - await testSubjects.click('fieldSaveButton'); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + async clickSaveScriptedField() { + this.log.debug('click Save Scripted Field'); + await this.testSubjects.click('fieldSaveButton'); + await this.header.waitUntilLoadingHasFinished(); + } - async setScriptedFieldName(name: string) { - log.debug('set scripted field name = ' + name); - await testSubjects.setValue('editorFieldName', name); - } + async setScriptedFieldName(name: string) { + this.log.debug('set scripted field name = ' + name); + await this.testSubjects.setValue('editorFieldName', name); + } - async setScriptedFieldLanguage(language: string) { - log.debug('set scripted field language = ' + language); - await find.clickByCssSelector( - 'select[data-test-subj="editorFieldLang"] > option[value="' + language + '"]' - ); - } + async setScriptedFieldLanguage(language: string) { + this.log.debug('set scripted field language = ' + language); + await this.find.clickByCssSelector( + 'select[data-test-subj="editorFieldLang"] > option[value="' + language + '"]' + ); + } - async setScriptedFieldType(type: string) { - log.debug('set scripted field type = ' + type); - await find.clickByCssSelector( - 'select[data-test-subj="editorFieldType"] > option[value="' + type + '"]' - ); - } + async setScriptedFieldType(type: string) { + this.log.debug('set scripted field type = ' + type); + await this.find.clickByCssSelector( + 'select[data-test-subj="editorFieldType"] > option[value="' + type + '"]' + ); + } - async setFieldFormat(format: string) { - log.debug('set scripted field format = ' + format); - await find.clickByCssSelector( - 'select[data-test-subj="editorSelectedFormatId"] > option[value="' + format + '"]' - ); - } + async setFieldFormat(format: string) { + this.log.debug('set scripted field format = ' + format); + await this.find.clickByCssSelector( + 'select[data-test-subj="editorSelectedFormatId"] > option[value="' + format + '"]' + ); + } - async setScriptedFieldUrlType(type: string) { - log.debug('set scripted field Url type = ' + type); - await find.clickByCssSelector( - 'select[data-test-subj="urlEditorType"] > option[value="' + type + '"]' - ); - } + async setScriptedFieldUrlType(type: string) { + this.log.debug('set scripted field Url type = ' + type); + await this.find.clickByCssSelector( + 'select[data-test-subj="urlEditorType"] > option[value="' + type + '"]' + ); + } - async setScriptedFieldUrlTemplate(template: string) { - log.debug('set scripted field Url Template = ' + template); - const urlTemplateField = await find.byCssSelector( - 'input[data-test-subj="urlEditorUrlTemplate"]' - ); - await urlTemplateField.type(template); - } + async setScriptedFieldUrlTemplate(template: string) { + this.log.debug('set scripted field Url Template = ' + template); + const urlTemplateField = await this.find.byCssSelector( + 'input[data-test-subj="urlEditorUrlTemplate"]' + ); + await urlTemplateField.type(template); + } - async setScriptedFieldUrlLabelTemplate(labelTemplate: string) { - log.debug('set scripted field Url Label Template = ' + labelTemplate); - const urlEditorLabelTemplate = await find.byCssSelector( - 'input[data-test-subj="urlEditorLabelTemplate"]' - ); - await urlEditorLabelTemplate.type(labelTemplate); - } + async setScriptedFieldUrlLabelTemplate(labelTemplate: string) { + this.log.debug('set scripted field Url Label Template = ' + labelTemplate); + const urlEditorLabelTemplate = await this.find.byCssSelector( + 'input[data-test-subj="urlEditorLabelTemplate"]' + ); + await urlEditorLabelTemplate.type(labelTemplate); + } - async setScriptedFieldDatePattern(datePattern: string) { - log.debug('set scripted field Date Pattern = ' + datePattern); - const datePatternField = await find.byCssSelector( - 'input[data-test-subj="dateEditorPattern"]' - ); - // clearValue does not work here - // Send Backspace event for each char in value string to clear field - await datePatternField.clearValueWithKeyboard({ charByChar: true }); - await datePatternField.type(datePattern); - } + async setScriptedFieldDatePattern(datePattern: string) { + this.log.debug('set scripted field Date Pattern = ' + datePattern); + const datePatternField = await this.find.byCssSelector( + 'input[data-test-subj="dateEditorPattern"]' + ); + // clearValue does not work here + // Send Backspace event for each char in value string to clear field + await datePatternField.clearValueWithKeyboard({ charByChar: true }); + await datePatternField.type(datePattern); + } - async setScriptedFieldStringTransform(stringTransform: string) { - log.debug('set scripted field string Transform = ' + stringTransform); - await find.clickByCssSelector( - 'select[data-test-subj="stringEditorTransform"] > option[value="' + stringTransform + '"]' - ); - } + async setScriptedFieldStringTransform(stringTransform: string) { + this.log.debug('set scripted field string Transform = ' + stringTransform); + await this.find.clickByCssSelector( + 'select[data-test-subj="stringEditorTransform"] > option[value="' + stringTransform + '"]' + ); + } - async setScriptedFieldPopularity(popularity: string) { - log.debug('set scripted field popularity = ' + popularity); - await testSubjects.setValue('editorFieldCount', popularity); - } + async setScriptedFieldPopularity(popularity: string) { + this.log.debug('set scripted field popularity = ' + popularity); + await this.testSubjects.setValue('editorFieldCount', popularity); + } - async setScriptedFieldScript(script: string) { - log.debug('set scripted field script = ' + script); - const aceEditorCssSelector = '[data-test-subj="editorFieldScript"] .ace_editor'; - const editor = await find.byCssSelector(aceEditorCssSelector); - await editor.click(); - const existingText = await editor.getVisibleText(); - for (let i = 0; i < existingText.length; i++) { - await browser.pressKeys(browser.keys.BACK_SPACE); - } - await browser.pressKeys(...script.split('')); + async setScriptedFieldScript(script: string) { + this.log.debug('set scripted field script = ' + script); + const aceEditorCssSelector = '[data-test-subj="editorFieldScript"] .ace_editor'; + const editor = await this.find.byCssSelector(aceEditorCssSelector); + await editor.click(); + const existingText = await editor.getVisibleText(); + for (let i = 0; i < existingText.length; i++) { + await this.browser.pressKeys(this.browser.keys.BACK_SPACE); } + await this.browser.pressKeys(...script.split('')); + } - async openScriptedFieldHelp(activeTab: string) { - log.debug('open Scripted Fields help'); - let isOpen = await testSubjects.exists('scriptedFieldsHelpFlyout'); - if (!isOpen) { - await retry.try(async () => { - await testSubjects.click('scriptedFieldsHelpLink'); - isOpen = await testSubjects.exists('scriptedFieldsHelpFlyout'); - if (!isOpen) { - throw new Error('Failed to open scripted fields help'); - } - }); - } - - if (activeTab) { - await testSubjects.click(activeTab); - } + async openScriptedFieldHelp(activeTab: string) { + this.log.debug('open Scripted Fields help'); + let isOpen = await this.testSubjects.exists('scriptedFieldsHelpFlyout'); + if (!isOpen) { + await this.retry.try(async () => { + await this.testSubjects.click('scriptedFieldsHelpLink'); + isOpen = await this.testSubjects.exists('scriptedFieldsHelpFlyout'); + if (!isOpen) { + throw new Error('Failed to open scripted fields help'); + } + }); } - async closeScriptedFieldHelp() { - await flyout.ensureClosed('scriptedFieldsHelpFlyout'); + if (activeTab) { + await this.testSubjects.click(activeTab); } + } - async executeScriptedField(script: string, additionalField: string) { - log.debug('execute Scripted Fields help'); - await this.closeScriptedFieldHelp(); // ensure script help is closed so script input is not blocked - await this.setScriptedFieldScript(script); - await this.openScriptedFieldHelp('testTab'); - if (additionalField) { - await comboBox.set('additionalFieldsSelect', additionalField); - await testSubjects.find('scriptedFieldPreview'); - await testSubjects.click('runScriptButton'); - await testSubjects.waitForDeleted('.euiLoadingSpinner'); - } - let scriptResults; - await retry.try(async () => { - scriptResults = await testSubjects.getVisibleText('scriptedFieldPreview'); - }); - return scriptResults; - } + async closeScriptedFieldHelp() { + await this.flyout.ensureClosed('scriptedFieldsHelpFlyout'); + } - async clickEditFieldFormat() { - await testSubjects.click('editFieldFormat'); - } + async executeScriptedField(script: string, additionalField: string) { + this.log.debug('execute Scripted Fields help'); + await this.closeScriptedFieldHelp(); // ensure script help is closed so script input is not blocked + await this.setScriptedFieldScript(script); + await this.openScriptedFieldHelp('testTab'); + if (additionalField) { + await this.comboBox.set('additionalFieldsSelect', additionalField); + await this.testSubjects.find('scriptedFieldPreview'); + await this.testSubjects.click('runScriptButton'); + await this.testSubjects.waitForDeleted('.euiLoadingSpinner'); + } + let scriptResults; + await this.retry.try(async () => { + scriptResults = await this.testSubjects.getVisibleText('scriptedFieldPreview'); + }); + return scriptResults; + } - async associateIndexPattern(oldIndexPatternId: string, newIndexPatternTitle: string) { - await find.clickByCssSelector( - `select[data-test-subj="managementChangeIndexSelection-${oldIndexPatternId}"] > - [data-test-subj="indexPatternOption-${newIndexPatternTitle}"]` - ); - } + async clickEditFieldFormat() { + await this.testSubjects.click('editFieldFormat'); + } - async clickChangeIndexConfirmButton() { - await testSubjects.click('changeIndexConfirmButton'); - } + async associateIndexPattern(oldIndexPatternId: string, newIndexPatternTitle: string) { + await this.find.clickByCssSelector( + `select[data-test-subj="managementChangeIndexSelection-${oldIndexPatternId}"] > + [data-test-subj="indexPatternOption-${newIndexPatternTitle}"]` + ); } - return new SettingsPage(); + async clickChangeIndexConfirmButton() { + await this.testSubjects.click('changeIndexConfirmButton'); + } } diff --git a/test/functional/page_objects/share_page.ts b/test/functional/page_objects/share_page.ts index aa58341600599b..ce1dc4c45e21fb 100644 --- a/test/functional/page_objects/share_page.ts +++ b/test/functional/page_objects/share_page.ts @@ -6,76 +6,72 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; -export function SharePageProvider({ getService }: FtrProviderContext) { - const testSubjects = getService('testSubjects'); - const find = getService('find'); - const log = getService('log'); +export class SharePageObject extends FtrService { + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly find = this.ctx.getService('find'); + private readonly log = this.ctx.getService('log'); - class SharePage { - async isShareMenuOpen() { - return await testSubjects.exists('shareContextMenu'); - } - - async clickShareTopNavButton() { - return testSubjects.click('shareTopNavButton'); - } + async isShareMenuOpen() { + return await this.testSubjects.exists('shareContextMenu'); + } - async openShareMenuItem(itemTitle: string) { - log.debug(`openShareMenuItem title:${itemTitle}`); - const isShareMenuOpen = await this.isShareMenuOpen(); - if (!isShareMenuOpen) { - await this.clickShareTopNavButton(); - } else { - // there is no easy way to ensure the menu is at the top level - // so just close the existing menu - await this.clickShareTopNavButton(); - // and then re-open the menu - await this.clickShareTopNavButton(); - } - const menuPanel = await find.byCssSelector('div.euiContextMenuPanel'); - await testSubjects.click(`sharePanel-${itemTitle.replace(' ', '')}`); - await testSubjects.waitForDeleted(menuPanel); - } + async clickShareTopNavButton() { + return this.testSubjects.click('shareTopNavButton'); + } - /** - * if there are more entries in the share menu, the permalinks entry has to be clicked first - * else the selection isn't displayed. this happens if you're testing against an instance - * with xpack features enabled, where there's also a csv sharing option - * in a pure OSS environment, the permalinks sharing panel is displayed initially - */ - async openPermaLinks() { - if (await testSubjects.exists('sharePanel-Permalinks')) { - await testSubjects.click(`sharePanel-Permalinks`); - } + async openShareMenuItem(itemTitle: string) { + this.log.debug(`openShareMenuItem title:${itemTitle}`); + const isShareMenuOpen = await this.isShareMenuOpen(); + if (!isShareMenuOpen) { + await this.clickShareTopNavButton(); + } else { + // there is no easy way to ensure the menu is at the top level + // so just close the existing menu + await this.clickShareTopNavButton(); + // and then re-open the menu + await this.clickShareTopNavButton(); } + const menuPanel = await this.find.byCssSelector('div.euiContextMenuPanel'); + await this.testSubjects.click(`sharePanel-${itemTitle.replace(' ', '')}`); + await this.testSubjects.waitForDeleted(menuPanel); + } - async getSharedUrl() { - await this.openPermaLinks(); - return await testSubjects.getAttribute('copyShareUrlButton', 'data-share-url'); + /** + * if there are more entries in the share menu, the permalinks entry has to be clicked first + * else the selection isn't displayed. this happens if you're testing against an instance + * with xpack features enabled, where there's also a csv sharing option + * in a pure OSS environment, the permalinks sharing panel is displayed initially + */ + async openPermaLinks() { + if (await this.testSubjects.exists('sharePanel-Permalinks')) { + await this.testSubjects.click(`sharePanel-Permalinks`); } + } - async createShortUrlExistOrFail() { - await testSubjects.existOrFail('createShortUrl'); - } + async getSharedUrl() { + await this.openPermaLinks(); + return await this.testSubjects.getAttribute('copyShareUrlButton', 'data-share-url'); + } - async createShortUrlMissingOrFail() { - await testSubjects.missingOrFail('createShortUrl'); - } + async createShortUrlExistOrFail() { + await this.testSubjects.existOrFail('createShortUrl'); + } - async checkShortenUrl() { - await this.openPermaLinks(); - const shareForm = await testSubjects.find('shareUrlForm'); - await testSubjects.setCheckbox('useShortUrl', 'check'); - await shareForm.waitForDeletedByCssSelector('.euiLoadingSpinner'); - } + async createShortUrlMissingOrFail() { + await this.testSubjects.missingOrFail('createShortUrl'); + } - async exportAsSavedObject() { - await this.openPermaLinks(); - return await testSubjects.click('exportAsSavedObject'); - } + async checkShortenUrl() { + await this.openPermaLinks(); + const shareForm = await this.testSubjects.find('shareUrlForm'); + await this.testSubjects.setCheckbox('useShortUrl', 'check'); + await shareForm.waitForDeletedByCssSelector('.euiLoadingSpinner'); } - return new SharePage(); + async exportAsSavedObject() { + await this.openPermaLinks(); + return await this.testSubjects.click('exportAsSavedObject'); + } } diff --git a/test/functional/page_objects/tag_cloud_page.ts b/test/functional/page_objects/tag_cloud_page.ts index fa977618e64d77..61e844c813df8c 100644 --- a/test/functional/page_objects/tag_cloud_page.ts +++ b/test/functional/page_objects/tag_cloud_page.ts @@ -6,36 +6,33 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; import { WebElementWrapper } from '../services/lib/web_element_wrapper'; -export function TagCloudPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const find = getService('find'); - const testSubjects = getService('testSubjects'); - const { header, visChart } = getPageObjects(['header', 'visChart']); +export class TagCloudPageObject extends FtrService { + private readonly find = this.ctx.getService('find'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly header = this.ctx.getPageObject('header'); + private readonly visChart = this.ctx.getPageObject('visChart'); - class TagCloudPage { - public async selectTagCloudTag(tagDisplayText: string) { - await testSubjects.click(tagDisplayText); - await header.waitUntilLoadingHasFinished(); - } + public async selectTagCloudTag(tagDisplayText: string) { + await this.testSubjects.click(tagDisplayText); + await this.header.waitUntilLoadingHasFinished(); + } - public async getTextTag() { - await visChart.waitForVisualization(); - const elements = await find.allByCssSelector('text'); - return await Promise.all(elements.map(async (element) => await element.getVisibleText())); - } + public async getTextTag() { + await this.visChart.waitForVisualization(); + const elements = await this.find.allByCssSelector('text'); + return await Promise.all(elements.map(async (element) => await element.getVisibleText())); + } - public async getTextSizes() { - const tags = await find.allByCssSelector('text'); - async function returnTagSize(tag: WebElementWrapper) { - const style = await tag.getAttribute('style'); - const fontSize = style.match(/font-size: ([^;]*);/); - return fontSize ? fontSize[1] : ''; - } - return await Promise.all(tags.map(returnTagSize)); + public async getTextSizes() { + const tags = await this.find.allByCssSelector('text'); + async function returnTagSize(tag: WebElementWrapper) { + const style = await tag.getAttribute('style'); + const fontSize = style.match(/font-size: ([^;]*);/); + return fontSize ? fontSize[1] : ''; } + return await Promise.all(tags.map(returnTagSize)); } - - return new TagCloudPage(); } diff --git a/test/functional/page_objects/tile_map_page.ts b/test/functional/page_objects/tile_map_page.ts index 6008d7434bf1d3..079ca919543e22 100644 --- a/test/functional/page_objects/tile_map_page.ts +++ b/test/functional/page_objects/tile_map_page.ts @@ -6,92 +6,88 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; - -export function TileMapPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const find = getService('find'); - const testSubjects = getService('testSubjects'); - const retry = getService('retry'); - const log = getService('log'); - const inspector = getService('inspector'); - const monacoEditor = getService('monacoEditor'); - const { header } = getPageObjects(['header']); - - class TileMapPage { - public async getZoomSelectors(zoomSelector: string) { - return await find.allByCssSelector(zoomSelector); - } - - public async clickMapButton(zoomSelector: string, waitForLoading?: boolean) { - await retry.try(async () => { - const zooms = await this.getZoomSelectors(zoomSelector); - for (let i = 0; i < zooms.length; i++) { - await zooms[i].click(); - } - if (waitForLoading) { - await header.waitUntilLoadingHasFinished(); - } - }); - } +import { FtrService } from '../ftr_provider_context'; + +export class TileMapPageObject extends FtrService { + private readonly find = this.ctx.getService('find'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly retry = this.ctx.getService('retry'); + private readonly log = this.ctx.getService('log'); + private readonly inspector = this.ctx.getService('inspector'); + private readonly monacoEditor = this.ctx.getService('monacoEditor'); + private readonly header = this.ctx.getPageObject('header'); + + public async getZoomSelectors(zoomSelector: string) { + return await this.find.allByCssSelector(zoomSelector); + } - public async getVisualizationRequest() { - log.debug('getVisualizationRequest'); - await inspector.open(); - await testSubjects.click('inspectorViewChooser'); - await testSubjects.click('inspectorViewChooserRequests'); - await testSubjects.click('inspectorRequestDetailRequest'); - await find.byCssSelector('.react-monaco-editor-container'); + public async clickMapButton(zoomSelector: string, waitForLoading?: boolean) { + await this.retry.try(async () => { + const zooms = await this.getZoomSelectors(zoomSelector); + for (let i = 0; i < zooms.length; i++) { + await zooms[i].click(); + } + if (waitForLoading) { + await this.header.waitUntilLoadingHasFinished(); + } + }); + } - return await monacoEditor.getCodeEditorValue(1); - } + public async getVisualizationRequest() { + this.log.debug('getVisualizationRequest'); + await this.inspector.open(); + await this.testSubjects.click('inspectorViewChooser'); + await this.testSubjects.click('inspectorViewChooserRequests'); + await this.testSubjects.click('inspectorRequestDetailRequest'); + await this.find.byCssSelector('.react-monaco-editor-container'); - public async getMapBounds(): Promise { - const request = await this.getVisualizationRequest(); - const requestObject = JSON.parse(request); + return await this.monacoEditor.getCodeEditorValue(1); + } - return requestObject.aggs.filter_agg.filter.geo_bounding_box['geo.coordinates']; - } + public async getMapBounds(): Promise { + const request = await this.getVisualizationRequest(); + const requestObject = JSON.parse(request); - public async clickMapZoomIn(waitForLoading = true) { - await this.clickMapButton('a.leaflet-control-zoom-in', waitForLoading); - } + return requestObject.aggs.filter_agg.filter.geo_bounding_box['geo.coordinates']; + } - public async clickMapZoomOut(waitForLoading = true) { - await this.clickMapButton('a.leaflet-control-zoom-out', waitForLoading); - } + public async clickMapZoomIn(waitForLoading = true) { + await this.clickMapButton('a.leaflet-control-zoom-in', waitForLoading); + } - public async getMapZoomEnabled(zoomSelector: string): Promise { - const zooms = await this.getZoomSelectors(zoomSelector); - const classAttributes = await Promise.all( - zooms.map(async (zoom) => await zoom.getAttribute('class')) - ); - return !classAttributes.join('').includes('leaflet-disabled'); - } + public async clickMapZoomOut(waitForLoading = true) { + await this.clickMapButton('a.leaflet-control-zoom-out', waitForLoading); + } - public async zoomAllTheWayOut(): Promise { - // we can tell we're at level 1 because zoom out is disabled - return await retry.try(async () => { - await this.clickMapZoomOut(); - const enabled = await this.getMapZoomOutEnabled(); - // should be able to zoom more as current config has 0 as min level. - if (enabled) { - throw new Error('Not fully zoomed out yet'); - } - }); - } + public async getMapZoomEnabled(zoomSelector: string): Promise { + const zooms = await this.getZoomSelectors(zoomSelector); + const classAttributes = await Promise.all( + zooms.map(async (zoom) => await zoom.getAttribute('class')) + ); + return !classAttributes.join('').includes('leaflet-disabled'); + } - public async getMapZoomInEnabled() { - return await this.getMapZoomEnabled('a.leaflet-control-zoom-in'); - } + public async zoomAllTheWayOut(): Promise { + // we can tell we're at level 1 because zoom out is disabled + return await this.retry.try(async () => { + await this.clickMapZoomOut(); + const enabled = await this.getMapZoomOutEnabled(); + // should be able to zoom more as current config has 0 as min level. + if (enabled) { + throw new Error('Not fully zoomed out yet'); + } + }); + } - public async getMapZoomOutEnabled() { - return await this.getMapZoomEnabled('a.leaflet-control-zoom-out'); - } + public async getMapZoomInEnabled() { + return await this.getMapZoomEnabled('a.leaflet-control-zoom-in'); + } - public async clickMapFitDataBounds() { - return await this.clickMapButton('a.fa-crop'); - } + public async getMapZoomOutEnabled() { + return await this.getMapZoomEnabled('a.leaflet-control-zoom-out'); } - return new TileMapPage(); + public async clickMapFitDataBounds() { + return await this.clickMapButton('a.fa-crop'); + } } diff --git a/test/functional/page_objects/time_picker.ts b/test/functional/page_objects/time_picker.ts index 4d0930c3ff932d..e8f6afc365f5d1 100644 --- a/test/functional/page_objects/time_picker.ts +++ b/test/functional/page_objects/time_picker.ts @@ -7,7 +7,7 @@ */ import moment from 'moment'; -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; import { WebElementWrapper } from '../services/lib/web_element_wrapper'; export type CommonlyUsed = @@ -22,275 +22,270 @@ export type CommonlyUsed = | 'Last_90 days' | 'Last_1 year'; -export function TimePickerProvider({ getService, getPageObjects }: FtrProviderContext) { - const log = getService('log'); - const find = getService('find'); - const browser = getService('browser'); - const retry = getService('retry'); - const testSubjects = getService('testSubjects'); - const { header } = getPageObjects(['header']); - const kibanaServer = getService('kibanaServer'); - const menuToggle = getService('menuToggle'); - - const quickSelectTimeMenuToggle = menuToggle.create({ +export class TimePickerPageObject extends FtrService { + private readonly log = this.ctx.getService('log'); + private readonly find = this.ctx.getService('find'); + private readonly browser = this.ctx.getService('browser'); + private readonly retry = this.ctx.getService('retry'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly header = this.ctx.getPageObject('header'); + private readonly kibanaServer = this.ctx.getService('kibanaServer'); + + private readonly quickSelectTimeMenuToggle = this.ctx.getService('menuToggle').create({ name: 'QuickSelectTime Menu', menuTestSubject: 'superDatePickerQuickMenu', toggleButtonTestSubject: 'superDatePickerToggleQuickMenuButton', }); - class TimePicker { - defaultStartTime = 'Sep 19, 2015 @ 06:31:44.000'; - defaultEndTime = 'Sep 23, 2015 @ 18:31:44.000'; - defaultStartTimeUTC = '2015-09-18T06:31:44.000Z'; - defaultEndTimeUTC = '2015-09-23T18:31:44.000Z'; - - async setDefaultAbsoluteRange() { - await this.setAbsoluteRange(this.defaultStartTime, this.defaultEndTime); - } + public readonly defaultStartTime = 'Sep 19, 2015 @ 06:31:44.000'; + public readonly defaultEndTime = 'Sep 23, 2015 @ 18:31:44.000'; + public readonly defaultStartTimeUTC = '2015-09-18T06:31:44.000Z'; + public readonly defaultEndTimeUTC = '2015-09-23T18:31:44.000Z'; - async ensureHiddenNoDataPopover() { - const isVisible = await testSubjects.exists('noDataPopoverDismissButton'); - if (isVisible) { - await testSubjects.click('noDataPopoverDismissButton'); - } - } + async setDefaultAbsoluteRange() { + await this.setAbsoluteRange(this.defaultStartTime, this.defaultEndTime); + } - /** - * the provides a quicker way to set the timepicker to the default range, saves a few seconds - */ - async setDefaultAbsoluteRangeViaUiSettings() { - await kibanaServer.uiSettings.update({ - 'timepicker:timeDefaults': `{ "from": "${this.defaultStartTimeUTC}", "to": "${this.defaultEndTimeUTC}"}`, - }); + async ensureHiddenNoDataPopover() { + const isVisible = await this.testSubjects.exists('noDataPopoverDismissButton'); + if (isVisible) { + await this.testSubjects.click('noDataPopoverDismissButton'); } + } - async resetDefaultAbsoluteRangeViaUiSettings() { - await kibanaServer.uiSettings.replace({}); - } + /** + * the provides a quicker way to set the timepicker to the default range, saves a few seconds + */ + async setDefaultAbsoluteRangeViaUiSettings() { + await this.kibanaServer.uiSettings.update({ + 'timepicker:timeDefaults': `{ "from": "${this.defaultStartTimeUTC}", "to": "${this.defaultEndTimeUTC}"}`, + }); + } - private async getTimePickerPanel() { - return await retry.try(async () => { - return await find.byCssSelector('div.euiPopover__panel-isOpen'); - }); - } + async resetDefaultAbsoluteRangeViaUiSettings() { + await this.kibanaServer.uiSettings.replace({}); + } - private async waitPanelIsGone(panelElement: WebElementWrapper) { - await find.waitForElementStale(panelElement); - } + private async getTimePickerPanel() { + return await this.retry.try(async () => { + return await this.find.byCssSelector('div.euiPopover__panel-isOpen'); + }); + } - public async timePickerExists() { - return await testSubjects.exists('superDatePickerToggleQuickMenuButton'); - } + private async waitPanelIsGone(panelElement: WebElementWrapper) { + await this.find.waitForElementStale(panelElement); + } - /** - * Sets commonly used time - * @param option 'Today' | 'This_week' | 'Last_15 minutes' | 'Last_24 hours' ... - */ - async setCommonlyUsedTime(option: CommonlyUsed | string) { - await testSubjects.click('superDatePickerToggleQuickMenuButton'); - await testSubjects.click(`superDatePickerCommonlyUsed_${option}`); - } + public async timePickerExists() { + return await this.testSubjects.exists('superDatePickerToggleQuickMenuButton'); + } - public async inputValue(dataTestSubj: string, value: string) { - if (browser.isFirefox) { - const input = await testSubjects.find(dataTestSubj); - await input.clearValue(); - await input.type(value); - } else { - await testSubjects.setValue(dataTestSubj, value); - } - } + /** + * Sets commonly used time + * @param option 'Today' | 'This_week' | 'Last_15 minutes' | 'Last_24 hours' ... + */ + async setCommonlyUsedTime(option: CommonlyUsed | string) { + await this.testSubjects.click('superDatePickerToggleQuickMenuButton'); + await this.testSubjects.click(`superDatePickerCommonlyUsed_${option}`); + } - private async showStartEndTimes() { - // This first await makes sure the superDatePicker has loaded before we check for the ShowDatesButton - await testSubjects.exists('superDatePickerToggleQuickMenuButton', { timeout: 20000 }); - const isShowDatesButton = await testSubjects.exists('superDatePickerShowDatesButton'); - if (isShowDatesButton) { - await testSubjects.click('superDatePickerShowDatesButton'); - } - await testSubjects.exists('superDatePickerstartDatePopoverButton'); + public async inputValue(dataTestSubj: string, value: string) { + if (this.browser.isFirefox) { + const input = await this.testSubjects.find(dataTestSubj); + await input.clearValue(); + await input.type(value); + } else { + await this.testSubjects.setValue(dataTestSubj, value); } + } - /** - * @param {String} fromTime MMM D, YYYY @ HH:mm:ss.SSS - * @param {String} toTime MMM D, YYYY @ HH:mm:ss.SSS - */ - public async setAbsoluteRange(fromTime: string, toTime: string) { - log.debug(`Setting absolute range to ${fromTime} to ${toTime}`); - await this.showStartEndTimes(); - - // set to time - await testSubjects.click('superDatePickerendDatePopoverButton'); - let panel = await this.getTimePickerPanel(); - await testSubjects.click('superDatePickerAbsoluteTab'); - await testSubjects.click('superDatePickerAbsoluteDateInput'); - await this.inputValue('superDatePickerAbsoluteDateInput', toTime); - await browser.pressKeys(browser.keys.ESCAPE); // close popover because sometimes browser can't find start input - - // set from time - await testSubjects.click('superDatePickerstartDatePopoverButton'); - await this.waitPanelIsGone(panel); - panel = await this.getTimePickerPanel(); - await testSubjects.click('superDatePickerAbsoluteTab'); - await testSubjects.click('superDatePickerAbsoluteDateInput'); - await this.inputValue('superDatePickerAbsoluteDateInput', fromTime); - - const superDatePickerApplyButtonExists = await testSubjects.exists( - 'superDatePickerApplyTimeButton' - ); - if (superDatePickerApplyButtonExists) { - // Timepicker is in top nav - // Click super date picker apply button to apply time range - await testSubjects.click('superDatePickerApplyTimeButton'); - } else { - // Timepicker is embedded in query bar - // click query bar submit button to apply time range - await testSubjects.click('querySubmitButton'); - } - - await this.waitPanelIsGone(panel); - await header.awaitGlobalLoadingIndicatorHidden(); + private async showStartEndTimes() { + // This first await makes sure the superDatePicker has loaded before we check for the ShowDatesButton + await this.testSubjects.exists('superDatePickerToggleQuickMenuButton', { timeout: 20000 }); + const isShowDatesButton = await this.testSubjects.exists('superDatePickerShowDatesButton'); + if (isShowDatesButton) { + await this.testSubjects.click('superDatePickerShowDatesButton'); } + await this.testSubjects.exists('superDatePickerstartDatePopoverButton'); + } - public async isOff() { - return await find.existsByCssSelector('.euiDatePickerRange--readOnly'); + /** + * @param {String} fromTime MMM D, YYYY @ HH:mm:ss.SSS + * @param {String} toTime MMM D, YYYY @ HH:mm:ss.SSS + */ + public async setAbsoluteRange(fromTime: string, toTime: string) { + this.log.debug(`Setting absolute range to ${fromTime} to ${toTime}`); + await this.showStartEndTimes(); + + // set to time + await this.testSubjects.click('superDatePickerendDatePopoverButton'); + let panel = await this.getTimePickerPanel(); + await this.testSubjects.click('superDatePickerAbsoluteTab'); + await this.testSubjects.click('superDatePickerAbsoluteDateInput'); + await this.inputValue('superDatePickerAbsoluteDateInput', toTime); + await this.browser.pressKeys(this.browser.keys.ESCAPE); // close popover because sometimes browser can't find start input + + // set from time + await this.testSubjects.click('superDatePickerstartDatePopoverButton'); + await this.waitPanelIsGone(panel); + panel = await this.getTimePickerPanel(); + await this.testSubjects.click('superDatePickerAbsoluteTab'); + await this.testSubjects.click('superDatePickerAbsoluteDateInput'); + await this.inputValue('superDatePickerAbsoluteDateInput', fromTime); + + const superDatePickerApplyButtonExists = await this.testSubjects.exists( + 'superDatePickerApplyTimeButton' + ); + if (superDatePickerApplyButtonExists) { + // Timepicker is in top nav + // Click super date picker apply button to apply time range + await this.testSubjects.click('superDatePickerApplyTimeButton'); + } else { + // Timepicker is embedded in query bar + // click query bar submit button to apply time range + await this.testSubjects.click('querySubmitButton'); } - public async getRefreshConfig(keepQuickSelectOpen = false) { - await quickSelectTimeMenuToggle.open(); - const interval = await testSubjects.getAttribute( - 'superDatePickerRefreshIntervalInput', - 'value' - ); - - let selectedUnit; - const select = await testSubjects.find('superDatePickerRefreshIntervalUnitsSelect'); - const options = await find.allDescendantDisplayedByCssSelector('option', select); - await Promise.all( - options.map(async (optionElement) => { - const isSelected = await optionElement.isSelected(); - if (isSelected) { - selectedUnit = await optionElement.getVisibleText(); - } - }) - ); - - const toggleButtonText = await testSubjects.getVisibleText( - 'superDatePickerToggleRefreshButton' - ); - if (!keepQuickSelectOpen) { - await quickSelectTimeMenuToggle.close(); - } - - return { - interval, - units: selectedUnit, - isPaused: toggleButtonText === 'Start' ? true : false, - }; - } + await this.waitPanelIsGone(panel); + await this.header.awaitGlobalLoadingIndicatorHidden(); + } - public async getTimeConfig() { - await this.showStartEndTimes(); - const start = await testSubjects.getVisibleText('superDatePickerstartDatePopoverButton'); - const end = await testSubjects.getVisibleText('superDatePickerendDatePopoverButton'); - return { - start, - end, - }; - } + public async isOff() { + return await this.find.existsByCssSelector('.euiDatePickerRange--readOnly'); + } - public async getShowDatesButtonText() { - const button = await testSubjects.find('superDatePickerShowDatesButton'); - const text = await button.getVisibleText(); - return text; + public async getRefreshConfig(keepQuickSelectOpen = false) { + await this.quickSelectTimeMenuToggle.open(); + const interval = await this.testSubjects.getAttribute( + 'superDatePickerRefreshIntervalInput', + 'value' + ); + + let selectedUnit; + const select = await this.testSubjects.find('superDatePickerRefreshIntervalUnitsSelect'); + const options = await this.find.allDescendantDisplayedByCssSelector('option', select); + await Promise.all( + options.map(async (optionElement) => { + const isSelected = await optionElement.isSelected(); + if (isSelected) { + selectedUnit = await optionElement.getVisibleText(); + } + }) + ); + + const toggleButtonText = await this.testSubjects.getVisibleText( + 'superDatePickerToggleRefreshButton' + ); + if (!keepQuickSelectOpen) { + await this.quickSelectTimeMenuToggle.close(); } - public async getTimeDurationForSharing() { - return await testSubjects.getAttribute( - 'dataSharedTimefilterDuration', - 'data-shared-timefilter-duration' - ); - } + return { + interval, + units: selectedUnit, + isPaused: toggleButtonText === 'Start' ? true : false, + }; + } - public async getTimeConfigAsAbsoluteTimes() { - await this.showStartEndTimes(); - - // get to time - await testSubjects.click('superDatePickerendDatePopoverButton'); - const panel = await this.getTimePickerPanel(); - await testSubjects.click('superDatePickerAbsoluteTab'); - const end = await testSubjects.getAttribute('superDatePickerAbsoluteDateInput', 'value'); - - // get from time - await testSubjects.click('superDatePickerstartDatePopoverButton'); - await this.waitPanelIsGone(panel); - await testSubjects.click('superDatePickerAbsoluteTab'); - const start = await testSubjects.getAttribute('superDatePickerAbsoluteDateInput', 'value'); - - return { - start, - end, - }; - } + public async getTimeConfig() { + await this.showStartEndTimes(); + const start = await this.testSubjects.getVisibleText('superDatePickerstartDatePopoverButton'); + const end = await this.testSubjects.getVisibleText('superDatePickerendDatePopoverButton'); + return { + start, + end, + }; + } - public async getTimeDurationInHours() { - const DEFAULT_DATE_FORMAT = 'MMM D, YYYY @ HH:mm:ss.SSS'; - const { start, end } = await this.getTimeConfigAsAbsoluteTimes(); - const startMoment = moment(start, DEFAULT_DATE_FORMAT); - const endMoment = moment(end, DEFAULT_DATE_FORMAT); - return moment.duration(endMoment.diff(startMoment)).asHours(); - } + public async getShowDatesButtonText() { + const button = await this.testSubjects.find('superDatePickerShowDatesButton'); + const text = await button.getVisibleText(); + return text; + } - public async startAutoRefresh(intervalS = 3) { - await quickSelectTimeMenuToggle.open(); - await this.inputValue('superDatePickerRefreshIntervalInput', intervalS.toString()); - const refreshConfig = await this.getRefreshConfig(true); - if (refreshConfig.isPaused) { - log.debug('start auto refresh'); - await testSubjects.click('superDatePickerToggleRefreshButton'); - } - await quickSelectTimeMenuToggle.close(); - } + public async getTimeDurationForSharing() { + return await this.testSubjects.getAttribute( + 'dataSharedTimefilterDuration', + 'data-shared-timefilter-duration' + ); + } - public async pauseAutoRefresh() { - log.debug('pauseAutoRefresh'); - const refreshConfig = await this.getRefreshConfig(true); + public async getTimeConfigAsAbsoluteTimes() { + await this.showStartEndTimes(); + + // get to time + await this.testSubjects.click('superDatePickerendDatePopoverButton'); + const panel = await this.getTimePickerPanel(); + await this.testSubjects.click('superDatePickerAbsoluteTab'); + const end = await this.testSubjects.getAttribute('superDatePickerAbsoluteDateInput', 'value'); + + // get from time + await this.testSubjects.click('superDatePickerstartDatePopoverButton'); + await this.waitPanelIsGone(panel); + await this.testSubjects.click('superDatePickerAbsoluteTab'); + const start = await this.testSubjects.getAttribute('superDatePickerAbsoluteDateInput', 'value'); + + return { + start, + end, + }; + } - if (!refreshConfig.isPaused) { - log.debug('pause auto refresh'); - await testSubjects.click('superDatePickerToggleRefreshButton'); - } + public async getTimeDurationInHours() { + const DEFAULT_DATE_FORMAT = 'MMM D, YYYY @ HH:mm:ss.SSS'; + const { start, end } = await this.getTimeConfigAsAbsoluteTimes(); + const startMoment = moment(start, DEFAULT_DATE_FORMAT); + const endMoment = moment(end, DEFAULT_DATE_FORMAT); + return moment.duration(endMoment.diff(startMoment)).asHours(); + } - await quickSelectTimeMenuToggle.close(); + public async startAutoRefresh(intervalS = 3) { + await this.quickSelectTimeMenuToggle.open(); + await this.inputValue('superDatePickerRefreshIntervalInput', intervalS.toString()); + const refreshConfig = await this.getRefreshConfig(true); + if (refreshConfig.isPaused) { + this.log.debug('start auto refresh'); + await this.testSubjects.click('superDatePickerToggleRefreshButton'); } + await this.quickSelectTimeMenuToggle.close(); + } - public async resumeAutoRefresh() { - log.debug('resumeAutoRefresh'); - const refreshConfig = await this.getRefreshConfig(true); - if (refreshConfig.isPaused) { - log.debug('resume auto refresh'); - await testSubjects.click('superDatePickerToggleRefreshButton'); - } + public async pauseAutoRefresh() { + this.log.debug('pauseAutoRefresh'); + const refreshConfig = await this.getRefreshConfig(true); - await quickSelectTimeMenuToggle.close(); + if (!refreshConfig.isPaused) { + this.log.debug('pause auto refresh'); + await this.testSubjects.click('superDatePickerToggleRefreshButton'); } - public async setHistoricalDataRange() { - await this.setDefaultAbsoluteRange(); - } + await this.quickSelectTimeMenuToggle.close(); + } - public async setDefaultDataRange() { - const fromTime = 'Jan 1, 2018 @ 00:00:00.000'; - const toTime = 'Apr 13, 2018 @ 00:00:00.000'; - await this.setAbsoluteRange(fromTime, toTime); + public async resumeAutoRefresh() { + this.log.debug('resumeAutoRefresh'); + const refreshConfig = await this.getRefreshConfig(true); + if (refreshConfig.isPaused) { + this.log.debug('resume auto refresh'); + await this.testSubjects.click('superDatePickerToggleRefreshButton'); } - public async setLogstashDataRange() { - const fromTime = 'Apr 9, 2018 @ 00:00:00.000'; - const toTime = 'Apr 13, 2018 @ 00:00:00.000'; - await this.setAbsoluteRange(fromTime, toTime); - } + await this.quickSelectTimeMenuToggle.close(); } - return new TimePicker(); + public async setHistoricalDataRange() { + await this.setDefaultAbsoluteRange(); + } + + public async setDefaultDataRange() { + const fromTime = 'Jan 1, 2018 @ 00:00:00.000'; + const toTime = 'Apr 13, 2018 @ 00:00:00.000'; + await this.setAbsoluteRange(fromTime, toTime); + } + + public async setLogstashDataRange() { + const fromTime = 'Apr 9, 2018 @ 00:00:00.000'; + const toTime = 'Apr 13, 2018 @ 00:00:00.000'; + await this.setAbsoluteRange(fromTime, toTime); + } } diff --git a/test/functional/page_objects/time_to_visualize_page.ts b/test/functional/page_objects/time_to_visualize_page.ts index 458b4dd3e60a13..287b03ec60d88a 100644 --- a/test/functional/page_objects/time_to_visualize_page.ts +++ b/test/functional/page_objects/time_to_visualize_page.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; interface SaveModalArgs { addToDashboard?: 'new' | 'existing' | null; @@ -21,117 +21,108 @@ type DashboardPickerOption = | 'existing-dashboard-option' | 'new-dashboard-option'; -export function TimeToVisualizePageProvider({ getService, getPageObjects }: FtrProviderContext) { - const testSubjects = getService('testSubjects'); - const log = getService('log'); - const find = getService('find'); - const { common, dashboard } = getPageObjects(['common', 'dashboard']); +export class TimeToVisualizePageObject extends FtrService { + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly log = this.ctx.getService('log'); + private readonly find = this.ctx.getService('find'); + private readonly common = this.ctx.getPageObject('common'); + private readonly dashboard = this.ctx.getPageObject('dashboard'); - class TimeToVisualizePage { - public async ensureSaveModalIsOpen() { - await testSubjects.exists('savedObjectSaveModal', { timeout: 5000 }); - } + public async ensureSaveModalIsOpen() { + await this.testSubjects.exists('savedObjectSaveModal', { timeout: 5000 }); + } - public async ensureDashboardOptionsAreDisabled() { - const dashboardSelector = await testSubjects.find('add-to-dashboard-options'); - await dashboardSelector.findByCssSelector(`input[id="new-dashboard-option"]:disabled`); - await dashboardSelector.findByCssSelector(`input[id="existing-dashboard-option"]:disabled`); + public async ensureDashboardOptionsAreDisabled() { + const dashboardSelector = await this.testSubjects.find('add-to-dashboard-options'); + await dashboardSelector.findByCssSelector(`input[id="new-dashboard-option"]:disabled`); + await dashboardSelector.findByCssSelector(`input[id="existing-dashboard-option"]:disabled`); - const librarySelector = await testSubjects.find('add-to-library-checkbox'); - await librarySelector.findByCssSelector(`input[id="add-to-library-checkbox"]:disabled`); - } - - public async resetNewDashboard() { - await common.navigateToApp('dashboard'); - await dashboard.gotoDashboardLandingPage(true); - await dashboard.clickNewDashboard(false); - } + const librarySelector = await this.testSubjects.find('add-to-library-checkbox'); + await librarySelector.findByCssSelector(`input[id="add-to-library-checkbox"]:disabled`); + } - public async setSaveModalValues( - vizName: string, - { - saveAsNew, - redirectToOrigin, - addToDashboard, - dashboardId, - saveToLibrary, - }: SaveModalArgs = {} - ) { - await testSubjects.setValue('savedObjectTitle', vizName); - - const hasSaveAsNew = await testSubjects.exists('saveAsNewCheckbox'); - if (hasSaveAsNew && saveAsNew !== undefined) { - const state = saveAsNew ? 'check' : 'uncheck'; - log.debug('save as new checkbox exists. Setting its state to', state); - await testSubjects.setEuiSwitch('saveAsNewCheckbox', state); - } + public async resetNewDashboard() { + await this.common.navigateToApp('dashboard'); + await this.dashboard.gotoDashboardLandingPage(true); + await this.dashboard.clickNewDashboard(false); + } - const hasDashboardSelector = await testSubjects.exists('add-to-dashboard-options'); - if (hasDashboardSelector && addToDashboard !== undefined) { - let option: DashboardPickerOption = 'add-to-library-option'; - if (addToDashboard) { - option = dashboardId ? 'existing-dashboard-option' : 'new-dashboard-option'; - } - log.debug('save modal dashboard selector, choosing option:', option); - const dashboardSelector = await testSubjects.find('add-to-dashboard-options'); - const label = await dashboardSelector.findByCssSelector(`label[for="${option}"]`); - await label.click(); + public async setSaveModalValues( + vizName: string, + { saveAsNew, redirectToOrigin, addToDashboard, dashboardId, saveToLibrary }: SaveModalArgs = {} + ) { + await this.testSubjects.setValue('savedObjectTitle', vizName); + + const hasSaveAsNew = await this.testSubjects.exists('saveAsNewCheckbox'); + if (hasSaveAsNew && saveAsNew !== undefined) { + const state = saveAsNew ? 'check' : 'uncheck'; + this.log.debug('save as new checkbox exists. Setting its state to', state); + await this.testSubjects.setEuiSwitch('saveAsNewCheckbox', state); + } - if (dashboardId) { - await testSubjects.setValue('dashboardPickerInput', dashboardId); - await find.clickByButtonText(dashboardId); - } + const hasDashboardSelector = await this.testSubjects.exists('add-to-dashboard-options'); + if (hasDashboardSelector && addToDashboard !== undefined) { + let option: DashboardPickerOption = 'add-to-library-option'; + if (addToDashboard) { + option = dashboardId ? 'existing-dashboard-option' : 'new-dashboard-option'; } - - const hasSaveToLibrary = await testSubjects.exists('add-to-library-checkbox'); - if (hasSaveToLibrary && saveToLibrary !== undefined) { - const libraryCheckbox = await find.byCssSelector('#add-to-library-checkbox'); - const isChecked = await libraryCheckbox.isSelected(); - const needsClick = isChecked !== saveToLibrary; - const state = saveToLibrary ? 'check' : 'uncheck'; - - log.debug('save to library checkbox exists. Setting its state to', state); - if (needsClick) { - const selector = await testSubjects.find('add-to-library-checkbox'); - const label = await selector.findByCssSelector(`label[for="add-to-library-checkbox"]`); - await label.click(); - } + this.log.debug('save modal dashboard selector, choosing option:', option); + const dashboardSelector = await this.testSubjects.find('add-to-dashboard-options'); + const label = await dashboardSelector.findByCssSelector(`label[for="${option}"]`); + await label.click(); + + if (dashboardId) { + await this.testSubjects.setValue('dashboardPickerInput', dashboardId); + await this.find.clickByButtonText(dashboardId); } + } - const hasRedirectToOrigin = await testSubjects.exists('returnToOriginModeSwitch'); - if (hasRedirectToOrigin && redirectToOrigin !== undefined) { - const state = redirectToOrigin ? 'check' : 'uncheck'; - log.debug('redirect to origin checkbox exists. Setting its state to', state); - await testSubjects.setEuiSwitch('returnToOriginModeSwitch', state); + const hasSaveToLibrary = await this.testSubjects.exists('add-to-library-checkbox'); + if (hasSaveToLibrary && saveToLibrary !== undefined) { + const libraryCheckbox = await this.find.byCssSelector('#add-to-library-checkbox'); + const isChecked = await libraryCheckbox.isSelected(); + const needsClick = isChecked !== saveToLibrary; + const state = saveToLibrary ? 'check' : 'uncheck'; + + this.log.debug('save to library checkbox exists. Setting its state to', state); + if (needsClick) { + const selector = await this.testSubjects.find('add-to-library-checkbox'); + const label = await selector.findByCssSelector(`label[for="add-to-library-checkbox"]`); + await label.click(); } } - public async libraryNotificationExists(panelTitle: string) { - log.debug('searching for library modal on panel:', panelTitle); - const panel = await testSubjects.find( - `embeddablePanelHeading-${panelTitle.replace(/ /g, '')}` - ); - const libraryActionExists = await testSubjects.descendantExists( - 'embeddablePanelNotification-ACTION_LIBRARY_NOTIFICATION', - panel - ); - return libraryActionExists; + const hasRedirectToOrigin = await this.testSubjects.exists('returnToOriginModeSwitch'); + if (hasRedirectToOrigin && redirectToOrigin !== undefined) { + const state = redirectToOrigin ? 'check' : 'uncheck'; + this.log.debug('redirect to origin checkbox exists. Setting its state to', state); + await this.testSubjects.setEuiSwitch('returnToOriginModeSwitch', state); } + } - public async saveFromModal( - vizName: string, - saveModalArgs: SaveModalArgs = { addToDashboard: null } - ) { - await this.ensureSaveModalIsOpen(); + public async libraryNotificationExists(panelTitle: string) { + this.log.debug('searching for library modal on panel:', panelTitle); + const panel = await this.testSubjects.find( + `embeddablePanelHeading-${panelTitle.replace(/ /g, '')}` + ); + const libraryActionExists = await this.testSubjects.descendantExists( + 'embeddablePanelNotification-ACTION_LIBRARY_NOTIFICATION', + panel + ); + return libraryActionExists; + } - await this.setSaveModalValues(vizName, saveModalArgs); - log.debug('Click Save Visualization button'); + public async saveFromModal( + vizName: string, + saveModalArgs: SaveModalArgs = { addToDashboard: null } + ) { + await this.ensureSaveModalIsOpen(); - await testSubjects.click('confirmSaveSavedObjectButton'); + await this.setSaveModalValues(vizName, saveModalArgs); + this.log.debug('Click Save Visualization button'); - await common.waitForSaveModalToClose(); - } - } + await this.testSubjects.click('confirmSaveSavedObjectButton'); - return new TimeToVisualizePage(); + await this.common.waitForSaveModalToClose(); + } } diff --git a/test/functional/page_objects/timelion_page.ts b/test/functional/page_objects/timelion_page.ts index 7f4c4eb125c8e1..65584d98022be3 100644 --- a/test/functional/page_objects/timelion_page.ts +++ b/test/functional/page_objects/timelion_page.ts @@ -6,79 +6,75 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; -export function TimelionPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const testSubjects = getService('testSubjects'); - const log = getService('log'); - const PageObjects = getPageObjects(['common', 'header']); - const esArchiver = getService('esArchiver'); - const kibanaServer = getService('kibanaServer'); +export class TimelionPageObject extends FtrService { + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly log = this.ctx.getService('log'); + private readonly common = this.ctx.getPageObject('common'); + private readonly esArchiver = this.ctx.getService('esArchiver'); + private readonly kibanaServer = this.ctx.getService('kibanaServer'); - class TimelionPage { - public async initTests() { - await kibanaServer.uiSettings.replace({ - defaultIndex: 'logstash-*', - }); + public async initTests() { + await this.kibanaServer.uiSettings.replace({ + defaultIndex: 'logstash-*', + }); - log.debug('load kibana index'); - await esArchiver.load('timelion'); + this.log.debug('load kibana index'); + await this.esArchiver.load('test/functional/fixtures/es_archiver/timelion'); - await PageObjects.common.navigateToApp('timelion'); - } - - public async setExpression(expression: string) { - const input = await testSubjects.find('timelionExpressionTextArea'); - await input.clearValue(); - await input.type(expression); - } + await this.common.navigateToApp('timelion'); + } - public async updateExpression(updates: string) { - const input = await testSubjects.find('timelionExpressionTextArea'); - await input.type(updates); - await PageObjects.common.sleep(1000); - } + public async setExpression(expression: string) { + const input = await this.testSubjects.find('timelionExpressionTextArea'); + await input.clearValue(); + await input.type(expression); + } - public async getExpression() { - const input = await testSubjects.find('timelionExpressionTextArea'); - return input.getVisibleText(); - } + public async updateExpression(updates: string) { + const input = await this.testSubjects.find('timelionExpressionTextArea'); + await input.type(updates); + await this.common.sleep(1000); + } - public async getSuggestionItemsText() { - const elements = await testSubjects.findAll('timelionSuggestionListItem'); - return await Promise.all(elements.map(async (element) => await element.getVisibleText())); - } + public async getExpression() { + const input = await this.testSubjects.find('timelionExpressionTextArea'); + return input.getVisibleText(); + } - public async clickSuggestion(suggestionIndex = 0, waitTime = 1000) { - const elements = await testSubjects.findAll('timelionSuggestionListItem'); - if (suggestionIndex > elements.length) { - throw new Error( - `Unable to select suggestion ${suggestionIndex}, only ${elements.length} suggestions available.` - ); - } - await elements[suggestionIndex].click(); - // Wait for timelion expression to be updated after clicking suggestions - await PageObjects.common.sleep(waitTime); - } + public async getSuggestionItemsText() { + const elements = await this.testSubjects.findAll('timelionSuggestionListItem'); + return await Promise.all(elements.map(async (element) => await element.getVisibleText())); + } - public async saveTimelionSheet() { - await testSubjects.click('timelionSaveButton'); - await testSubjects.click('timelionSaveAsSheetButton'); - await testSubjects.click('timelionFinishSaveButton'); - await testSubjects.existOrFail('timelionSaveSuccessToast'); - await testSubjects.waitForDeleted('timelionSaveSuccessToast'); + public async clickSuggestion(suggestionIndex = 0, waitTime = 1000) { + const elements = await this.testSubjects.findAll('timelionSuggestionListItem'); + if (suggestionIndex > elements.length) { + throw new Error( + `Unable to select suggestion ${suggestionIndex}, only ${elements.length} suggestions available.` + ); } + await elements[suggestionIndex].click(); + // Wait for timelion expression to be updated after clicking suggestions + await this.common.sleep(waitTime); + } - public async expectWriteControls() { - await testSubjects.existOrFail('timelionSaveButton'); - await testSubjects.existOrFail('timelionDeleteButton'); - } + public async saveTimelionSheet() { + await this.testSubjects.click('timelionSaveButton'); + await this.testSubjects.click('timelionSaveAsSheetButton'); + await this.testSubjects.click('timelionFinishSaveButton'); + await this.testSubjects.existOrFail('timelionSaveSuccessToast'); + await this.testSubjects.waitForDeleted('timelionSaveSuccessToast'); + } - public async expectMissingWriteControls() { - await testSubjects.missingOrFail('timelionSaveButton'); - await testSubjects.missingOrFail('timelionDeleteButton'); - } + public async expectWriteControls() { + await this.testSubjects.existOrFail('timelionSaveButton'); + await this.testSubjects.existOrFail('timelionDeleteButton'); } - return new TimelionPage(); + public async expectMissingWriteControls() { + await this.testSubjects.missingOrFail('timelionSaveButton'); + await this.testSubjects.missingOrFail('timelionDeleteButton'); + } } diff --git a/test/functional/page_objects/vega_chart_page.ts b/test/functional/page_objects/vega_chart_page.ts index 3e165b3434f8a4..f83c5e193034eb 100644 --- a/test/functional/page_objects/vega_chart_page.ts +++ b/test/functional/page_objects/vega_chart_page.ts @@ -7,110 +7,103 @@ */ import expect from '@kbn/expect'; -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; const compareSpecs = (first: string, second: string) => { const normalizeSpec = (spec: string) => spec.replace(/[\n ]/g, ''); return normalizeSpec(first) === normalizeSpec(second); }; -export function VegaChartPageProvider({ - getService, - getPageObjects, -}: FtrProviderContext & { updateBaselines: boolean }) { - const find = getService('find'); - const testSubjects = getService('testSubjects'); - const browser = getService('browser'); - const retry = getService('retry'); - - class VegaChartPage { - public getEditor() { - return testSubjects.find('vega-editor'); - } +export class VegaChartPageObject extends FtrService { + private readonly find = this.ctx.getService('find'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly browser = this.ctx.getService('browser'); + private readonly retry = this.ctx.getService('retry'); - public getViewContainer() { - return find.byCssSelector('div.vgaVis__view'); - } + public getEditor() { + return this.testSubjects.find('vega-editor'); + } - public getControlContainer() { - return find.byCssSelector('div.vgaVis__controls'); - } + public getViewContainer() { + return this.find.byCssSelector('div.vgaVis__view'); + } - public getYAxisContainer() { - return find.byCssSelector('[aria-label^="Y-axis"]'); - } + public getControlContainer() { + return this.find.byCssSelector('div.vgaVis__controls'); + } - public async getAceGutterContainer() { - const editor = await this.getEditor(); - return editor.findByClassName('ace_gutter'); - } + public getYAxisContainer() { + return this.find.byCssSelector('[aria-label^="Y-axis"]'); + } - public async getRawSpec() { - // Adapted from console_page.js:getVisibleTextFromAceEditor(). Is there a common utilities file? - const editor = await this.getEditor(); - const lines = await editor.findAllByClassName('ace_line_group'); + public async getAceGutterContainer() { + const editor = await this.getEditor(); + return editor.findByClassName('ace_gutter'); + } - return await Promise.all( - lines.map(async (line) => { - return await line.getVisibleText(); - }) - ); - } + public async getRawSpec() { + // Adapted from console_page.js:getVisibleTextFromAceEditor(). Is there a common utilities file? + const editor = await this.getEditor(); + const lines = await editor.findAllByClassName('ace_line_group'); - public async getSpec() { - return (await this.getRawSpec()).join('\n'); - } + return await Promise.all( + lines.map(async (line) => { + return await line.getVisibleText(); + }) + ); + } - public async focusEditor() { - const editor = await this.getEditor(); - const textarea = await editor.findByClassName('ace_content'); + public async getSpec() { + return (await this.getRawSpec()).join('\n'); + } - await textarea.click(); - } + public async focusEditor() { + const editor = await this.getEditor(); + const textarea = await editor.findByClassName('ace_content'); - public async fillSpec(newSpec: string) { - await retry.try(async () => { - await this.cleanSpec(); - await this.focusEditor(); - await browser.pressKeys(newSpec); + await textarea.click(); + } - expect(compareSpecs(await this.getSpec(), newSpec)).to.be(true); - }); - } + public async fillSpec(newSpec: string) { + await this.retry.try(async () => { + await this.cleanSpec(); + await this.focusEditor(); + await this.browser.pressKeys(newSpec); - public async typeInSpec(text: string) { - const aceGutter = await this.getAceGutterContainer(); + expect(compareSpecs(await this.getSpec(), newSpec)).to.be(true); + }); + } - await aceGutter.doubleClick(); - await browser.pressKeys(browser.keys.RIGHT); - await browser.pressKeys(browser.keys.LEFT); - await browser.pressKeys(browser.keys.LEFT); - await browser.pressKeys(text); - } + public async typeInSpec(text: string) { + const aceGutter = await this.getAceGutterContainer(); - public async cleanSpec() { - const aceGutter = await this.getAceGutterContainer(); + await aceGutter.doubleClick(); + await this.browser.pressKeys(this.browser.keys.RIGHT); + await this.browser.pressKeys(this.browser.keys.LEFT); + await this.browser.pressKeys(this.browser.keys.LEFT); + await this.browser.pressKeys(text); + } - await retry.try(async () => { - await aceGutter.doubleClick(); - await browser.pressKeys(browser.keys.BACK_SPACE); + public async cleanSpec() { + const aceGutter = await this.getAceGutterContainer(); - expect(await this.getSpec()).to.be(''); - }); - } + await this.retry.try(async () => { + await aceGutter.doubleClick(); + await this.browser.pressKeys(this.browser.keys.BACK_SPACE); - public async getYAxisLabels() { - const yAxis = await this.getYAxisContainer(); - const tickGroup = await yAxis.findByClassName('role-axis-label'); - const labels = await tickGroup.findAllByCssSelector('text'); - const labelTexts: string[] = []; + expect(await this.getSpec()).to.be(''); + }); + } + + public async getYAxisLabels() { + const yAxis = await this.getYAxisContainer(); + const tickGroup = await yAxis.findByClassName('role-axis-label'); + const labels = await tickGroup.findAllByCssSelector('text'); + const labelTexts: string[] = []; - for (const label of labels) { - labelTexts.push(await label.getVisibleText()); - } - return labelTexts; + for (const label of labels) { + labelTexts.push(await label.getVisibleText()); } + return labelTexts; } - - return new VegaChartPage(); } diff --git a/test/functional/page_objects/visual_builder_page.ts b/test/functional/page_objects/visual_builder_page.ts index 997a1127005ee5..d796067372fa87 100644 --- a/test/functional/page_objects/visual_builder_page.ts +++ b/test/functional/page_objects/visual_builder_page.ts @@ -6,654 +6,651 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; import { WebElementWrapper } from '../services/lib/web_element_wrapper'; -export function VisualBuilderPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const find = getService('find'); - const log = getService('log'); - const retry = getService('retry'); - const testSubjects = getService('testSubjects'); - const comboBox = getService('comboBox'); - const PageObjects = getPageObjects(['common', 'header', 'visualize', 'timePicker', 'visChart']); - - type Duration = - | 'Milliseconds' - | 'Seconds' - | 'Minutes' - | 'Hours' - | 'Days' - | 'Weeks' - | 'Months' - | 'Years'; - - type FromDuration = Duration | 'Picoseconds' | 'Nanoseconds' | 'Microseconds'; - type ToDuration = Duration | 'Human readable'; - - class VisualBuilderPage { - public async resetPage( - fromTime = 'Sep 19, 2015 @ 06:31:44.000', - toTime = 'Sep 22, 2015 @ 18:31:44.000' - ) { - await PageObjects.common.navigateToUrl('visualize', 'create?type=metrics', { - useActualUrl: true, - }); - log.debug('Wait for initializing TSVB editor'); - await this.checkVisualBuilderIsPresent(); - log.debug('Set absolute time range from "' + fromTime + '" to "' + toTime + '"'); - await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime); - // 2 sec sleep until https://github.com/elastic/kibana/issues/46353 is fixed - await PageObjects.common.sleep(2000); - } +type Duration = + | 'Milliseconds' + | 'Seconds' + | 'Minutes' + | 'Hours' + | 'Days' + | 'Weeks' + | 'Months' + | 'Years'; + +type FromDuration = Duration | 'Picoseconds' | 'Nanoseconds' | 'Microseconds'; +type ToDuration = Duration | 'Human readable'; + +export class VisualBuilderPageObject extends FtrService { + private readonly find = this.ctx.getService('find'); + private readonly log = this.ctx.getService('log'); + private readonly retry = this.ctx.getService('retry'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly comboBox = this.ctx.getService('comboBox'); + private readonly common = this.ctx.getPageObject('common'); + private readonly header = this.ctx.getPageObject('header'); + private readonly timePicker = this.ctx.getPageObject('timePicker'); + private readonly visChart = this.ctx.getPageObject('visChart'); + + public async resetPage( + fromTime = 'Sep 19, 2015 @ 06:31:44.000', + toTime = 'Sep 22, 2015 @ 18:31:44.000' + ) { + await this.common.navigateToUrl('visualize', 'create?type=metrics', { + useActualUrl: true, + }); + this.log.debug('Wait for initializing TSVB editor'); + await this.checkVisualBuilderIsPresent(); + this.log.debug('Set absolute time range from "' + fromTime + '" to "' + toTime + '"'); + await this.timePicker.setAbsoluteRange(fromTime, toTime); + // 2 sec sleep until https://github.com/elastic/kibana/issues/46353 is fixed + await this.common.sleep(2000); + } - public async checkTabIsLoaded(testSubj: string, name: string) { - let isPresent = false; - await retry.try(async () => { - isPresent = await testSubjects.exists(testSubj, { timeout: 20000 }); - if (!isPresent) { - isPresent = await testSubjects.exists('visNoResult', { timeout: 1000 }); - } - }); + public async checkTabIsLoaded(testSubj: string, name: string) { + let isPresent = false; + await this.retry.try(async () => { + isPresent = await this.testSubjects.exists(testSubj, { timeout: 20000 }); if (!isPresent) { - throw new Error(`TSVB ${name} tab is not loaded`); + isPresent = await this.testSubjects.exists('visNoResult', { timeout: 1000 }); } + }); + if (!isPresent) { + throw new Error(`TSVB ${name} tab is not loaded`); } + } - public async checkTabIsSelected(chartType: string) { - const chartTypeBtn = await testSubjects.find(`${chartType}TsvbTypeBtn`); - const isSelected = await chartTypeBtn.getAttribute('aria-selected'); + public async checkTabIsSelected(chartType: string) { + const chartTypeBtn = await this.testSubjects.find(`${chartType}TsvbTypeBtn`); + const isSelected = await chartTypeBtn.getAttribute('aria-selected'); - if (isSelected !== 'true') { - throw new Error(`TSVB ${chartType} tab is not selected`); - } + if (isSelected !== 'true') { + throw new Error(`TSVB ${chartType} tab is not selected`); } + } - public async checkPanelConfigIsPresent(chartType: string) { - await testSubjects.existOrFail(`tvbPanelConfig__${chartType}`); - } + public async checkPanelConfigIsPresent(chartType: string) { + await this.testSubjects.existOrFail(`tvbPanelConfig__${chartType}`); + } - public async checkVisualBuilderIsPresent() { - await this.checkTabIsLoaded('tvbVisEditor', 'Time Series'); - } + public async checkVisualBuilderIsPresent() { + await this.checkTabIsLoaded('tvbVisEditor', 'Time Series'); + } - public async checkTimeSeriesChartIsPresent() { - const isPresent = await find.existsByCssSelector('.tvbVisTimeSeries'); - if (!isPresent) { - throw new Error(`TimeSeries chart is not loaded`); - } + public async checkTimeSeriesChartIsPresent() { + const isPresent = await this.find.existsByCssSelector('.tvbVisTimeSeries'); + if (!isPresent) { + throw new Error(`TimeSeries chart is not loaded`); } + } - public async checkTimeSeriesIsLight() { - return await find.existsByCssSelector('.tvbVisTimeSeriesLight'); - } + public async checkTimeSeriesIsLight() { + return await this.find.existsByCssSelector('.tvbVisTimeSeriesLight'); + } - public async checkTimeSeriesLegendIsPresent() { - const isPresent = await find.existsByCssSelector('.echLegend'); - if (!isPresent) { - throw new Error(`TimeSeries legend is not loaded`); - } + public async checkTimeSeriesLegendIsPresent() { + const isPresent = await this.find.existsByCssSelector('.echLegend'); + if (!isPresent) { + throw new Error(`TimeSeries legend is not loaded`); } + } - public async checkMetricTabIsPresent() { - await this.checkTabIsLoaded('tsvbMetricValue', 'Metric'); - } + public async checkMetricTabIsPresent() { + await this.checkTabIsLoaded('tsvbMetricValue', 'Metric'); + } - public async checkGaugeTabIsPresent() { - await this.checkTabIsLoaded('tvbVisGaugeContainer', 'Gauge'); - } + public async checkGaugeTabIsPresent() { + await this.checkTabIsLoaded('tvbVisGaugeContainer', 'Gauge'); + } - public async checkTopNTabIsPresent() { - await this.checkTabIsLoaded('tvbVisTopNTable', 'TopN'); - } + public async checkTopNTabIsPresent() { + await this.checkTabIsLoaded('tvbVisTopNTable', 'TopN'); + } - public async clickMetric() { - const button = await testSubjects.find('metricTsvbTypeBtn'); - await button.click(); - } + public async clickMetric() { + const button = await this.testSubjects.find('metricTsvbTypeBtn'); + await button.click(); + } - public async clickMarkdown() { - const button = await testSubjects.find('markdownTsvbTypeBtn'); - await button.click(); - } + public async clickMarkdown() { + const button = await this.testSubjects.find('markdownTsvbTypeBtn'); + await button.click(); + } - public async getMetricValue() { - await PageObjects.visChart.waitForVisualizationRenderingStabilized(); - const metricValue = await find.byCssSelector('.tvbVisMetric__value--primary'); - return metricValue.getVisibleText(); - } + public async getMetricValue() { + await this.visChart.waitForVisualizationRenderingStabilized(); + const metricValue = await this.find.byCssSelector('.tvbVisMetric__value--primary'); + return metricValue.getVisibleText(); + } - public async enterMarkdown(markdown: string) { - await this.clearMarkdown(); - const input = await find.byCssSelector('.tvbMarkdownEditor__editor textarea'); - await input.type(markdown); - await PageObjects.common.sleep(3000); - } + public async enterMarkdown(markdown: string) { + await this.clearMarkdown(); + const input = await this.find.byCssSelector('.tvbMarkdownEditor__editor textarea'); + await input.type(markdown); + await this.common.sleep(3000); + } - public async clearMarkdown() { - // Since we use ACE editor and that isn't really storing its value inside - // a textarea we must really select all text and remove it, and cannot use - // clearValue(). - await retry.waitForWithTimeout('text area is cleared', 20000, async () => { - const editor = await testSubjects.find('codeEditorContainer'); - const $ = await editor.parseDomContent(); - const value = $('.ace_line').text(); - if (value.length > 0) { - log.debug('Clearing text area input'); - this.waitForMarkdownTextAreaCleaned(); - } - - return value.length === 0; - }); - } + public async clearMarkdown() { + // Since we use ACE editor and that isn't really storing its value inside + // a textarea we must really select all text and remove it, and cannot use + // clearValue(). + await this.retry.waitForWithTimeout('text area is cleared', 20000, async () => { + const editor = await this.testSubjects.find('codeEditorContainer'); + const $ = await editor.parseDomContent(); + const value = $('.ace_line').text(); + if (value.length > 0) { + this.log.debug('Clearing text area input'); + this.waitForMarkdownTextAreaCleaned(); + } - public async waitForMarkdownTextAreaCleaned() { - const input = await find.byCssSelector('.tvbMarkdownEditor__editor textarea'); - await input.clearValueWithKeyboard(); - const text = await this.getMarkdownText(); - return text.length === 0; - } + return value.length === 0; + }); + } - public async getMarkdownText(): Promise { - const el = await find.byCssSelector('.tvbVis'); - const text = await el.getVisibleText(); - return text; - } + public async waitForMarkdownTextAreaCleaned() { + const input = await this.find.byCssSelector('.tvbMarkdownEditor__editor textarea'); + await input.clearValueWithKeyboard(); + const text = await this.getMarkdownText(); + return text.length === 0; + } - /** - * - * getting all markdown variables list which located on `table` section - * - * **Note**: if `table` not have variables, use `getMarkdownTableNoVariables` method instead - * @see {getMarkdownTableNoVariables} - * @returns {Promise>} - * @memberof VisualBuilderPage - */ - public async getMarkdownTableVariables(): Promise< - Array<{ key: string; value: string; selector: WebElementWrapper }> - > { - const testTableVariables = await testSubjects.find('tsvbMarkdownVariablesTable'); - const variablesSelector = 'tbody tr'; - const exists = await find.existsByCssSelector(variablesSelector); - if (!exists) { - log.debug('variable list is empty'); - return []; - } - const variables = await testTableVariables.findAllByCssSelector(variablesSelector); - - const variablesKeyValueSelectorMap = await Promise.all( - variables.map(async (variable) => { - const subVars = await variable.findAllByCssSelector('td'); - const selector = await subVars[0].findByTagName('a'); - const key = await selector.getVisibleText(); - const value = await subVars[1].getVisibleText(); - log.debug(`markdown table variables table is: ${key} ${value}`); - return { key, value, selector }; - }) - ); - return variablesKeyValueSelectorMap; - } + public async getMarkdownText(): Promise { + const el = await this.find.byCssSelector('.tvbVis'); + const text = await el.getVisibleText(); + return text; + } - /** - * return variable table message, if `table` is empty it will be fail - * - * **Note:** if `table` have variables, use `getMarkdownTableVariables` method instead - * @see {@link VisualBuilderPage#getMarkdownTableVariables} - * @returns - * @memberof VisualBuilderPage - */ - public async getMarkdownTableNoVariables() { - return await testSubjects.getVisibleText('tvbMarkdownEditor__noVariables'); - } + /** + * + * getting all markdown variables list which located on `table` section + * + * **Note**: if `table` not have variables, use `getMarkdownTableNoVariables` method instead + * @see {getMarkdownTableNoVariables} + * @returns {Promise>} + * @memberof VisualBuilderPage + */ + public async getMarkdownTableVariables(): Promise< + Array<{ key: string; value: string; selector: WebElementWrapper }> + > { + const testTableVariables = await this.testSubjects.find('tsvbMarkdownVariablesTable'); + const variablesSelector = 'tbody tr'; + const exists = await this.find.existsByCssSelector(variablesSelector); + if (!exists) { + this.log.debug('variable list is empty'); + return []; + } + const variables = await testTableVariables.findAllByCssSelector(variablesSelector); + + const variablesKeyValueSelectorMap = await Promise.all( + variables.map(async (variable) => { + const subVars = await variable.findAllByCssSelector('td'); + const selector = await subVars[0].findByTagName('a'); + const key = await selector.getVisibleText(); + const value = await subVars[1].getVisibleText(); + this.log.debug(`markdown table variables table is: ${key} ${value}`); + return { key, value, selector }; + }) + ); + return variablesKeyValueSelectorMap; + } - /** - * get all sub-tabs count for `time series`, `metric`, `top n`, `gauge`, `markdown` or `table` tab. - * - * @returns {Promise} - * @memberof VisualBuilderPage - */ - public async getSubTabs(): Promise { - return await find.allByCssSelector('[data-test-subj$="-subtab"]'); - } + /** + * return variable table message, if `table` is empty it will be fail + * + * **Note:** if `table` have variables, use `getMarkdownTableVariables` method instead + * @see {@link VisualBuilderPage#getMarkdownTableVariables} + * @returns + * @memberof VisualBuilderPage + */ + public async getMarkdownTableNoVariables() { + return await this.testSubjects.getVisibleText('tvbMarkdownEditor__noVariables'); + } - /** - * switch markdown sub-tab for visualization - * - * @param {'data' | 'options'| 'markdown'} subTab - * @memberof VisualBuilderPage - */ - public async markdownSwitchSubTab(subTab: 'data' | 'options' | 'markdown') { - const tab = await testSubjects.find(`${subTab}-subtab`); - const isSelected = await tab.getAttribute('aria-selected'); - if (isSelected !== 'true') { - await tab.click(); - } - } + /** + * get all sub-tabs count for `time series`, `metric`, `top n`, `gauge`, `markdown` or `table` tab. + * + * @returns {Promise} + * @memberof VisualBuilderPage + */ + public async getSubTabs(): Promise { + return await this.find.allByCssSelector('[data-test-subj$="-subtab"]'); + } - /** - * setting label for markdown visualization - * - * @param {string} variableName - * @param type - * @memberof VisualBuilderPage - */ - public async setMarkdownDataVariable(variableName: string, type: 'variable' | 'label') { - const SELECTOR = type === 'label' ? '[placeholder="Label"]' : '[placeholder="Variable name"]'; - if (variableName) { - await find.setValue(SELECTOR, variableName); - } else { - const input = await find.byCssSelector(SELECTOR); - await input.clearValueWithKeyboard({ charByChar: true }); - } + /** + * switch markdown sub-tab for visualization + * + * @param {'data' | 'options'| 'markdown'} subTab + * @memberof VisualBuilderPage + */ + public async markdownSwitchSubTab(subTab: 'data' | 'options' | 'markdown') { + const tab = await this.testSubjects.find(`${subTab}-subtab`); + const isSelected = await tab.getAttribute('aria-selected'); + if (isSelected !== 'true') { + await tab.click(); } + } - public async clickSeriesOption(nth = 0) { - const el = await testSubjects.findAll('seriesOptions'); - await el[nth].click(); + /** + * setting label for markdown visualization + * + * @param {string} variableName + * @param type + * @memberof VisualBuilderPage + */ + public async setMarkdownDataVariable(variableName: string, type: 'variable' | 'label') { + const SELECTOR = type === 'label' ? '[placeholder="Label"]' : '[placeholder="Variable name"]'; + if (variableName) { + await this.find.setValue(SELECTOR, variableName); + } else { + const input = await this.find.byCssSelector(SELECTOR); + await input.clearValueWithKeyboard({ charByChar: true }); } + } - public async clearOffsetSeries() { - const el = await testSubjects.find('offsetTimeSeries'); - await el.clearValue(); - } + public async clickSeriesOption(nth = 0) { + const el = await this.testSubjects.findAll('seriesOptions'); + await el[nth].click(); + } - public async toggleAutoApplyChanges() { - await find.clickByCssSelector('#tsvbAutoApplyInput'); - } + public async clearOffsetSeries() { + const el = await this.testSubjects.find('offsetTimeSeries'); + await el.clearValue(); + } - public async applyChanges() { - await testSubjects.clickWhenNotDisabled('applyBtn'); - } + public async toggleAutoApplyChanges() { + await this.find.clickByCssSelector('#tsvbAutoApplyInput'); + } - /** - * change the data formatter for template in an `options` label tab - * - * @param formatter - typeof formatter which you can use for presenting data. By default kibana show `Number` formatter - */ - public async changeDataFormatter( - formatter: 'Bytes' | 'Number' | 'Percent' | 'Duration' | 'Custom' - ) { - const formatterEl = await testSubjects.find('tsvbDataFormatPicker'); - await comboBox.setElement(formatterEl, formatter, { clickWithMouse: true }); - } + public async applyChanges() { + await this.testSubjects.clickWhenNotDisabled('applyBtn'); + } - /** - * set duration formatter additional settings - * - * @param from start format - * @param to end format - * @param decimalPlaces decimals count - */ - public async setDurationFormatterSettings({ - from, - to, - decimalPlaces, - }: { - from?: FromDuration; - to?: ToDuration; - decimalPlaces?: string; - }) { - if (from) { - await retry.try(async () => { - const fromCombobox = await find.byCssSelector('[id$="from-row"] .euiComboBox'); - await comboBox.setElement(fromCombobox, from, { clickWithMouse: true }); - }); - } - if (to) { - const toCombobox = await find.byCssSelector('[id$="to-row"] .euiComboBox'); - await comboBox.setElement(toCombobox, to, { clickWithMouse: true }); - } - if (decimalPlaces) { - const decimalPlacesInput = await find.byCssSelector('[id$="decimal"]'); - await decimalPlacesInput.type(decimalPlaces); - } - } + /** + * change the data formatter for template in an `options` label tab + * + * @param formatter - typeof formatter which you can use for presenting data. By default kibana show `Number` formatter + */ + public async changeDataFormatter( + formatter: 'Bytes' | 'Number' | 'Percent' | 'Duration' | 'Custom' + ) { + const formatterEl = await this.testSubjects.find('tsvbDataFormatPicker'); + await this.comboBox.setElement(formatterEl, formatter, { clickWithMouse: true }); + } - /** - * write template for aggregation row in the `option` tab - * - * @param template always should contain `{{value}}` - * @example - * await visualBuilder.enterSeriesTemplate('$ {{value}}') // add `$` symbol for value - */ - public async enterSeriesTemplate(template: string) { - const el = await testSubjects.find('tsvb_series_value'); - await el.clearValueWithKeyboard(); - await el.type(template); + /** + * set duration formatter additional settings + * + * @param from start format + * @param to end format + * @param decimalPlaces decimals count + */ + public async setDurationFormatterSettings({ + from, + to, + decimalPlaces, + }: { + from?: FromDuration; + to?: ToDuration; + decimalPlaces?: string; + }) { + if (from) { + await this.retry.try(async () => { + const fromCombobox = await this.find.byCssSelector('[id$="from-row"] .euiComboBox'); + await this.comboBox.setElement(fromCombobox, from, { clickWithMouse: true }); + }); } - - public async enterOffsetSeries(value: string) { - const el = await testSubjects.find('offsetTimeSeries'); - await el.clearValue(); - await el.type(value); + if (to) { + const toCombobox = await this.find.byCssSelector('[id$="to-row"] .euiComboBox'); + await this.comboBox.setElement(toCombobox, to, { clickWithMouse: true }); } - - public async getRhythmChartLegendValue(nth = 0) { - await PageObjects.visChart.waitForVisualizationRenderingStabilized(); - const metricValue = ( - await find.allByCssSelector(`.echLegendItem .echLegendItem__extra`, 20000) - )[nth]; - await metricValue.moveMouseTo(); - return await metricValue.getVisibleText(); + if (decimalPlaces) { + const decimalPlacesInput = await this.find.byCssSelector('[id$="decimal"]'); + await decimalPlacesInput.type(decimalPlaces); } + } - public async clickGauge() { - await testSubjects.click('gaugeTsvbTypeBtn'); - } + /** + * write template for aggregation row in the `option` tab + * + * @param template always should contain `{{value}}` + * @example + * await visualBuilder.enterSeriesTemplate('$ {{value}}') // add `$` symbol for value + */ + public async enterSeriesTemplate(template: string) { + const el = await this.testSubjects.find('tsvb_series_value'); + await el.clearValueWithKeyboard(); + await el.type(template); + } - public async getGaugeLabel() { - const gaugeLabel = await find.byCssSelector('.tvbVisGauge__label'); - return await gaugeLabel.getVisibleText(); - } + public async enterOffsetSeries(value: string) { + const el = await this.testSubjects.find('offsetTimeSeries'); + await el.clearValue(); + await el.type(value); + } - public async getGaugeCount() { - const gaugeCount = await find.byCssSelector('.tvbVisGauge__value'); - return await gaugeCount.getVisibleText(); - } + public async getRhythmChartLegendValue(nth = 0) { + await this.visChart.waitForVisualizationRenderingStabilized(); + const metricValue = ( + await this.find.allByCssSelector(`.echLegendItem .echLegendItem__extra`, 20000) + )[nth]; + await metricValue.moveMouseTo(); + return await metricValue.getVisibleText(); + } - public async clickTopN() { - await testSubjects.click('top_nTsvbTypeBtn'); - } + public async clickGauge() { + await this.testSubjects.click('gaugeTsvbTypeBtn'); + } - public async getTopNLabel() { - const topNLabel = await find.byCssSelector('.tvbVisTopN__label'); - return await topNLabel.getVisibleText(); - } + public async getGaugeLabel() { + const gaugeLabel = await this.find.byCssSelector('.tvbVisGauge__label'); + return await gaugeLabel.getVisibleText(); + } - public async getTopNCount() { - const gaugeCount = await find.byCssSelector('.tvbVisTopN__value'); - return await gaugeCount.getVisibleText(); - } + public async getGaugeCount() { + const gaugeCount = await this.find.byCssSelector('.tvbVisGauge__value'); + return await gaugeCount.getVisibleText(); + } - public async clickTable() { - await testSubjects.click('tableTsvbTypeBtn'); - } + public async clickTopN() { + await this.testSubjects.click('top_nTsvbTypeBtn'); + } - public async createNewAgg(nth = 0) { - const prevAggs = await testSubjects.findAll('aggSelector'); - const elements = await testSubjects.findAll('addMetricAddBtn'); - await elements[nth].click(); - await PageObjects.visChart.waitForVisualizationRenderingStabilized(); - await retry.waitFor('new agg is added', async () => { - const currentAggs = await testSubjects.findAll('aggSelector'); - return currentAggs.length > prevAggs.length; - }); - } + public async getTopNLabel() { + const topNLabel = await this.find.byCssSelector('.tvbVisTopN__label'); + return await topNLabel.getVisibleText(); + } - public async selectAggType(value: string, nth = 0) { - const elements = await testSubjects.findAll('aggSelector'); - await comboBox.setElement(elements[nth], value); - return await PageObjects.header.waitUntilLoadingHasFinished(); - } + public async getTopNCount() { + const gaugeCount = await this.find.byCssSelector('.tvbVisTopN__value'); + return await gaugeCount.getVisibleText(); + } - public async fillInExpression(expression: string, nth = 0) { - const expressions = await testSubjects.findAll('mathExpression'); - await expressions[nth].type(expression); - return await PageObjects.header.waitUntilLoadingHasFinished(); - } + public async clickTable() { + await this.testSubjects.click('tableTsvbTypeBtn'); + } - public async fillInVariable(name = 'test', metric = 'Count', nth = 0) { - const elements = await testSubjects.findAll('varRow'); - const varNameInput = await elements[nth].findByCssSelector('.tvbAggs__varName'); - await varNameInput.type(name); - const metricSelectWrapper = await elements[nth].findByCssSelector( - '.tvbAggs__varMetricWrapper' - ); - await comboBox.setElement(metricSelectWrapper, metric); - return await PageObjects.header.waitUntilLoadingHasFinished(); - } + public async createNewAgg(nth = 0) { + const prevAggs = await this.testSubjects.findAll('aggSelector'); + const elements = await this.testSubjects.findAll('addMetricAddBtn'); + await elements[nth].click(); + await this.visChart.waitForVisualizationRenderingStabilized(); + await this.retry.waitFor('new agg is added', async () => { + const currentAggs = await this.testSubjects.findAll('aggSelector'); + return currentAggs.length > prevAggs.length; + }); + } - public async selectGroupByField(fieldName: string) { - await comboBox.set('groupByField', fieldName); - } + public async selectAggType(value: string, nth = 0) { + const elements = await this.testSubjects.findAll('aggSelector'); + await this.comboBox.setElement(elements[nth], value); + return await this.header.waitUntilLoadingHasFinished(); + } - public async setColumnLabelValue(value: string) { - const el = await testSubjects.find('columnLabelName'); - await el.clearValue(); - await el.type(value); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + public async fillInExpression(expression: string, nth = 0) { + const expressions = await this.testSubjects.findAll('mathExpression'); + await expressions[nth].type(expression); + return await this.header.waitUntilLoadingHasFinished(); + } - /** - * get values for rendered table - * - * **Note:** this work only for table visualization - * - * @returns {Promise} - * @memberof VisualBuilderPage - */ - public async getViewTable(): Promise { - const tableView = await testSubjects.find('tableView', 20000); - return await tableView.getVisibleText(); - } + public async fillInVariable(name = 'test', metric = 'Count', nth = 0) { + const elements = await this.testSubjects.findAll('varRow'); + const varNameInput = await elements[nth].findByCssSelector('.tvbAggs__varName'); + await varNameInput.type(name); + const metricSelectWrapper = await elements[nth].findByCssSelector('.tvbAggs__varMetricWrapper'); + await this.comboBox.setElement(metricSelectWrapper, metric); + return await this.header.waitUntilLoadingHasFinished(); + } - public async clickPanelOptions(tabName: string) { - await testSubjects.click(`${tabName}EditorPanelOptionsBtn`); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + public async selectGroupByField(fieldName: string) { + await this.comboBox.set('groupByField', fieldName); + } - public async clickDataTab(tabName: string) { - await testSubjects.click(`${tabName}EditorDataBtn`); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + public async setColumnLabelValue(value: string) { + const el = await this.testSubjects.find('columnLabelName'); + await el.clearValue(); + await el.type(value); + await this.header.waitUntilLoadingHasFinished(); + } - public async switchIndexPatternSelectionMode(useKibanaIndices: boolean) { - await testSubjects.click('switchIndexPatternSelectionModePopover'); - await testSubjects.setEuiSwitch( - 'switchIndexPatternSelectionMode', - useKibanaIndices ? 'check' : 'uncheck' - ); - } + /** + * get values for rendered table + * + * **Note:** this work only for table visualization + * + * @returns {Promise} + * @memberof VisualBuilderPage + */ + public async getViewTable(): Promise { + const tableView = await this.testSubjects.find('tableView', 20000); + return await tableView.getVisibleText(); + } - public async setIndexPatternValue(value: string, useKibanaIndices?: boolean) { - const metricsIndexPatternInput = 'metricsIndexPatternInput'; + public async clickPanelOptions(tabName: string) { + await this.testSubjects.click(`${tabName}EditorPanelOptionsBtn`); + await this.header.waitUntilLoadingHasFinished(); + } - if (useKibanaIndices !== undefined) { - await this.switchIndexPatternSelectionMode(useKibanaIndices); - } + public async clickDataTab(tabName: string) { + await this.testSubjects.click(`${tabName}EditorDataBtn`); + await this.header.waitUntilLoadingHasFinished(); + } - if (useKibanaIndices === false) { - const el = await testSubjects.find(metricsIndexPatternInput); - await el.clearValue(); - if (value) { - await el.type(value, { charByChar: true }); - } - } else { - await comboBox.clearInputField(metricsIndexPatternInput); - if (value) { - await comboBox.setCustom(metricsIndexPatternInput, value); - } - } + public async switchIndexPatternSelectionMode(useKibanaIndices: boolean) { + await this.testSubjects.click('switchIndexPatternSelectionModePopover'); + await this.testSubjects.setEuiSwitch( + 'switchIndexPatternSelectionMode', + useKibanaIndices ? 'check' : 'uncheck' + ); + } + + public async setIndexPatternValue(value: string, useKibanaIndices?: boolean) { + const metricsIndexPatternInput = 'metricsIndexPatternInput'; - await PageObjects.header.waitUntilLoadingHasFinished(); + if (useKibanaIndices !== undefined) { + await this.switchIndexPatternSelectionMode(useKibanaIndices); } - public async setIntervalValue(value: string) { - const el = await testSubjects.find('metricsIndexPatternInterval'); + if (useKibanaIndices === false) { + const el = await this.testSubjects.find(metricsIndexPatternInput); await el.clearValue(); - await el.type(value); - await PageObjects.header.waitUntilLoadingHasFinished(); + if (value) { + await el.type(value, { charByChar: true }); + } + } else { + await this.comboBox.clearInputField(metricsIndexPatternInput); + if (value) { + await this.comboBox.setCustom(metricsIndexPatternInput, value); + } } - public async setDropLastBucket(value: boolean) { - const option = await testSubjects.find(`metricsDropLastBucket-${value ? 'yes' : 'no'}`); - (await option.findByCssSelector('label')).click(); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + await this.header.waitUntilLoadingHasFinished(); + } - public async waitForIndexPatternTimeFieldOptionsLoaded() { - await retry.waitFor('combobox options loaded', async () => { - const options = await comboBox.getOptions('metricsIndexPatternFieldsSelect'); - log.debug(`-- optionsCount=${options.length}`); - return options.length > 0; - }); - } + public async setIntervalValue(value: string) { + const el = await this.testSubjects.find('metricsIndexPatternInterval'); + await el.clearValue(); + await el.type(value); + await this.header.waitUntilLoadingHasFinished(); + } - public async selectIndexPatternTimeField(timeField: string) { - await retry.try(async () => { - await comboBox.clearInputField('metricsIndexPatternFieldsSelect'); - await comboBox.set('metricsIndexPatternFieldsSelect', timeField); - }); - } + public async setDropLastBucket(value: boolean) { + const option = await this.testSubjects.find(`metricsDropLastBucket-${value ? 'yes' : 'no'}`); + (await option.findByCssSelector('label')).click(); + await this.header.waitUntilLoadingHasFinished(); + } - /** - * check that table visualization is visible and ready for interact - * - * @returns {Promise} - * @memberof VisualBuilderPage - */ - public async checkTableTabIsPresent(): Promise { - await testSubjects.existOrFail('visualizationLoader'); - const isDataExists = await testSubjects.exists('tableView'); - log.debug(`data is already rendered: ${isDataExists}`); - if (!isDataExists) { - await this.checkPreviewIsDisabled(); - } - } + public async waitForIndexPatternTimeFieldOptionsLoaded() { + await this.retry.waitFor('combobox options loaded', async () => { + const options = await this.comboBox.getOptions('metricsIndexPatternFieldsSelect'); + this.log.debug(`-- optionsCount=${options.length}`); + return options.length > 0; + }); + } - /** - * set label name for aggregation - * - * @param {string} labelName - * @param {number} [nth=0] - * @memberof VisualBuilderPage - */ - public async setLabel(labelName: string, nth: number = 0): Promise { - const input = (await find.allByCssSelector('[placeholder="Label"]'))[nth]; - await input.type(labelName); - } + public async selectIndexPatternTimeField(timeField: string) { + await this.retry.try(async () => { + await this.comboBox.clearInputField('metricsIndexPatternFieldsSelect'); + await this.comboBox.set('metricsIndexPatternFieldsSelect', timeField); + }); + } - /** - * set field for type of aggregation - * - * @param {string} field name of field - * @param {number} [aggNth=0] number of aggregation. Start by zero - * @default 0 - * @memberof VisualBuilderPage - */ - public async setFieldForAggregation(field: string, aggNth: number = 0): Promise { - const fieldEl = await this.getFieldForAggregation(aggNth); - - await comboBox.setElement(fieldEl, field); + /** + * check that table visualization is visible and ready for interact + * + * @returns {Promise} + * @memberof VisualBuilderPage + */ + public async checkTableTabIsPresent(): Promise { + await this.testSubjects.existOrFail('visualizationLoader'); + const isDataExists = await this.testSubjects.exists('tableView'); + this.log.debug(`data is already rendered: ${isDataExists}`); + if (!isDataExists) { + await this.checkPreviewIsDisabled(); } + } - public async checkFieldForAggregationValidity(aggNth: number = 0): Promise { - const fieldEl = await this.getFieldForAggregation(aggNth); + /** + * set label name for aggregation + * + * @param {string} labelName + * @param {number} [nth=0] + * @memberof VisualBuilderPage + */ + public async setLabel(labelName: string, nth: number = 0): Promise { + const input = (await this.find.allByCssSelector('[placeholder="Label"]'))[nth]; + await input.type(labelName); + } - return await comboBox.checkValidity(fieldEl); - } + /** + * set field for type of aggregation + * + * @param {string} field name of field + * @param {number} [aggNth=0] number of aggregation. Start by zero + * @default 0 + * @memberof VisualBuilderPage + */ + public async setFieldForAggregation(field: string, aggNth: number = 0): Promise { + const fieldEl = await this.getFieldForAggregation(aggNth); + + await this.comboBox.setElement(fieldEl, field); + } - public async getFieldForAggregation(aggNth: number = 0): Promise { - const labels = await testSubjects.findAll('aggRow'); - const label = labels[aggNth]; + public async checkFieldForAggregationValidity(aggNth: number = 0): Promise { + const fieldEl = await this.getFieldForAggregation(aggNth); - return (await label.findAllByTestSubject('comboBoxInput'))[1]; - } + return await this.comboBox.checkValidity(fieldEl); + } - public async clickColorPicker(): Promise { - const picker = await find.byCssSelector('.tvbColorPicker button'); - await picker.clickMouseButton(); - } + public async getFieldForAggregation(aggNth: number = 0): Promise { + const labels = await this.testSubjects.findAll('aggRow'); + const label = labels[aggNth]; - public async setBackgroundColor(colorHex: string): Promise { - await this.clickColorPicker(); - await this.checkColorPickerPopUpIsPresent(); - await find.setValue('.euiColorPicker input', colorHex); - await this.clickColorPicker(); - await PageObjects.visChart.waitForVisualizationRenderingStabilized(); - } + return (await label.findAllByTestSubject('comboBoxInput'))[1]; + } - public async checkColorPickerPopUpIsPresent(): Promise { - log.debug(`Check color picker popup is present`); - await testSubjects.existOrFail('colorPickerPopover', { timeout: 5000 }); - } + public async clickColorPicker(): Promise { + const picker = await this.find.byCssSelector('.tvbColorPicker button'); + await picker.clickMouseButton(); + } - public async changePanelPreview(nth: number = 0): Promise { - const prevRenderingCount = await PageObjects.visChart.getVisualizationRenderingCount(); - const changePreviewBtnArray = await testSubjects.findAll('AddActivatePanelBtn'); - await changePreviewBtnArray[nth].click(); - await PageObjects.visChart.waitForRenderingCount(prevRenderingCount + 1); - } + public async setBackgroundColor(colorHex: string): Promise { + await this.clickColorPicker(); + await this.checkColorPickerPopUpIsPresent(); + await this.find.setValue('.euiColorPicker input', colorHex); + await this.clickColorPicker(); + await this.visChart.waitForVisualizationRenderingStabilized(); + } - public async checkPreviewIsDisabled(): Promise { - log.debug(`Check no data message is present`); - await testSubjects.existOrFail('timeseriesVis > visNoResult', { timeout: 5000 }); - } + public async checkColorPickerPopUpIsPresent(): Promise { + this.log.debug(`Check color picker popup is present`); + await this.testSubjects.existOrFail('colorPickerPopover', { timeout: 5000 }); + } - public async cloneSeries(nth: number = 0): Promise { - const cloneBtnArray = await testSubjects.findAll('AddCloneBtn'); - await cloneBtnArray[nth].click(); - await PageObjects.visChart.waitForVisualizationRenderingStabilized(); - } + public async changePanelPreview(nth: number = 0): Promise { + const prevRenderingCount = await this.visChart.getVisualizationRenderingCount(); + const changePreviewBtnArray = await this.testSubjects.findAll('AddActivatePanelBtn'); + await changePreviewBtnArray[nth].click(); + await this.visChart.waitForRenderingCount(prevRenderingCount + 1); + } - /** - * Get aggregation count for the current series - * - * @param {number} [nth=0] series - * @returns {Promise} - * @memberof VisualBuilderPage - */ - public async getAggregationCount(nth: number = 0): Promise { - const series = await this.getSeries(); - const aggregation = await series[nth].findAllByTestSubject('draggable'); - return aggregation.length; - } + public async checkPreviewIsDisabled(): Promise { + this.log.debug(`Check no data message is present`); + await this.testSubjects.existOrFail('timeseriesVis > visNoResult', { timeout: 5000 }); + } - public async deleteSeries(nth: number = 0): Promise { - const prevRenderingCount = await PageObjects.visChart.getVisualizationRenderingCount(); - const cloneBtnArray = await testSubjects.findAll('AddDeleteBtn'); - await cloneBtnArray[nth].click(); - await PageObjects.visChart.waitForRenderingCount(prevRenderingCount + 1); - } + public async cloneSeries(nth: number = 0): Promise { + const cloneBtnArray = await this.testSubjects.findAll('AddCloneBtn'); + await cloneBtnArray[nth].click(); + await this.visChart.waitForVisualizationRenderingStabilized(); + } - public async getLegendItems(): Promise { - return await find.allByCssSelector('.echLegendItem'); - } + /** + * Get aggregation count for the current series + * + * @param {number} [nth=0] series + * @returns {Promise} + * @memberof VisualBuilderPage + */ + public async getAggregationCount(nth: number = 0): Promise { + const series = await this.getSeries(); + const aggregation = await series[nth].findAllByTestSubject('draggable'); + return aggregation.length; + } - public async getLegendItemsContent(): Promise { - const legendList = await find.byCssSelector('.echLegendList'); - const $ = await legendList.parseDomContent(); + public async deleteSeries(nth: number = 0): Promise { + const prevRenderingCount = await this.visChart.getVisualizationRenderingCount(); + const cloneBtnArray = await this.testSubjects.findAll('AddDeleteBtn'); + await cloneBtnArray[nth].click(); + await this.visChart.waitForRenderingCount(prevRenderingCount + 1); + } - return $('li') - .toArray() - .map((li) => { - const label = $(li).find('.echLegendItem__label').text(); - const value = $(li).find('.echLegendItem__extra').text(); + public async getLegendItems(): Promise { + return await this.find.allByCssSelector('.echLegendItem'); + } - return `${label}: ${value}`; - }); - } + public async getLegendItemsContent(): Promise { + const legendList = await this.find.byCssSelector('.echLegendList'); + const $ = await legendList.parseDomContent(); - public async getSeries(): Promise { - return await find.allByCssSelector('.tvbSeriesEditor'); - } + return $('li') + .toArray() + .map((li) => { + const label = $(li).find('.echLegendItem__label').text(); + const value = $(li).find('.echLegendItem__extra').text(); - public async setMetricsGroupByTerms(field: string) { - const groupBy = await find.byCssSelector( - '.tvbAggRow--split [data-test-subj="comboBoxInput"]' - ); - await comboBox.setElement(groupBy, 'Terms', { clickWithMouse: true }); - await PageObjects.common.sleep(1000); - const byField = await testSubjects.find('groupByField'); - await comboBox.setElement(byField, field); - } + return `${label}: ${value}`; + }); + } - public async checkSelectedMetricsGroupByValue(value: string) { - const groupBy = await find.byCssSelector( - '.tvbAggRow--split [data-test-subj="comboBoxInput"]' - ); - return await comboBox.isOptionSelected(groupBy, value); - } + public async getSeries(): Promise { + return await this.find.allByCssSelector('.tvbSeriesEditor'); + } - public async setMetricsDataTimerangeMode(value: string) { - const dataTimeRangeMode = await testSubjects.find('dataTimeRangeMode'); - return await comboBox.setElement(dataTimeRangeMode, value); - } + public async setMetricsGroupByTerms(field: string) { + const groupBy = await this.find.byCssSelector( + '.tvbAggRow--split [data-test-subj="comboBoxInput"]' + ); + await this.comboBox.setElement(groupBy, 'Terms', { clickWithMouse: true }); + await this.common.sleep(1000); + const byField = await this.testSubjects.find('groupByField'); + await this.comboBox.setElement(byField, field); + } - public async checkSelectedDataTimerangeMode(value: string) { - const dataTimeRangeMode = await testSubjects.find('dataTimeRangeMode'); - return await comboBox.isOptionSelected(dataTimeRangeMode, value); - } + public async checkSelectedMetricsGroupByValue(value: string) { + const groupBy = await this.find.byCssSelector( + '.tvbAggRow--split [data-test-subj="comboBoxInput"]' + ); + return await this.comboBox.isOptionSelected(groupBy, value); } - return new VisualBuilderPage(); + public async setMetricsDataTimerangeMode(value: string) { + const dataTimeRangeMode = await this.testSubjects.find('dataTimeRangeMode'); + return await this.comboBox.setElement(dataTimeRangeMode, value); + } + + public async checkSelectedDataTimerangeMode(value: string) { + const dataTimeRangeMode = await this.testSubjects.find('dataTimeRangeMode'); + return await this.comboBox.isOptionSelected(dataTimeRangeMode, value); + } } diff --git a/test/functional/page_objects/visualize_chart_page.ts b/test/functional/page_objects/visualize_chart_page.ts index 7ecf800b4be7c0..c8587f4ffd3469 100644 --- a/test/functional/page_objects/visualize_chart_page.ts +++ b/test/functional/page_objects/visualize_chart_page.ts @@ -9,614 +9,618 @@ import { Position } from '@elastic/charts'; import Color from 'color'; -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; const xyChartSelector = 'visTypeXyChart'; const pieChartSelector = 'visTypePieChart'; -export function VisualizeChartPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const testSubjects = getService('testSubjects'); - const config = getService('config'); - const find = getService('find'); - const log = getService('log'); - const retry = getService('retry'); - const kibanaServer = getService('kibanaServer'); - const elasticChart = getService('elasticChart'); - const dataGrid = getService('dataGrid'); - const defaultFindTimeout = config.get('timeouts.find'); - const { common } = getPageObjects(['common']); - - class VisualizeChart { - public async getEsChartDebugState(chartSelector: string) { - return await elasticChart.getChartDebugData(chartSelector); - } +export class VisualizeChartPageObject extends FtrService { + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly config = this.ctx.getService('config'); + private readonly find = this.ctx.getService('find'); + private readonly log = this.ctx.getService('log'); + private readonly retry = this.ctx.getService('retry'); + private readonly kibanaServer = this.ctx.getService('kibanaServer'); + private readonly elasticChart = this.ctx.getService('elasticChart'); + private readonly dataGrid = this.ctx.getService('dataGrid'); + private readonly common = this.ctx.getPageObject('common'); + + private readonly defaultFindTimeout = this.config.get('timeouts.find'); + + public async getEsChartDebugState(chartSelector: string) { + return await this.elasticChart.getChartDebugData(chartSelector); + } - /** - * Is new charts library advanced setting enabled - */ - public async isNewChartsLibraryEnabled(): Promise { - const legacyChartsLibrary = - Boolean(await kibanaServer.uiSettings.get('visualization:visualize:legacyChartsLibrary')) ?? - true; - const enabled = !legacyChartsLibrary; - log.debug(`-- isNewChartsLibraryEnabled = ${enabled}`); - - return enabled; - } + /** + * Is new charts library advanced setting enabled + */ + public async isNewChartsLibraryEnabled(): Promise { + const legacyChartsLibrary = + Boolean( + await this.kibanaServer.uiSettings.get('visualization:visualize:legacyChartsLibrary') + ) ?? true; + const enabled = !legacyChartsLibrary; + this.log.debug(`-- isNewChartsLibraryEnabled = ${enabled}`); + + return enabled; + } - /** - * Is new charts library enabled and an area, line or histogram chart exists - */ - public async isNewLibraryChart(chartSelector: string): Promise { - const enabled = await this.isNewChartsLibraryEnabled(); + /** + * Is new charts library enabled and an area, line or histogram chart exists + */ + public async isNewLibraryChart(chartSelector: string): Promise { + const enabled = await this.isNewChartsLibraryEnabled(); - if (!enabled) { - log.debug(`-- isNewLibraryChart = false`); - return false; - } - - // check if enabled but not a line, area, histogram or pie chart - if (await find.existsByCssSelector('.visLib__chart', 1)) { - const chart = await find.byCssSelector('.visLib__chart'); - const chartType = await chart.getAttribute('data-vislib-chart-type'); + if (!enabled) { + this.log.debug(`-- isNewLibraryChart = false`); + return false; + } - if (!['line', 'area', 'histogram', 'pie'].includes(chartType)) { - log.debug(`-- isNewLibraryChart = false`); - return false; - } - } + // check if enabled but not a line, area, histogram or pie chart + if (await this.find.existsByCssSelector('.visLib__chart', 1)) { + const chart = await this.find.byCssSelector('.visLib__chart'); + const chartType = await chart.getAttribute('data-vislib-chart-type'); - if (!(await elasticChart.hasChart(chartSelector, 1))) { - // not be a vislib chart type - log.debug(`-- isNewLibraryChart = false`); + if (!['line', 'area', 'histogram', 'pie'].includes(chartType)) { + this.log.debug(`-- isNewLibraryChart = false`); return false; } + } - log.debug(`-- isNewLibraryChart = true`); - return true; + if (!(await this.elasticChart.hasChart(chartSelector, 1))) { + // not be a vislib chart type + this.log.debug(`-- isNewLibraryChart = false`); + return false; } - /** - * Helper method to get expected values that are slightly different - * between vislib and elastic-chart inplementations - * @param vislibValue value expected for vislib chart - * @param elasticChartsValue value expected for `@elastic/charts` chart - */ - public async getExpectedValue(vislibValue: T, elasticChartsValue: T): Promise { - if (await this.isNewLibraryChart(xyChartSelector)) { - return elasticChartsValue; - } + this.log.debug(`-- isNewLibraryChart = true`); + return true; + } - return vislibValue; + /** + * Helper method to get expected values that are slightly different + * between vislib and elastic-chart inplementations + * @param vislibValue value expected for vislib chart + * @param elasticChartsValue value expected for `@elastic/charts` chart + */ + public async getExpectedValue(vislibValue: T, elasticChartsValue: T): Promise { + if (await this.isNewLibraryChart(xyChartSelector)) { + return elasticChartsValue; } - public async getYAxisTitle() { - if (await this.isNewLibraryChart(xyChartSelector)) { - const xAxis = (await this.getEsChartDebugState(xyChartSelector))?.axes?.y ?? []; - return xAxis[0]?.title; - } + return vislibValue; + } - const title = await find.byCssSelector('.y-axis-div .y-axis-title text'); - return await title.getVisibleText(); + public async getYAxisTitle() { + if (await this.isNewLibraryChart(xyChartSelector)) { + const xAxis = (await this.getEsChartDebugState(xyChartSelector))?.axes?.y ?? []; + return xAxis[0]?.title; } - public async getXAxisLabels() { - if (await this.isNewLibraryChart(xyChartSelector)) { - const [xAxis] = (await this.getEsChartDebugState(xyChartSelector))?.axes?.x ?? []; - return xAxis?.labels; - } + const title = await this.find.byCssSelector('.y-axis-div .y-axis-title text'); + return await title.getVisibleText(); + } - const xAxis = await find.byCssSelector('.visAxis--x.visAxis__column--bottom'); - const $ = await xAxis.parseDomContent(); - return $('.x > g > text') - .toArray() - .map((tick) => $(tick).text().trim()); + public async getXAxisLabels() { + if (await this.isNewLibraryChart(xyChartSelector)) { + const [xAxis] = (await this.getEsChartDebugState(xyChartSelector))?.axes?.x ?? []; + return xAxis?.labels; } - public async getYAxisLabels() { - if (await this.isNewLibraryChart(xyChartSelector)) { - const [yAxis] = (await this.getEsChartDebugState(xyChartSelector))?.axes?.y ?? []; - return yAxis?.labels; - } + const xAxis = await this.find.byCssSelector('.visAxis--x.visAxis__column--bottom'); + const $ = await xAxis.parseDomContent(); + return $('.x > g > text') + .toArray() + .map((tick) => $(tick).text().trim()); + } - const yAxis = await find.byCssSelector('.visAxis__column--y.visAxis__column--left'); - const $ = await yAxis.parseDomContent(); - return $('.y > g > text') - .toArray() - .map((tick) => $(tick).text().trim()); + public async getYAxisLabels() { + if (await this.isNewLibraryChart(xyChartSelector)) { + const [yAxis] = (await this.getEsChartDebugState(xyChartSelector))?.axes?.y ?? []; + return yAxis?.labels; } - public async getYAxisLabelsAsNumbers() { - if (await this.isNewLibraryChart(xyChartSelector)) { - const [yAxis] = (await this.getEsChartDebugState(xyChartSelector))?.axes?.y ?? []; - return yAxis?.values; - } + const yAxis = await this.find.byCssSelector('.visAxis__column--y.visAxis__column--left'); + const $ = await yAxis.parseDomContent(); + return $('.y > g > text') + .toArray() + .map((tick) => $(tick).text().trim()); + } - return (await this.getYAxisLabels()).map((label) => Number(label.replace(',', ''))); + public async getYAxisLabelsAsNumbers() { + if (await this.isNewLibraryChart(xyChartSelector)) { + const [yAxis] = (await this.getEsChartDebugState(xyChartSelector))?.axes?.y ?? []; + return yAxis?.values; } - /** - * Gets the chart data and scales it based on chart height and label. - * @param dataLabel data-label value - * @param axis axis value, 'ValueAxis-1' by default - * - * Returns an array of height values - */ - public async getAreaChartData(dataLabel: string, axis = 'ValueAxis-1') { - if (await this.isNewLibraryChart(xyChartSelector)) { - const areas = (await this.getEsChartDebugState(xyChartSelector))?.areas ?? []; - const points = areas.find(({ name }) => name === dataLabel)?.lines.y1.points ?? []; - return points.map(({ y }) => y); - } - - const yAxisRatio = await this.getChartYAxisRatio(axis); + return (await this.getYAxisLabels()).map((label) => Number(label.replace(',', ''))); + } - const rectangle = await find.byCssSelector('rect.background'); - const yAxisHeight = Number(await rectangle.getAttribute('height')); - log.debug(`height --------- ${yAxisHeight}`); + /** + * Gets the chart data and scales it based on chart height and label. + * @param dataLabel data-label value + * @param axis axis value, 'ValueAxis-1' by default + * + * Returns an array of height values + */ + public async getAreaChartData(dataLabel: string, axis = 'ValueAxis-1') { + if (await this.isNewLibraryChart(xyChartSelector)) { + const areas = (await this.getEsChartDebugState(xyChartSelector))?.areas ?? []; + const points = areas.find(({ name }) => name === dataLabel)?.lines.y1.points ?? []; + return points.map(({ y }) => y); + } + + const yAxisRatio = await this.getChartYAxisRatio(axis); + + const rectangle = await this.find.byCssSelector('rect.background'); + const yAxisHeight = Number(await rectangle.getAttribute('height')); + this.log.debug(`height --------- ${yAxisHeight}`); + + const path = await this.retry.try( + async () => + await this.find.byCssSelector( + `path[data-label="${dataLabel}"]`, + this.defaultFindTimeout * 2 + ) + ); + const data = await path.getAttribute('d'); + this.log.debug(data); + // This area chart data starts with a 'M'ove to a x,y location, followed + // by a bunch of 'L'ines from that point to the next. Those points are + // the values we're going to use to calculate the data values we're testing. + // So git rid of the one 'M' and split the rest on the 'L's. + const tempArray = data + .replace('M ', '') + .replace('M', '') + .replace(/ L /g, 'L') + .replace(/ /g, ',') + .split('L'); + const chartSections = tempArray.length / 2; + const chartData = []; + for (let i = 0; i < chartSections; i++) { + chartData[i] = Math.round((yAxisHeight - Number(tempArray[i].split(',')[1])) * yAxisRatio); + this.log.debug('chartData[i] =' + chartData[i]); + } + return chartData; + } - const path = await retry.try( - async () => - await find.byCssSelector(`path[data-label="${dataLabel}"]`, defaultFindTimeout * 2) - ); - const data = await path.getAttribute('d'); - log.debug(data); - // This area chart data starts with a 'M'ove to a x,y location, followed - // by a bunch of 'L'ines from that point to the next. Those points are - // the values we're going to use to calculate the data values we're testing. - // So git rid of the one 'M' and split the rest on the 'L's. - const tempArray = data - .replace('M ', '') - .replace('M', '') - .replace(/ L /g, 'L') - .replace(/ /g, ',') - .split('L'); - const chartSections = tempArray.length / 2; - const chartData = []; - for (let i = 0; i < chartSections; i++) { - chartData[i] = Math.round((yAxisHeight - Number(tempArray[i].split(',')[1])) * yAxisRatio); - log.debug('chartData[i] =' + chartData[i]); - } - return chartData; - } + /** + * Returns the paths that compose an area chart. + * @param dataLabel data-label value + */ + public async getAreaChartPaths(dataLabel: string) { + if (await this.isNewLibraryChart(xyChartSelector)) { + const areas = (await this.getEsChartDebugState(xyChartSelector))?.areas ?? []; + const path = areas.find(({ name }) => name === dataLabel)?.path ?? ''; + return path.split('L'); + } + + const path = await this.retry.try( + async () => + await this.find.byCssSelector( + `path[data-label="${dataLabel}"]`, + this.defaultFindTimeout * 2 + ) + ); + const data = await path.getAttribute('d'); + this.log.debug(data); + // This area chart data starts with a 'M'ove to a x,y location, followed + // by a bunch of 'L'ines from that point to the next. Those points are + // the values we're going to use to calculate the data values we're testing. + // So git rid of the one 'M' and split the rest on the 'L's. + return data.split('L'); + } - /** - * Returns the paths that compose an area chart. - * @param dataLabel data-label value - */ - public async getAreaChartPaths(dataLabel: string) { - if (await this.isNewLibraryChart(xyChartSelector)) { - const areas = (await this.getEsChartDebugState(xyChartSelector))?.areas ?? []; - const path = areas.find(({ name }) => name === dataLabel)?.path ?? ''; - return path.split('L'); - } + /** + * Gets the dots and normalizes their height. + * @param dataLabel data-label value + * @param axis axis value, 'ValueAxis-1' by default + */ + public async getLineChartData(dataLabel = 'Count', axis = 'ValueAxis-1') { + if (await this.isNewLibraryChart(xyChartSelector)) { + // For now lines are rendered as areas to enable stacking + const areas = (await this.getEsChartDebugState(xyChartSelector))?.areas ?? []; + const lines = areas.map(({ lines: { y1 }, name, color }) => ({ ...y1, name, color })); + const points = lines.find(({ name }) => name === dataLabel)?.points ?? []; + return points.map(({ y }) => y); + } + + // 1). get the range/pixel ratio + const yAxisRatio = await this.getChartYAxisRatio(axis); + // 2). find and save the y-axis pixel size (the chart height) + const rectangle = await this.find.byCssSelector('clipPath rect'); + const yAxisHeight = Number(await rectangle.getAttribute('height')); + // 3). get the visWrapper__chart elements + const chartTypes = await this.retry.try( + async () => + await this.find.allByCssSelector( + `.visWrapper__chart circle[data-label="${dataLabel}"][fill-opacity="1"]`, + this.defaultFindTimeout * 2 + ) + ); + // 4). for each chart element, find the green circle, then the cy position + const chartData = await Promise.all( + chartTypes.map(async (chart) => { + const cy = Number(await chart.getAttribute('cy')); + // the point_series_options test has data in the billions range and + // getting 11 digits of precision with these calculations is very hard + return Math.round(Number(((yAxisHeight - cy) * yAxisRatio).toPrecision(6))); + }) + ); + + return chartData; + } - const path = await retry.try( - async () => - await find.byCssSelector(`path[data-label="${dataLabel}"]`, defaultFindTimeout * 2) - ); - const data = await path.getAttribute('d'); - log.debug(data); - // This area chart data starts with a 'M'ove to a x,y location, followed - // by a bunch of 'L'ines from that point to the next. Those points are - // the values we're going to use to calculate the data values we're testing. - // So git rid of the one 'M' and split the rest on the 'L's. - return data.split('L'); - } + /** + * Returns bar chart data in pixels + * @param dataLabel data-label value + * @param axis axis value, 'ValueAxis-1' by default + */ + public async getBarChartData(dataLabel = 'Count', axis = 'ValueAxis-1') { + if (await this.isNewLibraryChart(xyChartSelector)) { + const bars = (await this.getEsChartDebugState(xyChartSelector))?.bars ?? []; + const values = bars.find(({ name }) => name === dataLabel)?.bars ?? []; + return values.map(({ y }) => y); + } + + const yAxisRatio = await this.getChartYAxisRatio(axis); + const svg = await this.find.byCssSelector('div.chart'); + const $ = await svg.parseDomContent(); + const chartData = $(`g > g.series > rect[data-label="${dataLabel}"]`) + .toArray() + .map((chart) => { + const barHeight = Number($(chart).attr('height')); + return Math.round(barHeight * yAxisRatio); + }); - /** - * Gets the dots and normalizes their height. - * @param dataLabel data-label value - * @param axis axis value, 'ValueAxis-1' by default - */ - public async getLineChartData(dataLabel = 'Count', axis = 'ValueAxis-1') { - if (await this.isNewLibraryChart(xyChartSelector)) { - // For now lines are rendered as areas to enable stacking - const areas = (await this.getEsChartDebugState(xyChartSelector))?.areas ?? []; - const lines = areas.map(({ lines: { y1 }, name, color }) => ({ ...y1, name, color })); - const points = lines.find(({ name }) => name === dataLabel)?.points ?? []; - return points.map(({ y }) => y); - } + return chartData; + } - // 1). get the range/pixel ratio - const yAxisRatio = await this.getChartYAxisRatio(axis); - // 2). find and save the y-axis pixel size (the chart height) - const rectangle = await find.byCssSelector('clipPath rect'); - const yAxisHeight = Number(await rectangle.getAttribute('height')); - // 3). get the visWrapper__chart elements - const chartTypes = await retry.try( - async () => - await find.allByCssSelector( - `.visWrapper__chart circle[data-label="${dataLabel}"][fill-opacity="1"]`, - defaultFindTimeout * 2 - ) - ); - // 4). for each chart element, find the green circle, then the cy position - const chartData = await Promise.all( - chartTypes.map(async (chart) => { - const cy = Number(await chart.getAttribute('cy')); - // the point_series_options test has data in the billions range and - // getting 11 digits of precision with these calculations is very hard - return Math.round(Number(((yAxisHeight - cy) * yAxisRatio).toPrecision(6))); - }) - ); + /** + * Returns the range/pixel ratio + * @param axis axis value, 'ValueAxis-1' by default + */ + private async getChartYAxisRatio(axis = 'ValueAxis-1') { + // 1). get the maximum chart Y-Axis marker value and Y position + const maxYAxisChartMarker = await this.retry.try( + async () => + await this.find.byCssSelector( + `div.visAxis__splitAxes--y > div > svg > g.${axis} > g:last-of-type.tick` + ) + ); + const maxYLabel = (await maxYAxisChartMarker.getVisibleText()).replace(/,/g, ''); + const maxYLabelYPosition = (await maxYAxisChartMarker.getPosition()).y; + this.log.debug(`maxYLabel = ${maxYLabel}, maxYLabelYPosition = ${maxYLabelYPosition}`); + + // 2). get the minimum chart Y-Axis marker value and Y position + const minYAxisChartMarker = await this.find.byCssSelector( + 'div.visAxis__column--y.visAxis__column--left > div > div > svg:nth-child(2) > g > g:nth-child(1).tick' + ); + const minYLabel = (await minYAxisChartMarker.getVisibleText()).replace(',', ''); + const minYLabelYPosition = (await minYAxisChartMarker.getPosition()).y; + return (Number(maxYLabel) - Number(minYLabel)) / (minYLabelYPosition - maxYLabelYPosition); + } - return chartData; - } + public async toggleLegend(show = true) { + const isVisTypeXYChart = await this.isNewLibraryChart(xyChartSelector); + const isVisTypePieChart = await this.isNewLibraryChart(pieChartSelector); + const legendSelector = isVisTypeXYChart || isVisTypePieChart ? '.echLegend' : '.visLegend'; - /** - * Returns bar chart data in pixels - * @param dataLabel data-label value - * @param axis axis value, 'ValueAxis-1' by default - */ - public async getBarChartData(dataLabel = 'Count', axis = 'ValueAxis-1') { - if (await this.isNewLibraryChart(xyChartSelector)) { - const bars = (await this.getEsChartDebugState(xyChartSelector))?.bars ?? []; - const values = bars.find(({ name }) => name === dataLabel)?.bars ?? []; - return values.map(({ y }) => y); + await this.retry.try(async () => { + const isVisible = await this.find.existsByCssSelector(legendSelector); + if ((show && !isVisible) || (!show && isVisible)) { + await this.testSubjects.click('vislibToggleLegend'); } + }); + } - const yAxisRatio = await this.getChartYAxisRatio(axis); - const svg = await find.byCssSelector('div.chart'); - const $ = await svg.parseDomContent(); - const chartData = $(`g > g.series > rect[data-label="${dataLabel}"]`) - .toArray() - .map((chart) => { - const barHeight = Number($(chart).attr('height')); - return Math.round(barHeight * yAxisRatio); - }); - - return chartData; - } - - /** - * Returns the range/pixel ratio - * @param axis axis value, 'ValueAxis-1' by default - */ - private async getChartYAxisRatio(axis = 'ValueAxis-1') { - // 1). get the maximum chart Y-Axis marker value and Y position - const maxYAxisChartMarker = await retry.try( - async () => - await find.byCssSelector( - `div.visAxis__splitAxes--y > div > svg > g.${axis} > g:last-of-type.tick` - ) - ); - const maxYLabel = (await maxYAxisChartMarker.getVisibleText()).replace(/,/g, ''); - const maxYLabelYPosition = (await maxYAxisChartMarker.getPosition()).y; - log.debug(`maxYLabel = ${maxYLabel}, maxYLabelYPosition = ${maxYLabelYPosition}`); + public async filterLegend(name: string) { + await this.toggleLegend(); + await this.testSubjects.click(`legend-${name}`); + const filterIn = await this.testSubjects.find(`legend-${name}-filterIn`); + await filterIn.click(); + await this.waitForVisualizationRenderingStabilized(); + } - // 2). get the minimum chart Y-Axis marker value and Y position - const minYAxisChartMarker = await find.byCssSelector( - 'div.visAxis__column--y.visAxis__column--left > div > div > svg:nth-child(2) > g > g:nth-child(1).tick' - ); - const minYLabel = (await minYAxisChartMarker.getVisibleText()).replace(',', ''); - const minYLabelYPosition = (await minYAxisChartMarker.getPosition()).y; - return (Number(maxYLabel) - Number(minYLabel)) / (minYLabelYPosition - maxYLabelYPosition); - } + public async doesLegendColorChoiceExist(color: string) { + return await this.testSubjects.exists(`visColorPickerColor-${color}`); + } - public async toggleLegend(show = true) { - const isVisTypeXYChart = await this.isNewLibraryChart(xyChartSelector); - const isVisTypePieChart = await this.isNewLibraryChart(pieChartSelector); - const legendSelector = isVisTypeXYChart || isVisTypePieChart ? '.echLegend' : '.visLegend'; + public async selectNewLegendColorChoice(color: string) { + await this.testSubjects.click(`visColorPickerColor-${color}`); + } - await retry.try(async () => { - const isVisible = await find.existsByCssSelector(legendSelector); - if ((show && !isVisible) || (!show && isVisible)) { - await testSubjects.click('vislibToggleLegend'); - } - }); + public async doesSelectedLegendColorExist(color: string) { + if (await this.isNewLibraryChart(xyChartSelector)) { + const items = (await this.getEsChartDebugState(xyChartSelector))?.legend?.items ?? []; + return items.some(({ color: c }) => c === color); } - public async filterLegend(name: string) { - await this.toggleLegend(); - await testSubjects.click(`legend-${name}`); - const filterIn = await testSubjects.find(`legend-${name}-filterIn`); - await filterIn.click(); - await this.waitForVisualizationRenderingStabilized(); + if (await this.isNewLibraryChart(pieChartSelector)) { + const slices = + (await this.getEsChartDebugState(pieChartSelector))?.partition?.[0]?.partitions ?? []; + return slices.some(({ color: c }) => { + const rgbColor = new Color(color).rgb().toString(); + return c === rgbColor; + }); } - public async doesLegendColorChoiceExist(color: string) { - return await testSubjects.exists(`visColorPickerColor-${color}`); - } + return await this.testSubjects.exists(`legendSelectedColor-${color}`); + } - public async selectNewLegendColorChoice(color: string) { - await testSubjects.click(`visColorPickerColor-${color}`); + public async expectError() { + if (!this.isNewLibraryChart(xyChartSelector)) { + await this.testSubjects.existOrFail('vislibVisualizeError'); } + } - public async doesSelectedLegendColorExist(color: string) { - if (await this.isNewLibraryChart(xyChartSelector)) { - const items = (await this.getEsChartDebugState(xyChartSelector))?.legend?.items ?? []; - return items.some(({ color: c }) => c === color); - } - - if (await this.isNewLibraryChart(pieChartSelector)) { - const slices = - (await this.getEsChartDebugState(pieChartSelector))?.partition?.[0]?.partitions ?? []; - return slices.some(({ color: c }) => { - const rgbColor = new Color(color).rgb().toString(); - return c === rgbColor; - }); - } - - return await testSubjects.exists(`legendSelectedColor-${color}`); - } + public async getVisualizationRenderingCount() { + const visualizationLoader = await this.testSubjects.find('visualizationLoader'); + const renderingCount = await visualizationLoader.getAttribute('data-rendering-count'); + return Number(renderingCount); + } - public async expectError() { - if (!this.isNewLibraryChart(xyChartSelector)) { - await testSubjects.existOrFail('vislibVisualizeError'); + public async waitForRenderingCount(minimumCount = 1) { + await this.retry.waitFor( + `rendering count to be greater than or equal to [${minimumCount}]`, + async () => { + const currentRenderingCount = await this.getVisualizationRenderingCount(); + this.log.debug(`-- currentRenderingCount=${currentRenderingCount}`); + this.log.debug(`-- expectedCount=${minimumCount}`); + return currentRenderingCount >= minimumCount; } - } + ); + } - public async getVisualizationRenderingCount() { - const visualizationLoader = await testSubjects.find('visualizationLoader'); - const renderingCount = await visualizationLoader.getAttribute('data-rendering-count'); - return Number(renderingCount); - } + public async waitForVisualizationRenderingStabilized() { + // assuming rendering is done when data-rendering-count is constant within 1000 ms + await this.retry.waitFor('rendering count to stabilize', async () => { + const firstCount = await this.getVisualizationRenderingCount(); + this.log.debug(`-- firstCount=${firstCount}`); - public async waitForRenderingCount(minimumCount = 1) { - await retry.waitFor( - `rendering count to be greater than or equal to [${minimumCount}]`, - async () => { - const currentRenderingCount = await this.getVisualizationRenderingCount(); - log.debug(`-- currentRenderingCount=${currentRenderingCount}`); - log.debug(`-- expectedCount=${minimumCount}`); - return currentRenderingCount >= minimumCount; - } - ); - } + await this.common.sleep(2000); - public async waitForVisualizationRenderingStabilized() { - // assuming rendering is done when data-rendering-count is constant within 1000 ms - await retry.waitFor('rendering count to stabilize', async () => { - const firstCount = await this.getVisualizationRenderingCount(); - log.debug(`-- firstCount=${firstCount}`); + const secondCount = await this.getVisualizationRenderingCount(); + this.log.debug(`-- secondCount=${secondCount}`); - await common.sleep(2000); + return firstCount === secondCount; + }); + } - const secondCount = await this.getVisualizationRenderingCount(); - log.debug(`-- secondCount=${secondCount}`); + public async waitForVisualization() { + await this.waitForVisualizationRenderingStabilized(); - return firstCount === secondCount; - }); + if (!(await this.isNewLibraryChart(xyChartSelector))) { + await this.find.byCssSelector('.visualization'); } + } - public async waitForVisualization() { - await this.waitForVisualizationRenderingStabilized(); - - if (!(await this.isNewLibraryChart(xyChartSelector))) { - await find.byCssSelector('.visualization'); - } + public async getLegendEntries() { + const isVisTypeXYChart = await this.isNewLibraryChart(xyChartSelector); + const isVisTypePieChart = await this.isNewLibraryChart(pieChartSelector); + if (isVisTypeXYChart) { + const items = (await this.getEsChartDebugState(xyChartSelector))?.legend?.items ?? []; + return items.map(({ name }) => name); } - public async getLegendEntries() { - const isVisTypeXYChart = await this.isNewLibraryChart(xyChartSelector); - const isVisTypePieChart = await this.isNewLibraryChart(pieChartSelector); - if (isVisTypeXYChart) { - const items = (await this.getEsChartDebugState(xyChartSelector))?.legend?.items ?? []; - return items.map(({ name }) => name); - } - - if (isVisTypePieChart) { - const slices = - (await this.getEsChartDebugState(pieChartSelector))?.partition?.[0]?.partitions ?? []; - return slices.map(({ name }) => name); - } - - const legendEntries = await find.allByCssSelector( - '.visLegend__button', - defaultFindTimeout * 2 - ); - return await Promise.all( - legendEntries.map(async (chart) => await chart.getAttribute('data-label')) - ); + if (isVisTypePieChart) { + const slices = + (await this.getEsChartDebugState(pieChartSelector))?.partition?.[0]?.partitions ?? []; + return slices.map(({ name }) => name); } - public async openLegendOptionColors(name: string, chartSelector: string) { - await this.waitForVisualizationRenderingStabilized(); - await retry.try(async () => { - if ( - (await this.isNewLibraryChart(xyChartSelector)) || - (await this.isNewLibraryChart(pieChartSelector)) - ) { - const chart = await find.byCssSelector(chartSelector); - const legendItemColor = await chart.findByCssSelector( - `[data-ech-series-name="${name}"] .echLegendItem__color` - ); - legendItemColor.click(); - } else { - // This click has been flaky in opening the legend, hence the retry. See - // https://github.com/elastic/kibana/issues/17468 - await testSubjects.click(`legend-${name}`); - } - - await this.waitForVisualizationRenderingStabilized(); - // arbitrary color chosen, any available would do - const arbitraryColor = (await this.isNewLibraryChart(xyChartSelector)) - ? '#d36086' - : '#EF843C'; - const isOpen = await this.doesLegendColorChoiceExist(arbitraryColor); - if (!isOpen) { - throw new Error('legend color selector not open'); - } - }); - } + const legendEntries = await this.find.allByCssSelector( + '.visLegend__button', + this.defaultFindTimeout * 2 + ); + return await Promise.all( + legendEntries.map(async (chart) => await chart.getAttribute('data-label')) + ); + } - public async filterOnTableCell(columnIndex: number, rowIndex: number) { - await retry.try(async () => { - const cell = await dataGrid.getCellElement(rowIndex, columnIndex); - await cell.click(); - const filterBtn = await testSubjects.findDescendant( - 'tbvChartCell__filterForCellValue', - cell + public async openLegendOptionColors(name: string, chartSelector: string) { + await this.waitForVisualizationRenderingStabilized(); + await this.retry.try(async () => { + if ( + (await this.isNewLibraryChart(xyChartSelector)) || + (await this.isNewLibraryChart(pieChartSelector)) + ) { + const chart = await this.find.byCssSelector(chartSelector); + const legendItemColor = await chart.findByCssSelector( + `[data-ech-series-name="${name}"] .echLegendItem__color` ); - await common.sleep(2000); - filterBtn.click(); - }); - } + legendItemColor.click(); + } else { + // This click has been flaky in opening the legend, hence the this.retry. See + // https://github.com/elastic/kibana/issues/17468 + await this.testSubjects.click(`legend-${name}`); + } - public async getMarkdownText() { - const markdownContainer = await testSubjects.find('markdownBody'); - return markdownContainer.getVisibleText(); - } + await this.waitForVisualizationRenderingStabilized(); + // arbitrary color chosen, any available would do + const arbitraryColor = (await this.isNewLibraryChart(xyChartSelector)) + ? '#d36086' + : '#EF843C'; + const isOpen = await this.doesLegendColorChoiceExist(arbitraryColor); + if (!isOpen) { + throw new Error('legend color selector not open'); + } + }); + } - public async getMarkdownBodyDescendentText(selector: string) { - const markdownContainer = await testSubjects.find('markdownBody'); - const element = await find.descendantDisplayedByCssSelector(selector, markdownContainer); - return element.getVisibleText(); - } + public async filterOnTableCell(columnIndex: number, rowIndex: number) { + await this.retry.try(async () => { + const cell = await this.dataGrid.getCellElement(rowIndex, columnIndex); + await cell.click(); + const filterBtn = await this.testSubjects.findDescendant( + 'tbvChartCell__filterForCellValue', + cell + ); + await this.common.sleep(2000); + filterBtn.click(); + }); + } - // Table visualization + public async getMarkdownText() { + const markdownContainer = await this.testSubjects.find('markdownBody'); + return markdownContainer.getVisibleText(); + } - public async getTableVisNoResult() { - return await testSubjects.find('tbvChartContainer>visNoResult'); - } + public async getMarkdownBodyDescendentText(selector: string) { + const markdownContainer = await this.testSubjects.find('markdownBody'); + const element = await this.find.descendantDisplayedByCssSelector(selector, markdownContainer); + return element.getVisibleText(); + } - /** - * This function returns the text displayed in the Table Vis header - */ - public async getTableVisHeader() { - return await testSubjects.getVisibleText('dataGridHeader'); - } + // Table visualization - public async getFieldLinkInVisTable(fieldName: string, rowIndex: number = 1) { - const headers = await dataGrid.getHeaders(); - const fieldColumnIndex = headers.indexOf(fieldName); - const cell = await dataGrid.getCellElement(rowIndex, fieldColumnIndex + 1); - return await cell.findByTagName('a'); - } + public async getTableVisNoResult() { + return await this.testSubjects.find('tbvChartContainer>visNoResult'); + } - /** - * Function to retrieve data from within a table visualization. - */ - public async getTableVisContent({ stripEmptyRows = true } = {}) { - return await retry.try(async () => { - const container = await testSubjects.find('tbvChart'); - const allTables = await testSubjects.findAllDescendant('dataGridWrapper', container); - - if (allTables.length === 0) { - return []; - } - - const allData = await Promise.all( - allTables.map(async (t) => { - let data = await dataGrid.getDataFromElement(t, 'tbvChartCellContent'); - if (stripEmptyRows) { - data = data.filter( - (row) => row.length > 0 && row.some((cell) => cell.trim().length > 0) - ); - } - return data; - }) - ); + /** + * This function returns the text displayed in the Table Vis header + */ + public async getTableVisHeader() { + return await this.testSubjects.getVisibleText('dataGridHeader'); + } - if (allTables.length === 1) { - // If there was only one table we return only the data for that table - // This prevents an unnecessary array around that single table, which - // is the case we have in most tests. - return allData[0]; - } + public async getFieldLinkInVisTable(fieldName: string, rowIndex: number = 1) { + const headers = await this.dataGrid.getHeaders(); + const fieldColumnIndex = headers.indexOf(fieldName); + const cell = await this.dataGrid.getCellElement(rowIndex, fieldColumnIndex + 1); + return await cell.findByTagName('a'); + } - return allData; - }); - } + /** + * Function to retrieve data from within a table visualization. + */ + public async getTableVisContent({ stripEmptyRows = true } = {}) { + return await this.retry.try(async () => { + const container = await this.testSubjects.find('tbvChart'); + const allTables = await this.testSubjects.findAllDescendant('dataGridWrapper', container); - public async getMetric() { - const elements = await find.allByCssSelector( - '[data-test-subj="visualizationLoader"] .mtrVis__container' - ); - const values = await Promise.all( - elements.map(async (element) => { - const text = await element.getVisibleText(); - return text; - }) - ); - return values - .filter((item) => item.length > 0) - .reduce((arr: string[], item) => arr.concat(item.split('\n')), []); - } + if (allTables.length === 0) { + return []; + } - public async getGaugeValue() { - const elements = await find.allByCssSelector( - '[data-test-subj="visualizationLoader"] .chart svg text' - ); - const values = await Promise.all( - elements.map(async (element) => { - const text = await element.getVisibleText(); - return text; + const allData = await Promise.all( + allTables.map(async (t) => { + let data = await this.dataGrid.getDataFromElement(t, 'tbvChartCellContent'); + if (stripEmptyRows) { + data = data.filter( + (row) => row.length > 0 && row.some((cell) => cell.trim().length > 0) + ); + } + return data; }) ); - return values.filter((item) => item.length > 0); - } - public async getRightValueAxesCount() { - if (await this.isNewLibraryChart(xyChartSelector)) { - const yAxes = (await this.getEsChartDebugState(xyChartSelector))?.axes?.y ?? []; - return yAxes.filter(({ position }) => position === Position.Right).length; + if (allTables.length === 1) { + // If there was only one table we return only the data for that table + // This prevents an unnecessary array around that single table, which + // is the case we have in most tests. + return allData[0]; } - const axes = await find.allByCssSelector('.visAxis__column--right g.axis'); - return axes.length; - } - public async clickOnGaugeByLabel(label: string) { - const gauge = await testSubjects.find(`visGauge__meter--${label}`); - const gaugeSize = await gauge.getSize(); - const gaugeHeight = gaugeSize.height; - // To click at Gauge arc instead of the center of SVG element - // the offset for a click is calculated as half arc height without 1 pixel - const yOffset = 1 - Math.floor(gaugeHeight / 2); + return allData; + }); + } - await gauge.clickMouseButton({ xOffset: 0, yOffset }); - } + public async getMetric() { + const elements = await this.find.allByCssSelector( + '[data-test-subj="visualizationLoader"] .mtrVis__container' + ); + const values = await Promise.all( + elements.map(async (element) => { + const text = await element.getVisibleText(); + return text; + }) + ); + return values + .filter((item) => item.length > 0) + .reduce((arr: string[], item) => arr.concat(item.split('\n')), []); + } - public async getHistogramSeriesCount() { - if (await this.isNewLibraryChart(xyChartSelector)) { - const bars = (await this.getEsChartDebugState(xyChartSelector))?.bars ?? []; - return bars.filter(({ visible }) => visible).length; - } + public async getGaugeValue() { + const elements = await this.find.allByCssSelector( + '[data-test-subj="visualizationLoader"] .chart svg text' + ); + const values = await Promise.all( + elements.map(async (element) => { + const text = await element.getVisibleText(); + return text; + }) + ); + return values.filter((item) => item.length > 0); + } - const series = await find.allByCssSelector('.series.histogram'); - return series.length; + public async getRightValueAxesCount() { + if (await this.isNewLibraryChart(xyChartSelector)) { + const yAxes = (await this.getEsChartDebugState(xyChartSelector))?.axes?.y ?? []; + return yAxes.filter(({ position }) => position === Position.Right).length; } + const axes = await this.find.allByCssSelector('.visAxis__column--right g.axis'); + return axes.length; + } - public async getGridLines(): Promise> { - if (await this.isNewLibraryChart(xyChartSelector)) { - const { x, y } = (await this.getEsChartDebugState(xyChartSelector))?.axes ?? { - x: [], - y: [], - }; - return [...x, ...y].flatMap(({ gridlines }) => gridlines); - } + public async clickOnGaugeByLabel(label: string) { + const gauge = await this.testSubjects.find(`visGauge__meter--${label}`); + const gaugeSize = await gauge.getSize(); + const gaugeHeight = gaugeSize.height; + // To click at Gauge arc instead of the center of SVG element + // the offset for a click is calculated as half arc height without 1 pixel + const yOffset = 1 - Math.floor(gaugeHeight / 2); - const grid = await find.byCssSelector('g.grid'); - const $ = await grid.parseDomContent(); - return $('path') - .toArray() - .map((line) => { - const dAttribute = $(line).attr('d'); - const firstPoint = dAttribute.split('L')[0].replace('M', '').split(','); - return { - x: parseFloat(firstPoint[0]), - y: parseFloat(firstPoint[1]), - }; - }); + await gauge.clickMouseButton({ xOffset: 0, yOffset }); + } + + public async getHistogramSeriesCount() { + if (await this.isNewLibraryChart(xyChartSelector)) { + const bars = (await this.getEsChartDebugState(xyChartSelector))?.bars ?? []; + return bars.filter(({ visible }) => visible).length; } - public async getChartValues() { - if (await this.isNewLibraryChart(xyChartSelector)) { - const barSeries = (await this.getEsChartDebugState(xyChartSelector))?.bars ?? []; - return barSeries.filter(({ visible }) => visible).flatMap((bars) => bars.labels); - } + const series = await this.find.allByCssSelector('.series.histogram'); + return series.length; + } - const elements = await find.allByCssSelector('.series.histogram text'); - const values = await Promise.all( - elements.map(async (element) => { - const text = await element.getVisibleText(); - return text; - }) - ); - return values; - } + public async getGridLines(): Promise> { + if (await this.isNewLibraryChart(xyChartSelector)) { + const { x, y } = (await this.getEsChartDebugState(xyChartSelector))?.axes ?? { + x: [], + y: [], + }; + return [...x, ...y].flatMap(({ gridlines }) => gridlines); + } + + const grid = await this.find.byCssSelector('g.grid'); + const $ = await grid.parseDomContent(); + return $('path') + .toArray() + .map((line) => { + const dAttribute = $(line).attr('d'); + const firstPoint = dAttribute.split('L')[0].replace('M', '').split(','); + return { + x: parseFloat(firstPoint[0]), + y: parseFloat(firstPoint[1]), + }; + }); } - return new VisualizeChart(); + public async getChartValues() { + if (await this.isNewLibraryChart(xyChartSelector)) { + const barSeries = (await this.getEsChartDebugState(xyChartSelector))?.bars ?? []; + return barSeries.filter(({ visible }) => visible).flatMap((bars) => bars.labels); + } + + const elements = await this.find.allByCssSelector('.series.histogram text'); + const values = await Promise.all( + elements.map(async (element) => { + const text = await element.getVisibleText(); + return text; + }) + ); + return values; + } } diff --git a/test/functional/page_objects/visualize_editor_page.ts b/test/functional/page_objects/visualize_editor_page.ts index d311f752fd4907..ab458c2c0fdc12 100644 --- a/test/functional/page_objects/visualize_editor_page.ts +++ b/test/functional/page_objects/visualize_editor_page.ts @@ -7,535 +7,529 @@ */ import expect from '@kbn/expect'; -import { FtrProviderContext } from '../ftr_provider_context'; - -export function VisualizeEditorPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const find = getService('find'); - const log = getService('log'); - const retry = getService('retry'); - const browser = getService('browser'); - const testSubjects = getService('testSubjects'); - const comboBox = getService('comboBox'); - const elasticChart = getService('elasticChart'); - const { common, header, visChart } = getPageObjects(['common', 'header', 'visChart']); - - interface IntervalOptions { - type?: 'default' | 'numeric' | 'custom'; - aggNth?: number; - append?: boolean; - } - - class VisualizeEditorPage { - public async clickDataTab() { - await testSubjects.click('visEditorTab__data'); - } +import { FtrService } from '../ftr_provider_context'; - public async clickOptionsTab() { - await testSubjects.click('visEditorTab__options'); - } +interface IntervalOptions { + type?: 'default' | 'numeric' | 'custom'; + aggNth?: number; + append?: boolean; +} - public async clickMetricsAndAxes() { - await testSubjects.click('visEditorTab__advanced'); - } +export class VisualizeEditorPageObject extends FtrService { + private readonly find = this.ctx.getService('find'); + private readonly log = this.ctx.getService('log'); + private readonly retry = this.ctx.getService('retry'); + private readonly browser = this.ctx.getService('browser'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly comboBox = this.ctx.getService('comboBox'); + private readonly elasticChart = this.ctx.getService('elasticChart'); + private readonly common = this.ctx.getPageObject('common'); + private readonly header = this.ctx.getPageObject('header'); + private readonly visChart = this.ctx.getPageObject('visChart'); + + public async clickDataTab() { + await this.testSubjects.click('visEditorTab__data'); + } - public async clickVisEditorTab(tabName: string) { - await testSubjects.click(`visEditorTab__${tabName}`); - await header.waitUntilLoadingHasFinished(); - } + public async clickOptionsTab() { + await this.testSubjects.click('visEditorTab__options'); + } - public async addInputControl(type?: string) { - if (type) { - const selectInput = await testSubjects.find('selectControlType'); - await selectInput.type(type); - } - await testSubjects.click('inputControlEditorAddBtn'); - await header.waitUntilLoadingHasFinished(); - } + public async clickMetricsAndAxes() { + await this.testSubjects.click('visEditorTab__advanced'); + } - public async inputControlClear() { - await testSubjects.click('inputControlClearBtn'); - await header.waitUntilLoadingHasFinished(); - } + public async clickVisEditorTab(tabName: string) { + await this.testSubjects.click(`visEditorTab__${tabName}`); + await this.header.waitUntilLoadingHasFinished(); + } - public async inputControlSubmit() { - await testSubjects.clickWhenNotDisabled('inputControlSubmitBtn'); - await visChart.waitForVisualizationRenderingStabilized(); + public async addInputControl(type?: string) { + if (type) { + const selectInput = await this.testSubjects.find('selectControlType'); + await selectInput.type(type); } + await this.testSubjects.click('inputControlEditorAddBtn'); + await this.header.waitUntilLoadingHasFinished(); + } - public async clickGo() { - if (await visChart.isNewChartsLibraryEnabled()) { - await elasticChart.setNewChartUiDebugFlag(); - } + public async inputControlClear() { + await this.testSubjects.click('inputControlClearBtn'); + await this.header.waitUntilLoadingHasFinished(); + } - const prevRenderingCount = await visChart.getVisualizationRenderingCount(); - log.debug(`Before Rendering count ${prevRenderingCount}`); - await testSubjects.clickWhenNotDisabled('visualizeEditorRenderButton'); - await visChart.waitForRenderingCount(prevRenderingCount + 1); - } + public async inputControlSubmit() { + await this.testSubjects.clickWhenNotDisabled('inputControlSubmitBtn'); + await this.visChart.waitForVisualizationRenderingStabilized(); + } - public async removeDimension(aggNth: number) { - await testSubjects.click(`visEditorAggAccordion${aggNth} > removeDimensionBtn`); + public async clickGo() { + if (await this.visChart.isNewChartsLibraryEnabled()) { + await this.elasticChart.setNewChartUiDebugFlag(); } - public async setFilterParams(aggNth: number, indexPattern: string, field: string) { - await comboBox.set(`indexPatternSelect-${aggNth}`, indexPattern); - await comboBox.set(`fieldSelect-${aggNth}`, field); - } + const prevRenderingCount = await this.visChart.getVisualizationRenderingCount(); + this.log.debug(`Before Rendering count ${prevRenderingCount}`); + await this.testSubjects.clickWhenNotDisabled('visualizeEditorRenderButton'); + await this.visChart.waitForRenderingCount(prevRenderingCount + 1); + } - public async setFilterRange(aggNth: number, min: string, max: string) { - const control = await testSubjects.find(`inputControl${aggNth}`); - const inputMin = await control.findByCssSelector('[name$="minValue"]'); - await inputMin.type(min); - const inputMax = await control.findByCssSelector('[name$="maxValue"]'); - await inputMax.type(max); - } + public async removeDimension(aggNth: number) { + await this.testSubjects.click(`visEditorAggAccordion${aggNth} > removeDimensionBtn`); + } - public async clickSplitDirection(direction: string) { - const radioBtn = await find.byCssSelector(`[data-test-subj="visEditorSplitBy-${direction}"]`); - await radioBtn.click(); - } + public async setFilterParams(aggNth: number, indexPattern: string, field: string) { + await this.comboBox.set(`indexPatternSelect-${aggNth}`, indexPattern); + await this.comboBox.set(`fieldSelect-${aggNth}`, field); + } - public async clickAddDateRange() { - await testSubjects.click(`visEditorAddDateRange`); - } + public async setFilterRange(aggNth: number, min: string, max: string) { + const control = await this.testSubjects.find(`inputControl${aggNth}`); + const inputMin = await control.findByCssSelector('[name$="minValue"]'); + await inputMin.type(min); + const inputMax = await control.findByCssSelector('[name$="maxValue"]'); + await inputMax.type(max); + } - public async setDateRangeByIndex(index: string, from: string, to: string) { - await testSubjects.setValue(`visEditorDateRange${index}__from`, from); - await testSubjects.setValue(`visEditorDateRange${index}__to`, to); - } + public async clickSplitDirection(direction: string) { + const radioBtn = await this.find.byCssSelector( + `[data-test-subj="visEditorSplitBy-${direction}"]` + ); + await radioBtn.click(); + } - /** - * Adds new bucket - * @param bucketName bucket name, like 'X-axis', 'Split rows', 'Split series' - * @param type aggregation type, like 'buckets', 'metrics' - */ - public async clickBucket(bucketName: string, type = 'buckets') { - await testSubjects.click(`visEditorAdd_${type}`); - await testSubjects.click(`visEditorAdd_${type}_${bucketName}`); - } + public async clickAddDateRange() { + await this.testSubjects.click(`visEditorAddDateRange`); + } - public async clickEnableCustomRanges() { - await testSubjects.click('heatmapUseCustomRanges'); - } + public async setDateRangeByIndex(index: string, from: string, to: string) { + await this.testSubjects.setValue(`visEditorDateRange${index}__from`, from); + await this.testSubjects.setValue(`visEditorDateRange${index}__to`, to); + } - public async clickAddRange() { - await testSubjects.click(`heatmapColorRange__addRangeButton`); - } + /** + * Adds new bucket + * @param bucketName bucket name, like 'X-axis', 'Split rows', 'Split series' + * @param type aggregation type, like 'buckets', 'metrics' + */ + public async clickBucket(bucketName: string, type = 'buckets') { + await this.testSubjects.click(`visEditorAdd_${type}`); + await this.testSubjects.click(`visEditorAdd_${type}_${bucketName}`); + } - public async setCustomRangeByIndex(index: string | number, from: string, to: string) { - await testSubjects.setValue(`heatmapColorRange${index}__from`, from); - await testSubjects.setValue(`heatmapColorRange${index}__to`, to); - } + public async clickEnableCustomRanges() { + await this.testSubjects.click('heatmapUseCustomRanges'); + } - public async changeHeatmapColorNumbers(value = 6) { - await testSubjects.setValue('heatmapColorsNumber', `${value}`); - } + public async clickAddRange() { + await this.testSubjects.click(`heatmapColorRange__addRangeButton`); + } - public async getBucketErrorMessage() { - const error = await find.byCssSelector( - '[data-test-subj="bucketsAggGroup"] [data-test-subj="defaultEditorAggSelect"] + .euiFormErrorText' - ); - const errorMessage = await error.getAttribute('innerText'); - log.debug(errorMessage); - return errorMessage; - } + public async setCustomRangeByIndex(index: string | number, from: string, to: string) { + await this.testSubjects.setValue(`heatmapColorRange${index}__from`, from); + await this.testSubjects.setValue(`heatmapColorRange${index}__to`, to); + } - public async addNewFilterAggregation() { - await testSubjects.click('visEditorAddFilterButton'); - } + public async changeHeatmapColorNumbers(value = 6) { + await this.testSubjects.setValue('heatmapColorsNumber', `${value}`); + } - public async selectField( - fieldValue: string, - groupName = 'buckets', - isChildAggregation = false - ) { - log.debug(`selectField ${fieldValue}`); - const selector = ` - [data-test-subj="${groupName}AggGroup"] - [data-test-subj^="visEditorAggAccordion"].euiAccordion-isOpen - [data-test-subj="visAggEditorParams"] - ${isChildAggregation ? '.visEditorAgg__subAgg' : ''} - [data-test-subj="visDefaultEditorField"] - `; - const fieldEl = await find.byCssSelector(selector); - await comboBox.setElement(fieldEl, fieldValue); - } + public async getBucketErrorMessage() { + const error = await this.find.byCssSelector( + '[data-test-subj="bucketsAggGroup"] [data-test-subj="defaultEditorAggSelect"] + .euiFormErrorText' + ); + const errorMessage = await error.getAttribute('innerText'); + this.log.debug(errorMessage); + return errorMessage; + } - public async selectOrderByMetric(aggNth: number, metric: string) { - const sortSelect = await testSubjects.find(`visEditorOrderBy${aggNth}`); - const sortMetric = await sortSelect.findByCssSelector(`option[value="${metric}"]`); - await sortMetric.click(); - } + public async addNewFilterAggregation() { + await this.testSubjects.click('visEditorAddFilterButton'); + } - public async selectCustomSortMetric(aggNth: number, metric: string, field: string) { - await this.selectOrderByMetric(aggNth, 'custom'); - await this.selectAggregation(metric, 'buckets', true); - await this.selectField(field, 'buckets', true); - } + public async selectField(fieldValue: string, groupName = 'buckets', isChildAggregation = false) { + this.log.debug(`selectField ${fieldValue}`); + const selector = ` + [data-test-subj="${groupName}AggGroup"] + [data-test-subj^="visEditorAggAccordion"].euiAccordion-isOpen + [data-test-subj="visAggEditorParams"] + ${isChildAggregation ? '.visEditorAgg__subAgg' : ''} + [data-test-subj="visDefaultEditorField"] + `; + const fieldEl = await this.find.byCssSelector(selector); + await this.comboBox.setElement(fieldEl, fieldValue); + } - public async selectAggregation( - aggValue: string, - groupName = 'buckets', - isChildAggregation = false - ) { - const comboBoxElement = await find.byCssSelector(` - [data-test-subj="${groupName}AggGroup"] - [data-test-subj^="visEditorAggAccordion"].euiAccordion-isOpen - ${isChildAggregation ? '.visEditorAgg__subAgg' : ''} - [data-test-subj="defaultEditorAggSelect"] - `); - - await comboBox.setElement(comboBoxElement, aggValue); - await common.sleep(500); - } + public async selectOrderByMetric(aggNth: number, metric: string) { + const sortSelect = await this.testSubjects.find(`visEditorOrderBy${aggNth}`); + const sortMetric = await sortSelect.findByCssSelector(`option[value="${metric}"]`); + await sortMetric.click(); + } - /** - * Set the test for a filter aggregation. - * @param {*} filterValue the string value of the filter - * @param {*} filterIndex used when multiple filters are configured on the same aggregation - * @param {*} aggregationId the ID if the aggregation. On Tests, it start at from 2 - */ - public async setFilterAggregationValue( - filterValue: string, - filterIndex = 0, - aggregationId = 2 - ) { - await testSubjects.setValue( - `visEditorFilterInput_${aggregationId}_${filterIndex}`, - filterValue - ); - } + public async selectCustomSortMetric(aggNth: number, metric: string, field: string) { + await this.selectOrderByMetric(aggNth, 'custom'); + await this.selectAggregation(metric, 'buckets', true); + await this.selectField(field, 'buckets', true); + } - public async setValue(newValue: string) { - const input = await find.byCssSelector('[data-test-subj="visEditorPercentileRanks"] input'); - await input.clearValue(); - await input.type(newValue); - } + public async selectAggregation( + aggValue: string, + groupName = 'buckets', + isChildAggregation = false + ) { + const comboBoxElement = await this.find.byCssSelector(` + [data-test-subj="${groupName}AggGroup"] + [data-test-subj^="visEditorAggAccordion"].euiAccordion-isOpen + ${isChildAggregation ? '.visEditorAgg__subAgg' : ''} + [data-test-subj="defaultEditorAggSelect"] + `); + + await this.comboBox.setElement(comboBoxElement, aggValue); + await this.common.sleep(500); + } - public async clickEditorSidebarCollapse() { - await testSubjects.click('collapseSideBarButton'); - } + /** + * Set the test for a filter aggregation. + * @param {*} filterValue the string value of the filter + * @param {*} filterIndex used when multiple filters are configured on the same aggregation + * @param {*} aggregationId the ID if the aggregation. On Tests, it start at from 2 + */ + public async setFilterAggregationValue(filterValue: string, filterIndex = 0, aggregationId = 2) { + await this.testSubjects.setValue( + `visEditorFilterInput_${aggregationId}_${filterIndex}`, + filterValue + ); + } - public async clickDropPartialBuckets() { - await testSubjects.click('dropPartialBucketsCheckbox'); - } + public async setValue(newValue: string) { + const input = await this.find.byCssSelector( + '[data-test-subj="visEditorPercentileRanks"] input' + ); + await input.clearValue(); + await input.type(newValue); + } - public async expectMarkdownTextArea() { - await testSubjects.existOrFail('markdownTextarea'); - } + public async clickEditorSidebarCollapse() { + await this.testSubjects.click('collapseSideBarButton'); + } - public async setMarkdownTxt(markdownTxt: string) { - const input = await testSubjects.find('markdownTextarea'); - await input.clearValue(); - await input.type(markdownTxt); - } + public async clickDropPartialBuckets() { + await this.testSubjects.click('dropPartialBucketsCheckbox'); + } - public async isSwitchChecked(selector: string) { - const checkbox = await testSubjects.find(selector); - const isChecked = await checkbox.getAttribute('aria-checked'); - return isChecked === 'true'; - } + public async expectMarkdownTextArea() { + await this.testSubjects.existOrFail('markdownTextarea'); + } - public async checkSwitch(selector: string) { - const isChecked = await this.isSwitchChecked(selector); - if (!isChecked) { - log.debug(`checking switch ${selector}`); - await testSubjects.click(selector); - } - } + public async setMarkdownTxt(markdownTxt: string) { + const input = await this.testSubjects.find('markdownTextarea'); + await input.clearValue(); + await input.type(markdownTxt); + } - public async uncheckSwitch(selector: string) { - const isChecked = await this.isSwitchChecked(selector); - if (isChecked) { - log.debug(`unchecking switch ${selector}`); - await testSubjects.click(selector); - } - } + public async isSwitchChecked(selector: string) { + const checkbox = await this.testSubjects.find(selector); + const isChecked = await checkbox.getAttribute('aria-checked'); + return isChecked === 'true'; + } - public async setIsFilteredByCollarCheckbox(value = true) { - await retry.try(async () => { - const isChecked = await this.isSwitchChecked('isFilteredByCollarCheckbox'); - if (isChecked !== value) { - await testSubjects.click('isFilteredByCollarCheckbox'); - throw new Error('isFilteredByCollar not set correctly'); - } - }); + public async checkSwitch(selector: string) { + const isChecked = await this.isSwitchChecked(selector); + if (!isChecked) { + this.log.debug(`checking switch ${selector}`); + await this.testSubjects.click(selector); } + } - public async setCustomLabel(label: string, index: number | string = 1) { - const customLabel = await testSubjects.find(`visEditorStringInput${index}customLabel`); - customLabel.type(label); + public async uncheckSwitch(selector: string) { + const isChecked = await this.isSwitchChecked(selector); + if (isChecked) { + this.log.debug(`unchecking switch ${selector}`); + await this.testSubjects.click(selector); } + } - public async selectYAxisAggregation(agg: string, field: string, label: string, index = 1) { - // index starts on the first "count" metric at 1 - // Each new metric or aggregation added to a visualization gets the next index. - // So to modify a metric or aggregation tests need to keep track of the - // order they are added. - await this.toggleOpenEditor(index); + public async setIsFilteredByCollarCheckbox(value = true) { + await this.retry.try(async () => { + const isChecked = await this.isSwitchChecked('isFilteredByCollarCheckbox'); + if (isChecked !== value) { + await this.testSubjects.click('isFilteredByCollarCheckbox'); + throw new Error('isFilteredByCollar not set correctly'); + } + }); + } - // select our agg - const aggSelect = await find.byCssSelector( - `#visEditorAggAccordion${index} [data-test-subj="defaultEditorAggSelect"]` - ); - await comboBox.setElement(aggSelect, agg); + public async setCustomLabel(label: string, index: number | string = 1) { + const customLabel = await this.testSubjects.find(`visEditorStringInput${index}customLabel`); + customLabel.type(label); + } - const fieldSelect = await find.byCssSelector( - `#visEditorAggAccordion${index} [data-test-subj="visDefaultEditorField"]` - ); - // select our field - await comboBox.setElement(fieldSelect, field); - // enter custom label - await this.setCustomLabel(label, index); - } + public async selectYAxisAggregation(agg: string, field: string, label: string, index = 1) { + // index starts on the first "count" metric at 1 + // Each new metric or aggregation added to a visualization gets the next index. + // So to modify a metric or aggregation tests need to keep track of the + // order they are added. + await this.toggleOpenEditor(index); + + // select our agg + const aggSelect = await this.find.byCssSelector( + `#visEditorAggAccordion${index} [data-test-subj="defaultEditorAggSelect"]` + ); + await this.comboBox.setElement(aggSelect, agg); + + const fieldSelect = await this.find.byCssSelector( + `#visEditorAggAccordion${index} [data-test-subj="visDefaultEditorField"]` + ); + // select our field + await this.comboBox.setElement(fieldSelect, field); + // enter custom label + await this.setCustomLabel(label, index); + } - public async getField() { - return await comboBox.getComboBoxSelectedOptions('visDefaultEditorField'); - } + public async getField() { + return await this.comboBox.getComboBoxSelectedOptions('visDefaultEditorField'); + } - public async sizeUpEditor() { - const resizerPanel = await testSubjects.find('euiResizableButton'); - // Drag panel 100 px left - await browser.dragAndDrop({ location: resizerPanel }, { location: { x: -100, y: 0 } }); - } + public async sizeUpEditor() { + const resizerPanel = await this.testSubjects.find('euiResizableButton'); + // Drag panel 100 px left + await this.browser.dragAndDrop({ location: resizerPanel }, { location: { x: -100, y: 0 } }); + } - public async toggleDisabledAgg(agg: string | number) { - await testSubjects.click(`visEditorAggAccordion${agg} > ~toggleDisableAggregationBtn`); - await header.waitUntilLoadingHasFinished(); - } + public async toggleDisabledAgg(agg: string | number) { + await this.testSubjects.click(`visEditorAggAccordion${agg} > ~toggleDisableAggregationBtn`); + await this.header.waitUntilLoadingHasFinished(); + } - public async toggleAggregationEditor(agg: string | number) { - await find.clickByCssSelector( - `[data-test-subj="visEditorAggAccordion${agg}"] .euiAccordion__button` - ); - await header.waitUntilLoadingHasFinished(); - } + public async toggleAggregationEditor(agg: string | number) { + await this.find.clickByCssSelector( + `[data-test-subj="visEditorAggAccordion${agg}"] .euiAccordion__button` + ); + await this.header.waitUntilLoadingHasFinished(); + } - public async toggleOtherBucket(agg: string | number = 2) { - await testSubjects.click(`visEditorAggAccordion${agg} > otherBucketSwitch`); - } + public async toggleOtherBucket(agg: string | number = 2) { + await this.testSubjects.click(`visEditorAggAccordion${agg} > otherBucketSwitch`); + } - public async toggleMissingBucket(agg: string | number = 2) { - await testSubjects.click(`visEditorAggAccordion${agg} > missingBucketSwitch`); - } + public async toggleMissingBucket(agg: string | number = 2) { + await this.testSubjects.click(`visEditorAggAccordion${agg} > missingBucketSwitch`); + } - public async toggleScaleMetrics() { - await testSubjects.click('scaleMetricsSwitch'); - } + public async toggleScaleMetrics() { + await this.testSubjects.click('scaleMetricsSwitch'); + } - public async toggleAutoMode() { - await testSubjects.click('visualizeEditorAutoButton'); - } + public async toggleAutoMode() { + await this.testSubjects.click('visualizeEditorAutoButton'); + } - public async togglePieLegend() { - await testSubjects.click('visTypePieAddLegendSwitch'); - } + public async togglePieLegend() { + await this.testSubjects.click('visTypePieAddLegendSwitch'); + } - public async togglePieNestedLegend() { - await testSubjects.click('visTypePieNestedLegendSwitch'); - } + public async togglePieNestedLegend() { + await this.testSubjects.click('visTypePieNestedLegendSwitch'); + } - public async isApplyEnabled() { - const applyButton = await testSubjects.find('visualizeEditorRenderButton'); - return await applyButton.isEnabled(); - } + public async isApplyEnabled() { + const applyButton = await this.testSubjects.find('visualizeEditorRenderButton'); + return await applyButton.isEnabled(); + } - public async toggleAccordion(id: string, toState = 'true') { - const toggle = await find.byCssSelector(`button[aria-controls="${id}"]`); - const toggleOpen = await toggle.getAttribute('aria-expanded'); - log.debug(`toggle ${id} expand = ${toggleOpen}`); - if (toggleOpen !== toState) { - log.debug(`toggle ${id} click()`); - await toggle.click(); - } + public async toggleAccordion(id: string, toState = 'true') { + const toggle = await this.find.byCssSelector(`button[aria-controls="${id}"]`); + const toggleOpen = await toggle.getAttribute('aria-expanded'); + this.log.debug(`toggle ${id} expand = ${toggleOpen}`); + if (toggleOpen !== toState) { + this.log.debug(`toggle ${id} click()`); + await toggle.click(); } + } - public async toggleOpenEditor(index: number, toState = 'true') { - // index, see selectYAxisAggregation - await this.toggleAccordion(`visEditorAggAccordion${index}`, toState); - } + public async toggleOpenEditor(index: number, toState = 'true') { + // index, see selectYAxisAggregation + await this.toggleAccordion(`visEditorAggAccordion${index}`, toState); + } - public async toggleAdvancedParams(aggId: string) { - const accordion = await testSubjects.find(`advancedParams-${aggId}`); - const accordionButton = await find.descendantDisplayedByCssSelector('button', accordion); - await accordionButton.click(); - } + public async toggleAdvancedParams(aggId: string) { + const accordion = await this.testSubjects.find(`advancedParams-${aggId}`); + const accordionButton = await this.find.descendantDisplayedByCssSelector('button', accordion); + await accordionButton.click(); + } - public async inputValueInCodeEditor(value: string) { - const codeEditor = await find.byCssSelector('.react-monaco-editor-container'); - const textarea = await codeEditor.findByClassName('monaco-mouse-cursor-text'); + public async inputValueInCodeEditor(value: string) { + const codeEditor = await this.find.byCssSelector('.react-monaco-editor-container'); + const textarea = await codeEditor.findByClassName('monaco-mouse-cursor-text'); - await textarea.click(); - await browser.pressKeys(value); - } + await textarea.click(); + await this.browser.pressKeys(value); + } - public async clickReset() { - await testSubjects.click('visualizeEditorResetButton'); - await visChart.waitForVisualization(); - } + public async clickReset() { + await this.testSubjects.click('visualizeEditorResetButton'); + await this.visChart.waitForVisualization(); + } - public async clickYAxisOptions(axisId: string) { - await testSubjects.click(`toggleYAxisOptions-${axisId}`); - } + public async clickYAxisOptions(axisId: string) { + await this.testSubjects.click(`toggleYAxisOptions-${axisId}`); + } - public async changeYAxisShowCheckbox(axisId: string, enabled: boolean) { - const selector = `valueAxisShow-${axisId}`; - const button = await testSubjects.find(selector); - const isEnabled = (await button.getAttribute('aria-checked')) === 'true'; - if (enabled !== isEnabled) { - await button.click(); - } + public async changeYAxisShowCheckbox(axisId: string, enabled: boolean) { + const selector = `valueAxisShow-${axisId}`; + const button = await this.testSubjects.find(selector); + const isEnabled = (await button.getAttribute('aria-checked')) === 'true'; + if (enabled !== isEnabled) { + await button.click(); } + } - public async changeYAxisFilterLabelsCheckbox(axisId: string, enabled: boolean) { - const selector = `yAxisFilterLabelsCheckbox-${axisId}`; - const button = await testSubjects.find(selector); - const isEnabled = (await button.getAttribute('aria-checked')) === 'true'; - if (enabled !== isEnabled) { - await button.click(); - } + public async changeYAxisFilterLabelsCheckbox(axisId: string, enabled: boolean) { + const selector = `yAxisFilterLabelsCheckbox-${axisId}`; + const button = await this.testSubjects.find(selector); + const isEnabled = (await button.getAttribute('aria-checked')) === 'true'; + if (enabled !== isEnabled) { + await button.click(); } + } - public async setSize(newValue: number, aggId?: number) { - const dataTestSubj = aggId - ? `visEditorAggAccordion${aggId} > sizeParamEditor` - : 'sizeParamEditor'; - await testSubjects.setValue(dataTestSubj, String(newValue)); - } + public async setSize(newValue: number, aggId?: number) { + const dataTestSubj = aggId + ? `visEditorAggAccordion${aggId} > sizeParamEditor` + : 'sizeParamEditor'; + await this.testSubjects.setValue(dataTestSubj, String(newValue)); + } - public async selectChartMode(mode: string) { - const selector = await find.byCssSelector(`#seriesMode0 > option[value="${mode}"]`); - await selector.click(); - } + public async selectChartMode(mode: string) { + const selector = await this.find.byCssSelector(`#seriesMode0 > option[value="${mode}"]`); + await selector.click(); + } - public async selectYAxisScaleType(axisId: string, scaleType: string) { - const selector = await find.byCssSelector( - `#scaleSelectYAxis-${axisId} > option[value="${scaleType}"]` - ); - await selector.click(); - } + public async selectYAxisScaleType(axisId: string, scaleType: string) { + const selector = await this.find.byCssSelector( + `#scaleSelectYAxis-${axisId} > option[value="${scaleType}"]` + ); + await selector.click(); + } - public async selectXAxisPosition(position: string) { - const option = await (await testSubjects.find('categoryAxisPosition')).findByCssSelector( - `option[value="${position}"]` - ); - await option.click(); - } + public async selectXAxisPosition(position: string) { + const option = await (await this.testSubjects.find('categoryAxisPosition')).findByCssSelector( + `option[value="${position}"]` + ); + await option.click(); + } - public async selectYAxisMode(mode: string) { - const selector = await find.byCssSelector(`#valueAxisMode0 > option[value="${mode}"]`); - await selector.click(); - } + public async selectYAxisMode(mode: string) { + const selector = await this.find.byCssSelector(`#valueAxisMode0 > option[value="${mode}"]`); + await selector.click(); + } - public async setAxisExtents(min: string, max: string, axisId = 'ValueAxis-1') { - await this.toggleAccordion(`yAxisAccordion${axisId}`); - await this.toggleAccordion(`yAxisOptionsAccordion${axisId}`); + public async setAxisExtents(min: string, max: string, axisId = 'ValueAxis-1') { + await this.toggleAccordion(`yAxisAccordion${axisId}`); + await this.toggleAccordion(`yAxisOptionsAccordion${axisId}`); - await testSubjects.click('yAxisSetYExtents'); - await testSubjects.setValue('yAxisYExtentsMax', max); - await testSubjects.setValue('yAxisYExtentsMin', min); - } + await this.testSubjects.click('yAxisSetYExtents'); + await this.testSubjects.setValue('yAxisYExtentsMax', max); + await this.testSubjects.setValue('yAxisYExtentsMin', min); + } - public async selectAggregateWith(fieldValue: string) { - await testSubjects.selectValue('visDefaultEditorAggregateWith', fieldValue); - } + public async selectAggregateWith(fieldValue: string) { + await this.testSubjects.selectValue('visDefaultEditorAggregateWith', fieldValue); + } - public async setInterval(newValue: string | number, options: IntervalOptions = {}) { - const newValueString = `${newValue}`; - const { type = 'default', aggNth = 2, append = false } = options; - log.debug(`visEditor.setInterval(${newValueString}, {${type}, ${aggNth}, ${append}})`); - if (type === 'default') { - await comboBox.set('visEditorInterval', newValueString); - } else if (type === 'custom') { - await comboBox.setCustom('visEditorInterval', newValueString); - } else { - if (type === 'numeric') { - const autoMode = await testSubjects.getAttribute( - `visEditorIntervalSwitch${aggNth}`, - 'aria-checked' - ); - if (autoMode === 'true') { - await testSubjects.click(`visEditorIntervalSwitch${aggNth}`); - } - } - if (append) { - await testSubjects.append(`visEditorInterval${aggNth}`, String(newValueString)); - } else { - await testSubjects.setValue(`visEditorInterval${aggNth}`, String(newValueString)); + public async setInterval(newValue: string | number, options: IntervalOptions = {}) { + const newValueString = `${newValue}`; + const { type = 'default', aggNth = 2, append = false } = options; + this.log.debug(`visEditor.setInterval(${newValueString}, {${type}, ${aggNth}, ${append}})`); + if (type === 'default') { + await this.comboBox.set('visEditorInterval', newValueString); + } else if (type === 'custom') { + await this.comboBox.setCustom('visEditorInterval', newValueString); + } else { + if (type === 'numeric') { + const autoMode = await this.testSubjects.getAttribute( + `visEditorIntervalSwitch${aggNth}`, + 'aria-checked' + ); + if (autoMode === 'true') { + await this.testSubjects.click(`visEditorIntervalSwitch${aggNth}`); } } + if (append) { + await this.testSubjects.append(`visEditorInterval${aggNth}`, String(newValueString)); + } else { + await this.testSubjects.setValue(`visEditorInterval${aggNth}`, String(newValueString)); + } } + } - public async getInterval() { - return await comboBox.getComboBoxSelectedOptions('visEditorInterval'); - } + public async getInterval() { + return await this.comboBox.getComboBoxSelectedOptions('visEditorInterval'); + } - public async getNumericInterval(aggNth = 2) { - return await testSubjects.getAttribute(`visEditorInterval${aggNth}`, 'value'); - } + public async getNumericInterval(aggNth = 2) { + return await this.testSubjects.getAttribute(`visEditorInterval${aggNth}`, 'value'); + } - public async clickMetricEditor() { - await find.clickByCssSelector('[data-test-subj="metricsAggGroup"] .euiAccordion__button'); - } + public async clickMetricEditor() { + await this.find.clickByCssSelector('[data-test-subj="metricsAggGroup"] .euiAccordion__button'); + } - public async clickMetricByIndex(index: number) { - const metrics = await find.allByCssSelector( - '[data-test-subj="visualizationLoader"] .mtrVis .mtrVis__container' - ); - expect(metrics.length).greaterThan(index); - await metrics[index].click(); - } + public async clickMetricByIndex(index: number) { + const metrics = await this.find.allByCssSelector( + '[data-test-subj="visualizationLoader"] .mtrVis .mtrVis__container' + ); + expect(metrics.length).greaterThan(index); + await metrics[index].click(); + } - public async setSelectByOptionText(selectId: string, optionText: string) { - const selectField = await find.byCssSelector(`#${selectId}`); - const options = await find.allByCssSelector(`#${selectId} > option`); - const $ = await selectField.parseDomContent(); - const optionsText = $('option') - .toArray() - .map((option) => $(option).text()); - const optionIndex = optionsText.indexOf(optionText); - - if (optionIndex === -1) { - throw new Error( - `Unable to find option '${optionText}' in select ${selectId}. Available options: ${optionsText.join( - ',' - )}` - ); - } - await options[optionIndex].click(); + public async setSelectByOptionText(selectId: string, optionText: string) { + const selectField = await this.find.byCssSelector(`#${selectId}`); + const options = await this.find.allByCssSelector(`#${selectId} > option`); + const $ = await selectField.parseDomContent(); + const optionsText = $('option') + .toArray() + .map((option) => $(option).text()); + const optionIndex = optionsText.indexOf(optionText); + + if (optionIndex === -1) { + throw new Error( + `Unable to find option '${optionText}' in select ${selectId}. Available options: ${optionsText.join( + ',' + )}` + ); } + await options[optionIndex].click(); + } - // point series - - async clickAddAxis() { - return await testSubjects.click('visualizeAddYAxisButton'); - } + // point series - async setAxisTitle(title: string, aggNth = 0) { - return await testSubjects.setValue(`valueAxisTitle${aggNth}`, title); - } + async clickAddAxis() { + return await this.testSubjects.click('visualizeAddYAxisButton'); + } - public async toggleGridCategoryLines() { - return await testSubjects.click('showCategoryLines'); - } + async setAxisTitle(title: string, aggNth = 0) { + return await this.testSubjects.setValue(`valueAxisTitle${aggNth}`, title); + } - public async toggleValuesOnChart() { - return await testSubjects.click('showValuesOnChart'); - } + public async toggleGridCategoryLines() { + return await this.testSubjects.click('showCategoryLines'); + } - public async setGridValueAxis(axis: string) { - log.debug(`setGridValueAxis(${axis})`); - await find.selectValue('select#gridAxis', axis); - } + public async toggleValuesOnChart() { + return await this.testSubjects.click('showValuesOnChart'); + } - public async setSeriesAxis(seriesNth: number, axis: string) { - await find.selectValue(`select#seriesValueAxis${seriesNth}`, axis); - } + public async setGridValueAxis(axis: string) { + this.log.debug(`setGridValueAxis(${axis})`); + await this.find.selectValue('select#gridAxis', axis); + } - public async setSeriesType(seriesNth: number, type: string) { - await find.selectValue(`select#seriesType${seriesNth}`, type); - } + public async setSeriesAxis(seriesNth: number, axis: string) { + await this.find.selectValue(`select#seriesValueAxis${seriesNth}`, axis); } - return new VisualizeEditorPage(); + public async setSeriesType(seriesNth: number, type: string) { + await this.find.selectValue(`select#seriesType${seriesNth}`, type); + } } diff --git a/test/functional/page_objects/visualize_page.ts b/test/functional/page_objects/visualize_page.ts index 78a963867b8c23..a11a254509e7a8 100644 --- a/test/functional/page_objects/visualize_page.ts +++ b/test/functional/page_objects/visualize_page.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; import { VisualizeConstants } from '../../../src/plugins/visualize/public/application/visualize_constants'; import { UI_SETTINGS } from '../../../src/plugins/data/common'; @@ -23,455 +23,454 @@ type DashboardPickerOption = | 'existing-dashboard-option' | 'new-dashboard-option'; -export function VisualizePageProvider({ getService, getPageObjects }: FtrProviderContext) { - const kibanaServer = getService('kibanaServer'); - const testSubjects = getService('testSubjects'); - const retry = getService('retry'); - const find = getService('find'); - const log = getService('log'); - const globalNav = getService('globalNav'); - const listingTable = getService('listingTable'); - const queryBar = getService('queryBar'); - const elasticChart = getService('elasticChart'); - const { common, header, visEditor, visChart } = getPageObjects([ - 'common', - 'header', - 'visEditor', - 'visChart', - ]); - - /** - * This page object contains the visualization type selection, the landing page, - * and the open/save dialog functions - */ - class VisualizePage { - index = { - LOGSTASH_TIME_BASED: 'logstash-*', - LOGSTASH_NON_TIME_BASED: 'logstash*', - }; - - public async initTests() { - await kibanaServer.savedObjects.clean({ types: ['visualization'] }); - await kibanaServer.importExport.load('visualize'); - - await kibanaServer.uiSettings.replace({ - defaultIndex: 'logstash-*', - [UI_SETTINGS.FORMAT_BYTES_DEFAULT_PATTERN]: '0,0.[000]b', - }); - } - - public async gotoVisualizationLandingPage() { - await common.navigateToApp('visualize'); - } +/** + * This page object contains the visualization type selection, the landing page, + * and the open/save dialog functions + */ +export class VisualizePageObject extends FtrService { + private readonly kibanaServer = this.ctx.getService('kibanaServer'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly retry = this.ctx.getService('retry'); + private readonly find = this.ctx.getService('find'); + private readonly log = this.ctx.getService('log'); + private readonly globalNav = this.ctx.getService('globalNav'); + private readonly listingTable = this.ctx.getService('listingTable'); + private readonly queryBar = this.ctx.getService('queryBar'); + private readonly elasticChart = this.ctx.getService('elasticChart'); + private readonly common = this.ctx.getPageObject('common'); + private readonly header = this.ctx.getPageObject('header'); + private readonly visEditor = this.ctx.getPageObject('visEditor'); + private readonly visChart = this.ctx.getPageObject('visChart'); + + index = { + LOGSTASH_TIME_BASED: 'logstash-*', + LOGSTASH_NON_TIME_BASED: 'logstash*', + }; + + public async initTests(isNewLibrary = false) { + await this.kibanaServer.savedObjects.clean({ types: ['visualization'] }); + await this.kibanaServer.importExport.load( + 'test/functional/fixtures/kbn_archiver/visualize.json' + ); + + await this.kibanaServer.uiSettings.replace({ + defaultIndex: 'logstash-*', + [UI_SETTINGS.FORMAT_BYTES_DEFAULT_PATTERN]: '0,0.[000]b', + 'visualization:visualize:legacyChartsLibrary': !isNewLibrary, + }); + } - public async clickNewVisualization() { - await listingTable.clickNewButton('createVisualizationPromptButton'); - } + public async gotoVisualizationLandingPage() { + await this.common.navigateToApp('visualize'); + } - public async clickAggBasedVisualizations() { - await testSubjects.click('visGroupAggBasedExploreLink'); - } + public async clickNewVisualization() { + await this.listingTable.clickNewButton('createVisualizationPromptButton'); + } - public async goBackToGroups() { - await testSubjects.click('goBackLink'); - } + public async clickAggBasedVisualizations() { + await this.testSubjects.click('visGroupAggBasedExploreLink'); + } - public async createVisualizationPromptButton() { - await testSubjects.click('createVisualizationPromptButton'); - } + public async goBackToGroups() { + await this.testSubjects.click('goBackLink'); + } - public async getChartTypes() { - const chartTypeField = await testSubjects.find('visNewDialogTypes'); - const $ = await chartTypeField.parseDomContent(); - return $('button') - .toArray() - .map((chart) => $(chart).findTestSubject('visTypeTitle').text().trim()); - } + public async createVisualizationPromptButton() { + await this.testSubjects.click('createVisualizationPromptButton'); + } - public async getPromotedVisTypes() { - const chartTypeField = await testSubjects.find('visNewDialogGroups'); - const $ = await chartTypeField.parseDomContent(); - const promotedVisTypes: string[] = []; - $('button') - .toArray() - .forEach((chart) => { - const title = $(chart).findTestSubject('visTypeTitle').text().trim(); - if (title) { - promotedVisTypes.push(title); - } - }); - return promotedVisTypes; - } + public async getChartTypes() { + const chartTypeField = await this.testSubjects.find('visNewDialogTypes'); + const $ = await chartTypeField.parseDomContent(); + return $('button') + .toArray() + .map((chart) => $(chart).findTestSubject('visTypeTitle').text().trim()); + } - public async waitForVisualizationSelectPage() { - await retry.try(async () => { - const visualizeSelectTypePage = await testSubjects.find('visNewDialogTypes'); - if (!(await visualizeSelectTypePage.isDisplayed())) { - throw new Error('wait for visualization select page'); + public async getPromotedVisTypes() { + const chartTypeField = await this.testSubjects.find('visNewDialogGroups'); + const $ = await chartTypeField.parseDomContent(); + const promotedVisTypes: string[] = []; + $('button') + .toArray() + .forEach((chart) => { + const title = $(chart).findTestSubject('visTypeTitle').text().trim(); + if (title) { + promotedVisTypes.push(title); } }); - } + return promotedVisTypes; + } - public async clickRefresh() { - if (await visChart.isNewChartsLibraryEnabled()) { - await elasticChart.setNewChartUiDebugFlag(); + public async waitForVisualizationSelectPage() { + await this.retry.try(async () => { + const visualizeSelectTypePage = await this.testSubjects.find('visNewDialogTypes'); + if (!(await visualizeSelectTypePage.isDisplayed())) { + throw new Error('wait for visualization select page'); } - await queryBar.clickQuerySubmitButton(); - } - - public async waitForGroupsSelectPage() { - await retry.try(async () => { - const visualizeSelectGroupStep = await testSubjects.find('visNewDialogGroups'); - if (!(await visualizeSelectGroupStep.isDisplayed())) { - throw new Error('wait for vis groups select step'); - } - }); - } - - public async navigateToNewVisualization() { - await this.gotoVisualizationLandingPage(); - await header.waitUntilLoadingHasFinished(); - await this.clickNewVisualization(); - await this.waitForGroupsSelectPage(); - } + }); + } - public async navigateToNewAggBasedVisualization() { - await this.gotoVisualizationLandingPage(); - await header.waitUntilLoadingHasFinished(); - await this.clickNewVisualization(); - await this.clickAggBasedVisualizations(); - await this.waitForVisualizationSelectPage(); + public async clickRefresh() { + if (await this.visChart.isNewChartsLibraryEnabled()) { + await this.elasticChart.setNewChartUiDebugFlag(); } + await this.queryBar.clickQuerySubmitButton(); + } - public async hasVisType(type: string) { - return await testSubjects.exists(`visType-${type}`); - } + public async waitForGroupsSelectPage() { + await this.retry.try(async () => { + const visualizeSelectGroupStep = await this.testSubjects.find('visNewDialogGroups'); + if (!(await visualizeSelectGroupStep.isDisplayed())) { + throw new Error('wait for vis groups select step'); + } + }); + } - public async clickVisType(type: string) { - await testSubjects.click(`visType-${type}`); - await header.waitUntilLoadingHasFinished(); - } + public async navigateToNewVisualization() { + await this.gotoVisualizationLandingPage(); + await this.header.waitUntilLoadingHasFinished(); + await this.clickNewVisualization(); + await this.waitForGroupsSelectPage(); + } - public async clickAreaChart() { - await this.clickVisType('area'); - } + public async navigateToNewAggBasedVisualization() { + await this.gotoVisualizationLandingPage(); + await this.header.waitUntilLoadingHasFinished(); + await this.clickNewVisualization(); + await this.clickAggBasedVisualizations(); + await this.waitForVisualizationSelectPage(); + } - public async clickDataTable() { - await this.clickVisType('table'); - } + public async hasVisType(type: string) { + return await this.testSubjects.exists(`visType-${type}`); + } - public async clickLineChart() { - await this.clickVisType('line'); - } + public async clickVisType(type: string) { + await this.testSubjects.click(`visType-${type}`); + await this.header.waitUntilLoadingHasFinished(); + } - public async clickRegionMap() { - await this.clickVisType('region_map'); - } + public async clickAreaChart() { + await this.clickVisType('area'); + } - public async hasRegionMap() { - return await this.hasVisType('region_map'); - } + public async clickDataTable() { + await this.clickVisType('table'); + } - public async clickMarkdownWidget() { - await this.clickVisType('markdown'); - } + public async clickLineChart() { + await this.clickVisType('line'); + } - public async clickMetric() { - await this.clickVisType('metric'); - } + public async clickRegionMap() { + await this.clickVisType('region_map'); + } - public async clickGauge() { - await this.clickVisType('gauge'); - } + public async hasRegionMap() { + return await this.hasVisType('region_map'); + } - public async clickPieChart() { - await this.clickVisType('pie'); - } + public async clickMarkdownWidget() { + await this.clickVisType('markdown'); + } - public async clickTileMap() { - await this.clickVisType('tile_map'); - } + public async clickMetric() { + await this.clickVisType('metric'); + } - public async hasTileMap() { - return await this.hasVisType('tile_map'); - } + public async clickGauge() { + await this.clickVisType('gauge'); + } - public async clickTagCloud() { - await this.clickVisType('tagcloud'); - } + public async clickPieChart() { + await this.clickVisType('pie'); + } - public async clickVega() { - await this.clickVisType('vega'); - } + public async clickTileMap() { + await this.clickVisType('tile_map'); + } - public async clickVisualBuilder() { - await this.clickVisType('metrics'); - } + public async hasTileMap() { + return await this.hasVisType('tile_map'); + } - public async clickVerticalBarChart() { - await this.clickVisType('histogram'); - } + public async clickTagCloud() { + await this.clickVisType('tagcloud'); + } - public async clickHeatmapChart() { - await this.clickVisType('heatmap'); - } + public async clickVega() { + await this.clickVisType('vega'); + } - public async clickInputControlVis() { - await this.clickVisType('input_control_vis'); - } + public async clickVisualBuilder() { + await this.clickVisType('metrics'); + } - public async clickLensWidget() { - await this.clickVisType('lens'); - } + public async clickVerticalBarChart() { + await this.clickVisType('histogram'); + } - public async clickMapsApp() { - await this.clickVisType('maps'); - } + public async clickHeatmapChart() { + await this.clickVisType('heatmap'); + } - public async hasMapsApp() { - return await this.hasVisType('maps'); - } + public async clickInputControlVis() { + await this.clickVisType('input_control_vis'); + } - public async createSimpleMarkdownViz(vizName: string) { - await this.gotoVisualizationLandingPage(); - await this.navigateToNewVisualization(); - await this.clickMarkdownWidget(); - await visEditor.setMarkdownTxt(vizName); - await visEditor.clickGo(); - await this.saveVisualization(vizName); - } + public async clickLensWidget() { + await this.clickVisType('lens'); + } - public async clickNewSearch(indexPattern = this.index.LOGSTASH_TIME_BASED) { - await testSubjects.click(`savedObjectTitle${indexPattern.split(' ').join('-')}`); - await header.waitUntilLoadingHasFinished(); - } + public async clickMapsApp() { + await this.clickVisType('maps'); + } - public async selectVisSourceIfRequired() { - log.debug('selectVisSourceIfRequired'); - const selectPage = await testSubjects.findAll('visualizeSelectSearch'); - if (selectPage.length) { - log.debug('a search is required for this visualization'); - await this.clickNewSearch(); - } - } + public async hasMapsApp() { + return await this.hasVisType('maps'); + } - /** - * Deletes all existing visualizations - */ - public async deleteAllVisualizations() { - await retry.try(async () => { - await listingTable.checkListingSelectAllCheckbox(); - await listingTable.clickDeleteSelected(); - await common.clickConfirmOnModal(); - await testSubjects.find('createVisualizationPromptButton'); - }); - } + public async createSimpleMarkdownViz(vizName: string) { + await this.gotoVisualizationLandingPage(); + await this.navigateToNewVisualization(); + await this.clickMarkdownWidget(); + await this.visEditor.setMarkdownTxt(vizName); + await this.visEditor.clickGo(); + await this.saveVisualization(vizName); + } - public async isBetaInfoShown() { - return await testSubjects.exists('betaVisInfo'); - } + public async clickNewSearch(indexPattern = this.index.LOGSTASH_TIME_BASED) { + await this.testSubjects.click(`savedObjectTitle${indexPattern.split(' ').join('-')}`); + await this.header.waitUntilLoadingHasFinished(); + } - public async getBetaTypeLinks() { - return await find.allByCssSelector('[data-vis-stage="beta"]'); + public async selectVisSourceIfRequired() { + this.log.debug('selectVisSourceIfRequired'); + const selectPage = await this.testSubjects.findAll('visualizeSelectSearch'); + if (selectPage.length) { + this.log.debug('a search is required for this visualization'); + await this.clickNewSearch(); } + } - public async getExperimentalTypeLinks() { - return await find.allByCssSelector('[data-vis-stage="experimental"]'); - } + /** + * Deletes all existing visualizations + */ + public async deleteAllVisualizations() { + await this.retry.try(async () => { + await this.listingTable.checkListingSelectAllCheckbox(); + await this.listingTable.clickDeleteSelected(); + await this.common.clickConfirmOnModal(); + await this.testSubjects.find('createVisualizationPromptButton'); + }); + } - public async isExperimentalInfoShown() { - return await testSubjects.exists('experimentalVisInfo'); - } + public async isBetaInfoShown() { + return await this.testSubjects.exists('betaVisInfo'); + } - public async getExperimentalInfo() { - return await testSubjects.find('experimentalVisInfo'); - } + public async getBetaTypeLinks() { + return await this.find.allByCssSelector('[data-vis-stage="beta"]'); + } - public async getSideEditorExists() { - return await find.existsByCssSelector('.visEditor__collapsibleSidebar'); - } + public async getExperimentalTypeLinks() { + return await this.find.allByCssSelector('[data-vis-stage="experimental"]'); + } - public async clickSavedSearch(savedSearchName: string) { - await testSubjects.click(`savedObjectTitle${savedSearchName.split(' ').join('-')}`); - await header.waitUntilLoadingHasFinished(); - } + public async isExperimentalInfoShown() { + return await this.testSubjects.exists('experimentalVisInfo'); + } - public async clickUnlinkSavedSearch() { - await testSubjects.click('showUnlinkSavedSearchPopover'); - await testSubjects.click('unlinkSavedSearch'); - await header.waitUntilLoadingHasFinished(); - } + public async getExperimentalInfo() { + return await this.testSubjects.find('experimentalVisInfo'); + } - public async ensureSavePanelOpen() { - log.debug('ensureSavePanelOpen'); - await header.waitUntilLoadingHasFinished(); - const isOpen = await testSubjects.exists('savedObjectSaveModal', { timeout: 5000 }); - if (!isOpen) { - await testSubjects.click('visualizeSaveButton'); - } - } + public async getSideEditorExists() { + return await this.find.existsByCssSelector('.visEditor__collapsibleSidebar'); + } - public async clickLoadSavedVisButton() { - // TODO: Use a test subject selector once we rewrite breadcrumbs to accept each breadcrumb - // element as a child instead of building the breadcrumbs dynamically. - await find.clickByCssSelector('[href="#/"]'); - } + public async clickSavedSearch(savedSearchName: string) { + await this.testSubjects.click(`savedObjectTitle${savedSearchName.split(' ').join('-')}`); + await this.header.waitUntilLoadingHasFinished(); + } - public async loadSavedVisualization(vizName: string, { navigateToVisualize = true } = {}) { - if (navigateToVisualize) { - await this.clickLoadSavedVisButton(); - } - await this.openSavedVisualization(vizName); - } + public async clickUnlinkSavedSearch() { + await this.testSubjects.click('showUnlinkSavedSearchPopover'); + await this.testSubjects.click('unlinkSavedSearch'); + await this.header.waitUntilLoadingHasFinished(); + } - public async openSavedVisualization(vizName: string) { - const dataTestSubj = `visListingTitleLink-${vizName.split(' ').join('-')}`; - await testSubjects.click(dataTestSubj, 20000); - await header.waitUntilLoadingHasFinished(); + public async ensureSavePanelOpen() { + this.log.debug('ensureSavePanelOpen'); + await this.header.waitUntilLoadingHasFinished(); + const isOpen = await this.testSubjects.exists('savedObjectSaveModal', { timeout: 5000 }); + if (!isOpen) { + await this.testSubjects.click('visualizeSaveButton'); } + } - public async waitForVisualizationSavedToastGone() { - await testSubjects.waitForDeleted('saveVisualizationSuccess'); - } + public async clickLoadSavedVisButton() { + // TODO: Use a test subject selector once we rewrite breadcrumbs to accept each breadcrumb + // element as a child instead of building the breadcrumbs dynamically. + await this.find.clickByCssSelector('[href="#/"]'); + } - public async clickLandingPageBreadcrumbLink() { - log.debug('clickLandingPageBreadcrumbLink'); - await find.clickByCssSelector(`a[href="#${VisualizeConstants.LANDING_PAGE_PATH}"]`); + public async loadSavedVisualization(vizName: string, { navigateToVisualize = true } = {}) { + if (navigateToVisualize) { + await this.clickLoadSavedVisButton(); } + await this.openSavedVisualization(vizName); + } - /** - * Returns true if already on the landing page (that page doesn't have a link to itself). - * @returns {Promise} - */ - public async onLandingPage() { - log.debug(`VisualizePage.onLandingPage`); - return await testSubjects.exists('visualizationLandingPage'); - } + public async openSavedVisualization(vizName: string) { + const dataTestSubj = `visListingTitleLink-${vizName.split(' ').join('-')}`; + await this.testSubjects.click(dataTestSubj, 20000); + await this.header.waitUntilLoadingHasFinished(); + } - public async gotoLandingPage() { - log.debug('VisualizePage.gotoLandingPage'); - const onPage = await this.onLandingPage(); - if (!onPage) { - await retry.try(async () => { - await this.clickLandingPageBreadcrumbLink(); - const onLandingPage = await this.onLandingPage(); - if (!onLandingPage) throw new Error('Not on the landing page.'); - }); - } - } + public async waitForVisualizationSavedToastGone() { + await this.testSubjects.waitForDeleted('saveVisualizationSuccess'); + } - public async saveVisualization(vizName: string, saveModalArgs: VisualizeSaveModalArgs = {}) { - await this.ensureSavePanelOpen(); + public async clickLandingPageBreadcrumbLink() { + this.log.debug('clickLandingPageBreadcrumbLink'); + await this.find.clickByCssSelector(`a[href="#${VisualizeConstants.LANDING_PAGE_PATH}"]`); + } - await this.setSaveModalValues(vizName, saveModalArgs); - log.debug('Click Save Visualization button'); + /** + * Returns true if already on the landing page (that page doesn't have a link to itself). + * @returns {Promise} + */ + public async onLandingPage() { + this.log.debug(`VisualizePage.onLandingPage`); + return await this.testSubjects.exists('visualizationLandingPage'); + } - await testSubjects.click('confirmSaveSavedObjectButton'); + public async gotoLandingPage() { + this.log.debug('VisualizePage.gotoLandingPage'); + const onPage = await this.onLandingPage(); + if (!onPage) { + await this.retry.try(async () => { + await this.clickLandingPageBreadcrumbLink(); + const onLandingPage = await this.onLandingPage(); + if (!onLandingPage) throw new Error('Not on the landing page.'); + }); + } + } - // Confirm that the Visualization has actually been saved - await testSubjects.existOrFail('saveVisualizationSuccess'); - const message = await common.closeToast(); - await header.waitUntilLoadingHasFinished(); - await common.waitForSaveModalToClose(); + public async saveVisualization(vizName: string, saveModalArgs: VisualizeSaveModalArgs = {}) { + await this.ensureSavePanelOpen(); - return message; - } + await this.setSaveModalValues(vizName, saveModalArgs); + this.log.debug('Click Save Visualization button'); - public async setSaveModalValues( - vizName: string, - { saveAsNew, redirectToOrigin, addToDashboard, dashboardId }: VisualizeSaveModalArgs = {} - ) { - await testSubjects.setValue('savedObjectTitle', vizName); - - const saveAsNewCheckboxExists = await testSubjects.exists('saveAsNewCheckbox'); - if (saveAsNewCheckboxExists) { - const state = saveAsNew ? 'check' : 'uncheck'; - log.debug('save as new checkbox exists. Setting its state to', state); - await testSubjects.setEuiSwitch('saveAsNewCheckbox', state); - } + await this.testSubjects.click('confirmSaveSavedObjectButton'); - const redirectToOriginCheckboxExists = await testSubjects.exists('returnToOriginModeSwitch'); - if (redirectToOriginCheckboxExists) { - const state = redirectToOrigin ? 'check' : 'uncheck'; - log.debug('redirect to origin checkbox exists. Setting its state to', state); - await testSubjects.setEuiSwitch('returnToOriginModeSwitch', state); - } + // Confirm that the Visualization has actually been saved + await this.testSubjects.existOrFail('saveVisualizationSuccess'); + const message = await this.common.closeToast(); + await this.header.waitUntilLoadingHasFinished(); + await this.common.waitForSaveModalToClose(); - const dashboardSelectorExists = await testSubjects.exists('add-to-dashboard-options'); - if (dashboardSelectorExists) { - let option: DashboardPickerOption = 'add-to-library-option'; - if (addToDashboard) { - option = dashboardId ? 'existing-dashboard-option' : 'new-dashboard-option'; - } - log.debug('save modal dashboard selector, choosing option:', option); - const dashboardSelector = await testSubjects.find('add-to-dashboard-options'); - const label = await dashboardSelector.findByCssSelector(`label[for="${option}"]`); - await label.click(); + return message; + } - if (dashboardId) { - // TODO - selecting an existing dashboard - } + public async setSaveModalValues( + vizName: string, + { saveAsNew, redirectToOrigin, addToDashboard, dashboardId }: VisualizeSaveModalArgs = {} + ) { + await this.testSubjects.setValue('savedObjectTitle', vizName); + + const saveAsNewCheckboxExists = await this.testSubjects.exists('saveAsNewCheckbox'); + if (saveAsNewCheckboxExists) { + const state = saveAsNew ? 'check' : 'uncheck'; + this.log.debug('save as new checkbox exists. Setting its state to', state); + await this.testSubjects.setEuiSwitch('saveAsNewCheckbox', state); + } + + const redirectToOriginCheckboxExists = await this.testSubjects.exists( + 'returnToOriginModeSwitch' + ); + if (redirectToOriginCheckboxExists) { + const state = redirectToOrigin ? 'check' : 'uncheck'; + this.log.debug('redirect to origin checkbox exists. Setting its state to', state); + await this.testSubjects.setEuiSwitch('returnToOriginModeSwitch', state); + } + + const dashboardSelectorExists = await this.testSubjects.exists('add-to-dashboard-options'); + if (dashboardSelectorExists) { + let option: DashboardPickerOption = 'add-to-library-option'; + if (addToDashboard) { + option = dashboardId ? 'existing-dashboard-option' : 'new-dashboard-option'; } - } + this.log.debug('save modal dashboard selector, choosing option:', option); + const dashboardSelector = await this.testSubjects.find('add-to-dashboard-options'); + const label = await dashboardSelector.findByCssSelector(`label[for="${option}"]`); + await label.click(); - public async saveVisualizationExpectSuccess( - vizName: string, - { saveAsNew, redirectToOrigin, addToDashboard, dashboardId }: VisualizeSaveModalArgs = {} - ) { - const saveMessage = await this.saveVisualization(vizName, { - saveAsNew, - redirectToOrigin, - addToDashboard, - dashboardId, - }); - if (!saveMessage) { - throw new Error( - `Expected saveVisualization to respond with the saveMessage from the toast, got ${saveMessage}` - ); + if (dashboardId) { + // TODO - selecting an existing dashboard } } + } - public async saveVisualizationExpectSuccessAndBreadcrumb( - vizName: string, - { saveAsNew = false, redirectToOrigin = false } = {} - ) { - await this.saveVisualizationExpectSuccess(vizName, { saveAsNew, redirectToOrigin }); - await retry.waitFor( - 'last breadcrumb to have new vis name', - async () => (await globalNav.getLastBreadcrumb()) === vizName + public async saveVisualizationExpectSuccess( + vizName: string, + { saveAsNew, redirectToOrigin, addToDashboard, dashboardId }: VisualizeSaveModalArgs = {} + ) { + const saveMessage = await this.saveVisualization(vizName, { + saveAsNew, + redirectToOrigin, + addToDashboard, + dashboardId, + }); + if (!saveMessage) { + throw new Error( + `Expected saveVisualization to respond with the saveMessage from the toast, got ${saveMessage}` ); } + } - public async saveVisualizationAndReturn() { - await header.waitUntilLoadingHasFinished(); - await testSubjects.existOrFail('visualizesaveAndReturnButton'); - await testSubjects.click('visualizesaveAndReturnButton'); - } + public async saveVisualizationExpectSuccessAndBreadcrumb( + vizName: string, + { saveAsNew = false, redirectToOrigin = false } = {} + ) { + await this.saveVisualizationExpectSuccess(vizName, { saveAsNew, redirectToOrigin }); + await this.retry.waitFor( + 'last breadcrumb to have new vis name', + async () => (await this.globalNav.getLastBreadcrumb()) === vizName + ); + } - public async linkedToOriginatingApp() { - await header.waitUntilLoadingHasFinished(); - await testSubjects.existOrFail('visualizesaveAndReturnButton'); - } + public async saveVisualizationAndReturn() { + await this.header.waitUntilLoadingHasFinished(); + await this.testSubjects.existOrFail('visualizesaveAndReturnButton'); + await this.testSubjects.click('visualizesaveAndReturnButton'); + } - public async notLinkedToOriginatingApp() { - await header.waitUntilLoadingHasFinished(); - await testSubjects.missingOrFail('visualizesaveAndReturnButton'); - } + public async linkedToOriginatingApp() { + await this.header.waitUntilLoadingHasFinished(); + await this.testSubjects.existOrFail('visualizesaveAndReturnButton'); + } - public async cancelAndReturn(showConfirmModal: boolean) { - await header.waitUntilLoadingHasFinished(); - await testSubjects.existOrFail('visualizeCancelAndReturnButton'); - await testSubjects.click('visualizeCancelAndReturnButton'); - if (showConfirmModal) { - await retry.waitFor( - 'confirm modal to show', - async () => await testSubjects.exists('appLeaveConfirmModal') - ); - await testSubjects.exists('confirmModalConfirmButton'); - await testSubjects.click('confirmModalConfirmButton'); - } - } + public async notLinkedToOriginatingApp() { + await this.header.waitUntilLoadingHasFinished(); + await this.testSubjects.missingOrFail('visualizesaveAndReturnButton'); } - return new VisualizePage(); + public async cancelAndReturn(showConfirmModal: boolean) { + await this.header.waitUntilLoadingHasFinished(); + await this.testSubjects.existOrFail('visualizeCancelAndReturnButton'); + await this.testSubjects.click('visualizeCancelAndReturnButton'); + if (showConfirmModal) { + await this.retry.waitFor( + 'confirm modal to show', + async () => await this.testSubjects.exists('appLeaveConfirmModal') + ); + await this.testSubjects.exists('confirmModalConfirmButton'); + await this.testSubjects.click('confirmModalConfirmButton'); + } + } } diff --git a/test/functional/services/combo_box.ts b/test/functional/services/combo_box.ts index a198aec1d16960..6706db82ce7086 100644 --- a/test/functional/services/combo_box.ts +++ b/test/functional/services/combo_box.ts @@ -21,7 +21,7 @@ export class ComboBoxService extends FtrService { private readonly log = this.ctx.getService('log'); private readonly retry = this.ctx.getService('retry'); private readonly browser = this.ctx.getService('browser'); - private readonly PageObjects = this.ctx.getPageObjects(['common']); + private readonly common = this.ctx.getPageObject('common'); private readonly WAIT_FOR_EXISTS_TIME: number = this.config.get('timeouts.waitForExists'); @@ -113,7 +113,7 @@ export class ComboBoxService extends FtrService { this.log.debug(`comboBox.setCustom, comboBoxSelector: ${comboBoxSelector}, value: ${value}`); const comboBoxElement = await this.testSubjects.find(comboBoxSelector); await this.setFilterValue(comboBoxElement, value); - await this.PageObjects.common.pressEnterKey(); + await this.common.pressEnterKey(); await this.closeOptionsList(comboBoxElement); } diff --git a/test/functional/services/dashboard/add_panel.ts b/test/functional/services/dashboard/add_panel.ts index 98e947541b52d7..43ab1f966bc9a0 100644 --- a/test/functional/services/dashboard/add_panel.ts +++ b/test/functional/services/dashboard/add_panel.ts @@ -13,20 +13,21 @@ export class DashboardAddPanelService extends FtrService { private readonly retry = this.ctx.getService('retry'); private readonly testSubjects = this.ctx.getService('testSubjects'); private readonly flyout = this.ctx.getService('flyout'); - private readonly PageObjects = this.ctx.getPageObjects(['header', 'common']); + private readonly common = this.ctx.getPageObject('common'); + private readonly header = this.ctx.getPageObject('header'); async clickOpenAddPanel() { this.log.debug('DashboardAddPanel.clickOpenAddPanel'); await this.testSubjects.click('dashboardAddPanelButton'); // Give some time for the animation to complete - await this.PageObjects.common.sleep(500); + await this.common.sleep(500); } async clickCreateNewLink() { this.log.debug('DashboardAddPanel.clickAddNewPanelButton'); await this.testSubjects.click('dashboardAddNewPanelButton'); // Give some time for the animation to complete - await this.PageObjects.common.sleep(500); + await this.common.sleep(500); } async clickQuickButton(visType: string) { @@ -94,7 +95,7 @@ export class DashboardAddPanelService extends FtrService { } await embeddableRows[i].click(); - await this.PageObjects.common.closeToast(); + await this.common.closeToast(); embeddableList.push(name); } }); @@ -104,7 +105,7 @@ export class DashboardAddPanelService extends FtrService { async clickPagerNextButton() { // Clear all toasts that could hide pagination controls - await this.PageObjects.common.clearAllToasts(); + await this.common.clearAllToasts(); const isNext = await this.testSubjects.exists('pagination-button-next'); if (!isNext) { @@ -118,9 +119,9 @@ export class DashboardAddPanelService extends FtrService { return false; } - await this.PageObjects.header.waitUntilLoadingHasFinished(); + await this.header.waitUntilLoadingHasFinished(); await pagerNextButton.click(); - await this.PageObjects.header.waitUntilLoadingHasFinished(); + await this.header.waitUntilLoadingHasFinished(); return true; } diff --git a/test/functional/services/dashboard/expectations.ts b/test/functional/services/dashboard/expectations.ts index 34a4a9de7899a9..c22eddb032cf9e 100644 --- a/test/functional/services/dashboard/expectations.ts +++ b/test/functional/services/dashboard/expectations.ts @@ -16,20 +16,21 @@ export class DashboardExpectService extends FtrService { private readonly testSubjects = this.ctx.getService('testSubjects'); private readonly find = this.ctx.getService('find'); private readonly filterBar = this.ctx.getService('filterBar'); - private readonly PageObjects = this.ctx.getPageObjects(['dashboard', 'visualize', 'visChart']); + private readonly dashboard = this.ctx.getPageObject('dashboard'); + private readonly visChart = this.ctx.getPageObject('visChart'); private readonly findTimeout = 2500; async panelCount(expectedCount: number) { this.log.debug(`DashboardExpect.panelCount(${expectedCount})`); await this.retry.try(async () => { - const panelCount = await this.PageObjects.dashboard.getPanelCount(); + const panelCount = await this.dashboard.getPanelCount(); expect(panelCount).to.be(expectedCount); }); } async visualizationsArePresent(vizList: string[]) { this.log.debug('Checking all visualisations are present on dashsboard'); - let notLoaded = await this.PageObjects.dashboard.getNotLoadedVisualizations(vizList); + let notLoaded = await this.dashboard.getNotLoadedVisualizations(vizList); // TODO: Determine issue occasionally preventing 'geo map' from loading notLoaded = notLoaded.filter((x) => x !== 'Rendering Test: geo map'); expect(notLoaded).to.be.empty(); @@ -231,7 +232,7 @@ export class DashboardExpectService extends FtrService { async dataTableRowCount(expectedCount: number) { this.log.debug(`DashboardExpect.dataTableRowCount(${expectedCount})`); await this.retry.try(async () => { - const dataTableRows = await this.PageObjects.visChart.getTableVisContent(); + const dataTableRows = await this.visChart.getTableVisContent(); expect(dataTableRows.length).to.be(expectedCount); }); } @@ -239,7 +240,7 @@ export class DashboardExpectService extends FtrService { async dataTableNoResult() { this.log.debug(`DashboardExpect.dataTableNoResult`); await this.retry.try(async () => { - await this.PageObjects.visChart.getTableVisNoResult(); + await this.visChart.getTableVisNoResult(); }); } diff --git a/test/functional/services/dashboard/panel_actions.ts b/test/functional/services/dashboard/panel_actions.ts index e7c028acc0e1bf..9aca790b0b4379 100644 --- a/test/functional/services/dashboard/panel_actions.ts +++ b/test/functional/services/dashboard/panel_actions.ts @@ -25,7 +25,9 @@ export class DashboardPanelActionsService extends FtrService { private readonly log = this.ctx.getService('log'); private readonly testSubjects = this.ctx.getService('testSubjects'); private readonly inspector = this.ctx.getService('inspector'); - private readonly PageObjects = this.ctx.getPageObjects(['header', 'common', 'dashboard']); + private readonly header = this.ctx.getPageObject('header'); + private readonly common = this.ctx.getPageObject('common'); + private readonly dashboard = this.ctx.getPageObject('dashboard'); async findContextMenu(parent?: WebElementWrapper) { return parent @@ -78,8 +80,8 @@ export class DashboardPanelActionsService extends FtrService { const isActionVisible = await this.testSubjects.exists(EDIT_PANEL_DATA_TEST_SUBJ); if (!isActionVisible) await this.clickContextMenuMoreItem(); await this.testSubjects.clickWhenNotDisabled(EDIT_PANEL_DATA_TEST_SUBJ); - await this.PageObjects.header.waitUntilLoadingHasFinished(); - await this.PageObjects.common.waitForTopNavToBeVisible(); + await this.header.waitUntilLoadingHasFinished(); + await this.common.waitForTopNavToBeVisible(); } async editPanelByTitle(title?: string) { @@ -146,7 +148,7 @@ export class DashboardPanelActionsService extends FtrService { await this.openContextMenu(); } await this.testSubjects.click(CLONE_PANEL_DATA_TEST_SUBJ); - await this.PageObjects.dashboard.waitForRenderComplete(); + await this.dashboard.waitForRenderComplete(); } async openCopyToModalByTitle(title?: string) { diff --git a/test/functional/services/dashboard/visualizations.ts b/test/functional/services/dashboard/visualizations.ts index a6b88802d7b814..8688d375f7a7b9 100644 --- a/test/functional/services/dashboard/visualizations.ts +++ b/test/functional/services/dashboard/visualizations.ts @@ -13,25 +13,23 @@ export class DashboardVisualizationsService extends FtrService { private readonly queryBar = this.ctx.getService('queryBar'); private readonly testSubjects = this.ctx.getService('testSubjects'); private readonly dashboardAddPanel = this.ctx.getService('dashboardAddPanel'); - private readonly PageObjects = this.ctx.getPageObjects([ - 'dashboard', - 'visualize', - 'visEditor', - 'header', - 'discover', - 'timePicker', - ]); + private readonly dashboard = this.ctx.getPageObject('dashboard'); + private readonly visualize = this.ctx.getPageObject('visualize'); + private readonly visEditor = this.ctx.getPageObject('visEditor'); + private readonly header = this.ctx.getPageObject('header'); + private readonly discover = this.ctx.getPageObject('discover'); + private readonly timePicker = this.ctx.getPageObject('timePicker'); async createAndAddTSVBVisualization(name: string) { this.log.debug(`createAndAddTSVBVisualization(${name})`); - const inViewMode = await this.PageObjects.dashboard.getIsInViewMode(); + const inViewMode = await this.dashboard.getIsInViewMode(); if (inViewMode) { - await this.PageObjects.dashboard.switchToEditMode(); + await this.dashboard.switchToEditMode(); } await this.dashboardAddPanel.clickEditorMenuButton(); await this.dashboardAddPanel.clickAddNewEmbeddableLink('metrics'); - await this.PageObjects.visualize.clickVisualBuilder(); - await this.PageObjects.visualize.saveVisualizationExpectSuccess(name); + await this.visualize.clickVisualBuilder(); + await this.visualize.saveVisualizationExpectSuccess(name); } async createSavedSearch({ @@ -44,8 +42,8 @@ export class DashboardVisualizationsService extends FtrService { fields?: string[]; }) { this.log.debug(`createSavedSearch(${name})`); - await this.PageObjects.header.clickDiscover(true); - await this.PageObjects.timePicker.setHistoricalDataRange(); + await this.header.clickDiscover(true); + await this.timePicker.setHistoricalDataRange(); if (query) { await this.queryBar.setQuery(query); @@ -54,12 +52,12 @@ export class DashboardVisualizationsService extends FtrService { if (fields) { for (let i = 0; i < fields.length; i++) { - await this.PageObjects.discover.clickFieldListItemAdd(fields[i]); + await this.discover.clickFieldListItemAdd(fields[i]); } } - await this.PageObjects.discover.saveSearch(name); - await this.PageObjects.header.waitUntilLoadingHasFinished(); + await this.discover.saveSearch(name); + await this.header.waitUntilLoadingHasFinished(); await this.testSubjects.exists('saveSearchSuccess'); } @@ -75,25 +73,25 @@ export class DashboardVisualizationsService extends FtrService { this.log.debug(`createAndAddSavedSearch(${name})`); await this.createSavedSearch({ name, query, fields }); - await this.PageObjects.header.clickDashboard(); + await this.header.clickDashboard(); - const inViewMode = await this.PageObjects.dashboard.getIsInViewMode(); + const inViewMode = await this.dashboard.getIsInViewMode(); if (inViewMode) { - await this.PageObjects.dashboard.switchToEditMode(); + await this.dashboard.switchToEditMode(); } await this.dashboardAddPanel.addSavedSearch(name); } async createAndAddMarkdown({ name, markdown }: { name: string; markdown: string }) { this.log.debug(`createAndAddMarkdown(${markdown})`); - const inViewMode = await this.PageObjects.dashboard.getIsInViewMode(); + const inViewMode = await this.dashboard.getIsInViewMode(); if (inViewMode) { - await this.PageObjects.dashboard.switchToEditMode(); + await this.dashboard.switchToEditMode(); } await this.dashboardAddPanel.clickMarkdownQuickButton(); - await this.PageObjects.visEditor.setMarkdownTxt(markdown); - await this.PageObjects.visEditor.clickGo(); - await this.PageObjects.visualize.saveVisualizationExpectSuccess(name, { + await this.visEditor.setMarkdownTxt(markdown); + await this.visEditor.clickGo(); + await this.visualize.saveVisualizationExpectSuccess(name, { saveAsNew: false, redirectToOrigin: true, }); @@ -101,9 +99,9 @@ export class DashboardVisualizationsService extends FtrService { async createAndEmbedMetric(name: string) { this.log.debug(`createAndEmbedMetric(${name})`); - const inViewMode = await this.PageObjects.dashboard.getIsInViewMode(); + const inViewMode = await this.dashboard.getIsInViewMode(); if (inViewMode) { - await this.PageObjects.dashboard.switchToEditMode(); + await this.dashboard.switchToEditMode(); } await this.dashboardAddPanel.clickEditorMenuButton(); await this.dashboardAddPanel.clickAggBasedVisualizations(); @@ -115,13 +113,13 @@ export class DashboardVisualizationsService extends FtrService { async createAndEmbedMarkdown({ name, markdown }: { name: string; markdown: string }) { this.log.debug(`createAndEmbedMarkdown(${markdown})`); - const inViewMode = await this.PageObjects.dashboard.getIsInViewMode(); + const inViewMode = await this.dashboard.getIsInViewMode(); if (inViewMode) { - await this.PageObjects.dashboard.switchToEditMode(); + await this.dashboard.switchToEditMode(); } await this.dashboardAddPanel.clickMarkdownQuickButton(); - await this.PageObjects.visEditor.setMarkdownTxt(markdown); - await this.PageObjects.visEditor.clickGo(); + await this.visEditor.setMarkdownTxt(markdown); + await this.visEditor.clickGo(); await this.testSubjects.click('visualizesaveAndReturnButton'); } } diff --git a/test/functional/services/data_grid.ts b/test/functional/services/data_grid.ts index f2079c02ef5b5c..f54e7b65a46e2a 100644 --- a/test/functional/services/data_grid.ts +++ b/test/functional/services/data_grid.ts @@ -10,7 +10,7 @@ import { chunk } from 'lodash'; import { FtrService } from '../ftr_provider_context'; import { WebElementWrapper } from './lib/web_element_wrapper'; -interface TabbedGridData { +export interface TabbedGridData { columns: string[]; rows: string[][]; } @@ -22,7 +22,7 @@ interface SelectOptions { export class DataGridService extends FtrService { private readonly find = this.ctx.getService('find'); private readonly testSubjects = this.ctx.getService('testSubjects'); - private readonly PageObjects = this.ctx.getPageObjects(['common', 'header']); + private readonly header = this.ctx.getPageObject('header'); private readonly retry = this.ctx.getService('retry'); async getDataGridTableData(): Promise { @@ -234,7 +234,7 @@ export class DataGridService extends FtrService { const tableDocViewRow = await this.getTableDocViewRow(detailsRow, fieldName); const addInclusiveFilterButton = await this.getAddInclusiveFilterButton(tableDocViewRow); await addInclusiveFilterButton.click(); - await this.PageObjects.header.awaitGlobalLoadingIndicatorHidden(); + await this.header.awaitGlobalLoadingIndicatorHidden(); } public async getAddInclusiveFilterButton( @@ -263,7 +263,7 @@ export class DataGridService extends FtrService { const tableDocViewRow = await this.getTableDocViewRow(detailsRow, fieldName); const addInclusiveFilterButton = await this.getRemoveInclusiveFilterButton(tableDocViewRow); await addInclusiveFilterButton.click(); - await this.PageObjects.header.awaitGlobalLoadingIndicatorHidden(); + await this.header.awaitGlobalLoadingIndicatorHidden(); } public async hasNoResults() { diff --git a/test/functional/services/doc_table.ts b/test/functional/services/doc_table.ts index 6c73faec16b1a9..685f1748d56b28 100644 --- a/test/functional/services/doc_table.ts +++ b/test/functional/services/doc_table.ts @@ -17,7 +17,7 @@ interface SelectOptions { export class DocTableService extends FtrService { private readonly testSubjects = this.ctx.getService('testSubjects'); private readonly retry = this.ctx.getService('retry'); - private readonly PageObjects = this.ctx.getPageObjects(['common', 'header']); + private readonly header = this.ctx.getPageObject('header'); public async getTable(selector?: string) { return await this.testSubjects.find(selector ? selector : 'docTable'); @@ -126,7 +126,7 @@ export class DocTableService extends FtrService { const tableDocViewRow = await this.getTableDocViewRow(detailsRow, fieldName); const addInclusiveFilterButton = await this.getAddInclusiveFilterButton(tableDocViewRow); await addInclusiveFilterButton.click(); - await this.PageObjects.header.awaitGlobalLoadingIndicatorHidden(); + await this.header.awaitGlobalLoadingIndicatorHidden(); } public async getRemoveInclusiveFilterButton( @@ -142,7 +142,7 @@ export class DocTableService extends FtrService { const tableDocViewRow = await this.getTableDocViewRow(detailsRow, fieldName); const addInclusiveFilterButton = await this.getRemoveInclusiveFilterButton(tableDocViewRow); await addInclusiveFilterButton.click(); - await this.PageObjects.header.awaitGlobalLoadingIndicatorHidden(); + await this.header.awaitGlobalLoadingIndicatorHidden(); } public async getAddExistsFilterButton( @@ -155,7 +155,7 @@ export class DocTableService extends FtrService { const tableDocViewRow = await this.getTableDocViewRow(detailsRow, fieldName); const addInclusiveFilterButton = await this.getAddExistsFilterButton(tableDocViewRow); await addInclusiveFilterButton.click(); - await this.PageObjects.header.awaitGlobalLoadingIndicatorHidden(); + await this.header.awaitGlobalLoadingIndicatorHidden(); } public async toggleRowExpanded({ @@ -163,7 +163,7 @@ export class DocTableService extends FtrService { rowIndex = 0, }: SelectOptions = {}): Promise { await this.clickRowToggle({ isAnchorRow, rowIndex }); - await this.PageObjects.header.awaitGlobalLoadingIndicatorHidden(); + await this.header.awaitGlobalLoadingIndicatorHidden(); return await this.retry.try(async () => { const row = isAnchorRow ? await this.getAnchorRow() : (await this.getBodyRows())[rowIndex]; const detailsRow = await row.findByXpath( diff --git a/test/functional/services/embedding.ts b/test/functional/services/embedding.ts index e394aff19ab8b6..6d168b00c5447d 100644 --- a/test/functional/services/embedding.ts +++ b/test/functional/services/embedding.ts @@ -11,7 +11,7 @@ import { FtrService } from '../ftr_provider_context'; export class EmbeddingService extends FtrService { private readonly browser = this.ctx.getService('browser'); private readonly log = this.ctx.getService('log'); - private readonly PageObjects = this.ctx.getPageObjects(['header']); + private readonly header = this.ctx.getPageObject('header'); /** * Opens current page in embeded mode @@ -20,6 +20,6 @@ export class EmbeddingService extends FtrService { const currentUrl = await this.browser.getCurrentUrl(); this.log.debug(`Opening in embedded mode: ${currentUrl}`); await this.browser.get(`${currentUrl}&embed=true`); - await this.PageObjects.header.waitUntilLoadingHasFinished(); + await this.header.waitUntilLoadingHasFinished(); } } diff --git a/test/functional/services/filter_bar.ts b/test/functional/services/filter_bar.ts index 5f20d3d4f8b7b5..1d0b85eed3a9c5 100644 --- a/test/functional/services/filter_bar.ts +++ b/test/functional/services/filter_bar.ts @@ -12,7 +12,8 @@ import { FtrService } from '../ftr_provider_context'; export class FilterBarService extends FtrService { private readonly comboBox = this.ctx.getService('comboBox'); private readonly testSubjects = this.ctx.getService('testSubjects'); - private readonly PageObjects = this.ctx.getPageObjects(['common', 'header']); + private readonly common = this.ctx.getPageObject('common'); + private readonly header = this.ctx.getPageObject('header'); /** * Checks if specified filter exists @@ -56,7 +57,7 @@ export class FilterBarService extends FtrService { public async removeFilter(key: string): Promise { await this.testSubjects.click(`~filter & ~filter-key-${key}`); await this.testSubjects.click(`deleteFilter`); - await this.PageObjects.header.awaitGlobalLoadingIndicatorHidden(); + await this.header.awaitGlobalLoadingIndicatorHidden(); } /** @@ -65,8 +66,8 @@ export class FilterBarService extends FtrService { public async removeAllFilters(): Promise { await this.testSubjects.click('showFilterActions'); await this.testSubjects.click('removeAllFilters'); - await this.PageObjects.header.waitUntilLoadingHasFinished(); - await this.PageObjects.common.waitUntilUrlIncludes('filters:!()'); + await this.header.waitUntilLoadingHasFinished(); + await this.common.waitUntilUrlIncludes('filters:!()'); } /** @@ -77,13 +78,13 @@ export class FilterBarService extends FtrService { public async toggleFilterEnabled(key: string): Promise { await this.testSubjects.click(`~filter & ~filter-key-${key}`); await this.testSubjects.click(`disableFilter`); - await this.PageObjects.header.awaitGlobalLoadingIndicatorHidden(); + await this.header.awaitGlobalLoadingIndicatorHidden(); } public async toggleFilterPinned(key: string): Promise { await this.testSubjects.click(`~filter & ~filter-key-${key}`); await this.testSubjects.click(`pinFilter`); - await this.PageObjects.header.awaitGlobalLoadingIndicatorHidden(); + await this.header.awaitGlobalLoadingIndicatorHidden(); } public async isFilterPinned(key: string): Promise { @@ -141,7 +142,7 @@ export class FilterBarService extends FtrService { } } await this.testSubjects.click('saveFilter'); - await this.PageObjects.header.awaitGlobalLoadingIndicatorHidden(); + await this.header.awaitGlobalLoadingIndicatorHidden(); } /** @@ -152,7 +153,7 @@ export class FilterBarService extends FtrService { public async clickEditFilter(key: string, value: string): Promise { await this.testSubjects.click(`~filter & ~filter-key-${key} & ~filter-value-${value}`); await this.testSubjects.click(`editFilter`); - await this.PageObjects.header.awaitGlobalLoadingIndicatorHidden(); + await this.header.awaitGlobalLoadingIndicatorHidden(); } /** diff --git a/test/functional/services/index.ts b/test/functional/services/index.ts index a509141390f676..26f562799b2974 100644 --- a/test/functional/services/index.ts +++ b/test/functional/services/index.ts @@ -47,7 +47,7 @@ import { ListingTableService } from './listing_table'; import { SavedQueryManagementComponentService } from './saved_query_management_component'; import { KibanaSupertestProvider } from './supertest'; import { MenuToggleService } from './menu_toggle'; -import { MonacoEditorProvider } from './monaco_editor'; +import { MonacoEditorService } from './monaco_editor'; export const services = { ...commonServiceProviders, @@ -84,6 +84,6 @@ export const services = { elasticChart: ElasticChartService, supertest: KibanaSupertestProvider, managementMenu: ManagementMenuService, - monacoEditor: MonacoEditorProvider, + monacoEditor: MonacoEditorService, menuToggle: MenuToggleService, }; diff --git a/test/functional/services/lib/web_element_wrapper/web_element_wrapper.ts b/test/functional/services/lib/web_element_wrapper/web_element_wrapper.ts index b1561b29342dad..148c21ffac191b 100644 --- a/test/functional/services/lib/web_element_wrapper/web_element_wrapper.ts +++ b/test/functional/services/lib/web_element_wrapper/web_element_wrapper.ts @@ -9,7 +9,6 @@ import { delay } from 'bluebird'; import { WebElement, WebDriver, By, Key } from 'selenium-webdriver'; import { PNG } from 'pngjs'; -// @ts-ignore not supported yet import cheerio from 'cheerio'; import testSubjSelector from '@kbn/test-subj-selector'; import { ToolingLog } from '@kbn/dev-utils'; diff --git a/test/functional/services/listing_table.ts b/test/functional/services/listing_table.ts index 79678cf7a812b8..1cd4249df5050c 100644 --- a/test/functional/services/listing_table.ts +++ b/test/functional/services/listing_table.ts @@ -17,8 +17,8 @@ export class ListingTableService extends FtrService { private readonly find = this.ctx.getService('find'); private readonly log = this.ctx.getService('log'); private readonly retry = this.ctx.getService('retry'); - private readonly common = this.ctx.getPageObjects(['common']).common; - private readonly header = this.ctx.getPageObjects(['header']).header; + private readonly common = this.ctx.getPageObject('common'); + private readonly header = this.ctx.getPageObject('header'); private async getSearchFilter() { return await this.testSubjects.find('tableListSearchBox'); diff --git a/test/functional/services/management/management_menu.ts b/test/functional/services/management/management_menu.ts index 738a8d55439ece..2b93fce4daa51e 100644 --- a/test/functional/services/management/management_menu.ts +++ b/test/functional/services/management/management_menu.ts @@ -13,7 +13,7 @@ export class ManagementMenuService extends FtrService { public async getSections() { const sectionsElements = await this.find.allByCssSelector( - '.mgtSideBarNav > .euiSideNav__content > .euiSideNavItem' + '.kbnPageTemplateSolutionNav .euiSideNavItem--root' ); const sections = []; diff --git a/test/functional/services/monaco_editor.ts b/test/functional/services/monaco_editor.ts index 4e791e54c4b09c..572606f8964546 100644 --- a/test/functional/services/monaco_editor.ts +++ b/test/functional/services/monaco_editor.ts @@ -6,26 +6,24 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; -export function MonacoEditorProvider({ getService }: FtrProviderContext) { - const retry = getService('retry'); - const browser = getService('browser'); +export class MonacoEditorService extends FtrService { + private readonly retry = this.ctx.getService('retry'); + private readonly browser = this.ctx.getService('browser'); - return new (class MonacoEditor { - public async getCodeEditorValue(nthIndex: number = 0) { - let values: string[] = []; + public async getCodeEditorValue(nthIndex: number = 0) { + let values: string[] = []; - await retry.try(async () => { - values = await browser.execute( - () => - (window as any).MonacoEnvironment.monaco.editor - .getModels() - .map((model: any) => model.getValue()) as string[] - ); - }); + await this.retry.try(async () => { + values = await this.browser.execute( + () => + (window as any).MonacoEnvironment.monaco.editor + .getModels() + .map((model: any) => model.getValue()) as string[] + ); + }); - return values[nthIndex] as string; - } - })(); + return values[nthIndex] as string; + } } diff --git a/test/functional/services/query_bar.ts b/test/functional/services/query_bar.ts index 31586d92d92a9d..f0728f2b022e30 100644 --- a/test/functional/services/query_bar.ts +++ b/test/functional/services/query_bar.ts @@ -13,7 +13,8 @@ export class QueryBarService extends FtrService { private readonly testSubjects = this.ctx.getService('testSubjects'); private readonly retry = this.ctx.getService('retry'); private readonly log = this.ctx.getService('log'); - private readonly PageObjects = this.ctx.getPageObjects(['header', 'common']); + private readonly common = this.ctx.getPageObject('common'); + private readonly header = this.ctx.getPageObject('header'); private readonly find = this.ctx.getService('find'); private readonly browser = this.ctx.getService('browser'); @@ -42,15 +43,15 @@ export class QueryBarService extends FtrService { public async clearQuery(): Promise { await this.setQuery(''); - await this.PageObjects.common.pressTabKey(); // move outside of input into language switcher - await this.PageObjects.common.pressTabKey(); // move outside of language switcher so time picker appears + await this.common.pressTabKey(); // move outside of input into language switcher + await this.common.pressTabKey(); // move outside of language switcher so time picker appears } public async submitQuery(): Promise { this.log.debug('QueryBar.submitQuery'); await this.testSubjects.click('queryInput'); - await this.PageObjects.common.pressEnterKey(); - await this.PageObjects.header.waitUntilLoadingHasFinished(); + await this.common.pressEnterKey(); + await this.header.waitUntilLoadingHasFinished(); } public async clickQuerySubmitButton(): Promise { diff --git a/test/functional/services/remote/prevent_parallel_calls.ts b/test/functional/services/remote/prevent_parallel_calls.ts index d21abc9d268674..338bfbd4278736 100644 --- a/test/functional/services/remote/prevent_parallel_calls.ts +++ b/test/functional/services/remote/prevent_parallel_calls.ts @@ -6,44 +6,49 @@ * Side Public License, v 1. */ -export function preventParallelCalls( - fn: (this: C, arg: A) => Promise, - filter: (arg: A) => boolean -) { - const execQueue: Task[] = []; +class Task { + public promise: Promise; + private resolve!: (result: R) => void; + private reject!: (error: Error) => void; - class Task { - public promise: Promise; - private resolve!: (result: R) => void; - private reject!: (error: Error) => void; - - constructor(private readonly context: C, private readonly arg: A) { - this.promise = new Promise((resolve, reject) => { - this.resolve = resolve; - this.reject = reject; - }); - } + constructor( + private readonly execQueue: Array>, + private readonly fn: (this: C, arg: A) => Promise, + private readonly context: C, + private readonly arg: A + ) { + this.promise = new Promise((resolve, reject) => { + this.resolve = resolve; + this.reject = reject; + }); + } - public async exec() { - try { - this.resolve(await fn.call(this.context, this.arg)); - } catch (error) { - this.reject(error); - } finally { - execQueue.shift(); - if (execQueue.length) { - execQueue[0].exec(); - } + public async exec() { + try { + this.resolve(await this.fn.call(this.context, this.arg)); + } catch (error) { + this.reject(error); + } finally { + this.execQueue.shift(); + if (this.execQueue.length) { + this.execQueue[0].exec(); } } } +} + +export function preventParallelCalls( + fn: (this: C, arg: A) => Promise, + filter: (arg: A) => boolean +) { + const execQueue: Array> = []; return async function (this: C, arg: A) { if (filter(arg)) { return await fn.call(this, arg); } - const task = new Task(this, arg); + const task = new Task(execQueue, fn, this, arg); if (execQueue.push(task) === 1) { // only item in the queue, kick it off task.exec(); diff --git a/test/functional/services/saved_query_management_component.ts b/test/functional/services/saved_query_management_component.ts index aabe8c0aebb0c6..decf1618c78793 100644 --- a/test/functional/services/saved_query_management_component.ts +++ b/test/functional/services/saved_query_management_component.ts @@ -14,7 +14,7 @@ export class SavedQueryManagementComponentService extends FtrService { private readonly queryBar = this.ctx.getService('queryBar'); private readonly retry = this.ctx.getService('retry'); private readonly config = this.ctx.getService('config'); - private readonly PageObjects = this.ctx.getPageObjects(['common']); + private readonly common = this.ctx.getPageObject('common'); public async getCurrentlyLoadedQueryID() { await this.openSavedQueryManagementComponent(); @@ -93,7 +93,7 @@ export class SavedQueryManagementComponentService extends FtrService { public async deleteSavedQuery(title: string) { await this.openSavedQueryManagementComponent(); await this.testSubjects.click(`~delete-saved-query-${title}-button`); - await this.PageObjects.common.clickConfirmOnModal(); + await this.common.clickConfirmOnModal(); } async clearCurrentlyLoadedQuery() { diff --git a/test/functional/services/visualizations/pie_chart.ts b/test/functional/services/visualizations/pie_chart.ts index f51492d29b4506..7c925318f0211f 100644 --- a/test/functional/services/visualizations/pie_chart.ts +++ b/test/functional/services/visualizations/pie_chart.ts @@ -20,16 +20,16 @@ export class PieChartService extends FtrService { private readonly find = this.ctx.getService('find'); private readonly panelActions = this.ctx.getService('dashboardPanelActions'); private readonly defaultFindTimeout = this.config.get('timeouts.find'); - private readonly pageObjects = this.ctx.getPageObjects(['visChart']); + private readonly visChart = this.ctx.getPageObject('visChart'); private readonly filterActionText = 'Apply filter to current view'; async clickOnPieSlice(name?: string) { this.log.debug(`PieChart.clickOnPieSlice(${name})`); - if (await this.pageObjects.visChart.isNewLibraryChart(pieChartSelector)) { + if (await this.visChart.isNewLibraryChart(pieChartSelector)) { const slices = - (await this.pageObjects.visChart.getEsChartDebugState(pieChartSelector))?.partition?.[0] - ?.partitions ?? []; + (await this.visChart.getEsChartDebugState(pieChartSelector))?.partition?.[0]?.partitions ?? + []; let sliceLabel = name || slices[0].name; if (name === 'Other') { sliceLabel = '__other__'; @@ -42,7 +42,7 @@ export class PieChartService extends FtrService { const pieWidth = pieSize.width; await pie.clickMouseButton({ xOffset: pieSlice.coords[0] - Math.floor(pieWidth / 2), - yOffset: Math.floor(pieHeight / 2) - pieSlice.coords[1], + yOffset: pieSlice.coords[1] - Math.floor(pieHeight / 2), }); } } else { @@ -87,14 +87,14 @@ export class PieChartService extends FtrService { async getPieSliceStyle(name: string) { this.log.debug(`VisualizePage.getPieSliceStyle(${name})`); - if (await this.pageObjects.visChart.isNewLibraryChart(pieChartSelector)) { + if (await this.visChart.isNewLibraryChart(pieChartSelector)) { const slices = - (await this.pageObjects.visChart.getEsChartDebugState(pieChartSelector))?.partition?.[0] - ?.partitions ?? []; + (await this.visChart.getEsChartDebugState(pieChartSelector))?.partition?.[0]?.partitions ?? + []; const selectedSlice = slices.filter((slice) => { return slice.name.toString() === name.replace(',', ''); }); - return selectedSlice[0].color; + return selectedSlice[0]?.color; } const pieSlice = await this.getPieSlice(name); return await pieSlice.getAttribute('style'); @@ -102,10 +102,10 @@ export class PieChartService extends FtrService { async getAllPieSliceStyles(name: string) { this.log.debug(`VisualizePage.getAllPieSliceStyles(${name})`); - if (await this.pageObjects.visChart.isNewLibraryChart(pieChartSelector)) { + if (await this.visChart.isNewLibraryChart(pieChartSelector)) { const slices = - (await this.pageObjects.visChart.getEsChartDebugState(pieChartSelector))?.partition?.[0] - ?.partitions ?? []; + (await this.visChart.getEsChartDebugState(pieChartSelector))?.partition?.[0]?.partitions ?? + []; const selectedSlice = slices.filter((slice) => { return slice.name.toString() === name.replace(',', ''); }); @@ -129,10 +129,10 @@ export class PieChartService extends FtrService { } async getPieChartLabels() { - if (await this.pageObjects.visChart.isNewLibraryChart(pieChartSelector)) { + if (await this.visChart.isNewLibraryChart(pieChartSelector)) { const slices = - (await this.pageObjects.visChart.getEsChartDebugState(pieChartSelector))?.partition?.[0] - ?.partitions ?? []; + (await this.visChart.getEsChartDebugState(pieChartSelector))?.partition?.[0]?.partitions ?? + []; return slices.map((slice) => { if (slice.name === '__missing__') { return 'Missing'; @@ -155,10 +155,10 @@ export class PieChartService extends FtrService { async getPieSliceCount() { this.log.debug('PieChart.getPieSliceCount'); - if (await this.pageObjects.visChart.isNewLibraryChart(pieChartSelector)) { + if (await this.visChart.isNewLibraryChart(pieChartSelector)) { const slices = - (await this.pageObjects.visChart.getEsChartDebugState(pieChartSelector))?.partition?.[0] - ?.partitions ?? []; + (await this.visChart.getEsChartDebugState(pieChartSelector))?.partition?.[0]?.partitions ?? + []; return slices?.length; } const slices = await this.find.allByCssSelector('svg > g > g.arcs > path.slice'); @@ -167,8 +167,8 @@ export class PieChartService extends FtrService { async expectPieSliceCountEsCharts(expectedCount: number) { const slices = - (await this.pageObjects.visChart.getEsChartDebugState(pieChartSelector))?.partition?.[0] - ?.partitions ?? []; + (await this.visChart.getEsChartDebugState(pieChartSelector))?.partition?.[0]?.partitions ?? + []; expect(slices.length).to.be(expectedCount); } diff --git a/test/interpreter_functional/config.ts b/test/interpreter_functional/config.ts index adcac520125ade..c0ec982fb98b6a 100644 --- a/test/interpreter_functional/config.ts +++ b/test/interpreter_functional/config.ts @@ -26,9 +26,6 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { servers: functionalConfig.get('servers'), esTestCluster: functionalConfig.get('esTestCluster'), apps: functionalConfig.get('apps'), - esArchiver: { - directory: path.resolve(__dirname, '../es_archives'), - }, snapshots: { directory: path.resolve(__dirname, 'snapshots'), }, diff --git a/test/interpreter_functional/test_suites/run_pipeline/index.ts b/test/interpreter_functional/test_suites/run_pipeline/index.ts index 18d20c97be81e9..9cf7e0deba2fac 100644 --- a/test/interpreter_functional/test_suites/run_pipeline/index.ts +++ b/test/interpreter_functional/test_suites/run_pipeline/index.ts @@ -20,8 +20,8 @@ export default function ({ getService, getPageObjects, loadTestFile }: FtrProvid this.tags(['skipFirefox']); before(async () => { - await esArchiver.loadIfNeeded('../functional/fixtures/es_archiver/logstash_functional'); - await esArchiver.load('../functional/fixtures/es_archiver/visualize_embedding'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); + await esArchiver.load('test/functional/fixtures/es_archiver/visualize_embedding'); await kibanaServer.uiSettings.replace({ 'dateFormat:tz': 'Australia/North', defaultIndex: 'logstash-*', diff --git a/test/new_visualize_flow/dashboard_embedding.ts b/test/new_visualize_flow/dashboard_embedding.ts index 04b91542223bad..3470973f9c96c5 100644 --- a/test/new_visualize_flow/dashboard_embedding.ts +++ b/test/new_visualize_flow/dashboard_embedding.ts @@ -34,7 +34,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('Dashboard Embedding', function describeIndexTests() { before(async () => { - await esArchiver.load('kibana'); + await esArchiver.load('test/new_visualize_flow/fixtures/es_archiver/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/new_visualize_flow/index.ts b/test/new_visualize_flow/index.ts index d17501305d0bda..02245002e83360 100644 --- a/test/new_visualize_flow/index.ts +++ b/test/new_visualize_flow/index.ts @@ -14,7 +14,9 @@ export default function ({ loadTestFile, getService }: FtrProviderContext) { this.tags('ciGroup2'); const esArchiver = getService('esArchiver'); before(async () => { - await esArchiver.loadIfNeeded('logstash_functional'); + await esArchiver.loadIfNeeded( + 'test/new_visualize_flow/fixtures/es_archiver/logstash_functional' + ); }); loadTestFile(require.resolve('./dashboard_embedding')); diff --git a/test/plugin_functional/config.ts b/test/plugin_functional/config.ts index 631cbc8146d654..3791e663fb68c3 100644 --- a/test/plugin_functional/config.ts +++ b/test/plugin_functional/config.ts @@ -44,9 +44,6 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { serverArgs: ['xpack.security.enabled=false'], }, apps: functionalConfig.get('apps'), - esArchiver: { - directory: path.resolve(__dirname, '../es_archives'), - }, screenshots: functionalConfig.get('screenshots'), junit: { reportName: 'Plugin Functional Tests', diff --git a/test/plugin_functional/plugins/core_app_status/tsconfig.json b/test/plugin_functional/plugins/core_app_status/tsconfig.json index 4d979fbf7f15fd..0f0e7caf2b486a 100644 --- a/test/plugin_functional/plugins/core_app_status/tsconfig.json +++ b/test/plugin_functional/plugins/core_app_status/tsconfig.json @@ -1,8 +1,11 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { + "composite": true, "outDir": "./target", - "skipLibCheck": true + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true }, "include": [ "index.ts", @@ -10,5 +13,8 @@ "public/**/*.tsx", "../../../../typings/**/*", ], - "exclude": [] + "exclude": [], + "references": [ + { "path": "../../../../src/core/tsconfig.json" }, + ], } diff --git a/test/plugin_functional/plugins/core_plugin_deep_links/kibana.json b/test/plugin_functional/plugins/core_plugin_deep_links/kibana.json new file mode 100644 index 00000000000000..539550974c563a --- /dev/null +++ b/test/plugin_functional/plugins/core_plugin_deep_links/kibana.json @@ -0,0 +1,7 @@ +{ + "id": "corePluginDeepLinks", + "version": "0.0.1", + "kibanaVersion": "kibana", + "configPath": ["core_plugin_deep_links"], + "ui": true +} diff --git a/test/plugin_functional/plugins/core_plugin_deep_links/package.json b/test/plugin_functional/plugins/core_plugin_deep_links/package.json new file mode 100644 index 00000000000000..3fe16ddee53214 --- /dev/null +++ b/test/plugin_functional/plugins/core_plugin_deep_links/package.json @@ -0,0 +1,14 @@ +{ + "name": "core_plugin_deep_links", + "version": "1.0.0", + "main": "target/test/plugin_functional/plugins/core_plugin_deep_links", + "kibana": { + "version": "kibana", + "templateVersion": "1.0.0" + }, + "license": "SSPL-1.0 OR Elastic License 2.0", + "scripts": { + "kbn": "node ../../../../scripts/kbn.js", + "build": "rm -rf './target' && ../../../../node_modules/.bin/tsc" + } +} \ No newline at end of file diff --git a/test/plugin_functional/plugins/core_plugin_deep_links/public/application.tsx b/test/plugin_functional/plugins/core_plugin_deep_links/public/application.tsx new file mode 100644 index 00000000000000..90814bd552d37e --- /dev/null +++ b/test/plugin_functional/plugins/core_plugin_deep_links/public/application.tsx @@ -0,0 +1,158 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { History } from 'history'; +import React from 'react'; +import ReactDOM from 'react-dom'; +import { Router, Route, withRouter, RouteComponentProps, Redirect } from 'react-router-dom'; + +import { + EuiPage, + EuiPageBody, + EuiPageContent, + EuiPageContentBody, + EuiPageContentHeader, + EuiPageContentHeaderSection, + EuiPageHeader, + EuiPageHeaderSection, + EuiPageSideBar, + EuiTitle, + EuiSideNav, +} from '@elastic/eui'; + +import { CoreStart, AppMountParameters } from 'kibana/public'; + +const Home = () => ( + + + + +

Welcome to DL!

+
+
+
+ + + + +

DL home page section title

+
+
+
+ Wow this is the content! +
+
+); + +const PageA = () => ( + + + + +

DL Page A

+
+
+
+ + + + +

DL Page A section title

+
+
+
+ DL Page A's content goes here +
+
+); + +const PageB = () => ( + + + + +

DL Page B

+
+
+
+ + + + +

DL Page B section title

+
+
+
+ DL Page B's content goes here +
+
+); + +type NavProps = RouteComponentProps & { + navigateToApp: CoreStart['application']['navigateToApp']; +}; +const Nav = withRouter(({ history, navigateToApp }: NavProps) => ( + history.push('/home'), + 'data-test-subj': 'dlNavHome', + }, + { + id: 'page-a', + name: 'DL page A', + onClick: () => history.push('/page-a'), + 'data-test-subj': 'dlNavPageA', + }, + { + id: 'navigateDeepByPath', + name: 'DL section 1 page B', + onClick: () => { + navigateToApp('deeplinks', { path: '/page-b' }); + }, + 'data-test-subj': 'dlNavDeepPageB', + }, + { + id: 'navigateDeepById', + name: 'DL page A deep link', + onClick: () => { + navigateToApp('deeplinks', { deepLinkId: 'pageA' }); + }, + 'data-test-subj': 'dlNavDeepPageAById', + }, + ], + }, + ]} + /> +)); + +const DlApp = ({ history, coreStart }: { history: History; coreStart: CoreStart }) => ( + + + +

New to Kibana?