diff --git a/.ci/Jenkinsfile_visual_baseline b/.ci/Jenkinsfile_visual_baseline index 4a1e0f7d74e07..5c13ccccd9c6f 100644 --- a/.ci/Jenkinsfile_visual_baseline +++ b/.ci/Jenkinsfile_visual_baseline @@ -6,13 +6,15 @@ kibanaLibrary.load() kibanaPipeline(timeoutMinutes: 120) { catchError { parallel([ - workers.base(name: 'oss-visualRegression', label: 'linux && immutable') { - kibanaPipeline.buildOss() - kibanaPipeline.functionalTestProcess('oss-visualRegression', './test/scripts/jenkins_visual_regression.sh') + 'oss-visualRegression': { + workers.ci(name: 'oss-visualRegression', label: 'linux && immutable', ramDisk: false) { + kibanaPipeline.functionalTestProcess('oss-visualRegression', './test/scripts/jenkins_visual_regression.sh')(1) + } }, - workers.base(name: 'xpack-visualRegression', label: 'linux && immutable') { - kibanaPipeline.buildXpack() - kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh') + 'xpack-visualRegression': { + workers.ci(name: 'xpack-visualRegression', label: 'linux && immutable', ramDisk: false) { + kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh')(1) + } }, ]) } diff --git a/.eslintrc.js b/.eslintrc.js index 087d6276cd33f..b730b88a1b9cf 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -76,12 +76,6 @@ module.exports = { 'react-hooks/exhaustive-deps': 'off', }, }, - { - files: ['src/legacy/core_plugins/vis_type_vislib/**/*.{js,ts,tsx}'], - rules: { - 'react-hooks/exhaustive-deps': 'off', - }, - }, { files: [ 'src/legacy/core_plugins/vis_default_editor/public/components/controls/**/*.{ts,tsx}', @@ -520,6 +514,16 @@ module.exports = { }, }, + /** + * Harden specific rules + */ + { + files: ['test/harden/*.js'], + rules: { + 'mocha/handle-done-callback': 'off', // TODO: Find a way to disable all mocha rules + }, + }, + /** * APM overrides */ diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index de46bcfa69830..de74a2c42be8b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -5,7 +5,6 @@ # App /x-pack/legacy/plugins/lens/ @elastic/kibana-app /x-pack/legacy/plugins/graph/ @elastic/kibana-app -/src/plugins/share/ @elastic/kibana-app /src/legacy/server/url_shortening/ @elastic/kibana-app /src/legacy/server/sample_data/ @elastic/kibana-app /src/legacy/core_plugins/kibana/public/dashboard/ @elastic/kibana-app @@ -27,6 +26,7 @@ /src/plugins/kibana_legacy/ @elastic/kibana-app /src/plugins/timelion/ @elastic/kibana-app /src/plugins/dev_tools/ @elastic/kibana-app +/src/plugins/dashboard_embeddable_container/ @elastic/kibana-app # App Architecture /packages/kbn-interpreter/ @elastic/kibana-app-arch @@ -42,7 +42,6 @@ /src/legacy/core_plugins/visualizations/ @elastic/kibana-app-arch /src/legacy/server/index_patterns/ @elastic/kibana-app-arch /src/plugins/bfetch/ @elastic/kibana-app-arch -/src/plugins/dashboard_embeddable_container/ @elastic/kibana-app-arch /src/plugins/data/ @elastic/kibana-app-arch /src/plugins/embeddable/ @elastic/kibana-app-arch /src/plugins/expressions/ @elastic/kibana-app-arch @@ -53,6 +52,9 @@ /src/plugins/navigation/ @elastic/kibana-app-arch /src/plugins/ui_actions/ @elastic/kibana-app-arch /src/plugins/visualizations/ @elastic/kibana-app-arch +/src/plugins/share/ @elastic/kibana-app-arch +/examples/url_generators_examples/ @elastic/kibana-app-arch +/examples/url_generators_explorer/ @elastic/kibana-app-arch /x-pack/plugins/advanced_ui_actions/ @elastic/kibana-app-arch /x-pack/plugins/drilldowns/ @elastic/kibana-app-arch @@ -80,12 +82,14 @@ # Machine Learning /x-pack/legacy/plugins/ml/ @elastic/ml-ui +/x-pack/plugins/ml/ @elastic/ml-ui /x-pack/test/functional/apps/machine_learning/ @elastic/ml-ui /x-pack/test/functional/services/machine_learning/ @elastic/ml-ui /x-pack/test/functional/services/ml.ts @elastic/ml-ui # ML team owns the transform plugin, ES team added here for visibility # because the plugin lives in Kibana's Elasticsearch management section. /x-pack/legacy/plugins/transform/ @elastic/ml-ui @elastic/es-ui +/x-pack/plugins/transform/ @elastic/ml-ui @elastic/es-ui /x-pack/test/functional/apps/transform/ @elastic/ml-ui /x-pack/test/functional/services/transform_ui/ @elastic/ml-ui /x-pack/test/functional/services/transform.ts @elastic/ml-ui @@ -128,6 +132,7 @@ /src/legacy/server/logging/ @elastic/kibana-platform /src/legacy/server/saved_objects/ @elastic/kibana-platform /src/legacy/server/status/ @elastic/kibana-platform +/src/plugins/status_page/ @elastic/kibana-platform /src/dev/run_check_core_api_changes.ts @elastic/kibana-platform # Security diff --git a/.github/workflows/pr-project-assigner.yml b/.github/workflows/pr-project-assigner.yml index 517aefb36e8d6..4058fcaadee5d 100644 --- a/.github/workflows/pr-project-assigner.yml +++ b/.github/workflows/pr-project-assigner.yml @@ -13,8 +13,9 @@ jobs: with: issue-mappings: | [ - { "label": "Team:AppArch", "projectName": "kibana-app-arch", "columnId": 6173897 }, - { "label": "Feature:Lens", "projectName": "Lens", "columnId": 6219362 }, - { "label": "Team:Canvas", "projectName": "canvas", "columnId": 6187580 } ] ghToken: ${{ secrets.PROJECT_ASSIGNER_TOKEN }} + +# { "label": "Team:AppArch", "projectName": "kibana-app-arch", "columnId": 6173897 }, +# { "label": "Feature:Lens", "projectName": "Lens", "columnId": 6219362 }, +# { "label": "Team:Canvas", "projectName": "canvas", "columnId": 6187580 } diff --git a/.gitignore b/.gitignore index 02b20da297fc6..efb5c57774633 100644 --- a/.gitignore +++ b/.gitignore @@ -44,5 +44,3 @@ package-lock.json *.sublime-* npm-debug.log* .tern-project -x-pack/legacy/plugins/apm/tsconfig.json -apm.tsconfig.json diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bd7868adb511e..aec6d44ad4abf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -391,9 +391,9 @@ Note that for VSCode, to enable "live" linting of TypeScript (and other) file ty All user-facing labels and info texts in Kibana should be internationalized. Please take a look at the [readme](packages/kbn-i18n/README.md) and the [guideline](packages/kbn-i18n/GUIDELINE.md) of the i18n package on how to do so. -In order to enable translations in the React parts of the application, the top most component of every `ReactDOM.render` call should be an `I18nContext`: +In order to enable translations in the React parts of the application, the top most component of every `ReactDOM.render` call should be the `Context` component from the `i18n` core service: ```jsx -import { I18nContext } from 'ui/i18n'; +const I18nContext = coreStart.i18n.Context; ReactDOM.render( diff --git a/Jenkinsfile b/Jenkinsfile index 85502369b07be..742aec1d4e7ab 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -40,6 +40,7 @@ kibanaPipeline(timeoutMinutes: 135) { 'xpack-ciGroup9': kibanaPipeline.xpackCiGroupProcess(9), 'xpack-ciGroup10': kibanaPipeline.xpackCiGroupProcess(10), 'xpack-accessibility': kibanaPipeline.functionalTestProcess('xpack-accessibility', './test/scripts/jenkins_xpack_accessibility.sh'), + 'xpack-siemCypress': kibanaPipeline.functionalTestProcess('xpack-siemCypress', './test/scripts/jenkins_siem_cypress.sh'), // 'xpack-visualRegression': kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh'), ]), ]) diff --git a/docs/apm/advanced-queries.asciidoc b/docs/apm/advanced-queries.asciidoc index 942882f8c4dfb..971d543bbb445 100644 --- a/docs/apm/advanced-queries.asciidoc +++ b/docs/apm/advanced-queries.asciidoc @@ -5,7 +5,7 @@ When querying in the APM app, you're simply searching and selecting data from fi Queries entered into the query bar are also added as parameters to the URL, so it's easy to share a specific query or view with others. -In the screenshot below, you can begin to see some of the transaction fields available for filtering on: +In the screenshot below, you can begin to see some of the transaction fields available for filtering on: [role="screenshot"] image::apm/images/apm-query-bar.png[Example of the Kibana Query bar in APM app in Kibana] @@ -25,7 +25,7 @@ TIP: Read the {kibana-ref}/kuery-query.html[Kibana Query Language Enhancements] It may also be helpful to view your APM data in the {kibana-ref}/discover.html[Discover app]. Querying documents in Discover works the same way as querying in the APM app, -and all of the example queries listed above can also be used in the Discover app. +and all of the example APM app queries can also be used in the Discover app. [float] ==== Example Discover app query diff --git a/docs/canvas/canvas-function-reference.asciidoc b/docs/canvas/canvas-function-reference.asciidoc index 85e9d22490497..16aaf55802b17 100644 --- a/docs/canvas/canvas-function-reference.asciidoc +++ b/docs/canvas/canvas-function-reference.asciidoc @@ -3,13 +3,13 @@ == Canvas function reference Behind the scenes, Canvas is driven by a powerful expression language, -with dozens of functions and other capabilities, including table transforms, +with dozens of functions and other capabilities, including table transforms, type casting, and sub-expressions. The Canvas expression language also supports <>, which perform complex math calculations. -A *** denotes a required argument. +A *** denotes a required argument. A † denotes an argument can be passed multiple times. @@ -184,7 +184,7 @@ filters ---- `as` casts any primitive value (`string`, `number`, `date`, `null`) into a `datatable` with a single row and a single column with the given name (or defaults to `"value"` if no name is provided). This is useful when piping a primitive value into a function that only takes `datatable` as an input. -In the example above, `ply` expects each `fn` subexpression to return a `datatable` in order to merge the results of each `fn` back into a `datatable`, but using a `math` aggregation in the subexpressions returns a single `math` value, which is then cast into a `datatable` using `as`. +In the example, `ply` expects each `fn` subexpression to return a `datatable` in order to merge the results of each `fn` back into a `datatable`, but using a `math` aggregation in the subexpressions returns a single `math` value, which is then cast into a `datatable` using `as`. *Accepts:* `string`, `boolean`, `number`, `null` @@ -496,14 +496,14 @@ containerStyle backgroundImage={asset id=asset-f40d2292-cf9e-4f2c-8c6f-a504a25e9 *Code example* [source,text] ---- -shape "star" fill="#E61D35" maintainAspect=true -| render containerStyle={ - containerStyle backgroundColor="#F8D546" - borderRadius="200px" - border="4px solid #05509F" - padding="0px" - opacity="0.9" - overflow="hidden" +shape "star" fill="#E61D35" maintainAspect=true +| render containerStyle={ + containerStyle backgroundColor="#F8D546" + borderRadius="200px" + border="4px solid #05509F" + padding="0px" + opacity="0.9" + overflow="hidden" } ---- @@ -1437,8 +1437,8 @@ Aliases: `dataurl`, `url` |`string`, `null` |The HTTP(S) URL or `base64` data URL of an image. -Example value for the _Unnamed_ argument, formatted as a `base64` data URL: -[source, url] +Example value for the _Unnamed_ argument, formatted as a `base64` data URL: +[source, url] ------------ data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgdmlld0JveD0iMCAwIDI3MC42MDAwMSAyNjkuNTQ2NjYiCiAgIGhlaWdodD0iMjY5LjU0NjY2IgogICB3aWR0aD0iMjcwLjYwMDAxIgogICB4bWw6c3BhY2U9InByZXNlcnZlIgogICBpZD0ic3ZnMiIKICAgdmVyc2lvbj0iMS4xIj48bWV0YWRhdGEKICAgICBpZD0ibWV0YWRhdGE4Ij48cmRmOlJERj48Y2M6V29yawogICAgICAgICByZGY6YWJvdXQ9IiI+PGRjOmZvcm1hdD5pbWFnZS9zdmcreG1sPC9kYzpmb3JtYXQ+PGRjOnR5cGUKICAgICAgICAgICByZGY6cmVzb3VyY2U9Imh0dHA6Ly9wdXJsLm9yZy9kYy9kY21pdHlwZS9TdGlsbEltYWdlIiAvPjwvY2M6V29yaz48L3JkZjpSREY+PC9tZXRhZGF0YT48ZGVmcwogICAgIGlkPSJkZWZzNiIgLz48ZwogICAgIHRyYW5zZm9ybT0ibWF0cml4KDEuMzMzMzMzMywwLDAsLTEuMzMzMzMzMywwLDI2OS41NDY2NykiCiAgICAgaWQ9ImcxMCI+PGcKICAgICAgIHRyYW5zZm9ybT0ic2NhbGUoMC4xKSIKICAgICAgIGlkPSJnMTIiPjxwYXRoCiAgICAgICAgIGlkPSJwYXRoMTQiCiAgICAgICAgIHN0eWxlPSJmaWxsOiNmZmZmZmY7ZmlsbC1vcGFjaXR5OjE7ZmlsbC1ydWxlOm5vbnplcm87c3Ryb2tlOm5vbmUiCiAgICAgICAgIGQ9Im0gMjAyOS40OCw5NjIuNDQxIGMgMCwxNzAuMDk5IC0xMDUuNDYsMzE4Ljc5OSAtMjY0LjE3LDM3Ni42NTkgNi45OCwzNS44NiAxMC42Miw3MS43MSAxMC42MiwxMDkuMDUgMCwzMTYuMTkgLTI1Ny4yNCw1NzMuNDMgLTU3My40Nyw1NzMuNDMgLTE4NC43MiwwIC0zNTYuNTU4LC04OC41OSAtNDY0LjUzLC0yMzcuODUgLTUzLjA5LDQxLjE4IC0xMTguMjg1LDYzLjc1IC0xODYuMzA1LDYzLjc1IC0xNjcuODM2LDAgLTMwNC4zODMsLTEzNi41NCAtMzA0LjM4MywtMzA0LjM4IDAsLTM3LjA4IDYuNjE3LC03Mi41OCAxOS4wMzEsLTEwNi4wOCBDIDEwOC40ODgsMTM4MC4wOSAwLDEyMjcuODkgMCwxMDU4Ljg4IDAsODg3LjkxIDEwNS45NzcsNzM4LjUzOSAyNjUuMzk4LDY4MS4wOSBjIC02Ljc2OSwtMzUuNDQyIC0xMC40NiwtNzIuMDIgLTEwLjQ2LC0xMDkgQyAyNTQuOTM4LDI1Ni42MjEgNTExLjU2NiwwIDgyNy4wMjcsMCAxMDEyLjIsMCAxMTgzLjk0LDg4Ljk0MTQgMTI5MS4zLDIzOC44MzIgYyA1My40NSwtNDEuOTYxIDExOC44LC02NC45OTIgMTg2LjU2LC02NC45OTIgMTY3LjgzLDAgMzA0LjM4LDEzNi40OTIgMzA0LjM4LDMwNC4zMzIgMCwzNy4wNzggLTYuNjIsNzIuNjI5IC0xOS4wMywxMDYuMTI5IDE1Ny43OCw1Ni44NzkgMjY2LjI3LDIwOS4xMjkgMjY2LjI3LDM3OC4xNCIgLz48cGF0aAogICAgICAgICBpZD0icGF0aDE2IgogICAgICAgICBzdHlsZT0iZmlsbDojZmFjZjA5O2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIgogICAgICAgICBkPSJtIDc5Ny44OTgsMTE1MC45MyA0NDQuMDcyLC0yMDIuNDUgNDQ4LjA1LDM5Mi41OCBjIDYuNDksMzIuMzkgOS42Niw2NC42NyA5LjY2LDk4LjQ2IDAsMjc2LjIzIC0yMjQuNjgsNTAwLjk1IC01MDAuOSw1MDAuOTUgLTE2NS4yNCwwIC0zMTkuMzcsLTgxLjM2IC00MTMuMDUzLC0yMTcuNzkgbCAtNzQuNTI0LC0zODYuNjQgODYuNjk1LC0xODUuMTEiIC8+PHBhdGgKICAgICAgICAgaWQ9InBhdGgxOCIKICAgICAgICAgc3R5bGU9ImZpbGw6IzQ5YzFhZTtmaWxsLW9wYWNpdHk6MTtmaWxsLXJ1bGU6bm9uemVybztzdHJva2U6bm9uZSIKICAgICAgICAgZD0ibSAzMzguMjIzLDY4MC42NzIgYyAtNi40ODksLTMyLjM4MyAtOS44MDksLTY1Ljk4MSAtOS44MDksLTk5Ljk3MyAwLC0yNzYuOTI5IDIyNS4zMzYsLTUwMi4yNTc2IDUwMi4zMTMsLTUwMi4yNTc2IDE2Ni41OTMsMCAzMjEuNDczLDgyLjExNzYgNDE1LjAxMywyMTkuOTQ5NiBsIDczLjk3LDM4NS4zNDcgLTk4LjcyLDE4OC42MjEgTCA3NzUuMTU2LDEwNzUuNTcgMzM4LjIyMyw2ODAuNjcyIiAvPjxwYXRoCiAgICAgICAgIGlkPSJwYXRoMjAiCiAgICAgICAgIHN0eWxlPSJmaWxsOiNlZjI5OWI7ZmlsbC1vcGFjaXR5OjE7ZmlsbC1ydWxlOm5vbnplcm87c3Ryb2tlOm5vbmUiCiAgICAgICAgIGQ9Im0gMzM1LjQxLDE0NDkuMTggMzA0LjMzMiwtNzEuODYgNjYuNjgsMzQ2LjAyIGMgLTQxLjU4NiwzMS43OCAtOTIuOTMsNDkuMTggLTE0NS43MzEsNDkuMTggLTEzMi4yNSwwIC0yMzkuODEyLC0xMDcuNjEgLTIzOS44MTIsLTIzOS44NyAwLC0yOS4yMSA0Ljg3OSwtNTcuMjIgMTQuNTMxLC04My40NyIgLz48cGF0aAogICAgICAgICBpZD0icGF0aDIyIgogICAgICAgICBzdHlsZT0iZmlsbDojNGNhYmU0O2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIgogICAgICAgICBkPSJNIDMwOC45OTIsMTM3Ni43IEMgMTczLjAyLDEzMzEuNjQgNzguNDgwNSwxMjAxLjMgNzguNDgwNSwxMDU3LjkzIDc4LjQ4MDUsOTE4LjM0IDE2NC44Miw3OTMuNjggMjk0LjQwNiw3NDQuMzUyIGwgNDI2Ljk4MSwzODUuOTM4IC03OC4zOTUsMTY3LjUxIC0zMzQsNzguOSIgLz48cGF0aAogICAgICAgICBpZD0icGF0aDI0IgogICAgICAgICBzdHlsZT0iZmlsbDojODVjZTI2O2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIgogICAgICAgICBkPSJtIDEzMjMuOCwyOTguNDEgYyA0MS43NCwtMzIuMDkgOTIuODMsLTQ5LjU5IDE0NC45OCwtNDkuNTkgMTMyLjI1LDAgMjM5LjgxLDEwNy41NTkgMjM5LjgxLDIzOS44MjEgMCwyOS4xNiAtNC44OCw1Ny4xNjggLTE0LjUzLDgzLjQxOCBsIC0zMDQuMDgsNzEuMTYgLTY2LjE4LC0zNDQuODA5IiAvPjxwYXRoCiAgICAgICAgIGlkPSJwYXRoMjYiCiAgICAgICAgIHN0eWxlPSJmaWxsOiMzMTc3YTc7ZmlsbC1vcGFjaXR5OjE7ZmlsbC1ydWxlOm5vbnplcm87c3Ryb2tlOm5vbmUiCiAgICAgICAgIGQ9Im0gMTM4NS42Nyw3MjIuOTMgMzM0Ljc2LC03OC4zMDEgYyAxMzYuMDIsNDQuOTYxIDIzMC41NiwxNzUuMzUxIDIzMC41NiwzMTguNzYyIDAsMTM5LjMzOSAtODYuNTQsMjYzLjg1OSAtMjE2LjM4LDMxMy4wMzkgbCAtNDM3Ljg0LC0zODMuNTkgODguOSwtMTY5LjkxIiAvPjwvZz48L2c+PC9zdmc+ ------------ @@ -2052,8 +2052,8 @@ Default: `null` |`string`, `null` |The image to repeat. Provide an image asset as a `base64` data URL, or pass in a sub-expression. -Example value for the `image` argument, formatted as a `base64` data URL: -[source, url] +Example value for the `image` argument, formatted as a `base64` data URL: +[source, url] ------------ data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3Csvg%20viewBox%3D%22-3.948730230331421%20-1.7549896240234375%20245.25946044921875%20241.40370178222656%22%20width%3D%22245.25946044921875%22%20height%3D%22241.40370178222656%22%20style%3D%22enable-background%3Anew%200%200%20686.2%20235.7%3B%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Cdefs%3E%0A%20%20%20%20%3Cstyle%20type%3D%22text%2Fcss%22%3E%0A%09.st0%7Bfill%3A%232D2D2D%3B%7D%0A%3C%2Fstyle%3E%0A%20%20%3C%2Fdefs%3E%0A%20%20%3Cg%20transform%3D%22matrix%281%2C%200%2C%200%2C%201%2C%200%2C%200%29%22%3E%0A%20%20%20%20%3Cg%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M329.4%2C160.3l4.7-0.5l0.3%2C9.6c-12.4%2C1.7-23%2C2.6-31.8%2C2.6c-11.7%2C0-20-3.4-24.9-10.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-4.9-6.8-7.3-17.4-7.3-31.7c0-28.6%2C11.4-42.9%2C34.1-42.9c11%2C0%2C19.2%2C3.1%2C24.6%2C9.2c5.4%2C6.1%2C8.1%2C15.8%2C8.1%2C28.9l-0.7%2C9.3h-53.8%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc0%2C9%2C1.6%2C15.7%2C4.9%2C20c3.3%2C4.3%2C8.9%2C6.5%2C17%2C6.5C312.8%2C161.2%2C321.1%2C160.9%2C329.4%2C160.3z%20M325%2C124.9c0-10-1.6-17.1-4.8-21.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-3.2-4.1-8.4-6.2-15.6-6.2c-7.2%2C0-12.7%2C2.2-16.3%2C6.5c-3.6%2C4.3-5.5%2C11.3-5.6%2C20.9H325z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M354.3%2C171.4V64h12.2v107.4H354.3z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M443.5%2C113.5v41.1c0%2C4.1%2C10.1%2C3.9%2C10.1%2C3.9l-0.6%2C10.8c-8.6%2C0-15.7%2C0.7-20-3.4c-9.8%2C4.3-19.5%2C6.1-29.3%2C6.1%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-7.5%2C0-13.2-2.1-17.1-6.4c-3.9-4.2-5.9-10.3-5.9-18.3c0-7.9%2C2-13.8%2C6-17.5c4-3.7%2C10.3-6.1%2C18.9-6.9l25.6-2.4v-7%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc0-5.5-1.2-9.5-3.6-11.9c-2.4-2.4-5.7-3.6-9.8-3.6l-32.1%2C0V87.2h31.3c9.2%2C0%2C15.9%2C2.1%2C20.1%2C6.4C441.4%2C97.8%2C443.5%2C104.5%2C443.5%2C113.5%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bz%20M393.3%2C146.7c0%2C10%2C4.1%2C15%2C12.4%2C15c7.4%2C0%2C14.7-1.2%2C21.8-3.7l3.7-1.3v-26.9l-24.1%2C2.3c-4.9%2C0.4-8.4%2C1.8-10.6%2C4.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3BC394.4%2C138.7%2C393.3%2C142.2%2C393.3%2C146.7z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M491.2%2C98.2c-11.8%2C0-17.8%2C4.1-17.8%2C12.4c0%2C3.8%2C1.4%2C6.5%2C4.1%2C8.1c2.7%2C1.6%2C8.9%2C3.2%2C18.6%2C4.9%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc9.7%2C1.7%2C16.5%2C4%2C20.5%2C7.1c4%2C3%2C6%2C8.7%2C6%2C17.1c0%2C8.4-2.7%2C14.5-8.1%2C18.4c-5.4%2C3.9-13.2%2C5.9-23.6%2C5.9c-6.7%2C0-29.2-2.5-29.2-2.5%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bl0.7-10.6c12.9%2C1.2%2C22.3%2C2.2%2C28.6%2C2.2c6.3%2C0%2C11.1-1%2C14.4-3c3.3-2%2C5-5.4%2C5-10.1c0-4.7-1.4-7.9-4.2-9.6c-2.8-1.7-9-3.3-18.6-4.8%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-9.6-1.5-16.4-3.7-20.4-6.7c-4-2.9-6-8.4-6-16.3c0-7.9%2C2.8-13.8%2C8.4-17.6c5.6-3.8%2C12.6-5.7%2C20.9-5.7c6.6%2C0%2C29.6%2C1.7%2C29.6%2C1.7%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bv10.7C508.1%2C99%2C498.2%2C98.2%2C491.2%2C98.2z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M581.7%2C99.5h-25.9v39c0%2C9.3%2C0.7%2C15.5%2C2%2C18.4c1.4%2C2.9%2C4.6%2C4.4%2C9.7%2C4.4l14.5-1l0.8%2C10.1%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-7.3%2C1.2-12.8%2C1.8-16.6%2C1.8c-8.5%2C0-14.3-2.1-17.6-6.2c-3.3-4.1-4.9-12-4.9-23.6V99.5h-11.6V88.9h11.6V63.9h12.1v24.9h25.9V99.5z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M598.7%2C78.4V64.3h12.2v14.2H598.7z%20M598.7%2C171.4V88.9h12.2v82.5H598.7z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M663.8%2C87.2c3.6%2C0%2C9.7%2C0.7%2C18.3%2C2l3.9%2C0.5l-0.5%2C9.9c-8.7-1-15.1-1.5-19.2-1.5c-9.2%2C0-15.5%2C2.2-18.8%2C6.6%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-3.3%2C4.4-5%2C12.6-5%2C24.5c0%2C11.9%2C1.5%2C20.2%2C4.6%2C24.9c3.1%2C4.7%2C9.5%2C7%2C19.3%2C7l19.2-1.5l0.5%2C10.1c-10.1%2C1.5-17.7%2C2.3-22.7%2C2.3%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-12.7%2C0-21.5-3.3-26.3-9.8c-4.8-6.5-7.3-17.5-7.3-33c0-15.5%2C2.6-26.4%2C7.8-32.6C643%2C90.4%2C651.7%2C87.2%2C663.8%2C87.2z%22%2F%3E%0A%20%20%20%20%3C%2Fg%3E%0A%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M236.6%2C123.5c0-19.8-12.3-37.2-30.8-43.9c0.8-4.2%2C1.2-8.4%2C1.2-12.7C207%2C30%2C177%2C0%2C140.2%2C0%26%2310%3B%26%239%3B%26%239%3BC118.6%2C0%2C98.6%2C10.3%2C86%2C27.7c-6.2-4.8-13.8-7.4-21.7-7.4c-19.6%2C0-35.5%2C15.9-35.5%2C35.5c0%2C4.3%2C0.8%2C8.5%2C2.2%2C12.4%26%2310%3B%26%239%3B%26%239%3BC12.6%2C74.8%2C0%2C92.5%2C0%2C112.2c0%2C19.9%2C12.4%2C37.3%2C30.9%2C44c-0.8%2C4.1-1.2%2C8.4-1.2%2C12.7c0%2C36.8%2C29.9%2C66.7%2C66.7%2C66.7%26%2310%3B%26%239%3B%26%239%3Bc21.6%2C0%2C41.6-10.4%2C54.1-27.8c6.2%2C4.9%2C13.8%2C7.6%2C21.7%2C7.6c19.6%2C0%2C35.5-15.9%2C35.5-35.5c0-4.3-0.8-8.5-2.2-12.4%26%2310%3B%26%239%3B%26%239%3BC223.9%2C160.9%2C236.6%2C143.2%2C236.6%2C123.5z%20M91.6%2C34.8c10.9-15.9%2C28.9-25.4%2C48.1-25.4c32.2%2C0%2C58.4%2C26.2%2C58.4%2C58.4%26%2310%3B%26%239%3B%26%239%3Bc0%2C3.9-0.4%2C7.7-1.1%2C11.5l-52.2%2C45.8L93%2C101.5L82.9%2C79.9L91.6%2C34.8z%20M65.4%2C29c6.2%2C0%2C12.1%2C2%2C17%2C5.7l-7.8%2C40.3l-35.5-8.4%26%2310%3B%26%239%3B%26%239%3Bc-1.1-3.1-1.7-6.3-1.7-9.7C37.4%2C41.6%2C49.9%2C29%2C65.4%2C29z%20M9.1%2C112.3c0-16.7%2C11-31.9%2C26.9-37.2L75%2C84.4l9.1%2C19.5l-49.8%2C45%26%2310%3B%26%239%3B%26%239%3BC19.2%2C143.1%2C9.1%2C128.6%2C9.1%2C112.3z%20M145.2%2C200.9c-10.9%2C16.1-29%2C25.6-48.4%2C25.6c-32.3%2C0-58.6-26.3-58.6-58.5c0-4%2C0.4-7.9%2C1.1-11.7%26%2310%3B%26%239%3B%26%239%3Bl50.9-46l52%2C23.7l11.5%2C22L145.2%2C200.9z%20M171.2%2C206.6c-6.1%2C0-12-2-16.9-5.8l7.7-40.2l35.4%2C8.3c1.1%2C3.1%2C1.7%2C6.3%2C1.7%2C9.7%26%2310%3B%26%239%3B%26%239%3BC199.2%2C194.1%2C186.6%2C206.6%2C171.2%2C206.6z%20M200.5%2C160.5l-39-9.1l-10.4-19.8l51-44.7c15.1%2C5.7%2C25.2%2C20.2%2C25.2%2C36.5%26%2310%3B%26%239%3B%26%239%3BC227.4%2C140.1%2C216.4%2C155.3%2C200.5%2C160.5z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E ------------ @@ -2132,8 +2132,8 @@ Default: `null` |`string`, `null` |The image to reveal. Provide an image asset as a `base64` data URL, or pass in a sub-expression. -Example value for the `image` argument, formatted as a `base64` data URL: -[source, url] +Example value for the `image` argument, formatted as a `base64` data URL: +[source, url] ------------ data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3Csvg%20viewBox%3D%22-3.948730230331421%20-1.7549896240234375%20245.25946044921875%20241.40370178222656%22%20width%3D%22245.25946044921875%22%20height%3D%22241.40370178222656%22%20style%3D%22enable-background%3Anew%200%200%20686.2%20235.7%3B%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Cdefs%3E%0A%20%20%20%20%3Cstyle%20type%3D%22text%2Fcss%22%3E%0A%09.st0%7Bfill%3A%232D2D2D%3B%7D%0A%3C%2Fstyle%3E%0A%20%20%3C%2Fdefs%3E%0A%20%20%3Cg%20transform%3D%22matrix%281%2C%200%2C%200%2C%201%2C%200%2C%200%29%22%3E%0A%20%20%20%20%3Cg%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M329.4%2C160.3l4.7-0.5l0.3%2C9.6c-12.4%2C1.7-23%2C2.6-31.8%2C2.6c-11.7%2C0-20-3.4-24.9-10.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-4.9-6.8-7.3-17.4-7.3-31.7c0-28.6%2C11.4-42.9%2C34.1-42.9c11%2C0%2C19.2%2C3.1%2C24.6%2C9.2c5.4%2C6.1%2C8.1%2C15.8%2C8.1%2C28.9l-0.7%2C9.3h-53.8%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc0%2C9%2C1.6%2C15.7%2C4.9%2C20c3.3%2C4.3%2C8.9%2C6.5%2C17%2C6.5C312.8%2C161.2%2C321.1%2C160.9%2C329.4%2C160.3z%20M325%2C124.9c0-10-1.6-17.1-4.8-21.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-3.2-4.1-8.4-6.2-15.6-6.2c-7.2%2C0-12.7%2C2.2-16.3%2C6.5c-3.6%2C4.3-5.5%2C11.3-5.6%2C20.9H325z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M354.3%2C171.4V64h12.2v107.4H354.3z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M443.5%2C113.5v41.1c0%2C4.1%2C10.1%2C3.9%2C10.1%2C3.9l-0.6%2C10.8c-8.6%2C0-15.7%2C0.7-20-3.4c-9.8%2C4.3-19.5%2C6.1-29.3%2C6.1%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-7.5%2C0-13.2-2.1-17.1-6.4c-3.9-4.2-5.9-10.3-5.9-18.3c0-7.9%2C2-13.8%2C6-17.5c4-3.7%2C10.3-6.1%2C18.9-6.9l25.6-2.4v-7%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc0-5.5-1.2-9.5-3.6-11.9c-2.4-2.4-5.7-3.6-9.8-3.6l-32.1%2C0V87.2h31.3c9.2%2C0%2C15.9%2C2.1%2C20.1%2C6.4C441.4%2C97.8%2C443.5%2C104.5%2C443.5%2C113.5%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bz%20M393.3%2C146.7c0%2C10%2C4.1%2C15%2C12.4%2C15c7.4%2C0%2C14.7-1.2%2C21.8-3.7l3.7-1.3v-26.9l-24.1%2C2.3c-4.9%2C0.4-8.4%2C1.8-10.6%2C4.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3BC394.4%2C138.7%2C393.3%2C142.2%2C393.3%2C146.7z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M491.2%2C98.2c-11.8%2C0-17.8%2C4.1-17.8%2C12.4c0%2C3.8%2C1.4%2C6.5%2C4.1%2C8.1c2.7%2C1.6%2C8.9%2C3.2%2C18.6%2C4.9%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc9.7%2C1.7%2C16.5%2C4%2C20.5%2C7.1c4%2C3%2C6%2C8.7%2C6%2C17.1c0%2C8.4-2.7%2C14.5-8.1%2C18.4c-5.4%2C3.9-13.2%2C5.9-23.6%2C5.9c-6.7%2C0-29.2-2.5-29.2-2.5%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bl0.7-10.6c12.9%2C1.2%2C22.3%2C2.2%2C28.6%2C2.2c6.3%2C0%2C11.1-1%2C14.4-3c3.3-2%2C5-5.4%2C5-10.1c0-4.7-1.4-7.9-4.2-9.6c-2.8-1.7-9-3.3-18.6-4.8%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-9.6-1.5-16.4-3.7-20.4-6.7c-4-2.9-6-8.4-6-16.3c0-7.9%2C2.8-13.8%2C8.4-17.6c5.6-3.8%2C12.6-5.7%2C20.9-5.7c6.6%2C0%2C29.6%2C1.7%2C29.6%2C1.7%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bv10.7C508.1%2C99%2C498.2%2C98.2%2C491.2%2C98.2z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M581.7%2C99.5h-25.9v39c0%2C9.3%2C0.7%2C15.5%2C2%2C18.4c1.4%2C2.9%2C4.6%2C4.4%2C9.7%2C4.4l14.5-1l0.8%2C10.1%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-7.3%2C1.2-12.8%2C1.8-16.6%2C1.8c-8.5%2C0-14.3-2.1-17.6-6.2c-3.3-4.1-4.9-12-4.9-23.6V99.5h-11.6V88.9h11.6V63.9h12.1v24.9h25.9V99.5z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M598.7%2C78.4V64.3h12.2v14.2H598.7z%20M598.7%2C171.4V88.9h12.2v82.5H598.7z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M663.8%2C87.2c3.6%2C0%2C9.7%2C0.7%2C18.3%2C2l3.9%2C0.5l-0.5%2C9.9c-8.7-1-15.1-1.5-19.2-1.5c-9.2%2C0-15.5%2C2.2-18.8%2C6.6%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-3.3%2C4.4-5%2C12.6-5%2C24.5c0%2C11.9%2C1.5%2C20.2%2C4.6%2C24.9c3.1%2C4.7%2C9.5%2C7%2C19.3%2C7l19.2-1.5l0.5%2C10.1c-10.1%2C1.5-17.7%2C2.3-22.7%2C2.3%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-12.7%2C0-21.5-3.3-26.3-9.8c-4.8-6.5-7.3-17.5-7.3-33c0-15.5%2C2.6-26.4%2C7.8-32.6C643%2C90.4%2C651.7%2C87.2%2C663.8%2C87.2z%22%2F%3E%0A%20%20%20%20%3C%2Fg%3E%0A%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M236.6%2C123.5c0-19.8-12.3-37.2-30.8-43.9c0.8-4.2%2C1.2-8.4%2C1.2-12.7C207%2C30%2C177%2C0%2C140.2%2C0%26%2310%3B%26%239%3B%26%239%3BC118.6%2C0%2C98.6%2C10.3%2C86%2C27.7c-6.2-4.8-13.8-7.4-21.7-7.4c-19.6%2C0-35.5%2C15.9-35.5%2C35.5c0%2C4.3%2C0.8%2C8.5%2C2.2%2C12.4%26%2310%3B%26%239%3B%26%239%3BC12.6%2C74.8%2C0%2C92.5%2C0%2C112.2c0%2C19.9%2C12.4%2C37.3%2C30.9%2C44c-0.8%2C4.1-1.2%2C8.4-1.2%2C12.7c0%2C36.8%2C29.9%2C66.7%2C66.7%2C66.7%26%2310%3B%26%239%3B%26%239%3Bc21.6%2C0%2C41.6-10.4%2C54.1-27.8c6.2%2C4.9%2C13.8%2C7.6%2C21.7%2C7.6c19.6%2C0%2C35.5-15.9%2C35.5-35.5c0-4.3-0.8-8.5-2.2-12.4%26%2310%3B%26%239%3B%26%239%3BC223.9%2C160.9%2C236.6%2C143.2%2C236.6%2C123.5z%20M91.6%2C34.8c10.9-15.9%2C28.9-25.4%2C48.1-25.4c32.2%2C0%2C58.4%2C26.2%2C58.4%2C58.4%26%2310%3B%26%239%3B%26%239%3Bc0%2C3.9-0.4%2C7.7-1.1%2C11.5l-52.2%2C45.8L93%2C101.5L82.9%2C79.9L91.6%2C34.8z%20M65.4%2C29c6.2%2C0%2C12.1%2C2%2C17%2C5.7l-7.8%2C40.3l-35.5-8.4%26%2310%3B%26%239%3B%26%239%3Bc-1.1-3.1-1.7-6.3-1.7-9.7C37.4%2C41.6%2C49.9%2C29%2C65.4%2C29z%20M9.1%2C112.3c0-16.7%2C11-31.9%2C26.9-37.2L75%2C84.4l9.1%2C19.5l-49.8%2C45%26%2310%3B%26%239%3B%26%239%3BC19.2%2C143.1%2C9.1%2C128.6%2C9.1%2C112.3z%20M145.2%2C200.9c-10.9%2C16.1-29%2C25.6-48.4%2C25.6c-32.3%2C0-58.6-26.3-58.6-58.5c0-4%2C0.4-7.9%2C1.1-11.7%26%2310%3B%26%239%3B%26%239%3Bl50.9-46l52%2C23.7l11.5%2C22L145.2%2C200.9z%20M171.2%2C206.6c-6.1%2C0-12-2-16.9-5.8l7.7-40.2l35.4%2C8.3c1.1%2C3.1%2C1.7%2C6.3%2C1.7%2C9.7%26%2310%3B%26%239%3B%26%239%3BC199.2%2C194.1%2C186.6%2C206.6%2C171.2%2C206.6z%20M200.5%2C160.5l-39-9.1l-10.4-19.8l51-44.7c15.1%2C5.7%2C25.2%2C20.2%2C25.2%2C36.5%26%2310%3B%26%239%3B%26%239%3BC227.4%2C140.1%2C216.4%2C155.3%2C200.5%2C160.5z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E ------------ diff --git a/docs/dev-tools/console/console.asciidoc b/docs/dev-tools/console/console.asciidoc index 26620688499af..caffef7995fbf 100644 --- a/docs/dev-tools/console/console.asciidoc +++ b/docs/dev-tools/console/console.asciidoc @@ -18,8 +18,8 @@ NOTE: You are unable to interact with the REST API of {kib} with the Console. [[console-api]] === Write requests -Console understands commands in a cURL-like syntax. -For example, the following is a `GET` request to the {es} `_search` API. +Console understands commands in a cURL-like syntax. +For example, the following is a `GET` request to the {es} `_search` API. [source,js] ---------------------------------- @@ -43,23 +43,23 @@ curl -XGET "http://localhost:9200/_search" -d' }' ---------------------------------- -If you paste the above command into Console, {kib} automatically converts it +When you paste the command into Console, {kib} automatically converts it to Console syntax. Alternatively, if you want to want to see Console syntax in cURL, -click the action icon (image:dev-tools/console/images/wrench.png[]) and select *Copy as cURL*. +click the action icon (image:dev-tools/console/images/wrench.png[]) and select *Copy as cURL*. [float] [[console-autocomplete]] ==== Autocomplete When you're typing a command, Console makes context-sensitive suggestions. -These suggestions show you the parameters for each API and speed up your typing. -To configure your preferences for autocomplete, go to -<>. +These suggestions show you the parameters for each API and speed up your typing. +To configure your preferences for autocomplete, go to +<>. [float] [[auto-formatting]] ==== Auto-formatting -The auto-formatting +The auto-formatting capability can help you format requests. Select one or more requests that you want to format, click the action icon (image:dev-tools/console/images/wrench.png[]), and then select *Auto indent*. @@ -69,27 +69,27 @@ For example, you might have a request formatted like this: [role="screenshot"] image::dev-tools/console/images/copy-curl.png["Console close-up"] -Console adjusts the JSON body of the request to apply the indents. +Console adjusts the JSON body of the request to apply the indents. [role="screenshot"] image::dev-tools/console/images/request.png["Console close-up"] -If you select *Auto indent* on a request that is already well formatted, -Console collapses the request body to a single line per document. +If you select *Auto indent* on a request that is already well formatted, +Console collapses the request body to a single line per document. This is helpful when working with the {es} {ref}/docs-bulk.html[bulk APIs]. [float] [[console-request]] -=== Submit requests +=== Submit requests -When you're ready to submit the request to {es}, click the +When you're ready to submit the request to {es}, click the green triangle. You can select multiple requests and submit them together. -Console sends the requests to {es} one by one and shows the output -in the response pane. Submitting multiple request is helpful when you're debugging an issue or trying query +Console sends the requests to {es} one by one and shows the output +in the response pane. Submitting multiple request is helpful when you're debugging an issue or trying query combinations in multiple scenarios. @@ -105,7 +105,7 @@ the action icon (image:dev-tools/console/images/wrench.png[]) and select [[console-history]] === Get your request history -Console maintains a list of the last 500 requests that {es} successfully executed. +Console maintains a list of the last 500 requests that {es} successfully executed. To view your most recent requests, click *History*. If you select a request and click *Apply*, {kib} adds it to the editor at the current cursor position. @@ -113,7 +113,7 @@ and click *Apply*, {kib} adds it to the editor at the current cursor position. [[configuring-console]] === Configure Console settings -You can configure the Console font size, JSON syntax, +You can configure the Console font size, JSON syntax, and autocomplete suggestions in *Settings*. [role="screenshot"] @@ -130,9 +130,7 @@ shortcuts, click *Help*. [[console-settings]] === Disable Console -If you don’t want to use Console, you can disable it by setting `console.enabled` -to `false` in your `kibana.yml` configuration file. Changing this setting -causes the server to regenerate assets on the next startup, +If you don’t want to use Console, you can disable it by setting `console.enabled` +to `false` in your `kibana.yml` configuration file. Changing this setting +causes the server to regenerate assets on the next startup, which might cause a delay before pages start being served. - - diff --git a/docs/dev-tools/searchprofiler/more-complicated.asciidoc b/docs/dev-tools/searchprofiler/more-complicated.asciidoc index bd74a1095083f..a0771f4a0f240 100644 --- a/docs/dev-tools/searchprofiler/more-complicated.asciidoc +++ b/docs/dev-tools/searchprofiler/more-complicated.asciidoc @@ -25,7 +25,7 @@ POST test/_bulk // CONSOLE -- -. From the {searchprofiler}, enter "test" in the Index field above the query editor to restrict profiled +. From the {searchprofiler}, enter "test" in the *Index* field to restrict profiled queries to the `test` index. . Replace the default `match_all` query in the query editor with a query that has two sub-query @@ -66,7 +66,7 @@ components and includes a simple aggregation, like the example below. // NOTCONSOLE -- -. Click *Profile* to profile the query and visualize the results. +. Click *Profile* to profile the query and visualize the results. . Select the shard to view the query details. + [role="screenshot"] @@ -100,5 +100,5 @@ Select the name of the shard to view the aggregation details and timing breakdow image::dev-tools/searchprofiler/images/gs10.png["Drilling into the first shard's details"] For more information about how the {searchprofiler} works, how timings are calculated, and -how to interpret various results, see +how to interpret various results, see {ref}/search-profile.html#profiling-queries[Profiling queries]. diff --git a/docs/developer/core/development-dependencies.asciidoc b/docs/developer/core/development-dependencies.asciidoc index d430667449afa..285d338a23a0d 100644 --- a/docs/developer/core/development-dependencies.asciidoc +++ b/docs/developer/core/development-dependencies.asciidoc @@ -96,8 +96,8 @@ module.exports = window.angular; What this shim does is fairly simple if you go line by line: -. makes sure that jQuery is loaded before angular (which actually runs the shim above) +. makes sure that jQuery is loaded before angular (which actually runs the shim) . load the angular.js file from the node_modules directory . load the angular-elastic plugin, a plugin we want to always be included whenever we import angular . use the `ui/modules` module to add the module exported by angular-elastic as a dependency to the `kibana` angular module -. finally, export the window.angular variable. This means that writing `import angular from 'angular';` will properly set the angular variable to the angular library, rather than undefined which is the default behavior. \ No newline at end of file +. finally, export the window.angular variable. This means that writing `import angular from 'angular';` will properly set the angular variable to the angular library, rather than undefined which is the default behavior. diff --git a/docs/developer/core/development-modules.asciidoc b/docs/developer/core/development-modules.asciidoc index b36be6bbb5d25..cc5cd69ed8cb9 100644 --- a/docs/developer/core/development-modules.asciidoc +++ b/docs/developer/core/development-modules.asciidoc @@ -20,7 +20,7 @@ certain components. Here is a breakdown of those modules: the required modules and import them were they are actually necessary. - *`import 'ui/autoload/all'`* - Imports all of the above modules + Imports all of the modules [float] ==== Resolving Require Paths @@ -60,4 +60,4 @@ Here is how import/require statements are resolved to a file: ** path/index + '.js' ** path/index + '.json' ** path/index - * if none of the above paths matches then an error is thrown \ No newline at end of file + * if none of the paths matches then an error is thrown diff --git a/docs/developer/plugin/development-plugin-feature-registration.asciidoc b/docs/developer/plugin/development-plugin-feature-registration.asciidoc index f9078440cff2b..2c686964d369a 100644 --- a/docs/developer/plugin/development-plugin-feature-registration.asciidoc +++ b/docs/developer/plugin/development-plugin-feature-registration.asciidoc @@ -175,7 +175,7 @@ init(server) { } ----------- -Unlike the Canvas example above, Dev Tools does not require access to any saved objects to function. Dev Tools does specify an API endpoint, however. When this is configured, the Security plugin will automatically authorize access to any server API route that is tagged with `access:console`, similar to the following: +Unlike the Canvas example, Dev Tools does not require access to any saved objects to function. Dev Tools does specify an API endpoint, however. When this is configured, the Security plugin will automatically authorize access to any server API route that is tagged with `access:console`, similar to the following: ["source","javascript"] ----------- diff --git a/docs/developer/plugin/development-plugin-localization.asciidoc b/docs/developer/plugin/development-plugin-localization.asciidoc index ff497ec40e30e..78ee933f681f4 100644 --- a/docs/developer/plugin/development-plugin-localization.asciidoc +++ b/docs/developer/plugin/development-plugin-localization.asciidoc @@ -68,7 +68,7 @@ This outputs a `en.json` file inside the `translations` directory. To localize o Checking i18n does the following: * Checks all existing labels for violations. -* Takes translations from `.i18nrc.json` and compares them to the messages extracted and validated at the step above and: +* Takes translations from `.i18nrc.json` and compares them to the messages extracted and validated. ** Checks for unused translations. If you remove a label that has a corresponding translation, you must also remove the label from the translations file. ** Checks for incompatible translations. If you add or remove a new parameter from an existing string, you must also remove the label from the translations file. @@ -86,7 +86,7 @@ node scripts/i18n_check --fix --include-config ../kibana-extra/myPlugin/.i18nrc. Kibana relies on several UI frameworks (ReactJS and AngularJS) and requires localization in different environments (browser and NodeJS). The internationalization engine is framework agnostic and consumable in -all parts of Kibana (ReactJS, AngularJS and NodeJS). +all parts of Kibana (ReactJS, AngularJS and NodeJS). To simplify internationalization in UI frameworks, additional abstractions are @@ -112,7 +112,7 @@ export const HELLO_WORLD = i18n.translate('hello.wonderful.world', { Full details are {repo}tree/master/packages/kbn-i18n#vanilla-js[here]. [float] -===== i18n for React +===== i18n for React To localize strings in React, use either `FormattedMessage` or `i18n.translate`. @@ -138,7 +138,7 @@ Full details are {repo}tree/master/packages/kbn-i18n#react[here]. [float] -===== i18n for Angular +===== i18n for Angular You are encouraged to use `i18n.translate()` by statically importing `i18n` from `@kbn/i18n` wherever possible in your Angular code. Angular wrappers use the translation `service` with the i18n engine under the hood. diff --git a/docs/developer/pr-review.asciidoc b/docs/developer/pr-review.asciidoc index dee40f5118672..304718e437dc5 100644 --- a/docs/developer/pr-review.asciidoc +++ b/docs/developer/pr-review.asciidoc @@ -67,7 +67,7 @@ Enhancements are pretty much always going to have extensive unit tests as a base [float] === Product level review -Reviewers are not simply evaluating the code itself, they are also evaluating the quality of the user-facing change in the product. This generally means they need to check out the branch locally and "play around" with it. In addition to the "do we want this change in the product" details from above, the reviewer should be looking for bugs and evaluating how approachable and useful the feature is as implemented. Special attention should be given to error scenarios and edge cases to ensure they are all handled well within the product. +Reviewers are not simply evaluating the code itself, they are also evaluating the quality of the user-facing change in the product. This generally means they need to check out the branch locally and "play around" with it. In addition to the "do we want this change in the product" details, the reviewer should be looking for bugs and evaluating how approachable and useful the feature is as implemented. Special attention should be given to error scenarios and edge cases to ensure they are all handled well within the product. [float] @@ -107,7 +107,7 @@ Conflicting opinions between reviewers and authors happen, and sometimes it is h Whether or not a bit of feedback is appropriate for a pull request is often dependent on the motivation for giving the feedback in the first place. -_Demanding_ an author make changes based primarily on the mindset of "how would I write this code?" isn't appropriate. The reviewer didn't write the code, and their critical purpose in the review process is not to craft the contribution into a form that is simply whatever they would have written if they had. If a reviewer wants to provide this type of feedback, they should qualify it as a "nit" as mentioned in the nitpicking section above to make it clear that the author can take it or leave it. +_Demanding_ an author make changes based primarily on the mindset of "how would I write this code?" isn't appropriate. The reviewer didn't write the code, and their critical purpose in the review process is not to craft the contribution into a form that is simply whatever they would have written if they had. If a reviewer wants to provide this type of feedback, they should qualify it as a "nit" as mentioned in the nitpicking section to make it clear that the author can take it or leave it. Inflammatory feedback such as "this is crap" isn't feedback at all. It's both mean and unhelpful, and it is never appropriate. diff --git a/docs/development/core/server/kibana-plugin-server.authnothandled.md b/docs/development/core/server/kibana-plugin-server.authnothandled.md new file mode 100644 index 0000000000000..01e465c266319 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.authnothandled.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [AuthNotHandled](./kibana-plugin-server.authnothandled.md) + +## AuthNotHandled interface + + +Signature: + +```typescript +export interface AuthNotHandled +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [type](./kibana-plugin-server.authnothandled.type.md) | AuthResultType.notHandled | | + diff --git a/docs/development/core/server/kibana-plugin-server.authnothandled.type.md b/docs/development/core/server/kibana-plugin-server.authnothandled.type.md new file mode 100644 index 0000000000000..81543de0ec61b --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.authnothandled.type.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [AuthNotHandled](./kibana-plugin-server.authnothandled.md) > [type](./kibana-plugin-server.authnothandled.type.md) + +## AuthNotHandled.type property + +Signature: + +```typescript +type: AuthResultType.notHandled; +``` diff --git a/docs/development/core/server/kibana-plugin-server.authredirected.md b/docs/development/core/server/kibana-plugin-server.authredirected.md new file mode 100644 index 0000000000000..3eb88d6c5a230 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.authredirected.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [AuthRedirected](./kibana-plugin-server.authredirected.md) + +## AuthRedirected interface + + +Signature: + +```typescript +export interface AuthRedirected extends AuthRedirectedParams +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [type](./kibana-plugin-server.authredirected.type.md) | AuthResultType.redirected | | + diff --git a/docs/development/core/server/kibana-plugin-server.authredirected.type.md b/docs/development/core/server/kibana-plugin-server.authredirected.type.md new file mode 100644 index 0000000000000..866ed358119e7 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.authredirected.type.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [AuthRedirected](./kibana-plugin-server.authredirected.md) > [type](./kibana-plugin-server.authredirected.type.md) + +## AuthRedirected.type property + +Signature: + +```typescript +type: AuthResultType.redirected; +``` diff --git a/docs/development/core/server/kibana-plugin-server.authredirectedparams.headers.md b/docs/development/core/server/kibana-plugin-server.authredirectedparams.headers.md new file mode 100644 index 0000000000000..c1cf8218e7509 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.authredirectedparams.headers.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [AuthRedirectedParams](./kibana-plugin-server.authredirectedparams.md) > [headers](./kibana-plugin-server.authredirectedparams.headers.md) + +## AuthRedirectedParams.headers property + +Headers to attach for auth redirect. Must include "location" header + +Signature: + +```typescript +headers: { + location: string; + } & ResponseHeaders; +``` diff --git a/docs/development/core/server/kibana-plugin-server.authredirectedparams.md b/docs/development/core/server/kibana-plugin-server.authredirectedparams.md new file mode 100644 index 0000000000000..3658f88fb6495 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.authredirectedparams.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [AuthRedirectedParams](./kibana-plugin-server.authredirectedparams.md) + +## AuthRedirectedParams interface + +Result of auth redirection. + +Signature: + +```typescript +export interface AuthRedirectedParams +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [headers](./kibana-plugin-server.authredirectedparams.headers.md) | {
location: string;
} & ResponseHeaders | Headers to attach for auth redirect. Must include "location" header | + diff --git a/docs/development/core/server/kibana-plugin-server.authresult.md b/docs/development/core/server/kibana-plugin-server.authresult.md index 8739c4899bd02..f540173f34c7c 100644 --- a/docs/development/core/server/kibana-plugin-server.authresult.md +++ b/docs/development/core/server/kibana-plugin-server.authresult.md @@ -8,5 +8,5 @@ Signature: ```typescript -export declare type AuthResult = Authenticated; +export declare type AuthResult = Authenticated | AuthNotHandled | AuthRedirected; ``` diff --git a/docs/development/core/server/kibana-plugin-server.authresultparams.md b/docs/development/core/server/kibana-plugin-server.authresultparams.md index 55b247f21f5a9..7a725cb340f5b 100644 --- a/docs/development/core/server/kibana-plugin-server.authresultparams.md +++ b/docs/development/core/server/kibana-plugin-server.authresultparams.md @@ -4,7 +4,7 @@ ## AuthResultParams interface -Result of an incoming request authentication. +Result of successful authentication. Signature: diff --git a/docs/development/core/server/kibana-plugin-server.authresulttype.md b/docs/development/core/server/kibana-plugin-server.authresulttype.md index 61a98ee5e7b11..48c159a94c23d 100644 --- a/docs/development/core/server/kibana-plugin-server.authresulttype.md +++ b/docs/development/core/server/kibana-plugin-server.authresulttype.md @@ -16,4 +16,6 @@ export declare enum AuthResultType | Member | Value | Description | | --- | --- | --- | | authenticated | "authenticated" | | +| notHandled | "notHandled" | | +| redirected | "redirected" | | diff --git a/docs/development/core/server/kibana-plugin-server.authtoolkit.md b/docs/development/core/server/kibana-plugin-server.authtoolkit.md index bc7003c5a68f3..4e523a7ce3cf5 100644 --- a/docs/development/core/server/kibana-plugin-server.authtoolkit.md +++ b/docs/development/core/server/kibana-plugin-server.authtoolkit.md @@ -17,4 +17,6 @@ export interface AuthToolkit | Property | Type | Description | | --- | --- | --- | | [authenticated](./kibana-plugin-server.authtoolkit.authenticated.md) | (data?: AuthResultParams) => AuthResult | Authentication is successful with given credentials, allow request to pass through | +| [notHandled](./kibana-plugin-server.authtoolkit.nothandled.md) | () => AuthResult | User has no credentials. Allows user to access a resource when authRequired: 'optional' Rejects a request when authRequired: true | +| [redirected](./kibana-plugin-server.authtoolkit.redirected.md) | (headers: {
location: string;
} & ResponseHeaders) => AuthResult | Redirects user to another location to complete authentication when authRequired: true Allows user to access a resource without redirection when authRequired: 'optional' | diff --git a/docs/development/core/server/kibana-plugin-server.authtoolkit.nothandled.md b/docs/development/core/server/kibana-plugin-server.authtoolkit.nothandled.md new file mode 100644 index 0000000000000..7de174b3c7bb6 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.authtoolkit.nothandled.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [AuthToolkit](./kibana-plugin-server.authtoolkit.md) > [notHandled](./kibana-plugin-server.authtoolkit.nothandled.md) + +## AuthToolkit.notHandled property + +User has no credentials. Allows user to access a resource when authRequired: 'optional' Rejects a request when authRequired: true + +Signature: + +```typescript +notHandled: () => AuthResult; +``` diff --git a/docs/development/core/server/kibana-plugin-server.authtoolkit.redirected.md b/docs/development/core/server/kibana-plugin-server.authtoolkit.redirected.md new file mode 100644 index 0000000000000..15d5498d90119 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.authtoolkit.redirected.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [AuthToolkit](./kibana-plugin-server.authtoolkit.md) > [redirected](./kibana-plugin-server.authtoolkit.redirected.md) + +## AuthToolkit.redirected property + +Redirects user to another location to complete authentication when authRequired: true Allows user to access a resource without redirection when authRequired: 'optional' + +Signature: + +```typescript +redirected: (headers: { + location: string; + } & ResponseHeaders) => AuthResult; +``` diff --git a/docs/development/core/server/kibana-plugin-server.coresetup.md b/docs/development/core/server/kibana-plugin-server.coresetup.md index c36d649837e8a..fa052c1179a30 100644 --- a/docs/development/core/server/kibana-plugin-server.coresetup.md +++ b/docs/development/core/server/kibana-plugin-server.coresetup.md @@ -20,6 +20,7 @@ export interface CoreSetup | [context](./kibana-plugin-server.coresetup.context.md) | ContextSetup | [ContextSetup](./kibana-plugin-server.contextsetup.md) | | [elasticsearch](./kibana-plugin-server.coresetup.elasticsearch.md) | ElasticsearchServiceSetup | [ElasticsearchServiceSetup](./kibana-plugin-server.elasticsearchservicesetup.md) | | [http](./kibana-plugin-server.coresetup.http.md) | HttpServiceSetup | [HttpServiceSetup](./kibana-plugin-server.httpservicesetup.md) | +| [metrics](./kibana-plugin-server.coresetup.metrics.md) | MetricsServiceSetup | [MetricsServiceSetup](./kibana-plugin-server.metricsservicesetup.md) | | [savedObjects](./kibana-plugin-server.coresetup.savedobjects.md) | SavedObjectsServiceSetup | [SavedObjectsServiceSetup](./kibana-plugin-server.savedobjectsservicesetup.md) | | [uiSettings](./kibana-plugin-server.coresetup.uisettings.md) | UiSettingsServiceSetup | [UiSettingsServiceSetup](./kibana-plugin-server.uisettingsservicesetup.md) | | [uuid](./kibana-plugin-server.coresetup.uuid.md) | UuidServiceSetup | [UuidServiceSetup](./kibana-plugin-server.uuidservicesetup.md) | diff --git a/docs/development/core/server/kibana-plugin-server.coresetup.metrics.md b/docs/development/core/server/kibana-plugin-server.coresetup.metrics.md new file mode 100644 index 0000000000000..5db723751be85 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.coresetup.metrics.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [CoreSetup](./kibana-plugin-server.coresetup.md) > [metrics](./kibana-plugin-server.coresetup.metrics.md) + +## CoreSetup.metrics property + +[MetricsServiceSetup](./kibana-plugin-server.metricsservicesetup.md) + +Signature: + +```typescript +metrics: MetricsServiceSetup; +``` diff --git a/docs/development/core/server/kibana-plugin-server.exportsavedobjectstostream.md b/docs/development/core/server/kibana-plugin-server.exportsavedobjectstostream.md new file mode 100644 index 0000000000000..76f0cea20d637 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.exportsavedobjectstostream.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [exportSavedObjectsToStream](./kibana-plugin-server.exportsavedobjectstostream.md) + +## exportSavedObjectsToStream() function + +Generates sorted saved object stream to be used for export. See the [options](./kibana-plugin-server.savedobjectsexportoptions.md) for more detailed information. + +Signature: + +```typescript +export declare function exportSavedObjectsToStream({ types, objects, search, savedObjectsClient, exportSizeLimit, includeReferencesDeep, excludeExportDetails, namespace, }: SavedObjectsExportOptions): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| { types, objects, search, savedObjectsClient, exportSizeLimit, includeReferencesDeep, excludeExportDetails, namespace, } | SavedObjectsExportOptions | | + +Returns: + +`Promise` + diff --git a/docs/development/core/server/kibana-plugin-server.importsavedobjectsfromstream.md b/docs/development/core/server/kibana-plugin-server.importsavedobjectsfromstream.md new file mode 100644 index 0000000000000..2293e196ae61e --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.importsavedobjectsfromstream.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [importSavedObjectsFromStream](./kibana-plugin-server.importsavedobjectsfromstream.md) + +## importSavedObjectsFromStream() function + +Import saved objects from given stream. See the [options](./kibana-plugin-server.savedobjectsimportoptions.md) for more detailed information. + +Signature: + +```typescript +export declare function importSavedObjectsFromStream({ readStream, objectLimit, overwrite, savedObjectsClient, supportedTypes, namespace, }: SavedObjectsImportOptions): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| { readStream, objectLimit, overwrite, savedObjectsClient, supportedTypes, namespace, } | SavedObjectsImportOptions | | + +Returns: + +`Promise` + diff --git a/docs/development/core/server/kibana-plugin-server.isavedobjecttyperegistry.md b/docs/development/core/server/kibana-plugin-server.isavedobjecttyperegistry.md index bbcba50c81027..6b0012b4ce46c 100644 --- a/docs/development/core/server/kibana-plugin-server.isavedobjecttyperegistry.md +++ b/docs/development/core/server/kibana-plugin-server.isavedobjecttyperegistry.md @@ -9,5 +9,5 @@ See [SavedObjectTypeRegistry](./kibana-plugin-server.savedobjecttyperegistry.md) Signature: ```typescript -export declare type ISavedObjectTypeRegistry = Pick; +export declare type ISavedObjectTypeRegistry = Pick; ``` diff --git a/docs/development/core/server/kibana-plugin-server.kibanarequest.auth.md b/docs/development/core/server/kibana-plugin-server.kibanarequest.auth.md new file mode 100644 index 0000000000000..536d6bd04d937 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.kibanarequest.auth.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [KibanaRequest](./kibana-plugin-server.kibanarequest.md) > [auth](./kibana-plugin-server.kibanarequest.auth.md) + +## KibanaRequest.auth property + +Signature: + +```typescript +readonly auth: { + isAuthenticated: boolean; + }; +``` diff --git a/docs/development/core/server/kibana-plugin-server.kibanarequest.md b/docs/development/core/server/kibana-plugin-server.kibanarequest.md index cb6745623e381..0d520783fd4cf 100644 --- a/docs/development/core/server/kibana-plugin-server.kibanarequest.md +++ b/docs/development/core/server/kibana-plugin-server.kibanarequest.md @@ -22,6 +22,7 @@ export declare class KibanaRequest{
isAuthenticated: boolean;
} | | | [body](./kibana-plugin-server.kibanarequest.body.md) | | Body | | | [events](./kibana-plugin-server.kibanarequest.events.md) | | KibanaRequestEvents | Request events [KibanaRequestEvents](./kibana-plugin-server.kibanarequestevents.md) | | [headers](./kibana-plugin-server.kibanarequest.headers.md) | | Headers | Readonly copy of incoming request headers. | diff --git a/docs/development/core/server/kibana-plugin-server.md b/docs/development/core/server/kibana-plugin-server.md index 0e79385d1ca4d..ff243dbb91a89 100644 --- a/docs/development/core/server/kibana-plugin-server.md +++ b/docs/development/core/server/kibana-plugin-server.md @@ -37,6 +37,14 @@ The plugin integrates with the core system via lifecycle events: `setup` | [AuthResultType](./kibana-plugin-server.authresulttype.md) | | | [AuthStatus](./kibana-plugin-server.authstatus.md) | Status indicating an outcome of the authentication. | +## Functions + +| Function | Description | +| --- | --- | +| [exportSavedObjectsToStream({ types, objects, search, savedObjectsClient, exportSizeLimit, includeReferencesDeep, excludeExportDetails, namespace, })](./kibana-plugin-server.exportsavedobjectstostream.md) | Generates sorted saved object stream to be used for export. See the [options](./kibana-plugin-server.savedobjectsexportoptions.md) for more detailed information. | +| [importSavedObjectsFromStream({ readStream, objectLimit, overwrite, savedObjectsClient, supportedTypes, namespace, })](./kibana-plugin-server.importsavedobjectsfromstream.md) | Import saved objects from given stream. See the [options](./kibana-plugin-server.savedobjectsimportoptions.md) for more detailed information. | +| [resolveSavedObjectsImportErrors({ readStream, objectLimit, retries, savedObjectsClient, supportedTypes, namespace, })](./kibana-plugin-server.resolvesavedobjectsimporterrors.md) | Resolve and return saved object import errors. See the [options](./kibana-plugin-server.savedobjectsresolveimporterrorsoptions.md) for more detailed informations. | + ## Interfaces | Interface | Description | @@ -45,7 +53,10 @@ The plugin integrates with the core system via lifecycle events: `setup` | [AssistanceAPIResponse](./kibana-plugin-server.assistanceapiresponse.md) | | | [AssistantAPIClientParams](./kibana-plugin-server.assistantapiclientparams.md) | | | [Authenticated](./kibana-plugin-server.authenticated.md) | | -| [AuthResultParams](./kibana-plugin-server.authresultparams.md) | Result of an incoming request authentication. | +| [AuthNotHandled](./kibana-plugin-server.authnothandled.md) | | +| [AuthRedirected](./kibana-plugin-server.authredirected.md) | | +| [AuthRedirectedParams](./kibana-plugin-server.authredirectedparams.md) | Result of auth redirection. | +| [AuthResultParams](./kibana-plugin-server.authresultparams.md) | Result of successful authentication. | | [AuthToolkit](./kibana-plugin-server.authtoolkit.md) | A tool set defining an outcome of Auth interceptor for incoming request. | | [CallAPIOptions](./kibana-plugin-server.callapioptions.md) | The set of options that defines how API call should be made and result be processed. | | [Capabilities](./kibana-plugin-server.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. | @@ -105,7 +116,7 @@ The plugin integrates with the core system via lifecycle events: `setup` | [PluginManifest](./kibana-plugin-server.pluginmanifest.md) | Describes the set of required and optional properties plugin can define in its mandatory JSON manifest file. | | [PluginsServiceSetup](./kibana-plugin-server.pluginsservicesetup.md) | | | [PluginsServiceStart](./kibana-plugin-server.pluginsservicestart.md) | | -| [RequestHandlerContext](./kibana-plugin-server.requesthandlercontext.md) | Plugin specific context passed to a route handler.Provides the following clients: - [rendering](./kibana-plugin-server.iscopedrenderingclient.md) - Rendering client which uses the data of the incoming request - [savedObjects.client](./kibana-plugin-server.savedobjectsclient.md) - Saved Objects client which uses the credentials of the incoming request - [elasticsearch.dataClient](./kibana-plugin-server.scopedclusterclient.md) - Elasticsearch data client which uses the credentials of the incoming request - [elasticsearch.adminClient](./kibana-plugin-server.scopedclusterclient.md) - Elasticsearch admin client which uses the credentials of the incoming request - [uiSettings.client](./kibana-plugin-server.iuisettingsclient.md) - uiSettings client which uses the credentials of the incoming request | +| [RequestHandlerContext](./kibana-plugin-server.requesthandlercontext.md) | Plugin specific context passed to a route handler.Provides the following clients and services: - [rendering](./kibana-plugin-server.iscopedrenderingclient.md) - Rendering client which uses the data of the incoming request - [savedObjects.client](./kibana-plugin-server.savedobjectsclient.md) - Saved Objects client which uses the credentials of the incoming request - [savedObjects.typeRegistry](./kibana-plugin-server.isavedobjecttyperegistry.md) - Type registry containing all the registered types. - [elasticsearch.dataClient](./kibana-plugin-server.scopedclusterclient.md) - Elasticsearch data client which uses the credentials of the incoming request - [elasticsearch.adminClient](./kibana-plugin-server.scopedclusterclient.md) - Elasticsearch admin client which uses the credentials of the incoming request - [uiSettings.client](./kibana-plugin-server.iuisettingsclient.md) - uiSettings client which uses the credentials of the incoming request | | [RouteConfig](./kibana-plugin-server.routeconfig.md) | Route specific configuration. | | [RouteConfigOptions](./kibana-plugin-server.routeconfigoptions.md) | Additional route options. | | [RouteConfigOptionsBody](./kibana-plugin-server.routeconfigoptionsbody.md) | Additional body options for a route | @@ -153,6 +164,7 @@ The plugin integrates with the core system via lifecycle events: `setup` | [SavedObjectsServiceSetup](./kibana-plugin-server.savedobjectsservicesetup.md) | Saved Objects is Kibana's data persistence mechanism allowing plugins to use Elasticsearch for storing and querying state. The SavedObjectsServiceSetup API exposes methods for registering Saved Object types, creating and registering Saved Object client wrappers and factories. | | [SavedObjectsServiceStart](./kibana-plugin-server.savedobjectsservicestart.md) | Saved Objects is Kibana's data persisentence mechanism allowing plugins to use Elasticsearch for storing and querying state. The SavedObjectsServiceStart API provides a scoped Saved Objects client for interacting with Saved Objects. | | [SavedObjectsType](./kibana-plugin-server.savedobjectstype.md) | | +| [SavedObjectsTypeManagementDefinition](./kibana-plugin-server.savedobjectstypemanagementdefinition.md) | Configuration options for the [type](./kibana-plugin-server.savedobjectstype.md)'s management section. | | [SavedObjectsTypeMappingDefinition](./kibana-plugin-server.savedobjectstypemappingdefinition.md) | Describe a saved object type mapping. | | [SavedObjectsUpdateOptions](./kibana-plugin-server.savedobjectsupdateoptions.md) | | | [SavedObjectsUpdateResponse](./kibana-plugin-server.savedobjectsupdateresponse.md) | | diff --git a/docs/development/core/server/kibana-plugin-server.requesthandlercontext.core.md b/docs/development/core/server/kibana-plugin-server.requesthandlercontext.core.md index 77bfd85e6e54b..18787d1c7c9a4 100644 --- a/docs/development/core/server/kibana-plugin-server.requesthandlercontext.core.md +++ b/docs/development/core/server/kibana-plugin-server.requesthandlercontext.core.md @@ -11,6 +11,7 @@ core: { rendering: IScopedRenderingClient; savedObjects: { client: SavedObjectsClientContract; + typeRegistry: ISavedObjectTypeRegistry; }; elasticsearch: { dataClient: IScopedClusterClient; diff --git a/docs/development/core/server/kibana-plugin-server.requesthandlercontext.md b/docs/development/core/server/kibana-plugin-server.requesthandlercontext.md index 4d14d890f51a2..4365da24d1489 100644 --- a/docs/development/core/server/kibana-plugin-server.requesthandlercontext.md +++ b/docs/development/core/server/kibana-plugin-server.requesthandlercontext.md @@ -6,7 +6,7 @@ Plugin specific context passed to a route handler. -Provides the following clients: - [rendering](./kibana-plugin-server.iscopedrenderingclient.md) - Rendering client which uses the data of the incoming request - [savedObjects.client](./kibana-plugin-server.savedobjectsclient.md) - Saved Objects client which uses the credentials of the incoming request - [elasticsearch.dataClient](./kibana-plugin-server.scopedclusterclient.md) - Elasticsearch data client which uses the credentials of the incoming request - [elasticsearch.adminClient](./kibana-plugin-server.scopedclusterclient.md) - Elasticsearch admin client which uses the credentials of the incoming request - [uiSettings.client](./kibana-plugin-server.iuisettingsclient.md) - uiSettings client which uses the credentials of the incoming request +Provides the following clients and services: - [rendering](./kibana-plugin-server.iscopedrenderingclient.md) - Rendering client which uses the data of the incoming request - [savedObjects.client](./kibana-plugin-server.savedobjectsclient.md) - Saved Objects client which uses the credentials of the incoming request - [savedObjects.typeRegistry](./kibana-plugin-server.isavedobjecttyperegistry.md) - Type registry containing all the registered types. - [elasticsearch.dataClient](./kibana-plugin-server.scopedclusterclient.md) - Elasticsearch data client which uses the credentials of the incoming request - [elasticsearch.adminClient](./kibana-plugin-server.scopedclusterclient.md) - Elasticsearch admin client which uses the credentials of the incoming request - [uiSettings.client](./kibana-plugin-server.iuisettingsclient.md) - uiSettings client which uses the credentials of the incoming request Signature: @@ -18,5 +18,5 @@ export interface RequestHandlerContext | Property | Type | Description | | --- | --- | --- | -| [core](./kibana-plugin-server.requesthandlercontext.core.md) | {
rendering: IScopedRenderingClient;
savedObjects: {
client: SavedObjectsClientContract;
};
elasticsearch: {
dataClient: IScopedClusterClient;
adminClient: IScopedClusterClient;
};
uiSettings: {
client: IUiSettingsClient;
};
} | | +| [core](./kibana-plugin-server.requesthandlercontext.core.md) | {
rendering: IScopedRenderingClient;
savedObjects: {
client: SavedObjectsClientContract;
typeRegistry: ISavedObjectTypeRegistry;
};
elasticsearch: {
dataClient: IScopedClusterClient;
adminClient: IScopedClusterClient;
};
uiSettings: {
client: IUiSettingsClient;
};
} | | diff --git a/docs/development/core/server/kibana-plugin-server.resolvesavedobjectsimporterrors.md b/docs/development/core/server/kibana-plugin-server.resolvesavedobjectsimporterrors.md new file mode 100644 index 0000000000000..9fcb335aad556 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.resolvesavedobjectsimporterrors.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [resolveSavedObjectsImportErrors](./kibana-plugin-server.resolvesavedobjectsimporterrors.md) + +## resolveSavedObjectsImportErrors() function + +Resolve and return saved object import errors. See the [options](./kibana-plugin-server.savedobjectsresolveimporterrorsoptions.md) for more detailed informations. + +Signature: + +```typescript +export declare function resolveSavedObjectsImportErrors({ readStream, objectLimit, retries, savedObjectsClient, supportedTypes, namespace, }: SavedObjectsResolveImportErrorsOptions): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| { readStream, objectLimit, retries, savedObjectsClient, supportedTypes, namespace, } | SavedObjectsResolveImportErrorsOptions | | + +Returns: + +`Promise` + diff --git a/docs/development/core/server/kibana-plugin-server.routeconfigoptions.authrequired.md b/docs/development/core/server/kibana-plugin-server.routeconfigoptions.authrequired.md index e4cbca9c97810..830abd4dde738 100644 --- a/docs/development/core/server/kibana-plugin-server.routeconfigoptions.authrequired.md +++ b/docs/development/core/server/kibana-plugin-server.routeconfigoptions.authrequired.md @@ -4,12 +4,12 @@ ## RouteConfigOptions.authRequired property -A flag shows that authentication for a route: `enabled` when true `disabled` when false +Defines authentication mode for a route: - true. A user has to have valid credentials to access a resource - false. A user can access a resource without any credentials. - 'optional'. A user can access a resource if has valid credentials or no credentials at all. Can be useful when we grant access to a resource but want to identify a user if possible. -Enabled by default. +Defaults to `true` if an auth mechanism is registered. Signature: ```typescript -authRequired?: boolean; +authRequired?: boolean | 'optional'; ``` diff --git a/docs/development/core/server/kibana-plugin-server.routeconfigoptions.md b/docs/development/core/server/kibana-plugin-server.routeconfigoptions.md index 7fbab90cc2c8a..6664a28424a32 100644 --- a/docs/development/core/server/kibana-plugin-server.routeconfigoptions.md +++ b/docs/development/core/server/kibana-plugin-server.routeconfigoptions.md @@ -16,7 +16,7 @@ export interface RouteConfigOptions | Property | Type | Description | | --- | --- | --- | -| [authRequired](./kibana-plugin-server.routeconfigoptions.authrequired.md) | boolean | A flag shows that authentication for a route: enabled when true disabled when falseEnabled by default. | +| [authRequired](./kibana-plugin-server.routeconfigoptions.authrequired.md) | boolean | 'optional' | Defines authentication mode for a route: - true. A user has to have valid credentials to access a resource - false. A user can access a resource without any credentials. - 'optional'. A user can access a resource if has valid credentials or no credentials at all. Can be useful when we grant access to a resource but want to identify a user if possible.Defaults to true if an auth mechanism is registered. | | [body](./kibana-plugin-server.routeconfigoptions.body.md) | Method extends 'get' | 'options' ? undefined : RouteConfigOptionsBody | Additional body options [RouteConfigOptionsBody](./kibana-plugin-server.routeconfigoptionsbody.md). | | [tags](./kibana-plugin-server.routeconfigoptions.tags.md) | readonly string[] | Additional metadata tag strings to attach to the route. | | [xsrfRequired](./kibana-plugin-server.routeconfigoptions.xsrfrequired.md) | Method extends 'get' ? never : boolean | Defines xsrf protection requirements for a route: - true. Requires an incoming POST/PUT/DELETE request to contain kbn-xsrf header. - false. Disables xsrf protection.Set to true by default | diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.md b/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.md index 9653fa802a3e8..013773e0789a1 100644 --- a/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.md +++ b/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.md @@ -16,10 +16,10 @@ export interface SavedObjectsImportOptions | Property | Type | Description | | --- | --- | --- | -| [namespace](./kibana-plugin-server.savedobjectsimportoptions.namespace.md) | string | | -| [objectLimit](./kibana-plugin-server.savedobjectsimportoptions.objectlimit.md) | number | | -| [overwrite](./kibana-plugin-server.savedobjectsimportoptions.overwrite.md) | boolean | | -| [readStream](./kibana-plugin-server.savedobjectsimportoptions.readstream.md) | Readable | | -| [savedObjectsClient](./kibana-plugin-server.savedobjectsimportoptions.savedobjectsclient.md) | SavedObjectsClientContract | | -| [supportedTypes](./kibana-plugin-server.savedobjectsimportoptions.supportedtypes.md) | string[] | | +| [namespace](./kibana-plugin-server.savedobjectsimportoptions.namespace.md) | string | if specified, will import in given namespace, else will import as global object | +| [objectLimit](./kibana-plugin-server.savedobjectsimportoptions.objectlimit.md) | number | The maximum number of object to import | +| [overwrite](./kibana-plugin-server.savedobjectsimportoptions.overwrite.md) | boolean | if true, will override existing object if present | +| [readStream](./kibana-plugin-server.savedobjectsimportoptions.readstream.md) | Readable | The stream of [saved objects](./kibana-plugin-server.savedobject.md) to import | +| [savedObjectsClient](./kibana-plugin-server.savedobjectsimportoptions.savedobjectsclient.md) | SavedObjectsClientContract | [client](./kibana-plugin-server.savedobjectsclientcontract.md) to use to perform the import operation | +| [supportedTypes](./kibana-plugin-server.savedobjectsimportoptions.supportedtypes.md) | string[] | the list of allowed types to import | diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.namespace.md b/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.namespace.md index 2b15ba2a1b7ec..bf8e56f65607c 100644 --- a/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.namespace.md +++ b/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.namespace.md @@ -4,6 +4,8 @@ ## SavedObjectsImportOptions.namespace property +if specified, will import in given namespace, else will import as global object + Signature: ```typescript diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.objectlimit.md b/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.objectlimit.md index 89c01a13644b8..526aef96eb8c0 100644 --- a/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.objectlimit.md +++ b/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.objectlimit.md @@ -4,6 +4,8 @@ ## SavedObjectsImportOptions.objectLimit property +The maximum number of object to import + Signature: ```typescript diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.overwrite.md b/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.overwrite.md index 54728aaa80fed..3a84001bbbad4 100644 --- a/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.overwrite.md +++ b/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.overwrite.md @@ -4,6 +4,8 @@ ## SavedObjectsImportOptions.overwrite property +if true, will override existing object if present + Signature: ```typescript diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.readstream.md b/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.readstream.md index 7739fdfbc8460..64875d42515aa 100644 --- a/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.readstream.md +++ b/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.readstream.md @@ -4,6 +4,8 @@ ## SavedObjectsImportOptions.readStream property +The stream of [saved objects](./kibana-plugin-server.savedobject.md) to import + Signature: ```typescript diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.savedobjectsclient.md b/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.savedobjectsclient.md index 23d5aba5fe114..864fe64f53a4e 100644 --- a/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.savedobjectsclient.md +++ b/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.savedobjectsclient.md @@ -4,6 +4,8 @@ ## SavedObjectsImportOptions.savedObjectsClient property +[client](./kibana-plugin-server.savedobjectsclientcontract.md) to use to perform the import operation + Signature: ```typescript diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.supportedtypes.md b/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.supportedtypes.md index 03ee12ab2a0f7..a897551bfcb12 100644 --- a/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.supportedtypes.md +++ b/docs/development/core/server/kibana-plugin-server.savedobjectsimportoptions.supportedtypes.md @@ -4,6 +4,8 @@ ## SavedObjectsImportOptions.supportedTypes property +the list of allowed types to import + Signature: ```typescript diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.md b/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.md index 8ed978d4a2639..75c9d77c5bf67 100644 --- a/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.md +++ b/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.md @@ -16,10 +16,10 @@ export interface SavedObjectsResolveImportErrorsOptions | Property | Type | Description | | --- | --- | --- | -| [namespace](./kibana-plugin-server.savedobjectsresolveimporterrorsoptions.namespace.md) | string | | -| [objectLimit](./kibana-plugin-server.savedobjectsresolveimporterrorsoptions.objectlimit.md) | number | | -| [readStream](./kibana-plugin-server.savedobjectsresolveimporterrorsoptions.readstream.md) | Readable | | -| [retries](./kibana-plugin-server.savedobjectsresolveimporterrorsoptions.retries.md) | SavedObjectsImportRetry[] | | -| [savedObjectsClient](./kibana-plugin-server.savedobjectsresolveimporterrorsoptions.savedobjectsclient.md) | SavedObjectsClientContract | | -| [supportedTypes](./kibana-plugin-server.savedobjectsresolveimporterrorsoptions.supportedtypes.md) | string[] | | +| [namespace](./kibana-plugin-server.savedobjectsresolveimporterrorsoptions.namespace.md) | string | if specified, will import in given namespace | +| [objectLimit](./kibana-plugin-server.savedobjectsresolveimporterrorsoptions.objectlimit.md) | number | The maximum number of object to import | +| [readStream](./kibana-plugin-server.savedobjectsresolveimporterrorsoptions.readstream.md) | Readable | The stream of [saved objects](./kibana-plugin-server.savedobject.md) to resolve errors from | +| [retries](./kibana-plugin-server.savedobjectsresolveimporterrorsoptions.retries.md) | SavedObjectsImportRetry[] | saved object import references to retry | +| [savedObjectsClient](./kibana-plugin-server.savedobjectsresolveimporterrorsoptions.savedobjectsclient.md) | SavedObjectsClientContract | client to use to perform the import operation | +| [supportedTypes](./kibana-plugin-server.savedobjectsresolveimporterrorsoptions.supportedtypes.md) | string[] | the list of allowed types to import | diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.namespace.md b/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.namespace.md index b88f124545bd5..87b69c78b33ee 100644 --- a/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.namespace.md +++ b/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.namespace.md @@ -4,6 +4,8 @@ ## SavedObjectsResolveImportErrorsOptions.namespace property +if specified, will import in given namespace + Signature: ```typescript diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.objectlimit.md b/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.objectlimit.md index a2753ceccc36f..57a3c358406d8 100644 --- a/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.objectlimit.md +++ b/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.objectlimit.md @@ -4,6 +4,8 @@ ## SavedObjectsResolveImportErrorsOptions.objectLimit property +The maximum number of object to import + Signature: ```typescript diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.readstream.md b/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.readstream.md index e7a31deed6faa..f109816c0de54 100644 --- a/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.readstream.md +++ b/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.readstream.md @@ -4,6 +4,8 @@ ## SavedObjectsResolveImportErrorsOptions.readStream property +The stream of [saved objects](./kibana-plugin-server.savedobject.md) to resolve errors from + Signature: ```typescript diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.retries.md b/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.retries.md index 658aa64cfc33f..265dd21b3728a 100644 --- a/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.retries.md +++ b/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.retries.md @@ -4,6 +4,8 @@ ## SavedObjectsResolveImportErrorsOptions.retries property +saved object import references to retry + Signature: ```typescript diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.savedobjectsclient.md b/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.savedobjectsclient.md index 8a8c620b2cf21..9a1864bfbbcd6 100644 --- a/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.savedobjectsclient.md +++ b/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.savedobjectsclient.md @@ -4,6 +4,8 @@ ## SavedObjectsResolveImportErrorsOptions.savedObjectsClient property +client to use to perform the import operation + Signature: ```typescript diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.supportedtypes.md b/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.supportedtypes.md index 9cc97c34669b7..e5db98aec23d9 100644 --- a/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.supportedtypes.md +++ b/docs/development/core/server/kibana-plugin-server.savedobjectsresolveimporterrorsoptions.supportedtypes.md @@ -4,6 +4,8 @@ ## SavedObjectsResolveImportErrorsOptions.supportedTypes property +the list of allowed types to import + Signature: ```typescript diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsservicesetup.getimportexportobjectlimit.md b/docs/development/core/server/kibana-plugin-server.savedobjectsservicesetup.getimportexportobjectlimit.md new file mode 100644 index 0000000000000..d8ec90d1718dc --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.savedobjectsservicesetup.getimportexportobjectlimit.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectsServiceSetup](./kibana-plugin-server.savedobjectsservicesetup.md) > [getImportExportObjectLimit](./kibana-plugin-server.savedobjectsservicesetup.getimportexportobjectlimit.md) + +## SavedObjectsServiceSetup.getImportExportObjectLimit property + +Returns the maximum number of objects allowed for import or export operations. + +Signature: + +```typescript +getImportExportObjectLimit: () => number; +``` diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsservicesetup.md b/docs/development/core/server/kibana-plugin-server.savedobjectsservicesetup.md index 963c4bbeb5515..2cc070d105d9f 100644 --- a/docs/development/core/server/kibana-plugin-server.savedobjectsservicesetup.md +++ b/docs/development/core/server/kibana-plugin-server.savedobjectsservicesetup.md @@ -54,6 +54,7 @@ export class Plugin() { | Property | Type | Description | | --- | --- | --- | | [addClientWrapper](./kibana-plugin-server.savedobjectsservicesetup.addclientwrapper.md) | (priority: number, id: string, factory: SavedObjectsClientWrapperFactory) => void | Add a [client wrapper factory](./kibana-plugin-server.savedobjectsclientwrapperfactory.md) with the given priority. | +| [getImportExportObjectLimit](./kibana-plugin-server.savedobjectsservicesetup.getimportexportobjectlimit.md) | () => number | Returns the maximum number of objects allowed for import or export operations. | | [registerType](./kibana-plugin-server.savedobjectsservicesetup.registertype.md) | (type: SavedObjectsType) => void | Register a [savedObjects type](./kibana-plugin-server.savedobjectstype.md) definition.See the [mappings format](./kibana-plugin-server.savedobjectstypemappingdefinition.md) and [migration format](./kibana-plugin-server.savedobjectmigrationmap.md) for more details about these. | | [setClientFactoryProvider](./kibana-plugin-server.savedobjectsservicesetup.setclientfactoryprovider.md) | (clientFactoryProvider: SavedObjectsClientFactoryProvider) => void | Set the default [factory provider](./kibana-plugin-server.savedobjectsclientfactoryprovider.md) for creating Saved Objects clients. Only one provider can be set, subsequent calls to this method will fail. | diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectstype.management.md b/docs/development/core/server/kibana-plugin-server.savedobjectstype.management.md new file mode 100644 index 0000000000000..301e80d74ed57 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.savedobjectstype.management.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectsType](./kibana-plugin-server.savedobjectstype.md) > [management](./kibana-plugin-server.savedobjectstype.management.md) + +## SavedObjectsType.management property + +An optional [saved objects management section](./kibana-plugin-server.savedobjectstypemanagementdefinition.md) definition for the type. + +Signature: + +```typescript +management?: SavedObjectsTypeManagementDefinition; +``` diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectstype.md b/docs/development/core/server/kibana-plugin-server.savedobjectstype.md index 1e989652e52bf..546d83ad0d8dc 100644 --- a/docs/development/core/server/kibana-plugin-server.savedobjectstype.md +++ b/docs/development/core/server/kibana-plugin-server.savedobjectstype.md @@ -21,6 +21,7 @@ This is only internal for now, and will only be public when we expose the regist | [convertToAliasScript](./kibana-plugin-server.savedobjectstype.converttoaliasscript.md) | string | If defined, will be used to convert the type to an alias. | | [hidden](./kibana-plugin-server.savedobjectstype.hidden.md) | boolean | Is the type hidden by default. If true, repositories will not have access to this type unless explicitly declared as an extraType when creating the repository.See [createInternalRepository](./kibana-plugin-server.savedobjectsservicestart.createinternalrepository.md). | | [indexPattern](./kibana-plugin-server.savedobjectstype.indexpattern.md) | string | If defined, the type instances will be stored in the given index instead of the default one. | +| [management](./kibana-plugin-server.savedobjectstype.management.md) | SavedObjectsTypeManagementDefinition | An optional [saved objects management section](./kibana-plugin-server.savedobjectstypemanagementdefinition.md) definition for the type. | | [mappings](./kibana-plugin-server.savedobjectstype.mappings.md) | SavedObjectsTypeMappingDefinition | The [mapping definition](./kibana-plugin-server.savedobjectstypemappingdefinition.md) for the type. | | [migrations](./kibana-plugin-server.savedobjectstype.migrations.md) | SavedObjectMigrationMap | An optional map of [migrations](./kibana-plugin-server.savedobjectmigrationfn.md) to be used to migrate the type. | | [name](./kibana-plugin-server.savedobjectstype.name.md) | string | The name of the type, which is also used as the internal id. | diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectstypemanagementdefinition.defaultsearchfield.md b/docs/development/core/server/kibana-plugin-server.savedobjectstypemanagementdefinition.defaultsearchfield.md new file mode 100644 index 0000000000000..229f0fd567b5d --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.savedobjectstypemanagementdefinition.defaultsearchfield.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectsTypeManagementDefinition](./kibana-plugin-server.savedobjectstypemanagementdefinition.md) > [defaultSearchField](./kibana-plugin-server.savedobjectstypemanagementdefinition.defaultsearchfield.md) + +## SavedObjectsTypeManagementDefinition.defaultSearchField property + +The default search field to use for this type. Defaults to `id`. + +Signature: + +```typescript +defaultSearchField?: string; +``` diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectstypemanagementdefinition.getediturl.md b/docs/development/core/server/kibana-plugin-server.savedobjectstypemanagementdefinition.getediturl.md new file mode 100644 index 0000000000000..276167560ebbf --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.savedobjectstypemanagementdefinition.getediturl.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectsTypeManagementDefinition](./kibana-plugin-server.savedobjectstypemanagementdefinition.md) > [getEditUrl](./kibana-plugin-server.savedobjectstypemanagementdefinition.getediturl.md) + +## SavedObjectsTypeManagementDefinition.getEditUrl property + +Function returning the url to use to redirect to the editing page of this object. If not defined, editing will not be allowed. + +Signature: + +```typescript +getEditUrl?: (savedObject: SavedObject) => string; +``` diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectstypemanagementdefinition.getinappurl.md b/docs/development/core/server/kibana-plugin-server.savedobjectstypemanagementdefinition.getinappurl.md new file mode 100644 index 0000000000000..82934985f3ad5 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.savedobjectstypemanagementdefinition.getinappurl.md @@ -0,0 +1,16 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectsTypeManagementDefinition](./kibana-plugin-server.savedobjectstypemanagementdefinition.md) > [getInAppUrl](./kibana-plugin-server.savedobjectstypemanagementdefinition.getinappurl.md) + +## SavedObjectsTypeManagementDefinition.getInAppUrl property + +Function returning the url to use to redirect to this object from the management section. If not defined, redirecting to the object will not be allowed. + +Signature: + +```typescript +getInAppUrl?: (savedObject: SavedObject) => { + path: string; + uiCapabilitiesPath: string; + }; +``` diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectstypemanagementdefinition.gettitle.md b/docs/development/core/server/kibana-plugin-server.savedobjectstypemanagementdefinition.gettitle.md new file mode 100644 index 0000000000000..348d80031a2e1 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.savedobjectstypemanagementdefinition.gettitle.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectsTypeManagementDefinition](./kibana-plugin-server.savedobjectstypemanagementdefinition.md) > [getTitle](./kibana-plugin-server.savedobjectstypemanagementdefinition.gettitle.md) + +## SavedObjectsTypeManagementDefinition.getTitle property + +Function returning the title to display in the management table. If not defined, will use the object's type and id to generate a label. + +Signature: + +```typescript +getTitle?: (savedObject: SavedObject) => string; +``` diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectstypemanagementdefinition.icon.md b/docs/development/core/server/kibana-plugin-server.savedobjectstypemanagementdefinition.icon.md new file mode 100644 index 0000000000000..1126c77106609 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.savedobjectstypemanagementdefinition.icon.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectsTypeManagementDefinition](./kibana-plugin-server.savedobjectstypemanagementdefinition.md) > [icon](./kibana-plugin-server.savedobjectstypemanagementdefinition.icon.md) + +## SavedObjectsTypeManagementDefinition.icon property + +The eui icon name to display in the management table. If not defined, the default icon will be used. + +Signature: + +```typescript +icon?: string; +``` diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectstypemanagementdefinition.importableandexportable.md b/docs/development/core/server/kibana-plugin-server.savedobjectstypemanagementdefinition.importableandexportable.md new file mode 100644 index 0000000000000..30a20f1a1b03e --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.savedobjectstypemanagementdefinition.importableandexportable.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectsTypeManagementDefinition](./kibana-plugin-server.savedobjectstypemanagementdefinition.md) > [importableAndExportable](./kibana-plugin-server.savedobjectstypemanagementdefinition.importableandexportable.md) + +## SavedObjectsTypeManagementDefinition.importableAndExportable property + +Is the type importable or exportable. Defaults to `false`. + +Signature: + +```typescript +importableAndExportable?: boolean; +``` diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectstypemanagementdefinition.md b/docs/development/core/server/kibana-plugin-server.savedobjectstypemanagementdefinition.md new file mode 100644 index 0000000000000..b54944b24035a --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.savedobjectstypemanagementdefinition.md @@ -0,0 +1,25 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectsTypeManagementDefinition](./kibana-plugin-server.savedobjectstypemanagementdefinition.md) + +## SavedObjectsTypeManagementDefinition interface + +Configuration options for the [type](./kibana-plugin-server.savedobjectstype.md)'s management section. + +Signature: + +```typescript +export interface SavedObjectsTypeManagementDefinition +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [defaultSearchField](./kibana-plugin-server.savedobjectstypemanagementdefinition.defaultsearchfield.md) | string | The default search field to use for this type. Defaults to id. | +| [getEditUrl](./kibana-plugin-server.savedobjectstypemanagementdefinition.getediturl.md) | (savedObject: SavedObject<any>) => string | Function returning the url to use to redirect to the editing page of this object. If not defined, editing will not be allowed. | +| [getInAppUrl](./kibana-plugin-server.savedobjectstypemanagementdefinition.getinappurl.md) | (savedObject: SavedObject<any>) => {
path: string;
uiCapabilitiesPath: string;
} | Function returning the url to use to redirect to this object from the management section. If not defined, redirecting to the object will not be allowed. | +| [getTitle](./kibana-plugin-server.savedobjectstypemanagementdefinition.gettitle.md) | (savedObject: SavedObject<any>) => string | Function returning the title to display in the management table. If not defined, will use the object's type and id to generate a label. | +| [icon](./kibana-plugin-server.savedobjectstypemanagementdefinition.icon.md) | string | The eui icon name to display in the management table. If not defined, the default icon will be used. | +| [importableAndExportable](./kibana-plugin-server.savedobjectstypemanagementdefinition.importableandexportable.md) | boolean | Is the type importable or exportable. Defaults to false. | + diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectstypemappingdefinition.dynamic.md b/docs/development/core/server/kibana-plugin-server.savedobjectstypemappingdefinition.dynamic.md index 0efab7bebfbe5..b6a3fa7a39811 100644 --- a/docs/development/core/server/kibana-plugin-server.savedobjectstypemappingdefinition.dynamic.md +++ b/docs/development/core/server/kibana-plugin-server.savedobjectstypemappingdefinition.dynamic.md @@ -4,7 +4,7 @@ ## SavedObjectsTypeMappingDefinition.dynamic property -The dynamic property of the mapping. either `false` or 'strict'. Defaults to strict +The dynamic property of the mapping. either `false` or 'strict'. Defaults to `false` Signature: diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectstypemappingdefinition.md b/docs/development/core/server/kibana-plugin-server.savedobjectstypemappingdefinition.md index 8c1a279894ffd..2f60c04f5f917 100644 --- a/docs/development/core/server/kibana-plugin-server.savedobjectstypemappingdefinition.md +++ b/docs/development/core/server/kibana-plugin-server.savedobjectstypemappingdefinition.md @@ -41,6 +41,6 @@ const typeDefinition: SavedObjectsTypeMappingDefinition = { | Property | Type | Description | | --- | --- | --- | -| [dynamic](./kibana-plugin-server.savedobjectstypemappingdefinition.dynamic.md) | false | 'strict' | The dynamic property of the mapping. either false or 'strict'. Defaults to strict | +| [dynamic](./kibana-plugin-server.savedobjectstypemappingdefinition.dynamic.md) | false | 'strict' | The dynamic property of the mapping. either false or 'strict'. Defaults to false | | [properties](./kibana-plugin-server.savedobjectstypemappingdefinition.properties.md) | SavedObjectsMappingProperties | The underlying properties of the type mapping | diff --git a/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.getimportableandexportabletypes.md b/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.getimportableandexportabletypes.md new file mode 100644 index 0000000000000..c9eb9c9c0c468 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.getimportableandexportabletypes.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectTypeRegistry](./kibana-plugin-server.savedobjecttyperegistry.md) > [getImportableAndExportableTypes](./kibana-plugin-server.savedobjecttyperegistry.getimportableandexportabletypes.md) + +## SavedObjectTypeRegistry.getImportableAndExportableTypes() method + +Return all [types](./kibana-plugin-server.savedobjectstype.md) currently registered that are importable/exportable. + +Signature: + +```typescript +getImportableAndExportableTypes(): SavedObjectsType[]; +``` +Returns: + +`SavedObjectsType[]` + diff --git a/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.isimportableandexportable.md b/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.isimportableandexportable.md new file mode 100644 index 0000000000000..4d6e95e100646 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.isimportableandexportable.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectTypeRegistry](./kibana-plugin-server.savedobjecttyperegistry.md) > [isImportableAndExportable](./kibana-plugin-server.savedobjecttyperegistry.isimportableandexportable.md) + +## SavedObjectTypeRegistry.isImportableAndExportable() method + +Returns the `management.importableAndExportable` property for given type, or `false` if the type is not registered or does not define a management section. + +Signature: + +```typescript +isImportableAndExportable(type: string): boolean; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| type | string | | + +Returns: + +`boolean` + diff --git a/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.md b/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.md index 3daad35808624..66ca9768b7187 100644 --- a/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.md +++ b/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.md @@ -17,9 +17,11 @@ export declare class SavedObjectTypeRegistry | Method | Modifiers | Description | | --- | --- | --- | | [getAllTypes()](./kibana-plugin-server.savedobjecttyperegistry.getalltypes.md) | | Return all [types](./kibana-plugin-server.savedobjectstype.md) currently registered. | +| [getImportableAndExportableTypes()](./kibana-plugin-server.savedobjecttyperegistry.getimportableandexportabletypes.md) | | Return all [types](./kibana-plugin-server.savedobjectstype.md) currently registered that are importable/exportable. | | [getIndex(type)](./kibana-plugin-server.savedobjecttyperegistry.getindex.md) | | Returns the indexPattern property for given type, or undefined if the type is not registered. | | [getType(type)](./kibana-plugin-server.savedobjecttyperegistry.gettype.md) | | Return the [type](./kibana-plugin-server.savedobjectstype.md) definition for given type name. | | [isHidden(type)](./kibana-plugin-server.savedobjecttyperegistry.ishidden.md) | | Returns the hidden property for given type, or false if the type is not registered. | +| [isImportableAndExportable(type)](./kibana-plugin-server.savedobjecttyperegistry.isimportableandexportable.md) | | Returns the management.importableAndExportable property for given type, or false if the type is not registered or does not define a management section. | | [isNamespaceAgnostic(type)](./kibana-plugin-server.savedobjecttyperegistry.isnamespaceagnostic.md) | | Returns the namespaceAgnostic property for given type, or false if the type is not registered. | | [registerType(type)](./kibana-plugin-server.savedobjecttyperegistry.registertype.md) | | Register a [type](./kibana-plugin-server.savedobjectstype.md) inside the registry. A type can only be registered once. subsequent calls with the same type name will throw an error. | diff --git a/docs/development/plugins/data/public/index.md b/docs/development/plugins/data/public/index.md new file mode 100644 index 0000000000000..424cfd22d3d31 --- /dev/null +++ b/docs/development/plugins/data/public/index.md @@ -0,0 +1,12 @@ + + +[Home](./index.md) + +## API Reference + +## Packages + +| Package | Description | +| --- | --- | +| [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.addsearchstrategy.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.addsearchstrategy.md new file mode 100644 index 0000000000000..119e7fbe62536 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.addsearchstrategy.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [addSearchStrategy](./kibana-plugin-plugins-data-public.addsearchstrategy.md) + +## addSearchStrategy variable + +Signature: + +```typescript +addSearchStrategy: (searchStrategy: SearchStrategyProvider) => void +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.baseformatterspublic.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.baseformatterspublic.md new file mode 100644 index 0000000000000..50e8f2409ac02 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.baseformatterspublic.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [baseFormattersPublic](./kibana-plugin-plugins-data-public.baseformatterspublic.md) + +## baseFormattersPublic variable + +Signature: + +```typescript +baseFormattersPublic: (import("../../common").IFieldFormatType | typeof DateFormat)[] +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.castestokbnfieldtypename.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.castestokbnfieldtypename.md new file mode 100644 index 0000000000000..d7257cfe61011 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.castestokbnfieldtypename.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [castEsToKbnFieldTypeName](./kibana-plugin-plugins-data-public.castestokbnfieldtypename.md) + +## castEsToKbnFieldTypeName variable + +Get the KbnFieldType name for an esType string + +Signature: + +```typescript +castEsToKbnFieldTypeName: (esType: string) => KBN_FIELD_TYPES +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.connecttoquerystate.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.connecttoquerystate.md new file mode 100644 index 0000000000000..005201735ed4b --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.connecttoquerystate.md @@ -0,0 +1,32 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [connectToQueryState](./kibana-plugin-plugins-data-public.connecttoquerystate.md) + +## connectToQueryState variable + +Helper to setup two-way syncing of global data and a state container + +Signature: + +```typescript +connectToQueryState: ({ timefilter: { timefilter }, filterManager, state$, }: Pick<{ + filterManager: import("..").FilterManager; + timefilter: import("..").TimefilterSetup; + state$: import("rxjs").Observable<{ + changes: QueryStateChange; + state: QueryState; + }>; + savedQueries: import("..").SavedQueryService; +} | { + filterManager: import("..").FilterManager; + timefilter: import("..").TimefilterSetup; + state$: import("rxjs").Observable<{ + changes: QueryStateChange; + state: QueryState; + }>; +}, "state$" | "timefilter" | "filterManager">, stateContainer: BaseStateContainer, syncConfig: { + time?: boolean | undefined; + refreshInterval?: boolean | undefined; + filters?: boolean | FilterStateStore | undefined; +}) => () => void +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.createsavedqueryservice.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.createsavedqueryservice.md new file mode 100644 index 0000000000000..c23d37dfecf90 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.createsavedqueryservice.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [createSavedQueryService](./kibana-plugin-plugins-data-public.createsavedqueryservice.md) + +## createSavedQueryService variable + +Signature: + +```typescript +createSavedQueryService: (savedObjectsClient: Pick) => SavedQueryService +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.customfilter.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.customfilter.md new file mode 100644 index 0000000000000..0a3b4e54cfe55 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.customfilter.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [CustomFilter](./kibana-plugin-plugins-data-public.customfilter.md) + +## CustomFilter type + +Signature: + +```typescript +export declare type CustomFilter = Filter & { + query: any; +}; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginsetup.autocomplete.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginsetup.autocomplete.md new file mode 100644 index 0000000000000..9ded30c531bed --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginsetup.autocomplete.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [DataPublicPluginSetup](./kibana-plugin-plugins-data-public.datapublicpluginsetup.md) > [autocomplete](./kibana-plugin-plugins-data-public.datapublicpluginsetup.autocomplete.md) + +## DataPublicPluginSetup.autocomplete property + +Signature: + +```typescript +autocomplete: AutocompleteSetup; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginsetup.fieldformats.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginsetup.fieldformats.md new file mode 100644 index 0000000000000..993634023c20c --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginsetup.fieldformats.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [DataPublicPluginSetup](./kibana-plugin-plugins-data-public.datapublicpluginsetup.md) > [fieldFormats](./kibana-plugin-plugins-data-public.datapublicpluginsetup.fieldformats.md) + +## DataPublicPluginSetup.fieldFormats property + +Signature: + +```typescript +fieldFormats: FieldFormatsSetup; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginsetup.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginsetup.md new file mode 100644 index 0000000000000..dba1d79e78682 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginsetup.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [DataPublicPluginSetup](./kibana-plugin-plugins-data-public.datapublicpluginsetup.md) + +## DataPublicPluginSetup interface + +Signature: + +```typescript +export interface DataPublicPluginSetup +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [autocomplete](./kibana-plugin-plugins-data-public.datapublicpluginsetup.autocomplete.md) | AutocompleteSetup | | +| [fieldFormats](./kibana-plugin-plugins-data-public.datapublicpluginsetup.fieldformats.md) | FieldFormatsSetup | | +| [query](./kibana-plugin-plugins-data-public.datapublicpluginsetup.query.md) | QuerySetup | | +| [search](./kibana-plugin-plugins-data-public.datapublicpluginsetup.search.md) | ISearchSetup | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginsetup.query.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginsetup.query.md new file mode 100644 index 0000000000000..b8882bdf671b6 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginsetup.query.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [DataPublicPluginSetup](./kibana-plugin-plugins-data-public.datapublicpluginsetup.md) > [query](./kibana-plugin-plugins-data-public.datapublicpluginsetup.query.md) + +## DataPublicPluginSetup.query property + +Signature: + +```typescript +query: QuerySetup; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginsetup.search.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginsetup.search.md new file mode 100644 index 0000000000000..a957c1acc4194 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginsetup.search.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [DataPublicPluginSetup](./kibana-plugin-plugins-data-public.datapublicpluginsetup.md) > [search](./kibana-plugin-plugins-data-public.datapublicpluginsetup.search.md) + +## DataPublicPluginSetup.search property + +Signature: + +```typescript +search: ISearchSetup; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginstart.autocomplete.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginstart.autocomplete.md new file mode 100644 index 0000000000000..d2e5aee7d90dd --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginstart.autocomplete.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [DataPublicPluginStart](./kibana-plugin-plugins-data-public.datapublicpluginstart.md) > [autocomplete](./kibana-plugin-plugins-data-public.datapublicpluginstart.autocomplete.md) + +## DataPublicPluginStart.autocomplete property + +Signature: + +```typescript +autocomplete: AutocompleteStart; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginstart.fieldformats.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginstart.fieldformats.md new file mode 100644 index 0000000000000..dd4b38f64d10b --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginstart.fieldformats.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [DataPublicPluginStart](./kibana-plugin-plugins-data-public.datapublicpluginstart.md) > [fieldFormats](./kibana-plugin-plugins-data-public.datapublicpluginstart.fieldformats.md) + +## DataPublicPluginStart.fieldFormats property + +Signature: + +```typescript +fieldFormats: FieldFormatsStart; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginstart.indexpatterns.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginstart.indexpatterns.md new file mode 100644 index 0000000000000..b3dd6a61760a6 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginstart.indexpatterns.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [DataPublicPluginStart](./kibana-plugin-plugins-data-public.datapublicpluginstart.md) > [indexPatterns](./kibana-plugin-plugins-data-public.datapublicpluginstart.indexpatterns.md) + +## DataPublicPluginStart.indexPatterns property + +Signature: + +```typescript +indexPatterns: IndexPatternsContract; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginstart.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginstart.md new file mode 100644 index 0000000000000..defc633b5d1ce --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginstart.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [DataPublicPluginStart](./kibana-plugin-plugins-data-public.datapublicpluginstart.md) + +## DataPublicPluginStart interface + +Signature: + +```typescript +export interface DataPublicPluginStart +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [autocomplete](./kibana-plugin-plugins-data-public.datapublicpluginstart.autocomplete.md) | AutocompleteStart | | +| [fieldFormats](./kibana-plugin-plugins-data-public.datapublicpluginstart.fieldformats.md) | FieldFormatsStart | | +| [indexPatterns](./kibana-plugin-plugins-data-public.datapublicpluginstart.indexpatterns.md) | IndexPatternsContract | | +| [query](./kibana-plugin-plugins-data-public.datapublicpluginstart.query.md) | QueryStart | | +| [search](./kibana-plugin-plugins-data-public.datapublicpluginstart.search.md) | ISearchStart | | +| [ui](./kibana-plugin-plugins-data-public.datapublicpluginstart.ui.md) | {
IndexPatternSelect: React.ComponentType<IndexPatternSelectProps>;
SearchBar: React.ComponentType<StatefulSearchBarProps>;
} | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginstart.query.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginstart.query.md new file mode 100644 index 0000000000000..a44e250077ed4 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginstart.query.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [DataPublicPluginStart](./kibana-plugin-plugins-data-public.datapublicpluginstart.md) > [query](./kibana-plugin-plugins-data-public.datapublicpluginstart.query.md) + +## DataPublicPluginStart.query property + +Signature: + +```typescript +query: QueryStart; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginstart.search.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginstart.search.md new file mode 100644 index 0000000000000..eec00e7b13e9d --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginstart.search.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [DataPublicPluginStart](./kibana-plugin-plugins-data-public.datapublicpluginstart.md) > [search](./kibana-plugin-plugins-data-public.datapublicpluginstart.search.md) + +## DataPublicPluginStart.search property + +Signature: + +```typescript +search: ISearchStart; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginstart.ui.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginstart.ui.md new file mode 100644 index 0000000000000..9c24216834371 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.datapublicpluginstart.ui.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [DataPublicPluginStart](./kibana-plugin-plugins-data-public.datapublicpluginstart.md) > [ui](./kibana-plugin-plugins-data-public.datapublicpluginstart.ui.md) + +## DataPublicPluginStart.ui property + +Signature: + +```typescript +ui: { + IndexPatternSelect: React.ComponentType; + SearchBar: React.ComponentType; + }; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.defaultsearchstrategy.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.defaultsearchstrategy.md new file mode 100644 index 0000000000000..d6a71cf561bc2 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.defaultsearchstrategy.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [defaultSearchStrategy](./kibana-plugin-plugins-data-public.defaultsearchstrategy.md) + +## defaultSearchStrategy variable + +Signature: + +```typescript +defaultSearchStrategy: SearchStrategyProvider +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.es_field_types.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.es_field_types.md new file mode 100644 index 0000000000000..e7341caf7b3cd --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.es_field_types.md @@ -0,0 +1,45 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [ES\_FIELD\_TYPES](./kibana-plugin-plugins-data-public.es_field_types.md) + +## ES\_FIELD\_TYPES enum + +\* + +Signature: + +```typescript +export declare enum ES_FIELD_TYPES +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| \_ID | "_id" | | +| \_INDEX | "_index" | | +| \_SOURCE | "_source" | | +| \_TYPE | "_type" | | +| ATTACHMENT | "attachment" | | +| BOOLEAN | "boolean" | | +| BYTE | "byte" | | +| DATE | "date" | | +| DATE\_NANOS | "date_nanos" | | +| DOUBLE | "double" | | +| FLOAT | "float" | | +| GEO\_POINT | "geo_point" | | +| GEO\_SHAPE | "geo_shape" | | +| HALF\_FLOAT | "half_float" | | +| INTEGER | "integer" | | +| IP | "ip" | | +| KEYWORD | "keyword" | | +| LONG | "long" | | +| MURMUR3 | "murmur3" | | +| NESTED | "nested" | | +| OBJECT | "object" | | +| SCALED\_FLOAT | "scaled_float" | | +| SHORT | "short" | | +| STRING | "string" | | +| TEXT | "text" | | +| TOKEN\_COUNT | "token_count" | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.es_search_strategy.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.es_search_strategy.md new file mode 100644 index 0000000000000..9cf3720e330c2 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.es_search_strategy.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [ES\_SEARCH\_STRATEGY](./kibana-plugin-plugins-data-public.es_search_strategy.md) + +## ES\_SEARCH\_STRATEGY variable + +Signature: + +```typescript +ES_SEARCH_STRATEGY = "es" +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esfilters.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esfilters.md new file mode 100644 index 0000000000000..e03072f9a41c3 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esfilters.md @@ -0,0 +1,55 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [esFilters](./kibana-plugin-plugins-data-public.esfilters.md) + +## esFilters variable + +Signature: + +```typescript +esFilters: { + FilterLabel: typeof FilterLabel; + FILTERS: typeof FILTERS; + FilterStateStore: typeof FilterStateStore; + buildEmptyFilter: (isPinned: boolean, index?: string | undefined) => import("../common").Filter; + buildPhrasesFilter: (field: import("../common").IFieldType, params: any[], indexPattern: import("../common").IIndexPattern) => import("../common").PhrasesFilter; + buildExistsFilter: (field: import("../common").IFieldType, indexPattern: import("../common").IIndexPattern) => import("../common").ExistsFilter; + buildPhraseFilter: (field: import("../common").IFieldType, value: any, indexPattern: import("../common").IIndexPattern) => import("../common").PhraseFilter; + buildQueryFilter: (query: any, index: string, alias: string) => import("../common").QueryStringFilter; + buildRangeFilter: (field: import("../common").IFieldType, params: import("../common").RangeFilterParams, indexPattern: import("../common").IIndexPattern, formattedValue?: string | undefined) => import("../common").RangeFilter; + isPhraseFilter: (filter: any) => filter is import("../common").PhraseFilter; + isExistsFilter: (filter: any) => filter is import("../common").ExistsFilter; + isPhrasesFilter: (filter: any) => filter is import("../common").PhrasesFilter; + isRangeFilter: (filter: any) => filter is import("../common").RangeFilter; + isMatchAllFilter: (filter: any) => filter is import("../common").MatchAllFilter; + isMissingFilter: (filter: any) => filter is import("../common").MissingFilter; + isQueryStringFilter: (filter: any) => filter is import("../common").QueryStringFilter; + isFilterPinned: (filter: import("../common").Filter) => boolean | undefined; + toggleFilterNegated: (filter: import("../common").Filter) => { + meta: { + negate: boolean; + alias: string | null; + disabled: boolean; + controlledBy?: string | undefined; + index?: string | undefined; + type?: string | undefined; + key?: string | undefined; + params?: any; + value?: string | ((formatter?: import("../common").FilterValueFormatter | undefined) => string) | undefined; + }; + $state?: import("../common").FilterState | undefined; + query?: any; + }; + disableFilter: (filter: import("../common").Filter) => import("../common").Filter; + getPhraseFilterField: (filter: import("../common").PhraseFilter) => string; + getPhraseFilterValue: (filter: import("../common").PhraseFilter) => string | number | boolean; + getDisplayValueFromFilter: typeof getDisplayValueFromFilter; + compareFilters: (first: import("../common").Filter | import("../common").Filter[], second: import("../common").Filter | import("../common").Filter[], comparatorOptions?: import("./query/filter_manager/lib/compare_filters").FilterCompareOptions) => boolean; + COMPARE_ALL_OPTIONS: import("./query/filter_manager/lib/compare_filters").FilterCompareOptions; + generateFilters: typeof generateFilters; + onlyDisabledFiltersChanged: (newFilters?: import("../common").Filter[] | undefined, oldFilters?: import("../common").Filter[] | undefined) => boolean; + changeTimeFilter: typeof changeTimeFilter; + mapAndFlattenFilters: (filters: import("../common").Filter[]) => import("../common").Filter[]; + extractTimeFilter: typeof extractTimeFilter; +} +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.eskuery.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.eskuery.md new file mode 100644 index 0000000000000..5d92e348d6276 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.eskuery.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [esKuery](./kibana-plugin-plugins-data-public.eskuery.md) + +## esKuery variable + +Signature: + +```typescript +esKuery: { + nodeTypes: import("../common/es_query/kuery/node_types").NodeTypes; + fromKueryExpression: (expression: any, parseOptions?: Partial) => import("../common").KueryNode; + toElasticsearchQuery: (node: import("../common").KueryNode, indexPattern?: import("../common").IIndexPattern | undefined, config?: Record | undefined, context?: Record | undefined) => import("../../kibana_utils/common").JsonObject; +} +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esquery.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esquery.md new file mode 100644 index 0000000000000..2430e6a93bd2b --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esquery.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [esQuery](./kibana-plugin-plugins-data-public.esquery.md) + +## esQuery variable + +Signature: + +```typescript +esQuery: { + buildEsQuery: typeof buildEsQuery; + getEsQueryConfig: typeof getEsQueryConfig; + buildQueryFromFilters: (filters: import("../common").Filter[] | undefined, indexPattern: import("../common").IIndexPattern | undefined, ignoreFilterIfFieldNotInIndex?: boolean) => { + must: never[]; + filter: import("../common").Filter[]; + should: never[]; + must_not: import("../common").Filter[]; + }; + luceneStringToDsl: typeof luceneStringToDsl; + decorateQuery: typeof decorateQuery; +} +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esqueryconfig.allowleadingwildcards.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esqueryconfig.allowleadingwildcards.md new file mode 100644 index 0000000000000..71eb23ac6299b --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esqueryconfig.allowleadingwildcards.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [EsQueryConfig](./kibana-plugin-plugins-data-public.esqueryconfig.md) > [allowLeadingWildcards](./kibana-plugin-plugins-data-public.esqueryconfig.allowleadingwildcards.md) + +## EsQueryConfig.allowLeadingWildcards property + +Signature: + +```typescript +allowLeadingWildcards: boolean; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esqueryconfig.dateformattz.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esqueryconfig.dateformattz.md new file mode 100644 index 0000000000000..e9c4c26878a97 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esqueryconfig.dateformattz.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [EsQueryConfig](./kibana-plugin-plugins-data-public.esqueryconfig.md) > [dateFormatTZ](./kibana-plugin-plugins-data-public.esqueryconfig.dateformattz.md) + +## EsQueryConfig.dateFormatTZ property + +Signature: + +```typescript +dateFormatTZ?: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esqueryconfig.ignorefilteriffieldnotinindex.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esqueryconfig.ignorefilteriffieldnotinindex.md new file mode 100644 index 0000000000000..9f765c51d0a69 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esqueryconfig.ignorefilteriffieldnotinindex.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [EsQueryConfig](./kibana-plugin-plugins-data-public.esqueryconfig.md) > [ignoreFilterIfFieldNotInIndex](./kibana-plugin-plugins-data-public.esqueryconfig.ignorefilteriffieldnotinindex.md) + +## EsQueryConfig.ignoreFilterIfFieldNotInIndex property + +Signature: + +```typescript +ignoreFilterIfFieldNotInIndex: boolean; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esqueryconfig.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esqueryconfig.md new file mode 100644 index 0000000000000..5252f8058b488 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esqueryconfig.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [EsQueryConfig](./kibana-plugin-plugins-data-public.esqueryconfig.md) + +## EsQueryConfig interface + +Signature: + +```typescript +export interface EsQueryConfig +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [allowLeadingWildcards](./kibana-plugin-plugins-data-public.esqueryconfig.allowleadingwildcards.md) | boolean | | +| [dateFormatTZ](./kibana-plugin-plugins-data-public.esqueryconfig.dateformattz.md) | string | | +| [ignoreFilterIfFieldNotInIndex](./kibana-plugin-plugins-data-public.esqueryconfig.ignorefilteriffieldnotinindex.md) | boolean | | +| [queryStringOptions](./kibana-plugin-plugins-data-public.esqueryconfig.querystringoptions.md) | Record<string, any> | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esqueryconfig.querystringoptions.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esqueryconfig.querystringoptions.md new file mode 100644 index 0000000000000..feaa8f1821e30 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esqueryconfig.querystringoptions.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [EsQueryConfig](./kibana-plugin-plugins-data-public.esqueryconfig.md) > [queryStringOptions](./kibana-plugin-plugins-data-public.esqueryconfig.querystringoptions.md) + +## EsQueryConfig.queryStringOptions property + +Signature: + +```typescript +queryStringOptions: Record; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esquerysortvalue.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esquerysortvalue.md new file mode 100644 index 0000000000000..83762c22f0f82 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.esquerysortvalue.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [EsQuerySortValue](./kibana-plugin-plugins-data-public.esquerysortvalue.md) + +## EsQuerySortValue type + +Signature: + +```typescript +export declare type EsQuerySortValue = Record; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.essearchstrategyprovider.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.essearchstrategyprovider.md new file mode 100644 index 0000000000000..1394c6b868546 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.essearchstrategyprovider.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [esSearchStrategyProvider](./kibana-plugin-plugins-data-public.essearchstrategyprovider.md) + +## esSearchStrategyProvider variable + +Signature: + +```typescript +esSearchStrategyProvider: TSearchStrategyProvider +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.existsfilter.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.existsfilter.md new file mode 100644 index 0000000000000..f1279934db84c --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.existsfilter.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [ExistsFilter](./kibana-plugin-plugins-data-public.existsfilter.md) + +## ExistsFilter type + +Signature: + +```typescript +export declare type ExistsFilter = Filter & { + meta: ExistsFilterMeta; + exists?: FilterExistsProperty; +}; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fetchoptions.abortsignal.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fetchoptions.abortsignal.md new file mode 100644 index 0000000000000..791f1b63e6539 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fetchoptions.abortsignal.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FetchOptions](./kibana-plugin-plugins-data-public.fetchoptions.md) > [abortSignal](./kibana-plugin-plugins-data-public.fetchoptions.abortsignal.md) + +## FetchOptions.abortSignal property + +Signature: + +```typescript +abortSignal?: AbortSignal; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fetchoptions.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fetchoptions.md new file mode 100644 index 0000000000000..f07fdd4280533 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fetchoptions.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FetchOptions](./kibana-plugin-plugins-data-public.fetchoptions.md) + +## FetchOptions interface + +Signature: + +```typescript +export interface FetchOptions +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [abortSignal](./kibana-plugin-plugins-data-public.fetchoptions.abortsignal.md) | AbortSignal | | +| [searchStrategyId](./kibana-plugin-plugins-data-public.fetchoptions.searchstrategyid.md) | string | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fetchoptions.searchstrategyid.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fetchoptions.searchstrategyid.md new file mode 100644 index 0000000000000..8824529eb4eca --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fetchoptions.searchstrategyid.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FetchOptions](./kibana-plugin-plugins-data-public.fetchoptions.md) > [searchStrategyId](./kibana-plugin-plugins-data-public.fetchoptions.searchstrategyid.md) + +## FetchOptions.searchStrategyId property + +Signature: + +```typescript +searchStrategyId?: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformatconfig.es.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformatconfig.es.md new file mode 100644 index 0000000000000..82441ee41d80d --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformatconfig.es.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FieldFormatConfig](./kibana-plugin-plugins-data-public.fieldformatconfig.md) > [es](./kibana-plugin-plugins-data-public.fieldformatconfig.es.md) + +## FieldFormatConfig.es property + +Signature: + +```typescript +es?: boolean; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformatconfig.id.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformatconfig.id.md new file mode 100644 index 0000000000000..b179c314a56d3 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformatconfig.id.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FieldFormatConfig](./kibana-plugin-plugins-data-public.fieldformatconfig.md) > [id](./kibana-plugin-plugins-data-public.fieldformatconfig.id.md) + +## FieldFormatConfig.id property + +Signature: + +```typescript +id: FieldFormatId; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformatconfig.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformatconfig.md new file mode 100644 index 0000000000000..f856a3132eccb --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformatconfig.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FieldFormatConfig](./kibana-plugin-plugins-data-public.fieldformatconfig.md) + +## FieldFormatConfig interface + +Signature: + +```typescript +export interface FieldFormatConfig +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [es](./kibana-plugin-plugins-data-public.fieldformatconfig.es.md) | boolean | | +| [id](./kibana-plugin-plugins-data-public.fieldformatconfig.id.md) | FieldFormatId | | +| [params](./kibana-plugin-plugins-data-public.fieldformatconfig.params.md) | Record<string, any> | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformatconfig.params.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformatconfig.params.md new file mode 100644 index 0000000000000..aad977643ad2f --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformatconfig.params.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FieldFormatConfig](./kibana-plugin-plugins-data-public.fieldformatconfig.md) > [params](./kibana-plugin-plugins-data-public.fieldformatconfig.params.md) + +## FieldFormatConfig.params property + +Signature: + +```typescript +params: Record; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformatid.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformatid.md new file mode 100644 index 0000000000000..9f94d50a2001f --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformatid.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FieldFormatId](./kibana-plugin-plugins-data-public.fieldformatid.md) + +## FieldFormatId type + + id type is needed for creating custom converters. + +Signature: + +```typescript +export declare type FieldFormatId = FIELD_FORMAT_IDS | string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformats.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformats.md new file mode 100644 index 0000000000000..7fd4d03e1b074 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformats.md @@ -0,0 +1,39 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [fieldFormats](./kibana-plugin-plugins-data-public.fieldformats.md) + +## fieldFormats variable + +Signature: + +```typescript +fieldFormats: { + FieldFormat: typeof FieldFormat; + FieldFormatsRegistry: typeof FieldFormatsRegistry; + serialize: (agg: import("../../../legacy/core_plugins/data/public/search").AggConfig) => import("../../expressions/common").SerializedFieldFormat; + DEFAULT_CONVERTER_COLOR: { + range: string; + regex: string; + text: string; + background: string; + }; + HTML_CONTEXT_TYPE: import("../common").FieldFormatsContentType; + TEXT_CONTEXT_TYPE: import("../common").FieldFormatsContentType; + FIELD_FORMAT_IDS: typeof FIELD_FORMAT_IDS; + BoolFormat: typeof BoolFormat; + BytesFormat: typeof BytesFormat; + ColorFormat: typeof ColorFormat; + DateFormat: typeof DateFormat; + DateNanosFormat: typeof DateNanosFormat; + DurationFormat: typeof DurationFormat; + IpFormat: typeof IpFormat; + NumberFormat: typeof NumberFormat; + PercentFormat: typeof PercentFormat; + RelativeDateFormat: typeof RelativeDateFormat; + SourceFormat: typeof SourceFormat; + StaticLookupFormat: typeof StaticLookupFormat; + UrlFormat: typeof UrlFormat; + StringFormat: typeof StringFormat; + TruncateFormat: typeof TruncateFormat; +} +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformatscontenttype.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformatscontenttype.md new file mode 100644 index 0000000000000..8e89a0262b438 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformatscontenttype.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FieldFormatsContentType](./kibana-plugin-plugins-data-public.fieldformatscontenttype.md) + +## FieldFormatsContentType type + +\* + +Signature: + +```typescript +export declare type FieldFormatsContentType = 'html' | 'text'; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformatsgetconfigfn.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformatsgetconfigfn.md new file mode 100644 index 0000000000000..4233eea42cded --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldformatsgetconfigfn.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FieldFormatsGetConfigFn](./kibana-plugin-plugins-data-public.fieldformatsgetconfigfn.md) + +## FieldFormatsGetConfigFn type + +Signature: + +```typescript +export declare type FieldFormatsGetConfigFn = (key: string, defaultOverride?: T) => T; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filter._state.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filter._state.md new file mode 100644 index 0000000000000..bfb5dff71e70d --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filter._state.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [Filter](./kibana-plugin-plugins-data-public.filter.md) > [$state](./kibana-plugin-plugins-data-public.filter._state.md) + +## Filter.$state property + +Signature: + +```typescript +$state?: FilterState; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filter.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filter.md new file mode 100644 index 0000000000000..f993721ee96ad --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filter.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [Filter](./kibana-plugin-plugins-data-public.filter.md) + +## Filter interface + +Signature: + +```typescript +export interface Filter +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [$state](./kibana-plugin-plugins-data-public.filter._state.md) | FilterState | | +| [meta](./kibana-plugin-plugins-data-public.filter.meta.md) | FilterMeta | | +| [query](./kibana-plugin-plugins-data-public.filter.query.md) | any | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filter.meta.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filter.meta.md new file mode 100644 index 0000000000000..3385a3773a2aa --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filter.meta.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [Filter](./kibana-plugin-plugins-data-public.filter.md) > [meta](./kibana-plugin-plugins-data-public.filter.meta.md) + +## Filter.meta property + +Signature: + +```typescript +meta: FilterMeta; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filter.query.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filter.query.md new file mode 100644 index 0000000000000..083b544493e80 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filter.query.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [Filter](./kibana-plugin-plugins-data-public.filter.md) > [query](./kibana-plugin-plugins-data-public.filter.query.md) + +## Filter.query property + +Signature: + +```typescript +query?: any; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filterbar.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filterbar.md new file mode 100644 index 0000000000000..016adffd0d7f4 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filterbar.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FilterBar](./kibana-plugin-plugins-data-public.filterbar.md) + +## FilterBar variable + +Signature: + +```typescript +FilterBar: React.ComponentClass, any> & { + WrappedComponent: React.ComponentType; +} +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager._constructor_.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager._constructor_.md new file mode 100644 index 0000000000000..6f9c3058928d1 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager._constructor_.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FilterManager](./kibana-plugin-plugins-data-public.filtermanager.md) > [(constructor)](./kibana-plugin-plugins-data-public.filtermanager._constructor_.md) + +## FilterManager.(constructor) + +Constructs a new instance of the `FilterManager` class + +Signature: + +```typescript +constructor(uiSettings: IUiSettingsClient); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| uiSettings | IUiSettingsClient | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.addfilters.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.addfilters.md new file mode 100644 index 0000000000000..98b21800ee655 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.addfilters.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FilterManager](./kibana-plugin-plugins-data-public.filtermanager.md) > [addFilters](./kibana-plugin-plugins-data-public.filtermanager.addfilters.md) + +## FilterManager.addFilters() method + +Signature: + +```typescript +addFilters(filters: Filter[] | Filter, pinFilterStatus?: boolean): void; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| filters | Filter[] | Filter | | +| pinFilterStatus | boolean | | + +Returns: + +`void` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.getappfilters.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.getappfilters.md new file mode 100644 index 0000000000000..7bb1f5971b740 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.getappfilters.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FilterManager](./kibana-plugin-plugins-data-public.filtermanager.md) > [getAppFilters](./kibana-plugin-plugins-data-public.filtermanager.getappfilters.md) + +## FilterManager.getAppFilters() method + +Signature: + +```typescript +getAppFilters(): Filter[]; +``` +Returns: + +`Filter[]` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.getfetches_.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.getfetches_.md new file mode 100644 index 0000000000000..fa47d1552de39 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.getfetches_.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FilterManager](./kibana-plugin-plugins-data-public.filtermanager.md) > [getFetches$](./kibana-plugin-plugins-data-public.filtermanager.getfetches_.md) + +## FilterManager.getFetches$() method + +Signature: + +```typescript +getFetches$(): import("rxjs").Observable; +``` +Returns: + +`import("rxjs").Observable` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.getfilters.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.getfilters.md new file mode 100644 index 0000000000000..234354e7f674a --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.getfilters.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FilterManager](./kibana-plugin-plugins-data-public.filtermanager.md) > [getFilters](./kibana-plugin-plugins-data-public.filtermanager.getfilters.md) + +## FilterManager.getFilters() method + +Signature: + +```typescript +getFilters(): Filter[]; +``` +Returns: + +`Filter[]` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.getglobalfilters.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.getglobalfilters.md new file mode 100644 index 0000000000000..933a0522ea2fd --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.getglobalfilters.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FilterManager](./kibana-plugin-plugins-data-public.filtermanager.md) > [getGlobalFilters](./kibana-plugin-plugins-data-public.filtermanager.getglobalfilters.md) + +## FilterManager.getGlobalFilters() method + +Signature: + +```typescript +getGlobalFilters(): Filter[]; +``` +Returns: + +`Filter[]` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.getpartitionedfilters.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.getpartitionedfilters.md new file mode 100644 index 0000000000000..ca8e9b8b4ff42 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.getpartitionedfilters.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FilterManager](./kibana-plugin-plugins-data-public.filtermanager.md) > [getPartitionedFilters](./kibana-plugin-plugins-data-public.filtermanager.getpartitionedfilters.md) + +## FilterManager.getPartitionedFilters() method + +Signature: + +```typescript +getPartitionedFilters(): PartitionedFilters; +``` +Returns: + +`PartitionedFilters` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.getupdates_.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.getupdates_.md new file mode 100644 index 0000000000000..ca121c4a51877 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.getupdates_.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FilterManager](./kibana-plugin-plugins-data-public.filtermanager.md) > [getUpdates$](./kibana-plugin-plugins-data-public.filtermanager.getupdates_.md) + +## FilterManager.getUpdates$() method + +Signature: + +```typescript +getUpdates$(): import("rxjs").Observable; +``` +Returns: + +`import("rxjs").Observable` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.md new file mode 100644 index 0000000000000..3e85859a3c831 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.md @@ -0,0 +1,36 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FilterManager](./kibana-plugin-plugins-data-public.filtermanager.md) + +## FilterManager class + +Signature: + +```typescript +export declare class FilterManager +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(uiSettings)](./kibana-plugin-plugins-data-public.filtermanager._constructor_.md) | | Constructs a new instance of the FilterManager class | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [addFilters(filters, pinFilterStatus)](./kibana-plugin-plugins-data-public.filtermanager.addfilters.md) | | | +| [getAppFilters()](./kibana-plugin-plugins-data-public.filtermanager.getappfilters.md) | | | +| [getFetches$()](./kibana-plugin-plugins-data-public.filtermanager.getfetches_.md) | | | +| [getFilters()](./kibana-plugin-plugins-data-public.filtermanager.getfilters.md) | | | +| [getGlobalFilters()](./kibana-plugin-plugins-data-public.filtermanager.getglobalfilters.md) | | | +| [getPartitionedFilters()](./kibana-plugin-plugins-data-public.filtermanager.getpartitionedfilters.md) | | | +| [getUpdates$()](./kibana-plugin-plugins-data-public.filtermanager.getupdates_.md) | | | +| [removeAll()](./kibana-plugin-plugins-data-public.filtermanager.removeall.md) | | | +| [removeFilter(filter)](./kibana-plugin-plugins-data-public.filtermanager.removefilter.md) | | | +| [setAppFilters(newAppFilters)](./kibana-plugin-plugins-data-public.filtermanager.setappfilters.md) | | Sets new app filters and leaves global filters untouched, Removes app filters for which there is a duplicate within new global filters | +| [setFilters(newFilters, pinFilterStatus)](./kibana-plugin-plugins-data-public.filtermanager.setfilters.md) | | | +| [setFiltersStore(filters, store, shouldOverrideStore)](./kibana-plugin-plugins-data-public.filtermanager.setfiltersstore.md) | static | | +| [setGlobalFilters(newGlobalFilters)](./kibana-plugin-plugins-data-public.filtermanager.setglobalfilters.md) | | Sets new global filters and leaves app filters untouched, Removes app filters for which there is a duplicate within new global filters | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.removeall.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.removeall.md new file mode 100644 index 0000000000000..745e62f36503d --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.removeall.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FilterManager](./kibana-plugin-plugins-data-public.filtermanager.md) > [removeAll](./kibana-plugin-plugins-data-public.filtermanager.removeall.md) + +## FilterManager.removeAll() method + +Signature: + +```typescript +removeAll(): void; +``` +Returns: + +`void` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.removefilter.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.removefilter.md new file mode 100644 index 0000000000000..a048cc2e21c8f --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.removefilter.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FilterManager](./kibana-plugin-plugins-data-public.filtermanager.md) > [removeFilter](./kibana-plugin-plugins-data-public.filtermanager.removefilter.md) + +## FilterManager.removeFilter() method + +Signature: + +```typescript +removeFilter(filter: Filter): void; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| filter | Filter | | + +Returns: + +`void` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.setappfilters.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.setappfilters.md new file mode 100644 index 0000000000000..36743fc0d3cad --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.setappfilters.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FilterManager](./kibana-plugin-plugins-data-public.filtermanager.md) > [setAppFilters](./kibana-plugin-plugins-data-public.filtermanager.setappfilters.md) + +## FilterManager.setAppFilters() method + +Sets new app filters and leaves global filters untouched, Removes app filters for which there is a duplicate within new global filters + +Signature: + +```typescript +setAppFilters(newAppFilters: Filter[]): void; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| newAppFilters | Filter[] | | + +Returns: + +`void` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.setfilters.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.setfilters.md new file mode 100644 index 0000000000000..0e37e55cee324 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.setfilters.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FilterManager](./kibana-plugin-plugins-data-public.filtermanager.md) > [setFilters](./kibana-plugin-plugins-data-public.filtermanager.setfilters.md) + +## FilterManager.setFilters() method + +Signature: + +```typescript +setFilters(newFilters: Filter[], pinFilterStatus?: boolean): void; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| newFilters | Filter[] | | +| pinFilterStatus | boolean | | + +Returns: + +`void` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.setfiltersstore.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.setfiltersstore.md new file mode 100644 index 0000000000000..1f0982b20353a --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.setfiltersstore.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FilterManager](./kibana-plugin-plugins-data-public.filtermanager.md) > [setFiltersStore](./kibana-plugin-plugins-data-public.filtermanager.setfiltersstore.md) + +## FilterManager.setFiltersStore() method + +Signature: + +```typescript +static setFiltersStore(filters: Filter[], store: FilterStateStore, shouldOverrideStore?: boolean): void; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| filters | Filter[] | | +| store | FilterStateStore | | +| shouldOverrideStore | boolean | | + +Returns: + +`void` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.setglobalfilters.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.setglobalfilters.md new file mode 100644 index 0000000000000..cd234d2350696 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filtermanager.setglobalfilters.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FilterManager](./kibana-plugin-plugins-data-public.filtermanager.md) > [setGlobalFilters](./kibana-plugin-plugins-data-public.filtermanager.setglobalfilters.md) + +## FilterManager.setGlobalFilters() method + +Sets new global filters and leaves app filters untouched, Removes app filters for which there is a duplicate within new global filters + +Signature: + +```typescript +setGlobalFilters(newGlobalFilters: Filter[]): void; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| newGlobalFilters | Filter[] | | + +Returns: + +`void` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.getespreference.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.getespreference.md new file mode 100644 index 0000000000000..f872c56c168ce --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.getespreference.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [getEsPreference](./kibana-plugin-plugins-data-public.getespreference.md) + +## getEsPreference() function + +Signature: + +```typescript +export declare function getEsPreference(uiSettings: IUiSettingsClient, sessionId?: string): any; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| uiSettings | IUiSettingsClient | | +| sessionId | string | | + +Returns: + +`any` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.getkbntypenames.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.getkbntypenames.md new file mode 100644 index 0000000000000..57ea5bab6e8c3 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.getkbntypenames.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [getKbnTypeNames](./kibana-plugin-plugins-data-public.getkbntypenames.md) + +## getKbnTypeNames variable + +Get the esTypes known by all kbnFieldTypes + + {Array} + +Signature: + +```typescript +getKbnTypeNames: () => string[] +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.getquerylog.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.getquerylog.md new file mode 100644 index 0000000000000..e933245e81623 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.getquerylog.md @@ -0,0 +1,25 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [getQueryLog](./kibana-plugin-plugins-data-public.getquerylog.md) + +## getQueryLog() function + +Signature: + +```typescript +export declare function getQueryLog(uiSettings: IUiSettingsClient, storage: IStorageWrapper, appName: string, language: string): PersistedLog; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| uiSettings | IUiSettingsClient | | +| storage | IStorageWrapper | | +| appName | string | | +| language | string | | + +Returns: + +`PersistedLog` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.getsearcherrortype.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.getsearcherrortype.md new file mode 100644 index 0000000000000..b46728c093792 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.getsearcherrortype.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [getSearchErrorType](./kibana-plugin-plugins-data-public.getsearcherrortype.md) + +## getSearchErrorType() function + +Signature: + +```typescript +export declare function getSearchErrorType({ message }: Pick): "UNSUPPORTED_QUERY" | undefined; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| { message } | Pick<SearchError, 'message'> | | + +Returns: + +`"UNSUPPORTED_QUERY" | undefined` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.gettime.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.gettime.md new file mode 100644 index 0000000000000..04a0d871cab2d --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.gettime.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [getTime](./kibana-plugin-plugins-data-public.gettime.md) + +## getTime() function + +Signature: + +```typescript +export declare function getTime(indexPattern: IIndexPattern | undefined, timeRange: TimeRange, forceNow?: Date): import("../..").RangeFilter | undefined; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| indexPattern | IIndexPattern | undefined | | +| timeRange | TimeRange | | +| forceNow | Date | | + +Returns: + +`import("../..").RangeFilter | undefined` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.hassearchstategyforindexpattern.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.hassearchstategyforindexpattern.md new file mode 100644 index 0000000000000..94608e7a86820 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.hassearchstategyforindexpattern.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [hasSearchStategyForIndexPattern](./kibana-plugin-plugins-data-public.hassearchstategyforindexpattern.md) + +## hasSearchStategyForIndexPattern variable + +Signature: + +```typescript +hasSearchStategyForIndexPattern: (indexPattern: IndexPattern) => boolean +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.appname.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.appname.md new file mode 100644 index 0000000000000..b58ee46f638db --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.appname.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IDataPluginServices](./kibana-plugin-plugins-data-public.idatapluginservices.md) > [appName](./kibana-plugin-plugins-data-public.idatapluginservices.appname.md) + +## IDataPluginServices.appName property + +Signature: + +```typescript +appName: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.data.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.data.md new file mode 100644 index 0000000000000..8a94974a7dd6b --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.data.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IDataPluginServices](./kibana-plugin-plugins-data-public.idatapluginservices.md) > [data](./kibana-plugin-plugins-data-public.idatapluginservices.data.md) + +## IDataPluginServices.data property + +Signature: + +```typescript +data: DataPublicPluginStart; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.http.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.http.md new file mode 100644 index 0000000000000..48a04c1204d14 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.http.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IDataPluginServices](./kibana-plugin-plugins-data-public.idatapluginservices.md) > [http](./kibana-plugin-plugins-data-public.idatapluginservices.http.md) + +## IDataPluginServices.http property + +Signature: + +```typescript +http: CoreStart['http']; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.md new file mode 100644 index 0000000000000..5f940bf70a12b --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IDataPluginServices](./kibana-plugin-plugins-data-public.idatapluginservices.md) + +## IDataPluginServices interface + +Signature: + +```typescript +export interface IDataPluginServices extends Partial +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [appName](./kibana-plugin-plugins-data-public.idatapluginservices.appname.md) | string | | +| [data](./kibana-plugin-plugins-data-public.idatapluginservices.data.md) | DataPublicPluginStart | | +| [http](./kibana-plugin-plugins-data-public.idatapluginservices.http.md) | CoreStart['http'] | | +| [notifications](./kibana-plugin-plugins-data-public.idatapluginservices.notifications.md) | CoreStart['notifications'] | | +| [savedObjects](./kibana-plugin-plugins-data-public.idatapluginservices.savedobjects.md) | CoreStart['savedObjects'] | | +| [storage](./kibana-plugin-plugins-data-public.idatapluginservices.storage.md) | IStorageWrapper | | +| [uiSettings](./kibana-plugin-plugins-data-public.idatapluginservices.uisettings.md) | CoreStart['uiSettings'] | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.notifications.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.notifications.md new file mode 100644 index 0000000000000..79b9e8a26e199 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.notifications.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IDataPluginServices](./kibana-plugin-plugins-data-public.idatapluginservices.md) > [notifications](./kibana-plugin-plugins-data-public.idatapluginservices.notifications.md) + +## IDataPluginServices.notifications property + +Signature: + +```typescript +notifications: CoreStart['notifications']; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.savedobjects.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.savedobjects.md new file mode 100644 index 0000000000000..2128d12a56b79 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.savedobjects.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IDataPluginServices](./kibana-plugin-plugins-data-public.idatapluginservices.md) > [savedObjects](./kibana-plugin-plugins-data-public.idatapluginservices.savedobjects.md) + +## IDataPluginServices.savedObjects property + +Signature: + +```typescript +savedObjects: CoreStart['savedObjects']; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.storage.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.storage.md new file mode 100644 index 0000000000000..923c60e7245d3 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.storage.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IDataPluginServices](./kibana-plugin-plugins-data-public.idatapluginservices.md) > [storage](./kibana-plugin-plugins-data-public.idatapluginservices.storage.md) + +## IDataPluginServices.storage property + +Signature: + +```typescript +storage: IStorageWrapper; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.uisettings.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.uisettings.md new file mode 100644 index 0000000000000..ccdd2ec23dc84 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.idatapluginservices.uisettings.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IDataPluginServices](./kibana-plugin-plugins-data-public.idatapluginservices.md) > [uiSettings](./kibana-plugin-plugins-data-public.idatapluginservices.uisettings.md) + +## IDataPluginServices.uiSettings property + +Signature: + +```typescript +uiSettings: CoreStart['uiSettings']; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iessearchrequest.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iessearchrequest.md new file mode 100644 index 0000000000000..7a40725a67e5f --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iessearchrequest.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IEsSearchRequest](./kibana-plugin-plugins-data-public.iessearchrequest.md) + +## IEsSearchRequest interface + +Signature: + +```typescript +export interface IEsSearchRequest extends IKibanaSearchRequest +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [params](./kibana-plugin-plugins-data-public.iessearchrequest.params.md) | SearchParams | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iessearchrequest.params.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iessearchrequest.params.md new file mode 100644 index 0000000000000..2ca8c83d3f1ef --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iessearchrequest.params.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IEsSearchRequest](./kibana-plugin-plugins-data-public.iessearchrequest.md) > [params](./kibana-plugin-plugins-data-public.iessearchrequest.params.md) + +## IEsSearchRequest.params property + +Signature: + +```typescript +params: SearchParams; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iessearchresponse.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iessearchresponse.md new file mode 100644 index 0000000000000..a5027ef292ef8 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iessearchresponse.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IEsSearchResponse](./kibana-plugin-plugins-data-public.iessearchresponse.md) + +## IEsSearchResponse interface + +Signature: + +```typescript +export interface IEsSearchResponse extends IKibanaSearchResponse +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [rawResponse](./kibana-plugin-plugins-data-public.iessearchresponse.rawresponse.md) | SearchResponse<Hits> | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iessearchresponse.rawresponse.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iessearchresponse.rawresponse.md new file mode 100644 index 0000000000000..8f6563a1cea84 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iessearchresponse.rawresponse.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IEsSearchResponse](./kibana-plugin-plugins-data-public.iessearchresponse.md) > [rawResponse](./kibana-plugin-plugins-data-public.iessearchresponse.rawresponse.md) + +## IEsSearchResponse.rawResponse property + +Signature: + +```typescript +rawResponse: SearchResponse; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldformat.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldformat.md new file mode 100644 index 0000000000000..0937706d6b0e9 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldformat.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IFieldFormat](./kibana-plugin-plugins-data-public.ifieldformat.md) + +## IFieldFormat type + +Signature: + +```typescript +export declare type IFieldFormat = PublicMethodsOf; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldformatsregistry.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldformatsregistry.md new file mode 100644 index 0000000000000..0f83e2bb2d423 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldformatsregistry.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IFieldFormatsRegistry](./kibana-plugin-plugins-data-public.ifieldformatsregistry.md) + +## IFieldFormatsRegistry type + +Signature: + +```typescript +declare type IFieldFormatsRegistry = PublicMethodsOf; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldsubtype.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldsubtype.md new file mode 100644 index 0000000000000..7e6ea86d7f3e8 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldsubtype.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IFieldSubType](./kibana-plugin-plugins-data-public.ifieldsubtype.md) + +## IFieldSubType interface + +Signature: + +```typescript +export interface IFieldSubType +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [multi](./kibana-plugin-plugins-data-public.ifieldsubtype.multi.md) | {
parent: string;
} | | +| [nested](./kibana-plugin-plugins-data-public.ifieldsubtype.nested.md) | {
path: string;
} | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldsubtype.multi.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldsubtype.multi.md new file mode 100644 index 0000000000000..6cfc6f037d013 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldsubtype.multi.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IFieldSubType](./kibana-plugin-plugins-data-public.ifieldsubtype.md) > [multi](./kibana-plugin-plugins-data-public.ifieldsubtype.multi.md) + +## IFieldSubType.multi property + +Signature: + +```typescript +multi?: { + parent: string; + }; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldsubtype.nested.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldsubtype.nested.md new file mode 100644 index 0000000000000..f9308b90a1b96 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldsubtype.nested.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IFieldSubType](./kibana-plugin-plugins-data-public.ifieldsubtype.md) > [nested](./kibana-plugin-plugins-data-public.ifieldsubtype.nested.md) + +## IFieldSubType.nested property + +Signature: + +```typescript +nested?: { + path: string; + }; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.aggregatable.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.aggregatable.md new file mode 100644 index 0000000000000..ac657500dc30e --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.aggregatable.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IFieldType](./kibana-plugin-plugins-data-public.ifieldtype.md) > [aggregatable](./kibana-plugin-plugins-data-public.ifieldtype.aggregatable.md) + +## IFieldType.aggregatable property + +Signature: + +```typescript +aggregatable?: boolean; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.count.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.count.md new file mode 100644 index 0000000000000..58e66820d90e8 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.count.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IFieldType](./kibana-plugin-plugins-data-public.ifieldtype.md) > [count](./kibana-plugin-plugins-data-public.ifieldtype.count.md) + +## IFieldType.count property + +Signature: + +```typescript +count?: number; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.displayname.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.displayname.md new file mode 100644 index 0000000000000..3a367ff86bd4d --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.displayname.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IFieldType](./kibana-plugin-plugins-data-public.ifieldtype.md) > [displayName](./kibana-plugin-plugins-data-public.ifieldtype.displayname.md) + +## IFieldType.displayName property + +Signature: + +```typescript +displayName?: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.estypes.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.estypes.md new file mode 100644 index 0000000000000..9500ef64687d3 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.estypes.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IFieldType](./kibana-plugin-plugins-data-public.ifieldtype.md) > [esTypes](./kibana-plugin-plugins-data-public.ifieldtype.estypes.md) + +## IFieldType.esTypes property + +Signature: + +```typescript +esTypes?: string[]; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.filterable.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.filterable.md new file mode 100644 index 0000000000000..b02424a2f7bf7 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.filterable.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IFieldType](./kibana-plugin-plugins-data-public.ifieldtype.md) > [filterable](./kibana-plugin-plugins-data-public.ifieldtype.filterable.md) + +## IFieldType.filterable property + +Signature: + +```typescript +filterable?: boolean; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.format.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.format.md new file mode 100644 index 0000000000000..d2de74398e416 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.format.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IFieldType](./kibana-plugin-plugins-data-public.ifieldtype.md) > [format](./kibana-plugin-plugins-data-public.ifieldtype.format.md) + +## IFieldType.format property + +Signature: + +```typescript +format?: any; +``` 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 new file mode 100644 index 0000000000000..a994fc458cfb6 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.lang.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IFieldType](./kibana-plugin-plugins-data-public.ifieldtype.md) > [lang](./kibana-plugin-plugins-data-public.ifieldtype.lang.md) + +## IFieldType.lang property + +Signature: + +```typescript +lang?: string; +``` 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 new file mode 100644 index 0000000000000..be6af335f20cd --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.md @@ -0,0 +1,33 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IFieldType](./kibana-plugin-plugins-data-public.ifieldtype.md) + +## IFieldType interface + +Signature: + +```typescript +export interface IFieldType +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [aggregatable](./kibana-plugin-plugins-data-public.ifieldtype.aggregatable.md) | boolean | | +| [count](./kibana-plugin-plugins-data-public.ifieldtype.count.md) | number | | +| [displayName](./kibana-plugin-plugins-data-public.ifieldtype.displayname.md) | string | | +| [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 | | +| [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 | | +| [scripted](./kibana-plugin-plugins-data-public.ifieldtype.scripted.md) | boolean | | +| [searchable](./kibana-plugin-plugins-data-public.ifieldtype.searchable.md) | boolean | | +| [sortable](./kibana-plugin-plugins-data-public.ifieldtype.sortable.md) | boolean | | +| [subType](./kibana-plugin-plugins-data-public.ifieldtype.subtype.md) | IFieldSubType | | +| [type](./kibana-plugin-plugins-data-public.ifieldtype.type.md) | string | | +| [visualizable](./kibana-plugin-plugins-data-public.ifieldtype.visualizable.md) | boolean | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.name.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.name.md new file mode 100644 index 0000000000000..1c01484372fd3 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.name.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IFieldType](./kibana-plugin-plugins-data-public.ifieldtype.md) > [name](./kibana-plugin-plugins-data-public.ifieldtype.name.md) + +## IFieldType.name property + +Signature: + +```typescript +name: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.readfromdocvalues.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.readfromdocvalues.md new file mode 100644 index 0000000000000..9f16b29edc9fe --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.readfromdocvalues.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IFieldType](./kibana-plugin-plugins-data-public.ifieldtype.md) > [readFromDocValues](./kibana-plugin-plugins-data-public.ifieldtype.readfromdocvalues.md) + +## IFieldType.readFromDocValues property + +Signature: + +```typescript +readFromDocValues?: boolean; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.script.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.script.md new file mode 100644 index 0000000000000..252c2c3822046 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.script.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IFieldType](./kibana-plugin-plugins-data-public.ifieldtype.md) > [script](./kibana-plugin-plugins-data-public.ifieldtype.script.md) + +## IFieldType.script property + +Signature: + +```typescript +script?: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.scripted.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.scripted.md new file mode 100644 index 0000000000000..33bbd0c2c20cb --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.scripted.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IFieldType](./kibana-plugin-plugins-data-public.ifieldtype.md) > [scripted](./kibana-plugin-plugins-data-public.ifieldtype.scripted.md) + +## IFieldType.scripted property + +Signature: + +```typescript +scripted?: boolean; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.searchable.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.searchable.md new file mode 100644 index 0000000000000..f977628f76698 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.searchable.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IFieldType](./kibana-plugin-plugins-data-public.ifieldtype.md) > [searchable](./kibana-plugin-plugins-data-public.ifieldtype.searchable.md) + +## IFieldType.searchable property + +Signature: + +```typescript +searchable?: boolean; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.sortable.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.sortable.md new file mode 100644 index 0000000000000..0fd3943fb3c6e --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.sortable.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IFieldType](./kibana-plugin-plugins-data-public.ifieldtype.md) > [sortable](./kibana-plugin-plugins-data-public.ifieldtype.sortable.md) + +## IFieldType.sortable property + +Signature: + +```typescript +sortable?: boolean; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.subtype.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.subtype.md new file mode 100644 index 0000000000000..d0c26186da085 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.subtype.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IFieldType](./kibana-plugin-plugins-data-public.ifieldtype.md) > [subType](./kibana-plugin-plugins-data-public.ifieldtype.subtype.md) + +## IFieldType.subType property + +Signature: + +```typescript +subType?: IFieldSubType; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.type.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.type.md new file mode 100644 index 0000000000000..26228cbe4bfdb --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.type.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IFieldType](./kibana-plugin-plugins-data-public.ifieldtype.md) > [type](./kibana-plugin-plugins-data-public.ifieldtype.type.md) + +## IFieldType.type property + +Signature: + +```typescript +type: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.visualizable.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.visualizable.md new file mode 100644 index 0000000000000..19a50bee9638d --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.visualizable.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IFieldType](./kibana-plugin-plugins-data-public.ifieldtype.md) > [visualizable](./kibana-plugin-plugins-data-public.ifieldtype.visualizable.md) + +## IFieldType.visualizable property + +Signature: + +```typescript +visualizable?: boolean; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iindexpattern.fieldformatmap.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iindexpattern.fieldformatmap.md new file mode 100644 index 0000000000000..2c131c6da9937 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iindexpattern.fieldformatmap.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IIndexPattern](./kibana-plugin-plugins-data-public.iindexpattern.md) > [fieldFormatMap](./kibana-plugin-plugins-data-public.iindexpattern.fieldformatmap.md) + +## IIndexPattern.fieldFormatMap property + +Signature: + +```typescript +fieldFormatMap?: Record; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iindexpattern.fields.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iindexpattern.fields.md new file mode 100644 index 0000000000000..792bee44f96a8 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iindexpattern.fields.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IIndexPattern](./kibana-plugin-plugins-data-public.iindexpattern.md) > [fields](./kibana-plugin-plugins-data-public.iindexpattern.fields.md) + +## IIndexPattern.fields property + +Signature: + +```typescript +fields: IFieldType[]; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iindexpattern.id.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iindexpattern.id.md new file mode 100644 index 0000000000000..917a80975df6c --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iindexpattern.id.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IIndexPattern](./kibana-plugin-plugins-data-public.iindexpattern.md) > [id](./kibana-plugin-plugins-data-public.iindexpattern.id.md) + +## IIndexPattern.id property + +Signature: + +```typescript +id?: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iindexpattern.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iindexpattern.md new file mode 100644 index 0000000000000..1bbd6cf67f0ce --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iindexpattern.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IIndexPattern](./kibana-plugin-plugins-data-public.iindexpattern.md) + +## IIndexPattern interface + +Signature: + +```typescript +export interface IIndexPattern +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [fieldFormatMap](./kibana-plugin-plugins-data-public.iindexpattern.fieldformatmap.md) | Record<string, {
id: string;
params: unknown;
}> | | +| [fields](./kibana-plugin-plugins-data-public.iindexpattern.fields.md) | IFieldType[] | | +| [id](./kibana-plugin-plugins-data-public.iindexpattern.id.md) | string | | +| [timeFieldName](./kibana-plugin-plugins-data-public.iindexpattern.timefieldname.md) | string | | +| [title](./kibana-plugin-plugins-data-public.iindexpattern.title.md) | string | | +| [type](./kibana-plugin-plugins-data-public.iindexpattern.type.md) | string | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iindexpattern.timefieldname.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iindexpattern.timefieldname.md new file mode 100644 index 0000000000000..791e9e53ee3da --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iindexpattern.timefieldname.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IIndexPattern](./kibana-plugin-plugins-data-public.iindexpattern.md) > [timeFieldName](./kibana-plugin-plugins-data-public.iindexpattern.timefieldname.md) + +## IIndexPattern.timeFieldName property + +Signature: + +```typescript +timeFieldName?: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iindexpattern.title.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iindexpattern.title.md new file mode 100644 index 0000000000000..c3a8644307b64 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iindexpattern.title.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IIndexPattern](./kibana-plugin-plugins-data-public.iindexpattern.md) > [title](./kibana-plugin-plugins-data-public.iindexpattern.title.md) + +## IIndexPattern.title property + +Signature: + +```typescript +title: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iindexpattern.type.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iindexpattern.type.md new file mode 100644 index 0000000000000..ea75c20b403c0 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iindexpattern.type.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IIndexPattern](./kibana-plugin-plugins-data-public.iindexpattern.md) > [type](./kibana-plugin-plugins-data-public.iindexpattern.type.md) + +## IIndexPattern.type property + +Signature: + +```typescript +type?: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ikibanasearchrequest.debug.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ikibanasearchrequest.debug.md new file mode 100644 index 0000000000000..cfb21a78557fd --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ikibanasearchrequest.debug.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IKibanaSearchRequest](./kibana-plugin-plugins-data-public.ikibanasearchrequest.md) > [debug](./kibana-plugin-plugins-data-public.ikibanasearchrequest.debug.md) + +## IKibanaSearchRequest.debug property + +Optionally tell search strategies to output debug information. + +Signature: + +```typescript +debug?: boolean; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ikibanasearchrequest.id.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ikibanasearchrequest.id.md new file mode 100644 index 0000000000000..61976abca3d6a --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ikibanasearchrequest.id.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IKibanaSearchRequest](./kibana-plugin-plugins-data-public.ikibanasearchrequest.md) > [id](./kibana-plugin-plugins-data-public.ikibanasearchrequest.id.md) + +## IKibanaSearchRequest.id property + +An id can be used to uniquely identify this request. + +Signature: + +```typescript +id?: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ikibanasearchrequest.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ikibanasearchrequest.md new file mode 100644 index 0000000000000..57e0fbe2c19a9 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ikibanasearchrequest.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IKibanaSearchRequest](./kibana-plugin-plugins-data-public.ikibanasearchrequest.md) + +## IKibanaSearchRequest interface + +Signature: + +```typescript +export interface IKibanaSearchRequest +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [debug](./kibana-plugin-plugins-data-public.ikibanasearchrequest.debug.md) | boolean | Optionally tell search strategies to output debug information. | +| [id](./kibana-plugin-plugins-data-public.ikibanasearchrequest.id.md) | string | An id can be used to uniquely identify this request. | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ikibanasearchresponse.id.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ikibanasearchresponse.id.md new file mode 100644 index 0000000000000..33dbf0d97b705 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ikibanasearchresponse.id.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IKibanaSearchResponse](./kibana-plugin-plugins-data-public.ikibanasearchresponse.md) > [id](./kibana-plugin-plugins-data-public.ikibanasearchresponse.id.md) + +## IKibanaSearchResponse.id property + +Some responses may contain a unique id to identify the request this response came from. + +Signature: + +```typescript +id?: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ikibanasearchresponse.loaded.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ikibanasearchresponse.loaded.md new file mode 100644 index 0000000000000..efa86795ffca5 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ikibanasearchresponse.loaded.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IKibanaSearchResponse](./kibana-plugin-plugins-data-public.ikibanasearchresponse.md) > [loaded](./kibana-plugin-plugins-data-public.ikibanasearchresponse.loaded.md) + +## IKibanaSearchResponse.loaded property + +If relevant to the search strategy, return a loaded number that represents how progress is indicated. + +Signature: + +```typescript +loaded?: number; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ikibanasearchresponse.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ikibanasearchresponse.md new file mode 100644 index 0000000000000..f7dfd1ddd2f49 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ikibanasearchresponse.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IKibanaSearchResponse](./kibana-plugin-plugins-data-public.ikibanasearchresponse.md) + +## IKibanaSearchResponse interface + +Signature: + +```typescript +export interface IKibanaSearchResponse +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [id](./kibana-plugin-plugins-data-public.ikibanasearchresponse.id.md) | string | Some responses may contain a unique id to identify the request this response came from. | +| [loaded](./kibana-plugin-plugins-data-public.ikibanasearchresponse.loaded.md) | number | If relevant to the search strategy, return a loaded number that represents how progress is indicated. | +| [total](./kibana-plugin-plugins-data-public.ikibanasearchresponse.total.md) | number | If relevant to the search strategy, return a total number that represents how progress is indicated. | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ikibanasearchresponse.total.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ikibanasearchresponse.total.md new file mode 100644 index 0000000000000..cfa3567da86fc --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ikibanasearchresponse.total.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IKibanaSearchResponse](./kibana-plugin-plugins-data-public.ikibanasearchresponse.md) > [total](./kibana-plugin-plugins-data-public.ikibanasearchresponse.total.md) + +## IKibanaSearchResponse.total property + +If relevant to the search strategy, return a total number that represents how progress is indicated. + +Signature: + +```typescript +total?: number; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern._constructor_.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern._constructor_.md new file mode 100644 index 0000000000000..4159247bb7c32 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern._constructor_.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) > [(constructor)](./kibana-plugin-plugins-data-public.indexpattern._constructor_.md) + +## IndexPattern.(constructor) + +Constructs a new instance of the `IndexPattern` class + +Signature: + +```typescript +constructor(id: string | undefined, getConfig: any, savedObjectsClient: SavedObjectsClientContract, apiClient: IIndexPatternsApiClient, patternCache: any); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| id | string | undefined | | +| getConfig | any | | +| savedObjectsClient | SavedObjectsClientContract | | +| apiClient | IIndexPatternsApiClient | | +| patternCache | any | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern._fetchfields.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern._fetchfields.md new file mode 100644 index 0000000000000..8fff8baa71139 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern._fetchfields.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [\_fetchFields](./kibana-plugin-plugins-data-public.indexpattern._fetchfields.md) + +## IndexPattern.\_fetchFields() method + +Signature: + +```typescript +_fetchFields(): Promise; +``` +Returns: + +`Promise` + 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 new file mode 100644 index 0000000000000..4bbbd83c65e10 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.addscriptedfield.md @@ -0,0 +1,25 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [addScriptedField](./kibana-plugin-plugins-data-public.indexpattern.addscriptedfield.md) + +## IndexPattern.addScriptedField() method + +Signature: + +```typescript +addScriptedField(name: string, script: string, fieldType: string | undefined, lang: string): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | | +| script | string | | +| fieldType | string | undefined | | +| lang | string | | + +Returns: + +`Promise` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.create.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.create.md new file mode 100644 index 0000000000000..5c122b835f59d --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.create.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [create](./kibana-plugin-plugins-data-public.indexpattern.create.md) + +## IndexPattern.create() method + +Signature: + +```typescript +create(allowOverride?: boolean): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| allowOverride | boolean | | + +Returns: + +`Promise` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.destroy.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.destroy.md new file mode 100644 index 0000000000000..3a8e1b9dae5a6 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.destroy.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [destroy](./kibana-plugin-plugins-data-public.indexpattern.destroy.md) + +## IndexPattern.destroy() method + +Signature: + +```typescript +destroy(): Promise<{}> | undefined; +``` +Returns: + +`Promise<{}> | undefined` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.fieldformatmap.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.fieldformatmap.md new file mode 100644 index 0000000000000..b89b244d9826c --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.fieldformatmap.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [fieldFormatMap](./kibana-plugin-plugins-data-public.indexpattern.fieldformatmap.md) + +## IndexPattern.fieldFormatMap property + +Signature: + +```typescript +fieldFormatMap: any; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.fields.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.fields.md new file mode 100644 index 0000000000000..fcd682340eb53 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.fields.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [fields](./kibana-plugin-plugins-data-public.indexpattern.fields.md) + +## IndexPattern.fields property + +Signature: + +```typescript +fields: IFieldList; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.fieldsfetcher.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.fieldsfetcher.md new file mode 100644 index 0000000000000..4d44b386a1db1 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.fieldsfetcher.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [fieldsFetcher](./kibana-plugin-plugins-data-public.indexpattern.fieldsfetcher.md) + +## IndexPattern.fieldsFetcher property + +Signature: + +```typescript +fieldsFetcher: any; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.flattenhit.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.flattenhit.md new file mode 100644 index 0000000000000..db28d95197bb3 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.flattenhit.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [flattenHit](./kibana-plugin-plugins-data-public.indexpattern.flattenhit.md) + +## IndexPattern.flattenHit property + +Signature: + +```typescript +flattenHit: any; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.formatfield.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.formatfield.md new file mode 100644 index 0000000000000..5a475d6161ac3 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.formatfield.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [formatField](./kibana-plugin-plugins-data-public.indexpattern.formatfield.md) + +## IndexPattern.formatField property + +Signature: + +```typescript +formatField: any; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.formathit.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.formathit.md new file mode 100644 index 0000000000000..ac515d374a93f --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.formathit.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [formatHit](./kibana-plugin-plugins-data-public.indexpattern.formathit.md) + +## IndexPattern.formatHit property + +Signature: + +```typescript +formatHit: any; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getaggregationrestrictions.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getaggregationrestrictions.md new file mode 100644 index 0000000000000..e42980bb53af4 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getaggregationrestrictions.md @@ -0,0 +1,29 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [getAggregationRestrictions](./kibana-plugin-plugins-data-public.indexpattern.getaggregationrestrictions.md) + +## IndexPattern.getAggregationRestrictions() method + +Signature: + +```typescript +getAggregationRestrictions(): Record> | undefined; +``` +Returns: + +`Record> | undefined` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getcomputedfields.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getcomputedfields.md new file mode 100644 index 0000000000000..84aeb9ffeb21a --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getcomputedfields.md @@ -0,0 +1,29 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [getComputedFields](./kibana-plugin-plugins-data-public.indexpattern.getcomputedfields.md) + +## IndexPattern.getComputedFields() method + +Signature: + +```typescript +getComputedFields(): { + storedFields: string[]; + scriptFields: any; + docvalueFields: { + field: any; + format: string; + }[]; + }; +``` +Returns: + +`{ + storedFields: string[]; + scriptFields: any; + docvalueFields: { + field: any; + format: string; + }[]; + }` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getfieldbyname.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getfieldbyname.md new file mode 100644 index 0000000000000..e6a23c5c70aab --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getfieldbyname.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [getFieldByName](./kibana-plugin-plugins-data-public.indexpattern.getfieldbyname.md) + +## IndexPattern.getFieldByName() method + +Signature: + +```typescript +getFieldByName(name: string): Field | void; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | | + +Returns: + +`Field | void` + 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 new file mode 100644 index 0000000000000..4e49304484815 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getnonscriptedfields.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [getNonScriptedFields](./kibana-plugin-plugins-data-public.indexpattern.getnonscriptedfields.md) + +## IndexPattern.getNonScriptedFields() method + +Signature: + +```typescript +getNonScriptedFields(): Field[]; +``` +Returns: + +`Field[]` + 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 new file mode 100644 index 0000000000000..9ab4f9a9aaed5 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getscriptedfields.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [getScriptedFields](./kibana-plugin-plugins-data-public.indexpattern.getscriptedfields.md) + +## IndexPattern.getScriptedFields() method + +Signature: + +```typescript +getScriptedFields(): Field[]; +``` +Returns: + +`Field[]` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getsourcefiltering.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getsourcefiltering.md new file mode 100644 index 0000000000000..121d32c7c40c8 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getsourcefiltering.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [getSourceFiltering](./kibana-plugin-plugins-data-public.indexpattern.getsourcefiltering.md) + +## IndexPattern.getSourceFiltering() method + +Signature: + +```typescript +getSourceFiltering(): { + excludes: any[]; + }; +``` +Returns: + +`{ + excludes: any[]; + }` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.gettimefield.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.gettimefield.md new file mode 100644 index 0000000000000..8e68e8c35aff7 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.gettimefield.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [getTimeField](./kibana-plugin-plugins-data-public.indexpattern.gettimefield.md) + +## IndexPattern.getTimeField() method + +Signature: + +```typescript +getTimeField(): Field | undefined; +``` +Returns: + +`Field | undefined` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.id.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.id.md new file mode 100644 index 0000000000000..85e680170d6ea --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.id.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [id](./kibana-plugin-plugins-data-public.indexpattern.id.md) + +## IndexPattern.id property + +Signature: + +```typescript +id?: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.init.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.init.md new file mode 100644 index 0000000000000..ce401bec87dbb --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.init.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [init](./kibana-plugin-plugins-data-public.indexpattern.init.md) + +## IndexPattern.init() method + +Signature: + +```typescript +init(forceFieldRefresh?: boolean): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| forceFieldRefresh | boolean | | + +Returns: + +`Promise` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.istimebased.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.istimebased.md new file mode 100644 index 0000000000000..aca243496d083 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.istimebased.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [isTimeBased](./kibana-plugin-plugins-data-public.indexpattern.istimebased.md) + +## IndexPattern.isTimeBased() method + +Signature: + +```typescript +isTimeBased(): boolean; +``` +Returns: + +`boolean` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.istimebasedwildcard.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.istimebasedwildcard.md new file mode 100644 index 0000000000000..27f99f418a078 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.istimebasedwildcard.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [isTimeBasedWildcard](./kibana-plugin-plugins-data-public.indexpattern.istimebasedwildcard.md) + +## IndexPattern.isTimeBasedWildcard() method + +Signature: + +```typescript +isTimeBasedWildcard(): boolean; +``` +Returns: + +`boolean` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.istimenanosbased.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.istimenanosbased.md new file mode 100644 index 0000000000000..3a3767ae64149 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.istimenanosbased.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [isTimeNanosBased](./kibana-plugin-plugins-data-public.indexpattern.istimenanosbased.md) + +## IndexPattern.isTimeNanosBased() method + +Signature: + +```typescript +isTimeNanosBased(): boolean; +``` +Returns: + +`boolean` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.iswildcard.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.iswildcard.md new file mode 100644 index 0000000000000..e5ea55ef1dd48 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.iswildcard.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [isWildcard](./kibana-plugin-plugins-data-public.indexpattern.iswildcard.md) + +## IndexPattern.isWildcard() method + +Signature: + +```typescript +isWildcard(): boolean; +``` +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 new file mode 100644 index 0000000000000..35075e19dcaf6 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.md @@ -0,0 +1,64 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) + +## IndexPattern class + +Signature: + +```typescript +export declare class IndexPattern implements IIndexPattern +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(id, getConfig, savedObjectsClient, apiClient, patternCache)](./kibana-plugin-plugins-data-public.indexpattern._constructor_.md) | | Constructs a new instance of the IndexPattern class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [fieldFormatMap](./kibana-plugin-plugins-data-public.indexpattern.fieldformatmap.md) | | any | | +| [fields](./kibana-plugin-plugins-data-public.indexpattern.fields.md) | | IFieldList | | +| [fieldsFetcher](./kibana-plugin-plugins-data-public.indexpattern.fieldsfetcher.md) | | any | | +| [flattenHit](./kibana-plugin-plugins-data-public.indexpattern.flattenhit.md) | | any | | +| [formatField](./kibana-plugin-plugins-data-public.indexpattern.formatfield.md) | | any | | +| [formatHit](./kibana-plugin-plugins-data-public.indexpattern.formathit.md) | | any | | +| [id](./kibana-plugin-plugins-data-public.indexpattern.id.md) | | string | | +| [metaFields](./kibana-plugin-plugins-data-public.indexpattern.metafields.md) | | string[] | | +| [routes](./kibana-plugin-plugins-data-public.indexpattern.routes.md) | | {
edit: string;
addField: string;
indexedFields: string;
scriptedFields: string;
sourceFilters: string;
} | | +| [timeFieldName](./kibana-plugin-plugins-data-public.indexpattern.timefieldname.md) | | string | undefined | | +| [title](./kibana-plugin-plugins-data-public.indexpattern.title.md) | | string | | +| [type](./kibana-plugin-plugins-data-public.indexpattern.type.md) | | string | | +| [typeMeta](./kibana-plugin-plugins-data-public.indexpattern.typemeta.md) | | TypeMeta | | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [\_fetchFields()](./kibana-plugin-plugins-data-public.indexpattern._fetchfields.md) | | | +| [addScriptedField(name, script, fieldType, lang)](./kibana-plugin-plugins-data-public.indexpattern.addscriptedfield.md) | | | +| [create(allowOverride)](./kibana-plugin-plugins-data-public.indexpattern.create.md) | | | +| [destroy()](./kibana-plugin-plugins-data-public.indexpattern.destroy.md) | | | +| [getAggregationRestrictions()](./kibana-plugin-plugins-data-public.indexpattern.getaggregationrestrictions.md) | | | +| [getComputedFields()](./kibana-plugin-plugins-data-public.indexpattern.getcomputedfields.md) | | | +| [getFieldByName(name)](./kibana-plugin-plugins-data-public.indexpattern.getfieldbyname.md) | | | +| [getNonScriptedFields()](./kibana-plugin-plugins-data-public.indexpattern.getnonscriptedfields.md) | | | +| [getScriptedFields()](./kibana-plugin-plugins-data-public.indexpattern.getscriptedfields.md) | | | +| [getSourceFiltering()](./kibana-plugin-plugins-data-public.indexpattern.getsourcefiltering.md) | | | +| [getTimeField()](./kibana-plugin-plugins-data-public.indexpattern.gettimefield.md) | | | +| [init(forceFieldRefresh)](./kibana-plugin-plugins-data-public.indexpattern.init.md) | | | +| [isTimeBased()](./kibana-plugin-plugins-data-public.indexpattern.istimebased.md) | | | +| [isTimeBasedWildcard()](./kibana-plugin-plugins-data-public.indexpattern.istimebasedwildcard.md) | | | +| [isTimeNanosBased()](./kibana-plugin-plugins-data-public.indexpattern.istimenanosbased.md) | | | +| [isWildcard()](./kibana-plugin-plugins-data-public.indexpattern.iswildcard.md) | | | +| [popularizeField(fieldName, unit)](./kibana-plugin-plugins-data-public.indexpattern.popularizefield.md) | | | +| [prepBody()](./kibana-plugin-plugins-data-public.indexpattern.prepbody.md) | | | +| [refreshFields()](./kibana-plugin-plugins-data-public.indexpattern.refreshfields.md) | | | +| [removeScriptedField(field)](./kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md) | | | +| [save(saveAttempts)](./kibana-plugin-plugins-data-public.indexpattern.save.md) | | | +| [toJSON()](./kibana-plugin-plugins-data-public.indexpattern.tojson.md) | | | +| [toString()](./kibana-plugin-plugins-data-public.indexpattern.tostring.md) | | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.metafields.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.metafields.md new file mode 100644 index 0000000000000..9f56bad35383c --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.metafields.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [metaFields](./kibana-plugin-plugins-data-public.indexpattern.metafields.md) + +## IndexPattern.metaFields property + +Signature: + +```typescript +metaFields: string[]; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.popularizefield.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.popularizefield.md new file mode 100644 index 0000000000000..eba5382158520 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.popularizefield.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [popularizeField](./kibana-plugin-plugins-data-public.indexpattern.popularizefield.md) + +## IndexPattern.popularizeField() method + +Signature: + +```typescript +popularizeField(fieldName: string, unit?: number): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| fieldName | string | | +| unit | number | | + +Returns: + +`Promise` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.prepbody.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.prepbody.md new file mode 100644 index 0000000000000..5c9f017b571da --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.prepbody.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [prepBody](./kibana-plugin-plugins-data-public.indexpattern.prepbody.md) + +## IndexPattern.prepBody() method + +Signature: + +```typescript +prepBody(): { + [key: string]: any; + }; +``` +Returns: + +`{ + [key: string]: any; + }` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.refreshfields.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.refreshfields.md new file mode 100644 index 0000000000000..271d0c45a4244 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.refreshfields.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [refreshFields](./kibana-plugin-plugins-data-public.indexpattern.refreshfields.md) + +## IndexPattern.refreshFields() method + +Signature: + +```typescript +refreshFields(): Promise; +``` +Returns: + +`Promise` + 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 new file mode 100644 index 0000000000000..2a6811f501152 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [removeScriptedField](./kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md) + +## IndexPattern.removeScriptedField() method + +Signature: + +```typescript +removeScriptedField(field: IFieldType): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | IFieldType | | + +Returns: + +`Promise` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.routes.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.routes.md new file mode 100644 index 0000000000000..81e7abd4f9609 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.routes.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [routes](./kibana-plugin-plugins-data-public.indexpattern.routes.md) + +## IndexPattern.routes property + +Signature: + +```typescript +get routes(): { + edit: string; + addField: string; + indexedFields: string; + scriptedFields: string; + sourceFilters: string; + }; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.save.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.save.md new file mode 100644 index 0000000000000..d0b471cc2bc21 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.save.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [save](./kibana-plugin-plugins-data-public.indexpattern.save.md) + +## IndexPattern.save() method + +Signature: + +```typescript +save(saveAttempts?: number): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| saveAttempts | number | | + +Returns: + +`Promise` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.timefieldname.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.timefieldname.md new file mode 100644 index 0000000000000..dc1cab592baac --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.timefieldname.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [timeFieldName](./kibana-plugin-plugins-data-public.indexpattern.timefieldname.md) + +## IndexPattern.timeFieldName property + +Signature: + +```typescript +timeFieldName: string | undefined; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.title.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.title.md new file mode 100644 index 0000000000000..aca6028bee96a --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.title.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [title](./kibana-plugin-plugins-data-public.indexpattern.title.md) + +## IndexPattern.title property + +Signature: + +```typescript +title: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.tojson.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.tojson.md new file mode 100644 index 0000000000000..0ae04bb424d44 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.tojson.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [toJSON](./kibana-plugin-plugins-data-public.indexpattern.tojson.md) + +## IndexPattern.toJSON() method + +Signature: + +```typescript +toJSON(): string | undefined; +``` +Returns: + +`string | undefined` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.tostring.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.tostring.md new file mode 100644 index 0000000000000..a10b549a7b9eb --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.tostring.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [toString](./kibana-plugin-plugins-data-public.indexpattern.tostring.md) + +## IndexPattern.toString() method + +Signature: + +```typescript +toString(): string; +``` +Returns: + +`string` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.type.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.type.md new file mode 100644 index 0000000000000..58047d9e27ac6 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.type.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [type](./kibana-plugin-plugins-data-public.indexpattern.type.md) + +## IndexPattern.type property + +Signature: + +```typescript +type?: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.typemeta.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.typemeta.md new file mode 100644 index 0000000000000..ea8533a8d837c --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.typemeta.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [typeMeta](./kibana-plugin-plugins-data-public.indexpattern.typemeta.md) + +## IndexPattern.typeMeta property + +Signature: + +```typescript +typeMeta?: TypeMeta; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternaggrestrictions.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternaggrestrictions.md new file mode 100644 index 0000000000000..324bd1e410c6c --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternaggrestrictions.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternAggRestrictions](./kibana-plugin-plugins-data-public.indexpatternaggrestrictions.md) + +## IndexPatternAggRestrictions type + +Signature: + +```typescript +export declare type AggregationRestrictions = Record; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternattributes.fields.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternattributes.fields.md new file mode 100644 index 0000000000000..a72184bf0111d --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternattributes.fields.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternAttributes](./kibana-plugin-plugins-data-public.indexpatternattributes.md) > [fields](./kibana-plugin-plugins-data-public.indexpatternattributes.fields.md) + +## IndexPatternAttributes.fields property + +Signature: + +```typescript +fields: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternattributes.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternattributes.md new file mode 100644 index 0000000000000..39ae328c14501 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternattributes.md @@ -0,0 +1,28 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternAttributes](./kibana-plugin-plugins-data-public.indexpatternattributes.md) + +## IndexPatternAttributes interface + +> Warning: This API is now obsolete. +> +> + +Use data plugin interface instead + +Signature: + +```typescript +export interface IndexPatternAttributes +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [fields](./kibana-plugin-plugins-data-public.indexpatternattributes.fields.md) | string | | +| [timeFieldName](./kibana-plugin-plugins-data-public.indexpatternattributes.timefieldname.md) | string | | +| [title](./kibana-plugin-plugins-data-public.indexpatternattributes.title.md) | string | | +| [type](./kibana-plugin-plugins-data-public.indexpatternattributes.type.md) | string | | +| [typeMeta](./kibana-plugin-plugins-data-public.indexpatternattributes.typemeta.md) | string | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternattributes.timefieldname.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternattributes.timefieldname.md new file mode 100644 index 0000000000000..22c241c58f202 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternattributes.timefieldname.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternAttributes](./kibana-plugin-plugins-data-public.indexpatternattributes.md) > [timeFieldName](./kibana-plugin-plugins-data-public.indexpatternattributes.timefieldname.md) + +## IndexPatternAttributes.timeFieldName property + +Signature: + +```typescript +timeFieldName?: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternattributes.title.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternattributes.title.md new file mode 100644 index 0000000000000..bfdb775c19e9b --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternattributes.title.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternAttributes](./kibana-plugin-plugins-data-public.indexpatternattributes.md) > [title](./kibana-plugin-plugins-data-public.indexpatternattributes.title.md) + +## IndexPatternAttributes.title property + +Signature: + +```typescript +title: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternattributes.type.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternattributes.type.md new file mode 100644 index 0000000000000..d980d3af41912 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternattributes.type.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternAttributes](./kibana-plugin-plugins-data-public.indexpatternattributes.md) > [type](./kibana-plugin-plugins-data-public.indexpatternattributes.type.md) + +## IndexPatternAttributes.type property + +Signature: + +```typescript +type: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternattributes.typemeta.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternattributes.typemeta.md new file mode 100644 index 0000000000000..130e4928640f5 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternattributes.typemeta.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternAttributes](./kibana-plugin-plugins-data-public.indexpatternattributes.md) > [typeMeta](./kibana-plugin-plugins-data-public.indexpatternattributes.typemeta.md) + +## IndexPatternAttributes.typeMeta property + +Signature: + +```typescript +typeMeta: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.__spec.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.__spec.md new file mode 100644 index 0000000000000..f52a3324af36f --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.__spec.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) > [$$spec](./kibana-plugin-plugins-data-public.indexpatternfield.__spec.md) + +## IndexPatternField.$$spec property + +Signature: + +```typescript +$$spec: FieldSpec; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield._constructor_.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield._constructor_.md new file mode 100644 index 0000000000000..cf7470c035a53 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield._constructor_.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) > [(constructor)](./kibana-plugin-plugins-data-public.indexpatternfield._constructor_.md) + +## IndexPatternField.(constructor) + +Constructs a new instance of the `Field` class + +Signature: + +```typescript +constructor(indexPattern: IndexPattern, spec: FieldSpec | Field, shortDotsEnable?: boolean); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| indexPattern | IndexPattern | | +| spec | FieldSpec | Field | | +| shortDotsEnable | boolean | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.aggregatable.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.aggregatable.md new file mode 100644 index 0000000000000..267c8f786b5dd --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.aggregatable.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) > [aggregatable](./kibana-plugin-plugins-data-public.indexpatternfield.aggregatable.md) + +## IndexPatternField.aggregatable property + +Signature: + +```typescript +aggregatable?: boolean; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.count.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.count.md new file mode 100644 index 0000000000000..8e848276f21c4 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.count.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) > [count](./kibana-plugin-plugins-data-public.indexpatternfield.count.md) + +## IndexPatternField.count property + +Signature: + +```typescript +count?: number; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.displayname.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.displayname.md new file mode 100644 index 0000000000000..ed9630f92fc97 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.displayname.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) > [displayName](./kibana-plugin-plugins-data-public.indexpatternfield.displayname.md) + +## IndexPatternField.displayName property + +Signature: + +```typescript +displayName?: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.estypes.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.estypes.md new file mode 100644 index 0000000000000..dec74df099d43 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.estypes.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) > [esTypes](./kibana-plugin-plugins-data-public.indexpatternfield.estypes.md) + +## IndexPatternField.esTypes property + +Signature: + +```typescript +esTypes?: string[]; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.filterable.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.filterable.md new file mode 100644 index 0000000000000..4290c4a2f86b3 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.filterable.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) > [filterable](./kibana-plugin-plugins-data-public.indexpatternfield.filterable.md) + +## IndexPatternField.filterable property + +Signature: + +```typescript +filterable?: boolean; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.format.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.format.md new file mode 100644 index 0000000000000..d5df8ed628cb0 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.format.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) > [format](./kibana-plugin-plugins-data-public.indexpatternfield.format.md) + +## IndexPatternField.format property + +Signature: + +```typescript +format: any; +``` 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 new file mode 100644 index 0000000000000..f731be8f613cf --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.lang.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) > [lang](./kibana-plugin-plugins-data-public.indexpatternfield.lang.md) + +## IndexPatternField.lang property + +Signature: + +```typescript +lang?: string; +``` 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 new file mode 100644 index 0000000000000..430590c7a2505 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.md @@ -0,0 +1,40 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) + +## IndexPatternField class + +Signature: + +```typescript +export declare class Field implements IFieldType +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(indexPattern, spec, shortDotsEnable)](./kibana-plugin-plugins-data-public.indexpatternfield._constructor_.md) | | Constructs a new instance of the Field class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [$$spec](./kibana-plugin-plugins-data-public.indexpatternfield.__spec.md) | | FieldSpec | | +| [aggregatable](./kibana-plugin-plugins-data-public.indexpatternfield.aggregatable.md) | | boolean | | +| [count](./kibana-plugin-plugins-data-public.indexpatternfield.count.md) | | number | | +| [displayName](./kibana-plugin-plugins-data-public.indexpatternfield.displayname.md) | | string | | +| [esTypes](./kibana-plugin-plugins-data-public.indexpatternfield.estypes.md) | | string[] | | +| [filterable](./kibana-plugin-plugins-data-public.indexpatternfield.filterable.md) | | boolean | | +| [format](./kibana-plugin-plugins-data-public.indexpatternfield.format.md) | | any | | +| [lang](./kibana-plugin-plugins-data-public.indexpatternfield.lang.md) | | string | | +| [name](./kibana-plugin-plugins-data-public.indexpatternfield.name.md) | | string | | +| [routes](./kibana-plugin-plugins-data-public.indexpatternfield.routes.md) | | Record<string, string> | | +| [script](./kibana-plugin-plugins-data-public.indexpatternfield.script.md) | | string | | +| [scripted](./kibana-plugin-plugins-data-public.indexpatternfield.scripted.md) | | boolean | | +| [searchable](./kibana-plugin-plugins-data-public.indexpatternfield.searchable.md) | | boolean | | +| [sortable](./kibana-plugin-plugins-data-public.indexpatternfield.sortable.md) | | boolean | | +| [subType](./kibana-plugin-plugins-data-public.indexpatternfield.subtype.md) | | IFieldSubType | | +| [type](./kibana-plugin-plugins-data-public.indexpatternfield.type.md) | | string | | +| [visualizable](./kibana-plugin-plugins-data-public.indexpatternfield.visualizable.md) | | boolean | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.name.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.name.md new file mode 100644 index 0000000000000..cb24621e73209 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.name.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) > [name](./kibana-plugin-plugins-data-public.indexpatternfield.name.md) + +## IndexPatternField.name property + +Signature: + +```typescript +name: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.routes.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.routes.md new file mode 100644 index 0000000000000..664a7b7b7ca0e --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.routes.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) > [routes](./kibana-plugin-plugins-data-public.indexpatternfield.routes.md) + +## IndexPatternField.routes property + +Signature: + +```typescript +routes: Record; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.script.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.script.md new file mode 100644 index 0000000000000..132ba25a47637 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.script.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) > [script](./kibana-plugin-plugins-data-public.indexpatternfield.script.md) + +## IndexPatternField.script property + +Signature: + +```typescript +script?: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.scripted.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.scripted.md new file mode 100644 index 0000000000000..1dd6bc865a75d --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.scripted.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) > [scripted](./kibana-plugin-plugins-data-public.indexpatternfield.scripted.md) + +## IndexPatternField.scripted property + +Signature: + +```typescript +scripted?: boolean; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.searchable.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.searchable.md new file mode 100644 index 0000000000000..42f984d851435 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.searchable.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) > [searchable](./kibana-plugin-plugins-data-public.indexpatternfield.searchable.md) + +## IndexPatternField.searchable property + +Signature: + +```typescript +searchable?: boolean; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.sortable.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.sortable.md new file mode 100644 index 0000000000000..72d225185140b --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.sortable.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) > [sortable](./kibana-plugin-plugins-data-public.indexpatternfield.sortable.md) + +## IndexPatternField.sortable property + +Signature: + +```typescript +sortable?: boolean; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.subtype.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.subtype.md new file mode 100644 index 0000000000000..2d807f8a5739c --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.subtype.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) > [subType](./kibana-plugin-plugins-data-public.indexpatternfield.subtype.md) + +## IndexPatternField.subType property + +Signature: + +```typescript +subType?: IFieldSubType; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.type.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.type.md new file mode 100644 index 0000000000000..c8483c9b83c9a --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.type.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) > [type](./kibana-plugin-plugins-data-public.indexpatternfield.type.md) + +## IndexPatternField.type property + +Signature: + +```typescript +type: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.visualizable.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.visualizable.md new file mode 100644 index 0000000000000..dd661ae779c11 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.visualizable.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) > [visualizable](./kibana-plugin-plugins-data-public.indexpatternfield.visualizable.md) + +## IndexPatternField.visualizable property + +Signature: + +```typescript +visualizable?: boolean; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfieldlist._constructor_.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfieldlist._constructor_.md new file mode 100644 index 0000000000000..2207107db8b2b --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfieldlist._constructor_.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternFieldList](./kibana-plugin-plugins-data-public.indexpatternfieldlist.md) > [(constructor)](./kibana-plugin-plugins-data-public.indexpatternfieldlist._constructor_.md) + +## IndexPatternFieldList.(constructor) + +Constructs a new instance of the `FieldList` class + +Signature: + +```typescript +constructor(indexPattern: IndexPattern, specs?: FieldSpec[], shortDotsEnable?: boolean); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| indexPattern | IndexPattern | | +| specs | FieldSpec[] | | +| shortDotsEnable | boolean | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfieldlist.add.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfieldlist.add.md new file mode 100644 index 0000000000000..dce2f38bbcf10 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfieldlist.add.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternFieldList](./kibana-plugin-plugins-data-public.indexpatternfieldlist.md) > [add](./kibana-plugin-plugins-data-public.indexpatternfieldlist.add.md) + +## IndexPatternFieldList.add property + +Signature: + +```typescript +add: (field: Record) => void; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfieldlist.getbyname.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfieldlist.getbyname.md new file mode 100644 index 0000000000000..bf6bc51b60301 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfieldlist.getbyname.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternFieldList](./kibana-plugin-plugins-data-public.indexpatternfieldlist.md) > [getByName](./kibana-plugin-plugins-data-public.indexpatternfieldlist.getbyname.md) + +## IndexPatternFieldList.getByName property + +Signature: + +```typescript +getByName: (name: string) => Field | undefined; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfieldlist.getbytype.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfieldlist.getbytype.md new file mode 100644 index 0000000000000..86c5ae32940d4 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfieldlist.getbytype.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternFieldList](./kibana-plugin-plugins-data-public.indexpatternfieldlist.md) > [getByType](./kibana-plugin-plugins-data-public.indexpatternfieldlist.getbytype.md) + +## IndexPatternFieldList.getByType property + +Signature: + +```typescript +getByType: (type: string) => any[]; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfieldlist.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfieldlist.md new file mode 100644 index 0000000000000..4b7184b7dc151 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfieldlist.md @@ -0,0 +1,28 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternFieldList](./kibana-plugin-plugins-data-public.indexpatternfieldlist.md) + +## IndexPatternFieldList class + +Signature: + +```typescript +export declare class FieldList extends Array implements IFieldList +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(indexPattern, specs, shortDotsEnable)](./kibana-plugin-plugins-data-public.indexpatternfieldlist._constructor_.md) | | Constructs a new instance of the FieldList class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [add](./kibana-plugin-plugins-data-public.indexpatternfieldlist.add.md) | | (field: Record<string, any>) => void | | +| [getByName](./kibana-plugin-plugins-data-public.indexpatternfieldlist.getbyname.md) | | (name: string) => Field | undefined | | +| [getByType](./kibana-plugin-plugins-data-public.indexpatternfieldlist.getbytype.md) | | (type: string) => any[] | | +| [remove](./kibana-plugin-plugins-data-public.indexpatternfieldlist.remove.md) | | (field: IFieldType) => void | | +| [update](./kibana-plugin-plugins-data-public.indexpatternfieldlist.update.md) | | (field: Field) => void | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfieldlist.remove.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfieldlist.remove.md new file mode 100644 index 0000000000000..1f2e0883d272e --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfieldlist.remove.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternFieldList](./kibana-plugin-plugins-data-public.indexpatternfieldlist.md) > [remove](./kibana-plugin-plugins-data-public.indexpatternfieldlist.remove.md) + +## IndexPatternFieldList.remove property + +Signature: + +```typescript +remove: (field: IFieldType) => void; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfieldlist.update.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfieldlist.update.md new file mode 100644 index 0000000000000..ca03ec4b72893 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfieldlist.update.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternFieldList](./kibana-plugin-plugins-data-public.indexpatternfieldlist.md) > [update](./kibana-plugin-plugins-data-public.indexpatternfieldlist.update.md) + +## IndexPatternFieldList.update property + +Signature: + +```typescript +update: (field: Field) => void; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatterns.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatterns.md new file mode 100644 index 0000000000000..fa97666a61b93 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatterns.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [indexPatterns](./kibana-plugin-plugins-data-public.indexpatterns.md) + +## indexPatterns variable + +Signature: + +```typescript +indexPatterns: { + ILLEGAL_CHARACTERS_KEY: string; + CONTAINS_SPACES_KEY: string; + ILLEGAL_CHARACTERS_VISIBLE: string[]; + ILLEGAL_CHARACTERS: string[]; + isDefault: (indexPattern: import("../common").IIndexPattern) => boolean; + isFilterable: typeof isFilterable; + isNestedField: typeof isNestedField; + validate: typeof validateIndexPattern; + getFromSavedObject: typeof getFromSavedObject; + flattenHitWrapper: typeof flattenHitWrapper; + getRoutes: typeof getRoutes; + formatHitProvider: typeof formatHitProvider; +} +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternscontract.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternscontract.md new file mode 100644 index 0000000000000..f83ed272c089c --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternscontract.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternsContract](./kibana-plugin-plugins-data-public.indexpatternscontract.md) + +## IndexPatternsContract type + +Signature: + +```typescript +export declare type IndexPatternsContract = PublicMethodsOf; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect._constructor_.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect._constructor_.md new file mode 100644 index 0000000000000..4c08e8c862613 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect._constructor_.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternSelect](./kibana-plugin-plugins-data-public.indexpatternselect.md) > [(constructor)](./kibana-plugin-plugins-data-public.indexpatternselect._constructor_.md) + +## IndexPatternSelect.(constructor) + +Constructs a new instance of the `IndexPatternSelect` class + +Signature: + +```typescript +constructor(props: IndexPatternSelectProps); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| props | IndexPatternSelectProps | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.componentdidmount.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.componentdidmount.md new file mode 100644 index 0000000000000..cf70c2add8742 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.componentdidmount.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternSelect](./kibana-plugin-plugins-data-public.indexpatternselect.md) > [componentDidMount](./kibana-plugin-plugins-data-public.indexpatternselect.componentdidmount.md) + +## IndexPatternSelect.componentDidMount() method + +Signature: + +```typescript +componentDidMount(): void; +``` +Returns: + +`void` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.componentwillunmount.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.componentwillunmount.md new file mode 100644 index 0000000000000..5f11208ecc317 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.componentwillunmount.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternSelect](./kibana-plugin-plugins-data-public.indexpatternselect.md) > [componentWillUnmount](./kibana-plugin-plugins-data-public.indexpatternselect.componentwillunmount.md) + +## IndexPatternSelect.componentWillUnmount() method + +Signature: + +```typescript +componentWillUnmount(): void; +``` +Returns: + +`void` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.debouncedfetch.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.debouncedfetch.md new file mode 100644 index 0000000000000..5238e2f1913e4 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.debouncedfetch.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternSelect](./kibana-plugin-plugins-data-public.indexpatternselect.md) > [debouncedFetch](./kibana-plugin-plugins-data-public.indexpatternselect.debouncedfetch.md) + +## IndexPatternSelect.debouncedFetch property + +Signature: + +```typescript +debouncedFetch: ((searchValue: string) => Promise) & _.Cancelable; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.fetchoptions.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.fetchoptions.md new file mode 100644 index 0000000000000..f5e388a86f4ae --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.fetchoptions.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternSelect](./kibana-plugin-plugins-data-public.indexpatternselect.md) > [fetchOptions](./kibana-plugin-plugins-data-public.indexpatternselect.fetchoptions.md) + +## IndexPatternSelect.fetchOptions property + +Signature: + +```typescript +fetchOptions: (searchValue?: string) => void; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.fetchselectedindexpattern.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.fetchselectedindexpattern.md new file mode 100644 index 0000000000000..d5981c19b99af --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.fetchselectedindexpattern.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternSelect](./kibana-plugin-plugins-data-public.indexpatternselect.md) > [fetchSelectedIndexPattern](./kibana-plugin-plugins-data-public.indexpatternselect.fetchselectedindexpattern.md) + +## IndexPatternSelect.fetchSelectedIndexPattern property + +Signature: + +```typescript +fetchSelectedIndexPattern: (indexPatternId: string) => Promise; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.md new file mode 100644 index 0000000000000..4f4feeb4caa8d --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.md @@ -0,0 +1,37 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternSelect](./kibana-plugin-plugins-data-public.indexpatternselect.md) + +## IndexPatternSelect class + +Signature: + +```typescript +export declare class IndexPatternSelect extends Component +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(props)](./kibana-plugin-plugins-data-public.indexpatternselect._constructor_.md) | | Constructs a new instance of the IndexPatternSelect class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [debouncedFetch](./kibana-plugin-plugins-data-public.indexpatternselect.debouncedfetch.md) | | ((searchValue: string) => Promise<void>) & _.Cancelable | | +| [fetchOptions](./kibana-plugin-plugins-data-public.indexpatternselect.fetchoptions.md) | | (searchValue?: string) => void | | +| [fetchSelectedIndexPattern](./kibana-plugin-plugins-data-public.indexpatternselect.fetchselectedindexpattern.md) | | (indexPatternId: string) => Promise<void> | | +| [onChange](./kibana-plugin-plugins-data-public.indexpatternselect.onchange.md) | | (selectedOptions: any) => void | | +| [state](./kibana-plugin-plugins-data-public.indexpatternselect.state.md) | | IndexPatternSelectState | | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [componentDidMount()](./kibana-plugin-plugins-data-public.indexpatternselect.componentdidmount.md) | | | +| [componentWillUnmount()](./kibana-plugin-plugins-data-public.indexpatternselect.componentwillunmount.md) | | | +| [render()](./kibana-plugin-plugins-data-public.indexpatternselect.render.md) | | | +| [UNSAFE\_componentWillReceiveProps(nextProps)](./kibana-plugin-plugins-data-public.indexpatternselect.unsafe_componentwillreceiveprops.md) | | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.onchange.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.onchange.md new file mode 100644 index 0000000000000..c0c2a2e6802e9 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.onchange.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternSelect](./kibana-plugin-plugins-data-public.indexpatternselect.md) > [onChange](./kibana-plugin-plugins-data-public.indexpatternselect.onchange.md) + +## IndexPatternSelect.onChange property + +Signature: + +```typescript +onChange: (selectedOptions: any) => void; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.render.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.render.md new file mode 100644 index 0000000000000..1cb495e7f8795 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.render.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternSelect](./kibana-plugin-plugins-data-public.indexpatternselect.md) > [render](./kibana-plugin-plugins-data-public.indexpatternselect.render.md) + +## IndexPatternSelect.render() method + +Signature: + +```typescript +render(): JSX.Element; +``` +Returns: + +`JSX.Element` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.state.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.state.md new file mode 100644 index 0000000000000..58fbcfe090235 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.state.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternSelect](./kibana-plugin-plugins-data-public.indexpatternselect.md) > [state](./kibana-plugin-plugins-data-public.indexpatternselect.state.md) + +## IndexPatternSelect.state property + +Signature: + +```typescript +state: IndexPatternSelectState; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.unsafe_componentwillreceiveprops.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.unsafe_componentwillreceiveprops.md new file mode 100644 index 0000000000000..de9d6a69e216e --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternselect.unsafe_componentwillreceiveprops.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternSelect](./kibana-plugin-plugins-data-public.indexpatternselect.md) > [UNSAFE\_componentWillReceiveProps](./kibana-plugin-plugins-data-public.indexpatternselect.unsafe_componentwillreceiveprops.md) + +## IndexPatternSelect.UNSAFE\_componentWillReceiveProps() method + +Signature: + +```typescript +UNSAFE_componentWillReceiveProps(nextProps: IndexPatternSelectProps): void; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| nextProps | IndexPatternSelectProps | | + +Returns: + +`void` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatterntypemeta.aggs.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatterntypemeta.aggs.md new file mode 100644 index 0000000000000..46cb435fb19bc --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatterntypemeta.aggs.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternTypeMeta](./kibana-plugin-plugins-data-public.indexpatterntypemeta.md) > [aggs](./kibana-plugin-plugins-data-public.indexpatterntypemeta.aggs.md) + +## IndexPatternTypeMeta.aggs property + +Signature: + +```typescript +aggs?: Record; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatterntypemeta.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatterntypemeta.md new file mode 100644 index 0000000000000..e6690b244c9ea --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatterntypemeta.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPatternTypeMeta](./kibana-plugin-plugins-data-public.indexpatterntypemeta.md) + +## IndexPatternTypeMeta interface + +Signature: + +```typescript +export interface TypeMeta +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [aggs](./kibana-plugin-plugins-data-public.indexpatterntypemeta.aggs.md) | Record<string, AggregationRestrictions> | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.inputtimerange.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.inputtimerange.md new file mode 100644 index 0000000000000..649355a5fffb5 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.inputtimerange.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [InputTimeRange](./kibana-plugin-plugins-data-public.inputtimerange.md) + +## InputTimeRange type + +Signature: + +```typescript +export declare type InputTimeRange = TimeRange | { + from: Moment; + to: Moment; +}; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.irequesttypesmap.es.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.irequesttypesmap.es.md new file mode 100644 index 0000000000000..0b31968f06425 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.irequesttypesmap.es.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IRequestTypesMap](./kibana-plugin-plugins-data-public.irequesttypesmap.md) > [es](./kibana-plugin-plugins-data-public.irequesttypesmap.es.md) + +## IRequestTypesMap.es property + +Signature: + +```typescript +[ES_SEARCH_STRATEGY]: IEsSearchRequest; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.irequesttypesmap.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.irequesttypesmap.md new file mode 100644 index 0000000000000..4ca5e9eab665a --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.irequesttypesmap.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IRequestTypesMap](./kibana-plugin-plugins-data-public.irequesttypesmap.md) + +## IRequestTypesMap interface + +Signature: + +```typescript +export interface IRequestTypesMap +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [es](./kibana-plugin-plugins-data-public.irequesttypesmap.es.md) | IEsSearchRequest | | +| [SYNC\_SEARCH\_STRATEGY](./kibana-plugin-plugins-data-public.irequesttypesmap.sync_search_strategy.md) | ISyncSearchRequest | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.irequesttypesmap.sync_search_strategy.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.irequesttypesmap.sync_search_strategy.md new file mode 100644 index 0000000000000..28b87111a75ad --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.irequesttypesmap.sync_search_strategy.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IRequestTypesMap](./kibana-plugin-plugins-data-public.irequesttypesmap.md) > [SYNC\_SEARCH\_STRATEGY](./kibana-plugin-plugins-data-public.irequesttypesmap.sync_search_strategy.md) + +## IRequestTypesMap.SYNC\_SEARCH\_STRATEGY property + +Signature: + +```typescript +[SYNC_SEARCH_STRATEGY]: ISyncSearchRequest; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iresponsetypesmap.es.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iresponsetypesmap.es.md new file mode 100644 index 0000000000000..8056d0b16a66e --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iresponsetypesmap.es.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IResponseTypesMap](./kibana-plugin-plugins-data-public.iresponsetypesmap.md) > [es](./kibana-plugin-plugins-data-public.iresponsetypesmap.es.md) + +## IResponseTypesMap.es property + +Signature: + +```typescript +[ES_SEARCH_STRATEGY]: IEsSearchResponse; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iresponsetypesmap.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iresponsetypesmap.md new file mode 100644 index 0000000000000..b6ec3aa38c96a --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iresponsetypesmap.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IResponseTypesMap](./kibana-plugin-plugins-data-public.iresponsetypesmap.md) + +## IResponseTypesMap interface + +Signature: + +```typescript +export interface IResponseTypesMap +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [es](./kibana-plugin-plugins-data-public.iresponsetypesmap.es.md) | IEsSearchResponse | | +| [SYNC\_SEARCH\_STRATEGY](./kibana-plugin-plugins-data-public.iresponsetypesmap.sync_search_strategy.md) | IKibanaSearchResponse | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iresponsetypesmap.sync_search_strategy.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iresponsetypesmap.sync_search_strategy.md new file mode 100644 index 0000000000000..c9fad4ced534c --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iresponsetypesmap.sync_search_strategy.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IResponseTypesMap](./kibana-plugin-plugins-data-public.iresponsetypesmap.md) > [SYNC\_SEARCH\_STRATEGY](./kibana-plugin-plugins-data-public.iresponsetypesmap.sync_search_strategy.md) + +## IResponseTypesMap.SYNC\_SEARCH\_STRATEGY property + +Signature: + +```typescript +[SYNC_SEARCH_STRATEGY]: IKibanaSearchResponse; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearch.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearch.md new file mode 100644 index 0000000000000..1a58b41052caf --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearch.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [ISearch](./kibana-plugin-plugins-data-public.isearch.md) + +## ISearch type + +Signature: + +```typescript +export declare type ISearch = (request: IRequestTypesMap[T], options?: ISearchOptions) => Observable; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchcontext.core.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchcontext.core.md new file mode 100644 index 0000000000000..7a7ea43bd3d40 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchcontext.core.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [ISearchContext](./kibana-plugin-plugins-data-public.isearchcontext.md) > [core](./kibana-plugin-plugins-data-public.isearchcontext.core.md) + +## ISearchContext.core property + +Signature: + +```typescript +core: CoreStart; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchcontext.getsearchstrategy.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchcontext.getsearchstrategy.md new file mode 100644 index 0000000000000..93ac88d200bb8 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchcontext.getsearchstrategy.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [ISearchContext](./kibana-plugin-plugins-data-public.isearchcontext.md) > [getSearchStrategy](./kibana-plugin-plugins-data-public.isearchcontext.getsearchstrategy.md) + +## ISearchContext.getSearchStrategy property + +Signature: + +```typescript +getSearchStrategy: (name: T) => TSearchStrategyProvider; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchcontext.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchcontext.md new file mode 100644 index 0000000000000..9b89f71434119 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchcontext.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [ISearchContext](./kibana-plugin-plugins-data-public.isearchcontext.md) + +## ISearchContext interface + +Signature: + +```typescript +export interface ISearchContext +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [core](./kibana-plugin-plugins-data-public.isearchcontext.core.md) | CoreStart | | +| [getSearchStrategy](./kibana-plugin-plugins-data-public.isearchcontext.getsearchstrategy.md) | <T extends TStrategyTypes>(name: T) => TSearchStrategyProvider<T> | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchgeneric.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchgeneric.md new file mode 100644 index 0000000000000..e118dac31c296 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchgeneric.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [ISearchGeneric](./kibana-plugin-plugins-data-public.isearchgeneric.md) + +## ISearchGeneric type + +Signature: + +```typescript +export declare type ISearchGeneric = (request: IRequestTypesMap[T], options?: ISearchOptions, strategy?: T) => Observable; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchoptions.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchoptions.md new file mode 100644 index 0000000000000..05b7252606289 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchoptions.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [ISearchOptions](./kibana-plugin-plugins-data-public.isearchoptions.md) + +## ISearchOptions interface + +Signature: + +```typescript +export interface ISearchOptions +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [signal](./kibana-plugin-plugins-data-public.isearchoptions.signal.md) | AbortSignal | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchoptions.signal.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchoptions.signal.md new file mode 100644 index 0000000000000..10bd186d55baa --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchoptions.signal.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [ISearchOptions](./kibana-plugin-plugins-data-public.isearchoptions.md) > [signal](./kibana-plugin-plugins-data-public.isearchoptions.signal.md) + +## ISearchOptions.signal property + +Signature: + +```typescript +signal?: AbortSignal; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchsource.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchsource.md new file mode 100644 index 0000000000000..a8154dff72a6a --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchsource.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [ISearchSource](./kibana-plugin-plugins-data-public.isearchsource.md) + +## ISearchSource type + +Signature: + +```typescript +export declare type ISearchSource = Pick; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchstrategy.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchstrategy.md new file mode 100644 index 0000000000000..9e74bc0e60a73 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchstrategy.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [ISearchStrategy](./kibana-plugin-plugins-data-public.isearchstrategy.md) + +## ISearchStrategy interface + +Search strategy interface contains a search method that takes in a request and returns a promise that resolves to a response. + +Signature: + +```typescript +export interface ISearchStrategy +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [search](./kibana-plugin-plugins-data-public.isearchstrategy.search.md) | ISearch<T> | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchstrategy.search.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchstrategy.search.md new file mode 100644 index 0000000000000..e2e4264b7c6e0 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isearchstrategy.search.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [ISearchStrategy](./kibana-plugin-plugins-data-public.isearchstrategy.md) > [search](./kibana-plugin-plugins-data-public.isearchstrategy.search.md) + +## ISearchStrategy.search property + +Signature: + +```typescript +search: ISearch; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isyncsearchrequest.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isyncsearchrequest.md new file mode 100644 index 0000000000000..29befdbf295dc --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isyncsearchrequest.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [ISyncSearchRequest](./kibana-plugin-plugins-data-public.isyncsearchrequest.md) + +## ISyncSearchRequest interface + +Signature: + +```typescript +export interface ISyncSearchRequest extends IKibanaSearchRequest +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [serverStrategy](./kibana-plugin-plugins-data-public.isyncsearchrequest.serverstrategy.md) | string | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isyncsearchrequest.serverstrategy.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isyncsearchrequest.serverstrategy.md new file mode 100644 index 0000000000000..f30f274a3b9b6 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.isyncsearchrequest.serverstrategy.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [ISyncSearchRequest](./kibana-plugin-plugins-data-public.isyncsearchrequest.md) > [serverStrategy](./kibana-plugin-plugins-data-public.isyncsearchrequest.serverstrategy.md) + +## ISyncSearchRequest.serverStrategy property + +Signature: + +```typescript +serverStrategy: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.kbn_field_types.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.kbn_field_types.md new file mode 100644 index 0000000000000..e5ae8ffbd2877 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.kbn_field_types.md @@ -0,0 +1,33 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [KBN\_FIELD\_TYPES](./kibana-plugin-plugins-data-public.kbn_field_types.md) + +## KBN\_FIELD\_TYPES enum + +\* + +Signature: + +```typescript +export declare enum KBN_FIELD_TYPES +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| \_SOURCE | "_source" | | +| ATTACHMENT | "attachment" | | +| BOOLEAN | "boolean" | | +| CONFLICT | "conflict" | | +| DATE | "date" | | +| GEO\_POINT | "geo_point" | | +| GEO\_SHAPE | "geo_shape" | | +| IP | "ip" | | +| MURMUR3 | "murmur3" | | +| NESTED | "nested" | | +| NUMBER | "number" | | +| OBJECT | "object" | | +| STRING | "string" | | +| UNKNOWN | "unknown" | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.kuerynode.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.kuerynode.md new file mode 100644 index 0000000000000..276f25da8cb9f --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.kuerynode.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [KueryNode](./kibana-plugin-plugins-data-public.kuerynode.md) + +## KueryNode interface + +Signature: + +```typescript +export interface KueryNode +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [type](./kibana-plugin-plugins-data-public.kuerynode.type.md) | keyof NodeTypes | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.kuerynode.type.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.kuerynode.type.md new file mode 100644 index 0000000000000..2ff96b6421c2e --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.kuerynode.type.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [KueryNode](./kibana-plugin-plugins-data-public.kuerynode.md) > [type](./kibana-plugin-plugins-data-public.kuerynode.type.md) + +## KueryNode.type property + +Signature: + +```typescript +type: keyof NodeTypes; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.matchallfilter.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.matchallfilter.md new file mode 100644 index 0000000000000..740b83bb5c563 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.matchallfilter.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [MatchAllFilter](./kibana-plugin-plugins-data-public.matchallfilter.md) + +## MatchAllFilter type + +Signature: + +```typescript +export declare type MatchAllFilter = Filter & { + meta: MatchAllFilterMeta; + match_all: any; +}; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.md new file mode 100644 index 0000000000000..4b85461e64097 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.md @@ -0,0 +1,142 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) + +## kibana-plugin-plugins-data-public package + +## Classes + +| Class | Description | +| --- | --- | +| [FilterManager](./kibana-plugin-plugins-data-public.filtermanager.md) | | +| [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) | | +| [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) | | +| [IndexPatternFieldList](./kibana-plugin-plugins-data-public.indexpatternfieldlist.md) | | +| [IndexPatternSelect](./kibana-plugin-plugins-data-public.indexpatternselect.md) | | +| [Plugin](./kibana-plugin-plugins-data-public.plugin.md) | | +| [SearchError](./kibana-plugin-plugins-data-public.searcherror.md) | | +| [SearchSource](./kibana-plugin-plugins-data-public.searchsource.md) | | +| [TimeHistory](./kibana-plugin-plugins-data-public.timehistory.md) | | + +## Enumerations + +| Enumeration | Description | +| --- | --- | +| [ES\_FIELD\_TYPES](./kibana-plugin-plugins-data-public.es_field_types.md) | \* | +| [KBN\_FIELD\_TYPES](./kibana-plugin-plugins-data-public.kbn_field_types.md) | \* | +| [QuerySuggestionTypes](./kibana-plugin-plugins-data-public.querysuggestiontypes.md) | | +| [SortDirection](./kibana-plugin-plugins-data-public.sortdirection.md) | | + +## Functions + +| Function | Description | +| --- | --- | +| [getDefaultQuery(language)](./kibana-plugin-plugins-data-public.getdefaultquery.md) | | +| [getEsPreference(uiSettings, sessionId)](./kibana-plugin-plugins-data-public.getespreference.md) | | +| [getQueryLog(uiSettings, storage, appName, language)](./kibana-plugin-plugins-data-public.getquerylog.md) | | +| [getSearchErrorType({ message })](./kibana-plugin-plugins-data-public.getsearcherrortype.md) | | +| [getTime(indexPattern, timeRange, forceNow)](./kibana-plugin-plugins-data-public.gettime.md) | | +| [parseInterval(interval)](./kibana-plugin-plugins-data-public.parseinterval.md) | | +| [plugin(initializerContext)](./kibana-plugin-plugins-data-public.plugin.md) | | + +## Interfaces + +| Interface | Description | +| --- | --- | +| [DataPublicPluginSetup](./kibana-plugin-plugins-data-public.datapublicpluginsetup.md) | | +| [DataPublicPluginStart](./kibana-plugin-plugins-data-public.datapublicpluginstart.md) | | +| [EsQueryConfig](./kibana-plugin-plugins-data-public.esqueryconfig.md) | | +| [FetchOptions](./kibana-plugin-plugins-data-public.fetchoptions.md) | | +| [FieldFormatConfig](./kibana-plugin-plugins-data-public.fieldformatconfig.md) | | +| [Filter](./kibana-plugin-plugins-data-public.filter.md) | | +| [IDataPluginServices](./kibana-plugin-plugins-data-public.idatapluginservices.md) | | +| [IEsSearchRequest](./kibana-plugin-plugins-data-public.iessearchrequest.md) | | +| [IEsSearchResponse](./kibana-plugin-plugins-data-public.iessearchresponse.md) | | +| [IFieldSubType](./kibana-plugin-plugins-data-public.ifieldsubtype.md) | | +| [IFieldType](./kibana-plugin-plugins-data-public.ifieldtype.md) | | +| [IIndexPattern](./kibana-plugin-plugins-data-public.iindexpattern.md) | | +| [IKibanaSearchRequest](./kibana-plugin-plugins-data-public.ikibanasearchrequest.md) | | +| [IKibanaSearchResponse](./kibana-plugin-plugins-data-public.ikibanasearchresponse.md) | | +| [IndexPatternAttributes](./kibana-plugin-plugins-data-public.indexpatternattributes.md) | Use data plugin interface instead | +| [IndexPatternTypeMeta](./kibana-plugin-plugins-data-public.indexpatterntypemeta.md) | | +| [IRequestTypesMap](./kibana-plugin-plugins-data-public.irequesttypesmap.md) | | +| [IResponseTypesMap](./kibana-plugin-plugins-data-public.iresponsetypesmap.md) | | +| [ISearchContext](./kibana-plugin-plugins-data-public.isearchcontext.md) | | +| [ISearchOptions](./kibana-plugin-plugins-data-public.isearchoptions.md) | | +| [ISearchStrategy](./kibana-plugin-plugins-data-public.isearchstrategy.md) | Search strategy interface contains a search method that takes in a request and returns a promise that resolves to a response. | +| [ISyncSearchRequest](./kibana-plugin-plugins-data-public.isyncsearchrequest.md) | | +| [KueryNode](./kibana-plugin-plugins-data-public.kuerynode.md) | | +| [Query](./kibana-plugin-plugins-data-public.query.md) | | +| [QueryState](./kibana-plugin-plugins-data-public.querystate.md) | All query state service state | +| [QuerySuggestionBasic](./kibana-plugin-plugins-data-public.querysuggestionbasic.md) | \* | +| [QuerySuggestionField](./kibana-plugin-plugins-data-public.querysuggestionfield.md) | \* | +| [QuerySuggestionGetFnArgs](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.md) | \* | +| [RangeFilterParams](./kibana-plugin-plugins-data-public.rangefilterparams.md) | | +| [RefreshInterval](./kibana-plugin-plugins-data-public.refreshinterval.md) | | +| [SavedQuery](./kibana-plugin-plugins-data-public.savedquery.md) | | +| [SavedQueryAttributes](./kibana-plugin-plugins-data-public.savedqueryattributes.md) | | +| [SavedQueryService](./kibana-plugin-plugins-data-public.savedqueryservice.md) | | +| [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) | | +| [SearchStrategyProvider](./kibana-plugin-plugins-data-public.searchstrategyprovider.md) | | +| [TimefilterSetup](./kibana-plugin-plugins-data-public.timefiltersetup.md) | | +| [TimeRange](./kibana-plugin-plugins-data-public.timerange.md) | | + +## Variables + +| Variable | Description | +| --- | --- | +| [addSearchStrategy](./kibana-plugin-plugins-data-public.addsearchstrategy.md) | | +| [baseFormattersPublic](./kibana-plugin-plugins-data-public.baseformatterspublic.md) | | +| [castEsToKbnFieldTypeName](./kibana-plugin-plugins-data-public.castestokbnfieldtypename.md) | Get the KbnFieldType name for an esType string | +| [connectToQueryState](./kibana-plugin-plugins-data-public.connecttoquerystate.md) | Helper to setup two-way syncing of global data and a state container | +| [createSavedQueryService](./kibana-plugin-plugins-data-public.createsavedqueryservice.md) | | +| [defaultSearchStrategy](./kibana-plugin-plugins-data-public.defaultsearchstrategy.md) | | +| [ES\_SEARCH\_STRATEGY](./kibana-plugin-plugins-data-public.es_search_strategy.md) | | +| [esFilters](./kibana-plugin-plugins-data-public.esfilters.md) | | +| [esKuery](./kibana-plugin-plugins-data-public.eskuery.md) | | +| [esQuery](./kibana-plugin-plugins-data-public.esquery.md) | | +| [esSearchStrategyProvider](./kibana-plugin-plugins-data-public.essearchstrategyprovider.md) | | +| [fieldFormats](./kibana-plugin-plugins-data-public.fieldformats.md) | | +| [FilterBar](./kibana-plugin-plugins-data-public.filterbar.md) | | +| [getKbnTypeNames](./kibana-plugin-plugins-data-public.getkbntypenames.md) | Get the esTypes known by all kbnFieldTypes {Array} | +| [hasSearchStategyForIndexPattern](./kibana-plugin-plugins-data-public.hassearchstategyforindexpattern.md) | | +| [indexPatterns](./kibana-plugin-plugins-data-public.indexpatterns.md) | | +| [QueryStringInput](./kibana-plugin-plugins-data-public.querystringinput.md) | | +| [SearchBar](./kibana-plugin-plugins-data-public.searchbar.md) | | +| [SYNC\_SEARCH\_STRATEGY](./kibana-plugin-plugins-data-public.sync_search_strategy.md) | | +| [syncQueryStateWithUrl](./kibana-plugin-plugins-data-public.syncquerystatewithurl.md) | Helper to setup syncing of global data with the URL | + +## Type Aliases + +| Type Alias | Description | +| --- | --- | +| [CustomFilter](./kibana-plugin-plugins-data-public.customfilter.md) | | +| [EsQuerySortValue](./kibana-plugin-plugins-data-public.esquerysortvalue.md) | | +| [ExistsFilter](./kibana-plugin-plugins-data-public.existsfilter.md) | | +| [FieldFormatId](./kibana-plugin-plugins-data-public.fieldformatid.md) | id type is needed for creating custom converters. | +| [FieldFormatsContentType](./kibana-plugin-plugins-data-public.fieldformatscontenttype.md) | \* | +| [FieldFormatsGetConfigFn](./kibana-plugin-plugins-data-public.fieldformatsgetconfigfn.md) | | +| [IFieldFormat](./kibana-plugin-plugins-data-public.ifieldformat.md) | | +| [IFieldFormatsRegistry](./kibana-plugin-plugins-data-public.ifieldformatsregistry.md) | | +| [IndexPatternAggRestrictions](./kibana-plugin-plugins-data-public.indexpatternaggrestrictions.md) | | +| [IndexPatternsContract](./kibana-plugin-plugins-data-public.indexpatternscontract.md) | | +| [InputTimeRange](./kibana-plugin-plugins-data-public.inputtimerange.md) | | +| [ISearch](./kibana-plugin-plugins-data-public.isearch.md) | | +| [ISearchGeneric](./kibana-plugin-plugins-data-public.isearchgeneric.md) | | +| [ISearchSource](./kibana-plugin-plugins-data-public.isearchsource.md) | | +| [MatchAllFilter](./kibana-plugin-plugins-data-public.matchallfilter.md) | | +| [PhraseFilter](./kibana-plugin-plugins-data-public.phrasefilter.md) | | +| [PhrasesFilter](./kibana-plugin-plugins-data-public.phrasesfilter.md) | | +| [QuerySuggestion](./kibana-plugin-plugins-data-public.querysuggestion.md) | \* | +| [QuerySuggestionGetFn](./kibana-plugin-plugins-data-public.querysuggestiongetfn.md) | | +| [RangeFilter](./kibana-plugin-plugins-data-public.rangefilter.md) | | +| [RangeFilterMeta](./kibana-plugin-plugins-data-public.rangefiltermeta.md) | | +| [SavedQueryTimeFilter](./kibana-plugin-plugins-data-public.savedquerytimefilter.md) | | +| [SearchBarProps](./kibana-plugin-plugins-data-public.searchbarprops.md) | | +| [SearchRequest](./kibana-plugin-plugins-data-public.searchrequest.md) | | +| [SearchResponse](./kibana-plugin-plugins-data-public.searchresponse.md) | | +| [StatefulSearchBarProps](./kibana-plugin-plugins-data-public.statefulsearchbarprops.md) | | +| [TimefilterContract](./kibana-plugin-plugins-data-public.timefiltercontract.md) | | +| [TimeHistoryContract](./kibana-plugin-plugins-data-public.timehistorycontract.md) | | +| [TSearchStrategyProvider](./kibana-plugin-plugins-data-public.tsearchstrategyprovider.md) | Search strategy provider creates an instance of a search strategy with the request handler context bound to it. This way every search strategy can use whatever information they require from the request context. | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.parseinterval.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.parseinterval.md new file mode 100644 index 0000000000000..1f5371fbf088a --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.parseinterval.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [parseInterval](./kibana-plugin-plugins-data-public.parseinterval.md) + +## parseInterval() function + +Signature: + +```typescript +export declare function parseInterval(interval: string): moment.Duration | null; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| interval | string | | + +Returns: + +`moment.Duration | null` + 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 new file mode 100644 index 0000000000000..090b78a7078cc --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.phrasefilter.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [PhraseFilter](./kibana-plugin-plugins-data-public.phrasefilter.md) + +## PhraseFilter type + +Signature: + +```typescript +export declare type PhraseFilter = Filter & { + meta: PhraseFilterMeta; + script?: { + script: { + source?: any; + lang?: string; + params: any; + }; + }; +}; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.phrasesfilter.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.phrasesfilter.md new file mode 100644 index 0000000000000..ab205cb62fd14 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.phrasesfilter.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [PhrasesFilter](./kibana-plugin-plugins-data-public.phrasesfilter.md) + +## PhrasesFilter type + +Signature: + +```typescript +export declare type PhrasesFilter = Filter & { + meta: PhrasesFilterMeta; +}; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin._constructor_.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin._constructor_.md new file mode 100644 index 0000000000000..5ec2d491295bf --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin._constructor_.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [Plugin](./kibana-plugin-plugins-data-public.plugin.md) > [(constructor)](./kibana-plugin-plugins-data-public.plugin._constructor_.md) + +## Plugin.(constructor) + +Constructs a new instance of the `DataPublicPlugin` class + +Signature: + +```typescript +constructor(initializerContext: PluginInitializerContext); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| initializerContext | PluginInitializerContext | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin.md new file mode 100644 index 0000000000000..6cbc1f441c048 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [plugin](./kibana-plugin-plugins-data-public.plugin.md) + +## plugin() function + +Signature: + +```typescript +export declare function plugin(initializerContext: PluginInitializerContext): DataPublicPlugin; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| initializerContext | PluginInitializerContext | | + +Returns: + +`DataPublicPlugin` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin.setup.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin.setup.md new file mode 100644 index 0000000000000..98a954456d482 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin.setup.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [Plugin](./kibana-plugin-plugins-data-public.plugin.md) > [setup](./kibana-plugin-plugins-data-public.plugin.setup.md) + +## Plugin.setup() method + +Signature: + +```typescript +setup(core: CoreSetup, { uiActions }: DataSetupDependencies): DataPublicPluginSetup; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| core | CoreSetup | | +| { uiActions } | DataSetupDependencies | | + +Returns: + +`DataPublicPluginSetup` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin.start.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin.start.md new file mode 100644 index 0000000000000..56934e8a29edd --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin.start.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [Plugin](./kibana-plugin-plugins-data-public.plugin.md) > [start](./kibana-plugin-plugins-data-public.plugin.start.md) + +## Plugin.start() method + +Signature: + +```typescript +start(core: CoreStart, { uiActions }: DataStartDependencies): DataPublicPluginStart; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| core | CoreStart | | +| { uiActions } | DataStartDependencies | | + +Returns: + +`DataPublicPluginStart` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin.stop.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin.stop.md new file mode 100644 index 0000000000000..8b8b63db4e03a --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin.stop.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [Plugin](./kibana-plugin-plugins-data-public.plugin.md) > [stop](./kibana-plugin-plugins-data-public.plugin.stop.md) + +## Plugin.stop() method + +Signature: + +```typescript +stop(): void; +``` +Returns: + +`void` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.query.language.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.query.language.md new file mode 100644 index 0000000000000..127ee9210799e --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.query.language.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [Query](./kibana-plugin-plugins-data-public.query.md) > [language](./kibana-plugin-plugins-data-public.query.language.md) + +## Query.language property + +Signature: + +```typescript +language: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.query.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.query.md new file mode 100644 index 0000000000000..a1dffe5ff5fa4 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.query.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [Query](./kibana-plugin-plugins-data-public.query.md) + +## Query interface + +Signature: + +```typescript +export interface Query +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [language](./kibana-plugin-plugins-data-public.query.language.md) | string | | +| [query](./kibana-plugin-plugins-data-public.query.query.md) | string | {
[key: string]: any;
} | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.query.query.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.query.query.md new file mode 100644 index 0000000000000..9fcd0310af0fe --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.query.query.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [Query](./kibana-plugin-plugins-data-public.query.md) > [query](./kibana-plugin-plugins-data-public.query.query.md) + +## Query.query property + +Signature: + +```typescript +query: string | { + [key: string]: any; + }; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querystate.filters.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querystate.filters.md new file mode 100644 index 0000000000000..7155ea92d82ec --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querystate.filters.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QueryState](./kibana-plugin-plugins-data-public.querystate.md) > [filters](./kibana-plugin-plugins-data-public.querystate.filters.md) + +## QueryState.filters property + +Signature: + +```typescript +filters?: Filter[]; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querystate.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querystate.md new file mode 100644 index 0000000000000..cc489a0cb0367 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querystate.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QueryState](./kibana-plugin-plugins-data-public.querystate.md) + +## QueryState interface + +All query state service state + +Signature: + +```typescript +export interface QueryState +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [filters](./kibana-plugin-plugins-data-public.querystate.filters.md) | Filter[] | | +| [refreshInterval](./kibana-plugin-plugins-data-public.querystate.refreshinterval.md) | RefreshInterval | | +| [time](./kibana-plugin-plugins-data-public.querystate.time.md) | TimeRange | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querystate.refreshinterval.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querystate.refreshinterval.md new file mode 100644 index 0000000000000..04745f94a05af --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querystate.refreshinterval.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QueryState](./kibana-plugin-plugins-data-public.querystate.md) > [refreshInterval](./kibana-plugin-plugins-data-public.querystate.refreshinterval.md) + +## QueryState.refreshInterval property + +Signature: + +```typescript +refreshInterval?: RefreshInterval; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querystate.time.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querystate.time.md new file mode 100644 index 0000000000000..8d08c8250387a --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querystate.time.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QueryState](./kibana-plugin-plugins-data-public.querystate.md) > [time](./kibana-plugin-plugins-data-public.querystate.time.md) + +## QueryState.time property + +Signature: + +```typescript +time?: TimeRange; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querystringinput.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querystringinput.md new file mode 100644 index 0000000000000..d0d4cc491e142 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querystringinput.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QueryStringInput](./kibana-plugin-plugins-data-public.querystringinput.md) + +## QueryStringInput variable + +Signature: + +```typescript +QueryStringInput: React.FC> +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestion.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestion.md new file mode 100644 index 0000000000000..5586b3843d777 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestion.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QuerySuggestion](./kibana-plugin-plugins-data-public.querysuggestion.md) + +## QuerySuggestion type + +\* + +Signature: + +```typescript +export declare type QuerySuggestion = QuerySuggestionBasic | QuerySuggestionField; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionbasic.cursorindex.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionbasic.cursorindex.md new file mode 100644 index 0000000000000..bc0a080739746 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionbasic.cursorindex.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QuerySuggestionBasic](./kibana-plugin-plugins-data-public.querysuggestionbasic.md) > [cursorIndex](./kibana-plugin-plugins-data-public.querysuggestionbasic.cursorindex.md) + +## QuerySuggestionBasic.cursorIndex property + +Signature: + +```typescript +cursorIndex?: number; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionbasic.description.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionbasic.description.md new file mode 100644 index 0000000000000..2e322c8225a27 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionbasic.description.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QuerySuggestionBasic](./kibana-plugin-plugins-data-public.querysuggestionbasic.md) > [description](./kibana-plugin-plugins-data-public.querysuggestionbasic.description.md) + +## QuerySuggestionBasic.description property + +Signature: + +```typescript +description?: string | JSX.Element; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionbasic.end.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionbasic.end.md new file mode 100644 index 0000000000000..a76e301ca257d --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionbasic.end.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QuerySuggestionBasic](./kibana-plugin-plugins-data-public.querysuggestionbasic.md) > [end](./kibana-plugin-plugins-data-public.querysuggestionbasic.end.md) + +## QuerySuggestionBasic.end property + +Signature: + +```typescript +end: number; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionbasic.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionbasic.md new file mode 100644 index 0000000000000..ab8fc45cd49dd --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionbasic.md @@ -0,0 +1,25 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QuerySuggestionBasic](./kibana-plugin-plugins-data-public.querysuggestionbasic.md) + +## QuerySuggestionBasic interface + +\* + +Signature: + +```typescript +export interface QuerySuggestionBasic +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [cursorIndex](./kibana-plugin-plugins-data-public.querysuggestionbasic.cursorindex.md) | number | | +| [description](./kibana-plugin-plugins-data-public.querysuggestionbasic.description.md) | string | JSX.Element | | +| [end](./kibana-plugin-plugins-data-public.querysuggestionbasic.end.md) | number | | +| [start](./kibana-plugin-plugins-data-public.querysuggestionbasic.start.md) | number | | +| [text](./kibana-plugin-plugins-data-public.querysuggestionbasic.text.md) | string | | +| [type](./kibana-plugin-plugins-data-public.querysuggestionbasic.type.md) | QuerySuggestionTypes | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionbasic.start.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionbasic.start.md new file mode 100644 index 0000000000000..2b24fc9b2f078 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionbasic.start.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QuerySuggestionBasic](./kibana-plugin-plugins-data-public.querysuggestionbasic.md) > [start](./kibana-plugin-plugins-data-public.querysuggestionbasic.start.md) + +## QuerySuggestionBasic.start property + +Signature: + +```typescript +start: number; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionbasic.text.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionbasic.text.md new file mode 100644 index 0000000000000..4054b5e1623d0 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionbasic.text.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QuerySuggestionBasic](./kibana-plugin-plugins-data-public.querysuggestionbasic.md) > [text](./kibana-plugin-plugins-data-public.querysuggestionbasic.text.md) + +## QuerySuggestionBasic.text property + +Signature: + +```typescript +text: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionbasic.type.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionbasic.type.md new file mode 100644 index 0000000000000..1bce656d94b57 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionbasic.type.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QuerySuggestionBasic](./kibana-plugin-plugins-data-public.querysuggestionbasic.md) > [type](./kibana-plugin-plugins-data-public.querysuggestionbasic.type.md) + +## QuerySuggestionBasic.type property + +Signature: + +```typescript +type: QuerySuggestionTypes; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionfield.field.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionfield.field.md new file mode 100644 index 0000000000000..ce4e3a9afeb4e --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionfield.field.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QuerySuggestionField](./kibana-plugin-plugins-data-public.querysuggestionfield.md) > [field](./kibana-plugin-plugins-data-public.querysuggestionfield.field.md) + +## QuerySuggestionField.field property + +Signature: + +```typescript +field: IFieldType; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionfield.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionfield.md new file mode 100644 index 0000000000000..88eb29d4ed66f --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionfield.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QuerySuggestionField](./kibana-plugin-plugins-data-public.querysuggestionfield.md) + +## QuerySuggestionField interface + +\* + +Signature: + +```typescript +export interface QuerySuggestionField extends QuerySuggestionBasic +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [field](./kibana-plugin-plugins-data-public.querysuggestionfield.field.md) | IFieldType | | +| [type](./kibana-plugin-plugins-data-public.querysuggestionfield.type.md) | QuerySuggestionTypes.Field | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionfield.type.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionfield.type.md new file mode 100644 index 0000000000000..185ee7dc47f22 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestionfield.type.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QuerySuggestionField](./kibana-plugin-plugins-data-public.querysuggestionfield.md) > [type](./kibana-plugin-plugins-data-public.querysuggestionfield.type.md) + +## QuerySuggestionField.type property + +Signature: + +```typescript +type: QuerySuggestionTypes.Field; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfn.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfn.md new file mode 100644 index 0000000000000..30a4630d6a983 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfn.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QuerySuggestionGetFn](./kibana-plugin-plugins-data-public.querysuggestiongetfn.md) + +## QuerySuggestionGetFn type + +Signature: + +```typescript +export declare type QuerySuggestionGetFn = (args: QuerySuggestionGetFnArgs) => Promise | undefined; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.boolfilter.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.boolfilter.md new file mode 100644 index 0000000000000..e5fecb8a2db16 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.boolfilter.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QuerySuggestionGetFnArgs](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.md) > [boolFilter](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.boolfilter.md) + +## QuerySuggestionGetFnArgs.boolFilter property + +Signature: + +```typescript +boolFilter?: any; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.indexpatterns.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.indexpatterns.md new file mode 100644 index 0000000000000..2ad3b2ea63308 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.indexpatterns.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QuerySuggestionGetFnArgs](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.md) > [indexPatterns](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.indexpatterns.md) + +## QuerySuggestionGetFnArgs.indexPatterns property + +Signature: + +```typescript +indexPatterns: IIndexPattern[]; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.language.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.language.md new file mode 100644 index 0000000000000..adebd05d21a1f --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.language.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QuerySuggestionGetFnArgs](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.md) > [language](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.language.md) + +## QuerySuggestionGetFnArgs.language property + +Signature: + +```typescript +language: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.md new file mode 100644 index 0000000000000..96e43ca836891 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.md @@ -0,0 +1,26 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QuerySuggestionGetFnArgs](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.md) + +## QuerySuggestionGetFnArgs interface + +\* + +Signature: + +```typescript +export interface QuerySuggestionGetFnArgs +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [boolFilter](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.boolfilter.md) | any | | +| [indexPatterns](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.indexpatterns.md) | IIndexPattern[] | | +| [language](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.language.md) | string | | +| [query](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.query.md) | string | | +| [selectionEnd](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.selectionend.md) | number | | +| [selectionStart](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.selectionstart.md) | number | | +| [signal](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.signal.md) | AbortSignal | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.query.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.query.md new file mode 100644 index 0000000000000..4cbe5a255841c --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.query.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QuerySuggestionGetFnArgs](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.md) > [query](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.query.md) + +## QuerySuggestionGetFnArgs.query property + +Signature: + +```typescript +query: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.selectionend.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.selectionend.md new file mode 100644 index 0000000000000..458a28cb6b1fa --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.selectionend.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QuerySuggestionGetFnArgs](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.md) > [selectionEnd](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.selectionend.md) + +## QuerySuggestionGetFnArgs.selectionEnd property + +Signature: + +```typescript +selectionEnd: number; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.selectionstart.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.selectionstart.md new file mode 100644 index 0000000000000..c253140468746 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.selectionstart.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QuerySuggestionGetFnArgs](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.md) > [selectionStart](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.selectionstart.md) + +## QuerySuggestionGetFnArgs.selectionStart property + +Signature: + +```typescript +selectionStart: number; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.signal.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.signal.md new file mode 100644 index 0000000000000..9a24fd2b47a14 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiongetfnargs.signal.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QuerySuggestionGetFnArgs](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.md) > [signal](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.signal.md) + +## QuerySuggestionGetFnArgs.signal property + +Signature: + +```typescript +signal?: AbortSignal; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiontypes.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiontypes.md new file mode 100644 index 0000000000000..fd5010167eaa1 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querysuggestiontypes.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [QuerySuggestionTypes](./kibana-plugin-plugins-data-public.querysuggestiontypes.md) + +## QuerySuggestionTypes enum + +Signature: + +```typescript +export declare enum QuerySuggestionTypes +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| Conjunction | "conjunction" | | +| Field | "field" | | +| Operator | "operator" | | +| RecentSearch | "recentSearch" | | +| Value | "value" | | + 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 new file mode 100644 index 0000000000000..fbe04f5e0a2a9 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilter.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [RangeFilter](./kibana-plugin-plugins-data-public.rangefilter.md) + +## RangeFilter type + +Signature: + +```typescript +export declare type RangeFilter = Filter & EsRangeFilter & { + meta: RangeFilterMeta; + script?: { + script: { + params: any; + lang: string; + source: any; + }; + }; + match_all?: any; +}; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefiltermeta.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefiltermeta.md new file mode 100644 index 0000000000000..609e98cb6faa8 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefiltermeta.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [RangeFilterMeta](./kibana-plugin-plugins-data-public.rangefiltermeta.md) + +## RangeFilterMeta type + +Signature: + +```typescript +export declare type RangeFilterMeta = FilterMeta & { + params: RangeFilterParams; + field?: any; + formattedValue?: string; +}; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.format.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.format.md new file mode 100644 index 0000000000000..15926481923ab --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.format.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [RangeFilterParams](./kibana-plugin-plugins-data-public.rangefilterparams.md) > [format](./kibana-plugin-plugins-data-public.rangefilterparams.format.md) + +## RangeFilterParams.format property + +Signature: + +```typescript +format?: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.from.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.from.md new file mode 100644 index 0000000000000..99b8d75e9c316 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.from.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [RangeFilterParams](./kibana-plugin-plugins-data-public.rangefilterparams.md) > [from](./kibana-plugin-plugins-data-public.rangefilterparams.from.md) + +## RangeFilterParams.from property + +Signature: + +```typescript +from?: number | string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.gt.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.gt.md new file mode 100644 index 0000000000000..32bfc6eeb68cb --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.gt.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [RangeFilterParams](./kibana-plugin-plugins-data-public.rangefilterparams.md) > [gt](./kibana-plugin-plugins-data-public.rangefilterparams.gt.md) + +## RangeFilterParams.gt property + +Signature: + +```typescript +gt?: number | string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.gte.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.gte.md new file mode 100644 index 0000000000000..81345e4a81610 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.gte.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [RangeFilterParams](./kibana-plugin-plugins-data-public.rangefilterparams.md) > [gte](./kibana-plugin-plugins-data-public.rangefilterparams.gte.md) + +## RangeFilterParams.gte property + +Signature: + +```typescript +gte?: number | string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.lt.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.lt.md new file mode 100644 index 0000000000000..6250fecfe59d6 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.lt.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [RangeFilterParams](./kibana-plugin-plugins-data-public.rangefilterparams.md) > [lt](./kibana-plugin-plugins-data-public.rangefilterparams.lt.md) + +## RangeFilterParams.lt property + +Signature: + +```typescript +lt?: number | string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.lte.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.lte.md new file mode 100644 index 0000000000000..c4f3cbf00b304 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.lte.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [RangeFilterParams](./kibana-plugin-plugins-data-public.rangefilterparams.md) > [lte](./kibana-plugin-plugins-data-public.rangefilterparams.lte.md) + +## RangeFilterParams.lte property + +Signature: + +```typescript +lte?: number | string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.md new file mode 100644 index 0000000000000..977559f5e6cb2 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [RangeFilterParams](./kibana-plugin-plugins-data-public.rangefilterparams.md) + +## RangeFilterParams interface + +Signature: + +```typescript +export interface RangeFilterParams +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [format](./kibana-plugin-plugins-data-public.rangefilterparams.format.md) | string | | +| [from](./kibana-plugin-plugins-data-public.rangefilterparams.from.md) | number | string | | +| [gt](./kibana-plugin-plugins-data-public.rangefilterparams.gt.md) | number | string | | +| [gte](./kibana-plugin-plugins-data-public.rangefilterparams.gte.md) | number | string | | +| [lt](./kibana-plugin-plugins-data-public.rangefilterparams.lt.md) | number | string | | +| [lte](./kibana-plugin-plugins-data-public.rangefilterparams.lte.md) | number | string | | +| [to](./kibana-plugin-plugins-data-public.rangefilterparams.to.md) | number | string | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.to.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.to.md new file mode 100644 index 0000000000000..c9d0069fb75f5 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilterparams.to.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [RangeFilterParams](./kibana-plugin-plugins-data-public.rangefilterparams.md) > [to](./kibana-plugin-plugins-data-public.rangefilterparams.to.md) + +## RangeFilterParams.to property + +Signature: + +```typescript +to?: number | string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.refreshinterval.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.refreshinterval.md new file mode 100644 index 0000000000000..6a6350d8ba4f6 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.refreshinterval.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [RefreshInterval](./kibana-plugin-plugins-data-public.refreshinterval.md) + +## RefreshInterval interface + +Signature: + +```typescript +export interface RefreshInterval +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [pause](./kibana-plugin-plugins-data-public.refreshinterval.pause.md) | boolean | | +| [value](./kibana-plugin-plugins-data-public.refreshinterval.value.md) | number | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.refreshinterval.pause.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.refreshinterval.pause.md new file mode 100644 index 0000000000000..fb854fcbbc277 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.refreshinterval.pause.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [RefreshInterval](./kibana-plugin-plugins-data-public.refreshinterval.md) > [pause](./kibana-plugin-plugins-data-public.refreshinterval.pause.md) + +## RefreshInterval.pause property + +Signature: + +```typescript +pause: boolean; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.refreshinterval.value.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.refreshinterval.value.md new file mode 100644 index 0000000000000..021a01391b71e --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.refreshinterval.value.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [RefreshInterval](./kibana-plugin-plugins-data-public.refreshinterval.md) > [value](./kibana-plugin-plugins-data-public.refreshinterval.value.md) + +## RefreshInterval.value property + +Signature: + +```typescript +value: number; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedquery.attributes.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedquery.attributes.md new file mode 100644 index 0000000000000..6c5277162fd51 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedquery.attributes.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SavedQuery](./kibana-plugin-plugins-data-public.savedquery.md) > [attributes](./kibana-plugin-plugins-data-public.savedquery.attributes.md) + +## SavedQuery.attributes property + +Signature: + +```typescript +attributes: SavedQueryAttributes; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedquery.id.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedquery.id.md new file mode 100644 index 0000000000000..386a1d048e937 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedquery.id.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SavedQuery](./kibana-plugin-plugins-data-public.savedquery.md) > [id](./kibana-plugin-plugins-data-public.savedquery.id.md) + +## SavedQuery.id property + +Signature: + +```typescript +id: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedquery.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedquery.md new file mode 100644 index 0000000000000..14c143edf13c1 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedquery.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SavedQuery](./kibana-plugin-plugins-data-public.savedquery.md) + +## SavedQuery interface + +Signature: + +```typescript +export interface SavedQuery +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [attributes](./kibana-plugin-plugins-data-public.savedquery.attributes.md) | SavedQueryAttributes | | +| [id](./kibana-plugin-plugins-data-public.savedquery.id.md) | string | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryattributes.description.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryattributes.description.md new file mode 100644 index 0000000000000..859935480357c --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryattributes.description.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SavedQueryAttributes](./kibana-plugin-plugins-data-public.savedqueryattributes.md) > [description](./kibana-plugin-plugins-data-public.savedqueryattributes.description.md) + +## SavedQueryAttributes.description property + +Signature: + +```typescript +description: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryattributes.filters.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryattributes.filters.md new file mode 100644 index 0000000000000..c2c1ac681802b --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryattributes.filters.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SavedQueryAttributes](./kibana-plugin-plugins-data-public.savedqueryattributes.md) > [filters](./kibana-plugin-plugins-data-public.savedqueryattributes.filters.md) + +## SavedQueryAttributes.filters property + +Signature: + +```typescript +filters?: Filter[]; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryattributes.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryattributes.md new file mode 100644 index 0000000000000..612be6a1dabc6 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryattributes.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SavedQueryAttributes](./kibana-plugin-plugins-data-public.savedqueryattributes.md) + +## SavedQueryAttributes interface + +Signature: + +```typescript +export interface SavedQueryAttributes +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [description](./kibana-plugin-plugins-data-public.savedqueryattributes.description.md) | string | | +| [filters](./kibana-plugin-plugins-data-public.savedqueryattributes.filters.md) | Filter[] | | +| [query](./kibana-plugin-plugins-data-public.savedqueryattributes.query.md) | Query | | +| [timefilter](./kibana-plugin-plugins-data-public.savedqueryattributes.timefilter.md) | SavedQueryTimeFilter | | +| [title](./kibana-plugin-plugins-data-public.savedqueryattributes.title.md) | string | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryattributes.query.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryattributes.query.md new file mode 100644 index 0000000000000..96673fc3a8fde --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryattributes.query.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SavedQueryAttributes](./kibana-plugin-plugins-data-public.savedqueryattributes.md) > [query](./kibana-plugin-plugins-data-public.savedqueryattributes.query.md) + +## SavedQueryAttributes.query property + +Signature: + +```typescript +query: Query; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryattributes.timefilter.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryattributes.timefilter.md new file mode 100644 index 0000000000000..b4edb059a3dfd --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryattributes.timefilter.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SavedQueryAttributes](./kibana-plugin-plugins-data-public.savedqueryattributes.md) > [timefilter](./kibana-plugin-plugins-data-public.savedqueryattributes.timefilter.md) + +## SavedQueryAttributes.timefilter property + +Signature: + +```typescript +timefilter?: SavedQueryTimeFilter; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryattributes.title.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryattributes.title.md new file mode 100644 index 0000000000000..99ae1b83e8834 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryattributes.title.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SavedQueryAttributes](./kibana-plugin-plugins-data-public.savedqueryattributes.md) > [title](./kibana-plugin-plugins-data-public.savedqueryattributes.title.md) + +## SavedQueryAttributes.title property + +Signature: + +```typescript +title: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryservice.deletesavedquery.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryservice.deletesavedquery.md new file mode 100644 index 0000000000000..5dd12a011ceca --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryservice.deletesavedquery.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SavedQueryService](./kibana-plugin-plugins-data-public.savedqueryservice.md) > [deleteSavedQuery](./kibana-plugin-plugins-data-public.savedqueryservice.deletesavedquery.md) + +## SavedQueryService.deleteSavedQuery property + +Signature: + +```typescript +deleteSavedQuery: (id: string) => Promise<{}>; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryservice.findsavedqueries.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryservice.findsavedqueries.md new file mode 100644 index 0000000000000..ef3f6ea1645f0 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryservice.findsavedqueries.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SavedQueryService](./kibana-plugin-plugins-data-public.savedqueryservice.md) > [findSavedQueries](./kibana-plugin-plugins-data-public.savedqueryservice.findsavedqueries.md) + +## SavedQueryService.findSavedQueries property + +Signature: + +```typescript +findSavedQueries: (searchText?: string, perPage?: number, activePage?: number) => Promise<{ + total: number; + queries: SavedQuery[]; + }>; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryservice.getallsavedqueries.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryservice.getallsavedqueries.md new file mode 100644 index 0000000000000..ef5048f3b22b8 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryservice.getallsavedqueries.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SavedQueryService](./kibana-plugin-plugins-data-public.savedqueryservice.md) > [getAllSavedQueries](./kibana-plugin-plugins-data-public.savedqueryservice.getallsavedqueries.md) + +## SavedQueryService.getAllSavedQueries property + +Signature: + +```typescript +getAllSavedQueries: () => Promise; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryservice.getsavedquery.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryservice.getsavedquery.md new file mode 100644 index 0000000000000..19c8fcc2a3f40 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryservice.getsavedquery.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SavedQueryService](./kibana-plugin-plugins-data-public.savedqueryservice.md) > [getSavedQuery](./kibana-plugin-plugins-data-public.savedqueryservice.getsavedquery.md) + +## SavedQueryService.getSavedQuery property + +Signature: + +```typescript +getSavedQuery: (id: string) => Promise; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryservice.getsavedquerycount.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryservice.getsavedquerycount.md new file mode 100644 index 0000000000000..225c74abe289f --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryservice.getsavedquerycount.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SavedQueryService](./kibana-plugin-plugins-data-public.savedqueryservice.md) > [getSavedQueryCount](./kibana-plugin-plugins-data-public.savedqueryservice.getsavedquerycount.md) + +## SavedQueryService.getSavedQueryCount property + +Signature: + +```typescript +getSavedQueryCount: () => Promise; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryservice.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryservice.md new file mode 100644 index 0000000000000..de48d867a9580 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryservice.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SavedQueryService](./kibana-plugin-plugins-data-public.savedqueryservice.md) + +## SavedQueryService interface + +Signature: + +```typescript +export interface SavedQueryService +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [deleteSavedQuery](./kibana-plugin-plugins-data-public.savedqueryservice.deletesavedquery.md) | (id: string) => Promise<{}> | | +| [findSavedQueries](./kibana-plugin-plugins-data-public.savedqueryservice.findsavedqueries.md) | (searchText?: string, perPage?: number, activePage?: number) => Promise<{
total: number;
queries: SavedQuery[];
}> | | +| [getAllSavedQueries](./kibana-plugin-plugins-data-public.savedqueryservice.getallsavedqueries.md) | () => Promise<SavedQuery[]> | | +| [getSavedQuery](./kibana-plugin-plugins-data-public.savedqueryservice.getsavedquery.md) | (id: string) => Promise<SavedQuery> | | +| [getSavedQueryCount](./kibana-plugin-plugins-data-public.savedqueryservice.getsavedquerycount.md) | () => Promise<number> | | +| [saveQuery](./kibana-plugin-plugins-data-public.savedqueryservice.savequery.md) | (attributes: SavedQueryAttributes, config?: {
overwrite: boolean;
}) => Promise<SavedQuery> | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryservice.savequery.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryservice.savequery.md new file mode 100644 index 0000000000000..64bced8ace292 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedqueryservice.savequery.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SavedQueryService](./kibana-plugin-plugins-data-public.savedqueryservice.md) > [saveQuery](./kibana-plugin-plugins-data-public.savedqueryservice.savequery.md) + +## SavedQueryService.saveQuery property + +Signature: + +```typescript +saveQuery: (attributes: SavedQueryAttributes, config?: { + overwrite: boolean; + }) => Promise; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedquerytimefilter.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedquerytimefilter.md new file mode 100644 index 0000000000000..542ed16ec1ef6 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.savedquerytimefilter.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SavedQueryTimeFilter](./kibana-plugin-plugins-data-public.savedquerytimefilter.md) + +## SavedQueryTimeFilter type + +Signature: + +```typescript +export declare type SavedQueryTimeFilter = TimeRange & { + refreshInterval: RefreshInterval; +}; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchbar.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchbar.md new file mode 100644 index 0000000000000..89c5ca800a4d4 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchbar.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchBar](./kibana-plugin-plugins-data-public.searchbar.md) + +## SearchBar variable + +Signature: + +```typescript +SearchBar: React.ComponentClass, "query" | "isLoading" | "indexPatterns" | "filters" | "refreshInterval" | "screenTitle" | "dataTestSubj" | "customSubmitButton" | "showQueryBar" | "showQueryInput" | "showFilterBar" | "showDatePicker" | "showAutoRefreshOnly" | "isRefreshPaused" | "dateRangeFrom" | "dateRangeTo" | "showSaveQuery" | "savedQuery" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated" | "onClearSavedQuery" | "onRefresh" | "timeHistory" | "onFiltersUpdated" | "onRefreshChange">, any> & { + WrappedComponent: React.ComponentType & ReactIntl.InjectedIntlProps>; +} +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchbarprops.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchbarprops.md new file mode 100644 index 0000000000000..7ab0c19fd37ba --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchbarprops.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchBarProps](./kibana-plugin-plugins-data-public.searchbarprops.md) + +## SearchBarProps type + +Signature: + +```typescript +export declare type SearchBarProps = SearchBarOwnProps & SearchBarInjectedDeps; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror._constructor_.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror._constructor_.md new file mode 100644 index 0000000000000..4d7691d24a79d --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror._constructor_.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchError](./kibana-plugin-plugins-data-public.searcherror.md) > [(constructor)](./kibana-plugin-plugins-data-public.searcherror._constructor_.md) + +## SearchError.(constructor) + +Constructs a new instance of the `SearchError` class + +Signature: + +```typescript +constructor({ status, title, message, path, type }: SearchErrorOptions); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| { status, title, message, path, type } | SearchErrorOptions | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.md new file mode 100644 index 0000000000000..06e60cadf4a85 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.md @@ -0,0 +1,29 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchError](./kibana-plugin-plugins-data-public.searcherror.md) + +## SearchError class + +Signature: + +```typescript +export declare class SearchError extends Error +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)({ status, title, message, path, type })](./kibana-plugin-plugins-data-public.searcherror._constructor_.md) | | Constructs a new instance of the SearchError class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [message](./kibana-plugin-plugins-data-public.searcherror.message.md) | | string | | +| [name](./kibana-plugin-plugins-data-public.searcherror.name.md) | | string | | +| [path](./kibana-plugin-plugins-data-public.searcherror.path.md) | | string | | +| [status](./kibana-plugin-plugins-data-public.searcherror.status.md) | | string | | +| [title](./kibana-plugin-plugins-data-public.searcherror.title.md) | | string | | +| [type](./kibana-plugin-plugins-data-public.searcherror.type.md) | | string | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.message.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.message.md new file mode 100644 index 0000000000000..5e2de2fbf7f42 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.message.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchError](./kibana-plugin-plugins-data-public.searcherror.md) > [message](./kibana-plugin-plugins-data-public.searcherror.message.md) + +## SearchError.message property + +Signature: + +```typescript +message: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.name.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.name.md new file mode 100644 index 0000000000000..8ad7bb5fcfd81 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.name.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchError](./kibana-plugin-plugins-data-public.searcherror.md) > [name](./kibana-plugin-plugins-data-public.searcherror.name.md) + +## SearchError.name property + +Signature: + +```typescript +name: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.path.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.path.md new file mode 100644 index 0000000000000..833c16e73ea8e --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.path.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchError](./kibana-plugin-plugins-data-public.searcherror.md) > [path](./kibana-plugin-plugins-data-public.searcherror.path.md) + +## SearchError.path property + +Signature: + +```typescript +path: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.status.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.status.md new file mode 100644 index 0000000000000..ae1a947da0abb --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.status.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchError](./kibana-plugin-plugins-data-public.searcherror.md) > [status](./kibana-plugin-plugins-data-public.searcherror.status.md) + +## SearchError.status property + +Signature: + +```typescript +status: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.title.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.title.md new file mode 100644 index 0000000000000..aa73ab3b5790c --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.title.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchError](./kibana-plugin-plugins-data-public.searcherror.md) > [title](./kibana-plugin-plugins-data-public.searcherror.title.md) + +## SearchError.title property + +Signature: + +```typescript +title: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.type.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.type.md new file mode 100644 index 0000000000000..dde447a9059c5 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.type.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchError](./kibana-plugin-plugins-data-public.searcherror.md) > [type](./kibana-plugin-plugins-data-public.searcherror.type.md) + +## SearchError.type property + +Signature: + +```typescript +type: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchrequest.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchrequest.md new file mode 100644 index 0000000000000..dbb465839e52c --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchrequest.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchRequest](./kibana-plugin-plugins-data-public.searchrequest.md) + +## SearchRequest type + +Signature: + +```typescript +export declare type SearchRequest = any; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchresponse.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchresponse.md new file mode 100644 index 0000000000000..6da31c8bced7e --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchresponse.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchResponse](./kibana-plugin-plugins-data-public.searchresponse.md) + +## SearchResponse type + +Signature: + +```typescript +export declare type SearchResponse = any; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource._constructor_.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource._constructor_.md new file mode 100644 index 0000000000000..e0c9e77b313a5 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource._constructor_.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSource](./kibana-plugin-plugins-data-public.searchsource.md) > [(constructor)](./kibana-plugin-plugins-data-public.searchsource._constructor_.md) + +## SearchSource.(constructor) + +Constructs a new instance of the `SearchSource` class + +Signature: + +```typescript +constructor(fields?: SearchSourceFields); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| fields | SearchSourceFields | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.create.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.create.md new file mode 100644 index 0000000000000..b0a0201680ca8 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.create.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSource](./kibana-plugin-plugins-data-public.searchsource.md) > [create](./kibana-plugin-plugins-data-public.searchsource.create.md) + +## SearchSource.create() method + +Signature: + +```typescript +create(): SearchSource; +``` +Returns: + +`SearchSource` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.createchild.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.createchild.md new file mode 100644 index 0000000000000..3f17dc21cf514 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.createchild.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSource](./kibana-plugin-plugins-data-public.searchsource.md) > [createChild](./kibana-plugin-plugins-data-public.searchsource.createchild.md) + +## SearchSource.createChild() method + +Signature: + +```typescript +createChild(options?: {}): SearchSource; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| options | {} | | + +Returns: + +`SearchSource` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.createcopy.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.createcopy.md new file mode 100644 index 0000000000000..f503a3dfc3299 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.createcopy.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSource](./kibana-plugin-plugins-data-public.searchsource.md) > [createCopy](./kibana-plugin-plugins-data-public.searchsource.createcopy.md) + +## SearchSource.createCopy() method + +Signature: + +```typescript +createCopy(): SearchSource; +``` +Returns: + +`SearchSource` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.destroy.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.destroy.md new file mode 100644 index 0000000000000..8a7cc5ee75d11 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.destroy.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSource](./kibana-plugin-plugins-data-public.searchsource.md) > [destroy](./kibana-plugin-plugins-data-public.searchsource.destroy.md) + +## SearchSource.destroy() method + +Completely destroy the SearchSource. {undefined} + +Signature: + +```typescript +destroy(): void; +``` +Returns: + +`void` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.fetch.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.fetch.md new file mode 100644 index 0000000000000..208ce565fac13 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.fetch.md @@ -0,0 +1,25 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSource](./kibana-plugin-plugins-data-public.searchsource.md) > [fetch](./kibana-plugin-plugins-data-public.searchsource.fetch.md) + +## SearchSource.fetch() method + +Fetch this source and reject the returned Promise on error + + +Signature: + +```typescript +fetch(options?: FetchOptions): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| options | FetchOptions | | + +Returns: + +`Promise` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.getfield.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.getfield.md new file mode 100644 index 0000000000000..98ba815696cf6 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.getfield.md @@ -0,0 +1,25 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSource](./kibana-plugin-plugins-data-public.searchsource.md) > [getField](./kibana-plugin-plugins-data-public.searchsource.getfield.md) + +## SearchSource.getField() method + +Get fields from the fields + +Signature: + +```typescript +getField(field: K, recurse?: boolean): SearchSourceFields[K]; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | K | | +| recurse | boolean | | + +Returns: + +`SearchSourceFields[K]` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.getfields.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.getfields.md new file mode 100644 index 0000000000000..4f4e575241e10 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.getfields.md @@ -0,0 +1,49 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSource](./kibana-plugin-plugins-data-public.searchsource.md) > [getFields](./kibana-plugin-plugins-data-public.searchsource.getfields.md) + +## SearchSource.getFields() method + +Signature: + +```typescript +getFields(): { + type?: string | undefined; + query?: import("../..").Query | undefined; + filter?: Filter | Filter[] | (() => Filter | Filter[] | undefined) | undefined; + sort?: Record | Record[] | undefined; + highlight?: any; + highlightAll?: boolean | undefined; + aggs?: any; + from?: number | undefined; + size?: number | undefined; + source?: string | boolean | string[] | undefined; + version?: boolean | undefined; + fields?: string | boolean | string[] | undefined; + index?: import("../..").IndexPattern | undefined; + searchAfter?: import("./types").EsQuerySearchAfter | undefined; + timeout?: string | undefined; + terminate_after?: number | undefined; + }; +``` +Returns: + +`{ + type?: string | undefined; + query?: import("../..").Query | undefined; + filter?: Filter | Filter[] | (() => Filter | Filter[] | undefined) | undefined; + sort?: Record | Record[] | undefined; + highlight?: any; + highlightAll?: boolean | undefined; + aggs?: any; + from?: number | undefined; + size?: number | undefined; + source?: string | boolean | string[] | undefined; + version?: boolean | undefined; + fields?: string | boolean | string[] | undefined; + index?: import("../..").IndexPattern | undefined; + searchAfter?: import("./types").EsQuerySearchAfter | undefined; + timeout?: string | undefined; + terminate_after?: number | undefined; + }` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.getid.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.getid.md new file mode 100644 index 0000000000000..55aaa26ca62f3 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.getid.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSource](./kibana-plugin-plugins-data-public.searchsource.md) > [getId](./kibana-plugin-plugins-data-public.searchsource.getid.md) + +## SearchSource.getId() method + +Signature: + +```typescript +getId(): string; +``` +Returns: + +`string` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.getownfield.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.getownfield.md new file mode 100644 index 0000000000000..d5a133772264e --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.getownfield.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSource](./kibana-plugin-plugins-data-public.searchsource.md) > [getOwnField](./kibana-plugin-plugins-data-public.searchsource.getownfield.md) + +## SearchSource.getOwnField() method + +Get the field from our own fields, don't traverse up the chain + +Signature: + +```typescript +getOwnField(field: K): SearchSourceFields[K]; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | K | | + +Returns: + +`SearchSourceFields[K]` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.getparent.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.getparent.md new file mode 100644 index 0000000000000..14578f7949ba6 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.getparent.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSource](./kibana-plugin-plugins-data-public.searchsource.md) > [getParent](./kibana-plugin-plugins-data-public.searchsource.getparent.md) + +## SearchSource.getParent() method + +Get the parent of this SearchSource {undefined\|searchSource} + +Signature: + +```typescript +getParent(): SearchSource | undefined; +``` +Returns: + +`SearchSource | undefined` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.getsearchrequestbody.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.getsearchrequestbody.md new file mode 100644 index 0000000000000..f3451c9391074 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.getsearchrequestbody.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSource](./kibana-plugin-plugins-data-public.searchsource.md) > [getSearchRequestBody](./kibana-plugin-plugins-data-public.searchsource.getsearchrequestbody.md) + +## SearchSource.getSearchRequestBody() method + +Signature: + +```typescript +getSearchRequestBody(): Promise; +``` +Returns: + +`Promise` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.history.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.history.md new file mode 100644 index 0000000000000..e77c9dac7239f --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.history.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSource](./kibana-plugin-plugins-data-public.searchsource.md) > [history](./kibana-plugin-plugins-data-public.searchsource.history.md) + +## SearchSource.history property + +Signature: + +```typescript +history: SearchRequest[]; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.md new file mode 100644 index 0000000000000..8e1dbb6e2671d --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.md @@ -0,0 +1,45 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSource](./kibana-plugin-plugins-data-public.searchsource.md) + +## SearchSource class + +Signature: + +```typescript +export declare class SearchSource +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(fields)](./kibana-plugin-plugins-data-public.searchsource._constructor_.md) | | Constructs a new instance of the SearchSource class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [history](./kibana-plugin-plugins-data-public.searchsource.history.md) | | SearchRequest[] | | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [create()](./kibana-plugin-plugins-data-public.searchsource.create.md) | | | +| [createChild(options)](./kibana-plugin-plugins-data-public.searchsource.createchild.md) | | | +| [createCopy()](./kibana-plugin-plugins-data-public.searchsource.createcopy.md) | | | +| [destroy()](./kibana-plugin-plugins-data-public.searchsource.destroy.md) | | Completely destroy the SearchSource. {undefined} | +| [fetch(options)](./kibana-plugin-plugins-data-public.searchsource.fetch.md) | | Fetch this source and reject the returned Promise on error | +| [getField(field, recurse)](./kibana-plugin-plugins-data-public.searchsource.getfield.md) | | Get fields from the fields | +| [getFields()](./kibana-plugin-plugins-data-public.searchsource.getfields.md) | | | +| [getId()](./kibana-plugin-plugins-data-public.searchsource.getid.md) | | | +| [getOwnField(field)](./kibana-plugin-plugins-data-public.searchsource.getownfield.md) | | Get the field from our own fields, don't traverse up the chain | +| [getParent()](./kibana-plugin-plugins-data-public.searchsource.getparent.md) | | Get the parent of this SearchSource {undefined\|searchSource} | +| [getSearchRequestBody()](./kibana-plugin-plugins-data-public.searchsource.getsearchrequestbody.md) | | | +| [onRequestStart(handler)](./kibana-plugin-plugins-data-public.searchsource.onrequeststart.md) | | Add a handler that will be notified whenever requests start | +| [setField(field, value)](./kibana-plugin-plugins-data-public.searchsource.setfield.md) | | | +| [setFields(newFields)](./kibana-plugin-plugins-data-public.searchsource.setfields.md) | | | +| [setParent(parent, options)](./kibana-plugin-plugins-data-public.searchsource.setparent.md) | | Set a searchSource that this source should inherit from | +| [setPreferredSearchStrategyId(searchStrategyId)](./kibana-plugin-plugins-data-public.searchsource.setpreferredsearchstrategyid.md) | | \*\*\* PUBLIC API \*\*\* | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.onrequeststart.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.onrequeststart.md new file mode 100644 index 0000000000000..092d057c69196 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.onrequeststart.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSource](./kibana-plugin-plugins-data-public.searchsource.md) > [onRequestStart](./kibana-plugin-plugins-data-public.searchsource.onrequeststart.md) + +## SearchSource.onRequestStart() method + +Add a handler that will be notified whenever requests start + +Signature: + +```typescript +onRequestStart(handler: (searchSource: ISearchSource, options?: FetchOptions) => Promise): void; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| handler | (searchSource: ISearchSource, options?: FetchOptions) => Promise<unknown> | | + +Returns: + +`void` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.setfield.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.setfield.md new file mode 100644 index 0000000000000..83b7c30281752 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.setfield.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSource](./kibana-plugin-plugins-data-public.searchsource.md) > [setField](./kibana-plugin-plugins-data-public.searchsource.setfield.md) + +## SearchSource.setField() method + +Signature: + +```typescript +setField(field: K, value: SearchSourceFields[K]): this; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | K | | +| value | SearchSourceFields[K] | | + +Returns: + +`this` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.setfields.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.setfields.md new file mode 100644 index 0000000000000..fa9b265aa43b7 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.setfields.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSource](./kibana-plugin-plugins-data-public.searchsource.md) > [setFields](./kibana-plugin-plugins-data-public.searchsource.setfields.md) + +## SearchSource.setFields() method + +Signature: + +```typescript +setFields(newFields: SearchSourceFields): this; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| newFields | SearchSourceFields | | + +Returns: + +`this` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.setparent.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.setparent.md new file mode 100644 index 0000000000000..19bf10bec210f --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.setparent.md @@ -0,0 +1,25 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSource](./kibana-plugin-plugins-data-public.searchsource.md) > [setParent](./kibana-plugin-plugins-data-public.searchsource.setparent.md) + +## SearchSource.setParent() method + +Set a searchSource that this source should inherit from + +Signature: + +```typescript +setParent(parent?: ISearchSource, options?: SearchSourceOptions): this; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| parent | ISearchSource | | +| options | SearchSourceOptions | | + +Returns: + +`this` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.setpreferredsearchstrategyid.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.setpreferredsearchstrategyid.md new file mode 100644 index 0000000000000..8d8dbce9e60f6 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.setpreferredsearchstrategyid.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSource](./kibana-plugin-plugins-data-public.searchsource.md) > [setPreferredSearchStrategyId](./kibana-plugin-plugins-data-public.searchsource.setpreferredsearchstrategyid.md) + +## SearchSource.setPreferredSearchStrategyId() method + +\*\*\* PUBLIC API \*\*\* + +Signature: + +```typescript +setPreferredSearchStrategyId(searchStrategyId: string): void; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| searchStrategyId | string | | + +Returns: + +`void` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.aggs.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.aggs.md new file mode 100644 index 0000000000000..743646708b4c6 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.aggs.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) > [aggs](./kibana-plugin-plugins-data-public.searchsourcefields.aggs.md) + +## SearchSourceFields.aggs property + +Signature: + +```typescript +aggs?: any; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.fields.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.fields.md new file mode 100644 index 0000000000000..21d09910bd2b9 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.fields.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) > [fields](./kibana-plugin-plugins-data-public.searchsourcefields.fields.md) + +## SearchSourceFields.fields property + +Signature: + +```typescript +fields?: NameList; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.filter.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.filter.md new file mode 100644 index 0000000000000..a14d33420a22d --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.filter.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) > [filter](./kibana-plugin-plugins-data-public.searchsourcefields.filter.md) + +## SearchSourceFields.filter property + +Signature: + +```typescript +filter?: Filter[] | Filter | (() => Filter[] | Filter | undefined); +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.from.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.from.md new file mode 100644 index 0000000000000..0b8bbfc3ef378 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.from.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) > [from](./kibana-plugin-plugins-data-public.searchsourcefields.from.md) + +## SearchSourceFields.from property + +Signature: + +```typescript +from?: number; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.highlight.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.highlight.md new file mode 100644 index 0000000000000..0541fb7cf9212 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.highlight.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) > [highlight](./kibana-plugin-plugins-data-public.searchsourcefields.highlight.md) + +## SearchSourceFields.highlight property + +Signature: + +```typescript +highlight?: any; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.highlightall.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.highlightall.md new file mode 100644 index 0000000000000..82f18e73856a6 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.highlightall.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) > [highlightAll](./kibana-plugin-plugins-data-public.searchsourcefields.highlightall.md) + +## SearchSourceFields.highlightAll property + +Signature: + +```typescript +highlightAll?: boolean; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.index.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.index.md new file mode 100644 index 0000000000000..fa1d1a552a560 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.index.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) > [index](./kibana-plugin-plugins-data-public.searchsourcefields.index.md) + +## SearchSourceFields.index property + +Signature: + +```typescript +index?: IndexPattern; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.md new file mode 100644 index 0000000000000..7a64af0f8b2b8 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.md @@ -0,0 +1,33 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) + +## SearchSourceFields interface + +Signature: + +```typescript +export interface SearchSourceFields +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [aggs](./kibana-plugin-plugins-data-public.searchsourcefields.aggs.md) | any | | +| [fields](./kibana-plugin-plugins-data-public.searchsourcefields.fields.md) | NameList | | +| [filter](./kibana-plugin-plugins-data-public.searchsourcefields.filter.md) | Filter[] | Filter | (() => Filter[] | Filter | undefined) | | +| [from](./kibana-plugin-plugins-data-public.searchsourcefields.from.md) | number | | +| [highlight](./kibana-plugin-plugins-data-public.searchsourcefields.highlight.md) | any | | +| [highlightAll](./kibana-plugin-plugins-data-public.searchsourcefields.highlightall.md) | boolean | | +| [index](./kibana-plugin-plugins-data-public.searchsourcefields.index.md) | IndexPattern | | +| [query](./kibana-plugin-plugins-data-public.searchsourcefields.query.md) | Query | | +| [searchAfter](./kibana-plugin-plugins-data-public.searchsourcefields.searchafter.md) | EsQuerySearchAfter | | +| [size](./kibana-plugin-plugins-data-public.searchsourcefields.size.md) | number | | +| [sort](./kibana-plugin-plugins-data-public.searchsourcefields.sort.md) | EsQuerySortValue | EsQuerySortValue[] | | +| [source](./kibana-plugin-plugins-data-public.searchsourcefields.source.md) | NameList | | +| [terminate\_after](./kibana-plugin-plugins-data-public.searchsourcefields.terminate_after.md) | number | | +| [timeout](./kibana-plugin-plugins-data-public.searchsourcefields.timeout.md) | string | | +| [type](./kibana-plugin-plugins-data-public.searchsourcefields.type.md) | string | | +| [version](./kibana-plugin-plugins-data-public.searchsourcefields.version.md) | boolean | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.query.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.query.md new file mode 100644 index 0000000000000..687dafce798d1 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.query.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) > [query](./kibana-plugin-plugins-data-public.searchsourcefields.query.md) + +## SearchSourceFields.query property + +Signature: + +```typescript +query?: Query; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.searchafter.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.searchafter.md new file mode 100644 index 0000000000000..fca9efcae8406 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.searchafter.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) > [searchAfter](./kibana-plugin-plugins-data-public.searchsourcefields.searchafter.md) + +## SearchSourceFields.searchAfter property + +Signature: + +```typescript +searchAfter?: EsQuerySearchAfter; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.size.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.size.md new file mode 100644 index 0000000000000..38a5f1856644b --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.size.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) > [size](./kibana-plugin-plugins-data-public.searchsourcefields.size.md) + +## SearchSourceFields.size property + +Signature: + +```typescript +size?: number; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.sort.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.sort.md new file mode 100644 index 0000000000000..c10f556cef6d6 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.sort.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) > [sort](./kibana-plugin-plugins-data-public.searchsourcefields.sort.md) + +## SearchSourceFields.sort property + +Signature: + +```typescript +sort?: EsQuerySortValue | EsQuerySortValue[]; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.source.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.source.md new file mode 100644 index 0000000000000..0066e96d0dfc1 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.source.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) > [source](./kibana-plugin-plugins-data-public.searchsourcefields.source.md) + +## SearchSourceFields.source property + +Signature: + +```typescript +source?: NameList; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.terminate_after.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.terminate_after.md new file mode 100644 index 0000000000000..e863c8ef77ef7 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.terminate_after.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) > [terminate\_after](./kibana-plugin-plugins-data-public.searchsourcefields.terminate_after.md) + +## SearchSourceFields.terminate\_after property + +Signature: + +```typescript +terminate_after?: number; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.timeout.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.timeout.md new file mode 100644 index 0000000000000..04fcaf455323a --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.timeout.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) > [timeout](./kibana-plugin-plugins-data-public.searchsourcefields.timeout.md) + +## SearchSourceFields.timeout property + +Signature: + +```typescript +timeout?: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.type.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.type.md new file mode 100644 index 0000000000000..97e5f469fb62f --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.type.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) > [type](./kibana-plugin-plugins-data-public.searchsourcefields.type.md) + +## SearchSourceFields.type property + +Signature: + +```typescript +type?: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.version.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.version.md new file mode 100644 index 0000000000000..c940be14f3cde --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsourcefields.version.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) > [version](./kibana-plugin-plugins-data-public.searchsourcefields.version.md) + +## SearchSourceFields.version property + +Signature: + +```typescript +version?: boolean; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.id.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.id.md new file mode 100644 index 0000000000000..d60ffba6a05ca --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.id.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchStrategyProvider](./kibana-plugin-plugins-data-public.searchstrategyprovider.md) > [id](./kibana-plugin-plugins-data-public.searchstrategyprovider.id.md) + +## SearchStrategyProvider.id property + +Signature: + +```typescript +id: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.isviable.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.isviable.md new file mode 100644 index 0000000000000..aa8ed49051ee9 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.isviable.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchStrategyProvider](./kibana-plugin-plugins-data-public.searchstrategyprovider.md) > [isViable](./kibana-plugin-plugins-data-public.searchstrategyprovider.isviable.md) + +## SearchStrategyProvider.isViable property + +Signature: + +```typescript +isViable: (indexPattern: IndexPattern) => boolean; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.md new file mode 100644 index 0000000000000..b271a921906a7 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchStrategyProvider](./kibana-plugin-plugins-data-public.searchstrategyprovider.md) + +## SearchStrategyProvider interface + +Signature: + +```typescript +export interface SearchStrategyProvider +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [id](./kibana-plugin-plugins-data-public.searchstrategyprovider.id.md) | string | | +| [isViable](./kibana-plugin-plugins-data-public.searchstrategyprovider.isviable.md) | (indexPattern: IndexPattern) => boolean | | +| [search](./kibana-plugin-plugins-data-public.searchstrategyprovider.search.md) | (params: SearchStrategySearchParams) => SearchStrategyResponse | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.search.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.search.md new file mode 100644 index 0000000000000..6e2561c3b0ad0 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.search.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchStrategyProvider](./kibana-plugin-plugins-data-public.searchstrategyprovider.md) > [search](./kibana-plugin-plugins-data-public.searchstrategyprovider.search.md) + +## SearchStrategyProvider.search property + +Signature: + +```typescript +search: (params: SearchStrategySearchParams) => SearchStrategyResponse; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.sortdirection.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.sortdirection.md new file mode 100644 index 0000000000000..bea20c323b850 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.sortdirection.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SortDirection](./kibana-plugin-plugins-data-public.sortdirection.md) + +## SortDirection enum + +Signature: + +```typescript +export declare enum SortDirection +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| asc | "asc" | | +| desc | "desc" | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.statefulsearchbarprops.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.statefulsearchbarprops.md new file mode 100644 index 0000000000000..7e10306857b8a --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.statefulsearchbarprops.md @@ -0,0 +1,16 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [StatefulSearchBarProps](./kibana-plugin-plugins-data-public.statefulsearchbarprops.md) + +## StatefulSearchBarProps type + +Signature: + +```typescript +export declare type StatefulSearchBarProps = SearchBarOwnProps & { + appName: string; + useDefaultBehaviors?: boolean; + savedQueryId?: string; + onSavedQueryIdChange?: (savedQueryId?: string) => void; +}; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.sync_search_strategy.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.sync_search_strategy.md new file mode 100644 index 0000000000000..3681fe6d6274c --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.sync_search_strategy.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SYNC\_SEARCH\_STRATEGY](./kibana-plugin-plugins-data-public.sync_search_strategy.md) + +## SYNC\_SEARCH\_STRATEGY variable + +Signature: + +```typescript +SYNC_SEARCH_STRATEGY = "SYNC_SEARCH_STRATEGY" +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.syncquerystatewithurl.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.syncquerystatewithurl.md new file mode 100644 index 0000000000000..aa1a54bcb6257 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.syncquerystatewithurl.md @@ -0,0 +1,31 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [syncQueryStateWithUrl](./kibana-plugin-plugins-data-public.syncquerystatewithurl.md) + +## syncQueryStateWithUrl variable + +Helper to setup syncing of global data with the URL + +Signature: + +```typescript +syncQueryStateWithUrl: (query: Pick<{ + filterManager: import("..").FilterManager; + timefilter: import("..").TimefilterSetup; + state$: import("rxjs").Observable<{ + changes: import("./types").QueryStateChange; + state: QueryState; + }>; + savedQueries: import("..").SavedQueryService; +} | { + filterManager: import("..").FilterManager; + timefilter: import("..").TimefilterSetup; + state$: import("rxjs").Observable<{ + changes: import("./types").QueryStateChange; + state: QueryState; + }>; +}, "state$" | "timefilter" | "filterManager">, kbnUrlStateStorage: IKbnUrlStateStorage) => { + stop: () => void; + hasInheritedQueryFromUrl: boolean; +} +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timefiltercontract.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timefiltercontract.md new file mode 100644 index 0000000000000..0e5e8707fec63 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timefiltercontract.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [TimefilterContract](./kibana-plugin-plugins-data-public.timefiltercontract.md) + +## TimefilterContract type + +Signature: + +```typescript +export declare type TimefilterContract = PublicMethodsOf; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timefiltersetup.history.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timefiltersetup.history.md new file mode 100644 index 0000000000000..b2ef4a92c5fef --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timefiltersetup.history.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [TimefilterSetup](./kibana-plugin-plugins-data-public.timefiltersetup.md) > [history](./kibana-plugin-plugins-data-public.timefiltersetup.history.md) + +## TimefilterSetup.history property + +Signature: + +```typescript +history: TimeHistoryContract; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timefiltersetup.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timefiltersetup.md new file mode 100644 index 0000000000000..3375b415e923b --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timefiltersetup.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [TimefilterSetup](./kibana-plugin-plugins-data-public.timefiltersetup.md) + +## TimefilterSetup interface + + +Signature: + +```typescript +export interface TimefilterSetup +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [history](./kibana-plugin-plugins-data-public.timefiltersetup.history.md) | TimeHistoryContract | | +| [timefilter](./kibana-plugin-plugins-data-public.timefiltersetup.timefilter.md) | TimefilterContract | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timefiltersetup.timefilter.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timefiltersetup.timefilter.md new file mode 100644 index 0000000000000..897ace53a282d --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timefiltersetup.timefilter.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [TimefilterSetup](./kibana-plugin-plugins-data-public.timefiltersetup.md) > [timefilter](./kibana-plugin-plugins-data-public.timefiltersetup.timefilter.md) + +## TimefilterSetup.timefilter property + +Signature: + +```typescript +timefilter: TimefilterContract; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timehistory._constructor_.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timehistory._constructor_.md new file mode 100644 index 0000000000000..3d0e7aea5be1f --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timehistory._constructor_.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [TimeHistory](./kibana-plugin-plugins-data-public.timehistory.md) > [(constructor)](./kibana-plugin-plugins-data-public.timehistory._constructor_.md) + +## TimeHistory.(constructor) + +Constructs a new instance of the `TimeHistory` class + +Signature: + +```typescript +constructor(storage: IStorageWrapper); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| storage | IStorageWrapper | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timehistory.add.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timehistory.add.md new file mode 100644 index 0000000000000..393e10403652d --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timehistory.add.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [TimeHistory](./kibana-plugin-plugins-data-public.timehistory.md) > [add](./kibana-plugin-plugins-data-public.timehistory.add.md) + +## TimeHistory.add() method + +Signature: + +```typescript +add(time: TimeRange): void; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| time | TimeRange | | + +Returns: + +`void` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timehistory.get.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timehistory.get.md new file mode 100644 index 0000000000000..fc9983836cd0b --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timehistory.get.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [TimeHistory](./kibana-plugin-plugins-data-public.timehistory.md) > [get](./kibana-plugin-plugins-data-public.timehistory.get.md) + +## TimeHistory.get() method + +Signature: + +```typescript +get(): TimeRange[]; +``` +Returns: + +`TimeRange[]` + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timehistory.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timehistory.md new file mode 100644 index 0000000000000..86b9865cbd53f --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timehistory.md @@ -0,0 +1,25 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [TimeHistory](./kibana-plugin-plugins-data-public.timehistory.md) + +## TimeHistory class + +Signature: + +```typescript +export declare class TimeHistory +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(storage)](./kibana-plugin-plugins-data-public.timehistory._constructor_.md) | | Constructs a new instance of the TimeHistory class | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [add(time)](./kibana-plugin-plugins-data-public.timehistory.add.md) | | | +| [get()](./kibana-plugin-plugins-data-public.timehistory.get.md) | | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timehistorycontract.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timehistorycontract.md new file mode 100644 index 0000000000000..15dea14c08b19 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timehistorycontract.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [TimeHistoryContract](./kibana-plugin-plugins-data-public.timehistorycontract.md) + +## TimeHistoryContract type + +Signature: + +```typescript +export declare type TimeHistoryContract = PublicMethodsOf; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timerange.from.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timerange.from.md new file mode 100644 index 0000000000000..b428bd9cd90ca --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timerange.from.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [TimeRange](./kibana-plugin-plugins-data-public.timerange.md) > [from](./kibana-plugin-plugins-data-public.timerange.from.md) + +## TimeRange.from property + +Signature: + +```typescript +from: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timerange.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timerange.md new file mode 100644 index 0000000000000..69078ca40d20d --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timerange.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [TimeRange](./kibana-plugin-plugins-data-public.timerange.md) + +## TimeRange interface + +Signature: + +```typescript +export interface TimeRange +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [from](./kibana-plugin-plugins-data-public.timerange.from.md) | string | | +| [mode](./kibana-plugin-plugins-data-public.timerange.mode.md) | 'absolute' | 'relative' | | +| [to](./kibana-plugin-plugins-data-public.timerange.to.md) | string | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timerange.mode.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timerange.mode.md new file mode 100644 index 0000000000000..fb9ebd3c9165f --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timerange.mode.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [TimeRange](./kibana-plugin-plugins-data-public.timerange.md) > [mode](./kibana-plugin-plugins-data-public.timerange.mode.md) + +## TimeRange.mode property + +Signature: + +```typescript +mode?: 'absolute' | 'relative'; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timerange.to.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timerange.to.md new file mode 100644 index 0000000000000..342acd5e049f1 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.timerange.to.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [TimeRange](./kibana-plugin-plugins-data-public.timerange.md) > [to](./kibana-plugin-plugins-data-public.timerange.to.md) + +## TimeRange.to property + +Signature: + +```typescript +to: string; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.tsearchstrategyprovider.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.tsearchstrategyprovider.md new file mode 100644 index 0000000000000..3233bb48cea2c --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.tsearchstrategyprovider.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [TSearchStrategyProvider](./kibana-plugin-plugins-data-public.tsearchstrategyprovider.md) + +## TSearchStrategyProvider type + +Search strategy provider creates an instance of a search strategy with the request handler context bound to it. This way every search strategy can use whatever information they require from the request context. + +Signature: + +```typescript +export declare type TSearchStrategyProvider = (context: ISearchContext) => ISearchStrategy; +``` diff --git a/docs/development/plugins/data/server/index.md b/docs/development/plugins/data/server/index.md new file mode 100644 index 0000000000000..d2cba1b6c2d9c --- /dev/null +++ b/docs/development/plugins/data/server/index.md @@ -0,0 +1,12 @@ + + +[Home](./index.md) + +## API Reference + +## Packages + +| Package | Description | +| --- | --- | +| [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) | | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.castestokbnfieldtypename.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.castestokbnfieldtypename.md new file mode 100644 index 0000000000000..68851503ae53c --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.castestokbnfieldtypename.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [castEsToKbnFieldTypeName](./kibana-plugin-plugins-data-server.castestokbnfieldtypename.md) + +## castEsToKbnFieldTypeName variable + +Get the KbnFieldType name for an esType string + +Signature: + +```typescript +castEsToKbnFieldTypeName: (esType: string) => KBN_FIELD_TYPES +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.es_field_types.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.es_field_types.md new file mode 100644 index 0000000000000..81a7cbca77c48 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.es_field_types.md @@ -0,0 +1,45 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [ES\_FIELD\_TYPES](./kibana-plugin-plugins-data-server.es_field_types.md) + +## ES\_FIELD\_TYPES enum + +\* + +Signature: + +```typescript +export declare enum ES_FIELD_TYPES +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| \_ID | "_id" | | +| \_INDEX | "_index" | | +| \_SOURCE | "_source" | | +| \_TYPE | "_type" | | +| ATTACHMENT | "attachment" | | +| BOOLEAN | "boolean" | | +| BYTE | "byte" | | +| DATE | "date" | | +| DATE\_NANOS | "date_nanos" | | +| DOUBLE | "double" | | +| FLOAT | "float" | | +| GEO\_POINT | "geo_point" | | +| GEO\_SHAPE | "geo_shape" | | +| HALF\_FLOAT | "half_float" | | +| INTEGER | "integer" | | +| IP | "ip" | | +| KEYWORD | "keyword" | | +| LONG | "long" | | +| MURMUR3 | "murmur3" | | +| NESTED | "nested" | | +| OBJECT | "object" | | +| SCALED\_FLOAT | "scaled_float" | | +| SHORT | "short" | | +| STRING | "string" | | +| TEXT | "text" | | +| TOKEN\_COUNT | "token_count" | | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.esfilters.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.esfilters.md new file mode 100644 index 0000000000000..d7e80d94db4e6 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.esfilters.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [esFilters](./kibana-plugin-plugins-data-server.esfilters.md) + +## esFilters variable + +Signature: + +```typescript +esFilters: { + buildQueryFilter: (query: any, index: string, alias: string) => import("../common").QueryStringFilter; + buildCustomFilter: typeof buildCustomFilter; + buildEmptyFilter: (isPinned: boolean, index?: string | undefined) => import("../common").Filter; + buildExistsFilter: (field: import("../common").IFieldType, indexPattern: import("../common").IIndexPattern) => import("../common").ExistsFilter; + buildFilter: typeof buildFilter; + buildPhraseFilter: (field: import("../common").IFieldType, value: any, indexPattern: import("../common").IIndexPattern) => import("../common").PhraseFilter; + buildPhrasesFilter: (field: import("../common").IFieldType, params: any[], indexPattern: import("../common").IIndexPattern) => import("../common").PhrasesFilter; + buildRangeFilter: (field: import("../common").IFieldType, params: import("../common").RangeFilterParams, indexPattern: import("../common").IIndexPattern, formattedValue?: string | undefined) => import("../common").RangeFilter; + isFilterDisabled: (filter: import("../common").Filter) => boolean; +} +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.eskuery.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.eskuery.md new file mode 100644 index 0000000000000..19cb742785e7b --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.eskuery.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [esKuery](./kibana-plugin-plugins-data-server.eskuery.md) + +## esKuery variable + +Signature: + +```typescript +esKuery: { + nodeTypes: import("../common/es_query/kuery/node_types").NodeTypes; + fromKueryExpression: (expression: any, parseOptions?: Partial) => import("../common").KueryNode; + toElasticsearchQuery: (node: import("../common").KueryNode, indexPattern?: import("../common").IIndexPattern | undefined, config?: Record | undefined, context?: Record | undefined) => import("../../kibana_utils/common").JsonObject; +} +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.esquery.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.esquery.md new file mode 100644 index 0000000000000..ac9be23bc6b6f --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.esquery.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [esQuery](./kibana-plugin-plugins-data-server.esquery.md) + +## esQuery variable + +Signature: + +```typescript +esQuery: { + buildQueryFromFilters: (filters: import("../common").Filter[] | undefined, indexPattern: import("../common").IIndexPattern | undefined, ignoreFilterIfFieldNotInIndex?: boolean) => { + must: never[]; + filter: import("../common").Filter[]; + should: never[]; + must_not: import("../common").Filter[]; + }; + getEsQueryConfig: typeof getEsQueryConfig; + buildEsQuery: typeof buildEsQuery; +} +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.esqueryconfig.allowleadingwildcards.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.esqueryconfig.allowleadingwildcards.md new file mode 100644 index 0000000000000..ce8303d720747 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.esqueryconfig.allowleadingwildcards.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [EsQueryConfig](./kibana-plugin-plugins-data-server.esqueryconfig.md) > [allowLeadingWildcards](./kibana-plugin-plugins-data-server.esqueryconfig.allowleadingwildcards.md) + +## EsQueryConfig.allowLeadingWildcards property + +Signature: + +```typescript +allowLeadingWildcards: boolean; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.esqueryconfig.dateformattz.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.esqueryconfig.dateformattz.md new file mode 100644 index 0000000000000..d3e86f19709f8 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.esqueryconfig.dateformattz.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [EsQueryConfig](./kibana-plugin-plugins-data-server.esqueryconfig.md) > [dateFormatTZ](./kibana-plugin-plugins-data-server.esqueryconfig.dateformattz.md) + +## EsQueryConfig.dateFormatTZ property + +Signature: + +```typescript +dateFormatTZ?: string; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.esqueryconfig.ignorefilteriffieldnotinindex.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.esqueryconfig.ignorefilteriffieldnotinindex.md new file mode 100644 index 0000000000000..93b3e8915c482 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.esqueryconfig.ignorefilteriffieldnotinindex.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [EsQueryConfig](./kibana-plugin-plugins-data-server.esqueryconfig.md) > [ignoreFilterIfFieldNotInIndex](./kibana-plugin-plugins-data-server.esqueryconfig.ignorefilteriffieldnotinindex.md) + +## EsQueryConfig.ignoreFilterIfFieldNotInIndex property + +Signature: + +```typescript +ignoreFilterIfFieldNotInIndex: boolean; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.esqueryconfig.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.esqueryconfig.md new file mode 100644 index 0000000000000..9ae604e07cabd --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.esqueryconfig.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [EsQueryConfig](./kibana-plugin-plugins-data-server.esqueryconfig.md) + +## EsQueryConfig interface + +Signature: + +```typescript +export interface EsQueryConfig +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [allowLeadingWildcards](./kibana-plugin-plugins-data-server.esqueryconfig.allowleadingwildcards.md) | boolean | | +| [dateFormatTZ](./kibana-plugin-plugins-data-server.esqueryconfig.dateformattz.md) | string | | +| [ignoreFilterIfFieldNotInIndex](./kibana-plugin-plugins-data-server.esqueryconfig.ignorefilteriffieldnotinindex.md) | boolean | | +| [queryStringOptions](./kibana-plugin-plugins-data-server.esqueryconfig.querystringoptions.md) | Record<string, any> | | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.esqueryconfig.querystringoptions.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.esqueryconfig.querystringoptions.md new file mode 100644 index 0000000000000..437d36112d015 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.esqueryconfig.querystringoptions.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [EsQueryConfig](./kibana-plugin-plugins-data-server.esqueryconfig.md) > [queryStringOptions](./kibana-plugin-plugins-data-server.esqueryconfig.querystringoptions.md) + +## EsQueryConfig.queryStringOptions property + +Signature: + +```typescript +queryStringOptions: Record; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.fieldformatconfig.es.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.fieldformatconfig.es.md new file mode 100644 index 0000000000000..a3c3ddc4e1649 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.fieldformatconfig.es.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [FieldFormatConfig](./kibana-plugin-plugins-data-server.fieldformatconfig.md) > [es](./kibana-plugin-plugins-data-server.fieldformatconfig.es.md) + +## FieldFormatConfig.es property + +Signature: + +```typescript +es?: boolean; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.fieldformatconfig.id.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.fieldformatconfig.id.md new file mode 100644 index 0000000000000..c5173fba22533 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.fieldformatconfig.id.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [FieldFormatConfig](./kibana-plugin-plugins-data-server.fieldformatconfig.md) > [id](./kibana-plugin-plugins-data-server.fieldformatconfig.id.md) + +## FieldFormatConfig.id property + +Signature: + +```typescript +id: FieldFormatId; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.fieldformatconfig.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.fieldformatconfig.md new file mode 100644 index 0000000000000..5d5c13784bc57 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.fieldformatconfig.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [FieldFormatConfig](./kibana-plugin-plugins-data-server.fieldformatconfig.md) + +## FieldFormatConfig interface + +Signature: + +```typescript +export interface FieldFormatConfig +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [es](./kibana-plugin-plugins-data-server.fieldformatconfig.es.md) | boolean | | +| [id](./kibana-plugin-plugins-data-server.fieldformatconfig.id.md) | FieldFormatId | | +| [params](./kibana-plugin-plugins-data-server.fieldformatconfig.params.md) | Record<string, any> | | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.fieldformatconfig.params.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.fieldformatconfig.params.md new file mode 100644 index 0000000000000..c5e5faef30860 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.fieldformatconfig.params.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [FieldFormatConfig](./kibana-plugin-plugins-data-server.fieldformatconfig.md) > [params](./kibana-plugin-plugins-data-server.fieldformatconfig.params.md) + +## FieldFormatConfig.params property + +Signature: + +```typescript +params: Record; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.fieldformats.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.fieldformats.md new file mode 100644 index 0000000000000..1cc1d829d01cd --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.fieldformats.md @@ -0,0 +1,29 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [fieldFormats](./kibana-plugin-plugins-data-server.fieldformats.md) + +## fieldFormats variable + +Signature: + +```typescript +fieldFormats: { + FieldFormatsRegistry: typeof FieldFormatsRegistry; + FieldFormat: typeof FieldFormat; + serializeFieldFormat: (agg: import("../../../legacy/core_plugins/data/public/search").AggConfig) => import("../../expressions/common").SerializedFieldFormat; + BoolFormat: typeof BoolFormat; + BytesFormat: typeof BytesFormat; + ColorFormat: typeof ColorFormat; + DateNanosFormat: typeof DateNanosFormat; + DurationFormat: typeof DurationFormat; + IpFormat: typeof IpFormat; + NumberFormat: typeof NumberFormat; + PercentFormat: typeof PercentFormat; + RelativeDateFormat: typeof RelativeDateFormat; + SourceFormat: typeof SourceFormat; + StaticLookupFormat: typeof StaticLookupFormat; + UrlFormat: typeof UrlFormat; + StringFormat: typeof StringFormat; + TruncateFormat: typeof TruncateFormat; +} +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.fieldformatsgetconfigfn.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.fieldformatsgetconfigfn.md new file mode 100644 index 0000000000000..c8815ed42d3b3 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.fieldformatsgetconfigfn.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [FieldFormatsGetConfigFn](./kibana-plugin-plugins-data-server.fieldformatsgetconfigfn.md) + +## FieldFormatsGetConfigFn type + +Signature: + +```typescript +export declare type FieldFormatsGetConfigFn = (key: string, defaultOverride?: T) => T; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.filter._state.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.filter._state.md new file mode 100644 index 0000000000000..079f352609a70 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.filter._state.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [Filter](./kibana-plugin-plugins-data-server.filter.md) > [$state](./kibana-plugin-plugins-data-server.filter._state.md) + +## Filter.$state property + +Signature: + +```typescript +$state?: FilterState; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.filter.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.filter.md new file mode 100644 index 0000000000000..4e4c49b222f01 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.filter.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [Filter](./kibana-plugin-plugins-data-server.filter.md) + +## Filter interface + +Signature: + +```typescript +export interface Filter +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [$state](./kibana-plugin-plugins-data-server.filter._state.md) | FilterState | | +| [meta](./kibana-plugin-plugins-data-server.filter.meta.md) | FilterMeta | | +| [query](./kibana-plugin-plugins-data-server.filter.query.md) | any | | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.filter.meta.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.filter.meta.md new file mode 100644 index 0000000000000..6d11804704d82 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.filter.meta.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [Filter](./kibana-plugin-plugins-data-server.filter.md) > [meta](./kibana-plugin-plugins-data-server.filter.meta.md) + +## Filter.meta property + +Signature: + +```typescript +meta: FilterMeta; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.filter.query.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.filter.query.md new file mode 100644 index 0000000000000..942c7930f449d --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.filter.query.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [Filter](./kibana-plugin-plugins-data-server.filter.md) > [query](./kibana-plugin-plugins-data-server.filter.query.md) + +## Filter.query property + +Signature: + +```typescript +query?: any; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.getdefaultsearchparams.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.getdefaultsearchparams.md new file mode 100644 index 0000000000000..9de005c1fd0dd --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.getdefaultsearchparams.md @@ -0,0 +1,30 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [getDefaultSearchParams](./kibana-plugin-plugins-data-server.getdefaultsearchparams.md) + +## getDefaultSearchParams() function + +Signature: + +```typescript +export declare function getDefaultSearchParams(config: SharedGlobalConfig): { + timeout: string; + ignoreUnavailable: boolean; + restTotalHitsAsInt: boolean; +}; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| config | SharedGlobalConfig | | + +Returns: + +`{ + timeout: string; + ignoreUnavailable: boolean; + restTotalHitsAsInt: boolean; +}` + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.icancel.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.icancel.md new file mode 100644 index 0000000000000..27141c68ae1a7 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.icancel.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [ICancel](./kibana-plugin-plugins-data-server.icancel.md) + +## ICancel type + +Signature: + +```typescript +export declare type ICancel = (id: string) => Promise; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldformatsregistry.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldformatsregistry.md new file mode 100644 index 0000000000000..c284d2c87fcaa --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldformatsregistry.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IFieldFormatsRegistry](./kibana-plugin-plugins-data-server.ifieldformatsregistry.md) + +## IFieldFormatsRegistry type + +Signature: + +```typescript +declare type IFieldFormatsRegistry = PublicMethodsOf; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldsubtype.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldsubtype.md new file mode 100644 index 0000000000000..70140e51a7316 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldsubtype.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IFieldSubType](./kibana-plugin-plugins-data-server.ifieldsubtype.md) + +## IFieldSubType interface + +Signature: + +```typescript +export interface IFieldSubType +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [multi](./kibana-plugin-plugins-data-server.ifieldsubtype.multi.md) | {
parent: string;
} | | +| [nested](./kibana-plugin-plugins-data-server.ifieldsubtype.nested.md) | {
path: string;
} | | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldsubtype.multi.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldsubtype.multi.md new file mode 100644 index 0000000000000..31a3bc53d6343 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldsubtype.multi.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IFieldSubType](./kibana-plugin-plugins-data-server.ifieldsubtype.md) > [multi](./kibana-plugin-plugins-data-server.ifieldsubtype.multi.md) + +## IFieldSubType.multi property + +Signature: + +```typescript +multi?: { + parent: string; + }; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldsubtype.nested.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldsubtype.nested.md new file mode 100644 index 0000000000000..b53a4406aedc2 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldsubtype.nested.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IFieldSubType](./kibana-plugin-plugins-data-server.ifieldsubtype.md) > [nested](./kibana-plugin-plugins-data-server.ifieldsubtype.nested.md) + +## IFieldSubType.nested property + +Signature: + +```typescript +nested?: { + path: string; + }; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.aggregatable.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.aggregatable.md new file mode 100644 index 0000000000000..74ea0e0181a11 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.aggregatable.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IFieldType](./kibana-plugin-plugins-data-server.ifieldtype.md) > [aggregatable](./kibana-plugin-plugins-data-server.ifieldtype.aggregatable.md) + +## IFieldType.aggregatable property + +Signature: + +```typescript +aggregatable?: boolean; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.count.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.count.md new file mode 100644 index 0000000000000..81dfce2024fc9 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.count.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IFieldType](./kibana-plugin-plugins-data-server.ifieldtype.md) > [count](./kibana-plugin-plugins-data-server.ifieldtype.count.md) + +## IFieldType.count property + +Signature: + +```typescript +count?: number; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.displayname.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.displayname.md new file mode 100644 index 0000000000000..b00f829c8909d --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.displayname.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IFieldType](./kibana-plugin-plugins-data-server.ifieldtype.md) > [displayName](./kibana-plugin-plugins-data-server.ifieldtype.displayname.md) + +## IFieldType.displayName property + +Signature: + +```typescript +displayName?: string; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.estypes.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.estypes.md new file mode 100644 index 0000000000000..779e3d0ecedf4 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.estypes.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IFieldType](./kibana-plugin-plugins-data-server.ifieldtype.md) > [esTypes](./kibana-plugin-plugins-data-server.ifieldtype.estypes.md) + +## IFieldType.esTypes property + +Signature: + +```typescript +esTypes?: string[]; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.filterable.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.filterable.md new file mode 100644 index 0000000000000..eaf8e91e0fe7d --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.filterable.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IFieldType](./kibana-plugin-plugins-data-server.ifieldtype.md) > [filterable](./kibana-plugin-plugins-data-server.ifieldtype.filterable.md) + +## IFieldType.filterable property + +Signature: + +```typescript +filterable?: boolean; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.format.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.format.md new file mode 100644 index 0000000000000..afdbfc9b65d05 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.format.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IFieldType](./kibana-plugin-plugins-data-server.ifieldtype.md) > [format](./kibana-plugin-plugins-data-server.ifieldtype.format.md) + +## IFieldType.format property + +Signature: + +```typescript +format?: any; +``` 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 new file mode 100644 index 0000000000000..d033804cb6fcb --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.lang.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IFieldType](./kibana-plugin-plugins-data-server.ifieldtype.md) > [lang](./kibana-plugin-plugins-data-server.ifieldtype.lang.md) + +## IFieldType.lang property + +Signature: + +```typescript +lang?: string; +``` 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 new file mode 100644 index 0000000000000..5375cf2a2ef43 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.md @@ -0,0 +1,33 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IFieldType](./kibana-plugin-plugins-data-server.ifieldtype.md) + +## IFieldType interface + +Signature: + +```typescript +export interface IFieldType +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [aggregatable](./kibana-plugin-plugins-data-server.ifieldtype.aggregatable.md) | boolean | | +| [count](./kibana-plugin-plugins-data-server.ifieldtype.count.md) | number | | +| [displayName](./kibana-plugin-plugins-data-server.ifieldtype.displayname.md) | string | | +| [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 | | +| [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 | | +| [scripted](./kibana-plugin-plugins-data-server.ifieldtype.scripted.md) | boolean | | +| [searchable](./kibana-plugin-plugins-data-server.ifieldtype.searchable.md) | boolean | | +| [sortable](./kibana-plugin-plugins-data-server.ifieldtype.sortable.md) | boolean | | +| [subType](./kibana-plugin-plugins-data-server.ifieldtype.subtype.md) | IFieldSubType | | +| [type](./kibana-plugin-plugins-data-server.ifieldtype.type.md) | string | | +| [visualizable](./kibana-plugin-plugins-data-server.ifieldtype.visualizable.md) | boolean | | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.name.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.name.md new file mode 100644 index 0000000000000..8be33a3f56d97 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.name.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IFieldType](./kibana-plugin-plugins-data-server.ifieldtype.md) > [name](./kibana-plugin-plugins-data-server.ifieldtype.name.md) + +## IFieldType.name property + +Signature: + +```typescript +name: string; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.readfromdocvalues.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.readfromdocvalues.md new file mode 100644 index 0000000000000..a77ce1821ed92 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.readfromdocvalues.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IFieldType](./kibana-plugin-plugins-data-server.ifieldtype.md) > [readFromDocValues](./kibana-plugin-plugins-data-server.ifieldtype.readfromdocvalues.md) + +## IFieldType.readFromDocValues property + +Signature: + +```typescript +readFromDocValues?: boolean; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.script.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.script.md new file mode 100644 index 0000000000000..b54a952a11253 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.script.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IFieldType](./kibana-plugin-plugins-data-server.ifieldtype.md) > [script](./kibana-plugin-plugins-data-server.ifieldtype.script.md) + +## IFieldType.script property + +Signature: + +```typescript +script?: string; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.scripted.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.scripted.md new file mode 100644 index 0000000000000..f7a8ed9aee0df --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.scripted.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IFieldType](./kibana-plugin-plugins-data-server.ifieldtype.md) > [scripted](./kibana-plugin-plugins-data-server.ifieldtype.scripted.md) + +## IFieldType.scripted property + +Signature: + +```typescript +scripted?: boolean; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.searchable.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.searchable.md new file mode 100644 index 0000000000000..002a48b60ec7d --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.searchable.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IFieldType](./kibana-plugin-plugins-data-server.ifieldtype.md) > [searchable](./kibana-plugin-plugins-data-server.ifieldtype.searchable.md) + +## IFieldType.searchable property + +Signature: + +```typescript +searchable?: boolean; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.sortable.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.sortable.md new file mode 100644 index 0000000000000..c6c8bffc743be --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.sortable.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IFieldType](./kibana-plugin-plugins-data-server.ifieldtype.md) > [sortable](./kibana-plugin-plugins-data-server.ifieldtype.sortable.md) + +## IFieldType.sortable property + +Signature: + +```typescript +sortable?: boolean; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.subtype.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.subtype.md new file mode 100644 index 0000000000000..fa78b23a2b558 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.subtype.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IFieldType](./kibana-plugin-plugins-data-server.ifieldtype.md) > [subType](./kibana-plugin-plugins-data-server.ifieldtype.subtype.md) + +## IFieldType.subType property + +Signature: + +```typescript +subType?: IFieldSubType; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.type.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.type.md new file mode 100644 index 0000000000000..ef6a4dcc167c5 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.type.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IFieldType](./kibana-plugin-plugins-data-server.ifieldtype.md) > [type](./kibana-plugin-plugins-data-server.ifieldtype.type.md) + +## IFieldType.type property + +Signature: + +```typescript +type: string; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.visualizable.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.visualizable.md new file mode 100644 index 0000000000000..3d0987f685db4 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.visualizable.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IFieldType](./kibana-plugin-plugins-data-server.ifieldtype.md) > [visualizable](./kibana-plugin-plugins-data-server.ifieldtype.visualizable.md) + +## IFieldType.visualizable property + +Signature: + +```typescript +visualizable?: boolean; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.fieldformatmap.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.fieldformatmap.md new file mode 100644 index 0000000000000..ab9e3171d7d7b --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.fieldformatmap.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IIndexPattern](./kibana-plugin-plugins-data-server.iindexpattern.md) > [fieldFormatMap](./kibana-plugin-plugins-data-server.iindexpattern.fieldformatmap.md) + +## IIndexPattern.fieldFormatMap property + +Signature: + +```typescript +fieldFormatMap?: Record; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.fields.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.fields.md new file mode 100644 index 0000000000000..fb6d046ff2174 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.fields.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IIndexPattern](./kibana-plugin-plugins-data-server.iindexpattern.md) > [fields](./kibana-plugin-plugins-data-server.iindexpattern.fields.md) + +## IIndexPattern.fields property + +Signature: + +```typescript +fields: IFieldType[]; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.id.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.id.md new file mode 100644 index 0000000000000..cac263df0f9aa --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.id.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IIndexPattern](./kibana-plugin-plugins-data-server.iindexpattern.md) > [id](./kibana-plugin-plugins-data-server.iindexpattern.id.md) + +## IIndexPattern.id property + +Signature: + +```typescript +id?: string; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.md new file mode 100644 index 0000000000000..24b56a9b98621 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IIndexPattern](./kibana-plugin-plugins-data-server.iindexpattern.md) + +## IIndexPattern interface + +Signature: + +```typescript +export interface IIndexPattern +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [fieldFormatMap](./kibana-plugin-plugins-data-server.iindexpattern.fieldformatmap.md) | Record<string, {
id: string;
params: unknown;
}> | | +| [fields](./kibana-plugin-plugins-data-server.iindexpattern.fields.md) | IFieldType[] | | +| [id](./kibana-plugin-plugins-data-server.iindexpattern.id.md) | string | | +| [timeFieldName](./kibana-plugin-plugins-data-server.iindexpattern.timefieldname.md) | string | | +| [title](./kibana-plugin-plugins-data-server.iindexpattern.title.md) | string | | +| [type](./kibana-plugin-plugins-data-server.iindexpattern.type.md) | string | | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.timefieldname.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.timefieldname.md new file mode 100644 index 0000000000000..14cf514477da4 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.timefieldname.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IIndexPattern](./kibana-plugin-plugins-data-server.iindexpattern.md) > [timeFieldName](./kibana-plugin-plugins-data-server.iindexpattern.timefieldname.md) + +## IIndexPattern.timeFieldName property + +Signature: + +```typescript +timeFieldName?: string; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.title.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.title.md new file mode 100644 index 0000000000000..119963d7ff95d --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.title.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IIndexPattern](./kibana-plugin-plugins-data-server.iindexpattern.md) > [title](./kibana-plugin-plugins-data-server.iindexpattern.title.md) + +## IIndexPattern.title property + +Signature: + +```typescript +title: string; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.type.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.type.md new file mode 100644 index 0000000000000..6b89b71664b23 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.type.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IIndexPattern](./kibana-plugin-plugins-data-server.iindexpattern.md) > [type](./kibana-plugin-plugins-data-server.iindexpattern.type.md) + +## IIndexPattern.type property + +Signature: + +```typescript +type?: string; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternattributes.fields.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternattributes.fields.md new file mode 100644 index 0000000000000..58a4066c02b20 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternattributes.fields.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IndexPatternAttributes](./kibana-plugin-plugins-data-server.indexpatternattributes.md) > [fields](./kibana-plugin-plugins-data-server.indexpatternattributes.fields.md) + +## IndexPatternAttributes.fields property + +Signature: + +```typescript +fields: string; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternattributes.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternattributes.md new file mode 100644 index 0000000000000..1fcc49796f59e --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternattributes.md @@ -0,0 +1,28 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IndexPatternAttributes](./kibana-plugin-plugins-data-server.indexpatternattributes.md) + +## IndexPatternAttributes interface + +> Warning: This API is now obsolete. +> +> + +Use data plugin interface instead + +Signature: + +```typescript +export interface IndexPatternAttributes +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [fields](./kibana-plugin-plugins-data-server.indexpatternattributes.fields.md) | string | | +| [timeFieldName](./kibana-plugin-plugins-data-server.indexpatternattributes.timefieldname.md) | string | | +| [title](./kibana-plugin-plugins-data-server.indexpatternattributes.title.md) | string | | +| [type](./kibana-plugin-plugins-data-server.indexpatternattributes.type.md) | string | | +| [typeMeta](./kibana-plugin-plugins-data-server.indexpatternattributes.typemeta.md) | string | | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternattributes.timefieldname.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternattributes.timefieldname.md new file mode 100644 index 0000000000000..8e5f765020af4 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternattributes.timefieldname.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IndexPatternAttributes](./kibana-plugin-plugins-data-server.indexpatternattributes.md) > [timeFieldName](./kibana-plugin-plugins-data-server.indexpatternattributes.timefieldname.md) + +## IndexPatternAttributes.timeFieldName property + +Signature: + +```typescript +timeFieldName?: string; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternattributes.title.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternattributes.title.md new file mode 100644 index 0000000000000..28e4fd418fabc --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternattributes.title.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IndexPatternAttributes](./kibana-plugin-plugins-data-server.indexpatternattributes.md) > [title](./kibana-plugin-plugins-data-server.indexpatternattributes.title.md) + +## IndexPatternAttributes.title property + +Signature: + +```typescript +title: string; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternattributes.type.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternattributes.type.md new file mode 100644 index 0000000000000..e88be8fd31246 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternattributes.type.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IndexPatternAttributes](./kibana-plugin-plugins-data-server.indexpatternattributes.md) > [type](./kibana-plugin-plugins-data-server.indexpatternattributes.type.md) + +## IndexPatternAttributes.type property + +Signature: + +```typescript +type: string; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternattributes.typemeta.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternattributes.typemeta.md new file mode 100644 index 0000000000000..44fee7c1a6317 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternattributes.typemeta.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IndexPatternAttributes](./kibana-plugin-plugins-data-server.indexpatternattributes.md) > [typeMeta](./kibana-plugin-plugins-data-server.indexpatternattributes.typemeta.md) + +## IndexPatternAttributes.typeMeta property + +Signature: + +```typescript +typeMeta: string; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.aggregatable.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.aggregatable.md new file mode 100644 index 0000000000000..92994b851ec85 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.aggregatable.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IndexPatternFieldDescriptor](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.md) > [aggregatable](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.aggregatable.md) + +## IndexPatternFieldDescriptor.aggregatable property + +Signature: + +```typescript +aggregatable: boolean; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.estypes.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.estypes.md new file mode 100644 index 0000000000000..f24ba9a48d85e --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.estypes.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IndexPatternFieldDescriptor](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.md) > [esTypes](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.estypes.md) + +## IndexPatternFieldDescriptor.esTypes property + +Signature: + +```typescript +esTypes: string[]; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.md new file mode 100644 index 0000000000000..d84d0cba06ac6 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IndexPatternFieldDescriptor](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.md) + +## IndexPatternFieldDescriptor interface + +Signature: + +```typescript +export interface FieldDescriptor +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [aggregatable](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.aggregatable.md) | boolean | | +| [esTypes](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.estypes.md) | string[] | | +| [name](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.name.md) | string | | +| [readFromDocValues](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.readfromdocvalues.md) | boolean | | +| [searchable](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.searchable.md) | boolean | | +| [subType](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.subtype.md) | FieldSubType | | +| [type](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.type.md) | string | | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.name.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.name.md new file mode 100644 index 0000000000000..16ea60c5b8ae2 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.name.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IndexPatternFieldDescriptor](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.md) > [name](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.name.md) + +## IndexPatternFieldDescriptor.name property + +Signature: + +```typescript +name: string; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.readfromdocvalues.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.readfromdocvalues.md new file mode 100644 index 0000000000000..fc8667196c879 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.readfromdocvalues.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IndexPatternFieldDescriptor](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.md) > [readFromDocValues](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.readfromdocvalues.md) + +## IndexPatternFieldDescriptor.readFromDocValues property + +Signature: + +```typescript +readFromDocValues: boolean; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.searchable.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.searchable.md new file mode 100644 index 0000000000000..7d159c65b40bd --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.searchable.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IndexPatternFieldDescriptor](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.md) > [searchable](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.searchable.md) + +## IndexPatternFieldDescriptor.searchable property + +Signature: + +```typescript +searchable: boolean; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.subtype.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.subtype.md new file mode 100644 index 0000000000000..7053eaf08138c --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.subtype.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IndexPatternFieldDescriptor](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.md) > [subType](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.subtype.md) + +## IndexPatternFieldDescriptor.subType property + +Signature: + +```typescript +subType?: FieldSubType; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.type.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.type.md new file mode 100644 index 0000000000000..bb571d1bee14a --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternfielddescriptor.type.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IndexPatternFieldDescriptor](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.md) > [type](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.type.md) + +## IndexPatternFieldDescriptor.type property + +Signature: + +```typescript +type: string; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatterns.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatterns.md new file mode 100644 index 0000000000000..935d7fbacf946 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatterns.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [indexPatterns](./kibana-plugin-plugins-data-server.indexpatterns.md) + +## indexPatterns variable + +Signature: + +```typescript +indexPatterns: { + isFilterable: typeof isFilterable; + isNestedField: typeof isNestedField; +} +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternsfetcher._constructor_.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternsfetcher._constructor_.md new file mode 100644 index 0000000000000..f9bbcc5a356e1 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternsfetcher._constructor_.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IndexPatternsFetcher](./kibana-plugin-plugins-data-server.indexpatternsfetcher.md) > [(constructor)](./kibana-plugin-plugins-data-server.indexpatternsfetcher._constructor_.md) + +## IndexPatternsFetcher.(constructor) + +Constructs a new instance of the `IndexPatternsFetcher` class + +Signature: + +```typescript +constructor(callDataCluster: APICaller); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| callDataCluster | APICaller | | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternsfetcher.getfieldsfortimepattern.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternsfetcher.getfieldsfortimepattern.md new file mode 100644 index 0000000000000..7d765d4c65eb1 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternsfetcher.getfieldsfortimepattern.md @@ -0,0 +1,29 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IndexPatternsFetcher](./kibana-plugin-plugins-data-server.indexpatternsfetcher.md) > [getFieldsForTimePattern](./kibana-plugin-plugins-data-server.indexpatternsfetcher.getfieldsfortimepattern.md) + +## IndexPatternsFetcher.getFieldsForTimePattern() method + +Get a list of field objects for a time pattern + +Signature: + +```typescript +getFieldsForTimePattern(options: { + pattern: string; + metaFields: string[]; + lookBack: number; + interval: string; + }): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| options | {
pattern: string;
metaFields: string[];
lookBack: number;
interval: string;
} | | + +Returns: + +`Promise` + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternsfetcher.getfieldsforwildcard.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternsfetcher.getfieldsforwildcard.md new file mode 100644 index 0000000000000..6bd3bbf2433cd --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternsfetcher.getfieldsforwildcard.md @@ -0,0 +1,27 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IndexPatternsFetcher](./kibana-plugin-plugins-data-server.indexpatternsfetcher.md) > [getFieldsForWildcard](./kibana-plugin-plugins-data-server.indexpatternsfetcher.getfieldsforwildcard.md) + +## IndexPatternsFetcher.getFieldsForWildcard() method + +Get a list of field objects for an index pattern that may contain wildcards + +Signature: + +```typescript +getFieldsForWildcard(options: { + pattern: string | string[]; + metaFields?: string[]; + }): Promise; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| options | {
pattern: string | string[];
metaFields?: string[];
} | | + +Returns: + +`Promise` + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternsfetcher.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternsfetcher.md new file mode 100644 index 0000000000000..f71a702f3381d --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternsfetcher.md @@ -0,0 +1,25 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IndexPatternsFetcher](./kibana-plugin-plugins-data-server.indexpatternsfetcher.md) + +## IndexPatternsFetcher class + +Signature: + +```typescript +export declare class IndexPatternsFetcher +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(callDataCluster)](./kibana-plugin-plugins-data-server.indexpatternsfetcher._constructor_.md) | | Constructs a new instance of the IndexPatternsFetcher class | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [getFieldsForTimePattern(options)](./kibana-plugin-plugins-data-server.indexpatternsfetcher.getfieldsfortimepattern.md) | | Get a list of field objects for a time pattern | +| [getFieldsForWildcard(options)](./kibana-plugin-plugins-data-server.indexpatternsfetcher.getfieldsforwildcard.md) | | Get a list of field objects for an index pattern that may contain wildcards | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.irequesttypesmap.es.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.irequesttypesmap.es.md new file mode 100644 index 0000000000000..9cebff05dc9db --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.irequesttypesmap.es.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IRequestTypesMap](./kibana-plugin-plugins-data-server.irequesttypesmap.md) > [es](./kibana-plugin-plugins-data-server.irequesttypesmap.es.md) + +## IRequestTypesMap.es property + +Signature: + +```typescript +[ES_SEARCH_STRATEGY]: IEsSearchRequest; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.irequesttypesmap.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.irequesttypesmap.md new file mode 100644 index 0000000000000..a9bb8f1eb9d6d --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.irequesttypesmap.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IRequestTypesMap](./kibana-plugin-plugins-data-server.irequesttypesmap.md) + +## IRequestTypesMap interface + +Signature: + +```typescript +export interface IRequestTypesMap +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [es](./kibana-plugin-plugins-data-server.irequesttypesmap.es.md) | IEsSearchRequest | | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iresponsetypesmap.es.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iresponsetypesmap.es.md new file mode 100644 index 0000000000000..1154fc141d6c7 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iresponsetypesmap.es.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IResponseTypesMap](./kibana-plugin-plugins-data-server.iresponsetypesmap.md) > [es](./kibana-plugin-plugins-data-server.iresponsetypesmap.es.md) + +## IResponseTypesMap.es property + +Signature: + +```typescript +[ES_SEARCH_STRATEGY]: IEsSearchResponse; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iresponsetypesmap.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iresponsetypesmap.md new file mode 100644 index 0000000000000..fe5fa0a5d3a33 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iresponsetypesmap.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IResponseTypesMap](./kibana-plugin-plugins-data-server.iresponsetypesmap.md) + +## IResponseTypesMap interface + +Signature: + +```typescript +export interface IResponseTypesMap +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [es](./kibana-plugin-plugins-data-server.iresponsetypesmap.es.md) | IEsSearchResponse | | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.isearch.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.isearch.md new file mode 100644 index 0000000000000..6e037f5161b53 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.isearch.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [ISearch](./kibana-plugin-plugins-data-server.isearch.md) + +## ISearch type + +Signature: + +```typescript +export declare type ISearch = (request: IRequestTypesMap[T], options?: ISearchOptions) => Promise; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.isearchcontext.config_.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.isearchcontext.config_.md new file mode 100644 index 0000000000000..364d44dba758a --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.isearchcontext.config_.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [ISearchContext](./kibana-plugin-plugins-data-server.isearchcontext.md) > [config$](./kibana-plugin-plugins-data-server.isearchcontext.config_.md) + +## ISearchContext.config$ property + +Signature: + +```typescript +config$: Observable; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.isearchcontext.core.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.isearchcontext.core.md new file mode 100644 index 0000000000000..9d571c25d94bd --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.isearchcontext.core.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [ISearchContext](./kibana-plugin-plugins-data-server.isearchcontext.md) > [core](./kibana-plugin-plugins-data-server.isearchcontext.core.md) + +## ISearchContext.core property + +Signature: + +```typescript +core: CoreSetup; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.isearchcontext.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.isearchcontext.md new file mode 100644 index 0000000000000..1c3c5ec78f894 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.isearchcontext.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [ISearchContext](./kibana-plugin-plugins-data-server.isearchcontext.md) + +## ISearchContext interface + +Signature: + +```typescript +export interface ISearchContext +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [config$](./kibana-plugin-plugins-data-server.isearchcontext.config_.md) | Observable<SharedGlobalConfig> | | +| [core](./kibana-plugin-plugins-data-server.isearchcontext.core.md) | CoreSetup | | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.isearchoptions.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.isearchoptions.md new file mode 100644 index 0000000000000..0319048f4418b --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.isearchoptions.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [ISearchOptions](./kibana-plugin-plugins-data-server.isearchoptions.md) + +## ISearchOptions interface + +Signature: + +```typescript +export interface ISearchOptions +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [signal](./kibana-plugin-plugins-data-server.isearchoptions.signal.md) | AbortSignal | | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.isearchoptions.signal.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.isearchoptions.signal.md new file mode 100644 index 0000000000000..7da5c182b2e0f --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.isearchoptions.signal.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [ISearchOptions](./kibana-plugin-plugins-data-server.isearchoptions.md) > [signal](./kibana-plugin-plugins-data-server.isearchoptions.signal.md) + +## ISearchOptions.signal property + +Signature: + +```typescript +signal?: AbortSignal; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.kbn_field_types.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.kbn_field_types.md new file mode 100644 index 0000000000000..40b81d2f6ac4d --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.kbn_field_types.md @@ -0,0 +1,33 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [KBN\_FIELD\_TYPES](./kibana-plugin-plugins-data-server.kbn_field_types.md) + +## KBN\_FIELD\_TYPES enum + +\* + +Signature: + +```typescript +export declare enum KBN_FIELD_TYPES +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| \_SOURCE | "_source" | | +| ATTACHMENT | "attachment" | | +| BOOLEAN | "boolean" | | +| CONFLICT | "conflict" | | +| DATE | "date" | | +| GEO\_POINT | "geo_point" | | +| GEO\_SHAPE | "geo_shape" | | +| IP | "ip" | | +| MURMUR3 | "murmur3" | | +| NESTED | "nested" | | +| NUMBER | "number" | | +| OBJECT | "object" | | +| STRING | "string" | | +| UNKNOWN | "unknown" | | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.kuerynode.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.kuerynode.md new file mode 100644 index 0000000000000..3a258a5b98616 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.kuerynode.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [KueryNode](./kibana-plugin-plugins-data-server.kuerynode.md) + +## KueryNode interface + +Signature: + +```typescript +export interface KueryNode +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [type](./kibana-plugin-plugins-data-server.kuerynode.type.md) | keyof NodeTypes | | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.kuerynode.type.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.kuerynode.type.md new file mode 100644 index 0000000000000..192a2c05191c7 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.kuerynode.type.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [KueryNode](./kibana-plugin-plugins-data-server.kuerynode.md) > [type](./kibana-plugin-plugins-data-server.kuerynode.type.md) + +## KueryNode.type property + +Signature: + +```typescript +type: keyof NodeTypes; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.md new file mode 100644 index 0000000000000..507e60971526b --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.md @@ -0,0 +1,73 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) + +## kibana-plugin-plugins-data-server package + +## Classes + +| Class | Description | +| --- | --- | +| [IndexPatternsFetcher](./kibana-plugin-plugins-data-server.indexpatternsfetcher.md) | | +| [Plugin](./kibana-plugin-plugins-data-server.plugin.md) | | + +## Enumerations + +| Enumeration | Description | +| --- | --- | +| [ES\_FIELD\_TYPES](./kibana-plugin-plugins-data-server.es_field_types.md) | \* | +| [KBN\_FIELD\_TYPES](./kibana-plugin-plugins-data-server.kbn_field_types.md) | \* | + +## Functions + +| Function | Description | +| --- | --- | +| [getDefaultSearchParams(config)](./kibana-plugin-plugins-data-server.getdefaultsearchparams.md) | | +| [parseInterval(interval)](./kibana-plugin-plugins-data-server.parseinterval.md) | | +| [plugin(initializerContext)](./kibana-plugin-plugins-data-server.plugin.md) | Static code to be shared externally | +| [shouldReadFieldFromDocValues(aggregatable, esType)](./kibana-plugin-plugins-data-server.shouldreadfieldfromdocvalues.md) | | + +## Interfaces + +| Interface | Description | +| --- | --- | +| [EsQueryConfig](./kibana-plugin-plugins-data-server.esqueryconfig.md) | | +| [FieldFormatConfig](./kibana-plugin-plugins-data-server.fieldformatconfig.md) | | +| [Filter](./kibana-plugin-plugins-data-server.filter.md) | | +| [IFieldSubType](./kibana-plugin-plugins-data-server.ifieldsubtype.md) | | +| [IFieldType](./kibana-plugin-plugins-data-server.ifieldtype.md) | | +| [IIndexPattern](./kibana-plugin-plugins-data-server.iindexpattern.md) | | +| [IndexPatternAttributes](./kibana-plugin-plugins-data-server.indexpatternattributes.md) | Use data plugin interface instead | +| [IndexPatternFieldDescriptor](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.md) | | +| [IRequestTypesMap](./kibana-plugin-plugins-data-server.irequesttypesmap.md) | | +| [IResponseTypesMap](./kibana-plugin-plugins-data-server.iresponsetypesmap.md) | | +| [ISearchContext](./kibana-plugin-plugins-data-server.isearchcontext.md) | | +| [ISearchOptions](./kibana-plugin-plugins-data-server.isearchoptions.md) | | +| [KueryNode](./kibana-plugin-plugins-data-server.kuerynode.md) | | +| [PluginSetup](./kibana-plugin-plugins-data-server.pluginsetup.md) | | +| [PluginStart](./kibana-plugin-plugins-data-server.pluginstart.md) | | +| [Query](./kibana-plugin-plugins-data-server.query.md) | | +| [RefreshInterval](./kibana-plugin-plugins-data-server.refreshinterval.md) | | +| [TimeRange](./kibana-plugin-plugins-data-server.timerange.md) | | + +## Variables + +| Variable | Description | +| --- | --- | +| [castEsToKbnFieldTypeName](./kibana-plugin-plugins-data-server.castestokbnfieldtypename.md) | Get the KbnFieldType name for an esType string | +| [esFilters](./kibana-plugin-plugins-data-server.esfilters.md) | | +| [esKuery](./kibana-plugin-plugins-data-server.eskuery.md) | | +| [esQuery](./kibana-plugin-plugins-data-server.esquery.md) | | +| [fieldFormats](./kibana-plugin-plugins-data-server.fieldformats.md) | | +| [indexPatterns](./kibana-plugin-plugins-data-server.indexpatterns.md) | | + +## Type Aliases + +| Type Alias | Description | +| --- | --- | +| [FieldFormatsGetConfigFn](./kibana-plugin-plugins-data-server.fieldformatsgetconfigfn.md) | | +| [ICancel](./kibana-plugin-plugins-data-server.icancel.md) | | +| [IFieldFormatsRegistry](./kibana-plugin-plugins-data-server.ifieldformatsregistry.md) | | +| [ISearch](./kibana-plugin-plugins-data-server.isearch.md) | | +| [TSearchStrategyProvider](./kibana-plugin-plugins-data-server.tsearchstrategyprovider.md) | Search strategy provider creates an instance of a search strategy with the request handler context bound to it. This way every search strategy can use whatever information they require from the request context. | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.parseinterval.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.parseinterval.md new file mode 100644 index 0000000000000..c0cb9862973d7 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.parseinterval.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [parseInterval](./kibana-plugin-plugins-data-server.parseinterval.md) + +## parseInterval() function + +Signature: + +```typescript +export declare function parseInterval(interval: string): moment.Duration | null; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| interval | string | | + +Returns: + +`moment.Duration | null` + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin._constructor_.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin._constructor_.md new file mode 100644 index 0000000000000..454d8a059a252 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin._constructor_.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [Plugin](./kibana-plugin-plugins-data-server.plugin.md) > [(constructor)](./kibana-plugin-plugins-data-server.plugin._constructor_.md) + +## Plugin.(constructor) + +Constructs a new instance of the `DataServerPlugin` class + +Signature: + +```typescript +constructor(initializerContext: PluginInitializerContext); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| initializerContext | PluginInitializerContext | | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin.md new file mode 100644 index 0000000000000..b3ba75ce29ab6 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [plugin](./kibana-plugin-plugins-data-server.plugin.md) + +## plugin() function + +Static code to be shared externally + +Signature: + +```typescript +export declare function plugin(initializerContext: PluginInitializerContext): DataServerPlugin; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| initializerContext | PluginInitializerContext | | + +Returns: + +`DataServerPlugin` + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin.setup.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin.setup.md new file mode 100644 index 0000000000000..5c2f542204079 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin.setup.md @@ -0,0 +1,33 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [Plugin](./kibana-plugin-plugins-data-server.plugin.md) > [setup](./kibana-plugin-plugins-data-server.plugin.setup.md) + +## Plugin.setup() method + +Signature: + +```typescript +setup(core: CoreSetup, { usageCollection }: DataPluginSetupDependencies): { + fieldFormats: { + register: (customFieldFormat: import("../common").IFieldFormatType) => number; + }; + search: ISearchSetup; + }; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| core | CoreSetup | | +| { usageCollection } | DataPluginSetupDependencies | | + +Returns: + +`{ + fieldFormats: { + register: (customFieldFormat: import("../common").IFieldFormatType) => number; + }; + search: ISearchSetup; + }` + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin.start.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin.start.md new file mode 100644 index 0000000000000..2a30cd3e68158 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin.start.md @@ -0,0 +1,30 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [Plugin](./kibana-plugin-plugins-data-server.plugin.md) > [start](./kibana-plugin-plugins-data-server.plugin.start.md) + +## Plugin.start() method + +Signature: + +```typescript +start(core: CoreStart): { + fieldFormats: { + fieldFormatServiceFactory: (uiSettings: import("kibana/server").IUiSettingsClient) => Promise; + }; + }; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| core | CoreStart | | + +Returns: + +`{ + fieldFormats: { + fieldFormatServiceFactory: (uiSettings: import("kibana/server").IUiSettingsClient) => Promise; + }; + }` + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin.stop.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin.stop.md new file mode 100644 index 0000000000000..4b5b54f64128c --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin.stop.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [Plugin](./kibana-plugin-plugins-data-server.plugin.md) > [stop](./kibana-plugin-plugins-data-server.plugin.stop.md) + +## Plugin.stop() method + +Signature: + +```typescript +stop(): void; +``` +Returns: + +`void` + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.pluginsetup.fieldformats.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.pluginsetup.fieldformats.md new file mode 100644 index 0000000000000..648e23e597f4d --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.pluginsetup.fieldformats.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [PluginSetup](./kibana-plugin-plugins-data-server.pluginsetup.md) > [fieldFormats](./kibana-plugin-plugins-data-server.pluginsetup.fieldformats.md) + +## PluginSetup.fieldFormats property + +Signature: + +```typescript +fieldFormats: FieldFormatsSetup; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.pluginsetup.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.pluginsetup.md new file mode 100644 index 0000000000000..fa289c0a3f4bd --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.pluginsetup.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [PluginSetup](./kibana-plugin-plugins-data-server.pluginsetup.md) + +## PluginSetup interface + +Signature: + +```typescript +export interface DataPluginSetup +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [fieldFormats](./kibana-plugin-plugins-data-server.pluginsetup.fieldformats.md) | FieldFormatsSetup | | +| [search](./kibana-plugin-plugins-data-server.pluginsetup.search.md) | ISearchSetup | | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.pluginsetup.search.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.pluginsetup.search.md new file mode 100644 index 0000000000000..eb1107604113b --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.pluginsetup.search.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [PluginSetup](./kibana-plugin-plugins-data-server.pluginsetup.md) > [search](./kibana-plugin-plugins-data-server.pluginsetup.search.md) + +## PluginSetup.search property + +Signature: + +```typescript +search: ISearchSetup; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.pluginstart.fieldformats.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.pluginstart.fieldformats.md new file mode 100644 index 0000000000000..7a77c6c943cd7 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.pluginstart.fieldformats.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [PluginStart](./kibana-plugin-plugins-data-server.pluginstart.md) > [fieldFormats](./kibana-plugin-plugins-data-server.pluginstart.fieldformats.md) + +## PluginStart.fieldFormats property + +Signature: + +```typescript +fieldFormats: FieldFormatsStart; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.pluginstart.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.pluginstart.md new file mode 100644 index 0000000000000..b7d6a7e8a83fd --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.pluginstart.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [PluginStart](./kibana-plugin-plugins-data-server.pluginstart.md) + +## PluginStart interface + +Signature: + +```typescript +export interface DataPluginStart +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [fieldFormats](./kibana-plugin-plugins-data-server.pluginstart.fieldformats.md) | FieldFormatsStart | | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.query.language.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.query.language.md new file mode 100644 index 0000000000000..384fc77d801c0 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.query.language.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [Query](./kibana-plugin-plugins-data-server.query.md) > [language](./kibana-plugin-plugins-data-server.query.language.md) + +## Query.language property + +Signature: + +```typescript +language: string; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.query.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.query.md new file mode 100644 index 0000000000000..5d61c75bc5e99 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.query.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [Query](./kibana-plugin-plugins-data-server.query.md) + +## Query interface + +Signature: + +```typescript +export interface Query +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [language](./kibana-plugin-plugins-data-server.query.language.md) | string | | +| [query](./kibana-plugin-plugins-data-server.query.query.md) | string | {
[key: string]: any;
} | | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.query.query.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.query.query.md new file mode 100644 index 0000000000000..5c2aa700bc603 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.query.query.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [Query](./kibana-plugin-plugins-data-server.query.md) > [query](./kibana-plugin-plugins-data-server.query.query.md) + +## Query.query property + +Signature: + +```typescript +query: string | { + [key: string]: any; + }; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.refreshinterval.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.refreshinterval.md new file mode 100644 index 0000000000000..ebb983de29942 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.refreshinterval.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [RefreshInterval](./kibana-plugin-plugins-data-server.refreshinterval.md) + +## RefreshInterval interface + +Signature: + +```typescript +export interface RefreshInterval +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [pause](./kibana-plugin-plugins-data-server.refreshinterval.pause.md) | boolean | | +| [value](./kibana-plugin-plugins-data-server.refreshinterval.value.md) | number | | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.refreshinterval.pause.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.refreshinterval.pause.md new file mode 100644 index 0000000000000..d045a3c0b9a21 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.refreshinterval.pause.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [RefreshInterval](./kibana-plugin-plugins-data-server.refreshinterval.md) > [pause](./kibana-plugin-plugins-data-server.refreshinterval.pause.md) + +## RefreshInterval.pause property + +Signature: + +```typescript +pause: boolean; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.refreshinterval.value.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.refreshinterval.value.md new file mode 100644 index 0000000000000..8b48d97a649c0 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.refreshinterval.value.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [RefreshInterval](./kibana-plugin-plugins-data-server.refreshinterval.md) > [value](./kibana-plugin-plugins-data-server.refreshinterval.value.md) + +## RefreshInterval.value property + +Signature: + +```typescript +value: number; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.shouldreadfieldfromdocvalues.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.shouldreadfieldfromdocvalues.md new file mode 100644 index 0000000000000..b62317cd75b50 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.shouldreadfieldfromdocvalues.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [shouldReadFieldFromDocValues](./kibana-plugin-plugins-data-server.shouldreadfieldfromdocvalues.md) + +## shouldReadFieldFromDocValues() function + +Signature: + +```typescript +export declare function shouldReadFieldFromDocValues(aggregatable: boolean, esType: string): boolean; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| aggregatable | boolean | | +| esType | string | | + +Returns: + +`boolean` + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.timerange.from.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.timerange.from.md new file mode 100644 index 0000000000000..b6f40cc2e4203 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.timerange.from.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [TimeRange](./kibana-plugin-plugins-data-server.timerange.md) > [from](./kibana-plugin-plugins-data-server.timerange.from.md) + +## TimeRange.from property + +Signature: + +```typescript +from: string; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.timerange.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.timerange.md new file mode 100644 index 0000000000000..8280d924eb609 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.timerange.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [TimeRange](./kibana-plugin-plugins-data-server.timerange.md) + +## TimeRange interface + +Signature: + +```typescript +export interface TimeRange +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [from](./kibana-plugin-plugins-data-server.timerange.from.md) | string | | +| [mode](./kibana-plugin-plugins-data-server.timerange.mode.md) | 'absolute' | 'relative' | | +| [to](./kibana-plugin-plugins-data-server.timerange.to.md) | string | | + diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.timerange.mode.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.timerange.mode.md new file mode 100644 index 0000000000000..1408fb43cbf39 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.timerange.mode.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [TimeRange](./kibana-plugin-plugins-data-server.timerange.md) > [mode](./kibana-plugin-plugins-data-server.timerange.mode.md) + +## TimeRange.mode property + +Signature: + +```typescript +mode?: 'absolute' | 'relative'; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.timerange.to.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.timerange.to.md new file mode 100644 index 0000000000000..98aca5474d350 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.timerange.to.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [TimeRange](./kibana-plugin-plugins-data-server.timerange.md) > [to](./kibana-plugin-plugins-data-server.timerange.to.md) + +## TimeRange.to property + +Signature: + +```typescript +to: string; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.tsearchstrategyprovider.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.tsearchstrategyprovider.md new file mode 100644 index 0000000000000..f528f48a68f72 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.tsearchstrategyprovider.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [TSearchStrategyProvider](./kibana-plugin-plugins-data-server.tsearchstrategyprovider.md) + +## TSearchStrategyProvider type + +Search strategy provider creates an instance of a search strategy with the request handler context bound to it. This way every search strategy can use whatever information they require from the request context. + +Signature: + +```typescript +export declare type TSearchStrategyProvider = (context: ISearchContext, caller: APICaller, search: ISearchGeneric) => ISearchStrategy; +``` diff --git a/docs/images/intro-dashboard.png b/docs/images/intro-dashboard.png new file mode 100755 index 0000000000000..5d18acb67bef5 Binary files /dev/null and b/docs/images/intro-dashboard.png differ diff --git a/docs/images/intro-data-tutorial.png b/docs/images/intro-data-tutorial.png new file mode 100644 index 0000000000000..a00e41c8b2a4c Binary files /dev/null and b/docs/images/intro-data-tutorial.png differ diff --git a/docs/images/intro-discover.png b/docs/images/intro-discover.png new file mode 100755 index 0000000000000..27e7a2c728597 Binary files /dev/null and b/docs/images/intro-discover.png differ diff --git a/docs/images/intro-kibana.png b/docs/images/intro-kibana.png new file mode 100644 index 0000000000000..1a59230f2f166 Binary files /dev/null and b/docs/images/intro-kibana.png differ diff --git a/docs/images/intro-management.png b/docs/images/intro-management.png new file mode 100644 index 0000000000000..3c14529a53e90 Binary files /dev/null and b/docs/images/intro-management.png differ diff --git a/docs/images/intro-spaces.jpg b/docs/images/intro-spaces.jpg new file mode 100755 index 0000000000000..7569dfc16b4f7 Binary files /dev/null and b/docs/images/intro-spaces.jpg differ diff --git a/docs/infrastructure/metrics-explorer.asciidoc b/docs/infrastructure/metrics-explorer.asciidoc index c20718dac1c7a..d47581ffe720a 100644 --- a/docs/infrastructure/metrics-explorer.asciidoc +++ b/docs/infrastructure/metrics-explorer.asciidoc @@ -44,7 +44,7 @@ In this step we'll leave the aggregation dropdown set to *Average* but you can t 4. In the *graph per* dropdown, enter `host.name` and select this field. You will see a separate graph for each host you are monitoring. -If you are collecting metrics for multiple hosts, you will see something like the screenshot above. +If you are collecting metrics for multiple hosts, multiple graphics are displayed. If you only have metrics for a single host, you will see a single graph. Congratulations! Either way, you've explored your first metric. diff --git a/docs/logs/using.asciidoc b/docs/logs/using.asciidoc index d84a9260521c7..8074cc4a8026d 100644 --- a/docs/logs/using.asciidoc +++ b/docs/logs/using.asciidoc @@ -31,9 +31,7 @@ If so, <> to change the Click image:images/time-filter-calendar.png[time filter calendar], then choose the time range for the logs. -Log entries for the specified time appear in the middle of the page, with the earlier entries above and the later entries below. - -To quickly jump to a nearby point in time, click the minimap timeline to the right. +Log entries for the specified time appear in the middle of the page. To quickly jump to a nearby point in time, click the minimap timeline to the right. // ++ what's this thing called? It's minimap in the UI. Would timeline be better? [float] diff --git a/docs/management/numeral.asciidoc b/docs/management/numeral.asciidoc index 861277fd18478..65dfdab3abd3c 100644 --- a/docs/management/numeral.asciidoc +++ b/docs/management/numeral.asciidoc @@ -145,7 +145,7 @@ with multiple forms, such as German. [float] === Complete number pattern reference -These number formats, combined with the patterns described above, +These number formats, combined with the previously described patterns, produce the complete set of options for numeral formatting. The output here is all for the `en` locale. @@ -180,5 +180,3 @@ The output here is all for the `en` locale. | 1e-27 | 000 | 1e-27 | -1e-27 | 000 | -1e-27 |=== - - diff --git a/docs/management/rollups/create_and_manage_rollups.asciidoc b/docs/management/rollups/create_and_manage_rollups.asciidoc index b07f075f88032..83e1b7c16f8b4 100644 --- a/docs/management/rollups/create_and_manage_rollups.asciidoc +++ b/docs/management/rollups/create_and_manage_rollups.asciidoc @@ -128,7 +128,7 @@ rollup index, or you can remove or archive it using < Elasticsearch*. +You’ll find *Snapshot and Restore* under *Management > Elasticsearch*. With this UI, you can: * Register a repository for storing your snapshots @@ -20,29 +20,42 @@ With this UI, you can: [role="screenshot"] image:management/snapshot-restore/images/snapshot_list.png["Snapshot list"] -Before using this feature, you should be familiar with how snapshots work. -{ref}/snapshot-restore.html[Snapshot and Restore] is a good source for +Before using this feature, you should be familiar with how snapshots work. +{ref}/snapshot-restore.html[Snapshot and Restore] is a good source for more detailed information. +[float] +[[snapshot-permissions]] +=== Required permissions +The minimum required permissions to access *Snapshot and Restore* include: + +* Cluster privileges: `monitor`, `manage_slm`, `cluster:admin/snapshot`, and `cluster:admin/repository` +* Index privileges: `all` on the `monitor` index if you want to access content in the *Restore Status* tab + +You can add these privileges in *Management > Security > Roles*. + +[role="screenshot"] +image:management/snapshot-restore/images/snapshot_permissions.png["Edit Role"] + [float] [[kib-snapshot-register-repository]] === Register a repository -A repository is where your snapshots live. You must register a snapshot -repository before you can perform snapshot and restore operations. +A repository is where your snapshots live. You must register a snapshot +repository before you can perform snapshot and restore operations. -If you don't have a repository, Kibana walks you through the process of -registering one. +If you don't have a repository, Kibana walks you through the process of +registering one. {kib} supports three repository types -out of the box: shared file system, read-only URL, and source-only. -For more information on these repositories and their settings, +out of the box: shared file system, read-only URL, and source-only. +For more information on these repositories and their settings, see {ref}/snapshots-register-repository.html[Repositories]. -To use other repositories, such as S3, see +To use other repositories, such as S3, see {ref}/snapshots-register-repository.html#snapshots-repository-plugins[Repository plugins]. -Once you create a repository, it is listed in the *Repositories* -view. -Click a repository name to view its type, number of snapshots, and settings, +Once you create a repository, it is listed in the *Repositories* +view. +Click a repository name to view its type, number of snapshots, and settings, and to verify status. [role="screenshot"] @@ -53,46 +66,46 @@ image:management/snapshot-restore/images/repository_list.png["Repository list"] [[kib-view-snapshot]] === View your snapshots -A snapshot is a backup taken from a running {es} cluster. You'll find an overview of -your snapshots in the *Snapshots* view, and you can drill down +A snapshot is a backup taken from a running {es} cluster. You'll find an overview of +your snapshots in the *Snapshots* view, and you can drill down into each snapshot for further investigation. [role="screenshot"] image:management/snapshot-restore/images/snapshot_details.png["Snapshot details"] -If you don’t have any snapshots, you can create them from the {kib} <>. The +If you don’t have any snapshots, you can create them from the {kib} <>. The {ref}/snapshots-take-snapshot.html[snapshot API] -takes the current state and data in your index or cluster, and then saves it to a -shared repository. +takes the current state and data in your index or cluster, and then saves it to a +shared repository. -The snapshot process is "smart." Your first snapshot is a complete copy of +The snapshot process is "smart." Your first snapshot is a complete copy of the data in your index or cluster. -All subsequent snapshots save the changes between the existing snapshots and +All subsequent snapshots save the changes between the existing snapshots and the new data. [float] [[kib-restore-snapshot]] === Restore a snapshot -The information stored in a snapshot is not tied to a specific +The information stored in a snapshot is not tied to a specific cluster or a cluster name. This enables you to -restore a snapshot made from one cluster to another cluster. You might +restore a snapshot made from one cluster to another cluster. You might use the restore operation to: * Recover data lost due to a failure * Migrate a current Elasticsearch cluster to a new version * Move data from one cluster to another cluster -To get started, go to the *Snapshots* view, find the -snapshot, and click the restore icon in the *Actions* column. +To get started, go to the *Snapshots* view, find the +snapshot, and click the restore icon in the *Actions* column. The Restore wizard presents -options for the restore operation, including which +options for the restore operation, including which indices to restore and whether to modify the index settings. -You can restore an existing index only if it’s closed and has the same +You can restore an existing index only if it’s closed and has the same number of shards as the index in the snapshot. Once you initiate the restore, you're navigated to the *Restore Status* view, -where you can track the current state for each shard in the snapshot. +where you can track the current state for each shard in the snapshot. [role="screenshot"] image:management/snapshot-restore/images/snapshot-restore.png["Snapshot details"] @@ -102,26 +115,26 @@ image:management/snapshot-restore/images/snapshot-restore.png["Snapshot details" [[kib-snapshot-policy]] === Create a snapshot lifecycle policy -Use a {ref}/snapshot-lifecycle-management-api.html[snapshot lifecycle policy] -to automate the creation and deletion +Use a {ref}/snapshot-lifecycle-management-api.html[snapshot lifecycle policy] +to automate the creation and deletion of cluster snapshots. Taking automatic snapshots: * Ensures your {es} indices and clusters are backed up on a regular basis -* Ensures a recent and relevant snapshot is available if a situation +* Ensures a recent and relevant snapshot is available if a situation arises where a cluster needs to be recovered -* Allows you to manage your snapshots in {kib}, instead of using a +* Allows you to manage your snapshots in {kib}, instead of using a third-party tool - -If you don’t have any snapshot policies, follow the -*Create policy* wizard. It walks you through defining -when and where to take snapshots, the settings you want, + +If you don’t have any snapshot policies, follow the +*Create policy* wizard. It walks you through defining +when and where to take snapshots, the settings you want, and how long to retain snapshots. [role="screenshot"] image:management/snapshot-restore/images/snapshot-retention.png["Snapshot details"] An overview of your policies is on the *Policies* view. -You can drill down into each policy to examine its settings and last successful and failed run. +You can drill down into each policy to examine its settings and last successful and failed run. You can perform the following actions on a snapshot policy: @@ -139,8 +152,8 @@ image:management/snapshot-restore/images/create-policy.png["Snapshot details"] === Delete a snapshot Delete snapshots to manage your repository storage space. -Find the snapshot in the *Snapshots* view and click the trash icon in the -*Actions* column. To delete snapshots in bulk, select their checkboxes, +Find the snapshot in the *Snapshots* view and click the trash icon in the +*Actions* column. To delete snapshots in bulk, select their checkboxes, and then click *Delete snapshots*. [[snapshot-repositories-example]] @@ -159,10 +172,10 @@ Ready to try *Snapshot and Restore*? In this tutorial, you'll learn to: ==== Before you begin -This example shows you how to register a shared file system repository +This example shows you how to register a shared file system repository and store snapshots. -Before you begin, you must register the location of the repository in the -{ref}/snapshots-register-repository.html#snapshots-filesystem-repository[path.repo] setting on +Before you begin, you must register the location of the repository in the +{ref}/snapshots-register-repository.html#snapshots-filesystem-repository[path.repo] setting on your master and data nodes. You can do this in one of two ways: * Edit your `elasticsearch.yml` to include the `path.repo` setting. @@ -175,14 +188,14 @@ your master and data nodes. You can do this in one of two ways: [[register-repo-example]] ==== Register a repository -Use *Snapshot and Restore* to register the repository where your snapshots -will live. +Use *Snapshot and Restore* to register the repository where your snapshots +will live. . Go to *Management > Elasticsearch > Snapshot and Restore*. . Click *Register a repository* in either the introductory message or *Repository view*. . Enter a name for your repository, for example, `my_backup`. . Select *Shared file system*. -+ ++ [role="screenshot"] image:management/snapshot-restore/images/register_repo.png["Register repository"] @@ -205,13 +218,13 @@ Use the {ref}/snapshots-take-snapshot.html[snapshot API] to create a snapshot. [source,js] PUT /_snapshot/my_backup/2019-04-25_snapshot?wait_for_completion=true + -In this example, the snapshot name is `2019-04-25_snapshot`. You can also +In this example, the snapshot name is `2019-04-25_snapshot`. You can also use {ref}/date-math-index-names.html[date math expression] for the snapshot name. + [role="screenshot"] image:management/snapshot-restore/images/create_snapshot.png["Create snapshot"] -. Return to *Snapshot and Restore*. +. Return to *Snapshot and Restore*. + Your new snapshot is available in the *Snapshots* view. @@ -223,7 +236,7 @@ using the repository created in the previous example. . Open the *Policies* view. . Click *Create a policy*. -+ ++ [role="screenshot"] image:management/snapshot-restore/images/create-policy-example.png["Create policy wizard"] @@ -288,17 +301,16 @@ Finally, you'll restore indices from an existing snapshot. |*Index settings* | |Modify index settings -|Toggle to overwrite index settings when they are restored, +|Toggle to overwrite index settings when they are restored, or leave in place to keep existing settings. |Reset index settings -|Toggle to reset index settings back to the default when they are restored, +|Toggle to reset index settings back to the default when they are restored, or leave in place to keep existing settings. |=== . Review your restore settings, and then click *Restore snapshot*. + -The operation loads for a few seconds, -and then you’re navigated to *Restore Status*, +The operation loads for a few seconds, +and then you’re navigated to *Restore Status*, where you can monitor the status of your restored indices. - diff --git a/docs/maps/connect-to-ems.asciidoc b/docs/maps/connect-to-ems.asciidoc index bc93fc2ba55d4..d7740d76b0456 100644 --- a/docs/maps/connect-to-ems.asciidoc +++ b/docs/maps/connect-to-ems.asciidoc @@ -19,7 +19,7 @@ EMS requests are made to the following domains: To connect to EMS when your Kibana server and browser are in an internal network: . Set `map.proxyElasticMapsServiceInMaps` to `true` in your <> file to proxy EMS requests through the Kibana server. -. Update your firewall rules to whitelist connections from your Kibana server to the EMS domains listed above. +. Update your firewall rules to whitelist connections from your Kibana server to the EMS domains. NOTE: Coordinate map and region map visualizations do not support `map.proxyElasticMapsServiceInMaps` and will not proxy EMS requests through the Kibana server. diff --git a/docs/maps/maps-aggregations.asciidoc b/docs/maps/maps-aggregations.asciidoc index 05d8c0c605e7f..692e30a6665ed 100644 --- a/docs/maps/maps-aggregations.asciidoc +++ b/docs/maps/maps-aggregations.asciidoc @@ -2,10 +2,25 @@ [[maps-aggregations]] == Plot big data without plotting too much data -Use {ref}/search-aggregations.html[aggregations] to plot large data sets without overwhemling your network or your browser. +Use {ref}/search-aggregations.html[aggregations] to plot large data sets without overwhelming your network or your browser. +When using aggregations, the documents stay in Elasticsearch and only the calculated values for each group are returned to your computer. Aggregations group your documents into buckets and calculate metrics for each bucket. -Your documents stay in Elasticsearch and only the metrics for each group are returned to your computer. +Use metric aggregations for <>. For example, use the count aggregation to shade world countries by web log traffic. + +You can add the following metric aggregations: + +* *Average.* The mean of the values. + +* *Count.* The number of documents. + +* *Max.* The highest value. + +* *Min.* The lowest value. + +* *Sum.* The total value. + +* *Unique count.* The number of distinct values. Use aggregated layers with document layers to show aggregated views when the map shows larger amounts of the globe and individual documents when the map shows smaller regions. diff --git a/docs/maps/vector-style.asciidoc b/docs/maps/vector-style.asciidoc index cd5b086508ae8..509b1fae4066a 100644 --- a/docs/maps/vector-style.asciidoc +++ b/docs/maps/vector-style.asciidoc @@ -45,11 +45,17 @@ image::maps/images/vector_style_dynamic.png[] Quantitative data driven styling symbolizes features from a range of numeric property values. -To ensure symbols are consistent as you pan, zoom, and filter the map, quantitative data driven styling uses {ref}/search-aggregations-metrics-extendedstats-aggregation.html[extended_stats aggregation] to retrieve statistical metadata. +Property values are fit from the domain range to the style range on a linear scale. +For example, let's symbolize <> documents by size. +The sample web logs `bytes` field ranges from 0 to 18,000. This is the domain range. +The smallest feature has a symbol radius of 1, and the largest feature has a symbol radius of 24. This is the style range. +The `bytes` property value for each feature will fit on a linear scale from the range of 0 to 18,000 to the style range of 1 to 24. -Click the gear icon image:maps/images/gear_icon.png[] to configure extended_stats. Set *Sigma* to a smaller value to minimize outliers by moving the range minimum and maximum closer to the average. Clear the *Calculate range from indices* checkbox to turn off the extended_stats aggregation request. +To ensure symbols are consistent as you pan, zoom, and filter the map, quantitative data driven styling uses {ref}/search-aggregations-metrics-extendedstats-aggregation.html[extended_stats aggregation] to retrieve statistical metadata. Extended_stats is not available for numeric property values from the <> count, sum, and unique count. -NOTE: When the *Calculate range from indices* checkbox is cleared, symbols might be inconsistent as users pan, zoom, and filter the map. Without extended_stats, the range is calulated with data from the local layer. The range is recalulcated when layer data changes. +To configure extended_stats,click the gear icon image:maps/images/gear_icon.png[] to configure extended_stats. Set *Sigma* to a smaller value to minimize outliers by moving the range minimum and maximum closer to the average. Clear the *Calculate range from indices* checkbox to turn off the extended_stats aggregation request. The gear icon is not available for numeric property values from the <> count, sum, and unique count. + +NOTE: When extended_stats is not used, symbols might be inconsistent as users pan, zoom, and filter the map. Without extended_stats, the range is calculated with data from the local layer. The range is re-calculated when layer data changes. [role="screenshot"] image::maps/images/extended_stats_config.png[] diff --git a/docs/settings/reporting-settings.asciidoc b/docs/settings/reporting-settings.asciidoc index a9fa2bd18d315..9a45fb9ab1d0c 100644 --- a/docs/settings/reporting-settings.asciidoc +++ b/docs/settings/reporting-settings.asciidoc @@ -95,6 +95,8 @@ index for any pending Reporting jobs. Defaults to `3000` (3 seconds). [[xpack-reporting-q-timeout]]`xpack.reporting.queue.timeout`:: How long each worker has to produce a report. If your machine is slow or under heavy load, you might need to increase this timeout. Specified in milliseconds. +If a Reporting job execution time goes over this time limit, the job will be +marked as a failure and there will not be a download available. Defaults to `120000` (two minutes). [float] @@ -104,6 +106,26 @@ Defaults to `120000` (two minutes). Reporting works by capturing screenshots from Kibana. The following settings control the capturing process. +`xpack.reporting.capture.timeouts.openUrl`:: +How long to allow the Reporting browser to wait for the initial data of the +Kibana page to load. Defaults to `30000` (30 seconds). + +`xpack.reporting.capture.timeouts.waitForElements`:: +How long to allow the Reporting browser to wait for the visualization panels to +load on the Kibana page. Defaults to `30000` (30 seconds). + +`xpack.reporting.capture.timeouts.renderComplete`:: +How long to allow the Reporting brwoser to wait for each visualization to +signal that it is done renderings. Defaults to `30000` (30 seconds). + +[NOTE] +============ +If any timeouts from `xpack.reporting.capture.timeouts.*` settings occur when +running a report job, Reporting will log the error and try to continue +capturing the page with a screenshot. As a result, a download will be +available, but there will likely be errors in the visualizations in the report. +============ + `xpack.reporting.capture.maxAttempts`:: If capturing a report fails for any reason, Kibana will re-attempt othe reporting job, as many times as this setting. Defaults to `3`. diff --git a/docs/setup/docker.asciidoc b/docs/setup/docker.asciidoc index 8fd7b0490e194..ddabce3d5b842 100644 --- a/docs/setup/docker.asciidoc +++ b/docs/setup/docker.asciidoc @@ -7,11 +7,11 @@ A list of all published Docker images and tags is available at https://www.docker.elastic.co[www.docker.elastic.co]. The source code is in https://github.com/elastic/dockerfiles/tree/{branch}/kibana[GitHub]. -These images are free to use under the Elastic license. They contain open source -and free commercial features and access to paid commercial features. -{stack-ov}/license-management.html[Start a 30-day trial] to try out all of the -paid commercial features. See the -https://www.elastic.co/subscriptions[Subscriptions] page for information about +These images are free to use under the Elastic license. They contain open source +and free commercial features and access to paid commercial features. +{stack-ov}/license-management.html[Start a 30-day trial] to try out all of the +paid commercial features. See the +https://www.elastic.co/subscriptions[Subscriptions] page for information about Elastic license levels. [float] @@ -35,8 +35,8 @@ ifeval::["{release-state}"!="unreleased"] docker pull {docker-repo}:{version} -------------------------------------------- -Alternatively, you can download other Docker images that contain only features -available under the Apache 2.0 license. To download the images, go to +Alternatively, you can download other Docker images that contain only features +available under the Apache 2.0 license. To download the images, go to https://www.docker.elastic.co[www.docker.elastic.co]. [float] @@ -96,7 +96,7 @@ Some example translations are shown here: `KIBANA_DEFAULTAPPID`:: `kibana.defaultAppId` `XPACK_MONITORING_ENABLED`:: `xpack.monitoring.enabled` -In general, any setting listed in <> can be +In general, any setting listed in <> can be configured with this technique. These variables can be set with +docker-compose+ like this: @@ -135,5 +135,5 @@ with a <> or via <>. IMPORTANT: If replacing `kibana.yml` with a custom version, be sure to copy the -above defaults to the custom file if you want to retain them. If not, they will +defaults to the custom file if you want to retain them. If not, they will be "masked" by the new file. diff --git a/docs/setup/settings.asciidoc b/docs/setup/settings.asciidoc index 7d0adb9b0e7ef..80d04c260e25f 100644 --- a/docs/setup/settings.asciidoc +++ b/docs/setup/settings.asciidoc @@ -234,7 +234,8 @@ FeatureCollection. The file must use the https://en.wikipedia.org/wiki/World_Geodetic_System[WGS84 coordinate reference system (ESPG:4326)] and only include polygons. If the file is hosted on a separate domain from Kibana, the server needs to be CORS-enabled so Kibana can download the file. -The following example shows a valid regionmap configuration. +[[region-map-configuration-example]] +The following example shows a valid region map configuration. + -- map @@ -262,7 +263,7 @@ References the originating source of the geojson file. Supported on {ece}. [[regionmap-fields]]`map.regionmap.layers[].fields[]:`:: Mandatory. Each layer can contain multiple fields to indicate what properties from the geojson -features you wish to expose. The example above shows how to define multiple +features you wish to expose. This <> shows how to define multiple properties. Supported on {ece}. [[regionmap-field-description]]`map.regionmap.layers[].fields[].description:`:: @@ -325,10 +326,6 @@ deprecation warning at startup. This setting cannot end in a slash (`/`). proxy sitting in front of it. This determines whether HTTP compression may be used for responses, based on the request's `Referer` header. This setting may not be used when `server.compression.enabled` is set to `false`. -[[server-cors]]`server.cors:`:: *Default: `false`* Set to `true` to enable CORS support. This setting is required to configure `server.cors.origin`. - -`server.cors.origin:`:: *Default: none* Specifies origins. "origin" must be an array. To use this setting, you must set `server.cors` to `true`. To accept all origins, use `server.cors.origin: ["*"]`. - `server.customResponseHeaders:`:: *Default: `{}`* Header names and values to send on all responses to the client from the Kibana server. diff --git a/docs/siem/index.asciidoc b/docs/siem/index.asciidoc index a15d860d76775..9d17b5209304f 100644 --- a/docs/siem/index.asciidoc +++ b/docs/siem/index.asciidoc @@ -4,7 +4,6 @@ [partintro] -- -beta[] The SIEM app in Kibana provides an interactive workspace for security teams to triage events and perform initial investigations. It enables analysis of diff --git a/docs/siem/siem-ui.asciidoc b/docs/siem/siem-ui.asciidoc index f01575a21b9f6..85253daaf2933 100644 --- a/docs/siem/siem-ui.asciidoc +++ b/docs/siem/siem-ui.asciidoc @@ -35,7 +35,7 @@ image::siem/images/network-ui.png[] [float] [[detections-ui]] -=== Detections +=== Detections (Beta) The Detections feature automatically searches for threats and creates signals when they are detected. Signal detection rules define the conditions diff --git a/docs/user/introduction.asciidoc b/docs/user/introduction.asciidoc index fcb072c7c925f..8b987f81779e3 100644 --- a/docs/user/introduction.asciidoc +++ b/docs/user/introduction.asciidoc @@ -1,12 +1,165 @@ [[introduction]] -== Introduction +== {kib} — your window into the Elastic Stack +++++ +What is Kibana? +++++ -Kibana is an open source analytics and visualization platform designed to work with Elasticsearch. You use Kibana to -search, view, and interact with data stored in Elasticsearch indices. You can easily perform advanced data analysis -and visualize your data in a variety of charts, tables, and maps. +**_Explore and visualize your data and manage all things Elastic Stack._** -Kibana makes it easy to understand large volumes of data. Its simple, browser-based interface enables you to quickly -create and share dynamic dashboards that display changes to Elasticsearch queries in real time. +Whether you’re a user or admin, {kib} makes your data actionable by providing +three key functions. Kibana is: -Setting up Kibana is a snap. You can install Kibana and start exploring your Elasticsearch indices in minutes -- no -code, no additional infrastructure required. +* **An open-source analytics and visualization platform.** +Use {kib} to explore your {es} data, and then build beautiful visualizations and dashboards. + +* **A UI for managing the Elastic Stack.** +Manage your security settings, assign user roles, take snapshots, roll up your data, +and more — all from the convenience of a {kib} UI. + +* **A centralized hub for Elastic's solutions.** From log analytics to +document discovery to SIEM, {kib} is the portal for accessing these and other capabilities. + +[role="screenshot"] +image::images/intro-kibana.png[] + +[float] +[[get-data-into-kibana]] +=== Getting data into {kib} + +{kib} is designed to use {es} as a data source. Think of Elasticsearch as the engine that stores +and processes the data, with {kib} sitting on top. + +From the home page, {kib} provides these options for getting data in: + +* Set up a data flow to Elasticsearch using our built-in tutorials. +(If a tutorial doesn’t exist for your data, go to the +{beats-ref}/beats-reference.html[Beats overview] to learn about other data shippers +in the {beats} family.) +* <> and take {kib} for a test drive without loading data yourself. +* Import static data using the +https://www.elastic.co/blog/importing-csv-and-log-data-into-elasticsearch-with-file-data-visualizer[file upload feature]. +* Index your data into Elasticsearch with {ref}/getting-started-index.html[REST APIs] + or https://www.elastic.co/guide/en/elasticsearch/client/index.html[client libraries]. ++ +[role="screenshot"] +image::images/intro-data-tutorial.png[Ways to get data in from the home page] + + +{kib} uses an +<> to tell it which {es} indices to explore. +If you add sample data or run a built-in tutorial, you get an index pattern for free, +and are good to start exploring. If you load your own data, you can create +an index pattern in <>. + +[float] +[[explore-and-query]] +=== Explore & query + +Ready to dive into your data? With <>, you can explore your data and +search for hidden insights and relationships. Ask your questions, and then +narrow the results to just the data you want. + +[role="screenshot"] +image::images/intro-discover.png[] + +[float] +[[visualize-and-analyze]] +=== Visualize & analyze + +A visualization is worth a thousand log lines, and {kib} provides +many options for showcasing your data. Use <>, +our drag-and-drop interface, +to rapidly build +charts, tables, metrics, and more. If there +is a better visualization for your data, *Lens* suggests it, allowing for quick +switching between visualization types. + +Once your visualizations are just the way you want, +use <> to collect them in one place. A dashboard provides +insights into your data from multiple perspectives. + +[role="screenshot"] +image::images/intro-dashboard.png[] + +{kib} also offers these visualization features: + +* <> allows you to display your data in +line charts, bar graphs, pie charts, histograms, and tables +(just to name a few). It's also home to *Lens*, the drag-and-drop interface. +*Visualize* supports the ability to add interactive +controls to your dashboard, and filter dashboard content in real time. + +* <> gives you the ability to present your data in a +visually compelling, pixel-perfect report. Give your data the “wow” factor +needed to impress your CEO or to captivate people with a big-screen display. + +* <> enables you to ask (and answer) meaningful +questions of your location-based data. *Elastic Maps* supports multiple +layers and data sources, mapping of individual geo points and shapes, +and dynamic client-side styling. + +* <> allows you to combine +an infinite number of aggregations to display complex data in a meaningful way. +With TSVB, you can analyze multiple index patterns and customize +every aspect of your visualization. Choose your own date format and color +gradients, and easily switch your data view between time series, metric, +top N, gauge, and markdown. + +[float] +[[organize-and-secure]] +=== Organize & secure + +Want to share Kibana’s goodness with other people or teams? You can do so with +<>, built for organizing your visualizations, dashboards, and indices. +Think of a space as its own mini {kib} installation — it’s isolated from +all other spaces, so you can tailor it to your specific needs without impacting others. + +You can even choose which features to enable within each space. Don’t need +Machine learning in your “Executive” space? Simply turn it off. + +[role="screenshot"] +image::images/intro-spaces.jpg[] + +You can take this all one step further with Kibana’s security features, and +control which users have access to each space. {kib} allows for fine-grained +controls, so you can give a user read-only access to +dashboards in one space, but full access to all of Kibana’s features in another. + +[float] +[[manage-all-things-stack]] +=== Manage all things Elastic Stack + +<> provides guided processes for managing all +things Elastic Stack — indices, clusters, licenses, UI settings, index patterns, +and more. Want to update your {es} indices? Set user roles and privileges? +Turn on dark mode? Kibana has UIs for all that. + +[role="screenshot"] +image::images/intro-management.png[] + +[float] +[[extend-your-use-case]] +=== Extend your use case — or add a new one + +As a hub for Elastic's https://www.elastic.co/products/[solutions], {kib} +can help you find security vulnerabilities, +monitor performance, and address your business needs. Get alerted if a key +metric spikes. Detect anomalous behavior or forecast future spikes. Root out +bottlenecks in your application code. Kibana doesn’t limit or dictate how you explore your data. + +[role="screenshot"] +image::siem/images/detections-ui.png[] + +[float] +[[try-kibana]] +=== Give {kib} a try + +There is no faster way to try out {kib} than with our hosted {es} Service. +https://www.elastic.co/cloud/elasticsearch-service/signup[Sign up for a free trial] +and start exploring data in minutes. + +You can also <> — no code, no additional +infrastructure required. + +Our <> and in-product guidance can +help you get up and running, faster. Use our Help menu if you have questions or feedback. diff --git a/docs/user/reporting/development/pdf-integration.asciidoc b/docs/user/reporting/development/pdf-integration.asciidoc index dc9e63f34b25e..af5ba5be1636e 100644 --- a/docs/user/reporting/development/pdf-integration.asciidoc +++ b/docs/user/reporting/development/pdf-integration.asciidoc @@ -51,8 +51,7 @@ should have their screenshot taken and when the Visualizations are done renderin The print layout takes a screenshot of every element with the `data-shared-item` attribute and includes the individual screenshots in the PDF. The print layout also uses the `data-title` and `data-description` -attributes on the same HTMLElement as the `data-shared-item` to specify the title and description -that appears right above the individual screenshots. +attributes on the same HTMLElement as the `data-shared-item` to specify the title and description. The preserve layout takes a screenshot of the element with the `data-shared-items-container` attribute. Additionally, reporting will resize the element with the `data-shared-items-container` to be the size specified in the layout dimensions. @@ -63,4 +62,4 @@ Reporting needs to determine when all of the visualizations have completed rende If there are multiple visualizations, the `data-shared-items-count` attribute should be specified to let Reporting know how many Visualizations to look for. Reporting will look at every element with the `data-shared-item` attribute and use the corresponding `data-render-complete` attribute and `renderComplete` events to listen for rendering to complete. When rendering is complete for a visualization -the `data-render-complete` attribute should be set to "true" and it should dispatch a custom DOM `renderComplete` event. \ No newline at end of file +the `data-render-complete` attribute should be set to "true" and it should dispatch a custom DOM `renderComplete` event. diff --git a/docs/user/security/securing-communications/elasticsearch-mutual-tls.asciidoc b/docs/user/security/securing-communications/elasticsearch-mutual-tls.asciidoc index 8d64a0e6e0c11..f5192f4641d4d 100644 --- a/docs/user/security/securing-communications/elasticsearch-mutual-tls.asciidoc +++ b/docs/user/security/securing-communications/elasticsearch-mutual-tls.asciidoc @@ -63,7 +63,7 @@ you have hostname verification enabled on {es}. -- {es} needs the appropriate CA certificate chain to properly establish trust when receiving connections from {kib}. -If you followed the instructions above to generate a client certificate, then you will have a PKCS#12 file for {kib}. You can extract the CA +If you followed the instructions to generate a client certificate, then you will have a PKCS#12 file for {kib}. You can extract the CA certificate chain from this file. For example: [source,sh] @@ -165,6 +165,6 @@ attempt to use them to authenticate to {es} via the native realm. . Restart {kib}. -NOTE: The steps above enable {kib} to authenticate to {es} using a certificate. However, end users will only be able to authenticate to +These steps enable {kib} to authenticate to {es} using a certificate. However, end users will only be able to authenticate to {kib} with a username and password. To allow end users to authenticate to {kib} using a client certificate, see <>. diff --git a/docs/user/security/securing-communications/index.asciidoc b/docs/user/security/securing-communications/index.asciidoc index 2ac08a4fab5ee..97313c19f44cb 100644 --- a/docs/user/security/securing-communications/index.asciidoc +++ b/docs/user/security/securing-communications/index.asciidoc @@ -150,7 +150,7 @@ elasticsearch.ssl.certificateAuthorities: ["/path/to/elasticsearch-ca.pem"] + -- WARNING: You should not use a PKCS#12 file that contains a private key. This is an unnecessary security risk. If you only have a PKCS#12 -file that contains a private key, a safer approach is to extract the CA certificate chain in PEM format as described above. +file that contains a private key, a safer approach is to extract the CA certificate chain in PEM format. Specify your PKCS#12 file in `kibana.yml`: @@ -188,5 +188,5 @@ verification. For more information about this setting, see <>. +. Optional: <>. . Optional: <>. @@ -103,8 +103,8 @@ You can manage privileges on the *Management / Security / Roles* page in {kib}. If you're using the native realm with Basic Authentication, you can assign roles using the *Management / Security / Users* page in {kib} or the -{ref}/security-api.html#security-user-apis[user management APIs]. For example, -the following creates a user named `jacknich` and assigns it the `kibana_admin` +{ref}/security-api.html#security-user-apis[user management APIs]. For example, +the following creates a user named `jacknich` and assigns it the `kibana_admin` role: [source,js] @@ -131,8 +131,8 @@ on specific index patterns. For more information, see . Verify that you can log in as a user. If you are running {kib} locally, go to `https://localhost:5601` and enter the credentials for a -user you've assigned a {kib} user role. For example, you could log in as the -`jacknich` user created above. +user you've assigned a {kib} user role. For example, you could log in as the user +`jacknich`. + -- diff --git a/docs/visualize/vega.asciidoc b/docs/visualize/vega.asciidoc index d5b7ccb12f48c..c9cf1e7aeb820 100644 --- a/docs/visualize/vega.asciidoc +++ b/docs/visualize/vega.asciidoc @@ -18,47 +18,47 @@ NOTE: In Vega it is possible to load data dynamically, e.g. by setting signals a * To experiment using sample data, first click the {kib} logo in the upper left hand corner and then click the link next to *Sample Data*. -* Once you have data loaded, go to *Visualize*, click *+*, and select *Vega* to see an example graph. -*Note*: The default graph is written in Vega-Lite, but you can build visualizations -in either language. See <> for more information. +* Once you have data loaded, go to *Visualize*, click *+*, and select *Vega* to see an example graph. +*Note*: The default graph is written in Vega-Lite, but you can build visualizations +in either language. See <> for more information. * Try changing `mark` from `line` to `point`, `area`, `bar`, `circle`, -or `square`. Check out the +or `square`. Check out the https://vega.github.io/vega-lite/docs/mark.html#mark-def[Vega-Lite docs] for more information. * Explore other available https://vega.github.io/vega/examples/[Vega] or -https://vega.github.io/vega-lite/examples/[Vega-Lite] visualizations. +https://vega.github.io/vega-lite/examples/[Vega-Lite] visualizations. *Note*: You might need to make URLs absolute, for example, replace `"url": "data/world-110m.json"` with -`"url": "https://vega.github.io/editor/data/world-110m.json"`. +`"url": "https://vega.github.io/editor/data/world-110m.json"`. See <>. -* For more information on getting started, check out this https://www.elastic.co/blog/getting-started-with-vega-visualizations-in-kibana[blog post]. +* For more information on getting started, check out this https://www.elastic.co/blog/getting-started-with-vega-visualizations-in-kibana[blog post]. [[vega-vs-vegalite]] === Vega vs Vega-Lite -The Vega visualization in {kib} supports both Vega and Vega-Lite. You can use the -`schema` value to define which language you would like to use and its minimum +The Vega visualization in {kib} supports both Vega and Vega-Lite. You can use the +`schema` value to define which language you would like to use and its minimum required version. - -For example: + +For example: * Vega-Lite v2: `$schema: https://vega.github.io/schema/vega-lite/v2.json` * Vega v4: `$schema: https://vega.github.io/schema/vega/v4.json` - + The `schema` URL is only used for identification, and does not need to be accessible by {kib}. -Vega-Lite is a simplified version of Vega; it automates some constructions and has -much shorter specifications than Vega. Vega-Lite is automatically converted into +Vega-Lite is a simplified version of Vega; it automates some constructions and has +much shorter specifications than Vega. Vega-Lite is automatically converted into Vega before rendering, but it has some limitations, and there are some visualizations that can be expressed in Vega that cannot be expressed in Vega-Lite. You can learn more in the https://vega.github.io/vega-lite/[Vega-Lite documentation]. You can use https://vega.github.io/editor/[this editor] to convert Vega-Lite into -Vega. +Vega. -When you create a Vega visualization in {kib}, you can edit the `schema` -value in the dev tools to the left of the graph to define which of the two expression -languages you would like to use (see examples above). +When you create a Vega visualization in {kib}, you can edit the `schema` +value in the dev tools to the left of the graph to define which of the two expression +languages you would like to use. [[vega-querying-elasticsearch]] @@ -176,7 +176,7 @@ except that the timerange is shifted back by 10 minutes: ---- The `"%timefilter%"` can also be used to specify a single min or max -value. As shown above, the date_histogram's `extended_bounds` can be set +value. The date_histogram's `extended_bounds` can be set with two values - min and max. Instead of hardcoding a value, you may use `"min": {"%timefilter%": "min"}`, which will be replaced with the beginning of the current time range. The `shift` and `unit` values are @@ -234,7 +234,7 @@ the graph must specify `type=map` in the host configuration: // defaults to true, shows +/- buttons to zoom in/out "zoomControl": false, - // Defaults to 'false', disables mouse wheel zoom. If set to + // Defaults to 'false', disables mouse wheel zoom. If set to // 'true', map may zoom unexpectedly while scrolling dashboard "scrollWheelZoom": false, @@ -295,7 +295,7 @@ to your kibana.yml file. === Useful Links ==== Vega Editor -The https://vega.github.io/editor/[Vega Editor] includes examples for Vega & Vega-Lite, but does not support any +The https://vega.github.io/editor/[Vega Editor] includes examples for Vega & Vega-Lite, but does not support any {kib}-specific features like {es} requests and interactive base maps. ==== Vega-Lite resources @@ -303,14 +303,14 @@ The https://vega.github.io/editor/[Vega Editor] includes examples for Vega & Veg * https://vega.github.io/vega-lite/docs/[Docs] * https://vega.github.io/vega-lite/examples/[Examples] -==== Vega resources +==== Vega resources * https://vega.github.io/vega/tutorials/[Tutorials] * https://vega.github.io/vega/docs/[Docs] * https://vega.github.io/vega/examples/[Examples] ==== Elastic blog posts * https://www.elastic.co/blog/getting-started-with-vega-visualizations-in-kibana[Getting Started with Vega Visualizations in Kibana] -* https://www.elastic.co/blog/custom-vega-visualizations-in-kibana[Custom Vega Visualizations in Kibana] +* https://www.elastic.co/blog/custom-vega-visualizations-in-kibana[Custom Vega Visualizations in Kibana] * https://www.elastic.co/blog/sankey-visualization-with-vega-in-kibana[Sankey Visualization with Vega in Kibana] diff --git a/examples/search_explorer/public/es_strategy.tsx b/examples/search_explorer/public/es_strategy.tsx index 5d2617e64a79e..aaf9dada90341 100644 --- a/examples/search_explorer/public/es_strategy.tsx +++ b/examples/search_explorer/public/es_strategy.tsx @@ -33,8 +33,6 @@ import { import { DoSearch } from './do_search'; import { GuideSection } from './guide_section'; -// @ts-ignore -import serverPlugin from '!!raw-loader!./../../../src/plugins/data/server/search/es_search/es_search_service'; // @ts-ignore import serverStrategy from '!!raw-loader!./../../../src/plugins/data/server/search/es_search/es_search_strategy'; @@ -127,10 +125,7 @@ export class EsSearchTest extends React.Component { }, { title: 'Server', - code: [ - { description: 'es_search_service.ts', snippet: serverPlugin }, - { description: 'es_search_strategy.ts', snippet: serverStrategy }, - ], + code: [{ description: 'es_search_strategy.ts', snippet: serverStrategy }], }, ]} demo={this.renderDemo()} diff --git a/examples/ui_action_examples/public/hello_world_action.tsx b/examples/ui_action_examples/public/hello_world_action.tsx index f4c3bfeee6a6d..da20f40464516 100644 --- a/examples/ui_action_examples/public/hello_world_action.tsx +++ b/examples/ui_action_examples/public/hello_world_action.tsx @@ -22,7 +22,7 @@ import { OverlayStart } from '../../../src/core/public'; import { createAction } from '../../../src/plugins/ui_actions/public'; import { toMountPoint } from '../../../src/plugins/kibana_react/public'; -export const HELLO_WORLD_ACTION_TYPE = 'HELLO_WORLD_ACTION_TYPE'; +export const ACTION_HELLO_WORLD = 'ACTION_HELLO_WORLD'; interface StartServices { openModal: OverlayStart['openModal']; @@ -30,7 +30,7 @@ interface StartServices { export const createHelloWorldAction = (getStartServices: () => Promise) => createAction({ - type: HELLO_WORLD_ACTION_TYPE, + type: ACTION_HELLO_WORLD, getDisplayName: () => 'Hello World!', execute: async () => { const { openModal } = await getStartServices(); diff --git a/examples/ui_action_examples/public/index.ts b/examples/ui_action_examples/public/index.ts index 9dce2191d2670..88a36d278e256 100644 --- a/examples/ui_action_examples/public/index.ts +++ b/examples/ui_action_examples/public/index.ts @@ -23,4 +23,4 @@ import { PluginInitializer } from '../../../src/core/public'; export const plugin: PluginInitializer = () => new UiActionExamplesPlugin(); export { HELLO_WORLD_TRIGGER_ID } from './hello_world_trigger'; -export { HELLO_WORLD_ACTION_TYPE } from './hello_world_action'; +export { ACTION_HELLO_WORLD } from './hello_world_action'; diff --git a/examples/ui_action_examples/public/plugin.ts b/examples/ui_action_examples/public/plugin.ts index 08b65714dbf66..c47746d4b3fd6 100644 --- a/examples/ui_action_examples/public/plugin.ts +++ b/examples/ui_action_examples/public/plugin.ts @@ -19,7 +19,7 @@ import { Plugin, CoreSetup } from '../../../src/core/public'; import { UiActionsSetup } from '../../../src/plugins/ui_actions/public'; -import { createHelloWorldAction } from './hello_world_action'; +import { createHelloWorldAction, ACTION_HELLO_WORLD } from './hello_world_action'; import { helloWorldTrigger, HELLO_WORLD_TRIGGER_ID } from './hello_world_trigger'; interface UiActionExamplesSetupDependencies { @@ -28,7 +28,11 @@ interface UiActionExamplesSetupDependencies { declare module '../../../src/plugins/ui_actions/public' { export interface TriggerContextMapping { - [HELLO_WORLD_TRIGGER_ID]: undefined; + [HELLO_WORLD_TRIGGER_ID]: {}; + } + + export interface ActionContextMapping { + [ACTION_HELLO_WORLD]: {}; } } @@ -42,7 +46,7 @@ export class UiActionExamplesPlugin })); uiActions.registerAction(helloWorldAction); - uiActions.attachAction(helloWorldTrigger.id, helloWorldAction.id); + uiActions.attachAction(helloWorldTrigger.id, helloWorldAction); } public start() {} diff --git a/examples/ui_actions_explorer/public/actions/actions.tsx b/examples/ui_actions_explorer/public/actions/actions.tsx index 2770b0e3bd5ff..64a820ab6d194 100644 --- a/examples/ui_actions_explorer/public/actions/actions.tsx +++ b/examples/ui_actions_explorer/public/actions/actions.tsx @@ -27,44 +27,48 @@ export const USER_TRIGGER = 'USER_TRIGGER'; export const COUNTRY_TRIGGER = 'COUNTRY_TRIGGER'; export const PHONE_TRIGGER = 'PHONE_TRIGGER'; -export const VIEW_IN_MAPS_ACTION = 'VIEW_IN_MAPS_ACTION'; -export const TRAVEL_GUIDE_ACTION = 'TRAVEL_GUIDE_ACTION'; -export const CALL_PHONE_NUMBER_ACTION = 'CALL_PHONE_NUMBER_ACTION'; -export const EDIT_USER_ACTION = 'EDIT_USER_ACTION'; -export const PHONE_USER_ACTION = 'PHONE_USER_ACTION'; -export const SHOWCASE_PLUGGABILITY_ACTION = 'SHOWCASE_PLUGGABILITY_ACTION'; +export const ACTION_VIEW_IN_MAPS = 'ACTION_VIEW_IN_MAPS'; +export const ACTION_TRAVEL_GUIDE = 'ACTION_TRAVEL_GUIDE'; +export const ACTION_CALL_PHONE_NUMBER = 'ACTION_CALL_PHONE_NUMBER'; +export const ACTION_EDIT_USER = 'ACTION_EDIT_USER'; +export const ACTION_PHONE_USER = 'ACTION_PHONE_USER'; +export const ACTION_SHOWCASE_PLUGGABILITY = 'ACTION_SHOWCASE_PLUGGABILITY'; -export const showcasePluggability = createAction({ - type: SHOWCASE_PLUGGABILITY_ACTION, +export const showcasePluggability = createAction({ + type: ACTION_SHOWCASE_PLUGGABILITY, getDisplayName: () => 'This is pluggable! Any plugin can inject their actions here.', execute: async () => alert("Isn't that cool?!"), }); -export type PhoneContext = string; +export interface PhoneContext { + phone: string; +} -export const makePhoneCallAction = createAction({ - type: CALL_PHONE_NUMBER_ACTION, +export const makePhoneCallAction = createAction({ + type: ACTION_CALL_PHONE_NUMBER, getDisplayName: () => 'Call phone number', - execute: async phone => alert(`Pretend calling ${phone}...`), + execute: async context => alert(`Pretend calling ${context.phone}...`), }); -export const lookUpWeatherAction = createAction<{ country: string }>({ - type: TRAVEL_GUIDE_ACTION, +export const lookUpWeatherAction = createAction({ + type: ACTION_TRAVEL_GUIDE, getIconType: () => 'popout', getDisplayName: () => 'View travel guide', - execute: async ({ country }) => { - window.open(`https://www.worldtravelguide.net/?s=${country},`, '_blank'); + execute: async context => { + window.open(`https://www.worldtravelguide.net/?s=${context.country}`, '_blank'); }, }); -export type CountryContext = string; +export interface CountryContext { + country: string; +} -export const viewInMapsAction = createAction({ - type: VIEW_IN_MAPS_ACTION, +export const viewInMapsAction = createAction({ + type: ACTION_VIEW_IN_MAPS, getIconType: () => 'popout', getDisplayName: () => 'View in maps', - execute: async country => { - window.open(`https://www.google.com/maps/place/${country}`, '_blank'); + execute: async context => { + window.open(`https://www.google.com/maps/place/${context.country}`, '_blank'); }, }); @@ -100,11 +104,8 @@ function EditUserModal({ } export const createEditUserAction = (getOpenModal: () => Promise) => - createAction<{ - user: User; - update: (user: User) => void; - }>({ - type: EDIT_USER_ACTION, + createAction({ + type: ACTION_EDIT_USER, getIconType: () => 'pencil', getDisplayName: () => 'Edit user', execute: async ({ user, update }) => { @@ -120,8 +121,8 @@ export interface UserContext { } export const createPhoneUserAction = (getUiActionsApi: () => Promise) => - createAction({ - type: PHONE_USER_ACTION, + createAction({ + type: ACTION_PHONE_USER, getDisplayName: () => 'Call phone number', isCompatible: async ({ user }) => user.phone !== undefined, execute: async ({ user }) => { @@ -133,7 +134,7 @@ export const createPhoneUserAction = (getUiActionsApi: () => Promise { uiActionsApi.executeTriggerActions(HELLO_WORLD_TRIGGER_ID, undefined)} + onClick={() => uiActionsApi.executeTriggerActions(HELLO_WORLD_TRIGGER_ID, {})} > Say hello world! @@ -76,8 +76,9 @@ const ActionsExplorer = ({ uiActionsApi, openModal }: Props) => { { - const dynamicAction = createAction<{}>({ - type: `${HELLO_WORLD_ACTION_TYPE}-${name}`, + const dynamicAction = createAction({ + id: `${ACTION_HELLO_WORLD}-${name}`, + type: ACTION_HELLO_WORLD, getDisplayName: () => `Say hello to ${name}`, execute: async () => { const overlay = openModal( @@ -95,7 +96,7 @@ const ActionsExplorer = ({ uiActionsApi, openModal }: Props) => { }, }); uiActionsApi.registerAction(dynamicAction); - uiActionsApi.attachAction(HELLO_WORLD_TRIGGER_ID, dynamicAction.type); + uiActionsApi.attachAction(HELLO_WORLD_TRIGGER_ID, dynamicAction); setConfirmationText( `You've successfully added a new action: ${dynamicAction.getDisplayName( {} diff --git a/examples/ui_actions_explorer/public/plugin.tsx b/examples/ui_actions_explorer/public/plugin.tsx index fecada71099e8..f1895905a45e1 100644 --- a/examples/ui_actions_explorer/public/plugin.tsx +++ b/examples/ui_actions_explorer/public/plugin.tsx @@ -27,17 +27,17 @@ import { lookUpWeatherAction, viewInMapsAction, createEditUserAction, - CALL_PHONE_NUMBER_ACTION, - VIEW_IN_MAPS_ACTION, - TRAVEL_GUIDE_ACTION, - PHONE_USER_ACTION, - EDIT_USER_ACTION, makePhoneCallAction, showcasePluggability, - SHOWCASE_PLUGGABILITY_ACTION, UserContext, CountryContext, PhoneContext, + ACTION_EDIT_USER, + ACTION_SHOWCASE_PLUGGABILITY, + ACTION_CALL_PHONE_NUMBER, + ACTION_TRAVEL_GUIDE, + ACTION_VIEW_IN_MAPS, + ACTION_PHONE_USER, } from './actions/actions'; interface StartDeps { @@ -54,6 +54,15 @@ declare module '../../../src/plugins/ui_actions/public' { [COUNTRY_TRIGGER]: CountryContext; [PHONE_TRIGGER]: PhoneContext; } + + export interface ActionContextMapping { + [ACTION_EDIT_USER]: UserContext; + [ACTION_SHOWCASE_PLUGGABILITY]: {}; + [ACTION_CALL_PHONE_NUMBER]: PhoneContext; + [ACTION_TRAVEL_GUIDE]: CountryContext; + [ACTION_VIEW_IN_MAPS]: CountryContext; + [ACTION_PHONE_USER]: UserContext; + } } export class UiActionsExplorerPlugin implements Plugin { @@ -67,29 +76,24 @@ export class UiActionsExplorerPlugin implements Plugin (await startServices)[1].uiActions) ); - deps.uiActions.registerAction( + deps.uiActions.attachAction( + USER_TRIGGER, createEditUserAction(async () => (await startServices)[0].overlays.openModal) ); - deps.uiActions.attachAction(USER_TRIGGER, PHONE_USER_ACTION); - deps.uiActions.attachAction(USER_TRIGGER, EDIT_USER_ACTION); - // What's missing here is type analysis to ensure the context emitted by the trigger - // is the same context that the action requires. - deps.uiActions.attachAction(COUNTRY_TRIGGER, VIEW_IN_MAPS_ACTION); - deps.uiActions.attachAction(COUNTRY_TRIGGER, TRAVEL_GUIDE_ACTION); - deps.uiActions.attachAction(COUNTRY_TRIGGER, SHOWCASE_PLUGGABILITY_ACTION); - deps.uiActions.attachAction(PHONE_TRIGGER, CALL_PHONE_NUMBER_ACTION); - deps.uiActions.attachAction(PHONE_TRIGGER, SHOWCASE_PLUGGABILITY_ACTION); - deps.uiActions.attachAction(USER_TRIGGER, SHOWCASE_PLUGGABILITY_ACTION); + deps.uiActions.attachAction(COUNTRY_TRIGGER, viewInMapsAction); + deps.uiActions.attachAction(COUNTRY_TRIGGER, lookUpWeatherAction); + deps.uiActions.attachAction(COUNTRY_TRIGGER, showcasePluggability); + deps.uiActions.attachAction(PHONE_TRIGGER, makePhoneCallAction); + deps.uiActions.attachAction(PHONE_TRIGGER, showcasePluggability); + deps.uiActions.attachAction(USER_TRIGGER, showcasePluggability); core.application.register({ id: 'uiActionsExplorer', diff --git a/examples/ui_actions_explorer/public/trigger_context_example.tsx b/examples/ui_actions_explorer/public/trigger_context_example.tsx index 00d974e938138..4b88652103966 100644 --- a/examples/ui_actions_explorer/public/trigger_context_example.tsx +++ b/examples/ui_actions_explorer/public/trigger_context_example.tsx @@ -47,7 +47,7 @@ const createRowData = ( { - uiActionsApi.executeTriggerActions(COUNTRY_TRIGGER, user.countryOfResidence); + uiActionsApi.executeTriggerActions(COUNTRY_TRIGGER, { country: user.countryOfResidence }); }} > {user.countryOfResidence} @@ -59,7 +59,7 @@ const createRowData = ( { - uiActionsApi.executeTriggerActions(PHONE_TRIGGER, user.phone!); + uiActionsApi.executeTriggerActions(PHONE_TRIGGER, { phone: user.phone! }); }} > {user.phone} diff --git a/examples/url_generators_examples/README.md b/examples/url_generators_examples/README.md new file mode 100644 index 0000000000000..facd5c90c8c96 --- /dev/null +++ b/examples/url_generators_examples/README.md @@ -0,0 +1,7 @@ +## Access links examples + +This example app shows how to: + - Register a direct access link generator. + - Handle migration of legacy generators into a new one. + +To run this example, use the command `yarn start --run-examples`. Navigate to the access links explorer app \ No newline at end of file diff --git a/examples/url_generators_examples/kibana.json b/examples/url_generators_examples/kibana.json new file mode 100644 index 0000000000000..0767018e3bb98 --- /dev/null +++ b/examples/url_generators_examples/kibana.json @@ -0,0 +1,10 @@ +{ + "id": "urlGeneratorsExamples", + "version": "0.0.1", + "kibanaVersion": "kibana", + "configPath": ["url_generators_examples"], + "server": false, + "ui": true, + "requiredPlugins": ["share"], + "optionalPlugins": [] +} diff --git a/examples/url_generators_examples/package.json b/examples/url_generators_examples/package.json new file mode 100644 index 0000000000000..e07482db25f43 --- /dev/null +++ b/examples/url_generators_examples/package.json @@ -0,0 +1,17 @@ +{ + "name": "url_generators_examples", + "version": "1.0.0", + "main": "target/examples/url_generators_examples", + "kibana": { + "version": "kibana", + "templateVersion": "1.0.0" + }, + "license": "Apache-2.0", + "scripts": { + "kbn": "node ../../scripts/kbn.js", + "build": "rm -rf './target' && tsc" + }, + "devDependencies": { + "typescript": "3.5.3" + } +} diff --git a/examples/url_generators_examples/public/app.tsx b/examples/url_generators_examples/public/app.tsx new file mode 100644 index 0000000000000..c39cd876ea9b1 --- /dev/null +++ b/examples/url_generators_examples/public/app.tsx @@ -0,0 +1,89 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import React from 'react'; +import ReactDOM from 'react-dom'; + +import { EuiPageBody } from '@elastic/eui'; +import { EuiPageContent } from '@elastic/eui'; +import { EuiPageContentBody } from '@elastic/eui'; +import { Route, Switch, Redirect, Router, useLocation } from 'react-router-dom'; +import { createBrowserHistory } from 'history'; +import { EuiText } from '@elastic/eui'; +import { AppMountParameters } from '../../../src/core/public'; + +function useQuery() { + const { search } = useLocation(); + const params = React.useMemo(() => new URLSearchParams(search), [search]); + return params; +} + +interface HelloPageProps { + firstName: string; + lastName: string; +} + +const HelloPage = ({ firstName, lastName }: HelloPageProps) => ( + {`Hello ${firstName} ${lastName}`} +); + +export const Routes: React.FC<{}> = () => { + const query = useQuery(); + + return ( + + + + + + + + + + + + + ); +}; + +export const LinksExample: React.FC<{ + appBasePath: string; +}> = props => { + const history = React.useMemo( + () => + createBrowserHistory({ + basename: props.appBasePath, + }), + [props.appBasePath] + ); + return ( + + + + ); +}; + +export const renderApp = (props: { appBasePath: string }, { element }: AppMountParameters) => { + ReactDOM.render(, element); + + return () => ReactDOM.unmountComponentAtNode(element); +}; diff --git a/examples/url_generators_examples/public/index.ts b/examples/url_generators_examples/public/index.ts new file mode 100644 index 0000000000000..e87f9237bff38 --- /dev/null +++ b/examples/url_generators_examples/public/index.ts @@ -0,0 +1,22 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { AccessLinksExamplesPlugin } from './plugin'; + +export const plugin = () => new AccessLinksExamplesPlugin(); diff --git a/examples/url_generators_examples/public/plugin.tsx b/examples/url_generators_examples/public/plugin.tsx new file mode 100644 index 0000000000000..016494037ec05 --- /dev/null +++ b/examples/url_generators_examples/public/plugin.tsx @@ -0,0 +1,76 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { SharePluginStart, SharePluginSetup } from '../../../src/plugins/share/public'; +import { Plugin, CoreSetup, AppMountParameters } from '../../../src/core/public'; +import { + HelloLinkGeneratorState, + createHelloPageLinkGenerator, + LegacyHelloLinkGeneratorState, + HELLO_URL_GENERATOR_V1, + HELLO_URL_GENERATOR, + helloPageLinkGeneratorV1, +} from './url_generator'; + +declare module '../../../src/plugins/share/public' { + export interface UrlGeneratorStateMapping { + [HELLO_URL_GENERATOR_V1]: LegacyHelloLinkGeneratorState; + [HELLO_URL_GENERATOR]: HelloLinkGeneratorState; + } +} + +interface StartDeps { + share: SharePluginStart; +} + +interface SetupDeps { + share: SharePluginSetup; +} + +const APP_ID = 'urlGeneratorsExamples'; + +export class AccessLinksExamplesPlugin implements Plugin { + public setup(core: CoreSetup, { share: { urlGenerators } }: SetupDeps) { + urlGenerators.registerUrlGenerator( + createHelloPageLinkGenerator(async () => ({ + appBasePath: (await core.getStartServices())[0].application.getUrlForApp(APP_ID), + })) + ); + + urlGenerators.registerUrlGenerator(helloPageLinkGeneratorV1); + + core.application.register({ + id: APP_ID, + title: 'Access links examples', + async mount(params: AppMountParameters) { + const { renderApp } = await import('./app'); + return renderApp( + { + appBasePath: params.appBasePath, + }, + params + ); + }, + }); + } + + public start() {} + + public stop() {} +} diff --git a/examples/url_generators_examples/public/url_generator.ts b/examples/url_generators_examples/public/url_generator.ts new file mode 100644 index 0000000000000..f21b1c9295e66 --- /dev/null +++ b/examples/url_generators_examples/public/url_generator.ts @@ -0,0 +1,78 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import url from 'url'; +import { UrlGeneratorState, UrlGeneratorsDefinition } from '../../../src/plugins/share/public'; + +/** + * The name of the latest variable can always stay the same so code that + * uses this link generator statically will switch to the latest version. + * Typescript will warn the developer if incorrect state is being passed + * down. + */ +export const HELLO_URL_GENERATOR = 'HELLO_URL_GENERATOR_V2'; + +export interface HelloLinkState { + firstName: string; + lastName: string; +} + +export type HelloLinkGeneratorState = UrlGeneratorState; + +export const createHelloPageLinkGenerator = ( + getStartServices: () => Promise<{ appBasePath: string }> +): UrlGeneratorsDefinition => ({ + id: HELLO_URL_GENERATOR, + createUrl: async state => { + const startServices = await getStartServices(); + const appBasePath = startServices.appBasePath; + const parsedUrl = url.parse(window.location.href); + + return url.format({ + protocol: parsedUrl.protocol, + host: parsedUrl.host, + pathname: `${appBasePath}/hello`, + query: { + ...state, + }, + }); + }, +}); + +/** + * The name of this legacy generator id changes, but the *value* stays the same. + */ +export const HELLO_URL_GENERATOR_V1 = 'HELLO_URL_GENERATOR'; + +export interface HelloLinkStateV1 { + name: string; +} + +export type LegacyHelloLinkGeneratorState = UrlGeneratorState< + HelloLinkStateV1, + typeof HELLO_URL_GENERATOR, + HelloLinkState +>; + +export const helloPageLinkGeneratorV1: UrlGeneratorsDefinition = { + id: HELLO_URL_GENERATOR_V1, + isDeprecated: true, + migrate: async state => { + return { id: HELLO_URL_GENERATOR, state: { firstName: state.name, lastName: '' } }; + }, +}; diff --git a/examples/url_generators_examples/tsconfig.json b/examples/url_generators_examples/tsconfig.json new file mode 100644 index 0000000000000..091130487791b --- /dev/null +++ b/examples/url_generators_examples/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./target", + "skipLibCheck": true + }, + "include": [ + "index.ts", + "public/**/*.ts", + "public/**/*.tsx", + "server/**/*.ts", + "../../typings/**/*" + ], + "exclude": [] +} diff --git a/examples/url_generators_explorer/README.md b/examples/url_generators_explorer/README.md new file mode 100644 index 0000000000000..922cf37aff847 --- /dev/null +++ b/examples/url_generators_explorer/README.md @@ -0,0 +1,8 @@ +## Access links explorer + +This example app shows how to: + - Generate links to other applications + - Generate dynamic links, when the target application is not known + - Handle backward compatibility of urls + +To run this example, use the command `yarn start --run-examples`. \ No newline at end of file diff --git a/examples/url_generators_explorer/kibana.json b/examples/url_generators_explorer/kibana.json new file mode 100644 index 0000000000000..94ab75b338889 --- /dev/null +++ b/examples/url_generators_explorer/kibana.json @@ -0,0 +1,10 @@ +{ + "id": "urlGeneratorsExplorer", + "version": "0.0.1", + "kibanaVersion": "kibana", + "configPath": ["url_generators_explorer"], + "server": false, + "ui": true, + "requiredPlugins": ["share", "urlGeneratorsExamples"], + "optionalPlugins": [] +} diff --git a/examples/url_generators_explorer/package.json b/examples/url_generators_explorer/package.json new file mode 100644 index 0000000000000..52da533dc0c05 --- /dev/null +++ b/examples/url_generators_explorer/package.json @@ -0,0 +1,17 @@ +{ + "name": "url_generators_explorer", + "version": "1.0.0", + "main": "target/examples/url_generators_explorer", + "kibana": { + "version": "kibana", + "templateVersion": "1.0.0" + }, + "license": "Apache-2.0", + "scripts": { + "kbn": "node ../../scripts/kbn.js", + "build": "rm -rf './target' && tsc" + }, + "devDependencies": { + "typescript": "3.5.3" + } +} diff --git a/examples/url_generators_explorer/public/app.tsx b/examples/url_generators_explorer/public/app.tsx new file mode 100644 index 0000000000000..77e804ae08c5f --- /dev/null +++ b/examples/url_generators_explorer/public/app.tsx @@ -0,0 +1,170 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import React, { useState, useEffect } from 'react'; +import ReactDOM from 'react-dom'; + +import { EuiPage } from '@elastic/eui'; + +import { EuiButton } from '@elastic/eui'; +import { EuiPageBody } from '@elastic/eui'; +import { EuiPageContent } from '@elastic/eui'; +import { EuiPageContentBody } from '@elastic/eui'; +import { EuiSpacer } from '@elastic/eui'; +import { EuiText } from '@elastic/eui'; +import { EuiFieldText } from '@elastic/eui'; +import { EuiPageHeader } from '@elastic/eui'; +import { EuiLink } from '@elastic/eui'; +import { AppMountParameters } from '../../../src/core/public'; +import { UrlGeneratorsService } from '../../../src/plugins/share/public'; +import { + HELLO_URL_GENERATOR, + HELLO_URL_GENERATOR_V1, +} from '../../url_generators_examples/public/url_generator'; + +interface Props { + getLinkGenerator: UrlGeneratorsService['getUrlGenerator']; +} + +interface MigratedLink { + isDeprecated: boolean; + linkText: string; + link: string; +} + +const ActionsExplorer = ({ getLinkGenerator }: Props) => { + const [migratedLinks, setMigratedLinks] = useState([] as MigratedLink[]); + const [buildingLinks, setBuildingLinks] = useState(false); + const [firstName, setFirstName] = useState(''); + const [lastName, setLastName] = useState(''); + /** + * Lets pretend we grabbed these links from a persistent store, like a saved object. + * Some of these links were created with older versions of the hello link generator. + * They use deprecated generator ids. + */ + const [persistedLinks, setPersistedLinks] = useState([ + { + id: HELLO_URL_GENERATOR_V1, + linkText: 'Say hello to Mary', + state: { + name: 'Mary', + }, + }, + { + id: HELLO_URL_GENERATOR, + linkText: 'Say hello to George', + state: { + firstName: 'George', + lastName: 'Washington', + }, + }, + ]); + + useEffect(() => { + setBuildingLinks(true); + + const updateLinks = async () => { + const updatedLinks = await Promise.all( + persistedLinks.map(async savedLink => { + const generator = getLinkGenerator(savedLink.id); + const link = await generator.createUrl(savedLink.state); + return { + isDeprecated: generator.isDeprecated, + linkText: savedLink.linkText, + link, + }; + }) + ); + setMigratedLinks(updatedLinks); + setBuildingLinks(false); + }; + + updateLinks(); + }, [getLinkGenerator, persistedLinks]); + + return ( + + + Access links explorer + + + +

Create new links using the most recent version of a url generator.

+
+ { + setFirstName(e.target.value); + }} + /> + setLastName(e.target.value)} /> + + setPersistedLinks([ + ...persistedLinks, + { + id: HELLO_URL_GENERATOR, + state: { firstName, lastName }, + linkText: `Say hello to ${firstName} ${lastName}`, + }, + ]) + } + > + Add new link + + + + +

+ Existing links retrieved from storage. The links that were generated from legacy + generators are in red. This can be useful for developers to know they will have to + migrate persisted state or in a future version of Kibana, these links may no longer + work. They still work now because legacy url generators must provide a state + migration function. +

+
+ {buildingLinks ? ( +
loading...
+ ) : ( + migratedLinks.map(link => ( + + + {link.linkText} + +
+
+ )) + )} +
+
+
+
+ ); +}; + +export const renderApp = (props: Props, { element }: AppMountParameters) => { + ReactDOM.render(, element); + + return () => ReactDOM.unmountComponentAtNode(element); +}; diff --git a/examples/url_generators_explorer/public/index.ts b/examples/url_generators_explorer/public/index.ts new file mode 100644 index 0000000000000..30ff481dbe3a5 --- /dev/null +++ b/examples/url_generators_explorer/public/index.ts @@ -0,0 +1,22 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { AccessLinksExplorerPlugin } from './plugin'; + +export const plugin = () => new AccessLinksExplorerPlugin(); diff --git a/examples/url_generators_explorer/public/page.tsx b/examples/url_generators_explorer/public/page.tsx new file mode 100644 index 0000000000000..90bea35804822 --- /dev/null +++ b/examples/url_generators_explorer/public/page.tsx @@ -0,0 +1,51 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import React from 'react'; + +import { + EuiPageBody, + EuiPageContent, + EuiPageContentBody, + EuiPageHeader, + EuiPageHeaderSection, + EuiTitle, +} from '@elastic/eui'; + +interface PageProps { + title: string; + children: React.ReactNode; +} + +export function Page({ title, children }: PageProps) { + return ( + + + + +

{title}

+
+
+
+ + {children} + +
+ ); +} diff --git a/examples/url_generators_explorer/public/plugin.tsx b/examples/url_generators_explorer/public/plugin.tsx new file mode 100644 index 0000000000000..1fe70476b8e79 --- /dev/null +++ b/examples/url_generators_explorer/public/plugin.tsx @@ -0,0 +1,48 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { SharePluginStart } from 'src/plugins/share/public'; +import { Plugin, CoreSetup, AppMountParameters } from '../../../src/core/public'; + +interface StartDeps { + share: SharePluginStart; +} + +export class AccessLinksExplorerPlugin implements Plugin { + public setup(core: CoreSetup) { + core.application.register({ + id: 'urlGeneratorsExplorer', + title: 'Access links explorer', + async mount(params: AppMountParameters) { + const depsStart = (await core.getStartServices())[1]; + const { renderApp } = await import('./app'); + return renderApp( + { + getLinkGenerator: depsStart.share.urlGenerators.getUrlGenerator, + }, + params + ); + }, + }); + } + + public start() {} + + public stop() {} +} diff --git a/examples/url_generators_explorer/tsconfig.json b/examples/url_generators_explorer/tsconfig.json new file mode 100644 index 0000000000000..091130487791b --- /dev/null +++ b/examples/url_generators_explorer/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./target", + "skipLibCheck": true + }, + "include": [ + "index.ts", + "public/**/*.ts", + "public/**/*.tsx", + "server/**/*.ts", + "../../typings/**/*" + ], + "exclude": [] +} diff --git a/package.json b/package.json index 2c401724c72cd..9f4d4450f459d 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "uiFramework:documentComponent": "cd packages/kbn-ui-framework && yarn documentComponent", "kbn:watch": "node scripts/kibana --dev --logging.json=false", "build:types": "tsc --p tsconfig.types.json", - "core:acceptApiChanges": "node scripts/check_core_api_changes.js --accept", + "docs:acceptApiChanges": "node scripts/check_published_api_changes.js --accept", "kbn:bootstrap": "yarn build:types && node scripts/register_git_hook", "spec_to_console": "node scripts/spec_to_console", "backport-skip-ci": "backport --prDescription \"[skip-ci]\"", @@ -120,13 +120,14 @@ "@elastic/charts": "^17.1.1", "@elastic/datemath": "5.0.2", "@elastic/ems-client": "7.6.0", - "@elastic/eui": "19.0.0", + "@elastic/eui": "20.0.2", "@elastic/filesaver": "1.1.2", "@elastic/good": "8.1.1-kibana2", "@elastic/numeral": "2.4.0", "@elastic/request-crypto": "^1.0.2", "@elastic/ui-ace": "0.2.3", - "@hapi/wreck": "^15.0.1", + "@hapi/good-squeeze": "5.2.1", + "@hapi/wreck": "^15.0.2", "@kbn/analytics": "1.0.0", "@kbn/babel-code-parser": "1.0.0", "@kbn/babel-preset": "1.0.0", @@ -179,7 +180,6 @@ "glob": "^7.1.2", "glob-all": "^3.1.0", "globby": "^8.0.1", - "good-squeeze": "2.1.0", "h2o2": "^8.1.2", "handlebars": "4.5.3", "hapi": "^17.5.3", @@ -203,7 +203,7 @@ "leaflet-responsive-popup": "0.6.4", "leaflet-vega": "^0.8.6", "leaflet.heat": "0.2.0", - "less": "^2.7.3", + "less": "^3.0.2", "less-loader": "5.0.0", "lodash": "npm:@elastic/lodash@3.10.1-kibana4", "lodash.clonedeep": "^4.5.0", @@ -246,6 +246,7 @@ "regenerator-runtime": "^0.13.3", "regression": "2.0.1", "request": "^2.88.0", + "require-in-the-middle": "^5.0.2", "reselect": "^4.0.0", "resize-observer-polyfill": "^1.5.0", "rison-node": "1.0.2", @@ -480,6 +481,7 @@ "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", + "tape": "^4.13.0", "tree-kill": "^1.2.2", "typescript": "3.7.2", "typings-tester": "^0.3.2", diff --git a/packages/kbn-config-schema/src/byte_size_value/__snapshots__/index.test.ts.snap b/packages/kbn-config-schema/src/byte_size_value/__snapshots__/index.test.ts.snap deleted file mode 100644 index 97e9082401b3d..0000000000000 --- a/packages/kbn-config-schema/src/byte_size_value/__snapshots__/index.test.ts.snap +++ /dev/null @@ -1,11 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`#constructor throws if number of bytes is negative 1`] = `"Value in bytes is expected to be a safe positive integer, but provided [-1024]."`; - -exports[`#constructor throws if number of bytes is not safe 1`] = `"Value in bytes is expected to be a safe positive integer, but provided [NaN]."`; - -exports[`#constructor throws if number of bytes is not safe 2`] = `"Value in bytes is expected to be a safe positive integer, but provided [Infinity]."`; - -exports[`#constructor throws if number of bytes is not safe 3`] = `"Value in bytes is expected to be a safe positive integer, but provided [9007199254740992]."`; - -exports[`parsing units throws an error when unsupported unit specified 1`] = `"Failed to parse [1tb] as byte value. Value must be either number of bytes, or follow the format [b|kb|mb|gb] (e.g., '1024kb', '200mb', '1gb'), where the number is a safe positive integer."`; diff --git a/packages/kbn-config-schema/src/byte_size_value/index.test.ts b/packages/kbn-config-schema/src/byte_size_value/index.test.ts index 198d95aa0ab4c..59960a4567f60 100644 --- a/packages/kbn-config-schema/src/byte_size_value/index.test.ts +++ b/packages/kbn-config-schema/src/byte_size_value/index.test.ts @@ -42,19 +42,29 @@ describe('parsing units', () => { }); test('throws an error when unsupported unit specified', () => { - expect(() => ByteSizeValue.parse('1tb')).toThrowErrorMatchingSnapshot(); + expect(() => ByteSizeValue.parse('1tb')).toThrowErrorMatchingInlineSnapshot( + `"Failed to parse value as byte value. Value must be either number of bytes, or follow the format [b|kb|mb|gb] (e.g., '1024kb', '200mb', '1gb'), where the number is a safe positive integer."` + ); }); }); describe('#constructor', () => { test('throws if number of bytes is negative', () => { - expect(() => new ByteSizeValue(-1024)).toThrowErrorMatchingSnapshot(); + expect(() => new ByteSizeValue(-1024)).toThrowErrorMatchingInlineSnapshot( + `"Value in bytes is expected to be a safe positive integer."` + ); }); test('throws if number of bytes is not safe', () => { - expect(() => new ByteSizeValue(NaN)).toThrowErrorMatchingSnapshot(); - expect(() => new ByteSizeValue(Infinity)).toThrowErrorMatchingSnapshot(); - expect(() => new ByteSizeValue(Math.pow(2, 53))).toThrowErrorMatchingSnapshot(); + expect(() => new ByteSizeValue(NaN)).toThrowErrorMatchingInlineSnapshot( + `"Value in bytes is expected to be a safe positive integer."` + ); + expect(() => new ByteSizeValue(Infinity)).toThrowErrorMatchingInlineSnapshot( + `"Value in bytes is expected to be a safe positive integer."` + ); + expect(() => new ByteSizeValue(Math.pow(2, 53))).toThrowErrorMatchingInlineSnapshot( + `"Value in bytes is expected to be a safe positive integer."` + ); }); test('accepts 0', () => { diff --git a/packages/kbn-config-schema/src/byte_size_value/index.ts b/packages/kbn-config-schema/src/byte_size_value/index.ts index 48862821bb78d..183a6c30f3839 100644 --- a/packages/kbn-config-schema/src/byte_size_value/index.ts +++ b/packages/kbn-config-schema/src/byte_size_value/index.ts @@ -38,7 +38,7 @@ export class ByteSizeValue { const number = Number(text); if (typeof number !== 'number' || isNaN(number)) { throw new Error( - `Failed to parse [${text}] as byte value. Value must be either number of bytes, or follow the format [b|kb|mb|gb] ` + + `Failed to parse value as byte value. Value must be either number of bytes, or follow the format [b|kb|mb|gb] ` + `(e.g., '1024kb', '200mb', '1gb'), where the number is a safe positive integer.` ); } @@ -53,9 +53,7 @@ export class ByteSizeValue { constructor(private readonly valueInBytes: number) { if (!Number.isSafeInteger(valueInBytes) || valueInBytes < 0) { - throw new Error( - `Value in bytes is expected to be a safe positive integer, but provided [${valueInBytes}].` - ); + throw new Error(`Value in bytes is expected to be a safe positive integer.`); } } diff --git a/packages/kbn-config-schema/src/duration/index.ts b/packages/kbn-config-schema/src/duration/index.ts index b96b5a3687bbb..282c150e8150a 100644 --- a/packages/kbn-config-schema/src/duration/index.ts +++ b/packages/kbn-config-schema/src/duration/index.ts @@ -28,7 +28,7 @@ function stringToDuration(text: string) { const number = Number(text); if (typeof number !== 'number' || isNaN(number)) { throw new Error( - `Failed to parse [${text}] as time value. Value must be a duration in milliseconds, or follow the format ` + + `Failed to parse value as time value. Value must be a duration in milliseconds, or follow the format ` + `[ms|s|m|h|d|w|M|Y] (e.g. '70ms', '5s', '3d', '1Y'), where the duration is a safe positive integer.` ); } @@ -43,9 +43,7 @@ function stringToDuration(text: string) { function numberToDuration(numberMs: number) { if (!Number.isSafeInteger(numberMs) || numberMs < 0) { - throw new Error( - `Value in milliseconds is expected to be a safe positive integer, but provided [${numberMs}].` - ); + throw new Error(`Value in milliseconds is expected to be a safe positive integer.`); } return momentDuration(numberMs); diff --git a/packages/kbn-config-schema/src/types/__snapshots__/any_type.test.ts.snap b/packages/kbn-config-schema/src/types/__snapshots__/any_type.test.ts.snap deleted file mode 100644 index 3a40752d52b6e..0000000000000 --- a/packages/kbn-config-schema/src/types/__snapshots__/any_type.test.ts.snap +++ /dev/null @@ -1,5 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`includes namespace in failure 1`] = `"[foo-namespace]: expected value of type [any] but got [undefined]"`; - -exports[`is required by default 1`] = `"expected value of type [any] but got [undefined]"`; diff --git a/packages/kbn-config-schema/src/types/__snapshots__/boolean_type.test.ts.snap b/packages/kbn-config-schema/src/types/__snapshots__/boolean_type.test.ts.snap deleted file mode 100644 index 0e5f6de2deea8..0000000000000 --- a/packages/kbn-config-schema/src/types/__snapshots__/boolean_type.test.ts.snap +++ /dev/null @@ -1,15 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`includes namespace in failure 1`] = `"[foo-namespace]: expected value of type [boolean] but got [undefined]"`; - -exports[`is required by default 1`] = `"expected value of type [boolean] but got [undefined]"`; - -exports[`returns error when not boolean 1`] = `"expected value of type [boolean] but got [number]"`; - -exports[`returns error when not boolean 2`] = `"expected value of type [boolean] but got [Array]"`; - -exports[`returns error when not boolean 3`] = `"expected value of type [boolean] but got [string]"`; - -exports[`returns error when not boolean 4`] = `"expected value of type [boolean] but got [number]"`; - -exports[`returns error when not boolean 5`] = `"expected value of type [boolean] but got [string]"`; diff --git a/packages/kbn-config-schema/src/types/__snapshots__/buffer_type.test.ts.snap b/packages/kbn-config-schema/src/types/__snapshots__/buffer_type.test.ts.snap deleted file mode 100644 index 96a7ab34dac26..0000000000000 --- a/packages/kbn-config-schema/src/types/__snapshots__/buffer_type.test.ts.snap +++ /dev/null @@ -1,11 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`includes namespace in failure 1`] = `"[foo-namespace]: expected value of type [Buffer] but got [undefined]"`; - -exports[`is required by default 1`] = `"expected value of type [Buffer] but got [undefined]"`; - -exports[`returns error when not a buffer 1`] = `"expected value of type [Buffer] but got [number]"`; - -exports[`returns error when not a buffer 2`] = `"expected value of type [Buffer] but got [Array]"`; - -exports[`returns error when not a buffer 3`] = `"expected value of type [Buffer] but got [string]"`; diff --git a/packages/kbn-config-schema/src/types/__snapshots__/byte_size_type.test.ts.snap b/packages/kbn-config-schema/src/types/__snapshots__/byte_size_type.test.ts.snap deleted file mode 100644 index ea2102b1776fb..0000000000000 --- a/packages/kbn-config-schema/src/types/__snapshots__/byte_size_type.test.ts.snap +++ /dev/null @@ -1,61 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`#defaultValue can be a ByteSizeValue 1`] = ` -ByteSizeValue { - "valueInBytes": 1024, -} -`; - -exports[`#defaultValue can be a number 1`] = ` -ByteSizeValue { - "valueInBytes": 1024, -} -`; - -exports[`#defaultValue can be a string 1`] = ` -ByteSizeValue { - "valueInBytes": 1024, -} -`; - -exports[`#defaultValue can be a string-formatted number 1`] = ` -ByteSizeValue { - "valueInBytes": 1024, -} -`; - -exports[`#max returns error when larger 1`] = `"Value is [1mb] ([1048576b]) but it must be equal to or less than [1kb]"`; - -exports[`#max returns value when smaller 1`] = ` -ByteSizeValue { - "valueInBytes": 1, -} -`; - -exports[`#min returns error when smaller 1`] = `"Value is [1b] ([1b]) but it must be equal to or greater than [1kb]"`; - -exports[`#min returns value when larger 1`] = ` -ByteSizeValue { - "valueInBytes": 1024, -} -`; - -exports[`includes namespace in failure 1`] = `"[foo-namespace]: expected value of type [ByteSize] but got [undefined]"`; - -exports[`is required by default 1`] = `"expected value of type [ByteSize] but got [undefined]"`; - -exports[`returns error when not valid string or positive safe integer 1`] = `"Value in bytes is expected to be a safe positive integer, but provided [-123]."`; - -exports[`returns error when not valid string or positive safe integer 2`] = `"Value in bytes is expected to be a safe positive integer, but provided [NaN]."`; - -exports[`returns error when not valid string or positive safe integer 3`] = `"Value in bytes is expected to be a safe positive integer, but provided [Infinity]."`; - -exports[`returns error when not valid string or positive safe integer 4`] = `"Value in bytes is expected to be a safe positive integer, but provided [9007199254740992]."`; - -exports[`returns error when not valid string or positive safe integer 5`] = `"expected value of type [ByteSize] but got [Array]"`; - -exports[`returns error when not valid string or positive safe integer 6`] = `"expected value of type [ByteSize] but got [RegExp]"`; - -exports[`returns error when not valid string or positive safe integer 7`] = `"Failed to parse [123foo] as byte value. Value must be either number of bytes, or follow the format [b|kb|mb|gb] (e.g., '1024kb', '200mb', '1gb'), where the number is a safe positive integer."`; - -exports[`returns error when not valid string or positive safe integer 8`] = `"Failed to parse [123 456] as byte value. Value must be either number of bytes, or follow the format [b|kb|mb|gb] (e.g., '1024kb', '200mb', '1gb'), where the number is a safe positive integer."`; diff --git a/packages/kbn-config-schema/src/types/__snapshots__/conditional_type.test.ts.snap b/packages/kbn-config-schema/src/types/__snapshots__/conditional_type.test.ts.snap deleted file mode 100644 index b32db114860f5..0000000000000 --- a/packages/kbn-config-schema/src/types/__snapshots__/conditional_type.test.ts.snap +++ /dev/null @@ -1,45 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`correctly handles missing references 1`] = `"[value]: expected value of type [string] but got [number]"`; - -exports[`includes namespace into failures 1`] = `"[mega-namespace.value]: expected value of type [string] but got [number]"`; - -exports[`includes namespace into failures 2`] = `"[mega-namespace.value]: expected value of type [number] but got [string]"`; - -exports[`properly handles conditionals within objects 1`] = `"[value]: expected value of type [string] but got [number]"`; - -exports[`properly handles conditionals within objects 2`] = `"[value]: expected value of type [number] but got [string]"`; - -exports[`properly handles schemas with incompatible types 1`] = `"expected value of type [string] but got [boolean]"`; - -exports[`properly handles schemas with incompatible types 2`] = `"expected value of type [boolean] but got [string]"`; - -exports[`properly validates types according chosen schema 1`] = `"value is [a] but it must have a minimum length of [2]."`; - -exports[`properly validates types according chosen schema 2`] = `"value is [ab] but it must have a maximum length of [1]."`; - -exports[`properly validates when compares with "null" literal Schema 1`] = `"value is [a] but it must have a minimum length of [2]."`; - -exports[`properly validates when compares with "null" literal Schema 2`] = `"value is [ab] but it must have a minimum length of [3]."`; - -exports[`properly validates when compares with Schema 1`] = `"value is [a] but it must have a minimum length of [2]."`; - -exports[`properly validates when compares with Schema 2`] = `"value is [ab] but it must have a minimum length of [3]."`; - -exports[`required by default 1`] = `"expected value of type [string] but got [undefined]"`; - -exports[`works with both context and sibling references 1`] = `"[value]: expected value of type [string] but got [number]"`; - -exports[`works with both context and sibling references 2`] = `"[value]: expected value of type [number] but got [string]"`; - -exports[`works within \`oneOf\` 1`] = ` -"types that failed validation: -- [0]: expected value of type [string] but got [number] -- [1]: expected value of type [array] but got [number]" -`; - -exports[`works within \`oneOf\` 2`] = ` -"types that failed validation: -- [0]: expected value of type [string] but got [boolean] -- [1]: expected value of type [array] but got [boolean]" -`; diff --git a/packages/kbn-config-schema/src/types/__snapshots__/duration_type.test.ts.snap b/packages/kbn-config-schema/src/types/__snapshots__/duration_type.test.ts.snap deleted file mode 100644 index c4e4ff652a2d7..0000000000000 --- a/packages/kbn-config-schema/src/types/__snapshots__/duration_type.test.ts.snap +++ /dev/null @@ -1,29 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`#defaultValue can be a moment.Duration 1`] = `"PT1H"`; - -exports[`#defaultValue can be a number 1`] = `"PT0.6S"`; - -exports[`#defaultValue can be a string 1`] = `"PT1H"`; - -exports[`#defaultValue can be a string-formatted number 1`] = `"PT0.6S"`; - -exports[`includes namespace in failure 1`] = `"[foo-namespace]: expected value of type [moment.Duration] but got [undefined]"`; - -exports[`is required by default 1`] = `"expected value of type [moment.Duration] but got [undefined]"`; - -exports[`returns error when not valid string or non-safe positive integer 1`] = `"Value in milliseconds is expected to be a safe positive integer, but provided [-123]."`; - -exports[`returns error when not valid string or non-safe positive integer 2`] = `"Value in milliseconds is expected to be a safe positive integer, but provided [NaN]."`; - -exports[`returns error when not valid string or non-safe positive integer 3`] = `"Value in milliseconds is expected to be a safe positive integer, but provided [Infinity]."`; - -exports[`returns error when not valid string or non-safe positive integer 4`] = `"Value in milliseconds is expected to be a safe positive integer, but provided [9007199254740992]."`; - -exports[`returns error when not valid string or non-safe positive integer 5`] = `"expected value of type [moment.Duration] but got [Array]"`; - -exports[`returns error when not valid string or non-safe positive integer 6`] = `"expected value of type [moment.Duration] but got [RegExp]"`; - -exports[`returns error when not valid string or non-safe positive integer 7`] = `"Failed to parse [123foo] as time value. Value must be a duration in milliseconds, or follow the format [ms|s|m|h|d|w|M|Y] (e.g. '70ms', '5s', '3d', '1Y'), where the duration is a safe positive integer."`; - -exports[`returns error when not valid string or non-safe positive integer 8`] = `"Failed to parse [123 456] as time value. Value must be a duration in milliseconds, or follow the format [ms|s|m|h|d|w|M|Y] (e.g. '70ms', '5s', '3d', '1Y'), where the duration is a safe positive integer."`; diff --git a/packages/kbn-config-schema/src/types/__snapshots__/literal_type.test.ts.snap b/packages/kbn-config-schema/src/types/__snapshots__/literal_type.test.ts.snap deleted file mode 100644 index 14d474b4a516b..0000000000000 --- a/packages/kbn-config-schema/src/types/__snapshots__/literal_type.test.ts.snap +++ /dev/null @@ -1,13 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`includes namespace in failure 1`] = `"[foo-namespace]: expected value to equal [test] but got [foo]"`; - -exports[`returns error when not correct 1`] = `"expected value to equal [test] but got [foo]"`; - -exports[`returns error when not correct 2`] = `"expected value to equal [true] but got [false]"`; - -exports[`returns error when not correct 3`] = `"expected value to equal [test] but got [1,2,3]"`; - -exports[`returns error when not correct 4`] = `"expected value to equal [123] but got [abc]"`; - -exports[`returns error when not correct 5`] = `"expected value to equal [null] but got [42]"`; diff --git a/packages/kbn-config-schema/src/types/__snapshots__/maybe_type.test.ts.snap b/packages/kbn-config-schema/src/types/__snapshots__/maybe_type.test.ts.snap deleted file mode 100644 index fdb172df356a7..0000000000000 --- a/packages/kbn-config-schema/src/types/__snapshots__/maybe_type.test.ts.snap +++ /dev/null @@ -1,9 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`fails if null 1`] = `"expected value of type [string] but got [null]"`; - -exports[`includes namespace in failure 1`] = `"[foo-namespace]: expected value of type [string] but got [null]"`; - -exports[`validates basic type 1`] = `"expected value of type [string] but got [number]"`; - -exports[`validates contained type 1`] = `"value is [foo] but it must have a maximum length of [1]."`; diff --git a/packages/kbn-config-schema/src/types/__snapshots__/never_type.test.ts.snap b/packages/kbn-config-schema/src/types/__snapshots__/never_type.test.ts.snap deleted file mode 100644 index 6eea2a7cefc72..0000000000000 --- a/packages/kbn-config-schema/src/types/__snapshots__/never_type.test.ts.snap +++ /dev/null @@ -1,13 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`throws on any value set 1`] = `"a value wasn't expected to be present"`; - -exports[`throws on any value set 2`] = `"a value wasn't expected to be present"`; - -exports[`throws on any value set 3`] = `"a value wasn't expected to be present"`; - -exports[`throws on any value set 4`] = `"a value wasn't expected to be present"`; - -exports[`throws on value set as object property 1`] = `"[name]: a value wasn't expected to be present"`; - -exports[`works for conditional types 1`] = `"[name]: a value wasn't expected to be present"`; diff --git a/packages/kbn-config-schema/src/types/__snapshots__/nullable_type.test.ts.snap b/packages/kbn-config-schema/src/types/__snapshots__/nullable_type.test.ts.snap deleted file mode 100644 index 96ab664921fdf..0000000000000 --- a/packages/kbn-config-schema/src/types/__snapshots__/nullable_type.test.ts.snap +++ /dev/null @@ -1,25 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`includes namespace in failure 1`] = ` -"[foo-namespace]: types that failed validation: -- [foo-namespace.0]: value is [foo] but it must have a maximum length of [1]. -- [foo-namespace.1]: expected value to equal [null] but got [foo]" -`; - -exports[`validates basic type 1`] = ` -"types that failed validation: -- [0]: expected value of type [string] but got [number] -- [1]: expected value to equal [null] but got [666]" -`; - -exports[`validates contained type 1`] = ` -"types that failed validation: -- [0]: value is [foo] but it must have a maximum length of [1]. -- [1]: expected value to equal [null] but got [foo]" -`; - -exports[`validates type errors in object 1`] = ` -"[foo]: types that failed validation: -- [foo.0]: value is [ab] but it must have a maximum length of [1]. -- [foo.1]: expected value to equal [null] but got [ab]" -`; diff --git a/packages/kbn-config-schema/src/types/__snapshots__/number_type.test.ts.snap b/packages/kbn-config-schema/src/types/__snapshots__/number_type.test.ts.snap deleted file mode 100644 index 5d1e5fcf1ef81..0000000000000 --- a/packages/kbn-config-schema/src/types/__snapshots__/number_type.test.ts.snap +++ /dev/null @@ -1,17 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`#max returns error when larger number 1`] = `"Value is [3] but it must be equal to or lower than [2]."`; - -exports[`#min returns error when smaller number 1`] = `"Value is [3] but it must be equal to or greater than [4]."`; - -exports[`fails if number is \`NaN\` 1`] = `"expected value of type [number] but got [number]"`; - -exports[`includes namespace in failure 1`] = `"[foo-namespace]: expected value of type [number] but got [undefined]"`; - -exports[`is required by default 1`] = `"expected value of type [number] but got [undefined]"`; - -exports[`returns error when not number or numeric string 1`] = `"expected value of type [number] but got [string]"`; - -exports[`returns error when not number or numeric string 2`] = `"expected value of type [number] but got [Array]"`; - -exports[`returns error when not number or numeric string 3`] = `"expected value of type [number] but got [RegExp]"`; diff --git a/packages/kbn-config-schema/src/types/__snapshots__/one_of_type.test.ts.snap b/packages/kbn-config-schema/src/types/__snapshots__/one_of_type.test.ts.snap deleted file mode 100644 index 75dfff456ebe7..0000000000000 --- a/packages/kbn-config-schema/src/types/__snapshots__/one_of_type.test.ts.snap +++ /dev/null @@ -1,32 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`fails if not matching literal 1`] = ` -"types that failed validation: -- [0]: expected value to equal [foo] but got [bar]" -`; - -exports[`fails if not matching multiple types 1`] = ` -"types that failed validation: -- [0]: expected value of type [string] but got [boolean] -- [1]: expected value of type [number] but got [boolean]" -`; - -exports[`fails if not matching type 1`] = ` -"types that failed validation: -- [0]: expected value of type [string] but got [boolean]" -`; - -exports[`fails if not matching type 2`] = ` -"types that failed validation: -- [0]: expected value of type [string] but got [number]" -`; - -exports[`handles object with wrong type 1`] = ` -"types that failed validation: -- [0.age]: expected value of type [number] but got [string]" -`; - -exports[`includes namespace in failure 1`] = ` -"[foo-namespace]: types that failed validation: -- [foo-namespace.0.age]: expected value of type [number] but got [string]" -`; diff --git a/packages/kbn-config-schema/src/types/__snapshots__/stream_type.test.ts.snap b/packages/kbn-config-schema/src/types/__snapshots__/stream_type.test.ts.snap deleted file mode 100644 index e813b4f68a09e..0000000000000 --- a/packages/kbn-config-schema/src/types/__snapshots__/stream_type.test.ts.snap +++ /dev/null @@ -1,11 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`includes namespace in failure 1`] = `"[foo-namespace]: expected value of type [Stream] but got [undefined]"`; - -exports[`is required by default 1`] = `"expected value of type [Buffer] but got [undefined]"`; - -exports[`returns error when not a stream 1`] = `"expected value of type [Stream] but got [number]"`; - -exports[`returns error when not a stream 2`] = `"expected value of type [Stream] but got [Array]"`; - -exports[`returns error when not a stream 3`] = `"expected value of type [Stream] but got [string]"`; diff --git a/packages/kbn-config-schema/src/types/__snapshots__/string_type.test.ts.snap b/packages/kbn-config-schema/src/types/__snapshots__/string_type.test.ts.snap deleted file mode 100644 index 8e1f63fb66733..0000000000000 --- a/packages/kbn-config-schema/src/types/__snapshots__/string_type.test.ts.snap +++ /dev/null @@ -1,35 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`#hostname returns error when empty string 1`] = `"any.empty"`; - -exports[`#hostname returns error when value is not a valid hostname 1`] = `"value is [host:name] but it must be a valid hostname (see RFC 1123)."`; - -exports[`#hostname returns error when value is not a valid hostname 2`] = `"value is [localhost:5601] but it must be a valid hostname (see RFC 1123)."`; - -exports[`#hostname returns error when value is not a valid hostname 3`] = `"value is [-] but it must be a valid hostname (see RFC 1123)."`; - -exports[`#hostname returns error when value is not a valid hostname 4`] = `"value is [0:?:0:0:0:0:0:1] but it must be a valid hostname (see RFC 1123)."`; - -exports[`#hostname returns error when value is not a valid hostname 5`] = `"value is [aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] but it must be a valid hostname (see RFC 1123)."`; - -exports[`#hostname supports string validation rules 1`] = `"value is [www.example.com] but it must have a maximum length of [3]."`; - -exports[`#maxLength returns error when longer string 1`] = `"value is [foo] but it must have a maximum length of [2]."`; - -exports[`#minLength returns error when empty string 1`] = `"value is [] but it must have a minimum length of [2]."`; - -exports[`#minLength returns error when shorter string 1`] = `"value is [foo] but it must have a minimum length of [4]."`; - -exports[`#validate throw when empty string 1`] = `"validator failure"`; - -exports[`#validate throws when returns string 1`] = `"validator failure"`; - -exports[`includes namespace in failure 1`] = `"[foo-namespace]: expected value of type [string] but got [undefined]"`; - -exports[`is required by default 1`] = `"expected value of type [string] but got [undefined]"`; - -exports[`returns error when not string 1`] = `"expected value of type [string] but got [number]"`; - -exports[`returns error when not string 2`] = `"expected value of type [string] but got [Array]"`; - -exports[`returns error when not string 3`] = `"expected value of type [string] but got [RegExp]"`; diff --git a/packages/kbn-config-schema/src/types/__snapshots__/uri_type.test.ts.snap b/packages/kbn-config-schema/src/types/__snapshots__/uri_type.test.ts.snap deleted file mode 100644 index 81fafdb4a7b33..0000000000000 --- a/packages/kbn-config-schema/src/types/__snapshots__/uri_type.test.ts.snap +++ /dev/null @@ -1,25 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`#scheme returns error when shorter string 1`] = `"expected URI with scheme [http|https] but got [ftp://elastic.co]."`; - -exports[`#scheme returns error when shorter string 2`] = `"expected URI with scheme [http|https] but got [file:///kibana.log]."`; - -exports[`#validate throws when returns string 1`] = `"validator failure"`; - -exports[`is required by default 1`] = `"expected value of type [string] but got [undefined]."`; - -exports[`returns error when not string 1`] = `"expected value of type [string] but got [number]."`; - -exports[`returns error when not string 2`] = `"expected value of type [string] but got [Array]."`; - -exports[`returns error when not string 3`] = `"expected value of type [string] but got [RegExp]."`; - -exports[`returns error when value is not a URI 1`] = `"value is [3domain.local] but it must be a valid URI (see RFC 3986)."`; - -exports[`returns error when value is not a URI 2`] = `"value is [http://8010:0:0:0:9:500:300C:200A] but it must be a valid URI (see RFC 3986)."`; - -exports[`returns error when value is not a URI 3`] = `"value is [-] but it must be a valid URI (see RFC 3986)."`; - -exports[`returns error when value is not a URI 4`] = `"value is [https://example.com?baz[]=foo&baz[]=bar] but it must be a valid URI (see RFC 3986)."`; - -exports[`returns error when value is not a URI 5`] = `"value is [http://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] but it must be a valid URI (see RFC 3986)."`; diff --git a/packages/kbn-config-schema/src/types/any_type.test.ts b/packages/kbn-config-schema/src/types/any_type.test.ts index 4d68c860ba13d..30a9a8b71ea12 100644 --- a/packages/kbn-config-schema/src/types/any_type.test.ts +++ b/packages/kbn-config-schema/src/types/any_type.test.ts @@ -28,13 +28,17 @@ test('works for any value', () => { }); test('is required by default', () => { - expect(() => schema.any().validate(undefined)).toThrowErrorMatchingSnapshot(); + expect(() => schema.any().validate(undefined)).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [any] but got [undefined]"` + ); }); test('includes namespace in failure', () => { expect(() => schema.any().validate(undefined, {}, 'foo-namespace') - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot( + `"[foo-namespace]: expected value of type [any] but got [undefined]"` + ); }); describe('#defaultValue', () => { diff --git a/packages/kbn-config-schema/src/types/array_type.test.ts b/packages/kbn-config-schema/src/types/array_type.test.ts index 66b72096a593d..9f3370de8c265 100644 --- a/packages/kbn-config-schema/src/types/array_type.test.ts +++ b/packages/kbn-config-schema/src/types/array_type.test.ts @@ -39,7 +39,7 @@ test('fails if wrong input type', () => { test('fails if string input cannot be parsed', () => { const type = schema.arrayOf(schema.string()); expect(() => type.validate('test')).toThrowErrorMatchingInlineSnapshot( - `"could not parse array value from [test]"` + `"could not parse array value from json input"` ); }); @@ -53,7 +53,7 @@ test('fails with correct type if parsed input is not an array', () => { test('includes namespace in failure when wrong top-level type', () => { const type = schema.arrayOf(schema.string()); expect(() => type.validate('test', {}, 'foo-namespace')).toThrowErrorMatchingInlineSnapshot( - `"[foo-namespace]: could not parse array value from [test]"` + `"[foo-namespace]: could not parse array value from json input"` ); }); diff --git a/packages/kbn-config-schema/src/types/array_type.ts b/packages/kbn-config-schema/src/types/array_type.ts index a0353e8348ddd..0df0d44a37951 100644 --- a/packages/kbn-config-schema/src/types/array_type.ts +++ b/packages/kbn-config-schema/src/types/array_type.ts @@ -52,7 +52,7 @@ export class ArrayType extends Type { case 'array.sparse': return `sparse array are not allowed`; case 'array.parse': - return `could not parse array value from [${value}]`; + return `could not parse array value from json input`; case 'array.min': return `array size is [${value.length}], but cannot be smaller than [${limit}]`; case 'array.max': diff --git a/packages/kbn-config-schema/src/types/boolean_type.test.ts b/packages/kbn-config-schema/src/types/boolean_type.test.ts index e94999b505437..bffa3e18f93bf 100644 --- a/packages/kbn-config-schema/src/types/boolean_type.test.ts +++ b/packages/kbn-config-schema/src/types/boolean_type.test.ts @@ -35,13 +35,17 @@ test('handles boolean strings', () => { }); test('is required by default', () => { - expect(() => schema.boolean().validate(undefined)).toThrowErrorMatchingSnapshot(); + expect(() => schema.boolean().validate(undefined)).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [boolean] but got [undefined]"` + ); }); test('includes namespace in failure', () => { expect(() => schema.boolean().validate(undefined, {}, 'foo-namespace') - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot( + `"[foo-namespace]: expected value of type [boolean] but got [undefined]"` + ); }); describe('#defaultValue', () => { @@ -55,13 +59,23 @@ describe('#defaultValue', () => { }); test('returns error when not boolean', () => { - expect(() => schema.boolean().validate(123)).toThrowErrorMatchingSnapshot(); + expect(() => schema.boolean().validate(123)).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [boolean] but got [number]"` + ); - expect(() => schema.boolean().validate([1, 2, 3])).toThrowErrorMatchingSnapshot(); + expect(() => schema.boolean().validate([1, 2, 3])).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [boolean] but got [Array]"` + ); - expect(() => schema.boolean().validate('abc')).toThrowErrorMatchingSnapshot(); + expect(() => schema.boolean().validate('abc')).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [boolean] but got [string]"` + ); - expect(() => schema.boolean().validate(0)).toThrowErrorMatchingSnapshot(); + expect(() => schema.boolean().validate(0)).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [boolean] but got [number]"` + ); - expect(() => schema.boolean().validate('no')).toThrowErrorMatchingSnapshot(); + expect(() => schema.boolean().validate('no')).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [boolean] but got [string]"` + ); }); diff --git a/packages/kbn-config-schema/src/types/buffer_type.test.ts b/packages/kbn-config-schema/src/types/buffer_type.test.ts index 63d59296aec84..a7b589df0c6d1 100644 --- a/packages/kbn-config-schema/src/types/buffer_type.test.ts +++ b/packages/kbn-config-schema/src/types/buffer_type.test.ts @@ -25,13 +25,17 @@ test('returns value by default', () => { }); test('is required by default', () => { - expect(() => schema.buffer().validate(undefined)).toThrowErrorMatchingSnapshot(); + expect(() => schema.buffer().validate(undefined)).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [Buffer] but got [undefined]"` + ); }); test('includes namespace in failure', () => { expect(() => schema.buffer().validate(undefined, {}, 'foo-namespace') - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot( + `"[foo-namespace]: expected value of type [Buffer] but got [undefined]"` + ); }); describe('#defaultValue', () => { @@ -49,9 +53,15 @@ describe('#defaultValue', () => { }); test('returns error when not a buffer', () => { - expect(() => schema.buffer().validate(123)).toThrowErrorMatchingSnapshot(); + expect(() => schema.buffer().validate(123)).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [Buffer] but got [number]"` + ); - expect(() => schema.buffer().validate([1, 2, 3])).toThrowErrorMatchingSnapshot(); + expect(() => schema.buffer().validate([1, 2, 3])).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [Buffer] but got [Array]"` + ); - expect(() => schema.buffer().validate('abc')).toThrowErrorMatchingSnapshot(); + expect(() => schema.buffer().validate('abc')).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [Buffer] but got [string]"` + ); }); diff --git a/packages/kbn-config-schema/src/types/byte_size_type.test.ts b/packages/kbn-config-schema/src/types/byte_size_type.test.ts index 7c65ec2945b49..a69a7296a6eb8 100644 --- a/packages/kbn-config-schema/src/types/byte_size_type.test.ts +++ b/packages/kbn-config-schema/src/types/byte_size_type.test.ts @@ -35,11 +35,17 @@ test('handles numbers', () => { }); test('is required by default', () => { - expect(() => byteSize().validate(undefined)).toThrowErrorMatchingSnapshot(); + expect(() => byteSize().validate(undefined)).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [ByteSize] but got [undefined]"` + ); }); test('includes namespace in failure', () => { - expect(() => byteSize().validate(undefined, {}, 'foo-namespace')).toThrowErrorMatchingSnapshot(); + expect(() => + byteSize().validate(undefined, {}, 'foo-namespace') + ).toThrowErrorMatchingInlineSnapshot( + `"[foo-namespace]: expected value of type [ByteSize] but got [undefined]"` + ); }); describe('#defaultValue', () => { @@ -48,7 +54,11 @@ describe('#defaultValue', () => { byteSize({ defaultValue: ByteSizeValue.parse('1kb'), }).validate(undefined) - ).toMatchSnapshot(); + ).toMatchInlineSnapshot(` + ByteSizeValue { + "valueInBytes": 1024, + } + `); }); test('can be a string', () => { @@ -56,7 +66,11 @@ describe('#defaultValue', () => { byteSize({ defaultValue: '1kb', }).validate(undefined) - ).toMatchSnapshot(); + ).toMatchInlineSnapshot(` + ByteSizeValue { + "valueInBytes": 1024, + } + `); }); test('can be a string-formatted number', () => { @@ -64,7 +78,11 @@ describe('#defaultValue', () => { byteSize({ defaultValue: '1024', }).validate(undefined) - ).toMatchSnapshot(); + ).toMatchInlineSnapshot(` + ByteSizeValue { + "valueInBytes": 1024, + } + `); }); test('can be a number', () => { @@ -72,7 +90,11 @@ describe('#defaultValue', () => { byteSize({ defaultValue: 1024, }).validate(undefined) - ).toMatchSnapshot(); + ).toMatchInlineSnapshot(` + ByteSizeValue { + "valueInBytes": 1024, + } + `); }); }); @@ -82,7 +104,11 @@ describe('#min', () => { byteSize({ min: '1b', }).validate('1kb') - ).toMatchSnapshot(); + ).toMatchInlineSnapshot(` + ByteSizeValue { + "valueInBytes": 1024, + } + `); }); test('returns error when smaller', () => { @@ -90,34 +116,56 @@ describe('#min', () => { byteSize({ min: '1kb', }).validate('1b') - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot(`"Value must be equal to or greater than [1kb]"`); }); }); describe('#max', () => { test('returns value when smaller', () => { - expect(byteSize({ max: '1kb' }).validate('1b')).toMatchSnapshot(); + expect(byteSize({ max: '1kb' }).validate('1b')).toMatchInlineSnapshot(` + ByteSizeValue { + "valueInBytes": 1, + } + `); }); test('returns error when larger', () => { - expect(() => byteSize({ max: '1kb' }).validate('1mb')).toThrowErrorMatchingSnapshot(); + expect(() => byteSize({ max: '1kb' }).validate('1mb')).toThrowErrorMatchingInlineSnapshot( + `"Value must be equal to or less than [1kb]"` + ); }); }); test('returns error when not valid string or positive safe integer', () => { - expect(() => byteSize().validate(-123)).toThrowErrorMatchingSnapshot(); + expect(() => byteSize().validate(-123)).toThrowErrorMatchingInlineSnapshot( + `"Value in bytes is expected to be a safe positive integer."` + ); - expect(() => byteSize().validate(NaN)).toThrowErrorMatchingSnapshot(); + expect(() => byteSize().validate(NaN)).toThrowErrorMatchingInlineSnapshot( + `"Value in bytes is expected to be a safe positive integer."` + ); - expect(() => byteSize().validate(Infinity)).toThrowErrorMatchingSnapshot(); + expect(() => byteSize().validate(Infinity)).toThrowErrorMatchingInlineSnapshot( + `"Value in bytes is expected to be a safe positive integer."` + ); - expect(() => byteSize().validate(Math.pow(2, 53))).toThrowErrorMatchingSnapshot(); + expect(() => byteSize().validate(Math.pow(2, 53))).toThrowErrorMatchingInlineSnapshot( + `"Value in bytes is expected to be a safe positive integer."` + ); - expect(() => byteSize().validate([1, 2, 3])).toThrowErrorMatchingSnapshot(); + expect(() => byteSize().validate([1, 2, 3])).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [ByteSize] but got [Array]"` + ); - expect(() => byteSize().validate(/abc/)).toThrowErrorMatchingSnapshot(); + expect(() => byteSize().validate(/abc/)).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [ByteSize] but got [RegExp]"` + ); - expect(() => byteSize().validate('123foo')).toThrowErrorMatchingSnapshot(); + expect(() => byteSize().validate('123foo')).toThrowErrorMatchingInlineSnapshot( + `"Failed to parse value as byte value. Value must be either number of bytes, or follow the format [b|kb|mb|gb] (e.g., '1024kb', '200mb', '1gb'), where the number is a safe positive integer."` + ); - expect(() => byteSize().validate('123 456')).toThrowErrorMatchingSnapshot(); + expect(() => byteSize().validate('123 456')).toThrowErrorMatchingInlineSnapshot( + `"Failed to parse value as byte value. Value must be either number of bytes, or follow the format [b|kb|mb|gb] (e.g., '1024kb', '200mb', '1gb'), where the number is a safe positive integer."` + ); }); diff --git a/packages/kbn-config-schema/src/types/byte_size_type.ts b/packages/kbn-config-schema/src/types/byte_size_type.ts index 4833de7ecf15f..f7aa12291c7de 100644 --- a/packages/kbn-config-schema/src/types/byte_size_type.ts +++ b/packages/kbn-config-schema/src/types/byte_size_type.ts @@ -61,13 +61,9 @@ export class ByteSizeType extends Type { case 'bytes.parse': return new SchemaTypeError(message, path); case 'bytes.min': - return `Value is [${value.toString()}] ([${value.toString( - 'b' - )}]) but it must be equal to or greater than [${limit.toString()}]`; + return `Value must be equal to or greater than [${limit.toString()}]`; case 'bytes.max': - return `Value is [${value.toString()}] ([${value.toString( - 'b' - )}]) but it must be equal to or less than [${limit.toString()}]`; + return `Value must be equal to or less than [${limit.toString()}]`; } } } diff --git a/packages/kbn-config-schema/src/types/conditional_type.test.ts b/packages/kbn-config-schema/src/types/conditional_type.test.ts index 354854b864755..b7ad431318e85 100644 --- a/packages/kbn-config-schema/src/types/conditional_type.test.ts +++ b/packages/kbn-config-schema/src/types/conditional_type.test.ts @@ -32,7 +32,7 @@ test('required by default', () => { context_value_1: 0, context_value_2: 0, }) - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot(`"expected value of type [string] but got [undefined]"`); }); test('returns default', () => { @@ -90,7 +90,9 @@ test('properly validates types according chosen schema', () => { context_value_1: 0, context_value_2: 0, }) - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot( + `"value has length [1] but it must have a minimum length of [2]."` + ); expect( type.validate('ab', { @@ -104,7 +106,9 @@ test('properly validates types according chosen schema', () => { context_value_1: 0, context_value_2: 1, }) - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot( + `"value has length [2] but it must have a maximum length of [1]."` + ); expect( type.validate('a', { @@ -126,7 +130,9 @@ test('properly validates when compares with Schema', () => { type.validate('a', { context_value_1: 0, }) - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot( + `"value has length [1] but it must have a minimum length of [2]."` + ); expect( type.validate('ab', { @@ -138,7 +144,9 @@ test('properly validates when compares with Schema', () => { type.validate('ab', { context_value_1: 'b', }) - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot( + `"value has length [2] but it must have a minimum length of [3]."` + ); expect( type.validate('abc', { @@ -159,7 +167,9 @@ test('properly validates when compares with "null" literal Schema', () => { type.validate('a', { context_value_1: null, }) - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot( + `"value has length [1] but it must have a minimum length of [2]."` + ); expect( type.validate('ab', { @@ -171,7 +181,9 @@ test('properly validates when compares with "null" literal Schema', () => { type.validate('ab', { context_value_1: 'b', }) - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot( + `"value has length [2] but it must have a minimum length of [3]."` + ); expect( type.validate('abc', { @@ -193,7 +205,7 @@ test('properly handles schemas with incompatible types', () => { context_value_1: 0, context_value_2: 0, }) - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot(`"expected value of type [string] but got [boolean]"`); expect( type.validate('a', { @@ -207,7 +219,7 @@ test('properly handles schemas with incompatible types', () => { context_value_1: 0, context_value_2: 1, }) - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot(`"expected value of type [boolean] but got [string]"`); expect( type.validate(true, { @@ -223,14 +235,18 @@ test('properly handles conditionals within objects', () => { value: schema.conditional(schema.siblingRef('key'), 'number', schema.number(), schema.string()), }); - expect(() => type.validate({ key: 'string', value: 1 })).toThrowErrorMatchingSnapshot(); + expect(() => type.validate({ key: 'string', value: 1 })).toThrowErrorMatchingInlineSnapshot( + `"[value]: expected value of type [string] but got [number]"` + ); expect(type.validate({ key: 'string', value: 'a' })).toEqual({ key: 'string', value: 'a', }); - expect(() => type.validate({ key: 'number', value: 'a' })).toThrowErrorMatchingSnapshot(); + expect(() => type.validate({ key: 'number', value: 'a' })).toThrowErrorMatchingInlineSnapshot( + `"[value]: expected value of type [number] but got [string]"` + ); expect(type.validate({ key: 'number', value: 1 })).toEqual({ key: 'number', @@ -269,7 +285,9 @@ test('works with both context and sibling references', () => { expect(() => type.validate({ key: 'string', value: 1 }, { context_key: 'number' }) - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot( + `"[value]: expected value of type [string] but got [number]"` + ); expect(type.validate({ key: 'string', value: 'a' }, { context_key: 'number' })).toEqual({ key: 'string', @@ -278,7 +296,9 @@ test('works with both context and sibling references', () => { expect(() => type.validate({ key: 'number', value: 'a' }, { context_key: 'number' }) - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot( + `"[value]: expected value of type [number] but got [string]"` + ); expect(type.validate({ key: 'number', value: 1 }, { context_key: 'number' })).toEqual({ key: 'number', @@ -294,11 +314,15 @@ test('includes namespace into failures', () => { expect(() => type.validate({ key: 'string', value: 1 }, {}, 'mega-namespace') - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot( + `"[mega-namespace.value]: expected value of type [string] but got [number]"` + ); expect(() => type.validate({ key: 'number', value: 'a' }, {}, 'mega-namespace') - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot( + `"[mega-namespace.value]: expected value of type [number] but got [string]"` + ); }); test('correctly handles missing references', () => { @@ -311,7 +335,9 @@ test('correctly handles missing references', () => { ), }); - expect(() => type.validate({ value: 1 })).toThrowErrorMatchingSnapshot(); + expect(() => type.validate({ value: 1 })).toThrowErrorMatchingInlineSnapshot( + `"[value]: expected value of type [string] but got [number]"` + ); expect(type.validate({ value: 'a' })).toEqual({ value: 'a' }); }); @@ -332,8 +358,16 @@ test('works within `oneOf`', () => { expect(type.validate(true, { type: 'boolean' })).toEqual(true); expect(type.validate(['a', 'b'], { type: 'array' })).toEqual(['a', 'b']); - expect(() => type.validate(1, { type: 'string' })).toThrowErrorMatchingSnapshot(); - expect(() => type.validate(true, { type: 'string' })).toThrowErrorMatchingSnapshot(); + expect(() => type.validate(1, { type: 'string' })).toThrowErrorMatchingInlineSnapshot(` +"types that failed validation: +- [0]: expected value of type [string] but got [number] +- [1]: expected value of type [array] but got [number]" +`); + expect(() => type.validate(true, { type: 'string' })).toThrowErrorMatchingInlineSnapshot(` +"types that failed validation: +- [0]: expected value of type [string] but got [boolean] +- [1]: expected value of type [array] but got [boolean]" +`); }); describe('#validate', () => { diff --git a/packages/kbn-config-schema/src/types/duration_type.test.ts b/packages/kbn-config-schema/src/types/duration_type.test.ts index 57e917dc99b2b..2a0458f1419cc 100644 --- a/packages/kbn-config-schema/src/types/duration_type.test.ts +++ b/packages/kbn-config-schema/src/types/duration_type.test.ts @@ -35,11 +35,17 @@ test('handles number', () => { }); test('is required by default', () => { - expect(() => duration().validate(undefined)).toThrowErrorMatchingSnapshot(); + expect(() => duration().validate(undefined)).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [moment.Duration] but got [undefined]"` + ); }); test('includes namespace in failure', () => { - expect(() => duration().validate(undefined, {}, 'foo-namespace')).toThrowErrorMatchingSnapshot(); + expect(() => + duration().validate(undefined, {}, 'foo-namespace') + ).toThrowErrorMatchingInlineSnapshot( + `"[foo-namespace]: expected value of type [moment.Duration] but got [undefined]"` + ); }); describe('#defaultValue', () => { @@ -48,7 +54,7 @@ describe('#defaultValue', () => { duration({ defaultValue: momentDuration(1, 'hour'), }).validate(undefined) - ).toMatchSnapshot(); + ).toMatchInlineSnapshot(`"PT1H"`); }); test('can be a string', () => { @@ -56,7 +62,7 @@ describe('#defaultValue', () => { duration({ defaultValue: '1h', }).validate(undefined) - ).toMatchSnapshot(); + ).toMatchInlineSnapshot(`"PT1H"`); }); test('can be a string-formatted number', () => { @@ -64,7 +70,7 @@ describe('#defaultValue', () => { duration({ defaultValue: '600', }).validate(undefined) - ).toMatchSnapshot(); + ).toMatchInlineSnapshot(`"PT0.6S"`); }); test('can be a number', () => { @@ -72,7 +78,7 @@ describe('#defaultValue', () => { duration({ defaultValue: 600, }).validate(undefined) - ).toMatchSnapshot(); + ).toMatchInlineSnapshot(`"PT0.6S"`); }); test('can be a function that returns compatible type', () => { @@ -103,12 +109,12 @@ describe('#defaultValue', () => { fromContext: duration({ defaultValue: contextRef('val') }), }).validate({}, { val: momentDuration(700, 'ms') }) ).toMatchInlineSnapshot(` -Object { - "fromContext": "PT0.7S", - "source": "PT0.6S", - "target": "PT0.6S", -} -`); + Object { + "fromContext": "PT0.7S", + "source": "PT0.6S", + "target": "PT0.6S", + } + `); expect( object({ @@ -117,12 +123,12 @@ Object { fromContext: duration({ defaultValue: contextRef('val') }), }).validate({}, { val: momentDuration(2, 'hour') }) ).toMatchInlineSnapshot(` -Object { - "fromContext": "PT2H", - "source": "PT1H", - "target": "PT1H", -} -`); + Object { + "fromContext": "PT2H", + "source": "PT1H", + "target": "PT1H", + } + `); expect( object({ @@ -131,29 +137,45 @@ Object { fromContext: duration({ defaultValue: contextRef('val') }), }).validate({}, { val: momentDuration(2, 'hour') }) ).toMatchInlineSnapshot(` -Object { - "fromContext": "PT2H", - "source": "PT1H", - "target": "PT1H", -} -`); + Object { + "fromContext": "PT2H", + "source": "PT1H", + "target": "PT1H", + } + `); }); }); test('returns error when not valid string or non-safe positive integer', () => { - expect(() => duration().validate(-123)).toThrowErrorMatchingSnapshot(); + expect(() => duration().validate(-123)).toThrowErrorMatchingInlineSnapshot( + `"Value in milliseconds is expected to be a safe positive integer."` + ); - expect(() => duration().validate(NaN)).toThrowErrorMatchingSnapshot(); + expect(() => duration().validate(NaN)).toThrowErrorMatchingInlineSnapshot( + `"Value in milliseconds is expected to be a safe positive integer."` + ); - expect(() => duration().validate(Infinity)).toThrowErrorMatchingSnapshot(); + expect(() => duration().validate(Infinity)).toThrowErrorMatchingInlineSnapshot( + `"Value in milliseconds is expected to be a safe positive integer."` + ); - expect(() => duration().validate(Math.pow(2, 53))).toThrowErrorMatchingSnapshot(); + expect(() => duration().validate(Math.pow(2, 53))).toThrowErrorMatchingInlineSnapshot( + `"Value in milliseconds is expected to be a safe positive integer."` + ); - expect(() => duration().validate([1, 2, 3])).toThrowErrorMatchingSnapshot(); + expect(() => duration().validate([1, 2, 3])).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [moment.Duration] but got [Array]"` + ); - expect(() => duration().validate(/abc/)).toThrowErrorMatchingSnapshot(); + expect(() => duration().validate(/abc/)).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [moment.Duration] but got [RegExp]"` + ); - expect(() => duration().validate('123foo')).toThrowErrorMatchingSnapshot(); + expect(() => duration().validate('123foo')).toThrowErrorMatchingInlineSnapshot( + `"Failed to parse value as time value. Value must be a duration in milliseconds, or follow the format [ms|s|m|h|d|w|M|Y] (e.g. '70ms', '5s', '3d', '1Y'), where the duration is a safe positive integer."` + ); - expect(() => duration().validate('123 456')).toThrowErrorMatchingSnapshot(); + expect(() => duration().validate('123 456')).toThrowErrorMatchingInlineSnapshot( + `"Failed to parse value as time value. Value must be a duration in milliseconds, or follow the format [ms|s|m|h|d|w|M|Y] (e.g. '70ms', '5s', '3d', '1Y'), where the duration is a safe positive integer."` + ); }); diff --git a/packages/kbn-config-schema/src/types/literal_type.test.ts b/packages/kbn-config-schema/src/types/literal_type.test.ts index a5ddff3152368..abcf5bb2a3b2d 100644 --- a/packages/kbn-config-schema/src/types/literal_type.test.ts +++ b/packages/kbn-config-schema/src/types/literal_type.test.ts @@ -38,17 +38,29 @@ test('handles null', () => { }); test('returns error when not correct', () => { - expect(() => literal('test').validate('foo')).toThrowErrorMatchingSnapshot(); + expect(() => literal('test').validate('foo')).toThrowErrorMatchingInlineSnapshot( + `"expected value to equal [test]"` + ); - expect(() => literal(true).validate(false)).toThrowErrorMatchingSnapshot(); + expect(() => literal(true).validate(false)).toThrowErrorMatchingInlineSnapshot( + `"expected value to equal [true]"` + ); - expect(() => literal('test').validate([1, 2, 3])).toThrowErrorMatchingSnapshot(); + expect(() => literal('test').validate([1, 2, 3])).toThrowErrorMatchingInlineSnapshot( + `"expected value to equal [test]"` + ); - expect(() => literal(123).validate('abc')).toThrowErrorMatchingSnapshot(); + expect(() => literal(123).validate('abc')).toThrowErrorMatchingInlineSnapshot( + `"expected value to equal [123]"` + ); - expect(() => literal(null).validate(42)).toThrowErrorMatchingSnapshot(); + expect(() => literal(null).validate(42)).toThrowErrorMatchingInlineSnapshot( + `"expected value to equal [null]"` + ); }); test('includes namespace in failure', () => { - expect(() => literal('test').validate('foo', {}, 'foo-namespace')).toThrowErrorMatchingSnapshot(); + expect(() => + literal('test').validate('foo', {}, 'foo-namespace') + ).toThrowErrorMatchingInlineSnapshot(`"[foo-namespace]: expected value to equal [test]"`); }); diff --git a/packages/kbn-config-schema/src/types/literal_type.ts b/packages/kbn-config-schema/src/types/literal_type.ts index b5ddaa2f68d4f..5ba0b417683bd 100644 --- a/packages/kbn-config-schema/src/types/literal_type.ts +++ b/packages/kbn-config-schema/src/types/literal_type.ts @@ -29,7 +29,7 @@ export class LiteralType extends Type { switch (type) { case 'any.required': case 'any.allowOnly': - return `expected value to equal [${expectedValue}] but got [${value}]`; + return `expected value to equal [${expectedValue}]`; } } } diff --git a/packages/kbn-config-schema/src/types/map_of_type.test.ts b/packages/kbn-config-schema/src/types/map_of_type.test.ts index 3cb3d2d0b6862..b015f51bdc8ad 100644 --- a/packages/kbn-config-schema/src/types/map_of_type.test.ts +++ b/packages/kbn-config-schema/src/types/map_of_type.test.ts @@ -40,7 +40,7 @@ test('properly parse the value if input is a string', () => { test('fails if string input cannot be parsed', () => { const type = schema.mapOf(schema.string(), schema.string()); expect(() => type.validate(`invalidjson`)).toThrowErrorMatchingInlineSnapshot( - `"could not parse map value from [invalidjson]"` + `"could not parse map value from json input"` ); }); @@ -169,7 +169,7 @@ test('error preserves full path', () => { expect(() => type.validate({ grandParentKey: { parentKey: { a: 'some-value' } } }) ).toThrowErrorMatchingInlineSnapshot( - `"[grandParentKey.parentKey.key(\\"a\\")]: value is [a] but it must have a minimum length of [2]."` + `"[grandParentKey.parentKey.key(\\"a\\")]: value has length [1] but it must have a minimum length of [2]."` ); expect(() => diff --git a/packages/kbn-config-schema/src/types/map_type.ts b/packages/kbn-config-schema/src/types/map_type.ts index 1c0c473f98ec1..231c3726ae9d5 100644 --- a/packages/kbn-config-schema/src/types/map_type.ts +++ b/packages/kbn-config-schema/src/types/map_type.ts @@ -49,7 +49,7 @@ export class MapOfType extends Type> { case 'map.base': return `expected value of type [Map] or [object] but got [${typeDetect(value)}]`; case 'map.parse': - return `could not parse map value from [${value}]`; + return `could not parse map value from json input`; case 'map.key': case 'map.value': const childPathWithIndex = path.slice(); diff --git a/packages/kbn-config-schema/src/types/maybe_type.test.ts b/packages/kbn-config-schema/src/types/maybe_type.test.ts index c35fa18593520..2a1278f5e801c 100644 --- a/packages/kbn-config-schema/src/types/maybe_type.test.ts +++ b/packages/kbn-config-schema/src/types/maybe_type.test.ts @@ -42,23 +42,31 @@ test('returns undefined even if contained type has a default value', () => { test('validates contained type', () => { const type = schema.maybe(schema.string({ maxLength: 1 })); - expect(() => type.validate('foo')).toThrowErrorMatchingSnapshot(); + expect(() => type.validate('foo')).toThrowErrorMatchingInlineSnapshot( + `"value has length [3] but it must have a maximum length of [1]."` + ); }); test('validates basic type', () => { const type = schema.maybe(schema.string()); - expect(() => type.validate(666)).toThrowErrorMatchingSnapshot(); + expect(() => type.validate(666)).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [string] but got [number]"` + ); }); test('fails if null', () => { const type = schema.maybe(schema.string()); - expect(() => type.validate(null)).toThrowErrorMatchingSnapshot(); + expect(() => type.validate(null)).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [string] but got [null]"` + ); }); test('includes namespace in failure', () => { const type = schema.maybe(schema.string()); - expect(() => type.validate(null, {}, 'foo-namespace')).toThrowErrorMatchingSnapshot(); + expect(() => type.validate(null, {}, 'foo-namespace')).toThrowErrorMatchingInlineSnapshot( + `"[foo-namespace]: expected value of type [string] but got [null]"` + ); }); describe('maybe + object', () => { diff --git a/packages/kbn-config-schema/src/types/never_type.test.ts b/packages/kbn-config-schema/src/types/never_type.test.ts index 46f0b47f56ad6..2e5bc0e8c672d 100644 --- a/packages/kbn-config-schema/src/types/never_type.test.ts +++ b/packages/kbn-config-schema/src/types/never_type.test.ts @@ -22,10 +22,18 @@ import { schema } from '..'; test('throws on any value set', () => { const type = schema.never(); - expect(() => type.validate(1)).toThrowErrorMatchingSnapshot(); - expect(() => type.validate('a')).toThrowErrorMatchingSnapshot(); - expect(() => type.validate(null)).toThrowErrorMatchingSnapshot(); - expect(() => type.validate({})).toThrowErrorMatchingSnapshot(); + expect(() => type.validate(1)).toThrowErrorMatchingInlineSnapshot( + `"a value wasn't expected to be present"` + ); + expect(() => type.validate('a')).toThrowErrorMatchingInlineSnapshot( + `"a value wasn't expected to be present"` + ); + expect(() => type.validate(null)).toThrowErrorMatchingInlineSnapshot( + `"a value wasn't expected to be present"` + ); + expect(() => type.validate({})).toThrowErrorMatchingInlineSnapshot( + `"a value wasn't expected to be present"` + ); expect(() => type.validate(undefined)).not.toThrow(); }); @@ -37,7 +45,7 @@ test('throws on value set as object property', () => { expect(() => type.validate({ name: 'name', status: 'in progress' }) - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot(`"[name]: a value wasn't expected to be present"`); expect(() => type.validate({ status: 'in progress' })).not.toThrow(); expect(() => type.validate({ name: undefined, status: 'in progress' })).not.toThrow(); @@ -71,5 +79,5 @@ test('works for conditional types', () => { context_value_2: 1, } ) - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot(`"[name]: a value wasn't expected to be present"`); }); diff --git a/packages/kbn-config-schema/src/types/nullable_type.test.ts b/packages/kbn-config-schema/src/types/nullable_type.test.ts index ed04202950a2c..fb9d544a3eb0e 100644 --- a/packages/kbn-config-schema/src/types/nullable_type.test.ts +++ b/packages/kbn-config-schema/src/types/nullable_type.test.ts @@ -94,13 +94,21 @@ test('returns null even if contained type has a default value', () => { test('validates contained type', () => { const type = schema.nullable(schema.string({ maxLength: 1 })); - expect(() => type.validate('foo')).toThrowErrorMatchingSnapshot(); + expect(() => type.validate('foo')).toThrowErrorMatchingInlineSnapshot(` +"types that failed validation: +- [0]: value has length [3] but it must have a maximum length of [1]. +- [1]: expected value to equal [null]" +`); }); test('validates basic type', () => { const type = schema.nullable(schema.string()); - expect(() => type.validate(666)).toThrowErrorMatchingSnapshot(); + expect(() => type.validate(666)).toThrowErrorMatchingInlineSnapshot(` +"types that failed validation: +- [0]: expected value of type [string] but got [number] +- [1]: expected value to equal [null]" +`); }); test('validates type in object', () => { @@ -121,11 +129,19 @@ test('validates type errors in object', () => { bar: schema.nullable(schema.boolean()), }); - expect(() => type.validate({ foo: 'ab' })).toThrowErrorMatchingSnapshot(); + expect(() => type.validate({ foo: 'ab' })).toThrowErrorMatchingInlineSnapshot(` +"[foo]: types that failed validation: +- [foo.0]: value has length [2] but it must have a maximum length of [1]. +- [foo.1]: expected value to equal [null]" +`); }); test('includes namespace in failure', () => { const type = schema.nullable(schema.string({ maxLength: 1 })); - expect(() => type.validate('foo', {}, 'foo-namespace')).toThrowErrorMatchingSnapshot(); + expect(() => type.validate('foo', {}, 'foo-namespace')).toThrowErrorMatchingInlineSnapshot(` +"[foo-namespace]: types that failed validation: +- [foo-namespace.0]: value has length [3] but it must have a maximum length of [1]. +- [foo-namespace.1]: expected value to equal [null]" +`); }); diff --git a/packages/kbn-config-schema/src/types/number_type.test.ts b/packages/kbn-config-schema/src/types/number_type.test.ts index b85d5113563eb..cfcb0e99afbd5 100644 --- a/packages/kbn-config-schema/src/types/number_type.test.ts +++ b/packages/kbn-config-schema/src/types/number_type.test.ts @@ -32,17 +32,23 @@ test('handles numeric strings with floats', () => { }); test('fails if number is `NaN`', () => { - expect(() => schema.number().validate(NaN)).toThrowErrorMatchingSnapshot(); + expect(() => schema.number().validate(NaN)).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [number] but got [number]"` + ); }); test('is required by default', () => { - expect(() => schema.number().validate(undefined)).toThrowErrorMatchingSnapshot(); + expect(() => schema.number().validate(undefined)).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [number] but got [undefined]"` + ); }); test('includes namespace in failure', () => { expect(() => schema.number().validate(undefined, {}, 'foo-namespace') - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot( + `"[foo-namespace]: expected value of type [number] but got [undefined]"` + ); }); describe('#min', () => { @@ -51,7 +57,9 @@ describe('#min', () => { }); test('returns error when smaller number', () => { - expect(() => schema.number({ min: 4 }).validate(3)).toThrowErrorMatchingSnapshot(); + expect(() => schema.number({ min: 4 }).validate(3)).toThrowErrorMatchingInlineSnapshot( + `"Value must be equal to or greater than [4]."` + ); }); }); @@ -61,7 +69,9 @@ describe('#max', () => { }); test('returns error when larger number', () => { - expect(() => schema.number({ max: 2 }).validate(3)).toThrowErrorMatchingSnapshot(); + expect(() => schema.number({ max: 2 }).validate(3)).toThrowErrorMatchingInlineSnapshot( + `"Value must be equal to or lower than [2]."` + ); }); }); @@ -76,9 +86,15 @@ describe('#defaultValue', () => { }); test('returns error when not number or numeric string', () => { - expect(() => schema.number().validate('test')).toThrowErrorMatchingSnapshot(); + expect(() => schema.number().validate('test')).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [number] but got [string]"` + ); - expect(() => schema.number().validate([1, 2, 3])).toThrowErrorMatchingSnapshot(); + expect(() => schema.number().validate([1, 2, 3])).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [number] but got [Array]"` + ); - expect(() => schema.number().validate(/abc/)).toThrowErrorMatchingSnapshot(); + expect(() => schema.number().validate(/abc/)).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [number] but got [RegExp]"` + ); }); diff --git a/packages/kbn-config-schema/src/types/number_type.ts b/packages/kbn-config-schema/src/types/number_type.ts index ada4d1909c917..81ca4449122a3 100644 --- a/packages/kbn-config-schema/src/types/number_type.ts +++ b/packages/kbn-config-schema/src/types/number_type.ts @@ -46,9 +46,9 @@ export class NumberType extends Type { case 'number.base': return `expected value of type [number] but got [${typeDetect(value)}]`; case 'number.min': - return `Value is [${value}] but it must be equal to or greater than [${limit}].`; + return `Value must be equal to or greater than [${limit}].`; case 'number.max': - return `Value is [${value}] but it must be equal to or lower than [${limit}].`; + return `Value must be equal to or lower than [${limit}].`; } } } diff --git a/packages/kbn-config-schema/src/types/object_type.test.ts b/packages/kbn-config-schema/src/types/object_type.test.ts index 64739d7a4c4da..29e341983fde9 100644 --- a/packages/kbn-config-schema/src/types/object_type.test.ts +++ b/packages/kbn-config-schema/src/types/object_type.test.ts @@ -49,7 +49,7 @@ test('fails if string input cannot be parsed', () => { name: schema.string(), }); expect(() => type.validate(`invalidjson`)).toThrowErrorMatchingInlineSnapshot( - `"could not parse object value from [invalidjson]"` + `"could not parse object value from json input"` ); }); @@ -181,7 +181,7 @@ test('called with wrong type', () => { const type = schema.object({}); expect(() => type.validate('foo')).toThrowErrorMatchingInlineSnapshot( - `"could not parse object value from [foo]"` + `"could not parse object value from json input"` ); expect(() => type.validate(123)).toThrowErrorMatchingInlineSnapshot( `"expected a plain object value, but found [number] instead."` diff --git a/packages/kbn-config-schema/src/types/object_type.ts b/packages/kbn-config-schema/src/types/object_type.ts index 4f3d68a6bac97..f34acd0d2ce65 100644 --- a/packages/kbn-config-schema/src/types/object_type.ts +++ b/packages/kbn-config-schema/src/types/object_type.ts @@ -62,7 +62,7 @@ export class ObjectType

extends Type> case 'object.base': return `expected a plain object value, but found [${typeDetect(value)}] instead.`; case 'object.parse': - return `could not parse object value from [${value}]`; + return `could not parse object value from json input`; case 'object.allowUnknown': return `definition for this key is missing`; case 'object.child': diff --git a/packages/kbn-config-schema/src/types/one_of_type.test.ts b/packages/kbn-config-schema/src/types/one_of_type.test.ts index c9da1a6cd8494..deb87a485cdfe 100644 --- a/packages/kbn-config-schema/src/types/one_of_type.test.ts +++ b/packages/kbn-config-schema/src/types/one_of_type.test.ts @@ -75,13 +75,20 @@ test('handles object', () => { test('handles object with wrong type', () => { const type = schema.oneOf([schema.object({ age: schema.number() })]); - expect(() => type.validate({ age: 'foo' })).toThrowErrorMatchingSnapshot(); + expect(() => type.validate({ age: 'foo' })).toThrowErrorMatchingInlineSnapshot(` +"types that failed validation: +- [0.age]: expected value of type [number] but got [string]" +`); }); test('includes namespace in failure', () => { const type = schema.oneOf([schema.object({ age: schema.number() })]); - expect(() => type.validate({ age: 'foo' }, {}, 'foo-namespace')).toThrowErrorMatchingSnapshot(); + expect(() => type.validate({ age: 'foo' }, {}, 'foo-namespace')) + .toThrowErrorMatchingInlineSnapshot(` +"[foo-namespace]: types that failed validation: +- [foo-namespace.0.age]: expected value of type [number] but got [string]" +`); }); test('handles multiple objects with same key', () => { @@ -110,20 +117,33 @@ test('handles maybe', () => { test('fails if not matching type', () => { const type = schema.oneOf([schema.string()]); - expect(() => type.validate(false)).toThrowErrorMatchingSnapshot(); - expect(() => type.validate(123)).toThrowErrorMatchingSnapshot(); + expect(() => type.validate(false)).toThrowErrorMatchingInlineSnapshot(` +"types that failed validation: +- [0]: expected value of type [string] but got [boolean]" +`); + expect(() => type.validate(123)).toThrowErrorMatchingInlineSnapshot(` +"types that failed validation: +- [0]: expected value of type [string] but got [number]" +`); }); test('fails if not matching multiple types', () => { const type = schema.oneOf([schema.string(), schema.number()]); - expect(() => type.validate(false)).toThrowErrorMatchingSnapshot(); + expect(() => type.validate(false)).toThrowErrorMatchingInlineSnapshot(` +"types that failed validation: +- [0]: expected value of type [string] but got [boolean] +- [1]: expected value of type [number] but got [boolean]" +`); }); test('fails if not matching literal', () => { const type = schema.oneOf([schema.literal('foo')]); - expect(() => type.validate('bar')).toThrowErrorMatchingSnapshot(); + expect(() => type.validate('bar')).toThrowErrorMatchingInlineSnapshot(` +"types that failed validation: +- [0]: expected value to equal [foo]" +`); }); test('fails if nested union type fail', () => { @@ -138,7 +158,7 @@ test('fails if nested union type fail', () => { - [0]: expected value of type [boolean] but got [string] - [1]: types that failed validation: - [0]: types that failed validation: - - [0]: could not parse object value from [aaa] + - [0]: could not parse object value from json input - [1]: expected value of type [number] but got [string]" `); }); diff --git a/packages/kbn-config-schema/src/types/record_of_type.test.ts b/packages/kbn-config-schema/src/types/record_of_type.test.ts index f3ab1925597b5..ef15e7b0f6ad6 100644 --- a/packages/kbn-config-schema/src/types/record_of_type.test.ts +++ b/packages/kbn-config-schema/src/types/record_of_type.test.ts @@ -73,8 +73,8 @@ test('fails when not receiving expected key type', () => { expect(() => type.validate(value)).toThrowErrorMatchingInlineSnapshot(` "[key(\\"name\\")]: types that failed validation: -- [0]: expected value to equal [nickName] but got [name] -- [1]: expected value to equal [lastName] but got [name]" +- [0]: expected value to equal [nickName] +- [1]: expected value to equal [lastName]" `); }); @@ -88,8 +88,8 @@ test('fails after parsing when not receiving expected key type', () => { expect(() => type.validate(value)).toThrowErrorMatchingInlineSnapshot(` "[key(\\"name\\")]: types that failed validation: -- [0]: expected value to equal [nickName] but got [name] -- [1]: expected value to equal [lastName] but got [name]" +- [0]: expected value to equal [nickName] +- [1]: expected value to equal [lastName]" `); }); @@ -118,7 +118,7 @@ test('includes namespace in failure when wrong key type', () => { }; expect(() => type.validate(value, {}, 'foo-namespace')).toThrowErrorMatchingInlineSnapshot( - `"[foo-namespace.key(\\"name\\")]: value is [name] but it must have a minimum length of [10]."` + `"[foo-namespace.key(\\"name\\")]: value has length [4] but it must have a minimum length of [10]."` ); }); @@ -169,7 +169,7 @@ test('error preserves full path', () => { expect(() => type.validate({ grandParentKey: { parentKey: { a: 'some-value' } } }) ).toThrowErrorMatchingInlineSnapshot( - `"[grandParentKey.parentKey.key(\\"a\\")]: value is [a] but it must have a minimum length of [2]."` + `"[grandParentKey.parentKey.key(\\"a\\")]: value has length [1] but it must have a minimum length of [2]."` ); expect(() => diff --git a/packages/kbn-config-schema/src/types/record_type.ts b/packages/kbn-config-schema/src/types/record_type.ts index b795c83acdadb..c6d4b4d71b4f1 100644 --- a/packages/kbn-config-schema/src/types/record_type.ts +++ b/packages/kbn-config-schema/src/types/record_type.ts @@ -41,7 +41,7 @@ export class RecordOfType extends Type> { case 'record.base': return `expected value of type [object] but got [${typeDetect(value)}]`; case 'record.parse': - return `could not parse record value from [${value}]`; + return `could not parse record value from json input`; case 'record.key': case 'record.value': const childPathWithIndex = path.slice(); diff --git a/packages/kbn-config-schema/src/types/stream_type.test.ts b/packages/kbn-config-schema/src/types/stream_type.test.ts index 011fa6373df33..2e6f31ad09b34 100644 --- a/packages/kbn-config-schema/src/types/stream_type.test.ts +++ b/packages/kbn-config-schema/src/types/stream_type.test.ts @@ -41,13 +41,17 @@ test('Passthrough is valid', () => { }); test('is required by default', () => { - expect(() => schema.buffer().validate(undefined)).toThrowErrorMatchingSnapshot(); + expect(() => schema.buffer().validate(undefined)).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [Buffer] but got [undefined]"` + ); }); test('includes namespace in failure', () => { expect(() => schema.stream().validate(undefined, {}, 'foo-namespace') - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot( + `"[foo-namespace]: expected value of type [Stream] but got [undefined]"` + ); }); describe('#defaultValue', () => { @@ -63,9 +67,15 @@ describe('#defaultValue', () => { }); test('returns error when not a stream', () => { - expect(() => schema.stream().validate(123)).toThrowErrorMatchingSnapshot(); + expect(() => schema.stream().validate(123)).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [Stream] but got [number]"` + ); - expect(() => schema.stream().validate([1, 2, 3])).toThrowErrorMatchingSnapshot(); + expect(() => schema.stream().validate([1, 2, 3])).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [Stream] but got [Array]"` + ); - expect(() => schema.stream().validate('abc')).toThrowErrorMatchingSnapshot(); + expect(() => schema.stream().validate('abc')).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [Stream] but got [string]"` + ); }); diff --git a/packages/kbn-config-schema/src/types/string_type.test.ts b/packages/kbn-config-schema/src/types/string_type.test.ts index d599ea65c5ae2..c1d853fe82b82 100644 --- a/packages/kbn-config-schema/src/types/string_type.test.ts +++ b/packages/kbn-config-schema/src/types/string_type.test.ts @@ -28,13 +28,17 @@ test('allows empty strings', () => { }); test('is required by default', () => { - expect(() => schema.string().validate(undefined)).toThrowErrorMatchingSnapshot(); + expect(() => schema.string().validate(undefined)).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [string] but got [undefined]"` + ); }); test('includes namespace in failure', () => { expect(() => schema.string().validate(undefined, {}, 'foo-namespace') - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot( + `"[foo-namespace]: expected value of type [string] but got [undefined]"` + ); }); describe('#minLength', () => { @@ -43,11 +47,17 @@ describe('#minLength', () => { }); test('returns error when shorter string', () => { - expect(() => schema.string({ minLength: 4 }).validate('foo')).toThrowErrorMatchingSnapshot(); + expect(() => + schema.string({ minLength: 4 }).validate('foo') + ).toThrowErrorMatchingInlineSnapshot( + `"value has length [3] but it must have a minimum length of [4]."` + ); }); test('returns error when empty string', () => { - expect(() => schema.string({ minLength: 2 }).validate('')).toThrowErrorMatchingSnapshot(); + expect(() => schema.string({ minLength: 2 }).validate('')).toThrowErrorMatchingInlineSnapshot( + `"value has length [0] but it must have a minimum length of [2]."` + ); }); }); @@ -57,7 +67,11 @@ describe('#maxLength', () => { }); test('returns error when longer string', () => { - expect(() => schema.string({ maxLength: 2 }).validate('foo')).toThrowErrorMatchingSnapshot(); + expect(() => + schema.string({ maxLength: 2 }).validate('foo') + ).toThrowErrorMatchingInlineSnapshot( + `"value has length [3] but it must have a maximum length of [2]."` + ); }); }); @@ -84,23 +98,37 @@ describe('#hostname', () => { test('returns error when value is not a valid hostname', () => { const hostNameSchema = schema.string({ hostname: true }); - expect(() => hostNameSchema.validate('host:name')).toThrowErrorMatchingSnapshot(); - expect(() => hostNameSchema.validate('localhost:5601')).toThrowErrorMatchingSnapshot(); - expect(() => hostNameSchema.validate('-')).toThrowErrorMatchingSnapshot(); - expect(() => hostNameSchema.validate('0:?:0:0:0:0:0:1')).toThrowErrorMatchingSnapshot(); + expect(() => hostNameSchema.validate('host:name')).toThrowErrorMatchingInlineSnapshot( + `"value must be a valid hostname (see RFC 1123)."` + ); + expect(() => hostNameSchema.validate('localhost:5601')).toThrowErrorMatchingInlineSnapshot( + `"value must be a valid hostname (see RFC 1123)."` + ); + expect(() => hostNameSchema.validate('-')).toThrowErrorMatchingInlineSnapshot( + `"value must be a valid hostname (see RFC 1123)."` + ); + expect(() => hostNameSchema.validate('0:?:0:0:0:0:0:1')).toThrowErrorMatchingInlineSnapshot( + `"value must be a valid hostname (see RFC 1123)."` + ); const tooLongHostName = 'a'.repeat(256); - expect(() => hostNameSchema.validate(tooLongHostName)).toThrowErrorMatchingSnapshot(); + expect(() => hostNameSchema.validate(tooLongHostName)).toThrowErrorMatchingInlineSnapshot( + `"value must be a valid hostname (see RFC 1123)."` + ); }); test('returns error when empty string', () => { - expect(() => schema.string({ hostname: true }).validate('')).toThrowErrorMatchingSnapshot(); + expect(() => schema.string({ hostname: true }).validate('')).toThrowErrorMatchingInlineSnapshot( + `"any.empty"` + ); }); test('supports string validation rules', () => { expect(() => schema.string({ hostname: true, maxLength: 3 }).validate('www.example.com') - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot( + `"value has length [15] but it must have a maximum length of [3]."` + ); }); }); @@ -146,20 +174,30 @@ describe('#validate', () => { test('throws when returns string', () => { const validate = () => 'validator failure'; - expect(() => schema.string({ validate }).validate('foo')).toThrowErrorMatchingSnapshot(); + expect(() => schema.string({ validate }).validate('foo')).toThrowErrorMatchingInlineSnapshot( + `"validator failure"` + ); }); test('throw when empty string', () => { const validate = () => 'validator failure'; - expect(() => schema.string({ validate }).validate('')).toThrowErrorMatchingSnapshot(); + expect(() => schema.string({ validate }).validate('')).toThrowErrorMatchingInlineSnapshot( + `"validator failure"` + ); }); }); test('returns error when not string', () => { - expect(() => schema.string().validate(123)).toThrowErrorMatchingSnapshot(); + expect(() => schema.string().validate(123)).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [string] but got [number]"` + ); - expect(() => schema.string().validate([1, 2, 3])).toThrowErrorMatchingSnapshot(); + expect(() => schema.string().validate([1, 2, 3])).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [string] but got [Array]"` + ); - expect(() => schema.string().validate(/abc/)).toThrowErrorMatchingSnapshot(); + expect(() => schema.string().validate(/abc/)).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [string] but got [RegExp]"` + ); }); diff --git a/packages/kbn-config-schema/src/types/string_type.ts b/packages/kbn-config-schema/src/types/string_type.ts index 6d5fa93c0299c..7f49440b8d7e2 100644 --- a/packages/kbn-config-schema/src/types/string_type.ts +++ b/packages/kbn-config-schema/src/types/string_type.ts @@ -45,7 +45,7 @@ export class StringType extends Type { if (options.minLength !== undefined) { schema = schema.custom(value => { if (value.length < options.minLength!) { - return `value is [${value}] but it must have a minimum length of [${options.minLength}].`; + return `value has length [${value.length}] but it must have a minimum length of [${options.minLength}].`; } }); } @@ -53,7 +53,7 @@ export class StringType extends Type { if (options.maxLength !== undefined) { schema = schema.custom(value => { if (value.length > options.maxLength!) { - return `value is [${value}] but it must have a maximum length of [${options.maxLength}].`; + return `value has length [${value.length}] but it must have a maximum length of [${options.maxLength}].`; } }); } @@ -66,7 +66,7 @@ export class StringType extends Type { case 'any.required': return `expected value of type [string] but got [${typeDetect(value)}]`; case 'string.hostname': - return `value is [${value}] but it must be a valid hostname (see RFC 1123).`; + return `value must be a valid hostname (see RFC 1123).`; } } } diff --git a/packages/kbn-config-schema/src/types/uri_type.test.ts b/packages/kbn-config-schema/src/types/uri_type.test.ts index 1345b47a63c1f..72e5ca6f7171e 100644 --- a/packages/kbn-config-schema/src/types/uri_type.test.ts +++ b/packages/kbn-config-schema/src/types/uri_type.test.ts @@ -20,7 +20,9 @@ import { schema } from '..'; test('is required by default', () => { - expect(() => schema.uri().validate(undefined)).toThrowErrorMatchingSnapshot(); + expect(() => schema.uri().validate(undefined)).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [string] but got [undefined]."` + ); }); test('returns value for valid URI as per RFC3986', () => { @@ -54,17 +56,23 @@ test('returns value for valid URI as per RFC3986', () => { test('returns error when value is not a URI', () => { const uriSchema = schema.uri(); - expect(() => uriSchema.validate('3domain.local')).toThrowErrorMatchingSnapshot(); + expect(() => uriSchema.validate('3domain.local')).toThrowErrorMatchingInlineSnapshot( + `"value must be a valid URI (see RFC 3986)."` + ); expect(() => uriSchema.validate('http://8010:0:0:0:9:500:300C:200A') - ).toThrowErrorMatchingSnapshot(); - expect(() => uriSchema.validate('-')).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot(`"value must be a valid URI (see RFC 3986)."`); + expect(() => uriSchema.validate('-')).toThrowErrorMatchingInlineSnapshot( + `"value must be a valid URI (see RFC 3986)."` + ); expect(() => uriSchema.validate('https://example.com?baz[]=foo&baz[]=bar') - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot(`"value must be a valid URI (see RFC 3986)."`); const tooLongUri = `http://${'a'.repeat(256)}`; - expect(() => uriSchema.validate(tooLongUri)).toThrowErrorMatchingSnapshot(); + expect(() => uriSchema.validate(tooLongUri)).toThrowErrorMatchingInlineSnapshot( + `"value must be a valid URI (see RFC 3986)."` + ); }); describe('#scheme', () => { @@ -78,8 +86,12 @@ describe('#scheme', () => { test('returns error when shorter string', () => { const uriSchema = schema.uri({ scheme: ['http', 'https'] }); - expect(() => uriSchema.validate('ftp://elastic.co')).toThrowErrorMatchingSnapshot(); - expect(() => uriSchema.validate('file:///kibana.log')).toThrowErrorMatchingSnapshot(); + expect(() => uriSchema.validate('ftp://elastic.co')).toThrowErrorMatchingInlineSnapshot( + `"expected URI with scheme [http|https]."` + ); + expect(() => uriSchema.validate('file:///kibana.log')).toThrowErrorMatchingInlineSnapshot( + `"expected URI with scheme [http|https]."` + ); }); }); @@ -131,14 +143,20 @@ describe('#validate', () => { expect(() => schema.uri({ validate }).validate('http://kibana.local') - ).toThrowErrorMatchingSnapshot(); + ).toThrowErrorMatchingInlineSnapshot(`"validator failure"`); }); }); test('returns error when not string', () => { - expect(() => schema.uri().validate(123)).toThrowErrorMatchingSnapshot(); + expect(() => schema.uri().validate(123)).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [string] but got [number]."` + ); - expect(() => schema.uri().validate([1, 2, 3])).toThrowErrorMatchingSnapshot(); + expect(() => schema.uri().validate([1, 2, 3])).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [string] but got [Array]."` + ); - expect(() => schema.uri().validate(/abc/)).toThrowErrorMatchingSnapshot(); + expect(() => schema.uri().validate(/abc/)).toThrowErrorMatchingInlineSnapshot( + `"expected value of type [string] but got [RegExp]."` + ); }); diff --git a/packages/kbn-config-schema/src/types/uri_type.ts b/packages/kbn-config-schema/src/types/uri_type.ts index df1ce9e869d3b..f365ed35e3579 100644 --- a/packages/kbn-config-schema/src/types/uri_type.ts +++ b/packages/kbn-config-schema/src/types/uri_type.ts @@ -36,9 +36,9 @@ export class URIType extends Type { case 'string.base': return `expected value of type [string] but got [${typeDetect(value)}].`; case 'string.uriCustomScheme': - return `expected URI with scheme [${scheme}] but got [${value}].`; + return `expected URI with scheme [${scheme}].`; case 'string.uri': - return `value is [${value}] but it must be a valid URI (see RFC 3986).`; + return `value must be a valid URI (see RFC 3986).`; } } } diff --git a/packages/kbn-interpreter/src/common/index.d.ts b/packages/kbn-interpreter/src/common/index.d.ts index bf03795d0a15c..ec6d1116b94cc 100644 --- a/packages/kbn-interpreter/src/common/index.d.ts +++ b/packages/kbn-interpreter/src/common/index.d.ts @@ -20,3 +20,4 @@ export { Registry } from './lib/registry'; export { fromExpression, toExpression, Ast, ExpressionFunctionAST } from './lib/ast'; +export { getType } from './lib/get_type'; diff --git a/packages/kbn-interpreter/src/common/lib/get_type.d.ts b/packages/kbn-interpreter/src/common/lib/get_type.d.ts new file mode 100644 index 0000000000000..db8592713abbf --- /dev/null +++ b/packages/kbn-interpreter/src/common/lib/get_type.d.ts @@ -0,0 +1,20 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export declare function getType(node: any): string; diff --git a/packages/kbn-storybook/storybook_config/webpack.config.js b/packages/kbn-storybook/storybook_config/webpack.config.js index 72ff9162ffe6c..1531c1d22b01b 100644 --- a/packages/kbn-storybook/storybook_config/webpack.config.js +++ b/packages/kbn-storybook/storybook_config/webpack.config.js @@ -19,6 +19,7 @@ const { resolve } = require('path'); const webpack = require('webpack'); +const { stringifyRequest } = require('loader-utils'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const { REPO_ROOT, DLL_DIST_DIR } = require('../lib/constants'); // eslint-disable-next-line import/no-unresolved @@ -72,6 +73,38 @@ module.exports = async ({ config }) => { ], }); + // Enable SASS + config.module.rules.push({ + test: /\.scss$/, + exclude: /\.module.(s(a|c)ss)$/, + use: [ + { loader: 'style-loader' }, + { loader: 'css-loader', options: { importLoaders: 2 } }, + { + loader: 'postcss-loader', + options: { + config: { + path: resolve(REPO_ROOT, 'src/optimize/'), + }, + }, + }, + { + loader: 'sass-loader', + options: { + prependData(loaderContext) { + return `@import ${stringifyRequest( + loaderContext, + resolve(REPO_ROOT, 'src/legacy/ui/public/styles/_styling_constants.scss') + )};\n`; + }, + sassOptions: { + includePaths: [resolve(REPO_ROOT, 'node_modules')], + }, + }, + }, + ], + }); + // Reference the built DLL file of static(ish) dependencies, which are removed // during kbn:bootstrap and rebuilt if missing. config.plugins.push( @@ -96,7 +129,7 @@ module.exports = async ({ config }) => { ); // Tell Webpack about the ts/x extensions - config.resolve.extensions.push('.ts', '.tsx'); + config.resolve.extensions.push('.ts', '.tsx', '.scss'); // Load custom Webpack config specified by a plugin. if (currentConfig.webpackHook) { diff --git a/packages/kbn-ui-shared-deps/package.json b/packages/kbn-ui-shared-deps/package.json index e9ad227b235fa..65fd837ad17c2 100644 --- a/packages/kbn-ui-shared-deps/package.json +++ b/packages/kbn-ui-shared-deps/package.json @@ -11,7 +11,7 @@ "devDependencies": { "@elastic/charts": "^17.1.1", "abortcontroller-polyfill": "^1.4.0", - "@elastic/eui": "19.0.0", + "@elastic/eui": "20.0.2", "@kbn/babel-preset": "1.0.0", "@kbn/dev-utils": "1.0.0", "@kbn/i18n": "1.0.0", diff --git a/scripts/check_core_api_changes.js b/scripts/check_core_api_changes.js deleted file mode 100644 index 153491e0aecda..0000000000000 --- a/scripts/check_core_api_changes.js +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -require('../src/setup_node_env'); -require('../src/dev/run_check_core_api_changes'); diff --git a/scripts/check_published_api_changes.js b/scripts/check_published_api_changes.js new file mode 100644 index 0000000000000..bea07dfd63377 --- /dev/null +++ b/scripts/check_published_api_changes.js @@ -0,0 +1,21 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +require('../src/setup_node_env'); +require('../src/dev/run_check_published_api_changes'); diff --git a/scripts/test_hardening.js b/scripts/test_hardening.js new file mode 100644 index 0000000000000..c0a20a9ff6cb4 --- /dev/null +++ b/scripts/test_hardening.js @@ -0,0 +1,41 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +var execFileSync = require('child_process').execFileSync; +var path = require('path'); +var syncGlob = require('glob').sync; +var program = require('commander'); + +program + .name('node scripts/test_hardening.js') + .arguments('[file...]') + .description( + 'Run the tests in test/harden directory. If no files are provided, all files within the directory will be run.' + ) + .action(function(globs) { + if (globs.length === 0) globs.push(path.join('test', 'harden', '*')); + globs.forEach(function(glob) { + syncGlob(glob).forEach(function(filename) { + if (path.basename(filename)[0] === '_') return; + console.log(process.argv[0], filename); + execFileSync(process.argv[0], [filename], { stdio: 'inherit' }); + }); + }); + }) + .parse(process.argv); diff --git a/src/cli_plugin/install/cleanup.js b/src/cli_plugin/install/cleanup.js index fa4bdcf4f6966..eaa25962ef0e4 100644 --- a/src/cli_plugin/install/cleanup.js +++ b/src/cli_plugin/install/cleanup.js @@ -27,7 +27,7 @@ export function cleanPrevious(settings, logger) { logger.log('Found previous install attempt. Deleting...'); try { - del.sync(settings.workingPath); + del.sync(settings.workingPath, { force: true }); } catch (e) { reject(e); } diff --git a/src/cli_plugin/install/install.js b/src/cli_plugin/install/install.js index 5a341e67dc128..92be2ac250320 100644 --- a/src/cli_plugin/install/install.js +++ b/src/cli_plugin/install/install.js @@ -46,7 +46,7 @@ export default async function install(settings, logger) { await extract(settings, logger); - del.sync(settings.tempArchiveFile); + del.sync(settings.tempArchiveFile, { force: true }); existingInstall(settings, logger); diff --git a/src/cli_plugin/remove/remove.js b/src/cli_plugin/remove/remove.js index 8432d0f44836b..353e592390ff4 100644 --- a/src/cli_plugin/remove/remove.js +++ b/src/cli_plugin/remove/remove.js @@ -37,7 +37,7 @@ export default function remove(settings, logger) { } logger.log(`Removing ${settings.plugin}...`); - del.sync(settings.pluginPath); + del.sync(settings.pluginPath, { force: true }); logger.log('Plugin removal complete'); } catch (err) { logger.error(`Unable to remove plugin because of error: "${err.message}"`); diff --git a/src/core/MIGRATION.md b/src/core/MIGRATION.md index 4dd6bedfa4f0c..e04d45f77db5d 100644 --- a/src/core/MIGRATION.md +++ b/src/core/MIGRATION.md @@ -1178,10 +1178,10 @@ import { setup, start } from '../core_plugins/visualizations/public/legacy'; | `ui/index_patterns` | `data.indexPatterns` | still in progress | | `ui/registry/field_formats` | `data.fieldFormats` | | | `ui/registry/feature_catalogue` | `home.featureCatalogue.register` | Must add `home` as a dependency in your kibana.json. | -| `ui/registry/vis_types` | `visualizations.types` | -- | -| `ui/vis` | `visualizations.types` | -- | +| `ui/registry/vis_types` | `visualizations` | -- | +| `ui/vis` | `visualizations` | -- | | `ui/share` | `share` | `showShareContextMenu` is now called `toggleShareContextMenu`, `ShareContextMenuExtensionsRegistryProvider` is now called `register` | -| `ui/vis/vis_factory` | `visualizations.types` | -- | +| `ui/vis/vis_factory` | `visualizations` | -- | | `ui/vis/vis_filters` | `visualizations.filters` | -- | | `ui/utils/parse_es_interval` | `import { parseEsInterval } from '../data/public'` | `parseEsInterval`, `ParsedInterval`, `InvalidEsCalendarIntervalError`, `InvalidEsIntervalFormatError` items were moved to the `Data Plugin` as a static code | @@ -1210,6 +1210,7 @@ In server code, `core` can be accessed from either `server.newPlatform` or `kbnS | `kibana.Plugin.savedObjectSchemas` | [`core.savedObjects.registerType`](docs/development/core/server/kibana-plugin-server.savedobjectsservicesetup.registertype.md) | [Examples](./MIGRATION_EXAMPLES.md#saved-objects-types) | | `kibana.Plugin.mappings` | [`core.savedObjects.registerType`](docs/development/core/server/kibana-plugin-server.savedobjectsservicesetup.registertype.md) | [Examples](./MIGRATION_EXAMPLES.md#saved-objects-types) | | `kibana.Plugin.migrations` | [`core.savedObjects.registerType`](docs/development/core/server/kibana-plugin-server.savedobjectsservicesetup.registertype.md) | [Examples](./MIGRATION_EXAMPLES.md#saved-objects-types) | +| `kibana.Plugin.savedObjectsManagement` | [`core.savedObjects.registerType`](docs/development/core/server/kibana-plugin-server.savedobjectsservicesetup.registertype.md) | [Examples](./MIGRATION_EXAMPLES.md#saved-objects-types) | _See also: [Server's CoreSetup API Docs](/docs/development/core/server/kibana-plugin-server.coresetup.md)_ diff --git a/src/core/MIGRATION_EXAMPLES.md b/src/core/MIGRATION_EXAMPLES.md index 2953edb535f47..29edef476d7c3 100644 --- a/src/core/MIGRATION_EXAMPLES.md +++ b/src/core/MIGRATION_EXAMPLES.md @@ -749,7 +749,7 @@ using the core `savedObjects`'s `registerType` setup API. The most notable difference is that in the new platform, the type registration is performed in a single call to `registerType`, passing a new `SavedObjectsType` structure that is a superset of the legacy `schema`, `migrations` -and `mappings`. +`mappings` and `savedObjectsManagement`. ### Concrete example @@ -775,6 +775,32 @@ new kibana.Plugin({ isHidden: true, }, }, + savedObjectsManagement: { + 'first-type': { + isImportableAndExportable: true, + icon: 'myFirstIcon', + defaultSearchField: 'title', + getTitle(obj) { + return obj.attributes.title; + }, + getEditUrl(obj) { + return `/some-url/${encodeURIComponent(obj.id)}`; + }, + }, + 'second-type': { + isImportableAndExportable: false, + icon: 'mySecondIcon', + getTitle(obj) { + return obj.attributes.myTitleField; + }, + getInAppUrl(obj) { + return { + path: `/some-url/${encodeURIComponent(obj.id)}`, + uiCapabilitiesPath: 'myPlugin.myType.show', + }; + }, + }, + }, }, }) ``` @@ -844,6 +870,17 @@ export const firstType: SavedObjectsType = { '1.0.0': migrateFirstTypeToV1, '2.0.0': migrateFirstTypeToV2, }, + management: { + importableAndExportable: true, + icon: 'myFirstIcon', + defaultSearchField: 'title', + getTitle(obj) { + return obj.attributes.title; + }, + getEditUrl(obj) { + return `/some-url/${encodeURIComponent(obj.id)}`; + }, + }, }; ``` @@ -870,6 +907,19 @@ export const secondType: SavedObjectsType = { migrations: { '1.5.0': migrateSecondTypeToV15, }, + management: { + importableAndExportable: false, + icon: 'mySecondIcon', + getTitle(obj) { + return obj.attributes.myTitleField; + }, + getInAppUrl(obj) { + return { + path: `/some-url/${encodeURIComponent(obj.id)}`, + uiCapabilitiesPath: 'myPlugin.myType.show', + }; + }, + }, }; ``` @@ -895,6 +945,8 @@ The NP `registerType` expected input is very close to the legacy format. However - The `schema.indexPattern` was accepting either a `string` or a `(config: LegacyConfig) => string`. `SavedObjectsType.indexPattern` only accepts a string, as you can access the configuration during your plugin's setup phase. +- The `savedObjectsManagement.isImportableAndExportable` property has been renamed: `SavedObjectsType.management.importableAndExportable` + - The migration function signature has changed: In legacy, it was `(doc: SavedObjectUnsanitizedDoc, log: SavedObjectsMigrationLogger) => SavedObjectUnsanitizedDoc;` In new platform, it is now `(doc: SavedObjectUnsanitizedDoc, context: SavedObjectMigrationContext) => SavedObjectUnsanitizedDoc;` diff --git a/src/core/README.md b/src/core/README.md index f4539191d448b..b30c62e21b296 100644 --- a/src/core/README.md +++ b/src/core/README.md @@ -37,7 +37,7 @@ well documented. To reduce the chance of regressions, development on the Core AP process described below. Changes to the API signature which have not been accepted will cause the build to fail. When changes to the Core API's signatures are made, the following process needs to be followed: -1. After changes have been made, run `yarn core:acceptApiChanges` which performs the following: +1. After changes have been made, run `yarn docs:acceptApiChanges` which performs the following: - Recompiles all typescript typings files - Updates the API review files `src/core/public/kibana.api.md` and `src/core/server/kibana.api.md` - Updates the Core API documentation in `docs/development/core/` diff --git a/src/core/public/application/capabilities/capabilities_service.tsx b/src/core/public/application/capabilities/capabilities_service.tsx index 05d718e1073df..d602422c14634 100644 --- a/src/core/public/application/capabilities/capabilities_service.tsx +++ b/src/core/public/application/capabilities/capabilities_service.tsx @@ -37,8 +37,7 @@ export interface CapabilitiesStart { */ export class CapabilitiesService { public async start({ appIds, http }: StartDeps): Promise { - const route = http.anonymousPaths.isAnonymous(window.location.pathname) ? '/defaults' : ''; - const capabilities = await http.post(`/api/core/capabilities${route}`, { + const capabilities = await http.post('/api/core/capabilities', { body: JSON.stringify({ applications: appIds }), }); diff --git a/src/core/public/http/fetch.test.ts b/src/core/public/http/fetch.test.ts index efd9fdd053674..f223956075e97 100644 --- a/src/core/public/http/fetch.test.ts +++ b/src/core/public/http/fetch.test.ts @@ -21,6 +21,7 @@ import fetchMock from 'fetch-mock/es5/client'; import { readFileSync } from 'fs'; import { join } from 'path'; +import { first } from 'rxjs/operators'; import { Fetch } from './fetch'; import { BasePath } from './base_path'; @@ -30,9 +31,11 @@ function delay(duration: number) { return new Promise(r => setTimeout(r, duration)); } +const BASE_PATH = 'http://localhost/myBase'; + describe('Fetch', () => { const fetchInstance = new Fetch({ - basePath: new BasePath('http://localhost/myBase'), + basePath: new BasePath(BASE_PATH), kibanaVersion: 'VERSION', }); afterEach(() => { @@ -40,6 +43,79 @@ describe('Fetch', () => { fetchInstance.removeAllInterceptors(); }); + describe('getRequestCount$', () => { + const getCurrentRequestCount = () => + fetchInstance + .getRequestCount$() + .pipe(first()) + .toPromise(); + + it('should increase and decrease when request receives success response', async () => { + fetchMock.get('*', 200); + + const fetchResponse = fetchInstance.fetch('/path'); + expect(await getCurrentRequestCount()).toEqual(1); + + await expect(fetchResponse).resolves.not.toThrow(); + expect(await getCurrentRequestCount()).toEqual(0); + }); + + it('should increase and decrease when request receives error response', async () => { + fetchMock.get('*', 500); + + const fetchResponse = fetchInstance.fetch('/path'); + expect(await getCurrentRequestCount()).toEqual(1); + + await expect(fetchResponse).rejects.toThrow(); + expect(await getCurrentRequestCount()).toEqual(0); + }); + + it('should increase and decrease when request fails', async () => { + fetchMock.get('*', Promise.reject('Network!')); + + const fetchResponse = fetchInstance.fetch('/path'); + expect(await getCurrentRequestCount()).toEqual(1); + + await expect(fetchResponse).rejects.toThrow(); + expect(await getCurrentRequestCount()).toEqual(0); + }); + + it('should change for multiple requests', async () => { + fetchMock.get(`${BASE_PATH}/success`, 200); + fetchMock.get(`${BASE_PATH}/fail`, 400); + fetchMock.get(`${BASE_PATH}/network-fail`, Promise.reject('Network!')); + + const requestCounts: number[] = []; + const subscription = fetchInstance + .getRequestCount$() + .subscribe(count => requestCounts.push(count)); + + const success1 = fetchInstance.fetch('/success'); + const success2 = fetchInstance.fetch('/success'); + const failure1 = fetchInstance.fetch('/fail'); + const failure2 = fetchInstance.fetch('/fail'); + const networkFailure1 = fetchInstance.fetch('/network-fail'); + const success3 = fetchInstance.fetch('/success'); + const failure3 = fetchInstance.fetch('/fail'); + const networkFailure2 = fetchInstance.fetch('/network-fail'); + + const swallowError = (p: Promise) => p.catch(() => {}); + await Promise.all([ + success1, + success2, + success3, + swallowError(failure1), + swallowError(failure2), + swallowError(failure3), + swallowError(networkFailure1), + swallowError(networkFailure2), + ]); + + expect(requestCounts).toEqual([0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0]); + subscription.unsubscribe(); + }); + }); + describe('http requests', () => { it('should fail with invalid arguments', async () => { fetchMock.get('*', {}); diff --git a/src/core/public/http/fetch.ts b/src/core/public/http/fetch.ts index b433acdb6dbb9..d88dc2e3a9037 100644 --- a/src/core/public/http/fetch.ts +++ b/src/core/public/http/fetch.ts @@ -19,6 +19,7 @@ import { merge } from 'lodash'; import { format } from 'url'; +import { BehaviorSubject } from 'rxjs'; import { IBasePath, @@ -43,6 +44,7 @@ const NDJSON_CONTENT = /^(application\/ndjson)(;.*)?$/; export class Fetch { private readonly interceptors = new Set(); + private readonly requestCount$ = new BehaviorSubject(0); constructor(private readonly params: Params) {} @@ -57,6 +59,10 @@ export class Fetch { this.interceptors.clear(); } + public getRequestCount$() { + return this.requestCount$.asObservable(); + } + public readonly delete = this.shorthand('DELETE'); public readonly get = this.shorthand('GET'); public readonly head = this.shorthand('HEAD'); @@ -76,6 +82,7 @@ export class Fetch { // a halt is called we do not resolve or reject, halting handling of the promise. return new Promise>(async (resolve, reject) => { try { + this.requestCount$.next(this.requestCount$.value + 1); const interceptedOptions = await interceptRequest( optionsWithPath, this.interceptors, @@ -98,6 +105,8 @@ export class Fetch { if (!(error instanceof HttpInterceptHaltError)) { reject(error); } + } finally { + this.requestCount$.next(this.requestCount$.value - 1); } }); }; diff --git a/src/core/public/http/http_service.test.ts b/src/core/public/http/http_service.test.ts index a40fcb06273dd..78220af9cc83b 100644 --- a/src/core/public/http/http_service.test.ts +++ b/src/core/public/http/http_service.test.ts @@ -24,6 +24,7 @@ import { loadingServiceMock } from './http_service.test.mocks'; import { fatalErrorsServiceMock } from '../fatal_errors/fatal_errors_service.mock'; import { injectedMetadataServiceMock } from '../injected_metadata/injected_metadata_service.mock'; import { HttpService } from './http_service'; +import { Observable } from 'rxjs'; describe('interceptors', () => { afterEach(() => fetchMock.restore()); @@ -52,6 +53,18 @@ describe('interceptors', () => { }); }); +describe('#setup()', () => { + it('registers Fetch#getLoadingCount$() with LoadingCountSetup#addLoadingCountSource()', () => { + const injectedMetadata = injectedMetadataServiceMock.createSetupContract(); + const fatalErrors = fatalErrorsServiceMock.createSetupContract(); + const httpService = new HttpService(); + httpService.setup({ fatalErrors, injectedMetadata }); + const loadingServiceSetup = loadingServiceMock.setup.mock.results[0].value; + // We don't verify that this Observable comes from Fetch#getLoadingCount$() to avoid complex mocking + expect(loadingServiceSetup.addLoadingCountSource).toHaveBeenCalledWith(expect.any(Observable)); + }); +}); + describe('#stop()', () => { it('calls loadingCount.stop()', () => { const injectedMetadata = injectedMetadataServiceMock.createSetupContract(); diff --git a/src/core/public/http/http_service.ts b/src/core/public/http/http_service.ts index 44fc9d65565d4..98de1d919c481 100644 --- a/src/core/public/http/http_service.ts +++ b/src/core/public/http/http_service.ts @@ -45,6 +45,7 @@ export class HttpService implements CoreService { ); const fetchService = new Fetch({ basePath, kibanaVersion }); const loadingCount = this.loadingCount.setup({ fatalErrors }); + loadingCount.addLoadingCountSource(fetchService.getRequestCount$()); this.service = { basePath, diff --git a/src/core/public/http/types.ts b/src/core/public/http/types.ts index 6370ae165282b..c40ad74893ead 100644 --- a/src/core/public/http/types.ts +++ b/src/core/public/http/types.ts @@ -205,7 +205,12 @@ export interface HttpRequestInit { /** @public */ export interface HttpFetchQuery { - [key: string]: string | number | boolean | undefined; + [key: string]: + | string + | number + | boolean + | undefined + | Array; } /** diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md index cd956eb17531a..f71a50e2927d8 100644 --- a/src/core/public/public.api.md +++ b/src/core/public/public.api.md @@ -610,7 +610,7 @@ export interface HttpFetchOptionsWithPath extends HttpFetchOptions { // @public (undocumented) export interface HttpFetchQuery { // (undocumented) - [key: string]: string | number | boolean | undefined; + [key: string]: string | number | boolean | undefined | Array; } // @public diff --git a/src/core/server/capabilities/capabilities_service.test.ts b/src/core/server/capabilities/capabilities_service.test.ts index aace0b9debf9c..7d2e7391aa8d4 100644 --- a/src/core/server/capabilities/capabilities_service.test.ts +++ b/src/core/server/capabilities/capabilities_service.test.ts @@ -41,8 +41,8 @@ describe('CapabilitiesService', () => { }); it('registers the capabilities routes', async () => { - expect(http.createRouter).toHaveBeenCalledWith('/api/core/capabilities'); - expect(router.post).toHaveBeenCalledTimes(2); + expect(http.createRouter).toHaveBeenCalledWith(''); + expect(router.post).toHaveBeenCalledTimes(1); expect(router.post).toHaveBeenCalledWith(expect.any(Object), expect.any(Function)); }); diff --git a/src/core/server/capabilities/routes/index.ts b/src/core/server/capabilities/routes/index.ts index ccaa4621d7003..74c485986a77b 100644 --- a/src/core/server/capabilities/routes/index.ts +++ b/src/core/server/capabilities/routes/index.ts @@ -22,6 +22,6 @@ import { InternalHttpServiceSetup } from '../../http'; import { registerCapabilitiesRoutes } from './resolve_capabilities'; export function registerRoutes(http: InternalHttpServiceSetup, resolver: CapabilitiesResolver) { - const router = http.createRouter('/api/core/capabilities'); + const router = http.createRouter(''); registerCapabilitiesRoutes(router, resolver); } diff --git a/src/core/server/capabilities/routes/resolve_capabilities.ts b/src/core/server/capabilities/routes/resolve_capabilities.ts index 5e1d49b4b1b7e..3fb1bb3d13d0b 100644 --- a/src/core/server/capabilities/routes/resolve_capabilities.ts +++ b/src/core/server/capabilities/routes/resolve_capabilities.ts @@ -22,30 +22,24 @@ import { IRouter } from '../../http'; import { CapabilitiesResolver } from '../resolve_capabilities'; export function registerCapabilitiesRoutes(router: IRouter, resolver: CapabilitiesResolver) { - // Capabilities are fetched on both authenticated and anonymous routes. - // However when `authRequired` is false, authentication is not performed - // and only default capabilities are returned (all disabled), even for authenticated users. - // So we need two endpoints to handle both scenarios. - [true, false].forEach(authRequired => { - router.post( - { - path: authRequired ? '' : '/defaults', - options: { - authRequired, - }, - validate: { - body: schema.object({ - applications: schema.arrayOf(schema.string()), - }), - }, + router.post( + { + path: '/api/core/capabilities', + options: { + authRequired: 'optional', }, - async (ctx, req, res) => { - const { applications } = req.body; - const capabilities = await resolver(req, applications); - return res.ok({ - body: capabilities, - }); - } - ); - }); + validate: { + body: schema.object({ + applications: schema.arrayOf(schema.string()), + }), + }, + }, + async (ctx, req, res) => { + const { applications } = req.body; + const capabilities = await resolver(req, applications); + return res.ok({ + body: capabilities, + }); + } + ); } diff --git a/src/core/server/http/__snapshots__/http_config.test.ts.snap b/src/core/server/http/__snapshots__/http_config.test.ts.snap index 28933a035c870..07c153a7a8a20 100644 --- a/src/core/server/http/__snapshots__/http_config.test.ts.snap +++ b/src/core/server/http/__snapshots__/http_config.test.ts.snap @@ -87,7 +87,7 @@ exports[`throws if basepath is missing prepended slash 1`] = `"[basePath]: must exports[`throws if basepath is not specified, but rewriteBasePath is set 1`] = `"cannot use [rewriteBasePath] when [basePath] is not specified"`; -exports[`throws if invalid hostname 1`] = `"[host]: value is [asdf$%^] but it must be a valid hostname (see RFC 1123)."`; +exports[`throws if invalid hostname 1`] = `"[host]: value must be a valid hostname (see RFC 1123)."`; exports[`with TLS throws if TLS is enabled but \`redirectHttpFromPort\` is equal to \`port\` 1`] = `"Kibana does not accept http traffic to [port] when ssl is enabled (only https is allowed), so [ssl.redirectHttpFromPort] cannot be configured to the same value. Both are [1234]."`; @@ -100,7 +100,7 @@ Array [ ] `; -exports[`with compression throws if invalid referrer whitelist 1`] = `"[compression.referrerWhitelist.0]: value is [asdf$%^] but it must be a valid hostname (see RFC 1123)."`; +exports[`with compression throws if invalid referrer whitelist 1`] = `"[compression.referrerWhitelist.0]: value must be a valid hostname (see RFC 1123)."`; exports[`with compression throws if invalid referrer whitelist 2`] = `"[compression.referrerWhitelist]: array size is [0], but cannot be smaller than [1]"`; diff --git a/src/core/server/http/http_server.mocks.ts b/src/core/server/http/http_server.mocks.ts index 741c723ca9365..bbef0a105c089 100644 --- a/src/core/server/http/http_server.mocks.ts +++ b/src/core/server/http/http_server.mocks.ts @@ -36,6 +36,7 @@ import { OnPostAuthToolkit } from './lifecycle/on_post_auth'; import { OnPreAuthToolkit } from './lifecycle/on_pre_auth'; interface RequestFixtureOptions

{ + auth?: { isAuthenticated: boolean }; headers?: Record; params?: Record; body?: Record; @@ -65,11 +66,13 @@ function createKibanaRequestMock

({ routeAuthRequired, validation = {}, kibanaRouteState = { xsrfRequired: true }, + auth = { isAuthenticated: true }, }: RequestFixtureOptions = {}) { const queryString = stringify(query, { sort: false }); return KibanaRequest.from( createRawRequestMock({ + auth, headers, params, query, @@ -113,6 +116,9 @@ function createRawRequestMock(customization: DeepPartial = {}) { {}, { app: { xsrfRequired: true } as any, + auth: { + isAuthenticated: true, + }, headers: {}, path: '/', route: { settings: {} }, diff --git a/src/core/server/http/http_server.ts b/src/core/server/http/http_server.ts index cffdffab0d0cf..f898ed0ea1a99 100644 --- a/src/core/server/http/http_server.ts +++ b/src/core/server/http/http_server.ts @@ -26,8 +26,7 @@ import { adoptToHapiAuthFormat, AuthenticationHandler } from './lifecycle/auth'; import { adoptToHapiOnPostAuthFormat, OnPostAuthHandler } from './lifecycle/on_post_auth'; import { adoptToHapiOnPreAuthFormat, OnPreAuthHandler } from './lifecycle/on_pre_auth'; import { adoptToHapiOnPreResponseFormat, OnPreResponseHandler } from './lifecycle/on_pre_response'; - -import { IRouter, KibanaRouteState, isSafeMethod } from './router'; +import { IRouter, RouteConfigOptions, KibanaRouteState, isSafeMethod } from './router'; import { SessionStorageCookieOptions, createCookieSessionStorageFactory, @@ -148,7 +147,7 @@ export class HttpServer { this.log.debug(`registering route handler for [${route.path}]`); // Hapi does not allow payload validation to be specified for 'head' or 'get' requests const validate = isSafeMethod(route.method) ? undefined : { payload: true }; - const { authRequired = true, tags, body = {} } = route.options; + const { authRequired, tags, body = {} } = route.options; const { accepts: allow, maxBytes, output, parse } = body; const kibanaRouteState: KibanaRouteState = { @@ -160,8 +159,7 @@ export class HttpServer { method: route.method, path: route.path, options: { - // Enforcing the comparison with true because plugins could overwrite the auth strategy by doing `options: { authRequired: authStrategy as any }` - auth: authRequired === true ? undefined : false, + auth: this.getAuthOption(authRequired), app: kibanaRouteState, tags: tags ? Array.from(tags) : undefined, // TODO: This 'validate' section can be removed once the legacy platform is completely removed. @@ -196,6 +194,22 @@ export class HttpServer { this.server = undefined; } + private getAuthOption( + authRequired: RouteConfigOptions['authRequired'] = true + ): undefined | false | { mode: 'required' | 'optional' } { + if (this.authRegistered === false) return undefined; + + if (authRequired === true) { + return { mode: 'required' }; + } + if (authRequired === 'optional') { + return { mode: 'optional' }; + } + if (authRequired === false) { + return false; + } + } + private setupBasePathRewrite(config: HttpConfig, basePathService: BasePath) { if (config.basePath === undefined || !config.rewriteBasePath) { return; diff --git a/src/core/server/http/http_service.mock.ts b/src/core/server/http/http_service.mock.ts index 30032ff5da796..442bc93190d86 100644 --- a/src/core/server/http/http_service.mock.ts +++ b/src/core/server/http/http_service.mock.ts @@ -115,6 +115,8 @@ const createOnPostAuthToolkitMock = (): jest.Mocked => ({ const createAuthToolkitMock = (): jest.Mocked => ({ authenticated: jest.fn(), + notHandled: jest.fn(), + redirected: jest.fn(), }); const createOnPreResponseToolkitMock = (): jest.Mocked => ({ diff --git a/src/core/server/http/index.ts b/src/core/server/http/index.ts index 8f4c02680f8a3..a75eb04fa0120 100644 --- a/src/core/server/http/index.ts +++ b/src/core/server/http/index.ts @@ -67,9 +67,12 @@ export { AuthenticationHandler, AuthHeaders, AuthResultParams, + AuthRedirected, + AuthRedirectedParams, AuthToolkit, AuthResult, Authenticated, + AuthNotHandled, AuthResultType, } from './lifecycle/auth'; export { OnPostAuthHandler, OnPostAuthToolkit } from './lifecycle/on_post_auth'; 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 425d8cac1893e..7b1630a7de0be 100644 --- a/src/core/server/http/integration_tests/core_services.test.ts +++ b/src/core/server/http/integration_tests/core_services.test.ts @@ -50,7 +50,7 @@ describe('http service', () => { await root.shutdown(); }); describe('#isAuthenticated()', () => { - it('returns true if has been authorized', async () => { + it('returns true if has been authenticated', async () => { const { http } = await root.setup(); const { registerAuth, createRouter, auth } = http; @@ -65,11 +65,11 @@ describe('http service', () => { await kbnTestServer.request.get(root, '/is-auth').expect(200, { isAuthenticated: true }); }); - it('returns false if has not been authorized', async () => { + it('returns false if has not been authenticated', async () => { const { http } = await root.setup(); const { registerAuth, createRouter, auth } = http; - await registerAuth((req, res, toolkit) => toolkit.authenticated()); + registerAuth((req, res, toolkit) => toolkit.authenticated()); const router = createRouter(''); router.get( @@ -81,7 +81,7 @@ describe('http service', () => { await kbnTestServer.request.get(root, '/is-auth').expect(200, { isAuthenticated: false }); }); - it('returns false if no authorization mechanism has been registered', async () => { + it('returns false if no authentication mechanism has been registered', async () => { const { http } = await root.setup(); const { createRouter, auth } = http; @@ -94,6 +94,37 @@ describe('http service', () => { await root.start(); await kbnTestServer.request.get(root, '/is-auth').expect(200, { isAuthenticated: false }); }); + + it('returns true if authenticated on a route with "optional" auth', async () => { + const { http } = await root.setup(); + const { createRouter, auth, registerAuth } = http; + + registerAuth((req, res, toolkit) => toolkit.authenticated()); + const router = createRouter(''); + router.get( + { path: '/is-auth', validate: false, options: { authRequired: 'optional' } }, + (context, req, res) => res.ok({ body: { isAuthenticated: auth.isAuthenticated(req) } }) + ); + + await root.start(); + await kbnTestServer.request.get(root, '/is-auth').expect(200, { isAuthenticated: true }); + }); + + it('returns false if not authenticated on a route with "optional" auth', async () => { + const { http } = await root.setup(); + const { createRouter, auth, registerAuth } = http; + + registerAuth((req, res, toolkit) => toolkit.notHandled()); + + const router = createRouter(''); + router.get( + { path: '/is-auth', validate: false, options: { authRequired: 'optional' } }, + (context, req, res) => res.ok({ body: { isAuthenticated: auth.isAuthenticated(req) } }) + ); + + await root.start(); + await kbnTestServer.request.get(root, '/is-auth').expect(200, { isAuthenticated: false }); + }); }); describe('#get()', () => { it('returns authenticated status and allow associate auth state with request', async () => { diff --git a/src/core/server/http/integration_tests/lifecycle.test.ts b/src/core/server/http/integration_tests/lifecycle.test.ts index 6dc7ece1359df..0f0d54e88daca 100644 --- a/src/core/server/http/integration_tests/lifecycle.test.ts +++ b/src/core/server/http/integration_tests/lifecycle.test.ts @@ -57,7 +57,7 @@ interface StorageData { } describe('OnPreAuth', () => { - it('supports registering request inceptors', async () => { + it('supports registering a request interceptor', async () => { const { registerOnPreAuth, server: innerServer, createRouter } = await server.setup(setupDeps); const router = createRouter('/'); @@ -415,6 +415,23 @@ describe('Auth', () => { .expect(200, { content: 'ok' }); }); + it('blocks access to a resource if credentials are not provided', async () => { + const { registerAuth, server: innerServer, createRouter } = await server.setup(setupDeps); + const router = createRouter('/'); + + router.get({ path: '/', validate: false }, (context, req, res) => + res.ok({ body: { content: 'ok' } }) + ); + registerAuth((req, res, t) => t.notHandled()); + await server.start(); + + const result = await supertest(innerServer.listener) + .get('/') + .expect(401); + + expect(result.body.message).toBe('Unauthorized'); + }); + it('enables auth for a route by default if registerAuth has been called', async () => { const { registerAuth, server: innerServer, createRouter } = await server.setup(setupDeps); const router = createRouter('/'); @@ -492,11 +509,9 @@ describe('Auth', () => { router.get({ path: '/', validate: false }, (context, req, res) => res.ok()); const redirectTo = '/redirect-url'; - registerAuth((req, res) => - res.redirected({ - headers: { - location: redirectTo, - }, + registerAuth((req, res, t) => + t.redirected({ + location: redirectTo, }) ); await server.start(); @@ -507,6 +522,19 @@ describe('Auth', () => { expect(response.header.location).toBe(redirectTo); }); + it('throws if redirection url is not provided', async () => { + const { registerAuth, server: innerServer, createRouter } = await server.setup(setupDeps); + const router = createRouter('/'); + + router.get({ path: '/', validate: false }, (context, req, res) => res.ok()); + registerAuth((req, res, t) => t.redirected({} as any)); + await server.start(); + + await supertest(innerServer.listener) + .get('/') + .expect(500); + }); + it(`doesn't expose internal error details`, async () => { const { registerAuth, server: innerServer, createRouter } = await server.setup(setupDeps); const router = createRouter('/'); @@ -865,7 +893,7 @@ describe('Auth', () => { ] `); }); - // eslint-disable-next-line + it(`doesn't share request object between interceptors`, async () => { const { registerOnPostAuth, server: innerServer, createRouter } = await server.setup(setupDeps); const router = createRouter('/'); diff --git a/src/core/server/http/integration_tests/request.test.ts b/src/core/server/http/integration_tests/request.test.ts index bc1bbc881315a..85270174fbc04 100644 --- a/src/core/server/http/integration_tests/request.test.ts +++ b/src/core/server/http/integration_tests/request.test.ts @@ -45,6 +45,89 @@ afterEach(async () => { const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms)); describe('KibanaRequest', () => { + describe('auth', () => { + describe('isAuthenticated', () => { + it('returns false if no auth interceptor was registered', async () => { + const { server: innerServer, createRouter } = await server.setup(setupDeps); + const router = createRouter('/'); + router.get( + { path: '/', validate: false, options: { authRequired: true } }, + (context, req, res) => res.ok({ body: { isAuthenticated: req.auth.isAuthenticated } }) + ); + await server.start(); + + await supertest(innerServer.listener) + .get('/') + .expect(200, { + isAuthenticated: false, + }); + }); + it('returns false if not authenticated on a route with authRequired: "optional"', async () => { + const { server: innerServer, createRouter, registerAuth } = await server.setup(setupDeps); + const router = createRouter('/'); + registerAuth((req, res, toolkit) => toolkit.notHandled()); + router.get( + { path: '/', validate: false, options: { authRequired: 'optional' } }, + (context, req, res) => res.ok({ body: { isAuthenticated: req.auth.isAuthenticated } }) + ); + await server.start(); + + await supertest(innerServer.listener) + .get('/') + .expect(200, { + isAuthenticated: false, + }); + }); + it('returns false if redirected on a route with authRequired: "optional"', async () => { + const { server: innerServer, createRouter, registerAuth } = await server.setup(setupDeps); + const router = createRouter('/'); + registerAuth((req, res, toolkit) => toolkit.redirected({ location: '/any' })); + router.get( + { path: '/', validate: false, options: { authRequired: 'optional' } }, + (context, req, res) => res.ok({ body: { isAuthenticated: req.auth.isAuthenticated } }) + ); + await server.start(); + + await supertest(innerServer.listener) + .get('/') + .expect(200, { + isAuthenticated: false, + }); + }); + it('returns true if authenticated on a route with authRequired: "optional"', async () => { + const { server: innerServer, createRouter, registerAuth } = await server.setup(setupDeps); + const router = createRouter('/'); + registerAuth((req, res, toolkit) => toolkit.authenticated()); + router.get( + { path: '/', validate: false, options: { authRequired: 'optional' } }, + (context, req, res) => res.ok({ body: { isAuthenticated: req.auth.isAuthenticated } }) + ); + await server.start(); + + await supertest(innerServer.listener) + .get('/') + .expect(200, { + isAuthenticated: true, + }); + }); + it('returns true if authenticated', async () => { + const { server: innerServer, createRouter, registerAuth } = await server.setup(setupDeps); + const router = createRouter('/'); + registerAuth((req, res, toolkit) => toolkit.authenticated()); + router.get( + { path: '/', validate: false, options: { authRequired: true } }, + (context, req, res) => res.ok({ body: { isAuthenticated: req.auth.isAuthenticated } }) + ); + await server.start(); + + await supertest(innerServer.listener) + .get('/') + .expect(200, { + isAuthenticated: true, + }); + }); + }); + }); describe('events', () => { describe('aborted$', () => { it('emits once and completes when request aborted', async done => { diff --git a/src/core/server/http/integration_tests/router.test.ts b/src/core/server/http/integration_tests/router.test.ts index a1523781010d4..ee5b0c50acafb 100644 --- a/src/core/server/http/integration_tests/router.test.ts +++ b/src/core/server/http/integration_tests/router.test.ts @@ -46,6 +46,286 @@ afterEach(async () => { await server.stop(); }); +describe('Options', () => { + describe('authRequired', () => { + describe('optional', () => { + it('User has access to a route if auth mechanism not registered', async () => { + const { server: innerServer, createRouter, auth } = await server.setup(setupDeps); + const router = createRouter('/'); + + router.get( + { path: '/', validate: false, options: { authRequired: 'optional' } }, + (context, req, res) => + res.ok({ + body: { + httpAuthIsAuthenticated: auth.isAuthenticated(req), + requestIsAuthenticated: req.auth.isAuthenticated, + }, + }) + ); + await server.start(); + + await supertest(innerServer.listener) + .get('/') + .expect(200, { + httpAuthIsAuthenticated: false, + requestIsAuthenticated: false, + }); + }); + + it('Authenticated user has access to a route', async () => { + const { server: innerServer, createRouter, registerAuth, auth } = await server.setup( + setupDeps + ); + const router = createRouter('/'); + + registerAuth((req, res, toolkit) => { + return toolkit.authenticated(); + }); + router.get( + { path: '/', validate: false, options: { authRequired: 'optional' } }, + (context, req, res) => + res.ok({ + body: { + httpAuthIsAuthenticated: auth.isAuthenticated(req), + requestIsAuthenticated: req.auth.isAuthenticated, + }, + }) + ); + await server.start(); + + await supertest(innerServer.listener) + .get('/') + .expect(200, { + httpAuthIsAuthenticated: true, + requestIsAuthenticated: true, + }); + }); + + it('User with no credentials can access a route', async () => { + const { server: innerServer, createRouter, registerAuth, auth } = await server.setup( + setupDeps + ); + const router = createRouter('/'); + + registerAuth((req, res, toolkit) => toolkit.notHandled()); + + router.get( + { path: '/', validate: false, options: { authRequired: 'optional' } }, + (context, req, res) => + res.ok({ + body: { + httpAuthIsAuthenticated: auth.isAuthenticated(req), + requestIsAuthenticated: req.auth.isAuthenticated, + }, + }) + ); + await server.start(); + + await supertest(innerServer.listener) + .get('/') + .expect(200, { + httpAuthIsAuthenticated: false, + requestIsAuthenticated: false, + }); + }); + + it('User with invalid credentials cannot access a route', async () => { + const { server: innerServer, createRouter, registerAuth } = await server.setup(setupDeps); + const router = createRouter('/'); + + registerAuth((req, res, toolkit) => res.unauthorized()); + + router.get( + { path: '/', validate: false, options: { authRequired: 'optional' } }, + (context, req, res) => res.ok({ body: 'ok' }) + ); + await server.start(); + + await supertest(innerServer.listener) + .get('/') + .expect(401); + }); + + it('does not redirect user and allows access to a resource', async () => { + const { server: innerServer, createRouter, registerAuth, auth } = await server.setup( + setupDeps + ); + const router = createRouter('/'); + + registerAuth((req, res, toolkit) => + toolkit.redirected({ + location: '/redirect-to', + }) + ); + + router.get( + { path: '/', validate: false, options: { authRequired: 'optional' } }, + (context, req, res) => + res.ok({ + body: { + httpAuthIsAuthenticated: auth.isAuthenticated(req), + requestIsAuthenticated: req.auth.isAuthenticated, + }, + }) + ); + await server.start(); + + await supertest(innerServer.listener) + .get('/') + .expect(200, { + httpAuthIsAuthenticated: false, + requestIsAuthenticated: false, + }); + }); + }); + + describe('true', () => { + it('User has access to a route if auth interceptor is not registered', async () => { + const { server: innerServer, createRouter, auth } = await server.setup(setupDeps); + const router = createRouter('/'); + + router.get( + { path: '/', validate: false, options: { authRequired: true } }, + (context, req, res) => + res.ok({ + body: { + httpAuthIsAuthenticated: auth.isAuthenticated(req), + requestIsAuthenticated: req.auth.isAuthenticated, + }, + }) + ); + await server.start(); + + await supertest(innerServer.listener) + .get('/') + .expect(200, { + httpAuthIsAuthenticated: false, + requestIsAuthenticated: false, + }); + }); + + it('Authenticated user has access to a route', async () => { + const { server: innerServer, createRouter, registerAuth, auth } = await server.setup( + setupDeps + ); + const router = createRouter('/'); + + registerAuth((req, res, toolkit) => { + return toolkit.authenticated(); + }); + router.get( + { path: '/', validate: false, options: { authRequired: true } }, + (context, req, res) => + res.ok({ + body: { + httpAuthIsAuthenticated: auth.isAuthenticated(req), + requestIsAuthenticated: req.auth.isAuthenticated, + }, + }) + ); + await server.start(); + + await supertest(innerServer.listener) + .get('/') + .expect(200, { + httpAuthIsAuthenticated: true, + requestIsAuthenticated: true, + }); + }); + + it('User with no credentials cannot access a route', async () => { + const { server: innerServer, createRouter, registerAuth } = await server.setup(setupDeps); + const router = createRouter('/'); + + registerAuth((req, res, toolkit) => toolkit.notHandled()); + router.get( + { path: '/', validate: false, options: { authRequired: true } }, + (context, req, res) => res.ok({ body: 'ok' }) + ); + await server.start(); + + await supertest(innerServer.listener) + .get('/') + .expect(401); + }); + + it('User with invalid credentials cannot access a route', async () => { + const { server: innerServer, createRouter, registerAuth } = await server.setup(setupDeps); + const router = createRouter('/'); + + registerAuth((req, res, toolkit) => res.unauthorized()); + + router.get( + { path: '/', validate: false, options: { authRequired: true } }, + (context, req, res) => res.ok({ body: 'ok' }) + ); + await server.start(); + + await supertest(innerServer.listener) + .get('/') + .expect(401); + }); + + it('allows redirecting an user', async () => { + const { server: innerServer, createRouter, registerAuth } = await server.setup(setupDeps); + const router = createRouter('/'); + const redirectUrl = '/redirect-to'; + + registerAuth((req, res, toolkit) => + toolkit.redirected({ + location: redirectUrl, + }) + ); + + router.get( + { path: '/', validate: false, options: { authRequired: true } }, + (context, req, res) => res.ok({ body: 'ok' }) + ); + await server.start(); + + const result = await supertest(innerServer.listener) + .get('/') + .expect(302); + + expect(result.header.location).toBe(redirectUrl); + }); + }); + + describe('false', () => { + it('does not try to authenticate a user', async () => { + const { server: innerServer, createRouter, registerAuth, auth } = await server.setup( + setupDeps + ); + const router = createRouter('/'); + + const authHook = jest.fn(); + registerAuth(authHook); + router.get( + { path: '/', validate: false, options: { authRequired: false } }, + (context, req, res) => + res.ok({ + body: { + httpAuthIsAuthenticated: auth.isAuthenticated(req), + requestIsAuthenticated: req.auth.isAuthenticated, + }, + }) + ); + await server.start(); + + await supertest(innerServer.listener) + .get('/') + .expect(200, { + httpAuthIsAuthenticated: false, + requestIsAuthenticated: false, + }); + + expect(authHook).toHaveBeenCalledTimes(0); + }); + }); + }); +}); + describe('Handler', () => { it("Doesn't expose error details if handler throws", async () => { const { server: innerServer, createRouter } = await server.setup(setupDeps); diff --git a/src/core/server/http/lifecycle/auth.ts b/src/core/server/http/lifecycle/auth.ts index 036ab0211c2ff..2eaf7e0f6fbfe 100644 --- a/src/core/server/http/lifecycle/auth.ts +++ b/src/core/server/http/lifecycle/auth.ts @@ -25,11 +25,14 @@ import { lifecycleResponseFactory, LifecycleResponseFactory, isKibanaResponse, + ResponseHeaders, } from '../router'; /** @public */ export enum AuthResultType { authenticated = 'authenticated', + notHandled = 'notHandled', + redirected = 'redirected', } /** @public */ @@ -38,10 +41,20 @@ export interface Authenticated extends AuthResultParams { } /** @public */ -export type AuthResult = Authenticated; +export interface AuthNotHandled { + type: AuthResultType.notHandled; +} + +/** @public */ +export interface AuthRedirected extends AuthRedirectedParams { + type: AuthResultType.redirected; +} + +/** @public */ +export type AuthResult = Authenticated | AuthNotHandled | AuthRedirected; const authResult = { - authenticated(data: Partial = {}): AuthResult { + authenticated(data: AuthResultParams = {}): AuthResult { return { type: AuthResultType.authenticated, state: data.state, @@ -49,8 +62,25 @@ const authResult = { responseHeaders: data.responseHeaders, }; }, + notHandled(): AuthResult { + return { + type: AuthResultType.notHandled, + }; + }, + redirected(headers: { location: string } & ResponseHeaders): AuthResult { + return { + type: AuthResultType.redirected, + headers, + }; + }, isAuthenticated(result: AuthResult): result is Authenticated { - return result && result.type === AuthResultType.authenticated; + return result?.type === AuthResultType.authenticated; + }, + isNotHandled(result: AuthResult): result is AuthNotHandled { + return result?.type === AuthResultType.notHandled; + }, + isRedirected(result: AuthResult): result is AuthRedirected { + return result?.type === AuthResultType.redirected; }, }; @@ -62,7 +92,7 @@ const authResult = { export type AuthHeaders = Record; /** - * Result of an incoming request authentication. + * Result of successful authentication. * @public */ export interface AuthResultParams { @@ -82,6 +112,18 @@ export interface AuthResultParams { responseHeaders?: AuthHeaders; } +/** + * Result of auth redirection. + * @public + */ +export interface AuthRedirectedParams { + /** + * Headers to attach for auth redirect. + * Must include "location" header + */ + headers: { location: string } & ResponseHeaders; +} + /** * @public * A tool set defining an outcome of Auth interceptor for incoming request. @@ -89,10 +131,23 @@ export interface AuthResultParams { export interface AuthToolkit { /** Authentication is successful with given credentials, allow request to pass through */ authenticated: (data?: AuthResultParams) => AuthResult; + /** + * User has no credentials. + * Allows user to access a resource when authRequired: 'optional' + * Rejects a request when authRequired: true + * */ + notHandled: () => AuthResult; + /** + * Redirects user to another location to complete authentication when authRequired: true + * Allows user to access a resource without redirection when authRequired: 'optional' + * */ + redirected: (headers: { location: string } & ResponseHeaders) => AuthResult; } const toolkit: AuthToolkit = { authenticated: authResult.authenticated, + notHandled: authResult.notHandled, + redirected: authResult.redirected, }; /** @@ -109,30 +164,51 @@ export type AuthenticationHandler = ( export function adoptToHapiAuthFormat( fn: AuthenticationHandler, log: Logger, - onSuccess: (req: Request, data: AuthResultParams) => void = () => undefined + onAuth: (request: Request, data: AuthResultParams) => void = () => undefined ) { return async function interceptAuth( request: Request, responseToolkit: ResponseToolkit ): Promise { const hapiResponseAdapter = new HapiResponseAdapter(responseToolkit); + const kibanaRequest = KibanaRequest.from(request, undefined, false); + try { - const result = await fn( - KibanaRequest.from(request, undefined, false), - lifecycleResponseFactory, - toolkit - ); + const result = await fn(kibanaRequest, lifecycleResponseFactory, toolkit); + if (isKibanaResponse(result)) { return hapiResponseAdapter.handle(result); } + if (authResult.isAuthenticated(result)) { - onSuccess(request, { + onAuth(request, { state: result.state, requestHeaders: result.requestHeaders, responseHeaders: result.responseHeaders, }); return responseToolkit.authenticated({ credentials: result.state || {} }); } + + if (authResult.isRedirected(result)) { + // we cannot redirect a user when resources with optional auth requested + if (kibanaRequest.route.options.authRequired === 'optional') { + return responseToolkit.continue; + } + + return hapiResponseAdapter.handle( + lifecycleResponseFactory.redirected({ + // hapi doesn't accept string[] as a valid header + headers: result.headers as any, + }) + ); + } + + if (authResult.isNotHandled(result)) { + if (kibanaRequest.route.options.authRequired === 'optional') { + return responseToolkit.continue; + } + return hapiResponseAdapter.handle(lifecycleResponseFactory.unauthorized()); + } throw new Error( `Unexpected result from Authenticate. Expected AuthResult or KibanaResponse, but given: ${result}.` ); diff --git a/src/core/server/http/router/request.test.ts b/src/core/server/http/router/request.test.ts index 032027c234485..fb999dc60e39c 100644 --- a/src/core/server/http/router/request.test.ts +++ b/src/core/server/http/router/request.test.ts @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +import { RouteOptions } from 'hapi'; import { KibanaRequest } from './request'; import { httpServerMock } from '../http_server.mocks'; import { schema } from '@kbn/config-schema'; @@ -117,6 +118,106 @@ describe('KibanaRequest', () => { }); }); + describe('route.options.authRequired property', () => { + it('handles required auth: undefined', () => { + const auth: RouteOptions['auth'] = undefined; + const request = httpServerMock.createRawRequest({ + route: { + settings: { + auth, + }, + }, + }); + const kibanaRequest = KibanaRequest.from(request); + + expect(kibanaRequest.route.options.authRequired).toBe(true); + }); + it('handles required auth: false', () => { + const auth: RouteOptions['auth'] = false; + const request = httpServerMock.createRawRequest({ + route: { + settings: { + auth, + }, + }, + }); + const kibanaRequest = KibanaRequest.from(request); + + expect(kibanaRequest.route.options.authRequired).toBe(false); + }); + it('handles required auth: { mode: "required" }', () => { + const auth: RouteOptions['auth'] = { mode: 'required' }; + const request = httpServerMock.createRawRequest({ + route: { + settings: { + auth, + }, + }, + }); + const kibanaRequest = KibanaRequest.from(request); + + expect(kibanaRequest.route.options.authRequired).toBe(true); + }); + + it('handles required auth: { mode: "optional" }', () => { + const auth: RouteOptions['auth'] = { mode: 'optional' }; + const request = httpServerMock.createRawRequest({ + route: { + settings: { + auth, + }, + }, + }); + const kibanaRequest = KibanaRequest.from(request); + + expect(kibanaRequest.route.options.authRequired).toBe('optional'); + }); + + it('handles required auth: { mode: "try" } as "optional"', () => { + const auth: RouteOptions['auth'] = { mode: 'try' }; + const request = httpServerMock.createRawRequest({ + route: { + settings: { + auth, + }, + }, + }); + const kibanaRequest = KibanaRequest.from(request); + + expect(kibanaRequest.route.options.authRequired).toBe('optional'); + }); + + it('throws on auth: strategy name', () => { + const auth: RouteOptions['auth'] = 'session'; + const request = httpServerMock.createRawRequest({ + route: { + settings: { + auth, + }, + }, + }); + + expect(() => KibanaRequest.from(request)).toThrowErrorMatchingInlineSnapshot( + `"unexpected authentication options: \\"session\\" for route: /"` + ); + }); + + it('throws on auth: { mode: unexpected mode }', () => { + const auth: RouteOptions['auth'] = { mode: undefined }; + const request = httpServerMock.createRawRequest({ + route: { + settings: { + auth, + }, + }, + }); + + expect(() => KibanaRequest.from(request)).toThrowErrorMatchingInlineSnapshot( + `"unexpected authentication options: {} for route: /"` + ); + }); + }); + describe('RouteSchema type inferring', () => { it('should work with config-schema', () => { const body = Buffer.from('body!'); diff --git a/src/core/server/http/router/request.ts b/src/core/server/http/router/request.ts index bb2db6367f701..f266677c1a172 100644 --- a/src/core/server/http/router/request.ts +++ b/src/core/server/http/router/request.ts @@ -143,6 +143,10 @@ export class KibanaRequest< public readonly socket: IKibanaSocket; /** Request events {@link KibanaRequestEvents} */ public readonly events: KibanaRequestEvents; + public readonly auth: { + /* true if the request has been successfully authenticated, otherwise false. */ + isAuthenticated: boolean; + }; /** @internal */ protected readonly [requestSymbol]: Request; @@ -172,6 +176,11 @@ export class KibanaRequest< this.route = deepFreeze(this.getRouteInfo(request)); this.socket = new KibanaSocket(request.raw.req.socket); this.events = this.getEvents(request); + + this.auth = { + // missing in fakeRequests, so we cast to false + isAuthenticated: Boolean(request.auth?.isAuthenticated), + }; } private getEvents(request: Request): KibanaRequestEvents { @@ -189,7 +198,7 @@ export class KibanaRequest< const { parse, maxBytes, allow, output } = request.route.settings.payload || {}; const options = ({ - authRequired: request.route.settings.auth !== false, + authRequired: this.getAuthRequired(request), // some places in LP call KibanaRequest.from(request) manually. remove fallback to true before v8 xsrfRequired: (request.route.settings.app as KibanaRouteState)?.xsrfRequired ?? true, tags: request.route.settings.tags || [], @@ -209,6 +218,31 @@ export class KibanaRequest< options, }; } + + private getAuthRequired(request: Request): boolean | 'optional' { + const authOptions = request.route.settings.auth; + if (typeof authOptions === 'object') { + // 'try' is used in the legacy platform + if (authOptions.mode === 'optional' || authOptions.mode === 'try') { + return 'optional'; + } + if (authOptions.mode === 'required') { + return true; + } + } + + // legacy platform routes + if (authOptions === undefined) { + return true; + } + + if (authOptions === false) return false; + throw new Error( + `unexpected authentication options: ${JSON.stringify(authOptions)} for route: ${ + this.url.href + }` + ); + } } /** diff --git a/src/core/server/http/router/route.ts b/src/core/server/http/router/route.ts index d1458ef4ad063..bb0a8616e7222 100644 --- a/src/core/server/http/router/route.ts +++ b/src/core/server/http/router/route.ts @@ -116,13 +116,15 @@ export interface RouteConfigOptionsBody { */ export interface RouteConfigOptions { /** - * A flag shows that authentication for a route: - * `enabled` when true - * `disabled` when false + * Defines authentication mode for a route: + * - true. A user has to have valid credentials to access a resource + * - false. A user can access a resource without any credentials. + * - 'optional'. A user can access a resource if has valid credentials or no credentials at all. + * Can be useful when we grant access to a resource but want to identify a user if possible. * - * Enabled by default. + * Defaults to `true` if an auth mechanism is registered. */ - authRequired?: boolean; + authRequired?: boolean | 'optional'; /** * Defines xsrf protection requirements for a route: diff --git a/src/core/server/http/ssl_config.test.ts b/src/core/server/http/ssl_config.test.ts index 738f86f7a69eb..3980b9c247fa3 100644 --- a/src/core/server/http/ssl_config.test.ts +++ b/src/core/server/http/ssl_config.test.ts @@ -293,16 +293,16 @@ describe('#sslSchema', () => { expect(() => sslSchema.validate(singleUnknownProtocol)).toThrowErrorMatchingInlineSnapshot(` "[supportedProtocols.0]: types that failed validation: -- [supportedProtocols.0.0]: expected value to equal [TLSv1] but got [SOMEv100500] -- [supportedProtocols.0.1]: expected value to equal [TLSv1.1] but got [SOMEv100500] -- [supportedProtocols.0.2]: expected value to equal [TLSv1.2] but got [SOMEv100500]" +- [supportedProtocols.0.0]: expected value to equal [TLSv1] +- [supportedProtocols.0.1]: expected value to equal [TLSv1.1] +- [supportedProtocols.0.2]: expected value to equal [TLSv1.2]" `); expect(() => sslSchema.validate(allKnownWithOneUnknownProtocols)) .toThrowErrorMatchingInlineSnapshot(` "[supportedProtocols.3]: types that failed validation: -- [supportedProtocols.3.0]: expected value to equal [TLSv1] but got [SOMEv100500] -- [supportedProtocols.3.1]: expected value to equal [TLSv1.1] but got [SOMEv100500] -- [supportedProtocols.3.2]: expected value to equal [TLSv1.2] but got [SOMEv100500]" +- [supportedProtocols.3.0]: expected value to equal [TLSv1] +- [supportedProtocols.3.1]: expected value to equal [TLSv1.1] +- [supportedProtocols.3.2]: expected value to equal [TLSv1.2]" `); }); }); diff --git a/src/core/server/index.ts b/src/core/server/index.ts index 0c112e3cfb5b2..e2faf49ba7a9e 100644 --- a/src/core/server/index.ts +++ b/src/core/server/index.ts @@ -51,9 +51,14 @@ import { PluginsServiceSetup, PluginsServiceStart, PluginOpaqueId } from './plug import { ContextSetup } from './context'; import { IUiSettingsClient, UiSettingsServiceSetup, UiSettingsServiceStart } from './ui_settings'; import { SavedObjectsClientContract } from './saved_objects/types'; -import { SavedObjectsServiceSetup, SavedObjectsServiceStart } from './saved_objects'; +import { + ISavedObjectTypeRegistry, + SavedObjectsServiceSetup, + SavedObjectsServiceStart, +} from './saved_objects'; import { CapabilitiesSetup, CapabilitiesStart } from './capabilities'; import { UuidServiceSetup } from './uuid'; +import { MetricsServiceSetup } from './metrics'; export { bootstrap } from './bootstrap'; export { Capabilities, CapabilitiesProvider, CapabilitiesSwitcher } from './capabilities'; @@ -99,9 +104,12 @@ export { AuthResultParams, AuthStatus, AuthToolkit, + AuthRedirected, + AuthRedirectedParams, AuthResult, AuthResultType, Authenticated, + AuthNotHandled, BasePath, IBasePath, CustomHttpResponseOptions, @@ -229,8 +237,12 @@ export { SavedObjectTypeRegistry, ISavedObjectTypeRegistry, SavedObjectsType, + SavedObjectsTypeManagementDefinition, SavedObjectMigrationMap, SavedObjectMigrationFn, + exportSavedObjectsToStream, + importSavedObjectsFromStream, + resolveSavedObjectsImportErrors, } from './saved_objects'; export { @@ -282,11 +294,13 @@ export { /** * Plugin specific context passed to a route handler. * - * Provides the following clients: + * Provides the following clients and services: * - {@link IScopedRenderingClient | rendering} - Rendering client * which uses the data of the incoming request * - {@link SavedObjectsClient | savedObjects.client} - Saved Objects client * which uses the credentials of the incoming request + * - {@link ISavedObjectTypeRegistry | savedObjects.typeRegistry} - Type registry containing + * all the registered types. * - {@link ScopedClusterClient | elasticsearch.dataClient} - Elasticsearch * data client which uses the credentials of the incoming request * - {@link ScopedClusterClient | elasticsearch.adminClient} - Elasticsearch @@ -301,6 +315,7 @@ export interface RequestHandlerContext { rendering: IScopedRenderingClient; savedObjects: { client: SavedObjectsClientContract; + typeRegistry: ISavedObjectTypeRegistry; }; elasticsearch: { dataClient: IScopedClusterClient; @@ -332,6 +347,8 @@ export interface CoreSetup { uiSettings: UiSettingsServiceSetup; /** {@link UuidServiceSetup} */ uuid: UuidServiceSetup; + /** {@link MetricsServiceSetup} */ + metrics: MetricsServiceSetup; /** * Allows plugins to get access to APIs available in start inside async handlers. * Promise will not resolve until Core and plugin dependencies have completed `start`. diff --git a/src/core/server/legacy/legacy_service.ts b/src/core/server/legacy/legacy_service.ts index 44f77b5ad215e..f67148d720446 100644 --- a/src/core/server/legacy/legacy_service.ts +++ b/src/core/server/legacy/legacy_service.ts @@ -296,10 +296,14 @@ export class LegacyService implements CoreService { isTlsEnabled: setupDeps.core.http.isTlsEnabled, getServerInfo: setupDeps.core.http.getServerInfo, }, + metrics: { + getOpsMetrics$: setupDeps.core.metrics.getOpsMetrics$, + }, savedObjects: { setClientFactoryProvider: setupDeps.core.savedObjects.setClientFactoryProvider, addClientWrapper: setupDeps.core.savedObjects.addClientWrapper, registerType: setupDeps.core.savedObjects.registerType, + getImportExportObjectLimit: setupDeps.core.savedObjects.getImportExportObjectLimit, }, uiSettings: { register: setupDeps.core.uiSettings.register, diff --git a/src/core/server/metrics/collectors/mocks.ts b/src/core/server/metrics/collectors/mocks.ts new file mode 100644 index 0000000000000..d1eb15637779a --- /dev/null +++ b/src/core/server/metrics/collectors/mocks.ts @@ -0,0 +1,35 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { MetricsCollector } from './types'; + +const createMock = () => { + const mocked: jest.Mocked> = { + collect: jest.fn(), + reset: jest.fn(), + }; + + mocked.collect.mockResolvedValue({}); + + return mocked; +}; + +export const collectorMock = { + create: createMock, +}; diff --git a/src/core/server/metrics/collectors/os.ts b/src/core/server/metrics/collectors/os.ts index d3d9bb0be86fa..59bef9d8ddd2b 100644 --- a/src/core/server/metrics/collectors/os.ts +++ b/src/core/server/metrics/collectors/os.ts @@ -57,4 +57,6 @@ export class OsMetricsCollector implements MetricsCollector { return metrics; } + + public reset() {} } diff --git a/src/core/server/metrics/collectors/process.ts b/src/core/server/metrics/collectors/process.ts index aa68abaf74e41..a3b59a7cc8b7c 100644 --- a/src/core/server/metrics/collectors/process.ts +++ b/src/core/server/metrics/collectors/process.ts @@ -40,6 +40,8 @@ export class ProcessMetricsCollector implements MetricsCollector => { diff --git a/src/core/server/metrics/collectors/server.ts b/src/core/server/metrics/collectors/server.ts index e46ac2f653df6..84204d0466ff3 100644 --- a/src/core/server/metrics/collectors/server.ts +++ b/src/core/server/metrics/collectors/server.ts @@ -26,12 +26,12 @@ interface ServerResponseTime { } export class ServerMetricsCollector implements MetricsCollector { - private readonly requests: OpsServerMetrics['requests'] = { + private requests: OpsServerMetrics['requests'] = { disconnects: 0, total: 0, statusCodes: {}, }; - private readonly responseTimes: ServerResponseTime = { + private responseTimes: ServerResponseTime = { count: 0, total: 0, max: 0, @@ -77,4 +77,17 @@ export class ServerMetricsCollector implements MetricsCollector { + /** collect the data currently gathered by the collector */ collect(): Promise; + /** reset the internal state of the collector */ + reset(): void; } /** diff --git a/src/core/server/metrics/integration_tests/server_collector.test.ts b/src/core/server/metrics/integration_tests/server_collector.test.ts index a387de80212d9..dd5c256cf1600 100644 --- a/src/core/server/metrics/integration_tests/server_collector.test.ts +++ b/src/core/server/metrics/integration_tests/server_collector.test.ts @@ -17,8 +17,8 @@ * under the License. */ -import { Subject } from 'rxjs'; -import { take } from 'rxjs/operators'; +import { BehaviorSubject, Subject } from 'rxjs'; +import { take, filter } from 'rxjs/operators'; import supertest from 'supertest'; import { Server as HapiServer } from 'hapi'; import { createHttpServer } from '../../http/test_utils'; @@ -26,6 +26,8 @@ import { HttpService, IRouter } from '../../http'; import { contextServiceMock } from '../../context/context_service.mock'; import { ServerMetricsCollector } from '../collectors/server'; +const requestWaitDelay = 25; + describe('ServerMetricsCollector', () => { let server: HttpService; let collector: ServerMetricsCollector; @@ -80,11 +82,13 @@ describe('ServerMetricsCollector', () => { it('collect disconnects requests infos', async () => { const never = new Promise(resolve => undefined); + const hitSubject = new BehaviorSubject(0); router.get({ path: '/', validate: false }, async (ctx, req, res) => { return res.ok({ body: '' }); }); router.get({ path: '/disconnect', validate: false }, async (ctx, req, res) => { + hitSubject.next(hitSubject.value + 1); await never; return res.ok({ body: '' }); }); @@ -93,7 +97,13 @@ describe('ServerMetricsCollector', () => { await sendGet('/'); const discoReq1 = sendGet('/disconnect').end(); const discoReq2 = sendGet('/disconnect').end(); - await delay(20); + + await hitSubject + .pipe( + filter(count => count >= 2), + take(1) + ) + .toPromise(); let metrics = await collector.collect(); expect(metrics.requests).toEqual( @@ -104,7 +114,7 @@ describe('ServerMetricsCollector', () => { ); discoReq1.abort(); - await delay(20); + await delay(requestWaitDelay); metrics = await collector.collect(); expect(metrics.requests).toEqual( @@ -115,7 +125,7 @@ describe('ServerMetricsCollector', () => { ); discoReq2.abort(); - await delay(20); + await delay(requestWaitDelay); metrics = await collector.collect(); expect(metrics.requests).toEqual( @@ -155,29 +165,115 @@ describe('ServerMetricsCollector', () => { it('collect connection count', async () => { const waitSubject = new Subject(); + const hitSubject = new BehaviorSubject(0); router.get({ path: '/', validate: false }, async (ctx, req, res) => { + hitSubject.next(hitSubject.value + 1); await waitSubject.pipe(take(1)).toPromise(); return res.ok({ body: '' }); }); await server.start(); + const waitForHits = (hits: number) => + hitSubject + .pipe( + filter(count => count >= hits), + take(1) + ) + .toPromise(); + let metrics = await collector.collect(); expect(metrics.concurrent_connections).toEqual(0); sendGet('/').end(() => null); - await delay(20); + await waitForHits(1); metrics = await collector.collect(); expect(metrics.concurrent_connections).toEqual(1); sendGet('/').end(() => null); - await delay(20); + await waitForHits(2); metrics = await collector.collect(); expect(metrics.concurrent_connections).toEqual(2); waitSubject.next('go'); - await delay(20); + await delay(requestWaitDelay); metrics = await collector.collect(); expect(metrics.concurrent_connections).toEqual(0); }); + + describe('#reset', () => { + it('reset the requests state', async () => { + router.get({ path: '/', validate: false }, async (ctx, req, res) => { + return res.ok({ body: '' }); + }); + await server.start(); + + await sendGet('/'); + await sendGet('/'); + await sendGet('/not-found'); + + let metrics = await collector.collect(); + + expect(metrics.requests).toEqual({ + total: 3, + disconnects: 0, + statusCodes: { + '200': 2, + '404': 1, + }, + }); + + collector.reset(); + metrics = await collector.collect(); + + expect(metrics.requests).toEqual({ + total: 0, + disconnects: 0, + statusCodes: {}, + }); + + await sendGet('/'); + await sendGet('/not-found'); + + metrics = await collector.collect(); + + expect(metrics.requests).toEqual({ + total: 2, + disconnects: 0, + statusCodes: { + '200': 1, + '404': 1, + }, + }); + }); + + it('resets the response times', async () => { + router.get({ path: '/no-delay', validate: false }, async (ctx, req, res) => { + return res.ok({ body: '' }); + }); + router.get({ path: '/500-ms', validate: false }, async (ctx, req, res) => { + await delay(500); + return res.ok({ body: '' }); + }); + + await server.start(); + + await Promise.all([sendGet('/no-delay'), sendGet('/500-ms')]); + let metrics = await collector.collect(); + + expect(metrics.response_times.avg_in_millis).toBeGreaterThanOrEqual(250); + expect(metrics.response_times.max_in_millis).toBeGreaterThanOrEqual(500); + + collector.reset(); + metrics = await collector.collect(); + expect(metrics.response_times.avg_in_millis).toBe(0); + expect(metrics.response_times.max_in_millis).toBeGreaterThanOrEqual(0); + + await Promise.all([sendGet('/500-ms'), sendGet('/500-ms')]); + metrics = await collector.collect(); + + expect(metrics.response_times.avg_in_millis).toBeGreaterThanOrEqual(500); + expect(metrics.response_times.max_in_millis).toBeGreaterThanOrEqual(500); + }); + }); }); diff --git a/src/core/server/metrics/metrics_service.test.mocks.ts b/src/core/server/metrics/metrics_service.test.mocks.ts index 8e91775283042..fe46e5693bf45 100644 --- a/src/core/server/metrics/metrics_service.test.mocks.ts +++ b/src/core/server/metrics/metrics_service.test.mocks.ts @@ -17,9 +17,10 @@ * under the License. */ -export const mockOpsCollector = { - collect: jest.fn(), -}; +import { collectorMock } from './collectors/mocks'; + +export const mockOpsCollector = collectorMock.create(); + jest.doMock('./ops_metrics_collector', () => ({ OpsMetricsCollector: jest.fn().mockImplementation(() => mockOpsCollector), })); diff --git a/src/core/server/metrics/metrics_service.test.ts b/src/core/server/metrics/metrics_service.test.ts index 10d6761adbe7d..f6334cc5d3c0f 100644 --- a/src/core/server/metrics/metrics_service.test.ts +++ b/src/core/server/metrics/metrics_service.test.ts @@ -57,37 +57,50 @@ describe('MetricsService', () => { expect(setInterval).toHaveBeenCalledWith(expect.any(Function), testInterval); }); - it('emits the metrics at start', async () => { + it('collects the metrics at every interval', async () => { mockOpsCollector.collect.mockResolvedValue(dummyMetrics); - const { getOpsMetrics$ } = await metricsService.setup({ - http: httpMock, - }); - + await metricsService.setup({ http: httpMock }); await metricsService.start(); expect(mockOpsCollector.collect).toHaveBeenCalledTimes(1); - expect( - await getOpsMetrics$() - .pipe(take(1)) - .toPromise() - ).toEqual(dummyMetrics); + + jest.advanceTimersByTime(testInterval); + expect(mockOpsCollector.collect).toHaveBeenCalledTimes(2); + + jest.advanceTimersByTime(testInterval); + expect(mockOpsCollector.collect).toHaveBeenCalledTimes(3); }); - it('collects the metrics at every interval', async () => { + it('resets the collector after each collection', async () => { mockOpsCollector.collect.mockResolvedValue(dummyMetrics); - await metricsService.setup({ http: httpMock }); - + const { getOpsMetrics$ } = await metricsService.setup({ http: httpMock }); await metricsService.start(); + // `advanceTimersByTime` only ensure the interval handler is executed + // however the `reset` call is executed after the async call to `collect` + // meaning that we are going to miss the call if we don't wait for the + // actual observable emission that is performed after + const waitForNextEmission = () => + getOpsMetrics$() + .pipe(take(1)) + .toPromise(); + expect(mockOpsCollector.collect).toHaveBeenCalledTimes(1); + expect(mockOpsCollector.reset).toHaveBeenCalledTimes(1); + let nextEmission = waitForNextEmission(); jest.advanceTimersByTime(testInterval); + await nextEmission; expect(mockOpsCollector.collect).toHaveBeenCalledTimes(2); + expect(mockOpsCollector.reset).toHaveBeenCalledTimes(2); + nextEmission = waitForNextEmission(); jest.advanceTimersByTime(testInterval); + await nextEmission; expect(mockOpsCollector.collect).toHaveBeenCalledTimes(3); + expect(mockOpsCollector.reset).toHaveBeenCalledTimes(3); }); it('throws when called before setup', async () => { diff --git a/src/core/server/metrics/metrics_service.ts b/src/core/server/metrics/metrics_service.ts index 1aed89a4aad60..0ea9d00792600 100644 --- a/src/core/server/metrics/metrics_service.ts +++ b/src/core/server/metrics/metrics_service.ts @@ -17,8 +17,8 @@ * under the License. */ -import { ReplaySubject } from 'rxjs'; -import { first, shareReplay } from 'rxjs/operators'; +import { Subject } from 'rxjs'; +import { first } from 'rxjs/operators'; import { CoreService } from '../../types'; import { CoreContext } from '../core_context'; import { Logger } from '../logging'; @@ -37,7 +37,7 @@ export class MetricsService private readonly logger: Logger; private metricsCollector?: OpsMetricsCollector; private collectInterval?: NodeJS.Timeout; - private metrics$ = new ReplaySubject(1); + private metrics$ = new Subject(); constructor(private readonly coreContext: CoreContext) { this.logger = coreContext.logger.get('metrics'); @@ -46,7 +46,7 @@ export class MetricsService public async setup({ http }: MetricsServiceSetupDeps): Promise { this.metricsCollector = new OpsMetricsCollector(http.server); - const metricsObservable = this.metrics$.pipe(shareReplay(1)); + const metricsObservable = this.metrics$.asObservable(); return { getOpsMetrics$: () => metricsObservable, @@ -74,6 +74,7 @@ export class MetricsService private async refreshMetrics() { this.logger.debug('Refreshing metrics'); const metrics = await this.metricsCollector!.collect(); + this.metricsCollector!.reset(); this.metrics$.next(metrics); } diff --git a/src/core/server/metrics/ops_metrics_collector.test.mocks.ts b/src/core/server/metrics/ops_metrics_collector.test.mocks.ts index 8265796d57970..cf51f8a753729 100644 --- a/src/core/server/metrics/ops_metrics_collector.test.mocks.ts +++ b/src/core/server/metrics/ops_metrics_collector.test.mocks.ts @@ -17,23 +17,19 @@ * under the License. */ -export const mockOsCollector = { - collect: jest.fn(), -}; +import { collectorMock } from './collectors/mocks'; + +export const mockOsCollector = collectorMock.create(); jest.doMock('./collectors/os', () => ({ OsMetricsCollector: jest.fn().mockImplementation(() => mockOsCollector), })); -export const mockProcessCollector = { - collect: jest.fn(), -}; +export const mockProcessCollector = collectorMock.create(); jest.doMock('./collectors/process', () => ({ ProcessMetricsCollector: jest.fn().mockImplementation(() => mockProcessCollector), })); -export const mockServerCollector = { - collect: jest.fn(), -}; +export const mockServerCollector = collectorMock.create(); jest.doMock('./collectors/server', () => ({ ServerMetricsCollector: jest.fn().mockImplementation(() => mockServerCollector), })); diff --git a/src/core/server/metrics/ops_metrics_collector.test.ts b/src/core/server/metrics/ops_metrics_collector.test.ts index 04302a195fb6c..559588db60a42 100644 --- a/src/core/server/metrics/ops_metrics_collector.test.ts +++ b/src/core/server/metrics/ops_metrics_collector.test.ts @@ -35,25 +35,43 @@ describe('OpsMetricsCollector', () => { mockOsCollector.collect.mockResolvedValue('osMetrics'); }); - it('gathers metrics from the underlying collectors', async () => { - mockOsCollector.collect.mockResolvedValue('osMetrics'); - mockProcessCollector.collect.mockResolvedValue('processMetrics'); - mockServerCollector.collect.mockResolvedValue({ - requests: 'serverRequestsMetrics', - response_times: 'serverTimingMetrics', + describe('#collect', () => { + it('gathers metrics from the underlying collectors', async () => { + mockOsCollector.collect.mockResolvedValue('osMetrics'); + mockProcessCollector.collect.mockResolvedValue('processMetrics'); + mockServerCollector.collect.mockResolvedValue({ + requests: 'serverRequestsMetrics', + response_times: 'serverTimingMetrics', + }); + + const metrics = await collector.collect(); + + expect(mockOsCollector.collect).toHaveBeenCalledTimes(1); + expect(mockProcessCollector.collect).toHaveBeenCalledTimes(1); + expect(mockServerCollector.collect).toHaveBeenCalledTimes(1); + + expect(metrics).toEqual({ + process: 'processMetrics', + os: 'osMetrics', + requests: 'serverRequestsMetrics', + response_times: 'serverTimingMetrics', + }); }); + }); + + describe('#reset', () => { + it('call reset on the underlying collectors', () => { + collector.reset(); - const metrics = await collector.collect(); + expect(mockOsCollector.reset).toHaveBeenCalledTimes(1); + expect(mockProcessCollector.reset).toHaveBeenCalledTimes(1); + expect(mockServerCollector.reset).toHaveBeenCalledTimes(1); - expect(mockOsCollector.collect).toHaveBeenCalledTimes(1); - expect(mockProcessCollector.collect).toHaveBeenCalledTimes(1); - expect(mockServerCollector.collect).toHaveBeenCalledTimes(1); + collector.reset(); - expect(metrics).toEqual({ - process: 'processMetrics', - os: 'osMetrics', - requests: 'serverRequestsMetrics', - response_times: 'serverTimingMetrics', + expect(mockOsCollector.reset).toHaveBeenCalledTimes(2); + expect(mockProcessCollector.reset).toHaveBeenCalledTimes(2); + expect(mockServerCollector.reset).toHaveBeenCalledTimes(2); }); }); }); diff --git a/src/core/server/metrics/ops_metrics_collector.ts b/src/core/server/metrics/ops_metrics_collector.ts index 04344f21f57f7..525515dba1457 100644 --- a/src/core/server/metrics/ops_metrics_collector.ts +++ b/src/core/server/metrics/ops_metrics_collector.ts @@ -49,4 +49,10 @@ export class OpsMetricsCollector implements MetricsCollector { ...server, }; } + + public reset() { + this.processCollector.reset(); + this.osCollector.reset(); + this.serverCollector.reset(); + } } diff --git a/src/core/server/mocks.ts b/src/core/server/mocks.ts index 037f3bbed67e0..a0bbe623289d8 100644 --- a/src/core/server/mocks.ts +++ b/src/core/server/mocks.ts @@ -26,6 +26,7 @@ import { httpServiceMock } from './http/http_service.mock'; import { contextServiceMock } from './context/context_service.mock'; import { savedObjectsServiceMock } from './saved_objects/saved_objects_service.mock'; import { savedObjectsClientMock } from './saved_objects/service/saved_objects_client.mock'; +import { typeRegistryMock as savedObjectsTypeRegistryMock } from './saved_objects/saved_objects_type_registry.mock'; import { uiSettingsServiceMock } from './ui_settings/ui_settings_service.mock'; import { SharedGlobalConfig } from './plugins'; import { InternalCoreSetup, InternalCoreStart } from './internal_types'; @@ -128,6 +129,7 @@ function createCoreSetupMock() { savedObjects: savedObjectsServiceMock.createInternalSetupContract(), uiSettings: uiSettingsMock, uuid: uuidServiceMock.createSetupContract(), + metrics: metricsServiceMock.createSetupContract(), getStartServices: jest .fn, object]>, []>() .mockResolvedValue([createCoreStartMock(), {}]), @@ -176,6 +178,7 @@ function createCoreRequestHandlerContextMock() { }, savedObjects: { client: savedObjectsClientMock.create(), + typeRegistry: savedObjectsTypeRegistryMock.create(), }, elasticsearch: { adminClient: elasticsearchServiceMock.createScopedClusterClient(), diff --git a/src/core/server/plugins/plugin_context.ts b/src/core/server/plugins/plugin_context.ts index a8a16713f69a4..b430fd28fb896 100644 --- a/src/core/server/plugins/plugin_context.ts +++ b/src/core/server/plugins/plugin_context.ts @@ -166,10 +166,14 @@ export function createPluginSetupContext( isTlsEnabled: deps.http.isTlsEnabled, getServerInfo: deps.http.getServerInfo, }, + metrics: { + getOpsMetrics$: deps.metrics.getOpsMetrics$, + }, savedObjects: { setClientFactoryProvider: deps.savedObjects.setClientFactoryProvider, addClientWrapper: deps.savedObjects.addClientWrapper, registerType: deps.savedObjects.registerType, + getImportExportObjectLimit: deps.savedObjects.getImportExportObjectLimit, }, uiSettings: { register: deps.uiSettings.register, diff --git a/src/core/server/saved_objects/__snapshots__/utils.test.ts.snap b/src/core/server/saved_objects/__snapshots__/utils.test.ts.snap index 89ff2b542c60f..5431d2ca47892 100644 --- a/src/core/server/saved_objects/__snapshots__/utils.test.ts.snap +++ b/src/core/server/saved_objects/__snapshots__/utils.test.ts.snap @@ -6,6 +6,7 @@ Array [ "convertToAliasScript": undefined, "hidden": false, "indexPattern": undefined, + "management": undefined, "mappings": Object { "properties": Object { "fieldA": Object { @@ -21,6 +22,7 @@ Array [ "convertToAliasScript": undefined, "hidden": false, "indexPattern": undefined, + "management": undefined, "mappings": Object { "properties": Object { "fieldB": Object { @@ -36,6 +38,7 @@ Array [ "convertToAliasScript": undefined, "hidden": false, "indexPattern": undefined, + "management": undefined, "mappings": Object { "properties": Object { "fieldC": Object { @@ -56,6 +59,7 @@ Array [ "convertToAliasScript": undefined, "hidden": true, "indexPattern": "myIndex", + "management": undefined, "mappings": Object { "properties": Object { "fieldA": Object { @@ -74,6 +78,7 @@ Array [ "convertToAliasScript": "some alias script", "hidden": false, "indexPattern": undefined, + "management": undefined, "mappings": Object { "properties": Object { "anotherFieldB": Object { @@ -92,6 +97,7 @@ Array [ "convertToAliasScript": undefined, "hidden": false, "indexPattern": undefined, + "management": undefined, "mappings": Object { "properties": Object { "fieldC": Object { @@ -114,6 +120,7 @@ Array [ "convertToAliasScript": undefined, "hidden": true, "indexPattern": "fooBar", + "management": undefined, "mappings": Object { "properties": Object { "fieldA": Object { @@ -129,6 +136,7 @@ Array [ "convertToAliasScript": undefined, "hidden": false, "indexPattern": undefined, + "management": undefined, "mappings": Object { "properties": Object { "fieldC": Object { diff --git a/src/core/server/saved_objects/export/get_sorted_objects_for_export.test.ts b/src/core/server/saved_objects/export/get_sorted_objects_for_export.test.ts index 1088478add137..32485f461f59b 100644 --- a/src/core/server/saved_objects/export/get_sorted_objects_for_export.test.ts +++ b/src/core/server/saved_objects/export/get_sorted_objects_for_export.test.ts @@ -17,7 +17,7 @@ * under the License. */ -import { getSortedObjectsForExport } from './get_sorted_objects_for_export'; +import { exportSavedObjectsToStream } from './get_sorted_objects_for_export'; import { savedObjectsClientMock } from '../service/saved_objects_client.mock'; import { Readable } from 'stream'; import { createPromiseFromStreams, createConcatStream } from '../../../../legacy/utils/streams'; @@ -65,7 +65,7 @@ describe('getSortedObjectsForExport()', () => { per_page: 1, page: 0, }); - const exportStream = await getSortedObjectsForExport({ + const exportStream = await exportSavedObjectsToStream({ savedObjectsClient, exportSizeLimit: 500, types: ['index-pattern', 'search'], @@ -151,7 +151,7 @@ describe('getSortedObjectsForExport()', () => { per_page: 1, page: 0, }); - const exportStream = await getSortedObjectsForExport({ + const exportStream = await exportSavedObjectsToStream({ savedObjectsClient, exportSizeLimit: 500, types: ['index-pattern', 'search'], @@ -210,7 +210,7 @@ describe('getSortedObjectsForExport()', () => { per_page: 1, page: 0, }); - const exportStream = await getSortedObjectsForExport({ + const exportStream = await exportSavedObjectsToStream({ savedObjectsClient, exportSizeLimit: 500, types: ['index-pattern', 'search'], @@ -297,7 +297,7 @@ describe('getSortedObjectsForExport()', () => { per_page: 1, page: 0, }); - const exportStream = await getSortedObjectsForExport({ + const exportStream = await exportSavedObjectsToStream({ savedObjectsClient, exportSizeLimit: 500, types: ['index-pattern', 'search'], @@ -385,7 +385,7 @@ describe('getSortedObjectsForExport()', () => { page: 0, }); await expect( - getSortedObjectsForExport({ + exportSavedObjectsToStream({ savedObjectsClient, exportSizeLimit: 1, types: ['index-pattern', 'search'], @@ -425,7 +425,7 @@ describe('getSortedObjectsForExport()', () => { }, ], }); - const exportStream = await getSortedObjectsForExport({ + const exportStream = await exportSavedObjectsToStream({ exportSizeLimit: 10000, savedObjectsClient, types: ['index-pattern'], @@ -489,7 +489,7 @@ describe('getSortedObjectsForExport()', () => { }, ], }); - const exportStream = await getSortedObjectsForExport({ + const exportStream = await exportSavedObjectsToStream({ exportSizeLimit: 10000, savedObjectsClient, objects: [ @@ -587,7 +587,7 @@ describe('getSortedObjectsForExport()', () => { }, ], }); - const exportStream = await getSortedObjectsForExport({ + const exportStream = await exportSavedObjectsToStream({ exportSizeLimit: 10000, savedObjectsClient, objects: [ @@ -681,7 +681,7 @@ describe('getSortedObjectsForExport()', () => { }, ], }; - await expect(getSortedObjectsForExport(exportOpts)).rejects.toThrowErrorMatchingInlineSnapshot( + await expect(exportSavedObjectsToStream(exportOpts)).rejects.toThrowErrorMatchingInlineSnapshot( `"Can't export more than 1 objects"` ); }); @@ -694,7 +694,7 @@ describe('getSortedObjectsForExport()', () => { objects: undefined, }; - expect(getSortedObjectsForExport(exportOpts)).rejects.toThrowErrorMatchingInlineSnapshot( + expect(exportSavedObjectsToStream(exportOpts)).rejects.toThrowErrorMatchingInlineSnapshot( `"Either \`type\` or \`objects\` are required."` ); }); @@ -707,7 +707,7 @@ describe('getSortedObjectsForExport()', () => { search: 'foo', }; - expect(getSortedObjectsForExport(exportOpts)).rejects.toThrowErrorMatchingInlineSnapshot( + expect(exportSavedObjectsToStream(exportOpts)).rejects.toThrowErrorMatchingInlineSnapshot( `"Can't specify both \\"search\\" and \\"objects\\" properties when exporting"` ); }); diff --git a/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts b/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts index 4b4cf1146aca0..a703c9f9fbd96 100644 --- a/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts +++ b/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts @@ -124,7 +124,13 @@ async function fetchObjectsToExport({ } } -export async function getSortedObjectsForExport({ +/** + * Generates sorted saved object stream to be used for export. + * See the {@link SavedObjectsExportOptions | options} for more detailed information. + * + * @public + */ +export async function exportSavedObjectsToStream({ types, objects, search, diff --git a/src/core/server/saved_objects/export/index.ts b/src/core/server/saved_objects/export/index.ts index 7533b8e500039..37824cceb18cb 100644 --- a/src/core/server/saved_objects/export/index.ts +++ b/src/core/server/saved_objects/export/index.ts @@ -18,7 +18,7 @@ */ export { - getSortedObjectsForExport, + exportSavedObjectsToStream, SavedObjectsExportOptions, SavedObjectsExportResultDetails, } from './get_sorted_objects_for_export'; diff --git a/src/core/server/saved_objects/import/import_saved_objects.test.ts b/src/core/server/saved_objects/import/import_saved_objects.test.ts index f0719cbf4c829..b43e5063c13e1 100644 --- a/src/core/server/saved_objects/import/import_saved_objects.test.ts +++ b/src/core/server/saved_objects/import/import_saved_objects.test.ts @@ -19,7 +19,7 @@ import { Readable } from 'stream'; import { SavedObject } from '../types'; -import { importSavedObjects } from './import_saved_objects'; +import { importSavedObjectsFromStream } from './import_saved_objects'; import { savedObjectsClientMock } from '../../mocks'; const emptyResponse = { @@ -76,7 +76,7 @@ describe('importSavedObjects()', () => { this.push(null); }, }); - const result = await importSavedObjects({ + const result = await importSavedObjectsFromStream({ readStream, objectLimit: 1, overwrite: false, @@ -103,7 +103,7 @@ describe('importSavedObjects()', () => { savedObjectsClient.bulkCreate.mockResolvedValue({ saved_objects: savedObjects, }); - const result = await importSavedObjects({ + const result = await importSavedObjectsFromStream({ readStream, objectLimit: 4, overwrite: false, @@ -186,7 +186,7 @@ describe('importSavedObjects()', () => { savedObjectsClient.bulkCreate.mockResolvedValue({ saved_objects: savedObjects, }); - const result = await importSavedObjects({ + const result = await importSavedObjectsFromStream({ readStream, objectLimit: 4, overwrite: false, @@ -270,7 +270,7 @@ describe('importSavedObjects()', () => { savedObjectsClient.bulkCreate.mockResolvedValue({ saved_objects: savedObjects, }); - const result = await importSavedObjects({ + const result = await importSavedObjectsFromStream({ readStream, objectLimit: 4, overwrite: true, @@ -362,7 +362,7 @@ describe('importSavedObjects()', () => { references: [], })), }); - const result = await importSavedObjects({ + const result = await importSavedObjectsFromStream({ readStream, objectLimit: 4, overwrite: false, @@ -460,7 +460,7 @@ describe('importSavedObjects()', () => { }, ], }); - const result = await importSavedObjects({ + const result = await importSavedObjectsFromStream({ readStream, objectLimit: 4, overwrite: false, @@ -536,7 +536,7 @@ describe('importSavedObjects()', () => { savedObjectsClient.bulkCreate.mockResolvedValue({ saved_objects: savedObjects, }); - const result = await importSavedObjects({ + const result = await importSavedObjectsFromStream({ readStream, objectLimit: 5, overwrite: false, diff --git a/src/core/server/saved_objects/import/import_saved_objects.ts b/src/core/server/saved_objects/import/import_saved_objects.ts index ef3b4a214c2c2..cb1d70e5c8dc4 100644 --- a/src/core/server/saved_objects/import/import_saved_objects.ts +++ b/src/core/server/saved_objects/import/import_saved_objects.ts @@ -26,7 +26,13 @@ import { } from './types'; import { validateReferences } from './validate_references'; -export async function importSavedObjects({ +/** + * Import saved objects from given stream. See the {@link SavedObjectsImportOptions | options} for more + * detailed information. + * + * @public + */ +export async function importSavedObjectsFromStream({ readStream, objectLimit, overwrite, diff --git a/src/core/server/saved_objects/import/index.ts b/src/core/server/saved_objects/import/index.ts index 95fa8aa192f3e..e268e970b94ac 100644 --- a/src/core/server/saved_objects/import/index.ts +++ b/src/core/server/saved_objects/import/index.ts @@ -17,8 +17,8 @@ * under the License. */ -export { importSavedObjects } from './import_saved_objects'; -export { resolveImportErrors } from './resolve_import_errors'; +export { importSavedObjectsFromStream } from './import_saved_objects'; +export { resolveSavedObjectsImportErrors } from './resolve_import_errors'; export { SavedObjectsImportResponse, SavedObjectsImportError, diff --git a/src/core/server/saved_objects/import/resolve_import_errors.test.ts b/src/core/server/saved_objects/import/resolve_import_errors.test.ts index c522d76f1ff04..2c6d89e0a0a47 100644 --- a/src/core/server/saved_objects/import/resolve_import_errors.test.ts +++ b/src/core/server/saved_objects/import/resolve_import_errors.test.ts @@ -19,7 +19,7 @@ import { Readable } from 'stream'; import { SavedObject } from '../types'; -import { resolveImportErrors } from './resolve_import_errors'; +import { resolveSavedObjectsImportErrors } from './resolve_import_errors'; import { savedObjectsClientMock } from '../../mocks'; describe('resolveImportErrors()', () => { @@ -80,7 +80,7 @@ describe('resolveImportErrors()', () => { savedObjectsClient.bulkCreate.mockResolvedValue({ saved_objects: [], }); - const result = await resolveImportErrors({ + const result = await resolveSavedObjectsImportErrors({ readStream, objectLimit: 4, retries: [], @@ -107,7 +107,7 @@ describe('resolveImportErrors()', () => { savedObjectsClient.bulkCreate.mockResolvedValueOnce({ saved_objects: savedObjects.filter(obj => obj.type === 'visualization' && obj.id === '3'), }); - const result = await resolveImportErrors({ + const result = await resolveSavedObjectsImportErrors({ readStream, objectLimit: 4, retries: [ @@ -168,7 +168,7 @@ describe('resolveImportErrors()', () => { savedObjectsClient.bulkCreate.mockResolvedValue({ saved_objects: savedObjects.filter(obj => obj.type === 'index-pattern' && obj.id === '1'), }); - const result = await resolveImportErrors({ + const result = await resolveSavedObjectsImportErrors({ readStream, objectLimit: 4, retries: [ @@ -230,7 +230,7 @@ describe('resolveImportErrors()', () => { savedObjectsClient.bulkCreate.mockResolvedValue({ saved_objects: savedObjects.filter(obj => obj.type === 'dashboard' && obj.id === '4'), }); - const result = await resolveImportErrors({ + const result = await resolveSavedObjectsImportErrors({ readStream, objectLimit: 4, retries: [ @@ -312,7 +312,7 @@ describe('resolveImportErrors()', () => { references: [], })), }); - const result = await resolveImportErrors({ + const result = await resolveSavedObjectsImportErrors({ readStream, objectLimit: 4, retries: savedObjects.map(obj => ({ @@ -415,7 +415,7 @@ describe('resolveImportErrors()', () => { }, ], }); - const result = await resolveImportErrors({ + const result = await resolveSavedObjectsImportErrors({ readStream, objectLimit: 2, retries: [ @@ -503,7 +503,7 @@ describe('resolveImportErrors()', () => { savedObjectsClient.bulkCreate.mockResolvedValue({ saved_objects: [], }); - const result = await resolveImportErrors({ + const result = await resolveSavedObjectsImportErrors({ readStream, objectLimit: 5, retries: [ @@ -547,7 +547,7 @@ describe('resolveImportErrors()', () => { savedObjectsClient.bulkCreate.mockResolvedValue({ saved_objects: savedObjects.filter(obj => obj.type === 'index-pattern' && obj.id === '1'), }); - const result = await resolveImportErrors({ + const result = await resolveSavedObjectsImportErrors({ readStream, objectLimit: 4, retries: [ diff --git a/src/core/server/saved_objects/import/resolve_import_errors.ts b/src/core/server/saved_objects/import/resolve_import_errors.ts index 6f56f283b4aec..d9ac567882573 100644 --- a/src/core/server/saved_objects/import/resolve_import_errors.ts +++ b/src/core/server/saved_objects/import/resolve_import_errors.ts @@ -27,7 +27,13 @@ import { } from './types'; import { validateReferences } from './validate_references'; -export async function resolveImportErrors({ +/** + * Resolve and return saved object import errors. + * See the {@link SavedObjectsResolveImportErrorsOptions | options} for more detailed informations. + * + * @public + */ +export async function resolveSavedObjectsImportErrors({ readStream, objectLimit, retries, diff --git a/src/core/server/saved_objects/import/types.ts b/src/core/server/saved_objects/import/types.ts index 44046378a7b97..067579f54edac 100644 --- a/src/core/server/saved_objects/import/types.ts +++ b/src/core/server/saved_objects/import/types.ts @@ -107,11 +107,17 @@ export interface SavedObjectsImportResponse { * @public */ export interface SavedObjectsImportOptions { + /** The stream of {@link SavedObject | saved objects} to import */ readStream: Readable; + /** The maximum number of object to import */ objectLimit: number; + /** if true, will override existing object if present */ overwrite: boolean; + /** {@link SavedObjectsClientContract | client} to use to perform the import operation */ savedObjectsClient: SavedObjectsClientContract; + /** the list of allowed types to import */ supportedTypes: string[]; + /** if specified, will import in given namespace, else will import as global object */ namespace?: string; } @@ -120,10 +126,16 @@ export interface SavedObjectsImportOptions { * @public */ export interface SavedObjectsResolveImportErrorsOptions { + /** The stream of {@link SavedObject | saved objects} to resolve errors from */ readStream: Readable; + /** The maximum number of object to import */ objectLimit: number; + /** client to use to perform the import operation */ savedObjectsClient: SavedObjectsClientContract; + /** saved object import references to retry */ retries: SavedObjectsImportRetry[]; + /** the list of allowed types to import */ supportedTypes: string[]; + /** if specified, will import in given namespace */ namespace?: string; } diff --git a/src/core/server/saved_objects/index.ts b/src/core/server/saved_objects/index.ts index 9bfe658028258..0af8ea7d0e830 100644 --- a/src/core/server/saved_objects/index.ts +++ b/src/core/server/saved_objects/index.ts @@ -26,7 +26,7 @@ export { SavedObjectsManagement } from './management'; export * from './import'; export { - getSortedObjectsForExport, + exportSavedObjectsToStream, SavedObjectsExportOptions, SavedObjectsExportResultDetails, } from './export'; @@ -70,7 +70,7 @@ export { SavedObjectMigrationContext, } from './migrations'; -export { SavedObjectsType } from './types'; +export { SavedObjectsType, SavedObjectsTypeManagementDefinition } from './types'; export { savedObjectsConfig, savedObjectsMigrationConfig } from './saved_objects_config'; export { SavedObjectTypeRegistry, ISavedObjectTypeRegistry } from './saved_objects_type_registry'; diff --git a/src/core/server/saved_objects/management/index.ts b/src/core/server/saved_objects/management/index.ts index c32639e74d079..a256a1333c5cc 100644 --- a/src/core/server/saved_objects/management/index.ts +++ b/src/core/server/saved_objects/management/index.ts @@ -17,4 +17,4 @@ * under the License. */ -export { SavedObjectsManagement, SavedObjectsManagementDefinition } from './management'; +export { SavedObjectsManagement } from './management'; diff --git a/src/core/server/saved_objects/management/management.mock.ts b/src/core/server/saved_objects/management/management.mock.ts index 2099cc0f77bcc..e7242c30d3961 100644 --- a/src/core/server/saved_objects/management/management.mock.ts +++ b/src/core/server/saved_objects/management/management.mock.ts @@ -24,6 +24,7 @@ const createManagementMock = () => { const mocked: jest.Mocked = { isImportAndExportable: jest.fn().mockReturnValue(true), getDefaultSearchField: jest.fn(), + getImportableAndExportableTypes: jest.fn(), getIcon: jest.fn(), getTitle: jest.fn(), getEditUrl: jest.fn(), diff --git a/src/core/server/saved_objects/management/management.test.ts b/src/core/server/saved_objects/management/management.test.ts index e936326d957f9..dc110dec020f0 100644 --- a/src/core/server/saved_objects/management/management.test.ts +++ b/src/core/server/saved_objects/management/management.test.ts @@ -18,157 +18,185 @@ */ import { SavedObjectsManagement } from './management'; +import { SavedObjectsType } from '../types'; +import { SavedObjectTypeRegistry } from '../saved_objects_type_registry'; -describe('isImportAndExportable()', () => { - it('returns false for unknown types', () => { - const management = new SavedObjectsManagement(); - const result = management.isImportAndExportable('bar'); - expect(result).toBe(false); - }); +describe('SavedObjectsManagement', () => { + let registry: SavedObjectTypeRegistry; + let management: SavedObjectsManagement; - it('returns true for explicitly importable and exportable type', () => { - const management = new SavedObjectsManagement({ - foo: { - isImportableAndExportable: true, - }, + const registerType = (type: Partial) => + registry.registerType({ + name: 'unknown', + hidden: false, + namespaceAgnostic: false, + mappings: { properties: {} }, + migrations: {}, + ...type, }); - const result = management.isImportAndExportable('foo'); - expect(result).toBe(true); + + beforeEach(() => { + registry = new SavedObjectTypeRegistry(); + management = new SavedObjectsManagement(registry); }); - it('returns false for explicitly importable and exportable type', () => { - const management = new SavedObjectsManagement({ - foo: { - isImportableAndExportable: false, - }, + describe('isImportAndExportable()', () => { + it('returns false for unknown types', () => { + const result = management.isImportAndExportable('bar'); + expect(result).toBe(false); }); - const result = management.isImportAndExportable('foo'); - expect(result).toBe(false); - }); -}); -describe('getDefaultSearchField()', () => { - it('returns empty for unknown types', () => { - const management = new SavedObjectsManagement(); - const result = management.getDefaultSearchField('bar'); - expect(result).toEqual(undefined); - }); + it('returns true for explicitly importable and exportable type', () => { + registerType({ + name: 'foo', + management: { + importableAndExportable: true, + }, + }); - it('returns explicit value', () => { - const management = new SavedObjectsManagement({ - foo: { - defaultSearchField: 'value', - }, + const result = management.isImportAndExportable('foo'); + expect(result).toBe(true); }); - const result = management.getDefaultSearchField('foo'); - expect(result).toEqual('value'); - }); -}); -describe('getIcon', () => { - it('returns empty for unknown types', () => { - const management = new SavedObjectsManagement(); - const result = management.getIcon('bar'); - expect(result).toEqual(undefined); - }); + it('returns false for explicitly importable and exportable type', () => { + registerType({ + name: 'foo', + management: { + importableAndExportable: false, + }, + }); - it('returns explicit value', () => { - const management = new SavedObjectsManagement({ - foo: { - icon: 'value', - }, + const result = management.isImportAndExportable('foo'); + expect(result).toBe(false); }); - const result = management.getIcon('foo'); - expect(result).toEqual('value'); }); -}); -describe('getTitle', () => { - it('returns empty for unknown type', () => { - const management = new SavedObjectsManagement(); - const result = management.getTitle({ - id: '1', - type: 'foo', - attributes: {}, - references: [], + describe('getDefaultSearchField()', () => { + it('returns empty for unknown types', () => { + const result = management.getDefaultSearchField('bar'); + expect(result).toEqual(undefined); }); - expect(result).toEqual(undefined); - }); - it('returns explicit value', () => { - const management = new SavedObjectsManagement({ - foo: { - getTitle() { - return 'called'; + it('returns explicit value', () => { + registerType({ + name: 'foo', + management: { + defaultSearchField: 'value', }, - }, - }); - const result = management.getTitle({ - id: '1', - type: 'foo', - attributes: {}, - references: [], + }); + + const result = management.getDefaultSearchField('foo'); + expect(result).toEqual('value'); }); - expect(result).toEqual('called'); }); -}); -describe('getEditUrl()', () => { - it('returns empty for unknown type', () => { - const management = new SavedObjectsManagement(); - const result = management.getEditUrl({ - id: '1', - type: 'foo', - attributes: {}, - references: [], + describe('getIcon()', () => { + it('returns empty for unknown types', () => { + const result = management.getIcon('bar'); + expect(result).toEqual(undefined); }); - expect(result).toEqual(undefined); - }); - it('returns explicit value', () => { - const management = new SavedObjectsManagement({ - foo: { - getEditUrl() { - return 'called'; + it('returns explicit value', () => { + registerType({ + name: 'foo', + management: { + icon: 'value', }, - }, - }); - const result = management.getEditUrl({ - id: '1', - type: 'foo', - attributes: {}, - references: [], + }); + const result = management.getIcon('foo'); + expect(result).toEqual('value'); }); - expect(result).toEqual('called'); }); -}); -describe('getInAppUrl()', () => { - it('returns empty array for unknown type', () => { - const management = new SavedObjectsManagement(); - const result = management.getInAppUrl({ - id: '1', - type: 'foo', - attributes: {}, - references: [], + describe('getTitle()', () => { + it('returns empty for unknown type', () => { + const result = management.getTitle({ + id: '1', + type: 'foo', + attributes: {}, + references: [], + }); + expect(result).toEqual(undefined); + }); + + it('returns explicit value', () => { + registerType({ + name: 'foo', + management: { + getTitle() { + return 'called'; + }, + }, + }); + const result = management.getTitle({ + id: '1', + type: 'foo', + attributes: {}, + references: [], + }); + expect(result).toEqual('called'); }); - expect(result).toEqual(undefined); }); - it('returns explicit value', () => { - const management = new SavedObjectsManagement({ - foo: { - getInAppUrl() { - return { path: 'called', uiCapabilitiesPath: 'my.path' }; + describe('getEditUrl()', () => { + it('returns empty for unknown type', () => { + const result = management.getEditUrl({ + id: '1', + type: 'foo', + attributes: {}, + references: [], + }); + expect(result).toEqual(undefined); + }); + + it('returns explicit value', () => { + registerType({ + name: 'foo', + management: { + getEditUrl() { + return 'called'; + }, }, - }, + }); + + const result = management.getEditUrl({ + id: '1', + type: 'foo', + attributes: {}, + references: [], + }); + expect(result).toEqual('called'); + }); + }); + + describe('getInAppUrl()', () => { + it('returns empty array for unknown type', () => { + const result = management.getInAppUrl({ + id: '1', + type: 'foo', + attributes: {}, + references: [], + }); + expect(result).toEqual(undefined); }); - const result = management.getInAppUrl({ - id: '1', - type: 'foo', - attributes: {}, - references: [], + + it('returns explicit value', () => { + registerType({ + name: 'foo', + management: { + getInAppUrl() { + return { path: 'called', uiCapabilitiesPath: 'my.path' }; + }, + }, + }); + + const result = management.getInAppUrl({ + id: '1', + type: 'foo', + attributes: {}, + references: [], + }); + expect(result).toEqual({ path: 'called', uiCapabilitiesPath: 'my.path' }); }); - expect(result).toEqual({ path: 'called', uiCapabilitiesPath: 'my.path' }); }); }); diff --git a/src/core/server/saved_objects/management/management.ts b/src/core/server/saved_objects/management/management.ts index b7dce2c087c5f..db759c4aec752 100644 --- a/src/core/server/saved_objects/management/management.ts +++ b/src/core/server/saved_objects/management/management.ts @@ -18,74 +18,42 @@ */ import { SavedObject } from '../types'; - -interface SavedObjectsManagementTypeDefinition { - isImportableAndExportable?: boolean; - defaultSearchField?: string; - icon?: string; - getTitle?: (savedObject: SavedObject) => string; - getEditUrl?: (savedObject: SavedObject) => string; - getInAppUrl?: (savedObject: SavedObject) => { path: string; uiCapabilitiesPath: string }; -} - -export interface SavedObjectsManagementDefinition { - [key: string]: SavedObjectsManagementTypeDefinition; -} +import { ISavedObjectTypeRegistry } from '../saved_objects_type_registry'; export class SavedObjectsManagement { - private readonly definition?: SavedObjectsManagementDefinition; + constructor(private readonly registry: ISavedObjectTypeRegistry) {} - constructor(managementDefinition?: SavedObjectsManagementDefinition) { - this.definition = managementDefinition; + public getImportableAndExportableTypes() { + return this.registry + .getAllTypes() + .map(type => type.name) + .filter(type => this.isImportAndExportable(type)); } public isImportAndExportable(type: string) { - if (this.definition && this.definition.hasOwnProperty(type)) { - return this.definition[type].isImportableAndExportable === true; - } - - return false; + return this.registry.isImportableAndExportable(type); } public getDefaultSearchField(type: string) { - if (this.definition && this.definition.hasOwnProperty(type)) { - return this.definition[type].defaultSearchField; - } + return this.registry.getType(type)?.management?.defaultSearchField; } public getIcon(type: string) { - if (this.definition && this.definition.hasOwnProperty(type)) { - return this.definition[type].icon; - } + return this.registry.getType(type)?.management?.icon; } public getTitle(savedObject: SavedObject) { - const { type } = savedObject; - if (this.definition && this.definition.hasOwnProperty(type) && this.definition[type].getTitle) { - const { getTitle } = this.definition[type]; - if (getTitle) { - return getTitle(savedObject); - } - } + const getTitle = this.registry.getType(savedObject.type)?.management?.getTitle; + return getTitle ? getTitle(savedObject) : undefined; } public getEditUrl(savedObject: SavedObject) { - const { type } = savedObject; - if (this.definition && this.definition.hasOwnProperty(type)) { - const { getEditUrl } = this.definition[type]; - if (getEditUrl) { - return getEditUrl(savedObject); - } - } + const getEditUrl = this.registry.getType(savedObject.type)?.management?.getEditUrl; + return getEditUrl ? getEditUrl(savedObject) : undefined; } public getInAppUrl(savedObject: SavedObject) { - const { type } = savedObject; - if (this.definition && this.definition.hasOwnProperty(type)) { - const { getInAppUrl } = this.definition[type]; - if (getInAppUrl) { - return getInAppUrl(savedObject); - } - } + const getInAppUrl = this.registry.getType(savedObject.type)?.management?.getInAppUrl; + return getInAppUrl ? getInAppUrl(savedObject) : undefined; } } diff --git a/src/core/server/saved_objects/mappings/types.ts b/src/core/server/saved_objects/mappings/types.ts index bc556c0429981..47fc29f8cf7d2 100644 --- a/src/core/server/saved_objects/mappings/types.ts +++ b/src/core/server/saved_objects/mappings/types.ts @@ -45,7 +45,7 @@ * @public */ export interface SavedObjectsTypeMappingDefinition { - /** The dynamic property of the mapping. either `false` or 'strict'. Defaults to strict */ + /** The dynamic property of the mapping. either `false` or 'strict'. Defaults to `false` */ dynamic?: false | 'strict'; /** The underlying properties of the type mapping */ properties: SavedObjectsMappingProperties; diff --git a/src/core/server/saved_objects/migrations/core/__snapshots__/build_active_mappings.test.ts.snap b/src/core/server/saved_objects/migrations/core/__snapshots__/build_active_mappings.test.ts.snap index 68f90ea70a0c6..fc26d7e9cf6e9 100644 --- a/src/core/server/saved_objects/migrations/core/__snapshots__/build_active_mappings.test.ts.snap +++ b/src/core/server/saved_objects/migrations/core/__snapshots__/build_active_mappings.test.ts.snap @@ -6,7 +6,6 @@ Object { "migrationMappingPropertyHashes": Object { "aaa": "625b32086eb1d1203564cf85062dd22e", "bbb": "18c78c995965207ed3f6e7fc5c6e55fe", - "config": "87aca8fdb053154f11383fce3dbf3edf", "migrationVersion": "4a1746014a75ade3a714e1db5763276f", "namespace": "2f4316de49999235636386fe51dc06c1", "references": "7997cf5a56cc02bdc9c93361bde732b0", @@ -22,14 +21,6 @@ Object { "bbb": Object { "type": "long", }, - "config": Object { - "dynamic": "true", - "properties": Object { - "buildNum": Object { - "type": "keyword", - }, - }, - }, "migrationVersion": Object { "dynamic": "true", "type": "object", @@ -65,7 +56,6 @@ exports[`buildActiveMappings handles the \`dynamic\` property of types 1`] = ` Object { "_meta": Object { "migrationMappingPropertyHashes": Object { - "config": "87aca8fdb053154f11383fce3dbf3edf", "firstType": "635418ab953d81d93f1190b70a8d3f57", "migrationVersion": "4a1746014a75ade3a714e1db5763276f", "namespace": "2f4316de49999235636386fe51dc06c1", @@ -78,14 +68,6 @@ Object { }, "dynamic": "strict", "properties": Object { - "config": Object { - "dynamic": "true", - "properties": Object { - "buildNum": Object { - "type": "keyword", - }, - }, - }, "firstType": Object { "dynamic": "strict", "properties": Object { diff --git a/src/core/server/saved_objects/migrations/core/build_active_mappings.ts b/src/core/server/saved_objects/migrations/core/build_active_mappings.ts index 3afe8aae119d9..4d1a607414ca6 100644 --- a/src/core/server/saved_objects/migrations/core/build_active_mappings.ts +++ b/src/core/server/saved_objects/migrations/core/build_active_mappings.ts @@ -132,14 +132,6 @@ function defaultMapping(): IndexMapping { return { dynamic: 'strict', properties: { - config: { - dynamic: 'true', - properties: { - buildNum: { - type: 'keyword', - }, - }, - }, migrationVersion: { dynamic: 'true', type: 'object', 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 a9d0a339c229f..1c2d3f501ff80 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 @@ -58,7 +58,6 @@ describe('IndexMigrator', () => { dynamic: 'strict', _meta: { migrationMappingPropertyHashes: { - config: '87aca8fdb053154f11383fce3dbf3edf', foo: '18c78c995965207ed3f6e7fc5c6e55fe', migrationVersion: '4a1746014a75ade3a714e1db5763276f', namespace: '2f4316de49999235636386fe51dc06c1', @@ -68,10 +67,6 @@ describe('IndexMigrator', () => { }, }, properties: { - config: { - dynamic: 'true', - properties: { buildNum: { type: 'keyword' } }, - }, foo: { type: 'long' }, migrationVersion: { dynamic: 'true', type: 'object' }, namespace: { type: 'keyword' }, @@ -180,7 +175,6 @@ describe('IndexMigrator', () => { dynamic: 'strict', _meta: { migrationMappingPropertyHashes: { - config: '87aca8fdb053154f11383fce3dbf3edf', foo: '625b32086eb1d1203564cf85062dd22e', migrationVersion: '4a1746014a75ade3a714e1db5763276f', namespace: '2f4316de49999235636386fe51dc06c1', @@ -191,10 +185,6 @@ describe('IndexMigrator', () => { }, properties: { author: { type: 'text' }, - config: { - dynamic: 'true', - properties: { buildNum: { type: 'keyword' } }, - }, foo: { type: 'text' }, migrationVersion: { dynamic: 'true', type: 'object' }, namespace: { type: 'keyword' }, diff --git a/src/core/server/saved_objects/migrations/kibana/__snapshots__/kibana_migrator.test.ts.snap b/src/core/server/saved_objects/migrations/kibana/__snapshots__/kibana_migrator.test.ts.snap index 37a73b11bbc48..507c0b0d9339f 100644 --- a/src/core/server/saved_objects/migrations/kibana/__snapshots__/kibana_migrator.test.ts.snap +++ b/src/core/server/saved_objects/migrations/kibana/__snapshots__/kibana_migrator.test.ts.snap @@ -6,7 +6,6 @@ Object { "migrationMappingPropertyHashes": Object { "amap": "510f1f0adb69830cf8a1c5ce2923ed82", "bmap": "510f1f0adb69830cf8a1c5ce2923ed82", - "config": "87aca8fdb053154f11383fce3dbf3edf", "migrationVersion": "4a1746014a75ade3a714e1db5763276f", "namespace": "2f4316de49999235636386fe51dc06c1", "references": "7997cf5a56cc02bdc9c93361bde732b0", @@ -30,14 +29,6 @@ Object { }, }, }, - "config": Object { - "dynamic": "true", - "properties": Object { - "buildNum": Object { - "type": "keyword", - }, - }, - }, "migrationVersion": Object { "dynamic": "true", "type": "object", diff --git a/src/core/server/saved_objects/routes/export.ts b/src/core/server/saved_objects/routes/export.ts index ab287332d8a65..7205699ddc702 100644 --- a/src/core/server/saved_objects/routes/export.ts +++ b/src/core/server/saved_objects/routes/export.ts @@ -26,33 +26,22 @@ import { } from '../../../../legacy/utils/streams'; import { IRouter } from '../../http'; import { SavedObjectConfig } from '../saved_objects_config'; -import { getSortedObjectsForExport } from '../export'; +import { exportSavedObjectsToStream } from '../export'; +import { validateTypes, validateObjects } from './utils'; -export const registerExportRoute = ( - router: IRouter, - config: SavedObjectConfig, - supportedTypes: string[] -) => { +export const registerExportRoute = (router: IRouter, config: SavedObjectConfig) => { const { maxImportExportSize } = config; - const typeSchema = schema.string({ - validate: (type: string) => { - if (!supportedTypes.includes(type)) { - return `${type} is not exportable`; - } - }, - }); - router.post( { path: '/_export', validate: { body: schema.object({ - type: schema.maybe(schema.oneOf([typeSchema, schema.arrayOf(typeSchema)])), + type: schema.maybe(schema.oneOf([schema.string(), schema.arrayOf(schema.string())])), objects: schema.maybe( schema.arrayOf( schema.object({ - type: typeSchema, + type: schema.string(), id: schema.string(), }), { maxSize: maxImportExportSize } @@ -67,9 +56,36 @@ export const registerExportRoute = ( router.handleLegacyErrors(async (context, req, res) => { const savedObjectsClient = context.core.savedObjects.client; const { type, objects, search, excludeExportDetails, includeReferencesDeep } = req.body; - const exportStream = await getSortedObjectsForExport({ + const types = typeof type === 'string' ? [type] : type; + + // need to access the registry for type validation, can't use the schema for this + const supportedTypes = context.core.savedObjects.typeRegistry + .getImportableAndExportableTypes() + .map(t => t.name); + if (types) { + const validationError = validateTypes(types, supportedTypes); + if (validationError) { + return res.badRequest({ + body: { + message: validationError, + }, + }); + } + } + if (objects) { + const validationError = validateObjects(objects, supportedTypes); + if (validationError) { + return res.badRequest({ + body: { + message: validationError, + }, + }); + } + } + + const exportStream = await exportSavedObjectsToStream({ savedObjectsClient, - types: typeof type === 'string' ? [type] : type, + types, search, objects, exportSizeLimit: maxImportExportSize, diff --git a/src/core/server/saved_objects/routes/import.ts b/src/core/server/saved_objects/routes/import.ts index e3f249dca05f7..0731d4159356d 100644 --- a/src/core/server/saved_objects/routes/import.ts +++ b/src/core/server/saved_objects/routes/import.ts @@ -21,7 +21,7 @@ import { Readable } from 'stream'; import { extname } from 'path'; import { schema } from '@kbn/config-schema'; import { IRouter } from '../../http'; -import { importSavedObjects } from '../import'; +import { importSavedObjectsFromStream } from '../import'; import { SavedObjectConfig } from '../saved_objects_config'; import { createSavedObjectsStreamFromNdJson } from './utils'; @@ -31,11 +31,7 @@ interface FileStream extends Readable { }; } -export const registerImportRoute = ( - router: IRouter, - config: SavedObjectConfig, - supportedTypes: string[] -) => { +export const registerImportRoute = (router: IRouter, config: SavedObjectConfig) => { const { maxImportExportSize, maxImportPayloadBytes } = config; router.post( @@ -65,7 +61,11 @@ export const registerImportRoute = ( return res.badRequest({ body: `Invalid file extension ${fileExtension}` }); } - const result = await importSavedObjects({ + const supportedTypes = context.core.savedObjects.typeRegistry + .getImportableAndExportableTypes() + .map(type => type.name); + + const result = await importSavedObjectsFromStream({ supportedTypes, savedObjectsClient: context.core.savedObjects.client, readStream: createSavedObjectsStreamFromNdJson(file), diff --git a/src/core/server/saved_objects/routes/index.ts b/src/core/server/saved_objects/routes/index.ts index 0afa24b18760b..fd57a9f3059e3 100644 --- a/src/core/server/saved_objects/routes/index.ts +++ b/src/core/server/saved_objects/routes/index.ts @@ -39,13 +39,11 @@ export function registerRoutes({ http, logger, config, - importableExportableTypes, migratorPromise, }: { http: InternalHttpServiceSetup; logger: Logger; config: SavedObjectConfig; - importableExportableTypes: string[]; migratorPromise: Promise; }) { const router = http.createRouter('/api/saved_objects/'); @@ -59,9 +57,9 @@ export function registerRoutes({ registerBulkCreateRoute(router); registerBulkUpdateRoute(router); registerLogLegacyImportRoute(router, logger); - registerExportRoute(router, config, importableExportableTypes); - registerImportRoute(router, config, importableExportableTypes); - registerResolveImportErrorsRoute(router, config, importableExportableTypes); + registerExportRoute(router, config); + registerImportRoute(router, config); + registerResolveImportErrorsRoute(router, config); const internalRouter = http.createRouter('/internal/saved_objects/'); diff --git a/src/core/server/saved_objects/routes/integration_tests/export.test.ts b/src/core/server/saved_objects/routes/integration_tests/export.test.ts index b52a8957176cc..858d34d5a93bf 100644 --- a/src/core/server/saved_objects/routes/integration_tests/export.test.ts +++ b/src/core/server/saved_objects/routes/integration_tests/export.test.ts @@ -18,7 +18,7 @@ */ jest.mock('../../export', () => ({ - getSortedObjectsForExport: jest.fn(), + exportSavedObjectsToStream: jest.fn(), })); import * as exportMock from '../../export'; @@ -27,10 +27,10 @@ import supertest from 'supertest'; import { UnwrapPromise } from '@kbn/utility-types'; import { SavedObjectConfig } from '../../saved_objects_config'; import { registerExportRoute } from '../export'; -import { setupServer } from './test_utils'; +import { setupServer, createExportableType } from './test_utils'; type setupServerReturn = UnwrapPromise>; -const getSortedObjectsForExport = exportMock.getSortedObjectsForExport as jest.Mock; +const exportSavedObjectsToStream = exportMock.exportSavedObjectsToStream as jest.Mock; const allowedTypes = ['index-pattern', 'search']; const config = { maxImportPayloadBytes: 10485760, @@ -40,12 +40,16 @@ const config = { describe('POST /api/saved_objects/_export', () => { let server: setupServerReturn['server']; let httpSetup: setupServerReturn['httpSetup']; + let handlerContext: setupServerReturn['handlerContext']; beforeEach(async () => { - ({ server, httpSetup } = await setupServer()); + ({ server, httpSetup, handlerContext } = await setupServer()); + handlerContext.savedObjects.typeRegistry.getImportableAndExportableTypes.mockReturnValue( + allowedTypes.map(createExportableType) + ); const router = httpSetup.createRouter('/api/saved_objects/'); - registerExportRoute(router, config, allowedTypes); + registerExportRoute(router, config); await server.start(); }); @@ -76,7 +80,7 @@ describe('POST /api/saved_objects/_export', () => { ], }, ]; - getSortedObjectsForExport.mockResolvedValueOnce(createListStream(sortedObjects)); + exportSavedObjectsToStream.mockResolvedValueOnce(createListStream(sortedObjects)); const result = await supertest(httpSetup.server.listener) .post('/api/saved_objects/_export') @@ -96,7 +100,7 @@ describe('POST /api/saved_objects/_export', () => { const objects = (result.text as string).split('\n').map(row => JSON.parse(row)); expect(objects).toEqual(sortedObjects); - expect(getSortedObjectsForExport.mock.calls[0][0]).toEqual( + expect(exportSavedObjectsToStream.mock.calls[0][0]).toEqual( expect.objectContaining({ excludeExportDetails: false, exportSizeLimit: 10000, diff --git a/src/core/server/saved_objects/routes/integration_tests/import.test.ts b/src/core/server/saved_objects/routes/integration_tests/import.test.ts index 954e6d9e4831a..c72d3e241b882 100644 --- a/src/core/server/saved_objects/routes/integration_tests/import.test.ts +++ b/src/core/server/saved_objects/routes/integration_tests/import.test.ts @@ -22,7 +22,7 @@ import { UnwrapPromise } from '@kbn/utility-types'; import { registerImportRoute } from '../import'; import { savedObjectsClientMock } from '../../../../../core/server/mocks'; import { SavedObjectConfig } from '../../saved_objects_config'; -import { setupServer } from './test_utils'; +import { setupServer, createExportableType } from './test_utils'; type setupServerReturn = UnwrapPromise>; @@ -47,12 +47,15 @@ describe('POST /internal/saved_objects/_import', () => { beforeEach(async () => { ({ server, httpSetup, handlerContext } = await setupServer()); - savedObjectsClient = handlerContext.savedObjects.client; + handlerContext.savedObjects.typeRegistry.getImportableAndExportableTypes.mockReturnValue( + allowedTypes.map(createExportableType) + ); + savedObjectsClient = handlerContext.savedObjects.client; savedObjectsClient.find.mockResolvedValue(emptyResponse); const router = httpSetup.createRouter('/internal/saved_objects/'); - registerImportRoute(router, config, allowedTypes); + registerImportRoute(router, config); await server.start(); }); diff --git a/src/core/server/saved_objects/routes/integration_tests/resolve_import_errors.test.ts b/src/core/server/saved_objects/routes/integration_tests/resolve_import_errors.test.ts index c2974395217f8..a36f246f9dbc5 100644 --- a/src/core/server/saved_objects/routes/integration_tests/resolve_import_errors.test.ts +++ b/src/core/server/saved_objects/routes/integration_tests/resolve_import_errors.test.ts @@ -21,7 +21,7 @@ import supertest from 'supertest'; import { UnwrapPromise } from '@kbn/utility-types'; import { registerResolveImportErrorsRoute } from '../resolve_import_errors'; import { savedObjectsClientMock } from '../../../../../core/server/mocks'; -import { setupServer } from './test_utils'; +import { setupServer, createExportableType } from './test_utils'; import { SavedObjectConfig } from '../../saved_objects_config'; type setupServerReturn = UnwrapPromise>; @@ -40,10 +40,14 @@ describe('POST /api/saved_objects/_resolve_import_errors', () => { beforeEach(async () => { ({ server, httpSetup, handlerContext } = await setupServer()); + handlerContext.savedObjects.typeRegistry.getImportableAndExportableTypes.mockReturnValue( + allowedTypes.map(createExportableType) + ); + savedObjectsClient = handlerContext.savedObjects.client; const router = httpSetup.createRouter('/api/saved_objects/'); - registerResolveImportErrorsRoute(router, config, allowedTypes); + registerResolveImportErrorsRoute(router, config); await server.start(); }); diff --git a/src/core/server/saved_objects/routes/integration_tests/test_utils.ts b/src/core/server/saved_objects/routes/integration_tests/test_utils.ts index 093b36a413214..82a889f75d3c1 100644 --- a/src/core/server/saved_objects/routes/integration_tests/test_utils.ts +++ b/src/core/server/saved_objects/routes/integration_tests/test_utils.ts @@ -20,6 +20,7 @@ import { ContextService } from '../../../context'; import { createHttpServer, createCoreContext } from '../../../http/test_utils'; import { coreMock } from '../../../mocks'; +import { SavedObjectsType } from '../../types'; const coreId = Symbol('core'); @@ -43,3 +44,17 @@ export const setupServer = async () => { handlerContext, }; }; + +export const createExportableType = (name: string): SavedObjectsType => { + return { + name, + hidden: false, + namespaceAgnostic: false, + mappings: { + properties: {}, + }, + management: { + importableAndExportable: true, + }, + }; +}; diff --git a/src/core/server/saved_objects/routes/resolve_import_errors.ts b/src/core/server/saved_objects/routes/resolve_import_errors.ts index efa7add7951b0..05bff871b3520 100644 --- a/src/core/server/saved_objects/routes/resolve_import_errors.ts +++ b/src/core/server/saved_objects/routes/resolve_import_errors.ts @@ -21,7 +21,7 @@ import { extname } from 'path'; import { Readable } from 'stream'; import { schema } from '@kbn/config-schema'; import { IRouter } from '../../http'; -import { resolveImportErrors } from '../import'; +import { resolveSavedObjectsImportErrors } from '../import'; import { SavedObjectConfig } from '../saved_objects_config'; import { createSavedObjectsStreamFromNdJson } from './utils'; @@ -31,11 +31,7 @@ interface FileStream extends Readable { }; } -export const registerResolveImportErrorsRoute = ( - router: IRouter, - config: SavedObjectConfig, - supportedTypes: string[] -) => { +export const registerResolveImportErrorsRoute = (router: IRouter, config: SavedObjectConfig) => { const { maxImportExportSize, maxImportPayloadBytes } = config; router.post( @@ -75,7 +71,12 @@ export const registerResolveImportErrorsRoute = ( if (fileExtension !== '.ndjson') { return res.badRequest({ body: `Invalid file extension ${fileExtension}` }); } - const result = await resolveImportErrors({ + + const supportedTypes = context.core.savedObjects.typeRegistry + .getImportableAndExportableTypes() + .map(type => type.name); + + const result = await resolveSavedObjectsImportErrors({ supportedTypes, savedObjectsClient: context.core.savedObjects.client, readStream: createSavedObjectsStreamFromNdJson(file), diff --git a/src/core/server/saved_objects/routes/utils.test.ts b/src/core/server/saved_objects/routes/utils.test.ts index 83dceda2e1398..24719724785af 100644 --- a/src/core/server/saved_objects/routes/utils.test.ts +++ b/src/core/server/saved_objects/routes/utils.test.ts @@ -17,7 +17,7 @@ * under the License. */ -import { createSavedObjectsStreamFromNdJson } from './utils'; +import { createSavedObjectsStreamFromNdJson, validateTypes, validateObjects } from './utils'; import { Readable } from 'stream'; import { createPromiseFromStreams, createConcatStream } from '../../../../legacy/utils/streams'; @@ -104,3 +104,53 @@ describe('createSavedObjectsStreamFromNdJson', () => { ]); }); }); + +describe('validateTypes', () => { + const allowedTypes = ['config', 'index-pattern', 'dashboard']; + + it('returns an error message if some types are not allowed', () => { + expect(validateTypes(['config', 'not-allowed-type'], allowedTypes)).toMatchInlineSnapshot( + `"Trying to export non-exportable type(s): not-allowed-type"` + ); + expect( + validateTypes(['index-pattern', 'not-allowed-type', 'not-allowed-type-2'], allowedTypes) + ).toMatchInlineSnapshot( + `"Trying to export non-exportable type(s): not-allowed-type, not-allowed-type-2"` + ); + }); + it('returns undefined if all types are allowed', () => { + expect(validateTypes(allowedTypes, allowedTypes)).toBeUndefined(); + expect(validateTypes(['config'], allowedTypes)).toBeUndefined(); + }); +}); + +describe('validateObjects', () => { + const allowedTypes = ['config', 'index-pattern', 'dashboard']; + + it('returns an error message if some objects have types that are not allowed', () => { + expect( + validateObjects( + [ + { id: '1', type: 'config' }, + { id: '1', type: 'not-allowed' }, + { id: '42', type: 'not-allowed-either' }, + ], + allowedTypes + ) + ).toMatchInlineSnapshot( + `"Trying to export object(s) with non-exportable types: not-allowed:1, not-allowed-either:42"` + ); + }); + it('returns undefined if all objects have allowed types', () => { + expect( + validateObjects( + [ + { id: '1', type: 'config' }, + { id: '2', type: 'config' }, + { id: '1', type: 'index-pattern' }, + ], + allowedTypes + ) + ).toBeUndefined(); + }); +}); diff --git a/src/core/server/saved_objects/routes/utils.ts b/src/core/server/saved_objects/routes/utils.ts index 5536391341da3..5f0db3c4d548c 100644 --- a/src/core/server/saved_objects/routes/utils.ts +++ b/src/core/server/saved_objects/routes/utils.ts @@ -41,3 +41,22 @@ export function createSavedObjectsStreamFromNdJson(ndJsonStream: Readable) { ) ); } + +export function validateTypes(types: string[], supportedTypes: string[]): string | undefined { + const invalidTypes = types.filter(t => !supportedTypes.includes(t)); + if (invalidTypes.length) { + return `Trying to export non-exportable type(s): ${invalidTypes.join(', ')}`; + } +} + +export function validateObjects( + objects: Array<{ id: string; type: string }>, + supportedTypes: string[] +): string | undefined { + const invalidObjects = objects.filter(obj => !supportedTypes.includes(obj.type)); + if (invalidObjects.length) { + return `Trying to export object(s) with non-exportable types: ${invalidObjects + .map(obj => `${obj.type}:${obj.id}`) + .join(', ')}`; + } +} diff --git a/src/core/server/saved_objects/saved_objects_service.mock.ts b/src/core/server/saved_objects/saved_objects_service.mock.ts index cbdff16324536..9fe32b14e6450 100644 --- a/src/core/server/saved_objects/saved_objects_service.mock.ts +++ b/src/core/server/saved_objects/saved_objects_service.mock.ts @@ -64,8 +64,11 @@ const createSetupContractMock = () => { setClientFactoryProvider: jest.fn(), addClientWrapper: jest.fn(), registerType: jest.fn(), + getImportExportObjectLimit: jest.fn(), }; + setupContract.getImportExportObjectLimit.mockReturnValue(100); + return setupContract; }; diff --git a/src/core/server/saved_objects/saved_objects_service.test.ts b/src/core/server/saved_objects/saved_objects_service.test.ts index 554acf8d43dcb..58b9abfbcdb3a 100644 --- a/src/core/server/saved_objects/saved_objects_service.test.ts +++ b/src/core/server/saved_objects/saved_objects_service.test.ts @@ -23,7 +23,7 @@ import { clientProviderInstanceMock, typeRegistryInstanceMock, } from './saved_objects_service.test.mocks'; - +import { BehaviorSubject } from 'rxjs'; import { ByteSizeValue } from '@kbn/config-schema'; import { SavedObjectsService } from './saved_objects_service'; import { mockCoreContext } from '../core_context.mock'; @@ -34,7 +34,6 @@ import { elasticsearchServiceMock } from '../elasticsearch/elasticsearch_service import { legacyServiceMock } from '../legacy/legacy_service.mock'; import { httpServiceMock } from '../http/http_service.mock'; import { SavedObjectsClientFactoryProvider } from './service/lib'; -import { BehaviorSubject } from 'rxjs'; import { NodesVersionCompatibility } from '../elasticsearch/version_check/ensure_es_version'; describe('SavedObjectsService', () => { diff --git a/src/core/server/saved_objects/saved_objects_service.ts b/src/core/server/saved_objects/saved_objects_service.ts index 62e25ad5fb458..175eac3c1bd95 100644 --- a/src/core/server/saved_objects/saved_objects_service.ts +++ b/src/core/server/saved_objects/saved_objects_service.ts @@ -38,7 +38,7 @@ import { SavedObjectConfig, } from './saved_objects_config'; import { KibanaRequest, InternalHttpServiceSetup } from '../http'; -import { SavedObjectsClientContract, SavedObjectsType, SavedObjectsLegacyUiExports } from './types'; +import { SavedObjectsClientContract, SavedObjectsType } from './types'; import { ISavedObjectsRepository, SavedObjectsRepository } from './service/lib/repository'; import { SavedObjectsClientFactoryProvider, @@ -154,6 +154,11 @@ export interface SavedObjectsServiceSetup { * This API is the single entry point to register saved object types in the new platform. */ registerType: (type: SavedObjectsType) => void; + + /** + * Returns the maximum number of objects allowed for import or export operations. + */ + getImportExportObjectLimit: () => number; } /** @@ -296,10 +301,6 @@ export class SavedObjectsService legacyTypes.forEach(type => this.typeRegistry.registerType(type)); this.validations = setupDeps.legacyPlugins.uiExports.savedObjectValidations || {}; - const importableExportableTypes = getImportableAndExportableTypes( - setupDeps.legacyPlugins.uiExports - ); - const savedObjectsConfig = await this.coreContext.configService .atPath('savedObjects') .pipe(first()) @@ -315,7 +316,6 @@ export class SavedObjectsService logger: this.logger, config: this.config, migratorPromise: this.migrator$.pipe(first()).toPromise(), - importableExportableTypes, }); return { @@ -344,6 +344,7 @@ export class SavedObjectsService } this.typeRegistry.registerType(type); }, + getImportExportObjectLimit: () => this.config!.maxImportExportSize, }; } @@ -473,16 +474,3 @@ export class SavedObjectsService }); } } - -function getImportableAndExportableTypes({ - savedObjectMappings = [], - savedObjectsManagement = {}, -}: SavedObjectsLegacyUiExports) { - const visibleTypes = savedObjectMappings.reduce( - (types, mapping) => [...types, ...Object.keys(mapping.properties)], - [] as string[] - ); - return visibleTypes.filter( - type => savedObjectsManagement[type]?.isImportableAndExportable === true ?? false - ); -} diff --git a/src/core/server/saved_objects/saved_objects_type_registry.mock.ts b/src/core/server/saved_objects/saved_objects_type_registry.mock.ts index 435e352335ecf..8c8458d7a5ce4 100644 --- a/src/core/server/saved_objects/saved_objects_type_registry.mock.ts +++ b/src/core/server/saved_objects/saved_objects_type_registry.mock.ts @@ -25,14 +25,20 @@ const createRegistryMock = (): jest.Mocked type === 'global'); + mock.isImportableAndExportable.mockReturnValue(true); return mock; }; diff --git a/src/core/server/saved_objects/saved_objects_type_registry.test.ts b/src/core/server/saved_objects/saved_objects_type_registry.test.ts index 4268ab7718f8d..4d1d5c1eacc25 100644 --- a/src/core/server/saved_objects/saved_objects_type_registry.test.ts +++ b/src/core/server/saved_objects/saved_objects_type_registry.test.ts @@ -212,4 +212,45 @@ describe('SavedObjectTypeRegistry', () => { expect(registry.getIndex('unknownType')).toBeUndefined(); }); }); + + describe('#isImportableAndExportable', () => { + it('returns correct value for the type', () => { + registry.registerType( + createType({ name: 'typeA', management: { importableAndExportable: true } }) + ); + registry.registerType( + createType({ name: 'typeB', management: { importableAndExportable: false } }) + ); + + expect(registry.isImportableAndExportable('typeA')).toBe(true); + expect(registry.isImportableAndExportable('typeB')).toBe(false); + }); + it('returns false when the type is not registered', () => { + registry.registerType(createType({ name: 'typeA', management: {} })); + registry.registerType(createType({ name: 'typeB', management: {} })); + + expect(registry.isImportableAndExportable('typeA')).toBe(false); + }); + it('returns false when management is not defined for the type', () => { + registry.registerType(createType({ name: 'typeA' })); + expect(registry.isImportableAndExportable('unknownType')).toBe(false); + }); + }); + + describe('#getImportableAndExportableTypes', () => { + it('returns all registered types that are importable/exportable', () => { + const typeA = createType({ name: 'typeA', management: { importableAndExportable: true } }); + const typeB = createType({ name: 'typeB' }); + const typeC = createType({ name: 'typeC', management: { importableAndExportable: false } }); + const typeD = createType({ name: 'typeD', management: { importableAndExportable: true } }); + registry.registerType(typeA); + registry.registerType(typeB); + registry.registerType(typeC); + registry.registerType(typeD); + + const types = registry.getImportableAndExportableTypes(); + expect(types.length).toEqual(2); + expect(types.map(t => t.name)).toEqual(['typeA', 'typeD']); + }); + }); }); 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 b73c80ad9dff7..5580ce3815d0d 100644 --- a/src/core/server/saved_objects/saved_objects_type_registry.ts +++ b/src/core/server/saved_objects/saved_objects_type_registry.ts @@ -27,7 +27,13 @@ import { SavedObjectsType } from './types'; */ export type ISavedObjectTypeRegistry = Pick< SavedObjectTypeRegistry, - 'getType' | 'getAllTypes' | 'getIndex' | 'isNamespaceAgnostic' | 'isHidden' + | 'getType' + | 'getAllTypes' + | 'getIndex' + | 'isNamespaceAgnostic' + | 'isHidden' + | 'getImportableAndExportableTypes' + | 'isImportableAndExportable' >; /** @@ -63,6 +69,13 @@ export class SavedObjectTypeRegistry { return [...this.types.values()]; } + /** + * Return all {@link SavedObjectsType | types} currently registered that are importable/exportable. + */ + public getImportableAndExportableTypes() { + return this.getAllTypes().filter(type => this.isImportableAndExportable(type.name)); + } + /** * Returns the `namespaceAgnostic` property for given type, or `false` if * the type is not registered. @@ -86,4 +99,12 @@ export class SavedObjectTypeRegistry { public getIndex(type: string) { return this.types.get(type)?.indexPattern; } + + /** + * Returns the `management.importableAndExportable` property for given type, or + * `false` if the type is not registered or does not define a management section. + */ + public isImportableAndExportable(type: string) { + return this.types.get(type)?.management?.importableAndExportable ?? false; + } } diff --git a/src/core/server/saved_objects/service/lib/repository_create_repository.test.ts b/src/core/server/saved_objects/service/lib/repository_create_repository.test.ts index 4a87bb1043ca2..a6b580e9b3461 100644 --- a/src/core/server/saved_objects/service/lib/repository_create_repository.test.ts +++ b/src/core/server/saved_objects/service/lib/repository_create_repository.test.ts @@ -102,7 +102,6 @@ describe('SavedObjectsRepository#createRepository', () => { expect(repository).toBeDefined(); expect(RepositoryConstructor.mock.calls[0][0].allowedTypes).toMatchInlineSnapshot(` Array [ - "config", "nsAgnosticType", "nsType", ] @@ -121,7 +120,6 @@ describe('SavedObjectsRepository#createRepository', () => { expect(repository).toBeDefined(); expect(RepositoryConstructor.mock.calls[0][0].allowedTypes).toMatchInlineSnapshot(` Array [ - "config", "nsAgnosticType", "nsType", "hiddenType", diff --git a/src/core/server/saved_objects/types.ts b/src/core/server/saved_objects/types.ts index 495d896ad12cd..1d927211b43e5 100644 --- a/src/core/server/saved_objects/types.ts +++ b/src/core/server/saved_objects/types.ts @@ -21,7 +21,6 @@ import { SavedObjectsClient } from './service/saved_objects_client'; import { SavedObjectsTypeMappingDefinition, SavedObjectsTypeMappingDefinitions } from './mappings'; import { SavedObjectMigrationMap } from './migrations'; import { PropertyValidators } from './validation'; -import { SavedObjectsManagementDefinition } from './management'; export { SavedObjectsImportResponse, @@ -62,7 +61,6 @@ export interface SavedObjectsMigrationVersion { } /** - * * @public */ export interface SavedObject { @@ -247,6 +245,50 @@ export interface SavedObjectsType { * An optional map of {@link SavedObjectMigrationFn | migrations} to be used to migrate the type. */ migrations?: SavedObjectMigrationMap; + /** + * An optional {@link SavedObjectsTypeManagementDefinition | saved objects management section} definition for the type. + */ + management?: SavedObjectsTypeManagementDefinition; +} + +/** + * Configuration options for the {@link SavedObjectsType | type}'s management section. + * + * @public + */ +export interface SavedObjectsTypeManagementDefinition { + /** + * Is the type importable or exportable. Defaults to `false`. + */ + importableAndExportable?: boolean; + /** + * The default search field to use for this type. Defaults to `id`. + */ + defaultSearchField?: string; + /** + * The eui icon name to display in the management table. + * If not defined, the default icon will be used. + */ + icon?: string; + /** + * Function returning the title to display in the management table. + * If not defined, will use the object's type and id to generate a label. + */ + getTitle?: (savedObject: SavedObject) => string; + /** + * Function returning the url to use to redirect to the editing page of this object. + * If not defined, editing will not be allowed. + */ + getEditUrl?: (savedObject: SavedObject) => string; + /** + * Function returning the url to use to redirect to this object from the management section. + * If not defined, redirecting to the object will not be allowed. + * + * @returns an object containing a `path` and `uiCapabilitiesPath` properties. the `path` is the path to + * the object page, relative to the base path. `uiCapabilitiesPath` is the path to check in the + * {@link Capabilities | uiCapabilities} to check if the user has permission to access the object. + */ + getInAppUrl?: (savedObject: SavedObject) => { path: string; uiCapabilitiesPath: string }; } /** @@ -258,7 +300,7 @@ export interface SavedObjectsLegacyUiExports { savedObjectMigrations: SavedObjectsLegacyMigrationDefinitions; savedObjectSchemas: SavedObjectsLegacySchemaDefinitions; savedObjectValidations: PropertyValidators; - savedObjectsManagement: SavedObjectsManagementDefinition; + savedObjectsManagement: SavedObjectsLegacyManagementDefinition; } /** @@ -270,6 +312,28 @@ export interface SavedObjectsLegacyMapping { properties: SavedObjectsTypeMappingDefinitions; } +/** + * @internal + * @deprecated Use {@link SavedObjectsTypeManagementDefinition | management definition} when registering + * from new platform plugins + */ +export interface SavedObjectsLegacyManagementDefinition { + [key: string]: SavedObjectsLegacyManagementTypeDefinition; +} + +/** + * @internal + * @deprecated + */ +export interface SavedObjectsLegacyManagementTypeDefinition { + isImportableAndExportable?: boolean; + defaultSearchField?: string; + icon?: string; + getTitle?: (savedObject: SavedObject) => string; + getEditUrl?: (savedObject: SavedObject) => string; + getInAppUrl?: (savedObject: SavedObject) => { path: string; uiCapabilitiesPath: string }; +} + /** * @internal * @deprecated diff --git a/src/core/server/saved_objects/utils.test.ts b/src/core/server/saved_objects/utils.test.ts index 0a56535ac8509..0719fe7138e8a 100644 --- a/src/core/server/saved_objects/utils.test.ts +++ b/src/core/server/saved_objects/utils.test.ts @@ -235,6 +235,75 @@ describe('convertLegacyTypes', () => { expect(legacyMigration).toHaveBeenCalledWith(doc, context.log); }); + it('imports type management information', () => { + const uiExports: SavedObjectsLegacyUiExports = { + savedObjectMappings: [ + { + pluginId: 'pluginA', + properties: { + typeA: { + properties: { + fieldA: { type: 'text' }, + }, + }, + }, + }, + { + pluginId: 'pluginB', + properties: { + typeB: { + properties: { + fieldB: { type: 'text' }, + }, + }, + typeC: { + properties: { + fieldC: { type: 'text' }, + }, + }, + }, + }, + ], + savedObjectsManagement: { + typeA: { + isImportableAndExportable: true, + icon: 'iconA', + defaultSearchField: 'searchFieldA', + getTitle: savedObject => savedObject.id, + }, + typeB: { + isImportableAndExportable: false, + icon: 'iconB', + getEditUrl: savedObject => `/some-url/${savedObject.id}`, + getInAppUrl: savedObject => ({ path: 'path', uiCapabilitiesPath: 'ui-path' }), + }, + }, + savedObjectMigrations: {}, + savedObjectSchemas: {}, + savedObjectValidations: {}, + }; + + const converted = convertLegacyTypes(uiExports, legacyConfig); + expect(converted.length).toEqual(3); + const [typeA, typeB, typeC] = converted; + + expect(typeA.management).toEqual({ + importableAndExportable: true, + icon: 'iconA', + defaultSearchField: 'searchFieldA', + getTitle: uiExports.savedObjectsManagement.typeA.getTitle, + }); + + expect(typeB.management).toEqual({ + importableAndExportable: false, + icon: 'iconB', + getEditUrl: uiExports.savedObjectsManagement.typeB.getEditUrl, + getInAppUrl: uiExports.savedObjectsManagement.typeB.getInAppUrl, + }); + + expect(typeC.management).toBeUndefined(); + }); + it('merges everything when all are present', () => { const uiExports: SavedObjectsLegacyUiExports = { savedObjectMappings: [ diff --git a/src/core/server/saved_objects/utils.ts b/src/core/server/saved_objects/utils.ts index bb2c42c6a362c..ea90efd8b9fbd 100644 --- a/src/core/server/saved_objects/utils.ts +++ b/src/core/server/saved_objects/utils.ts @@ -23,6 +23,8 @@ import { SavedObjectsType, SavedObjectsLegacyUiExports, SavedObjectLegacyMigrationMap, + SavedObjectsLegacyManagementTypeDefinition, + SavedObjectsTypeManagementDefinition, } from './types'; import { SavedObjectsSchemaDefinition } from './schema'; @@ -35,15 +37,17 @@ export const convertLegacyTypes = ( savedObjectMappings = [], savedObjectMigrations = {}, savedObjectSchemas = {}, + savedObjectsManagement = {}, }: SavedObjectsLegacyUiExports, legacyConfig: LegacyConfig ): SavedObjectsType[] => { - return savedObjectMappings.reduce((types, { pluginId, properties }) => { + return savedObjectMappings.reduce((types, { properties }) => { return [ ...types, ...Object.entries(properties).map(([type, mappings]) => { const schema = savedObjectSchemas[type]; const migrations = savedObjectMigrations[type]; + const management = savedObjectsManagement[type]; return { name: type, hidden: schema?.hidden ?? false, @@ -55,6 +59,7 @@ export const convertLegacyTypes = ( : schema?.indexPattern, convertToAliasScript: schema?.convertToAliasScript, migrations: convertLegacyMigrations(migrations ?? {}), + management: management ? convertLegacyTypeManagement(management) : undefined, }; }), ]; @@ -90,3 +95,16 @@ const convertLegacyMigrations = ( }; }, {} as SavedObjectMigrationMap); }; + +const convertLegacyTypeManagement = ( + legacyTypeManagement: SavedObjectsLegacyManagementTypeDefinition +): SavedObjectsTypeManagementDefinition => { + return { + importableAndExportable: legacyTypeManagement.isImportableAndExportable, + defaultSearchField: legacyTypeManagement.defaultSearchField, + icon: legacyTypeManagement.icon, + getTitle: legacyTypeManagement.getTitle, + getEditUrl: legacyTypeManagement.getEditUrl, + getInAppUrl: legacyTypeManagement.getInAppUrl, + }; +}; diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md index 8c5e84446a0d3..5ede98a1e6e6d 100644 --- a/src/core/server/server.api.md +++ b/src/core/server/server.api.md @@ -419,7 +419,26 @@ export type AuthenticationHandler = (request: KibanaRequest, response: Lifecycle export type AuthHeaders = Record; // @public (undocumented) -export type AuthResult = Authenticated; +export interface AuthNotHandled { + // (undocumented) + type: AuthResultType.notHandled; +} + +// @public (undocumented) +export interface AuthRedirected extends AuthRedirectedParams { + // (undocumented) + type: AuthResultType.redirected; +} + +// @public +export interface AuthRedirectedParams { + headers: { + location: string; + } & ResponseHeaders; +} + +// @public (undocumented) +export type AuthResult = Authenticated | AuthNotHandled | AuthRedirected; // @public export interface AuthResultParams { @@ -431,7 +450,11 @@ export interface AuthResultParams { // @public (undocumented) export enum AuthResultType { // (undocumented) - authenticated = "authenticated" + authenticated = "authenticated", + // (undocumented) + notHandled = "notHandled", + // (undocumented) + redirected = "redirected" } // @public @@ -444,6 +467,10 @@ export enum AuthStatus { // @public export interface AuthToolkit { authenticated: (data?: AuthResultParams) => AuthResult; + notHandled: () => AuthResult; + redirected: (headers: { + location: string; + } & ResponseHeaders) => AuthResult; } // @public @@ -606,6 +633,8 @@ export interface CoreSetup { // (undocumented) http: HttpServiceSetup; // (undocumented) + metrics: MetricsServiceSetup; + // (undocumented) savedObjects: SavedObjectsServiceSetup; // (undocumented) uiSettings: UiSettingsServiceSetup; @@ -766,6 +795,9 @@ export interface ErrorHttpResponseOptions { headers?: ResponseHeaders; } +// @public +export function exportSavedObjectsToStream({ types, objects, search, savedObjectsClient, exportSizeLimit, includeReferencesDeep, excludeExportDetails, namespace, }: SavedObjectsExportOptions): Promise; + // @public export interface FakeRequest { headers: Headers; @@ -894,6 +926,9 @@ export interface ImageValidation { }; } +// @public +export function importSavedObjectsFromStream({ readStream, objectLimit, overwrite, savedObjectsClient, supportedTypes, namespace, }: SavedObjectsImportOptions): Promise; + // @public (undocumented) export interface IndexSettingsDeprecationInfo { // (undocumented) @@ -933,7 +968,7 @@ export type IsAuthenticated = (request: KibanaRequest | LegacyRequest) => boolea export type ISavedObjectsRepository = Pick; // @public -export type ISavedObjectTypeRegistry = Pick; +export type ISavedObjectTypeRegistry = Pick; // @public export type IScopedClusterClient = Pick; @@ -962,6 +997,10 @@ export class KibanaRequest = IContextProvider, TContextName>; +// @public +export function resolveSavedObjectsImportErrors({ readStream, objectLimit, retries, savedObjectsClient, supportedTypes, namespace, }: SavedObjectsResolveImportErrorsOptions): Promise; + // @public export type ResponseError = string | Error | { message: string | Error; @@ -1459,7 +1502,7 @@ export interface RouteConfig { // @public export interface RouteConfigOptions { - authRequired?: boolean; + authRequired?: boolean | 'optional'; body?: Method extends 'get' | 'options' ? undefined : RouteConfigOptionsBody; tags?: readonly string[]; xsrfRequired?: Method extends 'get' ? never : boolean; @@ -1896,17 +1939,11 @@ export interface SavedObjectsImportMissingReferencesError { // @public export interface SavedObjectsImportOptions { - // (undocumented) namespace?: string; - // (undocumented) objectLimit: number; - // (undocumented) overwrite: boolean; - // (undocumented) readStream: Readable; - // (undocumented) savedObjectsClient: SavedObjectsClientContract; - // (undocumented) supportedTypes: string[]; } @@ -2060,17 +2097,11 @@ export interface SavedObjectsRepositoryFactory { // @public export interface SavedObjectsResolveImportErrorsOptions { - // (undocumented) namespace?: string; - // (undocumented) objectLimit: number; - // (undocumented) readStream: Readable; - // (undocumented) retries: SavedObjectsImportRetry[]; - // (undocumented) savedObjectsClient: SavedObjectsClientContract; - // (undocumented) supportedTypes: string[]; } @@ -2101,6 +2132,7 @@ export class SavedObjectsSerializer { // @public export interface SavedObjectsServiceSetup { addClientWrapper: (priority: number, id: string, factory: SavedObjectsClientWrapperFactory) => void; + getImportExportObjectLimit: () => number; registerType: (type: SavedObjectsType) => void; setClientFactoryProvider: (clientFactoryProvider: SavedObjectsClientFactoryProvider) => void; } @@ -2119,12 +2151,26 @@ export interface SavedObjectsType { convertToAliasScript?: string; hidden: boolean; indexPattern?: string; + management?: SavedObjectsTypeManagementDefinition; mappings: SavedObjectsTypeMappingDefinition; migrations?: SavedObjectMigrationMap; name: string; namespaceAgnostic: boolean; } +// @public +export interface SavedObjectsTypeManagementDefinition { + defaultSearchField?: string; + getEditUrl?: (savedObject: SavedObject) => string; + getInAppUrl?: (savedObject: SavedObject) => { + path: string; + uiCapabilitiesPath: string; + }; + getTitle?: (savedObject: SavedObject) => string; + icon?: string; + importableAndExportable?: boolean; +} + // @public export interface SavedObjectsTypeMappingDefinition { dynamic?: false | 'strict'; @@ -2149,9 +2195,11 @@ export interface SavedObjectsUpdateResponse extends Omit { + let service: UiSettingsService; + let setupDeps: SetupDeps; + let savedObjectsClient: ReturnType; + + beforeEach(() => { + const coreContext = mockCoreContext.create(); + coreContext.configService.atPath.mockReturnValue(new BehaviorSubject({ overrides })); + const httpSetup = httpServiceMock.createSetupContract(); + const savedObjectsSetup = savedObjectsServiceMock.createInternalSetupContract(); + setupDeps = { http: httpSetup, savedObjects: savedObjectsSetup }; + savedObjectsClient = savedObjectsClientMock.create(); + service = new UiSettingsService(coreContext); + }); -afterEach(() => { - MockUiSettingsClientConstructor.mockClear(); -}); + afterEach(() => { + MockUiSettingsClientConstructor.mockClear(); + }); -describe('uiSettings', () => { describe('#setup', () => { + it('registers the uiSettings type to the savedObjects registry', async () => { + await service.setup(setupDeps); + expect(setupDeps.savedObjects.registerType).toHaveBeenCalledTimes(1); + expect(setupDeps.savedObjects.registerType).toHaveBeenCalledWith(uiSettingsType); + }); + describe('#asScopedToClient', () => { it('passes saved object type "config" to UiSettingsClient', async () => { - const service = new UiSettingsService(coreContext); const setup = await service.setup(setupDeps); setup.asScopedToClient(savedObjectsClient); expect(MockUiSettingsClientConstructor).toBeCalledTimes(1); @@ -60,7 +73,6 @@ describe('uiSettings', () => { }); it('passes overrides to UiSettingsClient', async () => { - const service = new UiSettingsService(coreContext); const setup = await service.setup(setupDeps); setup.asScopedToClient(savedObjectsClient); expect(MockUiSettingsClientConstructor).toBeCalledTimes(1); @@ -69,7 +81,6 @@ describe('uiSettings', () => { }); it('passes a copy of set defaults to UiSettingsClient', async () => { - const service = new UiSettingsService(coreContext); const setup = await service.setup(setupDeps); setup.register(defaults); @@ -83,7 +94,6 @@ describe('uiSettings', () => { describe('#register', () => { it('throws if registers the same key twice', async () => { - const service = new UiSettingsService(coreContext); const setup = await service.setup(setupDeps); setup.register(defaults); expect(() => setup.register(defaults)).toThrowErrorMatchingInlineSnapshot( @@ -96,7 +106,6 @@ describe('uiSettings', () => { describe('#start', () => { describe('#asScopedToClient', () => { it('passes saved object type "config" to UiSettingsClient', async () => { - const service = new UiSettingsService(coreContext); await service.setup(setupDeps); const start = await service.start(); start.asScopedToClient(savedObjectsClient); @@ -106,7 +115,6 @@ describe('uiSettings', () => { }); it('passes overrides to UiSettingsClient', async () => { - const service = new UiSettingsService(coreContext); await service.setup(setupDeps); const start = await service.start(); start.asScopedToClient(savedObjectsClient); @@ -116,7 +124,6 @@ describe('uiSettings', () => { }); it('passes a copy of set defaults to UiSettingsClient', async () => { - const service = new UiSettingsService(coreContext); const setup = await service.setup(setupDeps); setup.register(defaults); const start = await service.start(); diff --git a/src/core/server/ui_settings/ui_settings_service.ts b/src/core/server/ui_settings/ui_settings_service.ts index 942c2625ac8e7..de2cc9d510e0c 100644 --- a/src/core/server/ui_settings/ui_settings_service.ts +++ b/src/core/server/ui_settings/ui_settings_service.ts @@ -24,6 +24,7 @@ import { CoreContext } from '../core_context'; import { Logger } from '../logging'; import { SavedObjectsClientContract } from '../saved_objects/types'; +import { InternalSavedObjectsServiceSetup } from '../saved_objects'; import { InternalHttpServiceSetup } from '../http'; import { UiSettingsConfigType, config as uiConfigDefinition } from './ui_settings_config'; import { UiSettingsClient } from './ui_settings_client'; @@ -33,11 +34,12 @@ import { UiSettingsParams, } from './types'; import { mapToObject } from '../../utils/'; - +import { uiSettingsType } from './saved_objects'; import { registerRoutes } from './routes'; -interface SetupDeps { +export interface SetupDeps { http: InternalHttpServiceSetup; + savedObjects: InternalSavedObjectsServiceSetup; } /** @internal */ @@ -53,9 +55,11 @@ export class UiSettingsService this.config$ = coreContext.configService.atPath(uiConfigDefinition.path); } - public async setup(deps: SetupDeps): Promise { - registerRoutes(deps.http.createRouter('')); + public async setup({ http, savedObjects }: SetupDeps): Promise { this.log.debug('Setting up ui settings service'); + + savedObjects.registerType(uiSettingsType); + registerRoutes(http.createRouter('')); const config = await this.config$.pipe(first()).toPromise(); this.overrides = config.overrides; diff --git a/src/dev/jest/config.js b/src/dev/jest/config.js index 807a3fbf4782b..e54384be7323f 100644 --- a/src/dev/jest/config.js +++ b/src/dev/jest/config.js @@ -68,7 +68,10 @@ export default { '/src/dev/jest/setup/polyfills.js', '/src/dev/jest/setup/enzyme.js', ], - setupFilesAfterEnv: ['/src/dev/jest/setup/mocks.js'], + setupFilesAfterEnv: [ + '/src/dev/jest/setup/mocks.js', + '/src/dev/jest/setup/react_testing_library.js', + ], coverageDirectory: '/target/kibana-coverage/jest', coverageReporters: !!process.env.CODE_COVERAGE ? ['json'] : ['html', 'text'], moduleFileExtensions: ['js', 'json', 'ts', 'tsx'], diff --git a/src/dev/jest/setup/react_testing_library.js b/src/dev/jest/setup/react_testing_library.js new file mode 100644 index 0000000000000..879292b540ba6 --- /dev/null +++ b/src/dev/jest/setup/react_testing_library.js @@ -0,0 +1,32 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import '@testing-library/jest-dom/extend-expect'; +/** + * Have to import "/pure" here to not register afterEach() hook clean up + * in the very beginning. There are couple tests which fail with clean up hook. + * On CI they run before first test which imports '@testing-library/react' + * and registers afterEach hook so the whole suite is passing. + * This have to be fixed as we depend on test order execution + * https://github.com/elastic/kibana/issues/59469 + */ +import { configure } from '@testing-library/react/pure'; + +// instead of default 'data-testid', use kibana's 'data-test-subj' +configure({ testIdAttribute: 'data-test-subj' }); diff --git a/src/dev/run_check_core_api_changes.ts b/src/dev/run_check_core_api_changes.ts deleted file mode 100644 index 48f31c261c445..0000000000000 --- a/src/dev/run_check_core_api_changes.ts +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { ToolingLog } from '@kbn/dev-utils'; -import { - Extractor, - IConfigFile, - ExtractorLogLevel, - ExtractorConfig, - ExtractorResult, - ExtractorMessage, -} from '@microsoft/api-extractor'; -import chalk from 'chalk'; -import dedent from 'dedent'; -import execa from 'execa'; -import fs from 'fs'; -import path from 'path'; -import getopts from 'getopts'; - -const apiExtractorConfig = (folder: string): ExtractorConfig => { - const config: IConfigFile = { - newlineKind: 'lf', - compiler: { - tsconfigFilePath: '/tsconfig.json', - }, - projectFolder: path.resolve('./'), - mainEntryPointFilePath: `target/types/core/${folder}/index.d.ts`, - apiReport: { - enabled: true, - reportFileName: `${folder}.api.md`, - reportFolder: `/src/core/${folder}/`, - reportTempFolder: `/build/${folder}/`, - }, - docModel: { - enabled: true, - apiJsonFilePath: `./build/${folder}/${folder}.api.json`, - }, - tsdocMetadata: { - enabled: false, - }, - messages: { - extractorMessageReporting: { - default: { - logLevel: 'warning' as ExtractorLogLevel.Warning, - addToApiReportFile: true, - }, - 'ae-internal-missing-underscore': { - logLevel: 'none' as ExtractorLogLevel.None, - addToApiReportFile: false, - }, - }, - }, - }; - const con = ExtractorConfig.prepare({ - configObject: config, - configObjectFullPath: undefined, - packageJsonFullPath: path.resolve('package.json'), - }); - - return con; -}; - -const runBuildTypes = async () => { - await execa('yarn', ['run', 'build:types']); -}; - -const runApiDocumenter = async (folder: string) => { - await execa( - 'api-documenter', - ['generate', '-i', `./build/${folder}`, '-o', `./docs/development/core/${folder}`], - { - preferLocal: true, - } - ); -}; - -const renameExtractedApiPackageName = async (folder: string) => { - const json = JSON.parse(fs.readFileSync(`build/${folder}/${folder}.api.json`).toString()); - json.canonicalReference = `kibana-plugin-${folder}`; - json.name = `kibana-plugin-${folder}`; - fs.writeFileSync(`build/${folder}/${folder}.api.json`, JSON.stringify(json, null, 2)); -}; - -/** - * Runs api-extractor with a custom logger in order to extract results from the process - * - */ -const runApiExtractor = ( - log: ToolingLog, - folder: string, - acceptChanges: boolean = false -): ExtractorResult => { - const config = apiExtractorConfig(folder); - const options = { - // Indicates that API Extractor is running as part of a local build, - // e.g. on developer's machine. For example, if the *.api.md output file - // has differences, it will be automatically overwritten for a - // local build, whereas this should report an error for a production build. - localBuild: acceptChanges, - messageCallback: (message: ExtractorMessage) => { - if (message.messageId === 'console-api-report-not-copied') { - // ConsoleMessageId.ApiReportNotCopied - log.warning(`You have changed the signature of the ${folder} Core API`); - log.warning( - 'To accept these changes run `node scripts/check_core_api_changes.js --accept` and then:\n' + - "\t 1. Commit the updated documentation and API review file '" + - config.reportFilePath + - "' \n" + - "\t 2. Describe the change in your PR including whether it's a major, minor or patch" - ); - message.handled = true; - } else if (message.messageId === 'console-api-report-copied') { - // ConsoleMessageId.ApiReportCopied - log.warning(`You have changed the signature of the ${folder} Core API`); - log.warning( - "Please commit the updated API documentation and the API review file: '" + - config.reportFilePath - ); - message.handled = true; - } else if (message.messageId === 'console-api-report-unchanged') { - // ConsoleMessageId.ApiReportUnchanged - log.info(`Core ${folder} API: no changes detected ✔`); - message.handled = true; - } - }, - }; - - return Extractor.invoke(config, options); -}; - -interface Options { - accept: boolean; - docs: boolean; - help: boolean; -} - -async function run( - folder: string, - { log, opts }: { log: ToolingLog; opts: Options } -): Promise { - log.info(`Core ${folder} API: checking for changes in API signature...`); - - const { apiReportChanged, succeeded } = runApiExtractor(log, folder, opts.accept); - - // If we're not accepting changes and there's a failure, exit. - if (!opts.accept && !succeeded) { - return false; - } - - // Attempt to generate docs even if api-extractor didn't succeed - if ((opts.accept && apiReportChanged) || opts.docs) { - try { - await renameExtractedApiPackageName(folder); - await runApiDocumenter(folder); - } catch (e) { - log.error(e); - return false; - } - log.info(`Core ${folder} API: updated documentation ✔`); - } - - // If the api signature changed or any errors or warnings occured, exit with an error - // NOTE: Because of https://github.com/Microsoft/web-build-tools/issues/1258 - // api-extractor will not return `succeeded: false` when the API changes. - return !apiReportChanged && succeeded; -} - -(async () => { - const log = new ToolingLog({ - level: 'info', - writeTo: process.stdout, - }); - - const extraFlags: string[] = []; - const opts = (getopts(process.argv.slice(2), { - boolean: ['accept', 'docs', 'help'], - default: { - project: undefined, - }, - unknown(name) { - extraFlags.push(name); - return false; - }, - }) as any) as Options; - - if (extraFlags.length > 0) { - for (const flag of extraFlags) { - log.error(`Unknown flag: ${flag}`); - } - - opts.help = true; - } - - if (opts.help) { - process.stdout.write( - dedent(chalk` - {dim usage:} node scripts/check_core_api_changes [...options] - - Checks for any changes to the Kibana Core API - - Examples: - - {dim # Checks for any changes to the Kibana Core API} - {dim $} node scripts/check_core_api_changes - - {dim # Checks for any changes to the Kibana Core API and updates the documentation} - {dim $} node scripts/check_core_api_changes --docs - - {dim # Checks for and automatically accepts and updates documentation for any changes to the Kibana Core API} - {dim $} node scripts/check_core_api_changes --accept - - Options: - --accept {dim Accepts all changes by updating the API Review files and documentation} - --docs {dim Updates the Core API documentation} - --help {dim Show this message} - `) - ); - process.stdout.write('\n'); - return !(extraFlags.length > 0); - } - - try { - log.info(`Core: Building types...`); - await runBuildTypes(); - } catch (e) { - log.error(e); - return false; - } - - const folders = ['public', 'server']; - const results = await Promise.all(folders.map(folder => run(folder, { log, opts }))); - - if (results.find(r => r === false) !== undefined) { - process.exitCode = 1; - } -})(); diff --git a/src/dev/run_check_published_api_changes.ts b/src/dev/run_check_published_api_changes.ts new file mode 100644 index 0000000000000..b12638d9b8661 --- /dev/null +++ b/src/dev/run_check_published_api_changes.ts @@ -0,0 +1,271 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* eslint-disable no-console */ + +import { ToolingLog } from '@kbn/dev-utils'; +import { + Extractor, + IConfigFile, + ExtractorLogLevel, + ExtractorConfig, + ExtractorResult, + ExtractorMessage, +} from '@microsoft/api-extractor'; +import chalk from 'chalk'; +import dedent from 'dedent'; +import execa from 'execa'; +import fs from 'fs'; +import path from 'path'; +import getopts from 'getopts'; + +/* + * Step 1: execute build:types + * This users tsconfig.types.json to generate types in `target/types` + * Step 2: run Api Extractor to detect API changes + * Step 3: generate new docs if needed + */ + +const getReportFileName = (folder: string) => { + return folder.indexOf('public') > -1 ? 'public' : 'server'; +}; + +const apiExtractorConfig = (folder: string): ExtractorConfig => { + const fname = getReportFileName(folder); + const config: IConfigFile = { + newlineKind: 'lf', + compiler: { + tsconfigFilePath: '/tsconfig.json', + }, + projectFolder: path.resolve('./'), + mainEntryPointFilePath: `target/types/${folder}/index.d.ts`, + apiReport: { + enabled: true, + reportFileName: `${fname}.api.md`, + reportFolder: `/src/${folder}/`, + reportTempFolder: `/build/${folder}/`, + }, + docModel: { + enabled: true, + apiJsonFilePath: `./build/${folder}/${fname}.api.json`, + }, + tsdocMetadata: { + enabled: false, + }, + messages: { + extractorMessageReporting: { + default: { + logLevel: 'warning' as ExtractorLogLevel.Warning, + addToApiReportFile: true, + }, + 'ae-internal-missing-underscore': { + logLevel: 'none' as ExtractorLogLevel.None, + addToApiReportFile: false, + }, + }, + }, + }; + const con = ExtractorConfig.prepare({ + configObject: config, + configObjectFullPath: undefined, + packageJsonFullPath: path.resolve('package.json'), + }); + + return con; +}; + +const runBuildTypes = async () => { + await execa('yarn', ['run', 'build:types']); +}; + +const runApiDocumenter = async (folder: string) => { + const sourceFolder = `./build/${folder}`; + const targetFolder = `./docs/development/${folder}`; + console.log(`Generating docs from ${sourceFolder} into ${targetFolder}...`); + await execa('api-documenter', ['generate', '-i', sourceFolder, '-o', targetFolder], { + preferLocal: true, + }); +}; + +const renameExtractedApiPackageName = async (folder: string) => { + const fname = getReportFileName(folder); + const jsonApiFile = `build/${folder}/${fname}.api.json`; + console.log(`Updating ${jsonApiFile}...`); + const json = JSON.parse(fs.readFileSync(jsonApiFile).toString()); + json.name = json.canonicalReference = `kibana-plugin-${folder.replace(/\//g, '-')}`; + fs.writeFileSync(jsonApiFile, JSON.stringify(json, null, 2)); +}; + +/** + * Runs api-extractor with a custom logger in order to extract results from the process + * + */ +const runApiExtractor = ( + log: ToolingLog, + folder: string, + acceptChanges: boolean = false +): ExtractorResult => { + const config = apiExtractorConfig(folder); + const options = { + // Indicates that API Extractor is running as part of a local build, + // e.g. on developer's machine. For example, if the *.api.md output file + // has differences, it will be automatically overwritten for a + // local build, whereas this should report an error for a production build. + localBuild: acceptChanges, + messageCallback: (message: ExtractorMessage) => { + if (message.messageId === 'console-api-report-not-copied') { + // ConsoleMessageId.ApiReportNotCopied + log.warning(`You have changed the signature of the ${folder} Core API`); + log.warning( + 'To accept these changes run `node scripts/check_core_api_changes.js --accept` and then:\n' + + "\t 1. Commit the updated documentation and API review file '" + + config.reportFilePath + + "' \n" + + "\t 2. Describe the change in your PR including whether it's a major, minor or patch" + ); + message.handled = true; + } else if (message.messageId === 'console-api-report-copied') { + // ConsoleMessageId.ApiReportCopied + log.warning(`You have changed the signature of the ${folder} Core API`); + log.warning( + "Please commit the updated API documentation and the API review file: '" + + config.reportFilePath + ); + message.handled = true; + } else if (message.messageId === 'console-api-report-unchanged') { + // ConsoleMessageId.ApiReportUnchanged + log.info(`Core ${folder} API: no changes detected ✔`); + message.handled = true; + } + }, + }; + + return Extractor.invoke(config, options); +}; + +interface Options { + accept: boolean; + docs: boolean; + help: boolean; +} + +async function run( + folder: string, + { log, opts }: { log: ToolingLog; opts: Options } +): Promise { + log.info(`Core ${folder} API: checking for changes in API signature...`); + + const { apiReportChanged, succeeded } = runApiExtractor(log, folder, opts.accept); + + // If we're not accepting changes and there's a failure, exit. + if (!opts.accept && !succeeded) { + return false; + } + + // Attempt to generate docs even if api-extractor didn't succeed + if ((opts.accept && apiReportChanged) || opts.docs) { + try { + await renameExtractedApiPackageName(folder); + await runApiDocumenter(folder); + } catch (e) { + log.error(e); + return false; + } + log.info(`Core ${folder} API: updated documentation ✔`); + } + + // If the api signature changed or any errors or warnings occured, exit with an error + // NOTE: Because of https://github.com/Microsoft/web-build-tools/issues/1258 + // api-extractor will not return `succeeded: false` when the API changes. + return !apiReportChanged && succeeded; +} + +(async () => { + const log = new ToolingLog({ + level: 'info', + writeTo: process.stdout, + }); + + const extraFlags: string[] = []; + const opts = (getopts(process.argv.slice(2), { + boolean: ['accept', 'docs', 'help'], + default: { + project: undefined, + }, + unknown(name) { + extraFlags.push(name); + return false; + }, + }) as any) as Options; + + if (extraFlags.length > 0) { + for (const flag of extraFlags) { + log.error(`Unknown flag: ${flag}`); + } + + opts.help = true; + } + + if (opts.help) { + process.stdout.write( + dedent(chalk` + {dim usage:} node scripts/check_core_api_changes [...options] + + Checks for any changes to the Kibana Core API + + Examples: + + {dim # Checks for any changes to the Kibana Core API} + {dim $} node scripts/check_core_api_changes + + {dim # Checks for any changes to the Kibana Core API and updates the documentation} + {dim $} node scripts/check_core_api_changes --docs + + {dim # Checks for and automatically accepts and updates documentation for any changes to the Kibana Core API} + {dim $} node scripts/check_core_api_changes --accept + + Options: + --accept {dim Accepts all changes by updating the API Review files and documentation} + --docs {dim Updates the Core API documentation} + --help {dim Show this message} + `) + ); + process.stdout.write('\n'); + return !(extraFlags.length > 0); + } + + try { + log.info(`Core: Building types...`); + await runBuildTypes(); + } catch (e) { + log.error(e); + return false; + } + + const folders = ['core/public', 'core/server', 'plugins/data/server', 'plugins/data/public']; + + const results = await Promise.all(folders.map(folder => run(folder, { log, opts }))); + + if (results.find(r => r === false) !== undefined) { + process.exitCode = 1; + } +})().catch(e => { + console.log(e); + process.exitCode = 1; +}); diff --git a/src/dev/storybook/aliases.ts b/src/dev/storybook/aliases.ts index 35ac4e27f9c8b..8ed64f004c9be 100644 --- a/src/dev/storybook/aliases.ts +++ b/src/dev/storybook/aliases.ts @@ -25,4 +25,5 @@ export const storybookAliases = { embeddable: 'src/plugins/embeddable/scripts/storybook.js', infra: 'x-pack/legacy/plugins/infra/scripts/storybook.js', siem: 'x-pack/legacy/plugins/siem/scripts/storybook.js', + ui_actions: 'x-pack/plugins/advanced_ui_actions/scripts/storybook.js', }; diff --git a/src/legacy/core_plugins/data/public/actions/filters/create_filters_from_event.js b/src/legacy/core_plugins/data/public/actions/filters/create_filters_from_event.js deleted file mode 100644 index 1037c718d0003..0000000000000 --- a/src/legacy/core_plugins/data/public/actions/filters/create_filters_from_event.js +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { esFilters } from '../../../../../../plugins/data/public'; -import { deserializeAggConfig } from '../../search/expressions/utils'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { getIndexPatterns } from '../../../../../../plugins/data/public/services'; - -/** - * For terms aggregations on `__other__` buckets, this assembles a list of applicable filter - * terms based on a specific cell in the tabified data. - * - * @param {object} table - tabified table data - * @param {number} columnIndex - current column index - * @param {number} rowIndex - current row index - * @return {array} - array of terms to filter against - */ -const getOtherBucketFilterTerms = (table, columnIndex, rowIndex) => { - if (rowIndex === -1) { - return []; - } - - // get only rows where cell value matches current row for all the fields before columnIndex - const rows = table.rows.filter(row => { - return table.columns.every((column, i) => { - return row[column.id] === table.rows[rowIndex][column.id] || i >= columnIndex; - }); - }); - const terms = rows.map(row => row[table.columns[columnIndex].id]); - - return [ - ...new Set( - terms.filter(term => { - const notOther = term !== '__other__'; - const notMissing = term !== '__missing__'; - return notOther && notMissing; - }) - ), - ]; -}; - -/** - * Assembles the filters needed to apply filtering against a specific cell value, while accounting - * for cases like if the value is a terms agg in an `__other__` or `__missing__` bucket. - * - * @param {object} table - tabified table data - * @param {number} columnIndex - current column index - * @param {number} rowIndex - current row index - * @param {string} cellValue - value of the current cell - * @return {array|string} - filter or list of filters to provide to queryFilter.addFilters() - */ -const createFilter = async (table, columnIndex, rowIndex) => { - if (!table || !table.columns || !table.columns[columnIndex]) return; - const column = table.columns[columnIndex]; - const aggConfig = deserializeAggConfig({ - type: column.meta.type, - aggConfigParams: column.meta.aggConfigParams, - indexPattern: await getIndexPatterns().get(column.meta.indexPatternId), - }); - let filter = []; - const value = rowIndex > -1 ? table.rows[rowIndex][column.id] : null; - if (value === null || value === undefined || !aggConfig.isFilterable()) { - return; - } - if (aggConfig.type.name === 'terms' && aggConfig.params.otherBucket) { - const terms = getOtherBucketFilterTerms(table, columnIndex, rowIndex); - filter = aggConfig.createFilter(value, { terms }); - } else { - filter = aggConfig.createFilter(value); - } - - if (!Array.isArray(filter)) { - filter = [filter]; - } - - return filter; -}; - -const createFiltersFromEvent = async event => { - const filters = []; - const dataPoints = event.data || [event]; - - await Promise.all( - dataPoints - .filter(point => point) - .map(async val => { - const { table, column, row } = val; - const filter = await createFilter(table, column, row); - if (filter) { - filter.forEach(f => { - if (event.negate) { - f = esFilters.toggleFilterNegated(f); - } - filters.push(f); - }); - } - }) - ); - - return filters; -}; - -export { createFilter, createFiltersFromEvent }; diff --git a/src/legacy/core_plugins/data/public/actions/filters/create_filters_from_event.test.ts b/src/legacy/core_plugins/data/public/actions/filters/create_filters_from_event.test.ts new file mode 100644 index 0000000000000..bfba4d7f4c8da --- /dev/null +++ b/src/legacy/core_plugins/data/public/actions/filters/create_filters_from_event.test.ts @@ -0,0 +1,119 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { + fieldFormats, + FieldFormatsGetConfigFn, + esFilters, + IndexPatternsContract, +} from '../../../../../../plugins/data/public'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { setIndexPatterns } from '../../../../../../plugins/data/public/services'; +import { dataPluginMock } from '../../../../../../plugins/data/public/mocks'; +import { createFiltersFromEvent, EventData } from './create_filters_from_event'; +import { mockDataServices } from '../../search/aggs/test_helpers'; + +jest.mock('ui/new_platform'); + +const mockField = { + name: 'bytes', + indexPattern: { + id: 'logstash-*', + }, + filterable: true, + format: new fieldFormats.BytesFormat({}, (() => {}) as FieldFormatsGetConfigFn), +}; + +describe('createFiltersFromEvent', () => { + let dataPoints: EventData[]; + + beforeEach(() => { + dataPoints = [ + { + table: { + columns: [ + { + name: 'test', + id: '1-1', + meta: { + type: 'histogram', + indexPatternId: 'logstash-*', + aggConfigParams: { + field: 'bytes', + interval: 30, + otherBucket: true, + }, + }, + }, + ], + rows: [ + { + '1-1': '2048', + }, + ], + }, + column: 0, + row: 0, + value: 'test', + }, + ]; + + mockDataServices(); + setIndexPatterns(({ + ...dataPluginMock.createStartContract().indexPatterns, + get: async () => ({ + id: 'logstash-*', + fields: { + getByName: () => mockField, + filter: () => [mockField], + }, + }), + } as unknown) as IndexPatternsContract); + }); + + test('ignores event when value for rows is not provided', async () => { + dataPoints[0].table.rows[0]['1-1'] = null; + const filters = await createFiltersFromEvent(dataPoints); + + expect(filters.length).toEqual(0); + }); + + test('handles an event when aggregations type is a terms', async () => { + if (dataPoints[0].table.columns[0].meta) { + dataPoints[0].table.columns[0].meta.type = 'terms'; + } + const filters = await createFiltersFromEvent(dataPoints); + + expect(filters.length).toEqual(1); + expect(filters[0].query.match_phrase.bytes).toEqual('2048'); + }); + + test('handles an event when aggregations type is not terms', async () => { + const filters = await createFiltersFromEvent(dataPoints); + + expect(filters.length).toEqual(1); + + const [rangeFilter] = filters; + + if (esFilters.isRangeFilter(rangeFilter)) { + expect(rangeFilter.range.bytes.gte).toEqual(2048); + expect(rangeFilter.range.bytes.lt).toEqual(2078); + } + }); +}); diff --git a/src/legacy/core_plugins/data/public/actions/filters/create_filters_from_event.ts b/src/legacy/core_plugins/data/public/actions/filters/create_filters_from_event.ts new file mode 100644 index 0000000000000..3713c781b0958 --- /dev/null +++ b/src/legacy/core_plugins/data/public/actions/filters/create_filters_from_event.ts @@ -0,0 +1,139 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { KibanaDatatable } from '../../../../../../plugins/expressions/public'; +import { esFilters, Filter } from '../../../../../../plugins/data/public'; +import { deserializeAggConfig } from '../../search/expressions/utils'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { getIndexPatterns } from '../../../../../../plugins/data/public/services'; + +export interface EventData { + table: Pick; + column: number; + row: number; + value: any; +} + +/** + * For terms aggregations on `__other__` buckets, this assembles a list of applicable filter + * terms based on a specific cell in the tabified data. + * + * @param {EventData['table']} table - tabified table data + * @param {number} columnIndex - current column index + * @param {number} rowIndex - current row index + * @return {array} - array of terms to filter against + */ +const getOtherBucketFilterTerms = ( + table: EventData['table'], + columnIndex: number, + rowIndex: number +) => { + if (rowIndex === -1) { + return []; + } + + // get only rows where cell value matches current row for all the fields before columnIndex + const rows = table.rows.filter(row => { + return table.columns.every((column, i) => { + return row[column.id] === table.rows[rowIndex][column.id] || i >= columnIndex; + }); + }); + const terms: any[] = rows.map(row => row[table.columns[columnIndex].id]); + + return [ + ...new Set( + terms.filter(term => { + const notOther = term !== '__other__'; + const notMissing = term !== '__missing__'; + return notOther && notMissing; + }) + ), + ]; +}; + +/** + * Assembles the filters needed to apply filtering against a specific cell value, while accounting + * for cases like if the value is a terms agg in an `__other__` or `__missing__` bucket. + * + * @param {EventData['table']} table - tabified table data + * @param {number} columnIndex - current column index + * @param {number} rowIndex - current row index + * @param {string} cellValue - value of the current cell + * @return {Filter[]|undefined} - list of filters to provide to queryFilter.addFilters() + */ +const createFilter = async (table: EventData['table'], columnIndex: number, rowIndex: number) => { + if (!table || !table.columns || !table.columns[columnIndex]) { + return; + } + const column = table.columns[columnIndex]; + if (!column.meta || !column.meta.indexPatternId) { + return; + } + const aggConfig = deserializeAggConfig({ + type: column.meta.type, + aggConfigParams: column.meta.aggConfigParams ? column.meta.aggConfigParams : {}, + indexPattern: await getIndexPatterns().get(column.meta.indexPatternId), + }); + let filter: Filter[] = []; + const value: any = rowIndex > -1 ? table.rows[rowIndex][column.id] : null; + if (value === null || value === undefined || !aggConfig.isFilterable()) { + return; + } + if (aggConfig.type.name === 'terms' && aggConfig.params.otherBucket) { + const terms = getOtherBucketFilterTerms(table, columnIndex, rowIndex); + filter = aggConfig.createFilter(value, { terms }); + } else { + filter = aggConfig.createFilter(value); + } + + if (!filter) { + return; + } + + if (!Array.isArray(filter)) { + filter = [filter]; + } + + return filter; +}; + +const createFiltersFromEvent = async (dataPoints: EventData[], negate?: boolean) => { + const filters: Filter[] = []; + + await Promise.all( + dataPoints + .filter(point => point) + .map(async val => { + const { table, column, row } = val; + const filter: Filter[] = (await createFilter(table, column, row)) || []; + if (filter) { + filter.forEach(f => { + if (negate) { + f = esFilters.toggleFilterNegated(f); + } + filters.push(f); + }); + } + }) + ); + + return filters; +}; + +export { createFilter, createFiltersFromEvent }; diff --git a/src/legacy/core_plugins/data/public/actions/select_range_action.ts b/src/legacy/core_plugins/data/public/actions/select_range_action.ts index 7f1c5d78ab800..21046f8bb834f 100644 --- a/src/legacy/core_plugins/data/public/actions/select_range_action.ts +++ b/src/legacy/core_plugins/data/public/actions/select_range_action.ts @@ -19,21 +19,21 @@ import { i18n } from '@kbn/i18n'; import { - Action, createAction, IncompatibleActionError, + ActionByType, } from '../../../../../plugins/ui_actions/public'; import { onBrushEvent } from './filters/brush_event'; import { FilterManager, TimefilterContract, esFilters } from '../../../../../plugins/data/public'; -export const SELECT_RANGE_ACTION = 'SELECT_RANGE_ACTION'; +export const ACTION_SELECT_RANGE = 'ACTION_SELECT_RANGE'; -interface ActionContext { +export interface SelectRangeActionContext { data: any; timeFieldName: string; } -async function isCompatible(context: ActionContext) { +async function isCompatible(context: SelectRangeActionContext) { try { return Boolean(await onBrushEvent(context.data)); } catch { @@ -44,17 +44,17 @@ async function isCompatible(context: ActionContext) { export function selectRangeAction( filterManager: FilterManager, timeFilter: TimefilterContract -): Action { - return createAction({ - type: SELECT_RANGE_ACTION, - id: SELECT_RANGE_ACTION, +): ActionByType { + return createAction({ + type: ACTION_SELECT_RANGE, + id: ACTION_SELECT_RANGE, getDisplayName: () => { return i18n.translate('data.filter.applyFilterActionTitle', { defaultMessage: 'Apply filter to current view', }); }, isCompatible, - execute: async ({ timeFieldName, data }: ActionContext) => { + execute: async ({ timeFieldName, data }: SelectRangeActionContext) => { if (!(await isCompatible({ timeFieldName, data }))) { throw new IncompatibleActionError(); } diff --git a/src/legacy/core_plugins/data/public/actions/value_click_action.ts b/src/legacy/core_plugins/data/public/actions/value_click_action.ts index 260b401e6d658..4c69bc8262922 100644 --- a/src/legacy/core_plugins/data/public/actions/value_click_action.ts +++ b/src/legacy/core_plugins/data/public/actions/value_click_action.ts @@ -20,7 +20,7 @@ import { i18n } from '@kbn/i18n'; import { toMountPoint } from '../../../../../plugins/kibana_react/public'; import { - Action, + ActionByType, createAction, IncompatibleActionError, } from '../../../../../plugins/ui_actions/public'; @@ -37,16 +37,18 @@ import { esFilters, } from '../../../../../plugins/data/public'; -export const VALUE_CLICK_ACTION = 'VALUE_CLICK_ACTION'; +export const ACTION_VALUE_CLICK = 'ACTION_VALUE_CLICK'; -interface ActionContext { +export interface ValueClickActionContext { data: any; timeFieldName: string; } -async function isCompatible(context: ActionContext) { +async function isCompatible(context: ValueClickActionContext) { try { - const filters: Filter[] = (await createFiltersFromEvent(context.data)) || []; + const filters: Filter[] = + (await createFiltersFromEvent(context.data.data || [context.data], context.data.negate)) || + []; return filters.length > 0; } catch { return false; @@ -56,22 +58,23 @@ async function isCompatible(context: ActionContext) { export function valueClickAction( filterManager: FilterManager, timeFilter: TimefilterContract -): Action { - return createAction({ - type: VALUE_CLICK_ACTION, - id: VALUE_CLICK_ACTION, +): ActionByType { + return createAction({ + type: ACTION_VALUE_CLICK, + id: ACTION_VALUE_CLICK, getDisplayName: () => { return i18n.translate('data.filter.applyFilterActionTitle', { defaultMessage: 'Apply filter to current view', }); }, isCompatible, - execute: async ({ timeFieldName, data }: ActionContext) => { + execute: async ({ timeFieldName, data }: ValueClickActionContext) => { if (!(await isCompatible({ timeFieldName, data }))) { throw new IncompatibleActionError(); } - const filters: Filter[] = (await createFiltersFromEvent(data)) || []; + const filters: Filter[] = + (await createFiltersFromEvent(data.data || [data], data.negate)) || []; let selectedFilters: Filter[] = esFilters.mapAndFlattenFilters(filters); diff --git a/src/legacy/core_plugins/data/public/index.ts b/src/legacy/core_plugins/data/public/index.ts index 8d730d18a1755..424e5ab0bf4d5 100644 --- a/src/legacy/core_plugins/data/public/index.ts +++ b/src/legacy/core_plugins/data/public/index.ts @@ -44,7 +44,6 @@ export { IFieldParamType, IMetricAggType, IpRangeKey, // only used in field formatter deserialization, which will live in data - ISchemas, OptionedParamEditorProps, // only type is used externally OptionedValueProp, // only type is used externally } from './search/types'; @@ -67,7 +66,6 @@ export { convertIPRangeToString, intervalOptions, // only used in Discover isDateHistogramBucketAggConfig, - setBounds, isStringType, isType, isValidInterval, @@ -76,10 +74,9 @@ export { OptionedParamType, parentPipelineType, propFilter, - Schema, - Schemas, siblingPipelineType, termsAggFilter, + toAbsoluteDates, // search_source getRequestInspectorStats, getResponseInspectorStats, diff --git a/src/legacy/core_plugins/data/public/plugin.ts b/src/legacy/core_plugins/data/public/plugin.ts index e2b8ca5dda78c..18230646ab412 100644 --- a/src/legacy/core_plugins/data/public/plugin.ts +++ b/src/legacy/core_plugins/data/public/plugin.ts @@ -37,8 +37,16 @@ import { // eslint-disable-next-line @kbn/eslint/no-restricted-paths } from '../../../../plugins/data/public/services'; import { setSearchServiceShim } from './services'; -import { SELECT_RANGE_ACTION, selectRangeAction } from './actions/select_range_action'; -import { VALUE_CLICK_ACTION, valueClickAction } from './actions/value_click_action'; +import { + selectRangeAction, + SelectRangeActionContext, + ACTION_SELECT_RANGE, +} from './actions/select_range_action'; +import { + valueClickAction, + ACTION_VALUE_CLICK, + ValueClickActionContext, +} from './actions/value_click_action'; import { SELECT_RANGE_TRIGGER, VALUE_CLICK_TRIGGER, @@ -76,6 +84,12 @@ export interface DataSetup { export interface DataStart { search: SearchStart; } +declare module '../../../../plugins/ui_actions/public' { + export interface ActionContextMapping { + [ACTION_SELECT_RANGE]: SelectRangeActionContext; + [ACTION_VALUE_CLICK]: ValueClickActionContext; + } +} /** * Data Plugin - public @@ -100,10 +114,13 @@ export class DataPlugin // This is to be deprecated once we switch to the new search service fully addSearchStrategy(defaultSearchStrategy); - uiActions.registerAction( + uiActions.attachAction( + SELECT_RANGE_TRIGGER, selectRangeAction(data.query.filterManager, data.query.timefilter.timefilter) ); - uiActions.registerAction( + + uiActions.attachAction( + VALUE_CLICK_TRIGGER, valueClickAction(data.query.filterManager, data.query.timefilter.timefilter) ); @@ -123,9 +140,6 @@ export class DataPlugin setSearchService(data.search); setOverlays(core.overlays); - uiActions.attachAction(SELECT_RANGE_TRIGGER, SELECT_RANGE_ACTION); - uiActions.attachAction(VALUE_CLICK_TRIGGER, VALUE_CLICK_ACTION); - return { search, }; diff --git a/src/legacy/core_plugins/data/public/search/aggs/agg_config.test.ts b/src/legacy/core_plugins/data/public/search/aggs/agg_config.test.ts index 7769aa29184d3..36d5451a4cd00 100644 --- a/src/legacy/core_plugins/data/public/search/aggs/agg_config.test.ts +++ b/src/legacy/core_plugins/data/public/search/aggs/agg_config.test.ts @@ -21,7 +21,7 @@ import { identity } from 'lodash'; import { AggConfig, IAggConfig } from './agg_config'; import { AggConfigs, CreateAggConfigParams } from './agg_configs'; -import { AggType } from './agg_types'; +import { AggType } from './agg_type'; import { AggTypesRegistryStart } from './agg_types_registry'; import { mockDataServices, mockAggTypesRegistry } from './test_helpers'; import { IndexPatternField, IndexPattern } from '../../../../../../plugins/data/public'; @@ -343,8 +343,7 @@ describe('AggConfig', () => { expect(typeof aggConfig.params).toBe('object'); expect(aggConfig.type).toBeInstanceOf(AggType); expect(aggConfig.type).toHaveProperty('name', 'date_histogram'); - expect(typeof aggConfig.schema).toBe('object'); - expect(aggConfig.schema).toHaveProperty('name', 'segment'); + expect(typeof aggConfig.schema).toBe('string'); const state = aggConfig.toJSON(); expect(state).toHaveProperty('id', '1'); diff --git a/src/legacy/core_plugins/data/public/search/aggs/agg_config.ts b/src/legacy/core_plugins/data/public/search/aggs/agg_config.ts index 659bec3f702e3..bf2d2f734c989 100644 --- a/src/legacy/core_plugins/data/public/search/aggs/agg_config.ts +++ b/src/legacy/core_plugins/data/public/search/aggs/agg_config.ts @@ -20,10 +20,8 @@ import _ from 'lodash'; import { i18n } from '@kbn/i18n'; import { IAggType } from './agg_type'; -import { AggGroupNames } from './agg_groups'; import { writeParams } from './agg_params'; import { IAggConfigs } from './agg_configs'; -import { Schema } from './schemas'; import { ISearchSource, FetchOptions, @@ -38,37 +36,9 @@ export interface AggConfigOptions { enabled?: boolean; id?: string; params?: Record; - schema?: string | Schema; + schema?: string; } -const unknownSchema: Schema = { - name: 'unknown', - title: 'Unknown', // only here for illustrative purposes - hideCustomLabel: true, - aggFilter: [], - min: 1, - max: 1, - params: [], - defaults: {}, - editor: false, - group: AggGroupNames.Metrics, - aggSettings: { - top_hits: { - allowStrings: true, - }, - }, -}; - -const getSchemaFromRegistry = (schemas: any, schema: string): Schema => { - let registeredSchema = schemas ? schemas.byName[schema] : null; - if (!registeredSchema) { - registeredSchema = Object.assign({}, unknownSchema); - registeredSchema.name = schema; - } - - return registeredSchema; -}; - /** * @name AggConfig * @@ -122,8 +92,8 @@ export class AggConfig { public params: any; public parent?: IAggConfigs; public brandNew?: boolean; + public schema?: string; - private __schema: Schema; private __type: IAggType; private __typeDecorations: any; private subAggs: AggConfig[] = []; @@ -141,14 +111,12 @@ export class AggConfig { this.setType(opts.type); if (opts.schema) { - this.setSchema(opts.schema); + this.schema = opts.schema; } // set the params to the values from opts, or just to the defaults this.setParams(opts.params || {}); - // @ts-ignore - this.__schema = this.__schema; // @ts-ignore this.__type = this.__type; } @@ -305,16 +273,13 @@ export class AggConfig { id: this.id, enabled: this.enabled, type: this.type && this.type.name, - schema: _.get(this, 'schema.name', this.schema), + schema: this.schema, params: outParams, }; } getAggParams() { - return [ - ...(_.has(this, 'type.params') ? this.type.params : []), - ...(_.has(this, 'schema.params') ? (this.schema as Schema).params : []), - ]; + return [...(_.has(this, 'type.params') ? this.type.params : [])]; } getRequestAggs() { @@ -397,7 +362,6 @@ export class AggConfig { fieldIsTimeField() { const indexPattern = this.getIndexPattern(); if (!indexPattern) return false; - // @ts-ignore const timeFieldName = indexPattern.timeFieldName; return timeFieldName && this.fieldName() === timeFieldName; } @@ -435,9 +399,6 @@ export class AggConfig { // clear out the previous params except for a few special ones this.setParams({ - // split row/columns is "outside" of the agg, so don't reset it - row: this.params.row, - // almost every agg has fields, so we try to persist that when type changes field: availableFields.find((field: any) => field.name === this.getField()), }); @@ -446,17 +407,4 @@ export class AggConfig { public setType(type: IAggType) { this.type = type; } - - public get schema() { - return this.__schema; - } - - public set schema(schema) { - this.__schema = schema; - } - - public setSchema(schema: string | Schema) { - this.schema = - typeof schema === 'string' ? getSchemaFromRegistry(this.aggConfigs.schemas, schema) : schema; - } } diff --git a/src/legacy/core_plugins/data/public/search/aggs/agg_configs.test.ts b/src/legacy/core_plugins/data/public/search/aggs/agg_configs.test.ts index 29f16b1e4f0bf..d69376b4026d9 100644 --- a/src/legacy/core_plugins/data/public/search/aggs/agg_configs.test.ts +++ b/src/legacy/core_plugins/data/public/search/aggs/agg_configs.test.ts @@ -21,8 +21,6 @@ import { indexBy } from 'lodash'; import { AggConfig } from './agg_config'; import { AggConfigs } from './agg_configs'; import { AggTypesRegistryStart } from './agg_types_registry'; -import { Schemas } from './schemas'; -import { AggGroupNames } from './agg_groups'; import { mockDataServices, mockAggTypesRegistry } from './test_helpers'; import { IndexPatternField, IndexPattern } from '../../../../../../plugins/data/public'; import { @@ -36,6 +34,7 @@ describe('AggConfigs', () => { let typesRegistry: AggTypesRegistryStart; beforeEach(() => { + mockDataServices(); indexPattern = stubIndexPatternWithFields as IndexPattern; typesRegistry = mockAggTypesRegistry(); }); @@ -80,67 +79,6 @@ describe('AggConfigs', () => { expect(spy.mock.calls[0]).toEqual([configStates]); spy.mockRestore(); }); - - describe('defaults', () => { - const schemas = new Schemas([ - { - group: AggGroupNames.Metrics, - name: 'metric', - title: 'Simple', - min: 1, - max: 2, - defaults: [ - { schema: 'metric', type: 'count' }, - { schema: 'metric', type: 'avg' }, - { schema: 'metric', type: 'sum' }, - ], - }, - { - group: AggGroupNames.Buckets, - name: 'segment', - title: 'Example', - min: 0, - max: 1, - defaults: [ - { schema: 'segment', type: 'terms' }, - { schema: 'segment', type: 'filters' }, - ], - }, - ]); - - it('should only set the number of defaults defined by the max', () => { - const ac = new AggConfigs(indexPattern, [], { - schemas: schemas.all, - typesRegistry, - }); - expect(ac.bySchemaName('metric')).toHaveLength(2); - }); - - it('should set the defaults defined in the schema when none exist', () => { - const ac = new AggConfigs(indexPattern, [], { - schemas: schemas.all, - typesRegistry, - }); - expect(ac.aggs).toHaveLength(3); - }); - - it('should NOT set the defaults defined in the schema when some exist', () => { - const configStates = [ - { - enabled: true, - type: 'date_histogram', - params: {}, - schema: 'segment', - }, - ]; - const ac = new AggConfigs(indexPattern, configStates, { - schemas: schemas.all, - typesRegistry, - }); - expect(ac.aggs).toHaveLength(3); - expect(ac.bySchemaName('segment')[0].type.name).toEqual('date_histogram'); - }); - }); }); describe('#createAggConfig', () => { @@ -284,19 +222,7 @@ describe('AggConfigs', () => { }); describe('#toDsl', () => { - const schemas = new Schemas([ - { - group: AggGroupNames.Buckets, - name: 'segment', - }, - { - group: AggGroupNames.Buckets, - name: 'split', - }, - ]); - beforeEach(() => { - mockDataServices(); indexPattern = stubIndexPattern as IndexPattern; indexPattern.fields.getByName = name => (name as unknown) as IndexPatternField; }); @@ -319,7 +245,6 @@ describe('AggConfigs', () => { const ac = new AggConfigs(indexPattern, configStates, { typesRegistry, - schemas: schemas.all, }); const aggInfos = ac.aggs.map(aggConfig => { @@ -390,11 +315,10 @@ describe('AggConfigs', () => { const ac = new AggConfigs(indexPattern, configStates, { typesRegistry, - schemas: schemas.all, }); const dsl = ac.toDsl(); const histo = ac.byName('date_histogram')[0]; - const metrics = ac.bySchemaGroup('metrics'); + const metrics = ac.bySchemaName('metrics'); expect(dsl).toHaveProperty(histo.id); expect(typeof dsl[histo.id]).toBe('object'); @@ -418,8 +342,8 @@ describe('AggConfigs', () => { const ac = new AggConfigs(indexPattern, configStates, { typesRegistry }); const topLevelDsl = ac.toDsl(true); - const buckets = ac.bySchemaGroup('buckets'); - const metrics = ac.bySchemaGroup('metrics'); + const buckets = ac.bySchemaName('buckets'); + const metrics = ac.bySchemaName('metrics'); (function checkLevel(dsl) { const bucket = buckets.shift(); diff --git a/src/legacy/core_plugins/data/public/search/aggs/agg_configs.ts b/src/legacy/core_plugins/data/public/search/aggs/agg_configs.ts index ab70e66b1e138..4a48f356d3f79 100644 --- a/src/legacy/core_plugins/data/public/search/aggs/agg_configs.ts +++ b/src/legacy/core_plugins/data/public/search/aggs/agg_configs.ts @@ -23,7 +23,6 @@ import { Assign } from '@kbn/utility-types'; import { AggConfig, AggConfigOptions, IAggConfig } from './agg_config'; import { IAggType } from './agg_type'; import { AggTypesRegistryStart } from './agg_types_registry'; -import { Schema } from './schemas'; import { AggGroupNames } from './agg_groups'; import { IndexPattern, @@ -32,8 +31,6 @@ import { TimeRange, } from '../../../../../../plugins/data/public'; -type Schemas = Record; - function removeParentAggs(obj: any) { for (const prop in obj) { if (prop === 'parentAggs') delete obj[prop]; @@ -51,7 +48,6 @@ function parseParentAggs(dslLvlCursor: any, dsl: any) { } export interface AggConfigsOptions { - schemas?: Schemas; typesRegistry: AggTypesRegistryStart; } @@ -73,7 +69,6 @@ export type IAggConfigs = AggConfigs; export class AggConfigs { public indexPattern: IndexPattern; - public schemas: any; public timeRange?: TimeRange; private readonly typesRegistry: AggTypesRegistryStart; @@ -90,37 +85,8 @@ export class AggConfigs { this.aggs = []; this.indexPattern = indexPattern; - this.schemas = opts.schemas; configStates.forEach((params: any) => this.createAggConfig(params)); - - if (this.schemas) { - this.initializeDefaultsFromSchemas(this.schemas); - } - } - - // do this wherever the schemas were passed in, & pass in state defaults instead - initializeDefaultsFromSchemas(schemas: Schemas) { - // Set the defaults for any schema which has them. If the defaults - // for some reason has more then the max only set the max number - // of defaults (not sure why a someone define more... - // but whatever). Also if a schema.name is already set then don't - // set anything. - _(schemas) - .filter((schema: Schema) => { - return Array.isArray(schema.defaults) && schema.defaults.length > 0; - }) - .each((schema: any) => { - if (!this.aggs.find((agg: AggConfig) => agg.schema && agg.schema.name === schema.name)) { - // the result here should be passable as a configState - const defaults = schema.defaults.slice(0, schema.max); - _.each(defaults, defaultState => { - const state = _.defaults({ id: AggConfig.nextId(this.aggs) }, defaultState); - this.createAggConfig(state as AggConfigOptions); - }); - } - }) - .commit(); } setTimeRange(timeRange: TimeRange) { @@ -148,7 +114,6 @@ export class AggConfigs { }; const aggConfigs = new AggConfigs(this.indexPattern, this.aggs.filter(filterAggs), { - schemas: this.schemas, typesRegistry: this.typesRegistry, }); @@ -271,23 +236,19 @@ export class AggConfigs { } byName(name: string) { - return this.aggs.filter(agg => agg.type.name === name); + return this.aggs.filter(agg => agg.type?.name === name); } byType(type: string) { - return this.aggs.filter(agg => agg.type.type === type); + return this.aggs.filter(agg => agg.type?.type === type); } byTypeName(type: string) { - return this.aggs.filter(agg => agg.type.name === type); + return this.byName(type); } bySchemaName(schema: string) { - return this.aggs.filter(agg => agg.schema && agg.schema.name === schema); - } - - bySchemaGroup(group: string) { - return this.aggs.filter(agg => agg.schema && agg.schema.group === group); + return this.aggs.filter(agg => agg.schema === schema); } getRequestAggs(): AggConfig[] { diff --git a/src/legacy/core_plugins/data/public/search/aggs/agg_types.ts b/src/legacy/core_plugins/data/public/search/aggs/agg_types.ts index c16eb06eeb116..691598fe27e31 100644 --- a/src/legacy/core_plugins/data/public/search/aggs/agg_types.ts +++ b/src/legacy/core_plugins/data/public/search/aggs/agg_types.ts @@ -88,27 +88,3 @@ export const aggTypes = { geoTileBucketAgg, ], }; - -export { AggType } from './agg_type'; -export { AggConfig } from './agg_config'; -export { AggConfigs } from './agg_configs'; -export { FieldParamType } from './param_types'; -export { aggTypeFieldFilters } from './param_types/filter'; -export { parentPipelineAggHelper } from './metrics/lib/parent_pipeline_agg_helper'; - -// static code -export { AggParamType } from './param_types/agg'; -export { AggGroupNames, aggGroupNamesMap } from './agg_groups'; -export { intervalOptions } from './buckets/_interval_options'; // only used in Discover -export { isDateHistogramBucketAggConfig, setBounds } from './buckets/date_histogram'; -export { termsAggFilter } from './buckets/terms'; -export { isType, isStringType } from './buckets/migrate_include_exclude_format'; -export { CidrMask } from './buckets/lib/cidr_mask'; -export { convertDateRangeToString } from './buckets/date_range'; -export { convertIPRangeToString } from './buckets/ip_range'; -export { aggTypeFilters, propFilter } from './filter'; -export { OptionedParamType } from './param_types/optioned'; -export { isValidJson, isValidInterval } from './utils'; -export { BUCKET_TYPES } from './buckets/bucket_agg_types'; -export { METRIC_TYPES } from './metrics/metric_agg_types'; -export { ISchemas, Schema, Schemas } from './schemas'; diff --git a/src/legacy/core_plugins/data/public/search/aggs/buckets/create_filter/date_histogram.test.ts b/src/legacy/core_plugins/data/public/search/aggs/buckets/create_filter/date_histogram.test.ts index 2b47dc384bca2..f21ca6c975809 100644 --- a/src/legacy/core_plugins/data/public/search/aggs/buckets/create_filter/date_histogram.test.ts +++ b/src/legacy/core_plugins/data/public/search/aggs/buckets/create_filter/date_histogram.test.ts @@ -26,9 +26,6 @@ import { dateHistogramBucketAgg, IBucketDateHistogramAggConfig } from '../date_h import { BUCKET_TYPES } from '../bucket_agg_types'; import { RangeFilter } from '../../../../../../../../plugins/data/public'; -// TODO: remove this once time buckets is migrated -jest.mock('ui/new_platform'); - describe('AggConfig Filters', () => { describe('date_histogram', () => { beforeEach(() => { diff --git a/src/legacy/core_plugins/data/public/search/aggs/buckets/date_histogram.ts b/src/legacy/core_plugins/data/public/search/aggs/buckets/date_histogram.ts index a5368135728d4..8c8911bda99a5 100644 --- a/src/legacy/core_plugins/data/public/search/aggs/buckets/date_histogram.ts +++ b/src/legacy/core_plugins/data/public/search/aggs/buckets/date_histogram.ts @@ -21,8 +21,7 @@ import _ from 'lodash'; import moment from 'moment-timezone'; import { i18n } from '@kbn/i18n'; -// TODO need to move TimeBuckets -import { TimeBuckets } from 'ui/time_buckets'; +import { TimeBuckets } from './lib/time_buckets'; import { BucketAggType, IBucketAggConfig } from './_bucket_agg_type'; import { BUCKET_TYPES } from './bucket_agg_types'; import { createFilterDateHistogram } from './create_filter/date_histogram'; @@ -31,34 +30,42 @@ import { dateHistogramInterval } from '../../../../common'; import { writeParams } from '../agg_params'; import { isMetricAggType } from '../metrics/metric_agg_type'; -import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { getQueryService, getUiSettings } from '../../../../../../../plugins/data/public/services'; +import { + fieldFormats, + KBN_FIELD_TYPES, + TimefilterContract, +} from '../../../../../../../plugins/data/public'; +import { + getFieldFormats, + getQueryService, + getUiSettings, + // eslint-disable-next-line @kbn/eslint/no-restricted-paths +} from '../../../../../../../plugins/data/public/services'; const detectedTimezone = moment.tz.guess(); const tzOffset = moment().format('Z'); -const getInterval = (agg: IBucketAggConfig): string => _.get(agg, ['params', 'interval']); - -export const setBounds = (agg: IBucketDateHistogramAggConfig, force?: boolean) => { - const { timefilter } = getQueryService().timefilter; - if (agg.buckets._alreadySet && !force) return; - agg.buckets._alreadySet = true; +const updateTimeBuckets = ( + agg: IBucketDateHistogramAggConfig, + timefilter: TimefilterContract, + customBuckets?: IBucketDateHistogramAggConfig['buckets'] +) => { const bounds = agg.params.timeRange ? timefilter.calculateBounds(agg.params.timeRange) : null; - agg.buckets.setBounds(agg.fieldIsTimeField() && bounds); + const buckets = customBuckets || agg.buckets; + buckets.setBounds(agg.fieldIsTimeField() && bounds); + buckets.setInterval(agg.params.interval); }; -// will be replaced by src/legacy/ui/public/time_buckets/time_buckets.js -interface TimeBuckets { - _alreadySet?: boolean; +// TODO: Need to incorporate these properly into TimeBuckets +interface ITimeBuckets { setBounds: Function; - getScaledDateFormatter: Function; + getScaledDateFormat: TimeBuckets['getScaledDateFormat']; setInterval: Function; getInterval: Function; } export interface IBucketDateHistogramAggConfig extends IBucketAggConfig { - buckets: TimeBuckets; + buckets: ITimeBuckets; } export function isDateHistogramBucketAggConfig(agg: any): agg is IBucketDateHistogramAggConfig { @@ -91,16 +98,18 @@ export const dateHistogramBucketAgg = new BucketAggType getUiSettings().get(key) + ); }, params: [ { @@ -122,8 +142,6 @@ export const dateHistogramBucketAgg = new BucketAggType string -) => { +export function convertDateRangeToString({ from, to }: DateRangeKey, format: (val: any) => string) { if (!from) { return 'Before ' + format(to); } else if (!to) { @@ -33,4 +30,4 @@ export const convertDateRangeToString = ( } else { return format(from) + ' to ' + format(to); } -}; +} diff --git a/src/legacy/core_plugins/data/public/search/aggs/buckets/lib/date_utils.ts b/src/legacy/core_plugins/data/public/search/aggs/buckets/lib/date_utils.ts new file mode 100644 index 0000000000000..c333a1dbe8524 --- /dev/null +++ b/src/legacy/core_plugins/data/public/search/aggs/buckets/lib/date_utils.ts @@ -0,0 +1,56 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import dateMath from '@elastic/datemath'; +import { TimeBuckets } from './time_buckets'; +import { TimeRange } from '../../../../../../../../plugins/data/public'; +import { IUiSettingsClient } from '../../../../../../../../core/public'; + +export function toAbsoluteDates(range: TimeRange) { + const fromDate = dateMath.parse(range.from); + const toDate = dateMath.parse(range.to, { roundUp: true }); + + if (!fromDate || !toDate) { + return; + } + + return { + from: fromDate.toDate(), + to: toDate.toDate(), + }; +} + +export function getCalculateAutoTimeExpression(uiSettings: IUiSettingsClient) { + return function calculateAutoTimeExpression(range: TimeRange) { + const dates = toAbsoluteDates(range); + if (!dates) { + return; + } + + const buckets = new TimeBuckets({ uiSettings }); + + buckets.setInterval('auto'); + buckets.setBounds({ + min: dates.from, + max: dates.to, + }); + + return buckets.getInterval().expression; + }; +} diff --git a/src/legacy/ui/public/time_buckets/calc_auto_interval.test.ts b/src/legacy/core_plugins/data/public/search/aggs/buckets/lib/time_buckets/calc_auto_interval.test.ts similarity index 100% rename from src/legacy/ui/public/time_buckets/calc_auto_interval.test.ts rename to src/legacy/core_plugins/data/public/search/aggs/buckets/lib/time_buckets/calc_auto_interval.test.ts diff --git a/src/legacy/ui/public/time_buckets/calc_auto_interval.ts b/src/legacy/core_plugins/data/public/search/aggs/buckets/lib/time_buckets/calc_auto_interval.ts similarity index 100% rename from src/legacy/ui/public/time_buckets/calc_auto_interval.ts rename to src/legacy/core_plugins/data/public/search/aggs/buckets/lib/time_buckets/calc_auto_interval.ts diff --git a/src/legacy/core_plugins/data/public/search/aggs/buckets/lib/time_buckets/calc_es_interval.ts b/src/legacy/core_plugins/data/public/search/aggs/buckets/lib/time_buckets/calc_es_interval.ts new file mode 100644 index 0000000000000..3e7d315a0a42a --- /dev/null +++ b/src/legacy/core_plugins/data/public/search/aggs/buckets/lib/time_buckets/calc_es_interval.ts @@ -0,0 +1,78 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import moment from 'moment'; +import dateMath, { Unit } from '@elastic/datemath'; + +import { parseEsInterval } from '../../../../../../common'; + +const unitsDesc = dateMath.unitsDesc; +const largeMax = unitsDesc.indexOf('M'); + +export interface EsInterval { + expression: string; + unit: Unit; + value: number; +} + +/** + * Convert a moment.duration into an es + * compatible expression, and provide + * associated metadata + * + * @param {moment.duration} duration + * @return {object} + */ +export function convertDurationToNormalizedEsInterval(duration: moment.Duration): EsInterval { + for (let i = 0; i < unitsDesc.length; i++) { + const unit = unitsDesc[i]; + const val = duration.as(unit); + // find a unit that rounds neatly + if (val >= 1 && Math.floor(val) === val) { + // if the unit is "large", like years, but + // isn't set to 1 ES will puke. So keep going until + // we get out of the "large" units + if (i <= largeMax && val !== 1) { + continue; + } + + return { + value: val, + unit, + expression: val + unit, + }; + } + } + + const ms = duration.as('ms'); + return { + value: ms, + unit: 'ms', + expression: ms + 'ms', + }; +} + +export function convertIntervalToEsInterval(interval: string): EsInterval { + const { value, unit } = parseEsInterval(interval); + return { + value, + unit, + expression: interval, + }; +} diff --git a/src/legacy/ui/public/time_buckets/index.js b/src/legacy/core_plugins/data/public/search/aggs/buckets/lib/time_buckets/index.ts similarity index 100% rename from src/legacy/ui/public/time_buckets/index.js rename to src/legacy/core_plugins/data/public/search/aggs/buckets/lib/time_buckets/index.ts diff --git a/src/legacy/core_plugins/data/public/search/aggs/buckets/lib/time_buckets/time_buckets.ts b/src/legacy/core_plugins/data/public/search/aggs/buckets/lib/time_buckets/time_buckets.ts new file mode 100644 index 0000000000000..9f43181932d7e --- /dev/null +++ b/src/legacy/core_plugins/data/public/search/aggs/buckets/lib/time_buckets/time_buckets.ts @@ -0,0 +1,438 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import _ from 'lodash'; +import moment from 'moment'; + +import { IUiSettingsClient } from '../../../../../../../../../core/public'; +import { parseInterval } from '../../../../../../../../../plugins/data/public'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { calcAutoIntervalLessThan, calcAutoIntervalNear } from './calc_auto_interval'; +import { + convertDurationToNormalizedEsInterval, + convertIntervalToEsInterval, + EsInterval, +} from './calc_es_interval'; + +interface Bounds { + min: Date | number | null; + max: Date | number | null; +} + +interface TimeBucketsInterval extends moment.Duration { + // TODO double-check whether all of these are needed + description: string; + esValue: EsInterval['value']; + esUnit: EsInterval['unit']; + expression: EsInterval['expression']; + overflow: moment.Duration | boolean; + preScaled?: moment.Duration; + scale?: number; + scaled?: boolean; +} + +function isObject(o: any): o is Record { + return _.isObject(o); +} + +function isString(s: any): s is string { + return _.isString(s); +} + +function isValidMoment(m: any): boolean { + return m && 'isValid' in m && m.isValid(); +} + +interface TimeBucketsConfig { + uiSettings: IUiSettingsClient; +} + +/** + * Helper class for wrapping the concept of an "Interval", + * which describes a timespan that will separate moments. + * + * @param {state} object - one of "" + * @param {[type]} display [description] + */ +export class TimeBuckets { + private getConfig: (key: string) => any; + + private _lb: Bounds['min'] = null; + private _ub: Bounds['max'] = null; + private _originalInterval: string | null = null; + private _i?: moment.Duration | 'auto'; + + // because other parts of Kibana arbitrarily add properties + [key: string]: any; + + static __cached__(self: TimeBuckets) { + let cache: any = {}; + const sameMoment = same(moment.isMoment); + const sameDuration = same(moment.isDuration); + + const desc: Record = { + __cached__: { + value: self, + }, + }; + + const breakers: Record = { + setBounds: 'bounds', + clearBounds: 'bounds', + setInterval: 'interval', + }; + + const resources: Record = { + bounds: { + setup() { + return [self._lb, self._ub]; + }, + changes(prev: any) { + return !sameMoment(prev[0], self._lb) || !sameMoment(prev[1], self._ub); + }, + }, + interval: { + setup() { + return self._i; + }, + changes(prev: any) { + return !sameDuration(prev, self._i); + }, + }, + }; + + function cachedGetter(prop: string) { + return { + value: (...rest: any) => { + if (cache.hasOwnProperty(prop)) { + return cache[prop]; + } + + return (cache[prop] = self[prop](...rest)); + }, + }; + } + + function cacheBreaker(prop: string) { + const resource = resources[breakers[prop]]; + const setup = resource.setup; + const changes = resource.changes; + const fn = self[prop]; + + return { + value: (...args: any) => { + const prev = setup.call(self); + const ret = fn.apply(self, ...args); + + if (changes.call(self, prev)) { + cache = {}; + } + + return ret; + }, + }; + } + + function same(checkType: any) { + return function(a: any, b: any) { + if (a === b) return true; + if (checkType(a) === checkType(b)) return +a === +b; + return false; + }; + } + + _.forOwn(TimeBuckets.prototype, (fn, prop) => { + if (!prop || prop[0] === '_') return; + + if (breakers.hasOwnProperty(prop)) { + desc[prop] = cacheBreaker(prop); + } else { + desc[prop] = cachedGetter(prop); + } + }); + + return Object.create(self, desc); + } + + constructor({ uiSettings }: TimeBucketsConfig) { + this.getConfig = (key: string) => uiSettings.get(key); + return TimeBuckets.__cached__(this); + } + + /** + * Get a moment duration object representing + * the distance between the bounds, if the bounds + * are set. + * + * @return {moment.duration|undefined} + */ + private getDuration(): moment.Duration | undefined { + if (this._ub === null || this._lb === null || !this.hasBounds()) { + return; + } + const difference = (this._ub as number) - (this._lb as number); + return moment.duration(difference, 'ms'); + } + + /** + * Set the bounds that these buckets are expected to cover. + * This is required to support interval "auto" as well + * as interval scaling. + * + * @param {object} input - an object with properties min and max, + * representing the edges for the time span + * we should cover + * + * @returns {undefined} + */ + setBounds(input?: Bounds | Bounds[]) { + if (!input) return this.clearBounds(); + + let bounds; + if (_.isPlainObject(input) && !Array.isArray(input)) { + // accept the response from timefilter.getActiveBounds() + bounds = [input.min, input.max]; + } else { + bounds = Array.isArray(input) ? input : []; + } + + const moments = _(bounds) + .map(_.ary(moment, 1)) + .sortBy(Number); + + const valid = moments.size() === 2 && moments.every(isValidMoment); + if (!valid) { + this.clearBounds(); + throw new Error('invalid bounds set: ' + input); + } + + this._lb = moments.shift() as any; + this._ub = moments.pop() as any; + + const duration = this.getDuration(); + if (!duration || duration.asSeconds() < 0) { + throw new TypeError('Intervals must be positive'); + } + } + + /** + * Clear the stored bounds + * + * @return {undefined} + */ + clearBounds() { + this._lb = this._ub = null; + } + + /** + * Check to see if we have received bounds yet + * + * @return {Boolean} + */ + hasBounds(): boolean { + return isValidMoment(this._ub) && isValidMoment(this._lb); + } + + /** + * Return the current bounds, if we have any. + * + * THIS DOES NOT CLONE THE BOUNDS, so editing them + * may have unexpected side-effects. Always + * call bounds.min.clone() before editing + * + * @return {object|undefined} - If bounds are not defined, this + * returns undefined, else it returns the bounds + * for these buckets. This object has two props, + * min and max. Each property will be a moment() + * object + * + */ + getBounds(): Bounds | undefined { + if (!this.hasBounds()) return; + return { + min: this._lb, + max: this._ub, + }; + } + + /** + * Update the interval at which buckets should be + * generated. + * + * Input can be one of the following: + * - Any object from src/legacy/ui/agg_types.js + * - "auto" + * - Pass a valid moment unit + * - a moment.duration object. + * + * @param {object|string|moment.duration} input - see desc + */ + setInterval(input: null | string | Record | moment.Duration) { + let interval = input; + + // selection object -> val + if (isObject(input) && !moment.isDuration(input)) { + interval = input.val; + } + + if (!interval || interval === 'auto') { + this._i = 'auto'; + return; + } + + if (isString(interval)) { + input = interval; + + // Preserve the original units because they're lost when the interval is converted to a + // moment duration object. + this._originalInterval = input; + + interval = parseInterval(interval); + if (interval === null || +interval === 0) { + interval = null; + } + } + + // if the value wasn't converted to a duration, and isn't + // already a duration, we have a problem + if (!moment.isDuration(interval)) { + throw new TypeError('"' + input + '" is not a valid interval.'); + } + + this._i = interval; + } + + /** + * Get the interval for the buckets. If the + * number of buckets created by the interval set + * is larger than config:histogram:maxBars then the + * interval will be scaled up. If the number of buckets + * created is less than one, the interval is scaled back. + * + * The interval object returned is a moment.duration + * object that has been decorated with the following + * properties. + * + * interval.description: a text description of the interval. + * designed to be used list "field per {{ desc }}". + * - "minute" + * - "10 days" + * - "3 years" + * + * interval.expression: the elasticsearch expression that creates this + * interval. If the interval does not properly form an elasticsearch + * expression it will be forced into one. + * + * interval.scaled: the interval was adjusted to + * accommodate the maxBars setting. + * + * interval.scale: the number that y-values should be + * multiplied by + */ + getInterval(useNormalizedEsInterval = true): TimeBucketsInterval { + const duration = this.getDuration(); + + // either pull the interval from state or calculate the auto-interval + const readInterval = () => { + const interval = this._i; + if (moment.isDuration(interval)) return interval; + return calcAutoIntervalNear(this.getConfig('histogram:barTarget'), Number(duration)); + }; + + const parsedInterval = readInterval(); + + // check to see if the interval should be scaled, and scale it if so + const maybeScaleInterval = (interval: moment.Duration) => { + if (!this.hasBounds() || !duration) { + return interval; + } + + const maxLength: number = this.getConfig('histogram:maxBars'); + const approxLen = Number(duration) / Number(interval); + + let scaled; + + if (approxLen > maxLength) { + scaled = calcAutoIntervalLessThan(maxLength, Number(duration)); + } else { + return interval; + } + + if (+scaled === +interval) return interval; + + interval = decorateInterval(interval); + return Object.assign(scaled, { + preScaled: interval, + scale: Number(interval) / Number(scaled), + scaled: true, + }); + }; + + // append some TimeBuckets specific props to the interval + const decorateInterval = (interval: moment.Duration): TimeBucketsInterval => { + const esInterval = useNormalizedEsInterval + ? convertDurationToNormalizedEsInterval(interval) + : convertIntervalToEsInterval(String(this._originalInterval)); + const prettyUnits = moment.normalizeUnits(esInterval.unit); + + return Object.assign(interval, { + description: + esInterval.value === 1 ? prettyUnits : esInterval.value + ' ' + prettyUnits + 's', + esValue: esInterval.value, + esUnit: esInterval.unit, + expression: esInterval.expression, + overflow: + Number(duration) > Number(interval) + ? moment.duration(Number(interval) - Number(duration)) + : false, + }); + }; + + if (useNormalizedEsInterval) { + return decorateInterval(maybeScaleInterval(parsedInterval)); + } else { + return decorateInterval(parsedInterval); + } + } + + /** + * Get a date format string that will represent dates that + * progress at our interval. + * + * Since our interval can be as small as 1ms, the default + * date format is usually way too much. with `dateFormat:scaled` + * users can modify how dates are formatted within series + * produced by TimeBuckets + * + * @return {string} + */ + getScaledDateFormat() { + const interval = this.getInterval(); + const rules = this.getConfig('dateFormat:scaled'); + + for (let i = rules.length - 1; i >= 0; i--) { + const rule = rules[i]; + if (!rule[0] || (interval && interval >= moment.duration(rule[0]))) { + return rule[1]; + } + } + + return this.getConfig('dateFormat'); + } +} diff --git a/src/legacy/core_plugins/data/public/search/aggs/buckets/terms.ts b/src/legacy/core_plugins/data/public/search/aggs/buckets/terms.ts index 8fd95c86d8476..b387e9b7d306a 100644 --- a/src/legacy/core_plugins/data/public/search/aggs/buckets/terms.ts +++ b/src/legacy/core_plugins/data/public/search/aggs/buckets/terms.ts @@ -40,8 +40,6 @@ import { mergeOtherBucketAggResponse, updateMissingBucket, } from './_terms_other_bucket_helper'; -import { Schemas } from '../schemas'; -import { AggGroupNames } from '../agg_groups'; export const termsAggFilter = [ '!top_hits', @@ -58,17 +56,6 @@ export const termsAggFilter = [ '!sum_bucket', ]; -const [orderAggSchema] = new Schemas([ - { - group: AggGroupNames.None, - name: 'orderAgg', - // This string is never visible to the user so it doesn't need to be translated - title: 'Order Agg', - hideCustomLabel: true, - aggFilter: termsAggFilter, - }, -]).all; - const termsTitle = i18n.translate('data.search.aggs.buckets.termsTitle', { defaultMessage: 'Terms', }); @@ -158,10 +145,11 @@ export const termsBucketAgg = new BucketAggType({ { name: 'orderAgg', type: 'agg', + allowedAggs: termsAggFilter, default: null, makeAgg(termsAgg, state) { state = state || {}; - state.schema = orderAggSchema; + state.schema = 'orderAgg'; const orderAgg = termsAgg.aggConfigs.createAggConfig(state, { addToAggConfigs: false, }); diff --git a/src/legacy/core_plugins/data/public/search/aggs/filter/agg_type_filters.test.ts b/src/legacy/core_plugins/data/public/search/aggs/filter/agg_type_filters.test.ts index 0de1c31d02f96..90c29675c0db2 100644 --- a/src/legacy/core_plugins/data/public/search/aggs/filter/agg_type_filters.test.ts +++ b/src/legacy/core_plugins/data/public/search/aggs/filter/agg_type_filters.test.ts @@ -32,7 +32,7 @@ describe('AggTypeFilters', () => { it('should filter nothing without registered filters', async () => { const aggTypes = [{ name: 'count' }, { name: 'sum' }] as IAggType[]; - const filtered = registry.filter(aggTypes, indexPattern, aggConfig); + const filtered = registry.filter(aggTypes, indexPattern, aggConfig, []); expect(filtered).toEqual(aggTypes); }); @@ -40,23 +40,23 @@ describe('AggTypeFilters', () => { const aggTypes = [{ name: 'count' }, { name: 'sum' }] as IAggType[]; const filter = jest.fn(); registry.addFilter(filter); - registry.filter(aggTypes, indexPattern, aggConfig); - expect(filter).toHaveBeenCalledWith(aggTypes[0], indexPattern, aggConfig); - expect(filter).toHaveBeenCalledWith(aggTypes[1], indexPattern, aggConfig); + registry.filter(aggTypes, indexPattern, aggConfig, []); + expect(filter).toHaveBeenCalledWith(aggTypes[0], indexPattern, aggConfig, []); + expect(filter).toHaveBeenCalledWith(aggTypes[1], indexPattern, aggConfig, []); }); it('should allow registered filters to filter out aggTypes', async () => { const aggTypes = [{ name: 'count' }, { name: 'sum' }, { name: 'avg' }] as IAggType[]; - let filtered = registry.filter(aggTypes, indexPattern, aggConfig); + let filtered = registry.filter(aggTypes, indexPattern, aggConfig, []); expect(filtered).toEqual(aggTypes); registry.addFilter(() => true); registry.addFilter(aggType => aggType.name !== 'count'); - filtered = registry.filter(aggTypes, indexPattern, aggConfig); + filtered = registry.filter(aggTypes, indexPattern, aggConfig, []); expect(filtered).toEqual([aggTypes[1], aggTypes[2]]); registry.addFilter(aggType => aggType.name !== 'avg'); - filtered = registry.filter(aggTypes, indexPattern, aggConfig); + filtered = registry.filter(aggTypes, indexPattern, aggConfig, []); expect(filtered).toEqual([aggTypes[1]]); }); }); diff --git a/src/legacy/core_plugins/data/public/search/aggs/filter/agg_type_filters.ts b/src/legacy/core_plugins/data/public/search/aggs/filter/agg_type_filters.ts index 13a4cc0856b09..8da547e592af9 100644 --- a/src/legacy/core_plugins/data/public/search/aggs/filter/agg_type_filters.ts +++ b/src/legacy/core_plugins/data/public/search/aggs/filter/agg_type_filters.ts @@ -23,7 +23,8 @@ import { IAggConfig, IAggType } from '../types'; type AggTypeFilter = ( aggType: IAggType, indexPattern: IndexPattern, - aggConfig: IAggConfig + aggConfig: IAggConfig, + aggFilter: string[] ) => boolean; /** @@ -48,12 +49,20 @@ class AggTypeFilters { * @param aggTypes A list of aggTypes that will be filtered down by this registry. * @param indexPattern The indexPattern for which this list should be filtered down. * @param aggConfig The aggConfig for which the returning list will be used. + * @param schema * @return A filtered list of the passed aggTypes. */ - public filter(aggTypes: IAggType[], indexPattern: IndexPattern, aggConfig: IAggConfig) { + public filter( + aggTypes: IAggType[], + indexPattern: IndexPattern, + aggConfig: IAggConfig, + aggFilter: string[] + ) { const allFilters = Array.from(this.filters); const allowedAggTypes = aggTypes.filter(aggType => { - const isAggTypeAllowed = allFilters.every(filter => filter(aggType, indexPattern, aggConfig)); + const isAggTypeAllowed = allFilters.every(filter => + filter(aggType, indexPattern, aggConfig, aggFilter) + ); return isAggTypeAllowed; }); return allowedAggTypes; diff --git a/src/legacy/core_plugins/data/public/search/aggs/index.ts b/src/legacy/core_plugins/data/public/search/aggs/index.ts index f6914c36f6c05..8d6fbeacd606a 100644 --- a/src/legacy/core_plugins/data/public/search/aggs/index.ts +++ b/src/legacy/core_plugins/data/public/search/aggs/index.ts @@ -27,6 +27,7 @@ export { aggTypes } from './agg_types'; export { AggConfig } from './agg_config'; export { AggConfigs } from './agg_configs'; export { FieldParamType } from './param_types'; +export { getCalculateAutoTimeExpression } from './buckets/lib/date_utils'; export { MetricAggType } from './metrics/metric_agg_type'; export { AggTypeFilters } from './filter'; export { aggTypeFieldFilters, AggTypeFieldFilters } from './param_types/filter'; @@ -43,18 +44,18 @@ export { export { AggParamType } from './param_types/agg'; export { AggGroupNames, aggGroupNamesMap } from './agg_groups'; export { intervalOptions } from './buckets/_interval_options'; // only used in Discover -export { isDateHistogramBucketAggConfig, setBounds } from './buckets/date_histogram'; +export { isDateHistogramBucketAggConfig } from './buckets/date_histogram'; export { termsAggFilter } from './buckets/terms'; export { isType, isStringType } from './buckets/migrate_include_exclude_format'; export { CidrMask } from './buckets/lib/cidr_mask'; export { convertDateRangeToString } from './buckets/date_range'; +export { toAbsoluteDates } from './buckets/lib/date_utils'; export { convertIPRangeToString } from './buckets/ip_range'; export { aggTypeFilters, propFilter } from './filter'; export { OptionedParamType } from './param_types/optioned'; export { isValidJson, isValidInterval } from './utils'; export { BUCKET_TYPES } from './buckets/bucket_agg_types'; export { METRIC_TYPES } from './metrics/metric_agg_types'; -export { ISchemas, Schema, Schemas } from './schemas'; // types export { CreateAggConfigParams, IAggConfig, IAggConfigs } from './types'; diff --git a/src/legacy/core_plugins/data/public/search/aggs/metrics/lib/parent_pipeline_agg_helper.ts b/src/legacy/core_plugins/data/public/search/aggs/metrics/lib/parent_pipeline_agg_helper.ts index 88549ee3019ee..df4cbaf49c8b3 100644 --- a/src/legacy/core_plugins/data/public/search/aggs/metrics/lib/parent_pipeline_agg_helper.ts +++ b/src/legacy/core_plugins/data/public/search/aggs/metrics/lib/parent_pipeline_agg_helper.ts @@ -23,7 +23,7 @@ import { noop, identity } from 'lodash'; import { forwardModifyAggConfigOnSearchRequestStart } from './nested_agg_helpers'; import { IMetricAggConfig, MetricAggParam } from '../metric_agg_type'; import { parentPipelineAggWriter } from './parent_pipeline_agg_writer'; -import { Schemas } from '../../schemas'; + import { fieldFormats } from '../../../../../../../../plugins/data/public'; const metricAggFilter = [ @@ -36,20 +36,6 @@ const metricAggFilter = [ '!geo_centroid', ]; -const metricAggTitle = i18n.translate('data.search.aggs.metrics.metricAggTitle', { - defaultMessage: 'Metric agg', -}); - -const [metricAggSchema] = new Schemas([ - { - group: 'none', - name: 'metricAgg', - title: metricAggTitle, - hideCustomLabel: true, - aggFilter: metricAggFilter, - }, -]).all; - const parentPipelineType = i18n.translate( 'data.search.aggs.metrics.parentPipelineAggregationsSubtypeTitle', { @@ -69,9 +55,9 @@ const parentPipelineAggHelper = { { name: 'customMetric', type: 'agg', + allowedAggs: metricAggFilter, makeAgg(termsAgg, state: any) { state = state || { type: 'count' }; - state.schema = metricAggSchema; const metricAgg = termsAgg.aggConfigs.createAggConfig(state, { addToAggConfigs: false }); diff --git a/src/legacy/core_plugins/data/public/search/aggs/metrics/lib/sibling_pipeline_agg_helper.ts b/src/legacy/core_plugins/data/public/search/aggs/metrics/lib/sibling_pipeline_agg_helper.ts index 05e009cc9da30..33d6d72540868 100644 --- a/src/legacy/core_plugins/data/public/search/aggs/metrics/lib/sibling_pipeline_agg_helper.ts +++ b/src/legacy/core_plugins/data/public/search/aggs/metrics/lib/sibling_pipeline_agg_helper.ts @@ -22,7 +22,6 @@ import { i18n } from '@kbn/i18n'; import { siblingPipelineAggWriter } from './sibling_pipeline_agg_writer'; import { forwardModifyAggConfigOnSearchRequestStart } from './nested_agg_helpers'; import { IMetricAggConfig, MetricAggParam } from '../metric_agg_type'; -import { Schemas } from '../../schemas'; import { fieldFormats } from '../../../../../../../../plugins/data/public'; const metricAggFilter: string[] = [ @@ -44,28 +43,6 @@ const metricAggFilter: string[] = [ ]; const bucketAggFilter: string[] = []; -const [metricAggSchema] = new Schemas([ - { - group: 'none', - name: 'metricAgg', - title: i18n.translate('data.search.aggs.metrics.metricAggTitle', { - defaultMessage: 'Metric agg', - }), - aggFilter: metricAggFilter, - }, -]).all; - -const [bucketAggSchema] = new Schemas([ - { - group: 'none', - title: i18n.translate('data.search.aggs.metrics.bucketAggTitle', { - defaultMessage: 'Bucket agg', - }), - name: 'bucketAgg', - aggFilter: bucketAggFilter, - }, -]).all; - const siblingPipelineType = i18n.translate( 'data.search.aggs.metrics.siblingPipelineAggregationsSubtypeTitle', { @@ -80,10 +57,10 @@ const siblingPipelineAggHelper = { { name: 'customBucket', type: 'agg', + allowedAggs: bucketAggFilter, default: null, makeAgg(agg: IMetricAggConfig, state: any) { state = state || { type: 'date_histogram' }; - state.schema = bucketAggSchema; const orderAgg = agg.aggConfigs.createAggConfig(state, { addToAggConfigs: false }); orderAgg.id = agg.id + '-bucket'; @@ -97,10 +74,10 @@ const siblingPipelineAggHelper = { { name: 'customMetric', type: 'agg', + allowedAggs: metricAggFilter, default: null, makeAgg(agg: IMetricAggConfig, state: any) { state = state || { type: 'count' }; - state.schema = metricAggSchema; const orderAgg = agg.aggConfigs.createAggConfig(state, { addToAggConfigs: false }); orderAgg.id = agg.id + '-metric'; diff --git a/src/legacy/core_plugins/data/public/search/aggs/metrics/metric_agg_type.ts b/src/legacy/core_plugins/data/public/search/aggs/metrics/metric_agg_type.ts index 952dcc96de833..82b042a1e3378 100644 --- a/src/legacy/core_plugins/data/public/search/aggs/metrics/metric_agg_type.ts +++ b/src/legacy/core_plugins/data/public/search/aggs/metrics/metric_agg_type.ts @@ -21,11 +21,11 @@ import { i18n } from '@kbn/i18n'; import { AggType, AggTypeConfig } from '../agg_type'; import { AggParamType } from '../param_types/agg'; import { AggConfig } from '../agg_config'; -import { FilterFieldTypes } from '../param_types/field'; import { METRIC_TYPES } from './metric_agg_types'; import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { getFieldFormats } from '../../../../../../../plugins/data/public/services'; +import { FieldTypes } from '../param_types'; export interface IMetricAggConfig extends AggConfig { type: InstanceType; @@ -33,7 +33,7 @@ export interface IMetricAggConfig extends AggConfig { export interface MetricAggParam extends AggParamType { - filterFieldTypes?: FilterFieldTypes; + filterFieldTypes?: FieldTypes; onlyAggregatable?: boolean; } diff --git a/src/legacy/core_plugins/data/public/search/aggs/metrics/parent_pipeline.test.ts b/src/legacy/core_plugins/data/public/search/aggs/metrics/parent_pipeline.test.ts index 58b4ee530a8c2..02e63f653f94f 100644 --- a/src/legacy/core_plugins/data/public/search/aggs/metrics/parent_pipeline.test.ts +++ b/src/legacy/core_plugins/data/public/search/aggs/metrics/parent_pipeline.test.ts @@ -25,15 +25,6 @@ import { AggConfigs } from '../agg_configs'; import { mockDataServices, mockAggTypesRegistry } from '../test_helpers'; import { IMetricAggConfig, MetricAggType } from './metric_agg_type'; -jest.mock('../schemas', () => { - class MockedSchemas { - all = [{}]; - } - return { - Schemas: jest.fn().mockImplementation(() => new MockedSchemas()), - }; -}); - describe('parent pipeline aggs', function() { beforeEach(() => { mockDataServices(); diff --git a/src/legacy/core_plugins/data/public/search/aggs/metrics/sibling_pipeline.test.ts b/src/legacy/core_plugins/data/public/search/aggs/metrics/sibling_pipeline.test.ts index d3456bacceb6a..8389ed8262ce5 100644 --- a/src/legacy/core_plugins/data/public/search/aggs/metrics/sibling_pipeline.test.ts +++ b/src/legacy/core_plugins/data/public/search/aggs/metrics/sibling_pipeline.test.ts @@ -26,15 +26,6 @@ import { AggConfigs } from '../agg_configs'; import { IMetricAggConfig, MetricAggType } from './metric_agg_type'; import { mockDataServices, mockAggTypesRegistry } from '../test_helpers'; -jest.mock('../schemas', () => { - class MockedSchemas { - all = [{}]; - } - return { - Schemas: jest.fn().mockImplementation(() => new MockedSchemas()), - }; -}); - describe('sibling pipeline aggs', () => { beforeEach(() => { mockDataServices(); diff --git a/src/legacy/core_plugins/data/public/search/aggs/metrics/top_hit.ts b/src/legacy/core_plugins/data/public/search/aggs/metrics/top_hit.ts index 3112d882bb87e..c850eb4ff2220 100644 --- a/src/legacy/core_plugins/data/public/search/aggs/metrics/top_hit.ts +++ b/src/legacy/core_plugins/data/public/search/aggs/metrics/top_hit.ts @@ -63,10 +63,7 @@ export const topHitMetricAgg = new MetricAggType({ name: 'field', type: 'field', onlyAggregatable: false, - filterFieldTypes: (aggConfig: IMetricAggConfig) => - _.get(aggConfig.schema, 'aggSettings.top_hits.allowStrings', false) - ? '*' - : KBN_FIELD_TYPES.NUMBER, + filterFieldTypes: '*', write(agg, output) { const field = agg.getParam('field'); output.params = {}; @@ -133,7 +130,7 @@ export const topHitMetricAgg = new MetricAggType({ defaultMessage: 'Concatenate', }), isCompatible(aggConfig: IMetricAggConfig) { - return _.get(aggConfig.schema, 'aggSettings.top_hits.allowStrings', false); + return _.get(aggConfig.params, 'field.filterFieldTypes', '*') === '*'; }, disabled: true, value: 'concat', diff --git a/src/legacy/core_plugins/data/public/search/aggs/param_types/agg.ts b/src/legacy/core_plugins/data/public/search/aggs/param_types/agg.ts index d31abe64491d0..e5b53020c3159 100644 --- a/src/legacy/core_plugins/data/public/search/aggs/param_types/agg.ts +++ b/src/legacy/core_plugins/data/public/search/aggs/param_types/agg.ts @@ -24,10 +24,15 @@ export class AggParamType extends Ba TAggConfig > { makeAgg: (agg: TAggConfig, state?: any) => TAggConfig; + allowedAggs: string[] = []; constructor(config: Record) { super(config); + if (config.allowedAggs) { + this.allowedAggs = config.allowedAggs; + } + if (!config.write) { this.write = (aggConfig: TAggConfig, output: Record) => { if (aggConfig.params[this.name] && aggConfig.params[this.name].length) { diff --git a/src/legacy/core_plugins/data/public/search/aggs/param_types/field.test.ts b/src/legacy/core_plugins/data/public/search/aggs/param_types/field.test.ts index 7338c41f920d7..18b666f454664 100644 --- a/src/legacy/core_plugins/data/public/search/aggs/param_types/field.test.ts +++ b/src/legacy/core_plugins/data/public/search/aggs/param_types/field.test.ts @@ -17,13 +17,10 @@ * under the License. */ -import { get } from 'lodash'; import { BaseParamType } from './base'; import { FieldParamType } from './field'; import { ES_FIELD_TYPES, KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public'; import { IAggConfig } from '../agg_config'; -import { IMetricAggConfig } from '../metrics/metric_agg_type'; -import { Schema } from '../schemas'; describe('Field', () => { const indexPattern = { @@ -105,43 +102,5 @@ describe('Field', () => { expect(fields.length).toBe(2); }); - - it('should return only numeric fields if filterFieldTypes was specified as a function', () => { - const aggParam = new FieldParamType({ - name: 'field', - type: 'field', - filterFieldTypes: (aggConfig: IMetricAggConfig) => - get(aggConfig.schema, 'aggSettings.top_hits.allowStrings', false) - ? '*' - : KBN_FIELD_TYPES.NUMBER, - }); - const fields = aggParam.getAvailableFields(agg); - - expect(fields.length).toBe(1); - expect(fields[0].type).toBe(KBN_FIELD_TYPES.NUMBER); - }); - - it('should return all fields if filterFieldTypes was specified as a function and aggSettings allow string type fields', () => { - const aggParam = new FieldParamType({ - name: 'field', - type: 'field', - filterFieldTypes: (aggConfig: IMetricAggConfig) => - get(aggConfig.schema, 'aggSettings.top_hits.allowStrings', false) - ? '*' - : KBN_FIELD_TYPES.NUMBER, - }); - - agg.schema = { - aggSettings: { - top_hits: { - allowStrings: true, - }, - }, - } as Schema; - - const fields = aggParam.getAvailableFields(agg); - - expect(fields.length).toBe(2); - }); }); }); diff --git a/src/legacy/core_plugins/data/public/search/aggs/param_types/field.ts b/src/legacy/core_plugins/data/public/search/aggs/param_types/field.ts index bb5707cbb482e..6882b8aa39e7e 100644 --- a/src/legacy/core_plugins/data/public/search/aggs/param_types/field.ts +++ b/src/legacy/core_plugins/data/public/search/aggs/param_types/field.ts @@ -18,12 +18,10 @@ */ import { i18n } from '@kbn/i18n'; -import { isFunction } from 'lodash'; import { IAggConfig } from '../agg_config'; import { SavedObjectNotFound } from '../../../../../../../plugins/kibana_utils/public'; import { BaseParamType } from './base'; import { propFilter } from '../filter'; -import { IMetricAggConfig } from '../metrics/metric_agg_type'; import { IndexPatternField, indexPatterns, @@ -34,15 +32,14 @@ import { getNotifications } from '../../../../../../../plugins/data/public/servi const filterByType = propFilter('type'); -type FieldTypes = KBN_FIELD_TYPES | KBN_FIELD_TYPES[] | '*'; -export type FilterFieldTypes = ((aggConfig: IMetricAggConfig) => FieldTypes) | FieldTypes; +export type FieldTypes = KBN_FIELD_TYPES | KBN_FIELD_TYPES[] | '*'; // TODO need to make a more explicit interface for this export type IFieldParamType = FieldParamType; export class FieldParamType extends BaseParamType { required = true; scriptable = true; - filterFieldTypes: FilterFieldTypes; + filterFieldTypes: FieldTypes; onlyAggregatable: boolean; constructor(config: Record) { @@ -127,12 +124,6 @@ export class FieldParamType extends BaseParamType { return false; } - if (isFunction(filterFieldTypes)) { - const filter = filterFieldTypes(aggConfig as IMetricAggConfig); - - return filterByType([field], filter).length !== 0; - } - return filterByType([field], filterFieldTypes).length !== 0; }); diff --git a/src/legacy/core_plugins/data/public/search/aggs/schemas.ts b/src/legacy/core_plugins/data/public/search/aggs/schemas.ts deleted file mode 100644 index 1aa5ebe08656b..0000000000000 --- a/src/legacy/core_plugins/data/public/search/aggs/schemas.ts +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import _ from 'lodash'; - -import { Optional } from '@kbn/utility-types'; - -import { IndexedArray } from 'ui/indexed_array'; -import { AggGroupNames } from './agg_groups'; -import { AggParam } from './agg_params'; - -export interface ISchemas { - [AggGroupNames.Buckets]: Schema[]; - [AggGroupNames.Metrics]: Schema[]; -} - -export interface Schema { - aggFilter: string | string[]; - editor: boolean | string; - group: AggGroupNames; - max: number; - min: number; - name: string; - params: AggParam[]; - title: string; - defaults: unknown; - hideCustomLabel?: boolean; - mustBeFirst?: boolean; - aggSettings?: any; -} - -export class Schemas { - // @ts-ignore - all: IndexedArray; - - constructor( - schemas: Array< - Optional< - Schema, - 'min' | 'max' | 'group' | 'title' | 'aggFilter' | 'editor' | 'params' | 'defaults' - > - > - ) { - _(schemas || []) - .map(schema => { - if (!schema.name) throw new Error('all schema must have a unique name'); - - if (schema.name === 'split') { - schema.params = [ - { - name: 'row', - default: true, - }, - ] as AggParam[]; - } - - _.defaults(schema, { - min: 0, - max: Infinity, - group: AggGroupNames.Buckets, - title: schema.name, - aggFilter: '*', - editor: false, - params: [], - }); - - return schema as Schema; - }) - .tap((fullSchemas: Schema[]) => { - this.all = new IndexedArray({ - index: ['name'], - group: ['group'], - immutable: true, - initialSet: fullSchemas, - }); - }) - .groupBy('group') - .forOwn((group, groupName) => { - // @ts-ignore - this[groupName] = new IndexedArray({ - index: ['name'], - immutable: true, - // @ts-ignore - initialSet: group, - }); - }) - .commit(); - } -} diff --git a/src/legacy/core_plugins/data/public/search/aggs/types.ts b/src/legacy/core_plugins/data/public/search/aggs/types.ts index 5d02f426b5896..069a933fd994a 100644 --- a/src/legacy/core_plugins/data/public/search/aggs/types.ts +++ b/src/legacy/core_plugins/data/public/search/aggs/types.ts @@ -26,4 +26,3 @@ export { IMetricAggType } from './metrics/metric_agg_type'; export { DateRangeKey } from './buckets/date_range'; export { IpRangeKey } from './buckets/ip_range'; export { OptionedValueProp, OptionedParamEditorProps } from './param_types/optioned'; -export { ISchemas } from './schemas'; diff --git a/src/legacy/core_plugins/data/public/search/expressions/build_tabular_inspector_data.ts b/src/legacy/core_plugins/data/public/search/expressions/build_tabular_inspector_data.ts index e85e9deff6ddf..bd05fa21bfd5d 100644 --- a/src/legacy/core_plugins/data/public/search/expressions/build_tabular_inspector_data.ts +++ b/src/legacy/core_plugins/data/public/search/expressions/build_tabular_inspector_data.ts @@ -20,7 +20,7 @@ import { set } from 'lodash'; // @ts-ignore import { FormattedData } from '../../../../../../plugins/inspector/public'; -// @ts-ignore + import { createFilter } from './create_filter'; import { TabbedTable } from '../tabify'; @@ -66,7 +66,10 @@ export async function buildTabularInspectorData( row => row[`col-${colIndex}-${col.aggConfig.id}`].raw === value.raw ); const filter = createFilter(aggConfigs, table, colIndex, rowIndex, value.raw); - queryFilter.addFilters(filter); + + if (filter) { + queryFilter.addFilters(filter); + } }), filterOut: isCellContentFilterable && @@ -75,14 +78,17 @@ export async function buildTabularInspectorData( row => row[`col-${colIndex}-${col.aggConfig.id}`].raw === value.raw ); const filter = createFilter(aggConfigs, table, colIndex, rowIndex, value.raw); - const notOther = value.raw !== '__other__'; - const notMissing = value.raw !== '__missing__'; - if (Array.isArray(filter)) { - filter.forEach(f => set(f, 'meta.negate', notOther && notMissing)); - } else { - set(filter, 'meta.negate', notOther && notMissing); + + if (filter) { + const notOther = value.raw !== '__other__'; + const notMissing = value.raw !== '__missing__'; + if (Array.isArray(filter)) { + filter.forEach(f => set(f, 'meta.negate', notOther && notMissing)); + } else { + set(filter, 'meta.negate', notOther && notMissing); + } + queryFilter.addFilters(filter); } - queryFilter.addFilters(filter); }), }; }); diff --git a/src/legacy/core_plugins/data/public/search/expressions/create_filter.js b/src/legacy/core_plugins/data/public/search/expressions/create_filter.js deleted file mode 100644 index 3f4028a9b5525..0000000000000 --- a/src/legacy/core_plugins/data/public/search/expressions/create_filter.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -const getOtherBucketFilterTerms = (table, columnIndex, rowIndex) => { - if (rowIndex === -1) { - return []; - } - - // get only rows where cell value matches current row for all the fields before columnIndex - const rows = table.rows.filter(row => { - return table.columns.every((column, i) => { - return row[column.id] === table.rows[rowIndex][column.id] || i >= columnIndex; - }); - }); - const terms = rows.map(row => row[table.columns[columnIndex].id]); - - return [ - ...new Set( - terms.filter(term => { - const notOther = term !== '__other__'; - const notMissing = term !== '__missing__'; - return notOther && notMissing; - }) - ), - ]; -}; - -const createFilter = (aggConfigs, table, columnIndex, rowIndex, cellValue) => { - const column = table.columns[columnIndex]; - const aggConfig = aggConfigs[columnIndex]; - let filter = []; - const value = rowIndex > -1 ? table.rows[rowIndex][column.id] : cellValue; - if (value === null || value === undefined || !aggConfig.isFilterable()) { - return; - } - if (aggConfig.type.name === 'terms' && aggConfig.params.otherBucket) { - const terms = getOtherBucketFilterTerms(table, columnIndex, rowIndex); - filter = aggConfig.createFilter(value, { terms }); - } else { - filter = aggConfig.createFilter(value); - } - - if (!Array.isArray(filter)) { - filter = [filter]; - } - - return filter; -}; - -export { createFilter }; diff --git a/src/legacy/core_plugins/data/public/search/expressions/create_filter.test.ts b/src/legacy/core_plugins/data/public/search/expressions/create_filter.test.ts new file mode 100644 index 0000000000000..890ec81778d4b --- /dev/null +++ b/src/legacy/core_plugins/data/public/search/expressions/create_filter.test.ts @@ -0,0 +1,130 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { + fieldFormats, + FieldFormatsGetConfigFn, + esFilters, +} from '../../../../../../plugins/data/public'; +import { createFilter } from './create_filter'; +import { TabbedTable } from '../tabify'; +import { AggConfigs } from '../aggs/agg_configs'; +import { IAggConfig } from '../aggs/agg_config'; +import { mockDataServices, mockAggTypesRegistry } from '../aggs/test_helpers'; + +describe('createFilter', () => { + let table: TabbedTable; + let aggConfig: IAggConfig; + + const typesRegistry = mockAggTypesRegistry(); + + const getAggConfigs = (type: string, params: any) => { + const field = { + name: 'bytes', + filterable: true, + indexPattern: { + id: '1234', + }, + format: new fieldFormats.BytesFormat({}, (() => {}) as FieldFormatsGetConfigFn), + }; + + const indexPattern = { + id: '1234', + title: 'logstash-*', + fields: { + getByName: () => field, + filter: () => [field], + }, + } as any; + + return new AggConfigs( + indexPattern, + [ + { + id: type, + type, + schema: 'buckets', + params, + }, + ], + { typesRegistry } + ); + }; + + const aggConfigParams: Record = { + field: 'bytes', + interval: 30, + otherBucket: true, + }; + + beforeEach(() => { + table = { + columns: [ + { + id: '1-1', + name: 'test', + aggConfig, + }, + ], + rows: [ + { + '1-1': '2048', + }, + ], + }; + mockDataServices(); + }); + + test('ignores event when cell value is not provided', async () => { + aggConfig = getAggConfigs('histogram', aggConfigParams).aggs[0]; + const filters = await createFilter([aggConfig], table, 0, -1, null); + + expect(filters).not.toBeDefined(); + }); + + test('handles an event when aggregations type is a terms', async () => { + aggConfig = getAggConfigs('terms', aggConfigParams).aggs[0]; + const filters = await createFilter([aggConfig], table, 0, 0, 'test'); + + expect(filters).toBeDefined(); + + if (filters) { + expect(filters.length).toEqual(1); + expect(filters[0].query.match_phrase.bytes).toEqual('2048'); + } + }); + + test('handles an event when aggregations type is not terms', async () => { + aggConfig = getAggConfigs('histogram', aggConfigParams).aggs[0]; + const filters = await createFilter([aggConfig], table, 0, 0, 'test'); + + expect(filters).toBeDefined(); + + if (filters) { + expect(filters.length).toEqual(1); + + const [rangeFilter] = filters; + + if (esFilters.isRangeFilter(rangeFilter)) { + expect(rangeFilter.range.bytes.gte).toEqual(2048); + expect(rangeFilter.range.bytes.lt).toEqual(2078); + } + } + }); +}); diff --git a/src/legacy/core_plugins/data/public/search/expressions/create_filter.ts b/src/legacy/core_plugins/data/public/search/expressions/create_filter.ts new file mode 100644 index 0000000000000..77e011932195c --- /dev/null +++ b/src/legacy/core_plugins/data/public/search/expressions/create_filter.ts @@ -0,0 +1,80 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { IAggConfig } from 'ui/agg_types'; +import { Filter } from '../../../../../../plugins/data/public'; +import { TabbedTable } from '../tabify'; + +const getOtherBucketFilterTerms = (table: TabbedTable, columnIndex: number, rowIndex: number) => { + if (rowIndex === -1) { + return []; + } + + // get only rows where cell value matches current row for all the fields before columnIndex + const rows = table.rows.filter(row => { + return table.columns.every((column, i) => { + return row[column.id] === table.rows[rowIndex][column.id] || i >= columnIndex; + }); + }); + const terms = rows.map(row => row[table.columns[columnIndex].id]); + + return [ + ...new Set( + terms.filter(term => { + const notOther = term !== '__other__'; + const notMissing = term !== '__missing__'; + return notOther && notMissing; + }) + ), + ]; +}; + +const createFilter = ( + aggConfigs: IAggConfig[], + table: TabbedTable, + columnIndex: number, + rowIndex: number, + cellValue: any +) => { + const column = table.columns[columnIndex]; + const aggConfig = aggConfigs[columnIndex]; + let filter: Filter[] = []; + const value: any = rowIndex > -1 ? table.rows[rowIndex][column.id] : cellValue; + if (value === null || value === undefined || !aggConfig.isFilterable()) { + return; + } + if (aggConfig.type.name === 'terms' && aggConfig.params.otherBucket) { + const terms = getOtherBucketFilterTerms(table, columnIndex, rowIndex); + filter = aggConfig.createFilter(value, { terms }); + } else { + filter = aggConfig.createFilter(value); + } + + if (!filter) { + return; + } + + if (!Array.isArray(filter)) { + filter = [filter]; + } + + return filter; +}; + +export { createFilter }; diff --git a/src/legacy/core_plugins/data/public/search/expressions/esaggs.ts b/src/legacy/core_plugins/data/public/search/expressions/esaggs.ts index 24dd1c4944bfb..bb954cb887ef3 100644 --- a/src/legacy/core_plugins/data/public/search/expressions/esaggs.ts +++ b/src/legacy/core_plugins/data/public/search/expressions/esaggs.ts @@ -38,7 +38,7 @@ import { } from '../../../../../../plugins/data/public'; import { buildTabularInspectorData } from './build_tabular_inspector_data'; -import { calculateObjectHash } from '../../../../visualizations/public'; +import { calculateObjectHash } from '../../../../../../plugins/kibana_utils/common'; import { tabifyAggResponse } from '../../../../../core_plugins/data/public'; import { PersistedState } from '../../../../../../plugins/visualizations/public'; import { Adapters } from '../../../../../../plugins/inspector/public'; diff --git a/src/legacy/core_plugins/data/public/search/mocks.ts b/src/legacy/core_plugins/data/public/search/mocks.ts index 86b6a928dc5b4..46c26dc8f1bd0 100644 --- a/src/legacy/core_plugins/data/public/search/mocks.ts +++ b/src/legacy/core_plugins/data/public/search/mocks.ts @@ -17,8 +17,11 @@ * under the License. */ +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { coreMock } from '../../../../../../src/core/public/mocks'; import { SearchSetup, SearchStart } from './search_service'; import { AggTypesRegistrySetup, AggTypesRegistryStart } from './aggs/agg_types_registry'; +import { getCalculateAutoTimeExpression } from './aggs'; import { AggConfigs } from './aggs/agg_configs'; import { mockAggTypesRegistry } from './aggs/test_helpers'; @@ -41,12 +44,12 @@ const aggTypeConfigMock = () => ({ params: [aggTypeBaseParamMock()], }); -export const aggTypesRegistrySetupMock = (): MockedKeys => ({ +export const aggTypesRegistrySetupMock = (): AggTypesRegistrySetup => ({ registerBucket: jest.fn(), registerMetric: jest.fn(), }); -export const aggTypesRegistryStartMock = (): MockedKeys => ({ +export const aggTypesRegistryStartMock = (): AggTypesRegistryStart => ({ get: jest.fn().mockImplementation(aggTypeConfigMock), getBuckets: jest.fn().mockImplementation(() => [aggTypeConfigMock()]), getMetrics: jest.fn().mockImplementation(() => [aggTypeConfigMock()]), @@ -56,17 +59,18 @@ export const aggTypesRegistryStartMock = (): MockedKeys = })), }); -export const searchSetupMock = (): MockedKeys => ({ +export const searchSetupMock = (): SearchSetup => ({ aggs: { + calculateAutoTimeExpression: getCalculateAutoTimeExpression(coreMock.createSetup().uiSettings), types: aggTypesRegistrySetupMock(), }, }); -export const searchStartMock = (): MockedKeys => ({ +export const searchStartMock = (): SearchStart => ({ aggs: { + calculateAutoTimeExpression: getCalculateAutoTimeExpression(coreMock.createStart().uiSettings), createAggConfigs: jest.fn().mockImplementation((indexPattern, configStates = [], schemas) => { return new AggConfigs(indexPattern, configStates, { - schemas, typesRegistry: mockAggTypesRegistry(), }); }), @@ -78,7 +82,6 @@ export const searchStartMock = (): MockedKeys => ({ FieldParamType: jest.fn(), MetricAggType: jest.fn(), parentPipelineAggHelper: jest.fn() as any, - setBounds: jest.fn(), siblingPipelineAggHelper: jest.fn() as any, }, }, diff --git a/src/legacy/core_plugins/data/public/search/search_service.ts b/src/legacy/core_plugins/data/public/search/search_service.ts index 6754c0e3551af..2d01ac446d951 100644 --- a/src/legacy/core_plugins/data/public/search/search_service.ts +++ b/src/legacy/core_plugins/data/public/search/search_service.ts @@ -29,14 +29,15 @@ import { AggConfigs, CreateAggConfigParams, FieldParamType, + getCalculateAutoTimeExpression, MetricAggType, aggTypeFieldFilters, - setBounds, parentPipelineAggHelper, siblingPipelineAggHelper, } from './aggs'; interface AggsSetup { + calculateAutoTimeExpression: ReturnType; types: AggTypesRegistrySetup; } @@ -47,11 +48,11 @@ interface AggsStartLegacy { FieldParamType: typeof FieldParamType; MetricAggType: typeof MetricAggType; parentPipelineAggHelper: typeof parentPipelineAggHelper; - setBounds: typeof setBounds; siblingPipelineAggHelper: typeof siblingPipelineAggHelper; } interface AggsStart { + calculateAutoTimeExpression: ReturnType; createAggConfigs: ( indexPattern: IndexPattern, configStates?: CreateAggConfigParams[], @@ -85,6 +86,7 @@ export class SearchService { return { aggs: { + calculateAutoTimeExpression: getCalculateAutoTimeExpression(core.uiSettings), types: aggTypesSetup, }, }; @@ -94,9 +96,9 @@ export class SearchService { const aggTypesStart = this.aggTypesRegistry.start(); return { aggs: { + calculateAutoTimeExpression: getCalculateAutoTimeExpression(core.uiSettings), createAggConfigs: (indexPattern, configStates = [], schemas) => { return new AggConfigs(indexPattern, configStates, { - schemas, typesRegistry: aggTypesStart, }); }, @@ -108,7 +110,6 @@ export class SearchService { FieldParamType, MetricAggType, parentPipelineAggHelper, // TODO make static - setBounds, // TODO make static siblingPipelineAggHelper, // TODO make static }, }, diff --git a/src/legacy/core_plugins/data/public/search/tabify/get_columns.test.ts b/src/legacy/core_plugins/data/public/search/tabify/get_columns.test.ts index 6c5dc790ef976..b7dadc3f65d82 100644 --- a/src/legacy/core_plugins/data/public/search/tabify/get_columns.test.ts +++ b/src/legacy/core_plugins/data/public/search/tabify/get_columns.test.ts @@ -19,7 +19,7 @@ import { tabifyGetColumns } from './get_columns'; import { TabbedAggColumn } from './types'; -import { AggConfigs, AggGroupNames, Schemas } from '../aggs'; +import { AggConfigs } from '../aggs'; import { mockAggTypesRegistry, mockDataServices } from '../aggs/test_helpers'; describe('get columns', () => { @@ -45,26 +45,10 @@ describe('get columns', () => { return new AggConfigs(indexPattern, aggs, { typesRegistry, - schemas: new Schemas([ - { - group: AggGroupNames.Metrics, - name: 'metric', - min: 1, - defaults: [{ schema: 'metric', type: 'count' }], - }, - ]).all, }); }; - test('should inject a count metric if no aggs exist', () => { - const columns = tabifyGetColumns(createAggConfigs().aggs, true); - - expect(columns).toHaveLength(1); - expect(columns[0]).toHaveProperty('aggConfig'); - expect(columns[0].aggConfig.type).toHaveProperty('name', 'count'); - }); - - test('should inject a count metric if only buckets exist', () => { + test('should inject the metric after each bucket if the vis is hierarchical', () => { const columns = tabifyGetColumns( createAggConfigs([ { @@ -72,18 +56,6 @@ describe('get columns', () => { schema: 'segment', params: { field: '@timestamp', interval: '10s' }, }, - ]).aggs, - true - ); - - expect(columns).toHaveLength(2); - expect(columns[1]).toHaveProperty('aggConfig'); - expect(columns[1].aggConfig.type).toHaveProperty('name', 'count'); - }); - - test('should inject the metric after each bucket if the vis is hierarchical', () => { - const columns = tabifyGetColumns( - createAggConfigs([ { type: 'date_histogram', schema: 'segment', @@ -100,9 +72,7 @@ describe('get columns', () => { params: { field: '@timestamp', interval: '10s' }, }, { - type: 'date_histogram', - schema: 'segment', - params: { field: '@timestamp', interval: '10s' }, + type: 'count', }, ]).aggs, false diff --git a/src/legacy/core_plugins/data/public/search/tabify/response_writer.test.ts b/src/legacy/core_plugins/data/public/search/tabify/response_writer.test.ts index 94301eedac74a..91835bc948abb 100644 --- a/src/legacy/core_plugins/data/public/search/tabify/response_writer.test.ts +++ b/src/legacy/core_plugins/data/public/search/tabify/response_writer.test.ts @@ -18,7 +18,7 @@ */ import { TabbedAggResponseWriter } from './response_writer'; -import { AggConfigs, AggGroupNames, Schemas, BUCKET_TYPES } from '../aggs'; +import { AggConfigs, BUCKET_TYPES } from '../aggs'; import { mockDataServices, mockAggTypesRegistry } from '../aggs/test_helpers'; import { TabbedResponseWriterOptions } from './types'; @@ -39,6 +39,7 @@ describe('TabbedAggResponseWriter class', () => { field: 'geo.src', }, }, + { type: 'count' }, ]; const twoSplitsAggConfig = [ @@ -54,6 +55,7 @@ describe('TabbedAggResponseWriter class', () => { field: 'machine.os.raw', }, }, + { type: 'count' }, ]; const createResponseWritter = (aggs: any[] = [], opts?: Partial) => { @@ -73,14 +75,6 @@ describe('TabbedAggResponseWriter class', () => { return new TabbedAggResponseWriter( new AggConfigs(indexPattern, aggs, { typesRegistry, - schemas: new Schemas([ - { - group: AggGroupNames.Metrics, - name: 'metric', - min: 1, - defaults: [{ schema: 'metric', type: 'count' }], - }, - ]).all, }), { metricsAtAllLevels: false, diff --git a/src/legacy/core_plugins/data/public/search/tabify/tabify.test.ts b/src/legacy/core_plugins/data/public/search/tabify/tabify.test.ts index db4ad3bdea96b..7e7748c00ab43 100644 --- a/src/legacy/core_plugins/data/public/search/tabify/tabify.test.ts +++ b/src/legacy/core_plugins/data/public/search/tabify/tabify.test.ts @@ -19,7 +19,7 @@ import { IndexPattern } from '../../../../../../plugins/data/public'; import { tabifyAggResponse } from './tabify'; -import { IAggConfig, IAggConfigs, AggGroupNames, Schemas, AggConfigs } from '../aggs'; +import { IAggConfig, IAggConfigs, AggConfigs } from '../aggs'; import { mockAggTypesRegistry } from '../aggs/test_helpers'; import { metricOnly, threeTermBuckets } from 'fixtures/fake_hierarchical_data'; @@ -42,21 +42,13 @@ describe('tabifyAggResponse Integration', () => { return new AggConfigs(indexPattern, aggs, { typesRegistry, - schemas: new Schemas([ - { - group: AggGroupNames.Metrics, - name: 'metric', - min: 1, - defaults: [{ schema: 'metric', type: 'count' }], - }, - ]).all, }); }; const mockAggConfig = (agg: any): IAggConfig => (agg as unknown) as IAggConfig; test('transforms a simple response properly', () => { - const aggConfigs = createAggConfigs(); + const aggConfigs = createAggConfigs([{ type: 'count' } as any]); const resp = tabifyAggResponse(aggConfigs, metricOnly, { metricsAtAllLevels: true, diff --git a/src/legacy/core_plugins/input_control_vis/public/components/editor/field_select.tsx b/src/legacy/core_plugins/input_control_vis/public/components/editor/field_select.tsx index bde2f09ab0a47..68cca9bf6c4f2 100644 --- a/src/legacy/core_plugins/input_control_vis/public/components/editor/field_select.tsx +++ b/src/legacy/core_plugins/input_control_vis/public/components/editor/field_select.tsx @@ -22,13 +22,13 @@ import React, { Component } from 'react'; import { InjectedIntlProps } from 'react-intl'; import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; -import { EuiFormRow, EuiComboBox, EuiComboBoxOptionProps } from '@elastic/eui'; +import { EuiFormRow, EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui'; import { IIndexPattern, IFieldType } from '../../../../../../plugins/data/public'; interface FieldSelectUiState { isLoading: boolean; - fields: Array>; + fields: Array>; indexPatternId: string; } @@ -105,7 +105,7 @@ class FieldSelectUi extends Component { } const fieldsByTypeMap = new Map(); - const fields: Array> = []; + const fields: Array> = []; indexPattern.fields .filter(this.props.filterField ?? (() => true)) .forEach((field: IFieldType) => { @@ -135,7 +135,7 @@ class FieldSelectUi extends Component { }); }, 300); - onChange = (selectedOptions: Array>) => { + onChange = (selectedOptions: Array>) => { this.props.onChange(_.get(selectedOptions, '0.value')); }; diff --git a/src/legacy/core_plugins/input_control_vis/public/components/vis/list_control.tsx b/src/legacy/core_plugins/input_control_vis/public/components/vis/list_control.tsx index d01cef15ea41b..6ded66917a3fd 100644 --- a/src/legacy/core_plugins/input_control_vis/public/components/vis/list_control.tsx +++ b/src/legacy/core_plugins/input_control_vis/public/components/vis/list_control.tsx @@ -76,7 +76,7 @@ class ListControlUi extends PureComponent { + setTextInputRef = (ref: HTMLInputElement | null) => { this.textInput = ref; }; diff --git a/src/legacy/core_plugins/input_control_vis/public/input_control_vis_type.ts b/src/legacy/core_plugins/input_control_vis/public/input_control_vis_type.ts index 9473ea5a20b35..dae6c9abb625e 100644 --- a/src/legacy/core_plugins/input_control_vis/public/input_control_vis_type.ts +++ b/src/legacy/core_plugins/input_control_vis/public/input_control_vis_type.ts @@ -22,8 +22,9 @@ import { i18n } from '@kbn/i18n'; import { createInputControlVisController } from './vis_controller'; import { getControlsTab } from './components/editor/controls_tab'; import { OptionsTab } from './components/editor/options_tab'; -import { Status, defaultFeedbackMessage } from '../../visualizations/public'; +import { Status } from '../../visualizations/public'; import { InputControlVisDependencies } from './plugin'; +import { defaultFeedbackMessage } from '../../../../plugins/kibana_utils/common'; export function createInputControlVisTypeDefinition(deps: InputControlVisDependencies) { const InputControlVisController = createInputControlVisController(deps); @@ -34,7 +35,7 @@ export function createInputControlVisTypeDefinition(deps: InputControlVisDepende title: i18n.translate('inputControl.register.controlsTitle', { defaultMessage: 'Controls', }), - icon: 'visControls', + icon: 'controlsHorizontal', description: i18n.translate('inputControl.register.controlsDescription', { defaultMessage: 'Create interactive controls for easy dashboard manipulation.', }), diff --git a/src/legacy/core_plugins/input_control_vis/public/plugin.ts b/src/legacy/core_plugins/input_control_vis/public/plugin.ts index e9ffad8b35f21..e85ccd94f9e6a 100644 --- a/src/legacy/core_plugins/input_control_vis/public/plugin.ts +++ b/src/legacy/core_plugins/input_control_vis/public/plugin.ts @@ -59,7 +59,7 @@ export class InputControlVisPlugin implements Plugin, void> { }; expressions.registerFunction(createInputControlVisFn); - visualizations.types.createBaseVisualization( + visualizations.createBaseVisualization( createInputControlVisTypeDefinition(visualizationDependencies) ); } diff --git a/src/legacy/core_plugins/kibana/index.js b/src/legacy/core_plugins/kibana/index.js index 221133a17d59a..092eed924f330 100644 --- a/src/legacy/core_plugins/kibana/index.js +++ b/src/legacy/core_plugins/kibana/index.js @@ -201,18 +201,6 @@ export default function(kibana) { return `/goto/${encodeURIComponent(obj.id)}`; }, }, - config: { - isImportableAndExportable: true, - getInAppUrl() { - return { - path: `/app/kibana#/management/kibana/settings`, - uiCapabilitiesPath: 'advancedSettings.show', - }; - }, - getTitle(obj) { - return `Advanced Settings [${obj.id}]`; - }, - }, }, savedObjectSchemas: { diff --git a/src/legacy/core_plugins/kibana/public/.eslintrc.js b/src/legacy/core_plugins/kibana/public/.eslintrc.js index b3ee0a8fa7b04..e7171a5291d26 100644 --- a/src/legacy/core_plugins/kibana/public/.eslintrc.js +++ b/src/legacy/core_plugins/kibana/public/.eslintrc.js @@ -77,7 +77,7 @@ module.exports = { { basePath: path.resolve(__dirname, '../../../../../'), zones: topLevelRestricedZones.concat( - buildRestrictedPaths(['visualize', 'discover', 'dashboard', 'devTools', 'home']) + buildRestrictedPaths(['visualize', 'discover', 'dashboard', 'devTools']) ), }, ], diff --git a/src/legacy/core_plugins/kibana/public/discover/build_services.ts b/src/legacy/core_plugins/kibana/public/discover/build_services.ts index 6b0d2368cc1a2..c58307adaf38c 100644 --- a/src/legacy/core_plugins/kibana/public/discover/build_services.ts +++ b/src/legacy/core_plugins/kibana/public/discover/build_services.ts @@ -33,11 +33,10 @@ import { import { DiscoverStartPlugins } from './plugin'; import { SharePluginStart } from '../../../../../plugins/share/public'; -import { SavedSearch } from './np_ready/types'; import { DocViewsRegistry } from './np_ready/doc_views/doc_views_registry'; import { ChartsPluginStart } from '../../../../../plugins/charts/public'; import { VisualizationsStart } from '../../../visualizations/public'; -import { createSavedSearchesLoader } from '../../../../../plugins/discover/public'; +import { createSavedSearchesLoader, SavedSearch } from '../../../../../plugins/discover/public'; export interface DiscoverServices { addBasePath: (path: string) => string; diff --git a/src/legacy/core_plugins/kibana/public/discover/get_inner_angular.ts b/src/legacy/core_plugins/kibana/public/discover/get_inner_angular.ts index 9c29e182c55d6..76d475c4f7f96 100644 --- a/src/legacy/core_plugins/kibana/public/discover/get_inner_angular.ts +++ b/src/legacy/core_plugins/kibana/public/discover/get_inner_angular.ts @@ -22,15 +22,9 @@ // They can stay even after NP cutover import angular from 'angular'; import { EuiIcon } from '@elastic/eui'; -// @ts-ignore -import { StateProvider } from 'ui/state_management/state'; import { i18nDirective, i18nFilter, I18nProvider } from '@kbn/i18n/angular'; import { CoreStart, LegacyCoreStart, IUiSettingsClient } from 'kibana/public'; // @ts-ignore -import { AppStateProvider } from 'ui/state_management/app_state'; -// @ts-ignore -import { GlobalStateProvider } from 'ui/state_management/global_state'; -// @ts-ignore import { StateManagementConfigProvider } from 'ui/state_management/config_provider'; // @ts-ignore import { KbnUrlProvider, RedirectWhenMissingProvider } from 'ui/url'; @@ -117,8 +111,6 @@ export function initializeInnerAngularModule( createLocalConfigModule(core.uiSettings); createLocalKbnUrlModule(); createLocalTopNavModule(navigation); - createLocalGlobalStateModule(); - createLocalAppStateModule(); createLocalStorageModule(); createElasticSearchModule(data); createPagerFactoryModule(); @@ -136,6 +128,7 @@ export function initializeInnerAngularModule( 'discoverPrivate', 'discoverDocTable', 'discoverPagerFactory', + 'discoverPromise', ]) .config(watchMultiDecorator) .directive('icon', reactDirective => reactDirective(EuiIcon)) @@ -153,9 +146,8 @@ export function initializeInnerAngularModule( 'discoverConfig', 'discoverI18n', 'discoverPrivate', + 'discoverPromise', 'discoverTopNav', - 'discoverGlobalState', - 'discoverAppState', 'discoverLocalStorageProvider', 'discoverEs', 'discoverDocTable', @@ -178,19 +170,6 @@ export function initializeInnerAngularModule( .service('debounce', ['$timeout', DebounceProviderTimeout]); } -export function createLocalGlobalStateModule() { - angular - .module('discoverGlobalState', [ - 'discoverPrivate', - 'discoverConfig', - 'discoverKbnUrl', - 'discoverPromise', - ]) - .service('globalState', function(Private: IPrivate) { - return Private(GlobalStateProvider); - }); -} - function createLocalKbnUrlModule() { angular .module('discoverKbnUrl', ['discoverPrivate', 'ngRoute']) @@ -236,26 +215,6 @@ function createLocalI18nModule() { .directive('i18nId', i18nDirective); } -function createLocalAppStateModule() { - angular - .module('discoverAppState', [ - 'discoverGlobalState', - 'discoverPrivate', - 'discoverConfig', - 'discoverKbnUrl', - 'discoverPromise', - ]) - .service('AppState', function(Private: IPrivate) { - return Private(AppStateProvider); - }) - .service('getAppState', function(Private: any) { - return Private(AppStateProvider).getAppState; - }) - .service('State', function(Private: any) { - return Private(StateProvider); - }); -} - function createLocalStorageModule() { angular .module('discoverLocalStorageProvider', ['discoverPrivate']) @@ -287,7 +246,6 @@ function createDocTableModule() { .module('discoverDocTable', [ 'discoverKbnUrl', 'discoverConfig', - 'discoverAppState', 'discoverPagerFactory', 'react', ]) diff --git a/src/legacy/core_plugins/kibana/public/discover/kibana_services.ts b/src/legacy/core_plugins/kibana/public/discover/kibana_services.ts index 91b5c7f13dc95..6947d985be436 100644 --- a/src/legacy/core_plugins/kibana/public/discover/kibana_services.ts +++ b/src/legacy/core_plugins/kibana/public/discover/kibana_services.ts @@ -50,18 +50,15 @@ export function setServices(newServices: any) { // EXPORT legacy static dependencies, should be migrated when available in a new version; export { angular }; export { wrapInI18nContext } from 'ui/i18n'; -export { buildVislibDimensions } from '../../../visualizations/public'; export { getRequestInspectorStats, getResponseInspectorStats } from '../../../data/public'; // @ts-ignore export { intervalOptions } from 'ui/agg_types'; -export { stateMonitorFactory } from 'ui/state_management/state_monitor_factory'; export { subscribeWithScope } from 'ui/utils/subscribe_with_scope'; // @ts-ignore export { timezoneProvider } from 'ui/vis/lib/timezone'; export { tabifyAggResponse } from '../../../data/public'; export { unhashUrl } from '../../../../../plugins/kibana_utils/public'; export { - migrateLegacyQuery, ensureDefaultIndexPattern, formatMsg, formatStack, @@ -81,7 +78,6 @@ export { SortDirection, } from '../../../../../plugins/data/public'; export { ElasticSearchHit } from './np_ready/doc_views/doc_views_types'; -export { registerTimefilterWithGlobalStateFactory } from 'ui/timefilter/setup_router'; export { getFormat } from 'ui/visualize/loader/pipeline_helpers/utilities'; // @ts-ignore export { buildPointSeriesData } from 'ui/agg_response/point_series/point_series'; diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/discover.html b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/discover.html index 3fd3c5b5b7633..2d44b12989228 100644 --- a/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/discover.html +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/discover.html @@ -5,25 +5,22 @@

{{screenTitle}}

-