diff --git a/.eslintrc.js b/.eslintrc.js index cb15855a38e00..036b2123ee254 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -94,6 +94,22 @@ const SAFER_LODASH_SET_DEFINITELYTYPED_HEADER = ` */ `; +const KBN_HANDLEBARS_HEADER = ` +/* + * Elasticsearch B.V licenses this file to you under the MIT License. + * See \`packages/kbn-handlebars/LICENSE\` for more information. + */ +`; + +const KBN_HANDLEBARS_HANDLEBARS_HEADER = ` +/* + * This file is forked from the handlebars project (https://github.com/handlebars-lang/handlebars.js), + * and may include modifications made by Elasticsearch B.V. + * Elasticsearch B.V. licenses this file to you under the MIT License. + * See \`packages/kbn-handlebars/LICENSE\` for more information. + */ +`; + const packagePkgJsons = globby.sync('*/package.json', { cwd: Path.resolve(__dirname, 'packages'), absolute: true, @@ -293,6 +309,8 @@ module.exports = { SAFER_LODASH_SET_HEADER, SAFER_LODASH_SET_LODASH_HEADER, SAFER_LODASH_SET_DEFINITELYTYPED_HEADER, + KBN_HANDLEBARS_HEADER, + KBN_HANDLEBARS_HANDLEBARS_HEADER, ], }, ], @@ -325,6 +343,8 @@ module.exports = { SAFER_LODASH_SET_HEADER, SAFER_LODASH_SET_LODASH_HEADER, SAFER_LODASH_SET_DEFINITELYTYPED_HEADER, + KBN_HANDLEBARS_HEADER, + KBN_HANDLEBARS_HANDLEBARS_HEADER, ], }, ], @@ -364,6 +384,8 @@ module.exports = { SAFER_LODASH_SET_HEADER, SAFER_LODASH_SET_LODASH_HEADER, SAFER_LODASH_SET_DEFINITELYTYPED_HEADER, + KBN_HANDLEBARS_HEADER, + KBN_HANDLEBARS_HANDLEBARS_HEADER, ], }, ], @@ -393,6 +415,8 @@ module.exports = { OLD_ELASTIC_LICENSE_HEADER, SAFER_LODASH_SET_HEADER, SAFER_LODASH_SET_DEFINITELYTYPED_HEADER, + KBN_HANDLEBARS_HEADER, + KBN_HANDLEBARS_HANDLEBARS_HEADER, ], }, ], @@ -418,6 +442,8 @@ module.exports = { OLD_ELASTIC_LICENSE_HEADER, SAFER_LODASH_SET_LODASH_HEADER, SAFER_LODASH_SET_DEFINITELYTYPED_HEADER, + KBN_HANDLEBARS_HEADER, + KBN_HANDLEBARS_HANDLEBARS_HEADER, ], }, ], @@ -443,6 +469,66 @@ module.exports = { OLD_DUAL_LICENSE_HEADER, SAFER_LODASH_SET_HEADER, SAFER_LODASH_SET_LODASH_HEADER, + KBN_HANDLEBARS_HEADER, + KBN_HANDLEBARS_HANDLEBARS_HEADER, + ], + }, + ], + }, + }, + + /** + * @kbn/handlebars package requires special license headers + */ + { + files: ['packages/kbn-handlebars/**/*.{js,mjs,ts,tsx}'], + rules: { + '@kbn/eslint/require-license-header': [ + 'error', + { + license: KBN_HANDLEBARS_HEADER, + }, + ], + '@kbn/eslint/disallow-license-headers': [ + 'error', + { + licenses: [ + APACHE_2_0_LICENSE_HEADER, + DUAL_LICENSE_HEADER, + ELASTIC_LICENSE_HEADER, + OLD_DUAL_LICENSE_HEADER, + OLD_ELASTIC_LICENSE_HEADER, + SAFER_LODASH_SET_HEADER, + SAFER_LODASH_SET_LODASH_HEADER, + SAFER_LODASH_SET_DEFINITELYTYPED_HEADER, + KBN_HANDLEBARS_HANDLEBARS_HEADER, + ], + }, + ], + }, + }, + { + files: ['packages/kbn-handlebars/src/upstream/**/*.{js,mjs,ts,tsx}'], + rules: { + '@kbn/eslint/require-license-header': [ + 'error', + { + license: KBN_HANDLEBARS_HANDLEBARS_HEADER, + }, + ], + '@kbn/eslint/disallow-license-headers': [ + 'error', + { + licenses: [ + APACHE_2_0_LICENSE_HEADER, + DUAL_LICENSE_HEADER, + ELASTIC_LICENSE_HEADER, + OLD_DUAL_LICENSE_HEADER, + OLD_ELASTIC_LICENSE_HEADER, + SAFER_LODASH_SET_HEADER, + SAFER_LODASH_SET_LODASH_HEADER, + SAFER_LODASH_SET_DEFINITELYTYPED_HEADER, + KBN_HANDLEBARS_HEADER, ], }, ], @@ -957,6 +1043,13 @@ module.exports = { // to help deprecation and prevent accidental re-use/continued use of code we plan on removing. If you are // finding yourself turning this off a lot for "new code" consider renaming the file and functions if it is has valid uses. patterns: ['*legacy*'], + paths: [ + { + name: 'react-router-dom', + importNames: ['Route'], + message: "import { Route } from '@kbn/kibana-react-plugin/public'", + }, + ], }, ], }, diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index abd63289e0480..b07c172f615a3 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -187,7 +187,7 @@ /x-pack/test/screenshot_creation/apps/ml_docs @elastic/ml-ui /x-pack/test/screenshot_creation/services/ml_screenshots.ts @elastic/ml-ui -# Additional plugins maintained by the ML team. +# Additional plugins and packages maintained by the ML team. /x-pack/plugins/aiops/ @elastic/ml-ui /x-pack/plugins/data_visualizer/ @elastic/ml-ui /x-pack/plugins/file_upload/ @elastic/ml-ui @@ -198,6 +198,8 @@ /x-pack/test/functional/apps/transform/ @elastic/ml-ui /x-pack/test/functional/services/transform/ @elastic/ml-ui /x-pack/test/functional_basic/apps/transform/ @elastic/ml-ui +/packages/kbn-aiops-utils @elastic/ml-ui +/examples/response_stream/ @elastic/ml-ui # Maps #CC# /x-pack/plugins/maps/ @elastic/kibana-gis @@ -324,6 +326,7 @@ # Kibana Platform Security /packages/kbn-crypto/ @elastic/kibana-security +/packages/kbn-handlebars/ @elastic/kibana-security /src/core/server/csp/ @elastic/kibana-security @elastic/kibana-core /src/plugins/interactive_setup/ @elastic/kibana-security /test/interactive_setup_api_integration/ @elastic/kibana-security diff --git a/api_docs/deprecations_by_api.mdx b/api_docs/deprecations_by_api.mdx index a9ce0254cea52..e71454b74d697 100644 --- a/api_docs/deprecations_by_api.mdx +++ b/api_docs/deprecations_by_api.mdx @@ -3,7 +3,7 @@ id: kibDevDocsDeprecationsByApi slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-api title: Deprecated API usage by API summary: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2022-04-26 +date: 2022-05-23 tags: ['contributor', 'dev', 'apidocs', 'kibana'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. --- @@ -14,14 +14,14 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Referencing plugin(s) | Remove By | | ---------------|-----------|-----------| | | dataViews, maps, data | - | -| | dataViews, unifiedSearch, maps, data | - | +| | dataViews, maps, data | - | | | dataViews, discover, ux, savedObjects, dataViewEditor, maps, visDefaultEditor, data | - | | | dataViews, dataViewEditor, maps, visDefaultEditor, data | - | | | dataViews, unifiedSearch | - | | | dataViews, canvas | - | | | dataViews, unifiedSearch, data | - | | | dataViews, canvas, data | - | -| | dataViews, unifiedSearch, maps, data | - | +| | dataViews, maps, data | - | | | dataViews, dataViewEditor, maps, visDefaultEditor, data | - | | | dataViews, maps, data | - | | | dataViews | - | @@ -38,16 +38,17 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | dataViewManagement, dataViews | - | | | visTypeTimeseries, graph, dataViewManagement, dataViews | - | | | dataViews, dataViewManagement | - | +| | discover, visualizations, dashboard, lens, maps, monitoring | - | | | unifiedSearch, discover, maps, infra, graph, securitySolution, stackAlerts, inputControlVis, savedObjects | - | | | maps | - | | | data, infra, maps | - | -| | discover | - | -| | discover | - | +| | alerting, discover, securitySolution | - | +| | alerting, discover, securitySolution | - | | | data, discover, embeddable | - | | | advancedSettings, discover | - | | | advancedSettings, discover | - | -| | management, observability, infra, apm, cloudSecurityPosture, enterpriseSearch, securitySolution, synthetics, ux, kibanaOverview | - | -| | esUiShared, home, spaces, fleet, visualizations, lens, observability, dataEnhanced, ml, apm, cloudSecurityPosture, indexLifecycleManagement, synthetics, upgradeAssistant, ux, kibanaOverview, savedObjectsManagement | - | +| | management, observability, infra, apm, cloudSecurityPosture, enterpriseSearch, synthetics, ux, kibanaOverview | - | +| | esUiShared, home, data, spaces, fleet, visualizations, lens, observability, ml, apm, cloudSecurityPosture, indexLifecycleManagement, synthetics, upgradeAssistant, ux, kibanaOverview, savedObjectsManagement | - | | | canvas, visTypeXy | - | | | canvas | - | | | canvas | - | @@ -58,11 +59,12 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | canvas | - | | | canvas | - | | | canvas, visTypeXy | - | -| | management, spaces, observability, ml, canvas, cloudSecurityPosture, enterpriseSearch, osquery, securitySolution, kibanaOverview | - | +| | management, spaces, observability, ml, canvas, cloudSecurityPosture, enterpriseSearch, osquery, kibanaOverview | - | +| | actions, alerting | - | +| | encryptedSavedObjects, actions, data, cloud, ml, logstash, securitySolution | - | | | dashboard, lens, stackAlerts, visTypeTable, visTypeTimeseries, visTypeXy, visTypeVislib, expressionPartitionVis | - | -| | visTypeTimeseries, graph, dataViewManagement | - | -| | encryptedSavedObjects, actions, cloud, ml, dataEnhanced, logstash, securitySolution | - | | | dashboard | - | +| | visTypeTimeseries, graph, dataViewManagement | - | | | visTypeTimeseries | - | | | dataViewManagement | - | | | dataViewManagement | - | @@ -72,44 +74,36 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | visTypeGauge | - | | | visTypePie | - | | | visTypePie | - | -| | actions, alerting | - | | | console | - | +| | discover, dashboard, lens, urlDrilldown, stackAlerts | 8.1 | +| | discover, dashboard, lens, urlDrilldown, stackAlerts | 8.1 | +| | discover, dashboard, lens, urlDrilldown, stackAlerts | 8.1 | | | unifiedSearch | 8.1 | -| | unifiedSearch, dataEnhanced | 8.1 | -| | unifiedSearch, discover, dashboard, urlDrilldown, stackAlerts | 8.1 | -| | unifiedSearch | 8.1 | -| | unifiedSearch | 8.1 | -| | unifiedSearch, discover, dashboard, urlDrilldown, stackAlerts | 8.1 | -| | unifiedSearch, dataEnhanced | 8.1 | -| | unifiedSearch, discover, dashboard, urlDrilldown, stackAlerts | 8.1 | -| | unifiedSearch, dataEnhanced | 8.1 | -| | discover, stackAlerts, inputControlVis | 8.1 | -| | discover, stackAlerts, inputControlVis | 8.1 | -| | dataEnhanced | 8.1 | +| | stackAlerts, alerting, securitySolution, inputControlVis | 8.1 | +| | stackAlerts, alerting, securitySolution, inputControlVis | 8.1 | | | apm | 8.1 | | | dataViews, unifiedSearch | 8.2 | | | dataViews, unifiedSearch, data | 8.2 | | | visualizations, dashboard, lens, maps, ml, securitySolution, security | 8.8.0 | -| | lens, dashboard, maps | 8.8.0 | +| | dashboard, maps | 8.8.0 | | | embeddable, discover, presentationUtil, dashboard, graph | 8.8.0 | +| | spaces, security, alerting | 8.8.0 | | | spaces, security, actions, alerting, ml, remoteClusters, graph, indexLifecycleManagement, mapsEms, painlessLab, rollup, searchprofiler, snapshotRestore, transform, upgradeAssistant | 8.8.0 | | | apm, security, securitySolution | 8.8.0 | | | apm, security, securitySolution | 8.8.0 | | | securitySolution | 8.8.0 | | | savedObjectsTaggingOss, visualizations, dashboard, lens | 8.8.0 | | | dashboard | 8.8.0 | +| | monitoring | 8.8.0 | +| | monitoring, kibanaUsageCollection | 8.8.0 | | | cloud, apm | 8.8.0 | | | security, licenseManagement, ml, apm, crossClusterReplication, logstash, painlessLab, searchprofiler, watcher | 8.8.0 | | | management, fleet, security, kibanaOverview | 8.8.0 | -| | spaces, security, alerting | 8.8.0 | | | security, fleet | 8.8.0 | | | security, fleet | 8.8.0 | | | security, fleet | 8.8.0 | | | security | 8.8.0 | | | mapsEms | 8.8.0 | -| | visTypeVega | 8.8.0 | -| | monitoring, visTypeVega | 8.8.0 | -| | monitoring, kibanaUsageCollection | 8.8.0 | | | ml | 8.8.0 Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block, @@ -132,6 +126,7 @@ Safe to remove. | ---------------|------------| | | data | | | data | +| | data | | | data | | | data | | | data | @@ -168,12 +163,15 @@ Safe to remove. | | data | | | data | | | data | +| | data | | | data | +| | data | | | data | | | data | | | data | | | data | | | data | +| | data | | | data | | | data | | | data | @@ -181,11 +179,13 @@ Safe to remove. | | data | | | data | | | data | +| | data | | | data | | | data | | | data | | | data | | | data | +| | data | | | dataViews | | | dataViews | | | expressions | @@ -211,5 +211,6 @@ Safe to remove. | | reporting | | | taskManager | | | core | +| | core | | | core | | | core | \ No newline at end of file diff --git a/api_docs/deprecations_by_plugin.mdx b/api_docs/deprecations_by_plugin.mdx index 4904da587db13..f94de1760dd44 100644 --- a/api_docs/deprecations_by_plugin.mdx +++ b/api_docs/deprecations_by_plugin.mdx @@ -3,7 +3,7 @@ id: kibDevDocsDeprecationsByPlugin slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-plugin title: Deprecated API usage by plugin summary: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2022-04-26 +date: 2022-05-23 tags: ['contributor', 'dev', 'apidocs', 'kibana'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. --- @@ -33,6 +33,10 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [wrap_search_source_client.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.ts#:~:text=create) | - | +| | [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch) | 8.1 | +| | [wrap_search_source_client.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.ts#:~:text=create) | - | +| | [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch) | 8.1 | | | [plugin.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/plugin.test.ts#:~:text=getKibanaFeatures) | 8.8.0 | | | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/plugin.ts#:~:text=license%24), [license_state.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/license_state.test.ts#:~:text=license%24), [license_state.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/license_state.test.ts#:~:text=license%24) | 8.8.0 | | | [task.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/usage/task.ts#:~:text=index) | - | @@ -113,6 +117,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [sync_dashboard_filter_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_filter_state.ts#:~:text=syncQueryStateWithUrl), [sync_dashboard_filter_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_filter_state.ts#:~:text=syncQueryStateWithUrl), [dashboard_listing.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/listing/dashboard_listing.tsx#:~:text=syncQueryStateWithUrl), [dashboard_listing.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/listing/dashboard_listing.tsx#:~:text=syncQueryStateWithUrl) | - | | | [export_csv_action.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/actions/export_csv_action.tsx#:~:text=fieldFormats) | - | | | [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [saved_dashboard.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#:~:text=Filter), [saved_dashboard.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter)+ 5 more | 8.1 | | | [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [saved_dashboard.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#:~:text=Filter), [saved_dashboard.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter)+ 5 more | 8.1 | @@ -130,32 +135,21 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [mapping.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/aggs/param_types/mapping.ts#:~:text=IndexPatternField), [mapping.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/aggs/param_types/mapping.ts#:~:text=IndexPatternField), [mapping.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/aggs/param_types/mapping.ts#:~:text=IndexPatternField), [mapping.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/aggs/param_types/mapping.ts#:~:text=IndexPatternField), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/index.ts#:~:text=IndexPatternField), [kibana_context_type.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/expressions/kibana_context_type.ts#:~:text=IndexPatternField), [kibana_context_type.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/expressions/kibana_context_type.ts#:~:text=IndexPatternField), [search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source.ts#:~:text=IndexPatternField), [search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source.ts#:~:text=IndexPatternField), [search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source.ts#:~:text=IndexPatternField)+ 16 more | - | +| | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/index.ts#:~:text=IndexPatternField), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/index.ts#:~:text=IndexPatternField), [kibana_context_type.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/expressions/kibana_context_type.ts#:~:text=IndexPatternField), [kibana_context_type.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/expressions/kibana_context_type.ts#:~:text=IndexPatternField), [search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source.ts#:~:text=IndexPatternField), [search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source.ts#:~:text=IndexPatternField), [search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source.ts#:~:text=IndexPatternField), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/server/index.ts#:~:text=IndexPatternField), [agg_config.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/aggs/agg_config.test.ts#:~:text=IndexPatternField), [agg_config.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/aggs/agg_config.test.ts#:~:text=IndexPatternField)+ 16 more | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/index.ts#:~:text=IndexPatternsContract), [create_search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/create_search_source.ts#:~:text=IndexPatternsContract), [create_search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/create_search_source.ts#:~:text=IndexPatternsContract), [search_source_service.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source_service.ts#:~:text=IndexPatternsContract), [search_source_service.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source_service.ts#:~:text=IndexPatternsContract), [esaggs_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/expressions/esaggs/esaggs_fn.ts#:~:text=IndexPatternsContract), [esaggs_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/expressions/esaggs/esaggs_fn.ts#:~:text=IndexPatternsContract), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/search/types.ts#:~:text=IndexPatternsContract), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/search/types.ts#:~:text=IndexPatternsContract), [create_search_source.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/create_search_source.test.ts#:~:text=IndexPatternsContract)+ 19 more | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/index.ts#:~:text=IndexPatternsService), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/server/index.ts#:~:text=IndexPatternsService), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/server/index.ts#:~:text=IndexPatternsService), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/server/index.ts#:~:text=IndexPatternsService), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/index.ts#:~:text=IndexPatternsService) | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/index.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/types.ts#:~:text=IndexPattern), [search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source.ts#:~:text=IndexPattern), [search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source.ts#:~:text=IndexPattern), [search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source.ts#:~:text=IndexPattern), [tabify_docs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/tabify/tabify_docs.ts#:~:text=IndexPattern), [tabify_docs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/tabify/tabify_docs.ts#:~:text=IndexPattern)+ 89 more | - | -| | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/index.ts#:~:text=IFieldType), [date_histogram.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/aggs/buckets/date_histogram.ts#:~:text=IFieldType), [date_histogram.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/aggs/buckets/date_histogram.ts#:~:text=IFieldType), [generate_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/query/filter_manager/lib/generate_filters.ts#:~:text=IFieldType), [generate_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/query/filter_manager/lib/generate_filters.ts#:~:text=IFieldType), [generate_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/query/filter_manager/lib/generate_filters.ts#:~:text=IFieldType), [generate_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/query/filter_manager/lib/generate_filters.ts#:~:text=IFieldType), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/index.ts#:~:text=IFieldType), [create_filters_from_range_select.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/actions/filters/create_filters_from_range_select.ts#:~:text=IFieldType), [create_filters_from_range_select.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/actions/filters/create_filters_from_range_select.ts#:~:text=IFieldType)+ 6 more | 8.2 | -| | [mapping.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/aggs/param_types/mapping.ts#:~:text=IndexPatternField), [mapping.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/aggs/param_types/mapping.ts#:~:text=IndexPatternField), [mapping.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/aggs/param_types/mapping.ts#:~:text=IndexPatternField), [mapping.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/aggs/param_types/mapping.ts#:~:text=IndexPatternField), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/index.ts#:~:text=IndexPatternField), [kibana_context_type.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/expressions/kibana_context_type.ts#:~:text=IndexPatternField), [kibana_context_type.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/expressions/kibana_context_type.ts#:~:text=IndexPatternField), [search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source.ts#:~:text=IndexPatternField), [search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source.ts#:~:text=IndexPatternField), [search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source.ts#:~:text=IndexPatternField)+ 16 more | - | -| | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/index.ts#:~:text=IIndexPattern), [get_time.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/query/timefilter/get_time.ts#:~:text=IIndexPattern), [get_time.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/query/timefilter/get_time.ts#:~:text=IIndexPattern), [get_time.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/query/timefilter/get_time.ts#:~:text=IIndexPattern), [get_time.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/query/timefilter/get_time.ts#:~:text=IIndexPattern), [normalize_sort_request.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/normalize_sort_request.ts#:~:text=IIndexPattern), [normalize_sort_request.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/normalize_sort_request.ts#:~:text=IIndexPattern), [normalize_sort_request.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/normalize_sort_request.ts#:~:text=IIndexPattern), [search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source.ts#:~:text=IIndexPattern), [search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source.ts#:~:text=IIndexPattern)+ 23 more | - | +| | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/index.ts#:~:text=IFieldType), [generate_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/query/filter_manager/lib/generate_filters.ts#:~:text=IFieldType), [generate_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/query/filter_manager/lib/generate_filters.ts#:~:text=IFieldType), [generate_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/query/filter_manager/lib/generate_filters.ts#:~:text=IFieldType), [generate_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/query/filter_manager/lib/generate_filters.ts#:~:text=IFieldType), [date_histogram.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/aggs/buckets/date_histogram.ts#:~:text=IFieldType), [date_histogram.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/aggs/buckets/date_histogram.ts#:~:text=IFieldType), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/index.ts#:~:text=IFieldType), [create_filters_from_range_select.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/actions/filters/create_filters_from_range_select.ts#:~:text=IFieldType), [create_filters_from_range_select.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/actions/filters/create_filters_from_range_select.ts#:~:text=IFieldType)+ 6 more | 8.2 | +| | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/index.ts#:~:text=IndexPatternField), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/index.ts#:~:text=IndexPatternField), [kibana_context_type.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/expressions/kibana_context_type.ts#:~:text=IndexPatternField), [kibana_context_type.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/expressions/kibana_context_type.ts#:~:text=IndexPatternField), [search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source.ts#:~:text=IndexPatternField), [search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source.ts#:~:text=IndexPatternField), [search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source.ts#:~:text=IndexPatternField), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/server/index.ts#:~:text=IndexPatternField), [agg_config.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/aggs/agg_config.test.ts#:~:text=IndexPatternField), [agg_config.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/aggs/agg_config.test.ts#:~:text=IndexPatternField)+ 16 more | - | +| | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/index.ts#:~:text=IIndexPattern), [get_time.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/query/timefilter/get_time.ts#:~:text=IIndexPattern), [get_time.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/query/timefilter/get_time.ts#:~:text=IIndexPattern), [get_time.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/query/timefilter/get_time.ts#:~:text=IIndexPattern), [get_time.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/query/timefilter/get_time.ts#:~:text=IIndexPattern), [generate_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/query/filter_manager/lib/generate_filters.ts#:~:text=IIndexPattern), [generate_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/query/filter_manager/lib/generate_filters.ts#:~:text=IIndexPattern), [generate_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/query/filter_manager/lib/generate_filters.ts#:~:text=IIndexPattern), [timefilter.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/query/timefilter/timefilter.ts#:~:text=IIndexPattern), [timefilter.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/query/timefilter/timefilter.ts#:~:text=IIndexPattern)+ 23 more | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/index.ts#:~:text=IndexPatternAttributes), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/index.ts#:~:text=IndexPatternAttributes), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/server/index.ts#:~:text=IndexPatternAttributes) | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/index.ts#:~:text=IndexPatternsContract), [create_search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/create_search_source.ts#:~:text=IndexPatternsContract), [create_search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/create_search_source.ts#:~:text=IndexPatternsContract), [search_source_service.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source_service.ts#:~:text=IndexPatternsContract), [search_source_service.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source_service.ts#:~:text=IndexPatternsContract), [esaggs_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/expressions/esaggs/esaggs_fn.ts#:~:text=IndexPatternsContract), [esaggs_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/expressions/esaggs/esaggs_fn.ts#:~:text=IndexPatternsContract), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/search/types.ts#:~:text=IndexPatternsContract), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/search/types.ts#:~:text=IndexPatternsContract), [create_search_source.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/create_search_source.test.ts#:~:text=IndexPatternsContract)+ 19 more | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/index.ts#:~:text=IndexPatternsService), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/server/index.ts#:~:text=IndexPatternsService), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/server/index.ts#:~:text=IndexPatternsService), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/server/index.ts#:~:text=IndexPatternsService), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/index.ts#:~:text=IndexPatternsService) | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/index.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/types.ts#:~:text=IndexPattern), [search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source.ts#:~:text=IndexPattern), [search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source.ts#:~:text=IndexPattern), [search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/search_source/search_source.ts#:~:text=IndexPattern), [tabify_docs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/tabify/tabify_docs.ts#:~:text=IndexPattern), [tabify_docs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/common/search/tabify/tabify_docs.ts#:~:text=IndexPattern)+ 89 more | - | | | [aggs_service.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/server/search/aggs/aggs_service.ts#:~:text=indexPatternsServiceFactory), [esaggs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/server/search/expressions/esaggs.ts#:~:text=indexPatternsServiceFactory), [search_service.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/server/search/search_service.ts#:~:text=indexPatternsServiceFactory) | - | +| | [connected_search_session_indicator.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/connected_search_session_indicator.tsx#:~:text=RedirectAppLinks), [connected_search_session_indicator.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/connected_search_session_indicator.tsx#:~:text=RedirectAppLinks), [connected_search_session_indicator.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/connected_search_session_indicator.tsx#:~:text=RedirectAppLinks), [get_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/search/session/sessions_mgmt/lib/get_columns.tsx#:~:text=RedirectAppLinks), [get_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/search/session/sessions_mgmt/lib/get_columns.tsx#:~:text=RedirectAppLinks), [get_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/search/session/sessions_mgmt/lib/get_columns.tsx#:~:text=RedirectAppLinks) | - | | | [data_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/utils/table_inspector_view/components/data_table.tsx#:~:text=executeTriggerActions), [data_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data/public/utils/table_inspector_view/components/data_table.tsx#:~:text=executeTriggerActions) | - | - - - -## dataEnhanced - -| Deprecated API | Reference location(s) | Remove By | -| ---------------|-----------|-----------| -| | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/types.ts#:~:text=KueryNode), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/types.ts#:~:text=KueryNode), [get_search_session_page.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts#:~:text=KueryNode), [get_search_session_page.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts#:~:text=KueryNode), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=KueryNode), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=KueryNode), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=KueryNode), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=KueryNode), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=KueryNode), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=KueryNode) | 8.1 | -| | [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=nodeBuilder), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=nodeBuilder), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=nodeBuilder), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=nodeBuilder), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=nodeBuilder), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=nodeBuilder), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=nodeBuilder), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=nodeBuilder), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=nodeBuilder), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=nodeBuilder)+ 2 more | 8.1 | -| | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/types.ts#:~:text=KueryNode), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/types.ts#:~:text=KueryNode), [get_search_session_page.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts#:~:text=KueryNode), [get_search_session_page.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts#:~:text=KueryNode), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=KueryNode), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=KueryNode), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=KueryNode), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=KueryNode), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=KueryNode), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=KueryNode) | 8.1 | -| | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/types.ts#:~:text=KueryNode), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/types.ts#:~:text=KueryNode), [get_search_session_page.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts#:~:text=KueryNode), [get_search_session_page.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts#:~:text=KueryNode), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=KueryNode), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=KueryNode), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=KueryNode), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=KueryNode), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=KueryNode), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=KueryNode) | 8.1 | -| | [get_columns.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/get_columns.tsx#:~:text=RedirectAppLinks), [get_columns.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/get_columns.tsx#:~:text=RedirectAppLinks), [get_columns.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/get_columns.tsx#:~:text=RedirectAppLinks), [connected_search_session_indicator.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/connected_search_session_indicator.tsx#:~:text=RedirectAppLinks), [connected_search_session_indicator.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/connected_search_session_indicator.tsx#:~:text=RedirectAppLinks), [connected_search_session_indicator.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/connected_search_session_indicator.tsx#:~:text=RedirectAppLinks) | - | -| | [session_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/session_service.ts#:~:text=authc) | - | +| | [session_service.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data/server/search/session/session_service.ts#:~:text=authc) | - | @@ -197,9 +191,9 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/index.ts#:~:text=IndexPattern), [data_view_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.test.ts#:~:text=IndexPattern), [data_view_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.test.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/public/index.ts#:~:text=IndexPattern), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPattern), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPattern), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPattern), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPattern) | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/index.ts#:~:text=IndexPatternField), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/public/index.ts#:~:text=IndexPatternField), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPatternField), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPatternField), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPatternField), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPatternField), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPatternField), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPatternField), [data_view_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.test.ts#:~:text=IndexPatternField), [data_view_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.test.ts#:~:text=IndexPatternField)+ 2 more | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/index.ts#:~:text=IIndexPattern), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=IIndexPattern), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=IIndexPattern) | - | -| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/types.ts#:~:text=IFieldType), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/types.ts#:~:text=IFieldType)+ 7 more | 8.2 | +| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/index.ts#:~:text=IFieldType), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=IFieldType)+ 7 more | 8.2 | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/index.ts#:~:text=IndexPatternAttributes) | - | -| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/types.ts#:~:text=IFieldType), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/types.ts#:~:text=IFieldType)+ 7 more | 8.2 | +| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/index.ts#:~:text=IFieldType), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=IFieldType)+ 7 more | 8.2 | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/index.ts#:~:text=IIndexPattern), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=IIndexPattern), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=IIndexPattern) | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/index.ts#:~:text=IndexPatternAttributes) | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/index.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/public/index.ts#:~:text=IndexPatternsContract) | - | @@ -228,13 +222,12 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | ---------------|-----------|-----------| | | [view_alert_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/view_alert/view_alert_route.tsx#:~:text=IndexPattern), [view_alert_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/view_alert/view_alert_route.tsx#:~:text=IndexPattern), [view_alert_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/view_alert/view_alert_route.tsx#:~:text=IndexPattern), [view_alert_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/view_alert/view_alert_route.tsx#:~:text=IndexPattern) | - | | | [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=create), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=create) | - | -| | [anchor.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/anchor.ts#:~:text=fetch), [fetch_hits_in_interval.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/utils/fetch_hits_in_interval.ts#:~:text=fetch) | 8.1 | +| | [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=syncQueryStateWithUrl), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=syncQueryStateWithUrl) | - | | | [plugin.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/plugin.tsx#:~:text=indexPatterns) | - | | | [view_alert_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/view_alert/view_alert_route.tsx#:~:text=Filter), [view_alert_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/view_alert/view_alert_route.tsx#:~:text=Filter) | 8.1 | | | [view_alert_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/view_alert/view_alert_route.tsx#:~:text=Filter), [view_alert_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/view_alert/view_alert_route.tsx#:~:text=Filter) | 8.1 | | | [view_alert_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/view_alert/view_alert_route.tsx#:~:text=IndexPattern), [view_alert_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/view_alert/view_alert_route.tsx#:~:text=IndexPattern), [view_alert_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/view_alert/view_alert_route.tsx#:~:text=IndexPattern), [view_alert_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/view_alert/view_alert_route.tsx#:~:text=IndexPattern) | - | | | [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=create), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=create) | - | -| | [anchor.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/anchor.ts#:~:text=fetch), [fetch_hits_in_interval.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/utils/fetch_hits_in_interval.ts#:~:text=fetch) | 8.1 | | | [view_alert_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/view_alert/view_alert_route.tsx#:~:text=IndexPattern), [view_alert_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/view_alert/view_alert_route.tsx#:~:text=IndexPattern) | - | | | [view_alert_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/view_alert/view_alert_route.tsx#:~:text=Filter), [view_alert_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/view_alert/view_alert_route.tsx#:~:text=Filter) | 8.1 | | | [on_save_search.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/top_nav/on_save_search.tsx#:~:text=SavedObjectSaveModal), [on_save_search.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/top_nav/on_save_search.tsx#:~:text=SavedObjectSaveModal) | 8.8.0 | @@ -372,11 +365,14 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [app.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/app.tsx#:~:text=syncQueryStateWithUrl), [app.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/app.tsx#:~:text=syncQueryStateWithUrl) | - | | | [ranges.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/ranges.tsx#:~:text=fieldFormats), [droppable.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/droppable/droppable.test.ts#:~:text=fieldFormats) | - | +| | [open_in_discover_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/trigger_actions/open_in_discover_drilldown.tsx#:~:text=Filter), [open_in_discover_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/trigger_actions/open_in_discover_drilldown.tsx#:~:text=Filter) | 8.1 | +| | [open_in_discover_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/trigger_actions/open_in_discover_drilldown.tsx#:~:text=Filter), [open_in_discover_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/trigger_actions/open_in_discover_drilldown.tsx#:~:text=Filter) | 8.1 | +| | [open_in_discover_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/trigger_actions/open_in_discover_drilldown.tsx#:~:text=Filter), [open_in_discover_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/trigger_actions/open_in_discover_drilldown.tsx#:~:text=Filter) | 8.1 | | | [workspace_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx#:~:text=RedirectAppLinks), [workspace_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx#:~:text=RedirectAppLinks), [workspace_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx#:~:text=RedirectAppLinks) | - | | | [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject) | 8.8.0 | | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/types.ts#:~:text=onAppLeave), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/types.ts#:~:text=onAppLeave), [mounter.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/mounter.tsx#:~:text=onAppLeave) | 8.8.0 | -| | [saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/migrations/saved_object_migrations.ts#:~:text=warning), [saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/migrations/saved_object_migrations.ts#:~:text=warning) | 8.8.0 | @@ -415,6 +411,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract) | - | | | [es_tooltip_property.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts#:~:text=IndexPattern), [es_tooltip_property.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts#:~:text=IndexPattern), [percentile_agg_field.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts#:~:text=IndexPattern), [percentile_agg_field.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts#:~:text=IndexPattern), [get_docvalue_source_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts#:~:text=IndexPattern), [get_docvalue_source_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts#:~:text=IndexPattern), [get_docvalue_source_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts#:~:text=IndexPattern), [es_tooltip_property.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts#:~:text=IndexPattern), [es_tooltip_property.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts#:~:text=IndexPattern), [percentile_agg_field.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts#:~:text=IndexPattern)+ 4 more | - | | | [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField)+ 84 more | - | +| | [global_sync.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/routes/map_page/url_state/global_sync.ts#:~:text=syncQueryStateWithUrl), [global_sync.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/routes/map_page/url_state/global_sync.ts#:~:text=syncQueryStateWithUrl) | - | | | [kibana_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/kibana_services.ts#:~:text=indexPatterns) | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract) | - | | | [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField)+ 84 more | - | @@ -463,6 +460,7 @@ so TS and code-reference navigation might not highlight them. | | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [url_state.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/public/url_state.ts#:~:text=syncQueryStateWithUrl), [url_state.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/public/url_state.ts#:~:text=syncQueryStateWithUrl) | - | | | [legacy_shims.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/public/legacy_shims.ts#:~:text=injectedMetadata) | 8.8.0 | | | [bulk_uploader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/server/kibana_monitoring/bulk_uploader.ts#:~:text=process) | 8.8.0 | @@ -595,9 +593,11 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [wrap_search_source_client.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils/wrap_search_source_client.ts#:~:text=create) | - | +| | [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils/wrap_search_source_client.test.ts#:~:text=fetch) | 8.1 | | | [middleware.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#:~:text=indexPatterns), [dependencies_start_mock.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/mock/endpoint/dependencies_start_mock.ts#:~:text=indexPatterns) | - | -| | [use_primary_navigation.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/use_primary_navigation.tsx#:~:text=KibanaPageTemplateProps), [use_primary_navigation.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/use_primary_navigation.tsx#:~:text=KibanaPageTemplateProps), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/app/home/template_wrapper/bottom_bar/index.tsx#:~:text=KibanaPageTemplateProps), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/app/home/template_wrapper/bottom_bar/index.tsx#:~:text=KibanaPageTemplateProps) | - | -| | [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx#:~:text=KibanaPageTemplate), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx#:~:text=KibanaPageTemplate) | - | +| | [wrap_search_source_client.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils/wrap_search_source_client.ts#:~:text=create) | - | +| | [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils/wrap_search_source_client.test.ts#:~:text=fetch) | 8.1 | | | [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [isolation.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts#:~:text=mode), [isolation.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts#:~:text=mode)+ 2 more | 8.8.0 | | | [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [isolation.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts#:~:text=mode), [isolation.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts#:~:text=mode)+ 2 more | 8.8.0 | | | [request_context_factory.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/request_context_factory.ts#:~:text=authc), [request_context_factory.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/request_context_factory.ts#:~:text=authc), [create_signals_migration_route.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/create_signals_migration_route.ts#:~:text=authc), [delete_signals_migration_route.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/delete_signals_migration_route.ts#:~:text=authc), [finalize_signals_migration_route.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.ts#:~:text=authc), [open_close_signals_route.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/open_close_signals_route.ts#:~:text=authc), [preview_rules_route.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/preview_rules_route.ts#:~:text=authc), [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/timeline/utils/common.ts#:~:text=authc) | - | @@ -634,10 +634,10 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | | [fetch_search_source_query.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/server/alert_types/es_query/lib/fetch_search_source_query.ts#:~:text=fetch), [alert_type.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/server/alert_types/es_query/alert_type.test.ts#:~:text=fetch), [alert_type.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/server/alert_types/es_query/alert_type.test.ts#:~:text=fetch) | 8.1 | | | [entity_index_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx#:~:text=indexPatterns), [boundary_index_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx#:~:text=indexPatterns), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=indexPatterns), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=indexPatterns), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=indexPatterns) | - | | | [expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/threshold/expression.tsx#:~:text=fieldFormats) | - | -| | [read_only_filter_items.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/read_only_filter_items.tsx#:~:text=Filter), [read_only_filter_items.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/read_only_filter_items.tsx#:~:text=Filter), [search_source_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression.tsx#:~:text=Filter), [search_source_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression.tsx#:~:text=Filter) | 8.1 | -| | [read_only_filter_items.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/read_only_filter_items.tsx#:~:text=Filter), [read_only_filter_items.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/read_only_filter_items.tsx#:~:text=Filter), [search_source_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression.tsx#:~:text=Filter), [search_source_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression.tsx#:~:text=Filter) | 8.1 | +| | [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter) | 8.1 | +| | [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter) | 8.1 | | | [fetch_search_source_query.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/server/alert_types/es_query/lib/fetch_search_source_query.ts#:~:text=fetch), [alert_type.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/server/alert_types/es_query/alert_type.test.ts#:~:text=fetch), [alert_type.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/server/alert_types/es_query/alert_type.test.ts#:~:text=fetch) | 8.1 | -| | [read_only_filter_items.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/read_only_filter_items.tsx#:~:text=Filter), [read_only_filter_items.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/read_only_filter_items.tsx#:~:text=Filter), [search_source_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression.tsx#:~:text=Filter), [search_source_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression.tsx#:~:text=Filter) | 8.1 | +| | [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter) | 8.1 | @@ -645,8 +645,8 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [use_no_data_config.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/synthetics/public/apps/use_no_data_config.ts#:~:text=KibanaPageTemplateProps), [use_no_data_config.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/synthetics/public/apps/use_no_data_config.ts#:~:text=KibanaPageTemplateProps) | - | -| | [alert_messages.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/synthetics/public/lib/alert_types/alert_messages.tsx#:~:text=RedirectAppLinks), [alert_messages.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/synthetics/public/lib/alert_types/alert_messages.tsx#:~:text=RedirectAppLinks), [alert_messages.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/synthetics/public/lib/alert_types/alert_messages.tsx#:~:text=RedirectAppLinks), [uptime_app.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/synthetics/public/apps/uptime_app.tsx#:~:text=RedirectAppLinks), [uptime_app.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/synthetics/public/apps/uptime_app.tsx#:~:text=RedirectAppLinks), [uptime_app.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/synthetics/public/apps/uptime_app.tsx#:~:text=RedirectAppLinks) | - | +| | [use_no_data_config.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/synthetics/public/legacy_uptime/app/use_no_data_config.ts#:~:text=KibanaPageTemplateProps), [use_no_data_config.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/synthetics/public/legacy_uptime/app/use_no_data_config.ts#:~:text=KibanaPageTemplateProps), [use_no_data_config.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_no_data_config.ts#:~:text=KibanaPageTemplateProps), [use_no_data_config.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_no_data_config.ts#:~:text=KibanaPageTemplateProps) | - | +| | [alert_messages.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/alert_messages.tsx#:~:text=RedirectAppLinks), [alert_messages.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/alert_messages.tsx#:~:text=RedirectAppLinks), [alert_messages.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/alert_messages.tsx#:~:text=RedirectAppLinks), [uptime_app.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/synthetics/public/legacy_uptime/app/uptime_app.tsx#:~:text=RedirectAppLinks), [uptime_app.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/synthetics/public/legacy_uptime/app/uptime_app.tsx#:~:text=RedirectAppLinks), [uptime_app.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/synthetics/public/legacy_uptime/app/uptime_app.tsx#:~:text=RedirectAppLinks), [synthetics_app.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/synthetics/public/apps/synthetics/synthetics_app.tsx#:~:text=RedirectAppLinks), [synthetics_app.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/synthetics/public/apps/synthetics/synthetics_app.tsx#:~:text=RedirectAppLinks), [synthetics_app.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/synthetics/public/apps/synthetics/synthetics_app.tsx#:~:text=RedirectAppLinks) | - | @@ -662,22 +662,12 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/index_pattern_select/index_pattern_select.tsx#:~:text=IndexPatternsContract), [index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/index_pattern_select/index_pattern_select.tsx#:~:text=IndexPatternsContract), [create_index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/index_pattern_select/create_index_pattern_select.tsx#:~:text=IndexPatternsContract), [create_index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/index_pattern_select/create_index_pattern_select.tsx#:~:text=IndexPatternsContract), [index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/index_pattern_select/index_pattern_select.tsx#:~:text=IndexPatternsContract), [index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/index_pattern_select/index_pattern_select.tsx#:~:text=IndexPatternsContract), [create_index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/index_pattern_select/create_index_pattern_select.tsx#:~:text=IndexPatternsContract), [create_index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/index_pattern_select/create_index_pattern_select.tsx#:~:text=IndexPatternsContract) | - | -| | [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IIndexPattern), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IIndexPattern), [query_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts#:~:text=IIndexPattern), [query_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts#:~:text=IIndexPattern), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IIndexPattern), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IIndexPattern), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IIndexPattern) | - | -| | [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IFieldType), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IFieldType), [query_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts#:~:text=IFieldType), [query_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType)+ 25 more | 8.2 | +| | [query_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts#:~:text=IIndexPattern), [query_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts#:~:text=IIndexPattern), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IIndexPattern), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IIndexPattern), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IIndexPattern), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IIndexPattern), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IIndexPattern) | - | +| | [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IFieldType), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IFieldType) | 8.2 | | | [query_string_input.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/query_string_input/query_string_input.tsx#:~:text=indexPatterns) | - | | | [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=esFilters), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=esFilters), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=esFilters) | 8.1 | -| | [conjunction.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts#:~:text=KueryNode), [conjunction.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts#:~:text=KueryNode), [conjunction.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts#:~:text=KueryNode), [field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.test.ts#:~:text=KueryNode), [field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.test.ts#:~:text=KueryNode), [field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.test.ts#:~:text=KueryNode), [operator.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.test.ts#:~:text=KueryNode), [operator.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.test.ts#:~:text=KueryNode), [operator.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.test.ts#:~:text=KueryNode), [value.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.test.ts#:~:text=KueryNode)+ 2 more | 8.1 | -| | [use_filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/search_bar/lib/use_filter_manager.ts#:~:text=Filter), [use_filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/search_bar/lib/use_filter_manager.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [get_stub_filter.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/test_helpers/get_stub_filter.ts#:~:text=Filter), [get_stub_filter.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/test_helpers/get_stub_filter.ts#:~:text=Filter), [filter_label.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_label.tsx#:~:text=Filter)+ 10 more | 8.1 | -| | [filter_label.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_label.tsx#:~:text=FILTERS), [filter_label.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_label.tsx#:~:text=FILTERS), [filter_label.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_label.tsx#:~:text=FILTERS), [filter_label.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_label.tsx#:~:text=FILTERS), [filter_label.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_label.tsx#:~:text=FILTERS), [filter_label.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_label.tsx#:~:text=FILTERS) | 8.1 | -| | [filter_editor_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_editor_utils.test.ts#:~:text=toggleFilterNegated), [filter_editor_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_editor_utils.test.ts#:~:text=toggleFilterNegated), [filter_editor_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_editor_utils.test.ts#:~:text=toggleFilterNegated), [filter_editor_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_editor_utils.test.ts#:~:text=toggleFilterNegated), [filter_editor_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_editor_utils.test.ts#:~:text=toggleFilterNegated) | 8.1 | -| | [use_filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/search_bar/lib/use_filter_manager.ts#:~:text=Filter), [use_filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/search_bar/lib/use_filter_manager.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [get_stub_filter.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/test_helpers/get_stub_filter.ts#:~:text=Filter), [get_stub_filter.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/test_helpers/get_stub_filter.ts#:~:text=Filter), [filter_label.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_label.tsx#:~:text=Filter)+ 10 more | 8.1 | -| | [conjunction.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts#:~:text=KueryNode), [conjunction.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts#:~:text=KueryNode), [conjunction.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts#:~:text=KueryNode), [field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.test.ts#:~:text=KueryNode), [field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.test.ts#:~:text=KueryNode), [field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.test.ts#:~:text=KueryNode), [operator.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.test.ts#:~:text=KueryNode), [operator.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.test.ts#:~:text=KueryNode), [operator.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.test.ts#:~:text=KueryNode), [value.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.test.ts#:~:text=KueryNode)+ 2 more | 8.1 | -| | [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IFieldType), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IFieldType), [query_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts#:~:text=IFieldType), [query_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType)+ 60 more | 8.2 | -| | [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IIndexPattern), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IIndexPattern), [query_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts#:~:text=IIndexPattern), [query_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts#:~:text=IIndexPattern), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IIndexPattern), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IIndexPattern), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IIndexPattern), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IIndexPattern), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IIndexPattern), [query_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts#:~:text=IIndexPattern)+ 4 more | - | -| | [index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/index_pattern_select/index_pattern_select.tsx#:~:text=IndexPatternsContract), [index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/index_pattern_select/index_pattern_select.tsx#:~:text=IndexPatternsContract), [create_index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/index_pattern_select/create_index_pattern_select.tsx#:~:text=IndexPatternsContract), [create_index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/index_pattern_select/create_index_pattern_select.tsx#:~:text=IndexPatternsContract), [index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/index_pattern_select/index_pattern_select.tsx#:~:text=IndexPatternsContract), [index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/index_pattern_select/index_pattern_select.tsx#:~:text=IndexPatternsContract), [create_index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/index_pattern_select/create_index_pattern_select.tsx#:~:text=IndexPatternsContract), [create_index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/index_pattern_select/create_index_pattern_select.tsx#:~:text=IndexPatternsContract) | - | -| | [use_filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/search_bar/lib/use_filter_manager.ts#:~:text=Filter), [use_filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/search_bar/lib/use_filter_manager.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [get_stub_filter.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/test_helpers/get_stub_filter.ts#:~:text=Filter), [get_stub_filter.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/test_helpers/get_stub_filter.ts#:~:text=Filter), [filter_label.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_label.tsx#:~:text=Filter)+ 10 more | 8.1 | -| | [conjunction.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts#:~:text=KueryNode), [conjunction.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts#:~:text=KueryNode), [conjunction.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts#:~:text=KueryNode), [field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.test.ts#:~:text=KueryNode), [field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.test.ts#:~:text=KueryNode), [field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.test.ts#:~:text=KueryNode), [operator.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.test.ts#:~:text=KueryNode), [operator.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.test.ts#:~:text=KueryNode), [operator.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.test.ts#:~:text=KueryNode), [value.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.test.ts#:~:text=KueryNode)+ 2 more | 8.1 | +| | [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IFieldType), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IFieldType), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType)+ 8 more | 8.2 | +| | [query_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts#:~:text=IIndexPattern), [query_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts#:~:text=IIndexPattern), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IIndexPattern), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IIndexPattern), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IIndexPattern), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IIndexPattern), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IIndexPattern), [query_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts#:~:text=IIndexPattern), [query_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts#:~:text=IIndexPattern), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IIndexPattern)+ 4 more | - | @@ -762,15 +752,6 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ -## visTypeVega - -| Deprecated API | Reference location(s) | Remove By | -| ---------------|-----------|-----------| -| | [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/plugin.ts#:~:text=injectedMetadata) | 8.8.0 | -| | [search_api.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/data_model/search_api.ts#:~:text=injectedMetadata), [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/plugin.ts#:~:text=injectedMetadata) | 8.8.0 | - - - ## visTypeVislib | Deprecated API | Reference location(s) | Remove By | @@ -795,6 +776,7 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/app.tsx#:~:text=syncQueryStateWithUrl), [app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/app.tsx#:~:text=syncQueryStateWithUrl) | - | | | [get_table_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/utils/get_table_columns.tsx#:~:text=RedirectAppLinks), [get_table_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/utils/get_table_columns.tsx#:~:text=RedirectAppLinks), [get_table_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/utils/get_table_columns.tsx#:~:text=RedirectAppLinks) | - | | | [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject) | 8.8.0 | | | [visualize_top_nav.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/components/visualize_top_nav.tsx#:~:text=onAppLeave), [visualize_editor_common.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/components/visualize_editor_common.tsx#:~:text=onAppLeave), [app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/app.tsx#:~:text=onAppLeave), [index.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/index.tsx#:~:text=onAppLeave) | 8.8.0 | diff --git a/api_docs/deprecations_by_team.mdx b/api_docs/deprecations_by_team.mdx index aab61180e9dc8..816b8a9282d9f 100644 --- a/api_docs/deprecations_by_team.mdx +++ b/api_docs/deprecations_by_team.mdx @@ -3,7 +3,7 @@ id: kibDevDocsDeprecationsDueByTeam slug: /kibana-dev-docs/api-meta/deprecations-due-by-team title: Deprecated APIs due to be removed, by team summary: Lists the teams that are referencing deprecated APIs with a remove by date. -date: 2022-04-26 +date: 2022-05-23 tags: ['contributor', 'dev', 'apidocs', 'kibana'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. --- @@ -25,12 +25,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Plugin | Deprecated API | Reference location(s) | Remove By | | --------|-------|-----------|-----------| -| dataViews | | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/types.ts#:~:text=IFieldType), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/types.ts#:~:text=IFieldType)+ 7 more | 8.2 | -| dataViews | | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/types.ts#:~:text=IFieldType), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/types.ts#:~:text=IFieldType)+ 23 more | 8.2 | -| dataEnhanced | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/types.ts#:~:text=KueryNode), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/types.ts#:~:text=KueryNode), [get_search_session_page.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts#:~:text=KueryNode), [get_search_session_page.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts#:~:text=KueryNode), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=KueryNode), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=KueryNode), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=KueryNode), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=KueryNode), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=KueryNode), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=KueryNode) | 8.1 | -| dataEnhanced | | [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=nodeBuilder), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=nodeBuilder), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=nodeBuilder), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=nodeBuilder), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=nodeBuilder), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=nodeBuilder), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=nodeBuilder), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=nodeBuilder), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=nodeBuilder), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=nodeBuilder)+ 2 more | 8.1 | -| dataEnhanced | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/types.ts#:~:text=KueryNode), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/types.ts#:~:text=KueryNode), [get_search_session_page.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts#:~:text=KueryNode), [get_search_session_page.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts#:~:text=KueryNode), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=KueryNode), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=KueryNode), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=KueryNode), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=KueryNode), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=KueryNode), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=KueryNode) | 8.1 | -| dataEnhanced | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/types.ts#:~:text=KueryNode), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/types.ts#:~:text=KueryNode), [get_search_session_page.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts#:~:text=KueryNode), [get_search_session_page.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts#:~:text=KueryNode), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=KueryNode), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=KueryNode), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=KueryNode), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=KueryNode), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=KueryNode), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=KueryNode) | 8.1 | +| dataViews | | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/index.ts#:~:text=IFieldType), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=IFieldType)+ 7 more | 8.2 | +| dataViews | | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/index.ts#:~:text=IFieldType), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=IFieldType)+ 23 more | 8.2 | | urlDrilldown | | [context_variables.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts#:~:text=Filter), [context_variables.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts#:~:text=Filter), [url_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.tsx#:~:text=Filter), [url_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.tsx#:~:text=Filter), [data.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/test/data.ts#:~:text=Filter), [data.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/test/data.ts#:~:text=Filter) | 8.1 | | urlDrilldown | | [context_variables.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts#:~:text=Filter), [context_variables.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts#:~:text=Filter), [url_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.tsx#:~:text=Filter), [url_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.tsx#:~:text=Filter), [data.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/test/data.ts#:~:text=Filter), [data.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/test/data.ts#:~:text=Filter) | 8.1 | | urlDrilldown | | [context_variables.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts#:~:text=Filter), [context_variables.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts#:~:text=Filter), [url_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.tsx#:~:text=Filter), [url_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.tsx#:~:text=Filter), [data.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/test/data.ts#:~:text=Filter), [data.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/test/data.ts#:~:text=Filter) | 8.1 | @@ -42,10 +38,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Plugin | Deprecated API | Reference location(s) | Remove By | | --------|-------|-----------|-----------| -| discover | | [anchor.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/anchor.ts#:~:text=fetch), [fetch_hits_in_interval.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/utils/fetch_hits_in_interval.ts#:~:text=fetch) | 8.1 | | discover | | [view_alert_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/view_alert/view_alert_route.tsx#:~:text=Filter), [view_alert_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/view_alert/view_alert_route.tsx#:~:text=Filter) | 8.1 | | discover | | [view_alert_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/view_alert/view_alert_route.tsx#:~:text=Filter), [view_alert_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/view_alert/view_alert_route.tsx#:~:text=Filter) | 8.1 | -| discover | | [anchor.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/anchor.ts#:~:text=fetch), [fetch_hits_in_interval.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/utils/fetch_hits_in_interval.ts#:~:text=fetch) | 8.1 | | discover | | [view_alert_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/view_alert/view_alert_route.tsx#:~:text=Filter), [view_alert_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/view_alert/view_alert_route.tsx#:~:text=Filter) | 8.1 | | discover | | [on_save_search.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/top_nav/on_save_search.tsx#:~:text=SavedObjectSaveModal), [on_save_search.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/top_nav/on_save_search.tsx#:~:text=SavedObjectSaveModal), [save_modal.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/save_modal.tsx#:~:text=SavedObjectSaveModal), [save_modal.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/save_modal.tsx#:~:text=SavedObjectSaveModal) | 8.8.0 | | graph | | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/server/plugin.ts#:~:text=license%24) | 8.8.0 | @@ -161,13 +155,13 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Plugin | Deprecated API | Reference location(s) | Remove By | | --------|-------|-----------|-----------| -| stackAlerts | | [fetch_search_source_query.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/server/alert_types/es_query/lib/fetch_search_source_query.ts#:~:text=fetch), [alert_type.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/server/alert_types/es_query/alert_type.test.ts#:~:text=fetch), [alert_type.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/server/alert_types/es_query/alert_type.test.ts#:~:text=fetch) | 8.1 | -| stackAlerts | | [read_only_filter_items.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/read_only_filter_items.tsx#:~:text=Filter), [read_only_filter_items.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/read_only_filter_items.tsx#:~:text=Filter), [search_source_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression.tsx#:~:text=Filter), [search_source_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression.tsx#:~:text=Filter) | 8.1 | -| stackAlerts | | [read_only_filter_items.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/read_only_filter_items.tsx#:~:text=Filter), [read_only_filter_items.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/read_only_filter_items.tsx#:~:text=Filter), [search_source_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression.tsx#:~:text=Filter), [search_source_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression.tsx#:~:text=Filter) | 8.1 | -| stackAlerts | | [fetch_search_source_query.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/server/alert_types/es_query/lib/fetch_search_source_query.ts#:~:text=fetch), [alert_type.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/server/alert_types/es_query/alert_type.test.ts#:~:text=fetch), [alert_type.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/server/alert_types/es_query/alert_type.test.ts#:~:text=fetch) | 8.1 | -| stackAlerts | | [read_only_filter_items.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/read_only_filter_items.tsx#:~:text=Filter), [read_only_filter_items.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/read_only_filter_items.tsx#:~:text=Filter), [search_source_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression.tsx#:~:text=Filter), [search_source_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression.tsx#:~:text=Filter) | 8.1 | +| alerting | | [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [fetch_search_source_query.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/server/alert_types/es_query/lib/fetch_search_source_query.ts#:~:text=fetch), [alert_type.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/server/alert_types/es_query/alert_type.test.ts#:~:text=fetch), [alert_type.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/server/alert_types/es_query/alert_type.test.ts#:~:text=fetch) | 8.1 | +| alerting | | [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts#:~:text=fetch), [fetch_search_source_query.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/server/alert_types/es_query/lib/fetch_search_source_query.ts#:~:text=fetch), [alert_type.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/server/alert_types/es_query/alert_type.test.ts#:~:text=fetch), [alert_type.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/server/alert_types/es_query/alert_type.test.ts#:~:text=fetch) | 8.1 | | alerting | | [plugin.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/plugin.test.ts#:~:text=getKibanaFeatures) | 8.8.0 | | alerting | | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/plugin.ts#:~:text=license%24), [license_state.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/license_state.test.ts#:~:text=license%24), [license_state.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/alerting/server/lib/license_state.test.ts#:~:text=license%24), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/actions/server/plugin.ts#:~:text=license%24), [license_state.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/actions/server/lib/license_state.test.ts#:~:text=license%24), [license_state.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/actions/server/lib/license_state.test.ts#:~:text=license%24) | 8.8.0 | +| stackAlerts | | [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter) | 8.1 | +| stackAlerts | | [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter) | 8.1 | +| stackAlerts | | [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter), [search_source_expression_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression_form.tsx#:~:text=Filter) | 8.1 | @@ -175,6 +169,8 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Plugin | Deprecated API | Reference location(s) | Remove By | | --------|-------|-----------|-----------| +| securitySolution | | [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils/wrap_search_source_client.test.ts#:~:text=fetch) | 8.1 | +| securitySolution | | [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils/wrap_search_source_client.test.ts#:~:text=fetch) | 8.1 | | securitySolution | | [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [isolation.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts#:~:text=mode), [isolation.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts#:~:text=mode)+ 2 more | 8.8.0 | | securitySolution | | [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [isolation.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts#:~:text=mode), [isolation.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts#:~:text=mode)+ 2 more | 8.8.0 | | securitySolution | | [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/app/index.tsx#:~:text=onAppLeave) | 8.8.0 | @@ -204,17 +200,9 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Plugin | Deprecated API | Reference location(s) | Remove By | | --------|-------|-----------|-----------| -| unifiedSearch | | [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IFieldType), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IFieldType), [query_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts#:~:text=IFieldType), [query_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType)+ 25 more | 8.2 | +| unifiedSearch | | [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IFieldType), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IFieldType) | 8.2 | | unifiedSearch | | [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=esFilters), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=esFilters), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=esFilters) | 8.1 | -| unifiedSearch | | [conjunction.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts#:~:text=KueryNode), [conjunction.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts#:~:text=KueryNode), [conjunction.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts#:~:text=KueryNode), [field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.test.ts#:~:text=KueryNode), [field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.test.ts#:~:text=KueryNode), [field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.test.ts#:~:text=KueryNode), [operator.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.test.ts#:~:text=KueryNode), [operator.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.test.ts#:~:text=KueryNode), [operator.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.test.ts#:~:text=KueryNode), [value.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.test.ts#:~:text=KueryNode)+ 2 more | 8.1 | -| unifiedSearch | | [use_filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/search_bar/lib/use_filter_manager.ts#:~:text=Filter), [use_filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/search_bar/lib/use_filter_manager.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [get_stub_filter.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/test_helpers/get_stub_filter.ts#:~:text=Filter), [get_stub_filter.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/test_helpers/get_stub_filter.ts#:~:text=Filter), [filter_label.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_label.tsx#:~:text=Filter)+ 10 more | 8.1 | -| unifiedSearch | | [filter_label.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_label.tsx#:~:text=FILTERS), [filter_label.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_label.tsx#:~:text=FILTERS), [filter_label.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_label.tsx#:~:text=FILTERS), [filter_label.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_label.tsx#:~:text=FILTERS), [filter_label.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_label.tsx#:~:text=FILTERS), [filter_label.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_label.tsx#:~:text=FILTERS) | 8.1 | -| unifiedSearch | | [filter_editor_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_editor_utils.test.ts#:~:text=toggleFilterNegated), [filter_editor_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_editor_utils.test.ts#:~:text=toggleFilterNegated), [filter_editor_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_editor_utils.test.ts#:~:text=toggleFilterNegated), [filter_editor_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_editor_utils.test.ts#:~:text=toggleFilterNegated), [filter_editor_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_editor_utils.test.ts#:~:text=toggleFilterNegated) | 8.1 | -| unifiedSearch | | [use_filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/search_bar/lib/use_filter_manager.ts#:~:text=Filter), [use_filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/search_bar/lib/use_filter_manager.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [get_stub_filter.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/test_helpers/get_stub_filter.ts#:~:text=Filter), [get_stub_filter.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/test_helpers/get_stub_filter.ts#:~:text=Filter), [filter_label.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_label.tsx#:~:text=Filter)+ 10 more | 8.1 | -| unifiedSearch | | [conjunction.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts#:~:text=KueryNode), [conjunction.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts#:~:text=KueryNode), [conjunction.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts#:~:text=KueryNode), [field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.test.ts#:~:text=KueryNode), [field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.test.ts#:~:text=KueryNode), [field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.test.ts#:~:text=KueryNode), [operator.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.test.ts#:~:text=KueryNode), [operator.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.test.ts#:~:text=KueryNode), [operator.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.test.ts#:~:text=KueryNode), [value.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.test.ts#:~:text=KueryNode)+ 2 more | 8.1 | -| unifiedSearch | | [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IFieldType), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IFieldType), [query_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts#:~:text=IFieldType), [query_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/query_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType)+ 60 more | 8.2 | -| unifiedSearch | | [use_filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/search_bar/lib/use_filter_manager.ts#:~:text=Filter), [use_filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/search_bar/lib/use_filter_manager.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [apply_filter_action.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/actions/apply_filter_action.ts#:~:text=Filter), [get_stub_filter.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/test_helpers/get_stub_filter.ts#:~:text=Filter), [get_stub_filter.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/test_helpers/get_stub_filter.ts#:~:text=Filter), [filter_label.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_label.tsx#:~:text=Filter)+ 10 more | 8.1 | -| unifiedSearch | | [conjunction.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts#:~:text=KueryNode), [conjunction.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts#:~:text=KueryNode), [conjunction.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts#:~:text=KueryNode), [field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.test.ts#:~:text=KueryNode), [field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.test.ts#:~:text=KueryNode), [field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.test.ts#:~:text=KueryNode), [operator.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.test.ts#:~:text=KueryNode), [operator.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.test.ts#:~:text=KueryNode), [operator.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/operator.test.ts#:~:text=KueryNode), [value.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.test.ts#:~:text=KueryNode)+ 2 more | 8.1 | +| unifiedSearch | | [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value_suggestion_provider.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts#:~:text=IFieldType), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IFieldType), [value.ts](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/value.ts#:~:text=IFieldType), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/unified_search/public/autocomplete/providers/kql_query_suggestion/field.tsx#:~:text=IFieldType)+ 8 more | 8.2 | @@ -222,9 +210,9 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Plugin | Deprecated API | Reference location(s) | Remove By | | --------|-------|-----------|-----------| -| lens | | [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject), [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject) | 8.8.0 | -| lens | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/types.ts#:~:text=onAppLeave), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/types.ts#:~:text=onAppLeave), [mounter.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/mounter.tsx#:~:text=onAppLeave), [visualize_top_nav.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/components/visualize_top_nav.tsx#:~:text=onAppLeave), [visualize_editor_common.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/components/visualize_editor_common.tsx#:~:text=onAppLeave), [app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/app.tsx#:~:text=onAppLeave), [index.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/index.tsx#:~:text=onAppLeave) | 8.8.0 | -| lens | | [saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/migrations/saved_object_migrations.ts#:~:text=warning), [saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/migrations/saved_object_migrations.ts#:~:text=warning) | 8.8.0 | -| management | | [application.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/management/public/application.tsx#:~:text=appBasePath) | 8.8.0 | -| visTypeVega | | [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/plugin.ts#:~:text=injectedMetadata) | 8.8.0 | -| visTypeVega | | [search_api.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/data_model/search_api.ts#:~:text=injectedMetadata), [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/plugin.ts#:~:text=injectedMetadata) | 8.8.0 | \ No newline at end of file +| visualizations | | [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject), [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [display_duplicate_title_confirm_modal.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/display_duplicate_title_confirm_modal.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject), [check_for_duplicate_title.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/persistence/saved_objects_utils/check_for_duplicate_title.ts#:~:text=SavedObject) | 8.8.0 | +| visualizations | | [visualize_top_nav.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/components/visualize_top_nav.tsx#:~:text=onAppLeave), [visualize_editor_common.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/components/visualize_editor_common.tsx#:~:text=onAppLeave), [app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/app.tsx#:~:text=onAppLeave), [index.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/visualize_app/index.tsx#:~:text=onAppLeave), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/types.ts#:~:text=onAppLeave), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/types.ts#:~:text=onAppLeave), [mounter.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/mounter.tsx#:~:text=onAppLeave) | 8.8.0 | +| lens | | [open_in_discover_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/trigger_actions/open_in_discover_drilldown.tsx#:~:text=Filter), [open_in_discover_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/trigger_actions/open_in_discover_drilldown.tsx#:~:text=Filter) | 8.1 | +| lens | | [open_in_discover_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/trigger_actions/open_in_discover_drilldown.tsx#:~:text=Filter), [open_in_discover_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/trigger_actions/open_in_discover_drilldown.tsx#:~:text=Filter) | 8.1 | +| lens | | [open_in_discover_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/trigger_actions/open_in_discover_drilldown.tsx#:~:text=Filter), [open_in_discover_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/trigger_actions/open_in_discover_drilldown.tsx#:~:text=Filter) | 8.1 | +| management | | [application.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/management/public/application.tsx#:~:text=appBasePath) | 8.8.0 | \ No newline at end of file diff --git a/api_docs/kbn_handlebars.devdocs.json b/api_docs/kbn_handlebars.devdocs.json new file mode 100644 index 0000000000000..a7eaa1cd0c13c --- /dev/null +++ b/api_docs/kbn_handlebars.devdocs.json @@ -0,0 +1,153 @@ +{ + "id": "@kbn/handlebars", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/handlebars", + "id": "def-common.create", + "type": "Function", + "tags": [], + "label": "create", + "description": [ + "\nCreates an isolated Handlebars environment.\n\nEach environment has its own helpers.\nThis is only necessary for use cases that demand distinct helpers.\nMost use cases can use the root Handlebars environment directly.\n" + ], + "signature": [ + "() => typeof ", + { + "pluginId": "@kbn/handlebars", + "scope": "common", + "docId": "kibKbnHandlebarsPluginApi", + "section": "def-common.ExtendedHandlebars", + "text": "ExtendedHandlebars" + }, + " & typeof Handlebars" + ], + "path": "packages/kbn-handlebars/src/index.ts", + "deprecated": false, + "children": [], + "returnComment": [ + "A sandboxed/scoped version of the" + ], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/handlebars", + "id": "def-common.compileFnName", + "type": "CompoundType", + "tags": [], + "label": "compileFnName", + "description": [ + "\nIf the `unsafe-eval` CSP is set, this string constant will be `compile`,\notherwise `compileAST`.\n\nThis can be used to call the more optimized `compile` function in\nenvironments that support it, or fall back to `compileAST` on environments\nthat don't." + ], + "signature": [ + "\"compile\" | \"compileAST\"" + ], + "path": "packages/kbn-handlebars/src/index.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/handlebars", + "id": "def-common.ExtendedCompileOptions", + "type": "Type", + "tags": [], + "label": "ExtendedCompileOptions", + "description": [ + "\nSupported Handlebars compile options.\n\nThis is a subset of all the compile options supported by the upstream\nHandlebars module." + ], + "signature": [ + "{ data?: boolean | undefined; strict?: boolean | undefined; knownHelpers?: KnownHelpers | undefined; knownHelpersOnly?: boolean | undefined; assumeObjects?: boolean | undefined; noEscape?: boolean | undefined; }" + ], + "path": "packages/kbn-handlebars/src/index.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/handlebars", + "id": "def-common.ExtendedRuntimeOptions", + "type": "Type", + "tags": [], + "label": "ExtendedRuntimeOptions", + "description": [ + "\nSupported Handlebars runtime options\n\nThis is a subset of all the runtime options supported by the upstream\nHandlebars module." + ], + "signature": [ + "{ data?: any; helpers?: { [name: string]: Function; } | undefined; blockParams?: any[] | undefined; }" + ], + "path": "packages/kbn-handlebars/src/index.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/handlebars", + "id": "def-common.Handlebars", + "type": "CompoundType", + "tags": [], + "label": "Handlebars", + "description": [ + "\nA custom version of the Handlesbars module with an extra `compileAST` function." + ], + "signature": [ + "typeof ", + { + "pluginId": "@kbn/handlebars", + "scope": "common", + "docId": "kibKbnHandlebarsPluginApi", + "section": "def-common.ExtendedHandlebars", + "text": "ExtendedHandlebars" + }, + " & typeof Handlebars" + ], + "path": "packages/kbn-handlebars/src/index.ts", + "deprecated": false, + "initialIsOpen": false + } + ], + "objects": [ + { + "parentPluginId": "@kbn/handlebars", + "id": "def-common.ExtendedHandlebars", + "type": "Object", + "tags": [], + "label": "ExtendedHandlebars", + "description": [ + "\nNormally this namespace isn't used directly. It's required to be present by\nTypeScript when calling the `Handlebars.create()` function." + ], + "signature": [ + "typeof ", + { + "pluginId": "@kbn/handlebars", + "scope": "common", + "docId": "kibKbnHandlebarsPluginApi", + "section": "def-common.ExtendedHandlebars", + "text": "ExtendedHandlebars" + } + ], + "path": "packages/kbn-handlebars/src/index.ts", + "deprecated": false, + "initialIsOpen": false + } + ] + } +} \ No newline at end of file diff --git a/api_docs/kbn_handlebars.mdx b/api_docs/kbn_handlebars.mdx new file mode 100644 index 0000000000000..79d09d800a950 --- /dev/null +++ b/api_docs/kbn_handlebars.mdx @@ -0,0 +1,33 @@ +--- +id: kibKbnHandlebarsPluginApi +slug: /kibana-dev-docs/api/kbn-handlebars +title: "@kbn/handlebars" +image: https://source.unsplash.com/400x175/?github +summary: API docs for the @kbn/handlebars plugin +date: 2022-05-23 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/handlebars'] +warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. +--- +import kbnHandlebarsObj from './kbn_handlebars.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 6 | 0 | 0 | 0 | + +## Common + +### Objects + + +### Functions + + +### Consts, variables and types + + diff --git a/api_docs/plugin_directory.mdx b/api_docs/plugin_directory.mdx index f43ac68f5f298..eb09de3b5cecb 100644 --- a/api_docs/plugin_directory.mdx +++ b/api_docs/plugin_directory.mdx @@ -3,7 +3,7 @@ id: kibDevDocsPluginDirectory slug: /kibana-dev-docs/api-meta/plugin-api-directory title: Directory summary: Directory of public APIs available through plugins or packages. -date: 2022-04-26 +date: 2022-05-23 tags: ['contributor', 'dev', 'apidocs', 'kibana'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -12,123 +12,122 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Count | Plugins or Packages with a
public API | Number of teams | |--------------|----------|------------------------| -| 247 | 201 | 35 | +| 258 | 209 | 35 | ### Public API health stats | API Count | Any Count | Missing comments | Missing exports | |--------------|----------|-----------------|--------| -| 25958 | 170 | 19687 | 1153 | +| 26222 | 171 | 19770 | 870 | ## Plugin Directory | Plugin name           | Maintaining team | Description | API Cnt | Any Cnt | Missing
comments | Missing
exports | |--------------|----------------|-----------|--------------|----------|---------------|--------| -| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 195 | 0 | 191 | 11 | +| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 240 | 0 | 235 | 19 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 23 | 0 | 19 | 1 | -| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 325 | 0 | 316 | 19 | -| | [APM UI](https://github.com/orgs/elastic/teams/apm-ui) | The user interface for Elastic APM | 40 | 0 | 40 | 50 | +| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 359 | 0 | 350 | 19 | +| | [APM UI](https://github.com/orgs/elastic/teams/apm-ui) | The user interface for Elastic APM | 40 | 0 | 40 | 51 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 9 | 0 | 9 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Considering using bfetch capabilities when fetching large amounts of data. This services supports batching HTTP requests and streaming responses back. | 78 | 1 | 69 | 2 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds Canvas application to Kibana | 9 | 0 | 8 | 3 | -| | [ResponseOps](https://github.com/orgs/elastic/teams/response-ops) | The Case management system in Kibana | 71 | 0 | 57 | 19 | +| | [ResponseOps](https://github.com/orgs/elastic/teams/response-ops) | The Case management system in Kibana | 66 | 0 | 52 | 22 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 272 | 2 | 253 | 9 | -| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 28 | 0 | 23 | 0 | +| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 29 | 0 | 24 | 0 | | | [Cloud Security Posture](https://github.com/orgs/elastic/teams/cloud-posture-security) | The cloud security posture plugin | 14 | 0 | 14 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 13 | 0 | 13 | 1 | -| | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | The Controls Plugin contains embeddable components intended to create a simple query interface for end users, and a powerful editing suite that allows dashboard authors to build controls | 203 | 0 | 197 | 6 | -| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 2524 | 15 | 977 | 33 | +| | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | The Controls Plugin contains embeddable components intended to create a simple query interface for end users, and a powerful editing suite that allows dashboard authors to build controls | 205 | 0 | 199 | 7 | +| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 2541 | 15 | 977 | 33 | | crossClusterReplication | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | -| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | Add custom data integrations so they can be displayed in the Fleet integrations app | 98 | 0 | 79 | 1 | -| | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds the Dashboard app to Kibana | 142 | 0 | 140 | 12 | +| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | Add custom data integrations so they can be displayed in the Fleet integrations app | 101 | 0 | 82 | 1 | +| | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds the Dashboard app to Kibana | 143 | 0 | 141 | 12 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 52 | 0 | 51 | 0 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 3414 | 38 | 2802 | 18 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Enhanced data plugin. (See src/plugins/data.) Enhances the main data plugin with a search session management UI. Includes a reusable search session indicator component to use in other applications. Exposes routes for managing search sessions. Includes a service that monitors, updates, and cleans up search session saved objects. | 16 | 0 | 16 | 2 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | This plugin provides the ability to create data views via a modal flyout from any kibana app | 13 | 0 | 7 | 0 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 3482 | 38 | 2869 | 19 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | This plugin provides the ability to create data views via a modal flyout from any kibana app | 14 | 0 | 7 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Reusable data view field editor across Kibana | 42 | 0 | 37 | 3 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data view management app | 2 | 0 | 2 | 0 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 862 | 3 | 710 | 15 | -| | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | The Data Visualizer tools help you understand your data, by analyzing the metrics and fields in a log file or an existing Elasticsearch index. | 23 | 2 | 19 | 1 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 866 | 3 | 714 | 15 | +| | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | The Data Visualizer tools help you understand your data, by analyzing the metrics and fields in a log file or an existing Elasticsearch index. | 28 | 3 | 24 | 1 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 10 | 0 | 8 | 2 | -| | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains the Discover application and the saved search embeddable. | 76 | 0 | 60 | 7 | +| | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains the Discover application and the saved search embeddable. | 78 | 0 | 62 | 7 | | | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 37 | 0 | 35 | 2 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds embeddables service to Kibana | 476 | 0 | 386 | 4 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds embeddables service to Kibana | 486 | 0 | 396 | 4 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Extends embeddable plugin with more functionality | 14 | 0 | 14 | 0 | -| | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides encryption and decryption utilities for saved objects containing sensitive information. | 48 | 0 | 44 | 0 | +| | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides encryption and decryption utilities for saved objects containing sensitive information. | 51 | 0 | 44 | 0 | | | [Enterprise Search](https://github.com/orgs/elastic/teams/enterprise-search-frontend) | Adds dashboards for discovering and managing Enterprise Search products. | 2 | 0 | 2 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 112 | 3 | 108 | 3 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | The Event Annotation service contains expressions for event annotations | 49 | 0 | 49 | 3 | -| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 91 | 0 | 91 | 9 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | The Event Annotation service contains expressions for event annotations | 90 | 0 | 90 | 5 | +| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 100 | 0 | 100 | 9 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'error' renderer to expressions | 17 | 0 | 15 | 2 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression Gauge plugin adds a `gauge` renderer and function to the expression plugin. The renderer will display the `gauge` chart. | 61 | 0 | 61 | 2 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression Heatmap plugin adds a `heatmap` renderer and function to the expression plugin. The renderer will display the `heatmap` chart. | 104 | 0 | 100 | 3 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression Heatmap plugin adds a `heatmap` renderer and function to the expression plugin. The renderer will display the `heatmap` chart. | 107 | 0 | 103 | 3 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'image' function and renderer to expressions | 26 | 0 | 26 | 0 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'metric' function and renderer to expressions | 32 | 0 | 27 | 0 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression MetricVis plugin adds a `metric` renderer and function to the expression plugin. The renderer will display the `metric` chart. | 46 | 0 | 46 | 1 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression MetricVis plugin adds a `metric` renderer and function to the expression plugin. The renderer will display the `metric` chart. | 48 | 0 | 48 | 1 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression Partition Visualization plugin adds a `partitionVis` renderer and `pieVis`, `mosaicVis`, `treemapVis`, `waffleVis` functions to the expression plugin. The renderer will display the `pie`, `waffle`, `treemap` and `mosaic` charts. | 70 | 0 | 70 | 2 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'repeatImage' function and renderer to expressions | 32 | 0 | 32 | 0 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'revealImage' function and renderer to expressions | 14 | 0 | 14 | 3 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'shape' function and renderer to expressions | 148 | 0 | 146 | 0 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression Tagcloud plugin adds a `tagcloud` renderer and function to the expression plugin. The renderer will display the `Wordcloud` chart. | 7 | 0 | 7 | 0 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression XY plugin adds a `xy` renderer and function to the expression plugin. The renderer will display the `xy` chart. | 473 | 0 | 463 | 0 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds expression runtime to Kibana | 2158 | 17 | 1713 | 5 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression XY plugin adds a `xy` renderer and function to the expression plugin. The renderer will display the `xy` chart. | 143 | 0 | 133 | 14 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds expression runtime to Kibana | 2176 | 17 | 1722 | 5 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 222 | 0 | 95 | 2 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Index pattern fields and ambiguous values formatters | 286 | 6 | 247 | 3 | | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | The file upload plugin contains components and services for uploading a file, analyzing its data, and then importing the data into an Elasticsearch index. Supported file types include CSV, TSV, newline-delimited JSON and GeoJSON. | 62 | 0 | 62 | 2 | -| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | - | 1385 | 8 | 1268 | 10 | +| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | - | 1403 | 8 | 1281 | 10 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 68 | 0 | 14 | 5 | | globalSearchBar | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 0 | 0 | 0 | 0 | | globalSearchProviders | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 0 | 0 | 0 | 0 | | graph | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 0 | 0 | 0 | 0 | | grokdebugger | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | -| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 140 | 0 | 102 | 0 | +| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 141 | 0 | 102 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 4 | 0 | 4 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 175 | 0 | 170 | 3 | -| | [Logs and Metrics UI](https://github.com/orgs/elastic/teams/logs-metrics-ui) | This plugin visualizes data from Filebeat and Metricbeat, and integrates with other Observability solutions | 31 | 0 | 28 | 5 | +| | [Logs and Metrics UI](https://github.com/orgs/elastic/teams/logs-metrics-ui) | This plugin visualizes data from Filebeat and Metricbeat, and integrates with other Observability solutions | 34 | 0 | 31 | 5 | | ingestPipelines | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | | inputControlVis | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds Input Control visualization to Kibana | 0 | 0 | 0 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 123 | 2 | 96 | 4 | | | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides UI and APIs for the interactive setup mode. | 28 | 0 | 18 | 0 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 6 | 0 | 6 | 0 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 240 | 0 | 204 | 5 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 248 | 0 | 212 | 5 | | kibanaUsageCollection | [Kibana Telemetry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 0 | 0 | 0 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 615 | 3 | 420 | 9 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Visualization editor allowing to quickly and easily configure compelling visualizations to use on dashboards and canvas workpads. Exposes components to embed visualizations and link into the Lens editor from within other apps in Kibana. | 527 | 0 | 452 | 30 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Visualization editor allowing to quickly and easily configure compelling visualizations to use on dashboards and canvas workpads. Exposes components to embed visualizations and link into the Lens editor from within other apps in Kibana. | 574 | 0 | 497 | 35 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 8 | 0 | 8 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 3 | 0 | 3 | 0 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 117 | 0 | 42 | 10 | | | [Security detections response](https://github.com/orgs/elastic/teams/security-detections-response) | - | 198 | 0 | 90 | 49 | | logstash | [Logstash](https://github.com/orgs/elastic/teams/logstash) | - | 0 | 0 | 0 | 0 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 41 | 0 | 41 | 6 | -| | [GIS](https://github.com/orgs/elastic/teams/kibana-gis) | - | 224 | 0 | 223 | 25 | +| | [GIS](https://github.com/orgs/elastic/teams/kibana-gis) | - | 226 | 0 | 225 | 25 | | | [GIS](https://github.com/orgs/elastic/teams/kibana-gis) | - | 67 | 0 | 67 | 0 | -| | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | This plugin provides access to the machine learning features provided by Elastic. | 196 | 8 | 79 | 30 | +| | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | This plugin provides access to the machine learning features provided by Elastic. | 254 | 10 | 81 | 31 | | | [Stack Monitoring](https://github.com/orgs/elastic/teams/stack-monitoring-ui) | - | 11 | 0 | 9 | 1 | | | [Stack Monitoring](https://github.com/orgs/elastic/teams/stack-monitoring-ui) | - | 9 | 0 | 9 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 34 | 0 | 34 | 2 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 17 | 0 | 17 | 0 | -| | [Observability UI](https://github.com/orgs/elastic/teams/observability-ui) | - | 373 | 2 | 370 | 30 | +| | [Observability UI](https://github.com/orgs/elastic/teams/observability-ui) | - | 376 | 2 | 373 | 30 | | | [Security asset management](https://github.com/orgs/elastic/teams/security-asset-management) | - | 13 | 0 | 13 | 0 | | painlessLab | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | The Presentation Utility Plugin is a set of common, shared components and toolkits for solutions within the Presentation space, (e.g. Dashboards, Canvas). | 228 | 2 | 177 | 11 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 4 | 0 | 4 | 0 | | | [Kibana Reporting Services](https://github.com/orgs/elastic/teams/kibana-reporting-services) | Reporting Services enables applications to feature reports that the user can automate with Watcher and download later. | 36 | 0 | 16 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 21 | 0 | 21 | 0 | -| | [RAC](https://github.com/orgs/elastic/teams/rac) | - | 194 | 0 | 167 | 8 | +| | [RAC](https://github.com/orgs/elastic/teams/rac) | - | 202 | 0 | 174 | 9 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 24 | 0 | 19 | 2 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 192 | 2 | 151 | 5 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 110 | 0 | 97 | 0 | -| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 54 | 0 | 50 | 0 | +| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 76 | 0 | 70 | 3 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 90 | 0 | 45 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 32 | 0 | 13 | 0 | -| | [Kibana Reporting Services](https://github.com/orgs/elastic/teams/kibana-reporting-services) | Kibana Screenshotting Plugin | 27 | 0 | 7 | 4 | +| | [Kibana Reporting Services](https://github.com/orgs/elastic/teams/kibana-reporting-services) | Kibana Screenshotting Plugin | 28 | 0 | 8 | 4 | | searchprofiler | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | | | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides authentication and authorization features, and exposes functionality to understand the capabilities of the currently authenticated user. | 183 | 0 | 103 | 0 | | | [Security solution](https://github.com/orgs/elastic/teams/security-solution) | - | 46 | 0 | 46 | 19 | | | [Security Team](https://github.com/orgs/elastic/teams/security-team) | - | 3 | 0 | 3 | 1 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds URL Service and sharing capabilities to Kibana | 113 | 0 | 54 | 10 | | | [Shared UX](https://github.com/orgs/elastic/teams/shared-ux) | A plugin providing components and services for shared user experiences in Kibana. | 4 | 0 | 0 | 0 | -| | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 21 | 1 | 21 | 1 | +| | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 22 | 1 | 22 | 1 | | | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides the Spaces feature, which allows saved objects to be organized into meaningful categories. | 260 | 0 | 64 | 0 | | | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 4 | 0 | 4 | 0 | | synthetics | [Uptime](https://github.com/orgs/elastic/teams/uptime) | This plugin visualizes data from Synthetics and Heartbeat, and integrates with other Observability solutions. | 0 | 0 | 0 | 0 | @@ -137,13 +136,13 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Kibana Telemetry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 32 | 0 | 32 | 6 | | | [Kibana Telemetry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 1 | 0 | 1 | 0 | | | [Kibana Telemetry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 11 | 0 | 10 | 0 | -| | [Security solution](https://github.com/orgs/elastic/teams/security-solution) | - | 434 | 1 | 330 | 35 | +| | [Security solution](https://github.com/orgs/elastic/teams/security-solution) | - | 435 | 1 | 331 | 35 | | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | This plugin provides access to the transforms features provided by Elastic. Transforms enable you to convert existing Elasticsearch indices into summarized indices, which provide opportunities for new insights and analytics. | 4 | 0 | 4 | 1 | | translations | [Kibana Localization](https://github.com/orgs/elastic/teams/kibana-localization) | - | 0 | 0 | 0 | 0 | -| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 321 | 0 | 307 | 25 | +| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 374 | 0 | 360 | 34 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds UI Actions service to Kibana | 130 | 0 | 91 | 11 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Extends UI Actions plugin with more functionality | 203 | 0 | 141 | 9 | -| | [Unified Search](https://github.com/orgs/elastic/teams/kibana-app-services) | Contains all the key functionality of Kibana's unified search experience.Contains all the key functionality of Kibana's unified search experience. | 79 | 2 | 75 | 11 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Extends UI Actions plugin with more functionality | 205 | 0 | 142 | 9 | +| | [Unified Search](https://github.com/orgs/elastic/teams/kibana-app-services) | Contains all the key functionality of Kibana's unified search experience.Contains all the key functionality of Kibana's unified search experience. | 82 | 2 | 78 | 13 | | upgradeAssistant | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | | urlDrilldown | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds drilldown implementations to Kibana | 0 | 0 | 0 | 0 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 12 | 0 | 12 | 0 | @@ -162,35 +161,40 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Registers the vega visualization. Is the elastic version of vega and vega-lite libraries. | 2 | 0 | 2 | 0 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the vislib visualizations. These are the classical area/line/bar, pie, gauge/goal and heatmap charts. We want to replace them with elastic-charts. | 26 | 0 | 25 | 1 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the new xy-axis chart using the elastic-charts library, which will eventually replace the vislib xy-axis charts including bar, area, and line. | 57 | 0 | 51 | 5 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the shared architecture among all the legacy visualizations, e.g. the visualization type registry or the visualization embeddable. | 365 | 12 | 344 | 14 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the shared architecture among all the legacy visualizations, e.g. the visualization type registry or the visualization embeddable. | 372 | 12 | 351 | 14 | | watcher | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | ## Package Directory | Package name           | Maintaining team | Description | API Cnt | Any Cnt | Missing
comments | Missing
exports | |--------------|----------------|-----------|--------------|----------|---------------|--------| -| | [Owner missing] | Elastic APM trace data generator | 70 | 0 | 70 | 10 | +| | [Owner missing] | Elastic APM trace data generator | 74 | 0 | 74 | 11 | | | [Owner missing] | - | 11 | 5 | 11 | 0 | | | [Owner missing] | Alerts components and hooks | 9 | 1 | 9 | 0 | | | Ahmad Bamieh ahmadbamieh@gmail.com | Kibana Analytics tool | 69 | 0 | 69 | 2 | -| | [Owner missing] | - | 88 | 1 | 10 | 0 | -| | [Owner missing] | - | 18 | 0 | 13 | 0 | +| | [Owner missing] | - | 95 | 0 | 7 | 0 | +| | [Owner missing] | - | 18 | 0 | 13 | 0 | +| | [Owner missing] | - | 22 | 0 | 13 | 0 | +| | [Owner missing] | - | 18 | 0 | 13 | 0 | +| | [Owner missing] | - | 20 | 0 | 4 | 0 | | | [Owner missing] | - | 16 | 0 | 16 | 0 | | | [Owner missing] | - | 11 | 0 | 11 | 0 | | | [Owner missing] | - | 10 | 0 | 10 | 0 | | | [Owner missing] | - | 18 | 0 | 9 | 1 | | | [Owner missing] | - | 4 | 0 | 4 | 0 | -| | [Owner missing] | - | 8 | 0 | 7 | 0 | | | [Owner missing] | - | 7 | 0 | 2 | 0 | -| | [Owner missing] | - | 59 | 0 | 15 | 0 | +| | [Owner missing] | - | 60 | 0 | 15 | 0 | | | [Owner missing] | - | 2 | 0 | 2 | 0 | | | [Owner missing] | - | 106 | 0 | 80 | 1 | -| | [Owner missing] | - | 64 | 0 | 44 | 2 | +| | [Owner missing] | - | 65 | 0 | 44 | 2 | | | [Owner missing] | - | 129 | 3 | 127 | 17 | | | [Owner missing] | - | 13 | 0 | 7 | 0 | | | [Owner missing] | elasticsearch datemath parser, used in kibana | 44 | 0 | 43 | 0 | -| | [Owner missing] | - | 120 | 3 | 109 | 0 | -| | [Owner missing] | - | 64 | 0 | 64 | 2 | +| | [Owner missing] | - | 9 | 1 | 9 | 0 | +| | [Owner missing] | - | 65 | 0 | 64 | 0 | +| | [Owner missing] | - | 15 | 0 | 9 | 0 | +| | [Owner missing] | - | 31 | 2 | 27 | 0 | +| | [Owner missing] | - | 65 | 0 | 65 | 2 | | | [Owner missing] | - | 1 | 0 | 1 | 0 | | | [Owner missing] | - | 27 | 0 | 14 | 1 | | | [Owner missing] | - | 213 | 1 | 159 | 11 | @@ -198,6 +202,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Owner missing] | - | 20 | 0 | 16 | 0 | | | [Owner missing] | - | 2 | 0 | 0 | 0 | | | [Owner missing] | - | 1 | 0 | 0 | 0 | +| | [Owner missing] | - | 6 | 0 | 0 | 0 | | | [Owner missing] | - | 51 | 0 | 48 | 0 | | | [Owner missing] | - | 43 | 0 | 36 | 0 | | | App Services | - | 35 | 4 | 35 | 0 | @@ -208,11 +213,12 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Owner missing] | - | 8 | 0 | 8 | 0 | | | [Owner missing] | - | 494 | 1 | 1 | 0 | | | [Owner missing] | - | 55 | 0 | 55 | 2 | -| | [Owner missing] | - | 45 | 0 | 45 | 10 | +| | [Owner missing] | - | 47 | 0 | 46 | 10 | +| | [Owner missing] | A library to convert APM traces into JSON format for performance testing. | 3 | 0 | 3 | 0 | | | [Owner missing] | - | 30 | 0 | 29 | 0 | | | [Owner missing] | - | 1 | 0 | 1 | 0 | | | [Owner missing] | Just some helpers for kibana plugin devs. | 1 | 0 | 1 | 0 | -| | [Owner missing] | - | 47 | 0 | 35 | 5 | +| | [Owner missing] | - | 45 | 0 | 33 | 5 | | | [Owner missing] | - | 21 | 0 | 10 | 0 | | | [Owner missing] | - | 74 | 0 | 71 | 0 | | | [Owner missing] | Security Solution auto complete | 50 | 1 | 35 | 0 | @@ -232,17 +238,18 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Owner missing] | - | 53 | 0 | 50 | 1 | | | [Owner missing] | - | 25 | 0 | 24 | 1 | | | [Owner missing] | - | 12 | 0 | 2 | 3 | -| | [Owner missing] | - | 34 | 0 | 6 | 6 | -| | [Owner missing] | - | 67 | 0 | 43 | 0 | -| | [Owner missing] | - | 10 | 0 | 2 | 0 | +| | [Owner missing] | - | 23 | 0 | 6 | 3 | +| | [Owner missing] | - | 8 | 0 | 2 | 3 | +| | [Owner missing] | - | 78 | 0 | 49 | 2 | +| | [Owner missing] | - | 16 | 0 | 7 | 0 | | | [Owner missing] | - | 9 | 0 | 3 | 0 | | | [Owner missing] | - | 2 | 0 | 2 | 0 | | | [Owner missing] | - | 92 | 1 | 59 | 1 | | | [Owner missing] | - | 4 | 0 | 2 | 0 | -| | Operations | - | 22 | 2 | 21 | 0 | +| | Operations | - | 38 | 2 | 21 | 0 | | | [Owner missing] | - | 2 | 0 | 2 | 0 | -| | Operations | - | 252 | 6 | 214 | 9 | -| | [Owner missing] | - | 132 | 8 | 103 | 2 | +| | Operations | - | 240 | 5 | 201 | 9 | +| | [Owner missing] | - | 135 | 8 | 103 | 2 | | | [Owner missing] | - | 72 | 0 | 55 | 0 | | | [Owner missing] | - | 29 | 0 | 2 | 0 | | | [Owner missing] | - | 83 | 0 | 83 | 1 | diff --git a/docs/setup/settings.asciidoc b/docs/setup/settings.asciidoc index 79421e1ac90b5..24d62505e99e8 100644 --- a/docs/setup/settings.asciidoc +++ b/docs/setup/settings.asciidoc @@ -26,12 +26,19 @@ which may cause a delay before pages start being served. Set to `false` to disable Console. *Default: `true`* | `csp.rules:` - | deprecated:[7.14.0,"In 8.0 and later, this setting will no longer be supported."] +| deprecated:[7.14.0,"In 8.0 and later, this setting will no longer be supported."] A https://w3c.github.io/webappsec-csp/[Content Security Policy] template that disables certain unnecessary and potentially insecure capabilities in the browser. It is strongly recommended that you keep the default CSP rules that ship with {kib}. +| `csp.disableUnsafeEval` +| experimental[] Set this to `true` to remove the https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src#unsafe_eval_expressions[`unsafe-eval`] source expression from the `script-src` directive. *Default: `false`* + +By enabling `csp.disableUnsafeEval`, Kibana will use a custom version of the Handlebars template library which doesn't support https://handlebarsjs.com/guide/partials.html#inline-partials[inline partials]. +Handlebars is used in various locations in the Kibana frontend where custom templates can be supplied by the user when for instance setting up a visualisation. +If you experience any issues rendering Handlebars templates after turning on `csp.disableUnsafeEval`, or if you rely on inline partials, please revert this setting to `false` and https://github.com/elastic/kibana/issues/new/choose[open an issue] in the Kibana GitHub repository. + | `csp.script_src:` | Add sources for the https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src[Content Security Policy `script-src` directive]. diff --git a/docs/user/security/audit-logging.asciidoc b/docs/user/security/audit-logging.asciidoc index caa6512955f67..8cd293654c29c 100644 --- a/docs/user/security/audit-logging.asciidoc +++ b/docs/user/security/audit-logging.asciidoc @@ -15,8 +15,10 @@ by cluster-wide privileges. For more information on enabling audit logging in [NOTE] ============================================================================ Audit logs are **disabled** by default. To enable this functionality, you must -set `xpack.security.audit.enabled` to `true` in `kibana.yml`, and optionally configure -an <> to write the audit log to a location of your choosing. +set `xpack.security.audit.enabled` to `true` in `kibana.yml`. + +You can optionally configure audit logs location, file/rolling file appenders and +ignore filters using <>. ============================================================================ [[xpack-security-ecs-audit-logging]] diff --git a/examples/response_stream/README.md b/examples/response_stream/README.md new file mode 100644 index 0000000000000..3582f06fd216b --- /dev/null +++ b/examples/response_stream/README.md @@ -0,0 +1,28 @@ +## response stream + +This plugin demonstrates how to stream chunks of data to the client with just a single request. + +To run Kibana with the described examples, use `yarn start --run-examples`. + +The `response_stream` plugin demonstrates API endpoints that can stream data chunks with a single request with gzip/compression support. gzip-streams get decompressed natively by browsers. The plugin demonstrates two use cases to get started: Streaming a raw string as well as a more complex example that streams Redux-like actions to the client which update React state via `useReducer()`. + +Code in `@kbn/aiops-utils` contains helpers to set up a stream on the server side (`streamFactory()`) and consume it on the client side via a custom hook (`useFetchStream()`). The utilities make use of TS generics in a way that allows to have type safety for both request related options as well as the returned data. + +No additional third party libraries are used in the helpers to make it work. On the server, they integrate with `Hapi` and use node's own `gzip`. On the client, the custom hook abstracts away the necessary logic to consume the stream, internally it makes use of a generator function and `useReducer()` to update React state. + +On the server, the simpler stream to send a string is set up like this: + +```ts +const { end, push, responseWithHeaders } = streamFactory(request.headers); +``` + +The request's headers get passed on to automatically identify if compression is supported by the client. + +On the client, the custom hook is used like this: + +```ts +const { error, start, cancel, data, isRunning } = useFetchStream< + ApiSimpleStringStream, typeof basePath +>(`${basePath}/internal/response_stream/simple_string_stream`); +``` + diff --git a/examples/response_stream/common/README.md b/examples/response_stream/common/README.md new file mode 100644 index 0000000000000..33035da1653d0 --- /dev/null +++ b/examples/response_stream/common/README.md @@ -0,0 +1 @@ +The `./api` folder contains shared code used to support working with the same type specifications on server and client. diff --git a/examples/response_stream/common/api/index.ts b/examples/response_stream/common/api/index.ts new file mode 100644 index 0000000000000..8111a77d70274 --- /dev/null +++ b/examples/response_stream/common/api/index.ts @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { + UseFetchStreamCustomReducerParams, + UseFetchStreamParamsDefault, +} from '@kbn/aiops-utils'; + +import { + reducerStreamReducer, + ReducerStreamRequestBodySchema, + ReducerStreamApiAction, +} from './reducer_stream'; +import { SimpleStringStreamRequestBodySchema } from './simple_string_stream'; + +export const API_ENDPOINT = { + REDUCER_STREAM: '/internal/response_stream/reducer_stream', + SIMPLE_STRING_STREAM: '/internal/response_stream/simple_string_stream', +} as const; + +export interface ApiReducerStream extends UseFetchStreamCustomReducerParams { + endpoint: typeof API_ENDPOINT.REDUCER_STREAM; + reducer: typeof reducerStreamReducer; + body: ReducerStreamRequestBodySchema; + actions: ReducerStreamApiAction; +} + +export interface ApiSimpleStringStream extends UseFetchStreamParamsDefault { + endpoint: typeof API_ENDPOINT.SIMPLE_STRING_STREAM; + body: SimpleStringStreamRequestBodySchema; +} diff --git a/x-pack/plugins/aiops/common/api/example_stream.ts b/examples/response_stream/common/api/reducer_stream/index.ts similarity index 71% rename from x-pack/plugins/aiops/common/api/example_stream.ts rename to examples/response_stream/common/api/reducer_stream/index.ts index ccef04fc8473a..02e90dd6bd9eb 100644 --- a/x-pack/plugins/aiops/common/api/example_stream.ts +++ b/examples/response_stream/common/api/reducer_stream/index.ts @@ -1,20 +1,14 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ -import { schema, TypeOf } from '@kbn/config-schema'; - -export const aiopsExampleStreamSchema = schema.object({ - /** Boolean flag to enable/disabling simulation of response errors. */ - simulateErrors: schema.maybe(schema.boolean()), - /** Maximum timeout between streaming messages. */ - timeout: schema.maybe(schema.number()), -}); - -export type AiopsExampleStreamSchema = TypeOf; +export { reducerStreamReducer } from './reducer'; +export { reducerStreamRequestBodySchema } from './request_body_schema'; +export type { ReducerStreamRequestBodySchema } from './request_body_schema'; export const API_ACTION_NAME = { UPDATE_PROGRESS: 'update_progress', @@ -65,7 +59,7 @@ export function deleteEntityAction(payload: string): ApiActionDeleteEntity { }; } -export type AiopsExampleStreamApiAction = +export type ReducerStreamApiAction = | ApiActionUpdateProgress | ApiActionAddToEntity | ApiActionDeleteEntity; diff --git a/x-pack/plugins/aiops/public/components/single_endpoint_streaming_demo/stream_reducer.ts b/examples/response_stream/common/api/reducer_stream/reducer.ts similarity index 68% rename from x-pack/plugins/aiops/public/components/single_endpoint_streaming_demo/stream_reducer.ts rename to examples/response_stream/common/api/reducer_stream/reducer.ts index a3e9724f24a1f..f50fce4cd63cb 100644 --- a/x-pack/plugins/aiops/public/components/single_endpoint_streaming_demo/stream_reducer.ts +++ b/examples/response_stream/common/api/reducer_stream/reducer.ts @@ -1,33 +1,27 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ -import { AiopsExampleStreamApiAction, API_ACTION_NAME } from '../../../common/api/example_stream'; +import { ReducerStreamApiAction, API_ACTION_NAME } from '.'; export const UI_ACTION_NAME = { - ERROR: 'error', RESET: 'reset', } as const; export type UiActionName = typeof UI_ACTION_NAME[keyof typeof UI_ACTION_NAME]; export interface StreamState { - errors: string[]; progress: number; entities: Record; } export const initialState: StreamState = { - errors: [], progress: 0, entities: {}, }; -interface UiActionError { - type: typeof UI_ACTION_NAME.ERROR; - payload: string; -} interface UiActionResetStream { type: typeof UI_ACTION_NAME.RESET; } @@ -36,14 +30,14 @@ export function resetStream(): UiActionResetStream { return { type: UI_ACTION_NAME.RESET }; } -type UiAction = UiActionResetStream | UiActionError; -export type ReducerAction = AiopsExampleStreamApiAction | UiAction; -export function streamReducer( +type UiAction = UiActionResetStream; +export type ReducerAction = ReducerStreamApiAction | UiAction; +export function reducerStreamReducer( state: StreamState, action: ReducerAction | ReducerAction[] ): StreamState { if (Array.isArray(action)) { - return action.reduce(streamReducer, state); + return action.reduce(reducerStreamReducer, state); } switch (action.type) { @@ -72,15 +66,7 @@ export function streamReducer( }; case UI_ACTION_NAME.RESET: return initialState; - case UI_ACTION_NAME.ERROR: - return { - ...state, - errors: [...state.errors, action.payload], - }; default: - return { - ...state, - errors: [...state.errors, 'UNKNOWN_ACTION_ERROR'], - }; + return state; } } diff --git a/examples/response_stream/common/api/reducer_stream/request_body_schema.ts b/examples/response_stream/common/api/reducer_stream/request_body_schema.ts new file mode 100644 index 0000000000000..58ea487a8a539 --- /dev/null +++ b/examples/response_stream/common/api/reducer_stream/request_body_schema.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { schema, TypeOf } from '@kbn/config-schema'; + +export const reducerStreamRequestBodySchema = schema.object({ + /** Boolean flag to enable/disabling simulation of response errors. */ + simulateErrors: schema.maybe(schema.boolean()), + /** Maximum timeout between streaming messages. */ + timeout: schema.maybe(schema.number()), +}); +export type ReducerStreamRequestBodySchema = TypeOf; diff --git a/examples/response_stream/common/api/simple_string_stream/index.ts b/examples/response_stream/common/api/simple_string_stream/index.ts new file mode 100644 index 0000000000000..f154faef48e43 --- /dev/null +++ b/examples/response_stream/common/api/simple_string_stream/index.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { simpleStringStreamRequestBodySchema } from './request_body_schema'; +export type { SimpleStringStreamRequestBodySchema } from './request_body_schema'; diff --git a/examples/response_stream/common/api/simple_string_stream/request_body_schema.ts b/examples/response_stream/common/api/simple_string_stream/request_body_schema.ts new file mode 100644 index 0000000000000..8e891395e5dc8 --- /dev/null +++ b/examples/response_stream/common/api/simple_string_stream/request_body_schema.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { schema, TypeOf } from '@kbn/config-schema'; + +export const simpleStringStreamRequestBodySchema = schema.object({ + /** Maximum timeout between streaming messages. */ + timeout: schema.number(), +}); +export type SimpleStringStreamRequestBodySchema = TypeOf< + typeof simpleStringStreamRequestBodySchema +>; diff --git a/examples/response_stream/kibana.json b/examples/response_stream/kibana.json new file mode 100644 index 0000000000000..070c90b1c1ebd --- /dev/null +++ b/examples/response_stream/kibana.json @@ -0,0 +1,14 @@ +{ + "id": "responseStream", + "kibanaVersion": "kibana", + "version": "0.0.1", + "server": true, + "ui": true, + "owner": { + "name": "ML UI", + "githubTeam": "ml-ui" + }, + "requiredPlugins": ["developerExamples"], + "optionalPlugins": [], + "requiredBundles": ["kibanaReact"] +} diff --git a/examples/response_stream/public/components/page.tsx b/examples/response_stream/public/components/page.tsx new file mode 100644 index 0000000000000..86267a97a441d --- /dev/null +++ b/examples/response_stream/public/components/page.tsx @@ -0,0 +1,41 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import * as React from 'react'; + +import { + EuiPageBody, + EuiPageContent, + EuiPageContentBody, + EuiPageHeader, + EuiPageHeaderSection, + EuiTitle, +} from '@elastic/eui'; + +export interface PageProps { + title?: React.ReactNode; +} + +export const Page: React.FC = ({ title = 'Untitled', children }) => { + return ( + + + + +

{title}

+
+
+
+ + + {children} + + +
+ ); +}; diff --git a/examples/response_stream/public/containers/app/index.tsx b/examples/response_stream/public/containers/app/index.tsx new file mode 100644 index 0000000000000..eb61a748a5fd1 --- /dev/null +++ b/examples/response_stream/public/containers/app/index.tsx @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { BrowserRouter as Router, Route, Redirect, Switch } from 'react-router-dom'; +import { EuiPage } from '@elastic/eui'; +import { useDeps } from '../../hooks/use_deps'; +import { Sidebar } from './sidebar'; +import { routes } from '../../routes'; + +export const App: React.FC = () => { + const { appBasePath } = useDeps(); + + const routeElements: React.ReactElement[] = []; + for (const { items } of routes) { + for (const { id, component } of items) { + routeElements.push( component} />); + } + } + + return ( + + + + + {routeElements} + + + + + ); +}; diff --git a/x-pack/plugins/aiops/public/components/single_endpoint_streaming_demo/get_status_message.tsx b/examples/response_stream/public/containers/app/pages/page_reducer_stream/get_status_message.tsx similarity index 76% rename from x-pack/plugins/aiops/public/components/single_endpoint_streaming_demo/get_status_message.tsx rename to examples/response_stream/public/containers/app/pages/page_reducer_stream/get_status_message.tsx index e63748d03600a..479a1b5ded995 100644 --- a/x-pack/plugins/aiops/public/components/single_endpoint_streaming_demo/get_status_message.tsx +++ b/examples/response_stream/public/containers/app/pages/page_reducer_stream/get_status_message.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export function getStatusMessage(isRunning: boolean, isCancelled: boolean, progress: number) { @@ -13,7 +14,7 @@ export function getStatusMessage(isRunning: boolean, isCancelled: boolean, progr } else if (!isRunning && isCancelled) { return 'Oh no, development got cancelled!'; } else if (!isRunning && progress === 100) { - return 'Development clompeted, the release got out the door!'; + return 'Development completed, the release got out the door!'; } // When the process stops but wasn't cancelled by the user and progress is not yet at 100%, diff --git a/examples/response_stream/public/containers/app/pages/page_reducer_stream/index.tsx b/examples/response_stream/public/containers/app/pages/page_reducer_stream/index.tsx new file mode 100644 index 0000000000000..42d170ee6699d --- /dev/null +++ b/examples/response_stream/public/containers/app/pages/page_reducer_stream/index.tsx @@ -0,0 +1,140 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { useEffect, useState, FC } from 'react'; + +import { Chart, Settings, Axis, BarSeries, Position, ScaleType } from '@elastic/charts'; + +import { + EuiBadge, + EuiButton, + EuiCheckbox, + EuiFlexGroup, + EuiFlexItem, + EuiProgress, + EuiSpacer, + EuiText, +} from '@elastic/eui'; + +import { useFetchStream } from '@kbn/aiops-utils'; + +import { ApiReducerStream } from '../../../../../common/api'; +import { + initialState, + resetStream, + reducerStreamReducer, +} from '../../../../../common/api/reducer_stream/reducer'; + +import { Page } from '../../../../components/page'; + +import { useDeps } from '../../../../hooks/use_deps'; + +import { getStatusMessage } from './get_status_message'; + +export const PageReducerStream: FC = () => { + const { + core: { http, notifications }, + } = useDeps(); + + const basePath = http?.basePath.get() ?? ''; + + const [simulateErrors, setSimulateErrors] = useState(false); + + const { dispatch, start, cancel, data, error, isCancelled, isRunning } = useFetchStream< + ApiReducerStream, + typeof basePath + >( + `${basePath}/internal/response_stream/reducer_stream`, + { simulateErrors }, + { reducer: reducerStreamReducer, initialState } + ); + + const { progress, entities } = data; + + const onClickHandler = async () => { + if (isRunning) { + cancel(); + } else { + dispatch(resetStream()); + start(); + } + }; + + useEffect(() => { + if (error) { + notifications.toasts.addDanger(error); + } + }, [error, notifications.toasts]); + + const buttonLabel = isRunning ? 'Stop development' : 'Start development'; + + return ( + + +

+ This demonstrates a single endpoint with streaming support that sends Redux inspired + actions from server to client. The server and client share types of the data to be + received. The client uses a custom hook that receives stream chunks and passes them on to + `useReducer()` that acts on the Redux type actions it receives. The custom hook includes + code to buffer actions and is able to apply them in bulk so the DOM does not get hammered + with updates. Hit "Start development" to trigger the bar chart race! +

+
+
+ + + + {buttonLabel} + + + + + {progress}% + + + + + + + +
+ + + + + + { + return { + x, + y, + }; + }) + .sort((a, b) => b.y - a.y)} + /> + +
+ +

{getStatusMessage(isRunning, isCancelled, data.progress)}

+ setSimulateErrors(!simulateErrors)} + compressed + /> +
+
+ ); +}; diff --git a/examples/response_stream/public/containers/app/pages/page_simple_string_stream/index.tsx b/examples/response_stream/public/containers/app/pages/page_simple_string_stream/index.tsx new file mode 100644 index 0000000000000..ba159887edfaf --- /dev/null +++ b/examples/response_stream/public/containers/app/pages/page_simple_string_stream/index.tsx @@ -0,0 +1,71 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { FC } from 'react'; + +import { EuiButton, EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText } from '@elastic/eui'; + +import { useFetchStream } from '@kbn/aiops-utils'; + +import { ApiSimpleStringStream } from '../../../../../common/api'; + +import { useDeps } from '../../../../hooks/use_deps'; +import { Page } from '../../../../components/page'; + +export const PageSimpleStringStream: FC = () => { + const { core } = useDeps(); + const basePath = core.http?.basePath.get() ?? ''; + + const { dispatch, error, start, cancel, data, isRunning } = useFetchStream< + ApiSimpleStringStream, + typeof basePath + >(`${basePath}/internal/response_stream/simple_string_stream`, { timeout: 500 }); + + const onClickHandler = async () => { + if (isRunning) { + cancel(); + } else { + // Passing in undefined will reset `data` to an empty string. + dispatch(undefined); + start(); + } + }; + + const buttonLabel = isRunning ? 'Stop' : 'Start'; + + return ( + + +

+ This demonstrates a single endpoint with streaming support that sends just chunks of a + string from server to client. The client uses a custom hook that receives stream chunks + and passes them on to `useReducer()` that acts on the string chunks it receives. The + custom hook includes code to buffer chunks and is able to apply them in bulk so the DOM + does not get hammered with updates. Hit "Start" to trigger the stream! +

+
+
+ + + + {buttonLabel} + + + + + +

{data}

+
+ {error && ( + +

{error}

+
+ )} +
+ ); +}; diff --git a/examples/response_stream/public/containers/app/sidebar.tsx b/examples/response_stream/public/containers/app/sidebar.tsx new file mode 100644 index 0000000000000..28783a8704c6d --- /dev/null +++ b/examples/response_stream/public/containers/app/sidebar.tsx @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { EuiPageSideBar, EuiSideNav } from '@elastic/eui'; +import { useHistory } from 'react-router-dom'; +import { routes } from '../../routes'; + +export const Sidebar: React.FC = () => { + const history = useHistory(); + + return ( + + ({ + id, + name: title, + isSelected: true, + items: items.map((route) => ({ + id: route.id, + name: route.title, + onClick: () => history.push(`/${route.id}`), + 'data-test-subj': route.id, + })), + }))} + /> + + ); +}; diff --git a/examples/response_stream/public/hooks/use_deps.ts b/examples/response_stream/public/hooks/use_deps.ts new file mode 100644 index 0000000000000..ae81669c4a71f --- /dev/null +++ b/examples/response_stream/public/hooks/use_deps.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { useKibana } from '@kbn/kibana-react-plugin/public'; + +import type { ResponseStreamDeps } from '../mount'; + +export const useDeps = () => useKibana().services as ResponseStreamDeps; diff --git a/examples/response_stream/public/index.ts b/examples/response_stream/public/index.ts new file mode 100644 index 0000000000000..b7cfefe5583e0 --- /dev/null +++ b/examples/response_stream/public/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { ResponseStreamPlugin } from './plugin'; + +export const plugin = () => new ResponseStreamPlugin(); diff --git a/examples/response_stream/public/mount.tsx b/examples/response_stream/public/mount.tsx new file mode 100644 index 0000000000000..c47ca01860800 --- /dev/null +++ b/examples/response_stream/public/mount.tsx @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import * as React from 'react'; +import { render, unmountComponentAtNode } from 'react-dom'; +import { CoreSetup, CoreStart, AppMountParameters } from '@kbn/core/public'; +import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; +import { ResponseStreamStartPlugins } from './plugin'; +import { App } from './containers/app'; + +export interface ResponseStreamDeps { + appBasePath: string; + core: CoreStart; + plugins: ResponseStreamStartPlugins; +} + +export const mount = + (coreSetup: CoreSetup) => + async ({ appBasePath, element }: AppMountParameters) => { + const [core, plugins] = await coreSetup.getStartServices(); + const deps: ResponseStreamDeps = { appBasePath, core, plugins }; + const reactElement = ( + + + + ); + render(reactElement, element); + return () => unmountComponentAtNode(element); + }; diff --git a/examples/response_stream/public/plugin.ts b/examples/response_stream/public/plugin.ts new file mode 100644 index 0000000000000..c9e72f06e68ad --- /dev/null +++ b/examples/response_stream/public/plugin.ts @@ -0,0 +1,51 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Plugin, CoreSetup, AppNavLinkStatus } from '@kbn/core/public'; +import { DeveloperExamplesSetup } from '@kbn/developer-examples-plugin/public'; +import { mount } from './mount'; + +export interface ResponseStreamSetupPlugins { + developerExamples: DeveloperExamplesSetup; +} + +// eslint-disable-next-line +export interface ResponseStreamStartPlugins {} + +export class ResponseStreamPlugin implements Plugin { + public setup( + core: CoreSetup, + { developerExamples }: ResponseStreamSetupPlugins + ) { + core.application.register({ + id: 'response-stream', + title: 'response stream', + navLinkStatus: AppNavLinkStatus.hidden, + mount: mount(core), + }); + + developerExamples.register({ + appId: 'response-stream', + title: 'response stream', + description: + 'This example demonstrates how to stream chunks of data to the client with just a single request.', + links: [ + { + label: 'README', + href: 'https://github.com/elastic/kibana/blob/main/examples/response_stream/README.md', + iconType: 'logoGithub', + size: 's', + target: '_blank', + }, + ], + }); + } + + public start() {} + public stop() {} +} diff --git a/examples/response_stream/public/routes.tsx b/examples/response_stream/public/routes.tsx new file mode 100644 index 0000000000000..1d0b546f66d59 --- /dev/null +++ b/examples/response_stream/public/routes.tsx @@ -0,0 +1,42 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { PageSimpleStringStream } from './containers/app/pages/page_simple_string_stream'; +import { PageReducerStream } from './containers/app/pages/page_reducer_stream'; + +interface RouteSectionDef { + title: string; + id: string; + items: RouteDef[]; +} + +interface RouteDef { + title: string; + id: string; + component: React.ReactNode; +} + +export const routes: RouteSectionDef[] = [ + { + title: 'response stream', + id: 'responseStream', + items: [ + { + title: 'Simple string stream', + id: 'simple-string-stream', + component: , + }, + { + title: 'Reducer stream', + id: 'reducer-stream', + component: , + }, + ], + }, +]; diff --git a/examples/response_stream/server/index.ts b/examples/response_stream/server/index.ts new file mode 100644 index 0000000000000..2d1bb6229fce4 --- /dev/null +++ b/examples/response_stream/server/index.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { PluginInitializerContext } from '@kbn/core/server'; + +import { ResponseStreamPlugin } from './plugin'; + +export function plugin(initializerContext: PluginInitializerContext) { + return new ResponseStreamPlugin(initializerContext); +} diff --git a/examples/response_stream/server/plugin.ts b/examples/response_stream/server/plugin.ts new file mode 100644 index 0000000000000..f2d5e1dddb4c7 --- /dev/null +++ b/examples/response_stream/server/plugin.ts @@ -0,0 +1,39 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Plugin, PluginInitializerContext, CoreSetup, CoreStart, Logger } from '@kbn/core/server'; +import type { DataRequestHandlerContext } from '@kbn/data-plugin/server'; + +import { defineReducerStreamRoute, defineSimpleStringStreamRoute } from './routes'; + +// eslint-disable-next-line +export interface ResponseStreamSetupPlugins {} + +// eslint-disable-next-line +export interface ResponseStreamStartPlugins {} + +export class ResponseStreamPlugin implements Plugin { + private readonly logger: Logger; + + constructor(initializerContext: PluginInitializerContext) { + this.logger = initializerContext.logger.get(); + } + + public setup(core: CoreSetup, plugins: ResponseStreamSetupPlugins) { + const router = core.http.createRouter(); + + core.getStartServices().then(([_, depsStart]) => { + defineReducerStreamRoute(router, this.logger); + defineSimpleStringStreamRoute(router, this.logger); + }); + } + + public start(core: CoreStart, plugins: ResponseStreamStartPlugins) {} + + public stop() {} +} diff --git a/examples/response_stream/server/routes/index.ts b/examples/response_stream/server/routes/index.ts new file mode 100644 index 0000000000000..f18a1283aa0ec --- /dev/null +++ b/examples/response_stream/server/routes/index.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { defineReducerStreamRoute } from './reducer_stream'; +export { defineSimpleStringStreamRoute } from './single_string_stream'; diff --git a/x-pack/plugins/aiops/server/routes/example_stream.ts b/examples/response_stream/server/routes/reducer_stream.ts similarity index 67% rename from x-pack/plugins/aiops/server/routes/example_stream.ts rename to examples/response_stream/server/routes/reducer_stream.ts index 38ca28ce6f176..cb6f6f5e1b552 100644 --- a/x-pack/plugins/aiops/server/routes/example_stream.ts +++ b/examples/response_stream/server/routes/reducer_stream.ts @@ -1,28 +1,29 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { IRouter, Logger } from '@kbn/core/server'; +import { streamFactory } from '@kbn/aiops-utils'; import { - aiopsExampleStreamSchema, + reducerStreamRequestBodySchema, updateProgressAction, addToEntityAction, deleteEntityAction, -} from '../../common/api/example_stream'; + ReducerStreamApiAction, +} from '../../common/api/reducer_stream'; import { API_ENDPOINT } from '../../common/api'; -import { streamFactory } from '../lib/stream_factory'; - -export const defineExampleStreamRoute = (router: IRouter, logger: Logger) => { +export const defineReducerStreamRoute = (router: IRouter, logger: Logger) => { router.post( { - path: API_ENDPOINT.EXAMPLE_STREAM, + path: API_ENDPOINT.REDUCER_STREAM, validate: { - body: aiopsExampleStreamSchema, + body: reducerStreamRequestBodySchema, }, }, async (context, request, response) => { @@ -37,9 +38,9 @@ export const defineExampleStreamRoute = (router: IRouter, logger: Logger) => { shouldStop = true; }); - const { DELIMITER, end, push, responseWithHeaders, stream } = streamFactory< - typeof API_ENDPOINT.EXAMPLE_STREAM - >(logger, request.headers); + const { end, error, push, responseWithHeaders } = streamFactory( + request.headers + ); const entities = [ 'kimchy', @@ -55,9 +56,8 @@ export const defineExampleStreamRoute = (router: IRouter, logger: Logger) => { const actions = [...Array(19).fill('add'), 'delete']; if (simulateError) { - actions.push('server-only-error'); - actions.push('server-to-client-error'); - actions.push('client-error'); + actions.push('throw-error'); + actions.push('emit-error'); } let progress = 0; @@ -82,20 +82,20 @@ export const defineExampleStreamRoute = (router: IRouter, logger: Logger) => { push(addToEntityAction(randomEntity, randomCommits)); } else if (randomAction === 'delete') { push(deleteEntityAction(randomEntity)); - } else if (randomAction === 'server-to-client-error') { + } else if (randomAction === 'throw-error') { // Throw an error. It should not crash Kibana! + // It should be caught, logged and passed on as a stream error. throw new Error('There was a (simulated) server side error!'); - } else if (randomAction === 'client-error') { - // Return not properly encoded JSON to the client. - stream.push(`{body:'Not valid JSON${DELIMITER}`); + } else if (randomAction === 'emit-error') { + // Directly emit an error to the stream, this will not be logged. + error('Error pushed to the stream'); + return; } pushStreamUpdate(); - } catch (error) { - stream.push( - `${JSON.stringify({ type: 'error', payload: error.toString() })}${DELIMITER}` - ); - end(); + } catch (e) { + logger.error(e); + error(e); } }, Math.floor(Math.random() * maxTimeoutMs)); } diff --git a/examples/response_stream/server/routes/single_string_stream.ts b/examples/response_stream/server/routes/single_string_stream.ts new file mode 100644 index 0000000000000..97550b5630cbf --- /dev/null +++ b/examples/response_stream/server/routes/single_string_stream.ts @@ -0,0 +1,75 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { IRouter, Logger } from '@kbn/core/server'; +import { streamFactory } from '@kbn/aiops-utils'; + +import { simpleStringStreamRequestBodySchema } from '../../common/api/simple_string_stream'; +import { API_ENDPOINT } from '../../common/api'; + +function timeout(ms: number) { + return new Promise((resolve) => setTimeout(resolve, ms)); +} + +export const defineSimpleStringStreamRoute = (router: IRouter, logger: Logger) => { + router.post( + { + path: API_ENDPOINT.SIMPLE_STRING_STREAM, + validate: { + body: simpleStringStreamRequestBodySchema, + }, + }, + async (context, request, response) => { + const maxTimeoutMs = request.body.timeout ?? 250; + + let shouldStop = false; + request.events.aborted$.subscribe(() => { + shouldStop = true; + }); + request.events.completed$.subscribe(() => { + shouldStop = true; + }); + + const { end, error, push, responseWithHeaders } = streamFactory(request.headers); + + const text = + 'Elasticsearch is a search engine based on the Lucene library. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents. Elasticsearch is developed in Java and is dual-licensed under the source-available Server Side Public License and the Elastic license, while other parts fall under the proprietary (source-available) Elastic License. Official clients are available in Java, .NET (C#), PHP, Python, Apache Groovy, Ruby and many other languages. According to the DB-Engines ranking, Elasticsearch is the most popular enterprise search engine.'; + + const tokens = text.split(' '); + + async function pushStreamUpdate() { + try { + if (shouldStop) { + end(); + return; + } + + const token = tokens.shift(); + + if (token !== undefined) { + push(`${token} `); + await timeout(Math.floor(Math.random() * maxTimeoutMs)); + + if (!shouldStop) { + pushStreamUpdate(); + } + } else { + end(); + } + } catch (e) { + error(`There was an error: ${e.toString()}`); + } + } + + // do not call this using `await` so it will run asynchronously while we return the stream already. + pushStreamUpdate(); + + return response.ok(responseWithHeaders); + } + ); +}; diff --git a/examples/response_stream/tsconfig.json b/examples/response_stream/tsconfig.json new file mode 100644 index 0000000000000..9641610c54283 --- /dev/null +++ b/examples/response_stream/tsconfig.json @@ -0,0 +1,21 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + }, + "include": [ + "index.ts", + "common/**/*.ts", + "public/**/*.ts", + "public/**/*.tsx", + "server/**/*.ts", + "../../typings/**/*", + ], + "exclude": [], + "references": [ + { "path": "../../src/core/tsconfig.json" }, + { "path": "../developer_examples/tsconfig.json" }, + { "path": "../../src/plugins/data/tsconfig.json" }, + { "path": "../../src/plugins/kibana_react/tsconfig.json" }, + ] +} diff --git a/package.json b/package.json index e5fffb5b3a394..644517d2d86d1 100644 --- a/package.json +++ b/package.json @@ -131,6 +131,7 @@ "@hapi/inert": "^6.0.4", "@hapi/wreck": "^17.1.0", "@kbn/ace": "link:bazel-bin/packages/kbn-ace", + "@kbn/aiops-utils": "link:bazel-bin/packages/kbn-aiops-utils", "@kbn/alerts": "link:bazel-bin/packages/kbn-alerts", "@kbn/ambient-storybook-types": "link:bazel-bin/packages/kbn-ambient-storybook-types", "@kbn/ambient-ui-types": "link:bazel-bin/packages/kbn-ambient-ui-types", @@ -152,6 +153,7 @@ "@kbn/eslint-plugin-imports": "link:bazel-bin/packages/kbn-eslint-plugin-imports", "@kbn/field-types": "link:bazel-bin/packages/kbn-field-types", "@kbn/flot-charts": "link:bazel-bin/packages/kbn-flot-charts", + "@kbn/handlebars": "link:bazel-bin/packages/kbn-handlebars", "@kbn/i18n": "link:bazel-bin/packages/kbn-i18n", "@kbn/i18n-react": "link:bazel-bin/packages/kbn-i18n-react", "@kbn/interpreter": "link:bazel-bin/packages/kbn-interpreter", @@ -367,6 +369,7 @@ "react-dropzone": "^4.2.9", "react-fast-compare": "^2.0.4", "react-grid-layout": "^0.16.2", + "react-hook-form": "^7.30.0", "react-intl": "^2.8.0", "react-is": "^16.13.1", "react-markdown": "^4.3.1", @@ -613,6 +616,7 @@ "@types/json-stable-stringify": "^1.0.32", "@types/json5": "^0.0.30", "@types/kbn__ace": "link:bazel-bin/packages/kbn-ace/npm_module_types", + "@types/kbn__aiops-utils": "link:bazel-bin/packages/kbn-aiops-utils/npm_module_types", "@types/kbn__alerts": "link:bazel-bin/packages/kbn-alerts/npm_module_types", "@types/kbn__analytics": "link:bazel-bin/packages/kbn-analytics/npm_module_types", "@types/kbn__analytics-client": "link:bazel-bin/packages/analytics/client/npm_module_types", @@ -645,6 +649,7 @@ "@types/kbn__field-types": "link:bazel-bin/packages/kbn-field-types/npm_module_types", "@types/kbn__find-used-node-modules": "link:bazel-bin/packages/kbn-find-used-node-modules/npm_module_types", "@types/kbn__generate": "link:bazel-bin/packages/kbn-generate/npm_module_types", + "@types/kbn__handlebars": "link:bazel-bin/packages/kbn-handlebars/npm_module_types", "@types/kbn__i18n": "link:bazel-bin/packages/kbn-i18n/npm_module_types", "@types/kbn__i18n-react": "link:bazel-bin/packages/kbn-i18n-react/npm_module_types", "@types/kbn__import-resolver": "link:bazel-bin/packages/kbn-import-resolver/npm_module_types", diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel index 51db32d5d89f7..5d503b5fff46f 100644 --- a/packages/BUILD.bazel +++ b/packages/BUILD.bazel @@ -17,6 +17,7 @@ filegroup( "//packages/elastic-apm-synthtrace:build", "//packages/elastic-safer-lodash-set:build", "//packages/kbn-ace:build", + "//packages/kbn-aiops-utils:build", "//packages/kbn-alerts:build", "//packages/kbn-ambient-storybook-types:build", "//packages/kbn-ambient-ui-types:build", @@ -53,6 +54,7 @@ filegroup( "//packages/kbn-find-used-node-modules:build", "//packages/kbn-flot-charts:build", "//packages/kbn-generate:build", + "//packages/kbn-handlebars:build", "//packages/kbn-i18n-react:build", "//packages/kbn-i18n:build", "//packages/kbn-import-resolver:build", @@ -132,6 +134,7 @@ filegroup( "//packages/elastic-apm-synthtrace:build_types", "//packages/elastic-safer-lodash-set:build_types", "//packages/kbn-ace:build_types", + "//packages/kbn-aiops-utils:build_types", "//packages/kbn-alerts:build_types", "//packages/kbn-analytics:build_types", "//packages/kbn-apm-config-loader:build_types", @@ -159,6 +162,7 @@ filegroup( "//packages/kbn-field-types:build_types", "//packages/kbn-find-used-node-modules:build_types", "//packages/kbn-generate:build_types", + "//packages/kbn-handlebars:build_types", "//packages/kbn-i18n-react:build_types", "//packages/kbn-i18n:build_types", "//packages/kbn-import-resolver:build_types", diff --git a/packages/kbn-aiops-utils/BUILD.bazel b/packages/kbn-aiops-utils/BUILD.bazel new file mode 100644 index 0000000000000..cbbffd2703a87 --- /dev/null +++ b/packages/kbn-aiops-utils/BUILD.bazel @@ -0,0 +1,126 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "kbn-aiops-utils" +PKG_REQUIRE_NAME = "@kbn/aiops-utils" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + "src/**/*.tsx", + ], + exclude = [ + "**/*.test.*", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +# In this array place runtime dependencies, including other packages and NPM packages +# which must be available for this code to run. +# +# To reference other packages use: +# "//repo/relative/path/to/package" +# eg. "//packages/kbn-utils" +# +# To reference a NPM package use: +# "@npm//name-of-package" +# eg. "@npm//lodash" +RUNTIME_DEPS = [ + "//packages/kbn-logging", + "@npm//react" +] + +# In this array place dependencies necessary to build the types, which will include the +# :npm_module_types target of other packages and packages from NPM, including @types/* +# packages. +# +# To reference the types for another package use: +# "//repo/relative/path/to/package:npm_module_types" +# eg. "//packages/kbn-utils:npm_module_types" +# +# References to NPM packages work the same as RUNTIME_DEPS +TYPES_DEPS = [ + "//packages/kbn-logging:npm_module_types", + "@npm//@types/node", + "@npm//@types/jest", + "@npm//@types/react" +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + web = True, +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + emit_declaration_only = True, + out_dir = "target_types", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/kbn-aiops-utils/README.md b/packages/kbn-aiops-utils/README.md new file mode 100644 index 0000000000000..0dd5984d456ad --- /dev/null +++ b/packages/kbn-aiops-utils/README.md @@ -0,0 +1,3 @@ +# @kbn/aiops-utils + +The `aiops-utils` package contains static utilities maintained by the ML team for AIOps related efforts. diff --git a/src/plugins/vis_types/timeseries/public/application/components/lib/label_date_formatter.ts b/packages/kbn-aiops-utils/jest.config.js similarity index 51% rename from src/plugins/vis_types/timeseries/public/application/components/lib/label_date_formatter.ts rename to packages/kbn-aiops-utils/jest.config.js index e3abe86e9c22f..f3941d7831732 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/lib/label_date_formatter.ts +++ b/packages/kbn-aiops-utils/jest.config.js @@ -6,14 +6,8 @@ * Side Public License, v 1. */ -import moment from 'moment'; - -export const labelDateFormatter = (label: string, dateformat = 'lll') => { - let formattedLabel = label; - // Use moment isValid function on strict mode - const isDate = moment(label, '', true).isValid(); - if (isDate) { - formattedLabel = moment(label).format(dateformat); - } - return formattedLabel; +module.exports = { + preset: '@kbn/test', + rootDir: '../..', + roots: ['/packages/kbn-aiops-utils'], }; diff --git a/packages/kbn-aiops-utils/package.json b/packages/kbn-aiops-utils/package.json new file mode 100644 index 0000000000000..eb6ec7e802f5b --- /dev/null +++ b/packages/kbn-aiops-utils/package.json @@ -0,0 +1,8 @@ +{ + "name": "@kbn/aiops-utils", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "browser": "./target_web/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/packages/kbn-aiops-utils/src/index.ts b/packages/kbn-aiops-utils/src/index.ts new file mode 100644 index 0000000000000..7fe98de70eb7b --- /dev/null +++ b/packages/kbn-aiops-utils/src/index.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { streamFactory } from './lib/stream_factory'; +export { useFetchStream } from './lib/use_fetch_stream'; +export type { + UseFetchStreamCustomReducerParams, + UseFetchStreamParamsDefault, +} from './lib/use_fetch_stream'; diff --git a/x-pack/plugins/aiops/server/lib/accept_compression.test.ts b/packages/kbn-aiops-utils/src/lib/accept_compression.test.ts similarity index 90% rename from x-pack/plugins/aiops/server/lib/accept_compression.test.ts rename to packages/kbn-aiops-utils/src/lib/accept_compression.test.ts index f1c51f75cbe0c..cf64dfb95232a 100644 --- a/x-pack/plugins/aiops/server/lib/accept_compression.test.ts +++ b/packages/kbn-aiops-utils/src/lib/accept_compression.test.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { acceptCompression } from './accept_compression'; diff --git a/x-pack/plugins/aiops/server/lib/accept_compression.ts b/packages/kbn-aiops-utils/src/lib/accept_compression.ts similarity index 68% rename from x-pack/plugins/aiops/server/lib/accept_compression.ts rename to packages/kbn-aiops-utils/src/lib/accept_compression.ts index 0fd092d647314..f8be882b3ff92 100644 --- a/x-pack/plugins/aiops/server/lib/accept_compression.ts +++ b/packages/kbn-aiops-utils/src/lib/accept_compression.ts @@ -1,11 +1,15 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ -import type { Headers } from '@kbn/core/server'; +// TODO: Replace these with kbn packaged versions once we have those available to us. +// At the moment imports from runtime plugins into packages are not supported. +// import type { Headers } from '@kbn/core/server'; +type Headers = Record; /** * Returns whether request headers accept a response using gzip compression. diff --git a/packages/kbn-aiops-utils/src/lib/fetch_stream.ts b/packages/kbn-aiops-utils/src/lib/fetch_stream.ts new file mode 100644 index 0000000000000..1977276adc92b --- /dev/null +++ b/packages/kbn-aiops-utils/src/lib/fetch_stream.ts @@ -0,0 +1,137 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { ReducerAction } from 'react'; + +import type { UseFetchStreamParamsDefault } from './use_fetch_stream'; + +type GeneratorError = string | null; + +/** + * Uses `fetch` and `getReader` to receive an API call as a stream with multiple chunks + * as soon as they are available. `fetchStream` is implemented as a generator that will + * yield/emit chunks and can be consumed for example like this: + * + * ```js + * for await (const [error, chunk] of fetchStream(...) { + * ... + * } + * ``` + * + * @param endpoint — The API endpoint including the Kibana basepath. + * @param abortCtrl — Abort controller for cancelling the request. + * @param body — The request body. For now all requests are POST. + * @param ndjson — Boolean flag to receive the stream as a raw string or NDJSON. + * @param bufferBounce — A buffer timeout which defaults to 100ms. This collects stream + * chunks for the time of the timeout and only then yields/emits them. + * This is useful so we are more in control of passing on data to + * consuming React components and we won't hammer the DOM with + * updates on every received chunk. + * + * @returns - Yields/emits items in the format [error, value] + * inspired by node's recommended error convention for callbacks. + */ +export async function* fetchStream( + endpoint: `${BasePath}${I['endpoint']}`, + abortCtrl: React.MutableRefObject, + body: I['body'], + ndjson = true, + bufferBounce = 100 +): AsyncGenerator< + [GeneratorError, ReducerAction | Array> | undefined] +> { + const stream = await fetch(endpoint, { + signal: abortCtrl.current.signal, + method: 'POST', + headers: { + // This refers to the format of the request body, + // not the response, which will be a uint8array Buffer. + 'Content-Type': 'application/json', + 'kbn-xsrf': 'stream', + }, + ...(Object.keys(body).length > 0 ? { body: JSON.stringify(body) } : {}), + }); + + if (!stream.ok) { + yield [`Error ${stream.status}: ${stream.statusText}`, undefined]; + return; + } + + if (stream.body !== null) { + // Note that Firefox 99 doesn't support `TextDecoderStream` yet. + // That's why we skip it here and use `TextDecoder` later to decode each chunk. + // Once Firefox supports it, we can use the following alternative: + // const reader = stream.body.pipeThrough(new TextDecoderStream()).getReader(); + const reader = stream.body.getReader(); + + let partial = ''; + let actionBuffer: Array> = []; + let lastCall = 0; + + while (true) { + try { + const { value: uint8array, done } = await reader.read(); + if (done) break; + + const value = new TextDecoder().decode(uint8array); + + const full = `${partial}${value}`; + const parts = ndjson ? full.split('\n') : [full]; + const last = ndjson ? parts.pop() : ''; + + partial = last ?? ''; + + const actions = (ndjson ? parts.map((p) => JSON.parse(p)) : parts) as Array< + ReducerAction + >; + actionBuffer.push(...actions); + + const now = Date.now(); + + if (now - lastCall >= bufferBounce && actionBuffer.length > 0) { + yield [null, actionBuffer]; + actionBuffer = []; + lastCall = now; + + // In cases where the next chunk takes longer to be received than the `bufferBounce` timeout, + // we trigger this client side timeout to clear a potential intermediate buffer state. + // Since `yield` cannot be passed on to other scopes like callbacks, + // this pattern using a Promise is used to wait for the timeout. + yield new Promise< + [ + GeneratorError, + ReducerAction | Array> | undefined + ] + >((resolve) => { + setTimeout(() => { + if (actionBuffer.length > 0) { + resolve([null, actionBuffer]); + actionBuffer = []; + lastCall = now; + } else { + resolve([null, []]); + } + }, bufferBounce + 10); + }); + } + } catch (error) { + if (error.name !== 'AbortError') { + yield [error.toString(), undefined]; + } + break; + } + } + + // The stream reader might finish with a partially filled actionBuffer so + // we need to clear it once more after the request is done. + if (actionBuffer.length > 0) { + yield [null, actionBuffer]; + actionBuffer.length = 0; + } + } +} diff --git a/packages/kbn-aiops-utils/src/lib/stream_factory.test.ts b/packages/kbn-aiops-utils/src/lib/stream_factory.test.ts new file mode 100644 index 0000000000000..a5628f8d8313c --- /dev/null +++ b/packages/kbn-aiops-utils/src/lib/stream_factory.test.ts @@ -0,0 +1,189 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import zlib from 'zlib'; + +import { streamFactory } from './stream_factory'; + +interface MockItem { + type: string; + payload: string[]; +} + +const mockItem1: MockItem = { + type: 'add_fields', + payload: ['clientip'], +}; +const mockItem2: MockItem = { + type: 'add_fields', + payload: ['referer'], +}; + +describe('streamFactory', () => { + it('should encode and receive an uncompressed string based stream', async () => { + const { end, push, responseWithHeaders } = streamFactory({}); + + push('push1'); + push('push2'); + end(); + + let streamResult = ''; + for await (const chunk of responseWithHeaders.body) { + streamResult += chunk.toString('utf8'); + } + + expect(responseWithHeaders.headers).toBe(undefined); + expect(streamResult).toBe('push1push2'); + }); + + it('should encode and receive an uncompressed NDJSON based stream', async () => { + const { DELIMITER, end, push, responseWithHeaders } = streamFactory({}); + + push(mockItem1); + push(mockItem2); + end(); + + let streamResult = ''; + for await (const chunk of responseWithHeaders.body) { + streamResult += chunk.toString('utf8'); + } + + const streamItems = streamResult.split(DELIMITER); + const lastItem = streamItems.pop(); + + const parsedItems = streamItems.map((d) => JSON.parse(d)); + + expect(responseWithHeaders.headers).toBe(undefined); + expect(parsedItems).toHaveLength(2); + expect(parsedItems[0]).toStrictEqual(mockItem1); + expect(parsedItems[1]).toStrictEqual(mockItem2); + expect(lastItem).toBe(''); + }); + + // Because zlib.gunzip's API expects a callback, we need to use `done` here + // to indicate once all assertions are run. However, it's not allowed to use both + // `async` and `done` for the test callback. That's why we're using an "async IIFE" + // pattern inside the tests callback to still be able to do async/await for the + // `for await()` part. Note that the unzipping here is done just to be able to + // decode the stream for the test and assert it. When used in actual code, + // the browser on the client side will automatically take care of unzipping + // without the need for additional custom code. + it('should encode and receive a compressed string based stream', (done) => { + (async () => { + const { end, push, responseWithHeaders } = streamFactory({ + 'accept-encoding': 'gzip', + }); + + push('push1'); + push('push2'); + end(); + + const chunks = []; + for await (const chunk of responseWithHeaders.body) { + chunks.push(chunk); + } + + const buffer = Buffer.concat(chunks); + + zlib.gunzip(buffer, function (err, decoded) { + expect(err).toBe(null); + + const streamResult = decoded.toString('utf8'); + + expect(responseWithHeaders.headers).toStrictEqual({ 'content-encoding': 'gzip' }); + expect(streamResult).toBe('push1push2'); + + done(); + }); + })(); + }); + + it('should encode and receive a compressed NDJSON based stream', (done) => { + (async () => { + const { DELIMITER, end, push, responseWithHeaders } = streamFactory({ + 'accept-encoding': 'gzip', + }); + + push(mockItem1); + push(mockItem2); + end(); + + const chunks = []; + for await (const chunk of responseWithHeaders.body) { + chunks.push(chunk); + } + + const buffer = Buffer.concat(chunks); + + zlib.gunzip(buffer, function (err, decoded) { + expect(err).toBe(null); + + const streamResult = decoded.toString('utf8'); + + const streamItems = streamResult.split(DELIMITER); + const lastItem = streamItems.pop(); + + const parsedItems = streamItems.map((d) => JSON.parse(d)); + + expect(responseWithHeaders.headers).toStrictEqual({ 'content-encoding': 'gzip' }); + expect(parsedItems).toHaveLength(2); + expect(parsedItems[0]).toStrictEqual(mockItem1); + expect(parsedItems[1]).toStrictEqual(mockItem2); + expect(lastItem).toBe(''); + + done(); + }); + })(); + }); + + it('should throw when a string based stream receives a non-string chunk', async () => { + const { push } = streamFactory({}); + + // First push initializes the stream as string based. + expect(() => { + push('push1'); + }).not.toThrow(); + + // Second push is again a string and should not throw. + expect(() => { + push('push2'); + }).not.toThrow(); + + // Third push is not a string and should trigger an error. + expect(() => { + push({ myObject: 'push3' } as unknown as string); + }).toThrow('Must not push non-string chunks to a string based stream.'); + }); + + it('should throw when an NDJSON based stream receives a string chunk', async () => { + const { push } = streamFactory({}); + + // First push initializes the stream as NDJSON based. + expect(() => { + push(mockItem1); + }).not.toThrow(); + + // Second push is again a valid object and should not throw. + expect(() => { + push(mockItem1); + }).not.toThrow(); + + // Third push is a string and should trigger an error. + expect(() => { + push('push3' as unknown as MockItem); + }).toThrow('Must not push raw string chunks to an NDJSON based stream.'); + }); + + it('should throw for undefined as push value', async () => { + const { push } = streamFactory({}); + + expect(() => { + push(undefined as unknown as string); + }).toThrow('Stream chunk must not be undefined.'); + }); +}); diff --git a/packages/kbn-aiops-utils/src/lib/stream_factory.ts b/packages/kbn-aiops-utils/src/lib/stream_factory.ts new file mode 100644 index 0000000000000..f017f5190a695 --- /dev/null +++ b/packages/kbn-aiops-utils/src/lib/stream_factory.ts @@ -0,0 +1,115 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Stream } from 'stream'; +import zlib from 'zlib'; + +// TODO: Replace these with kbn packaged versions once we have those available to us. +// At the moment imports from runtime plugins into packages are not supported. +// import type { Headers } from '@kbn/core/server'; + +import { acceptCompression } from './accept_compression'; + +type Headers = Record; + +// We need this otherwise Kibana server will crash with a 'ERR_METHOD_NOT_IMPLEMENTED' error. +class ResponseStream extends Stream.PassThrough { + flush() {} + _read() {} +} + +const DELIMITER = '\n'; + +type StreamType = 'string' | 'ndjson'; + +interface StreamFactoryReturnType { + DELIMITER: string; + end: () => void; + error: (errorText: string) => void; + push: (d: T) => void; + responseWithHeaders: { + body: zlib.Gzip | ResponseStream; + // TODO: Replace these with kbn packaged versions once we have those available to us. + // At the moment imports from runtime plugins into packages are not supported. + headers?: any; + }; +} + +/** + * Overload to set up a string based response stream with support + * for gzip compression depending on provided request headers. + * + * @param headers - Request headers. + * @returns An object with stream attributes and methods. + */ +export function streamFactory(headers: Headers): StreamFactoryReturnType; +/** + * Sets up a response stream with support for gzip compression depending on provided + * request headers. Any non-string data pushed to the stream will be stream as NDJSON. + * + * @param headers - Request headers. + * @returns An object with stream attributes and methods. + */ +export function streamFactory(headers: Headers): StreamFactoryReturnType { + let streamType: StreamType; + const isCompressed = acceptCompression(headers); + + const stream = isCompressed ? zlib.createGzip() : new ResponseStream(); + + function error(errorText: string) { + stream.emit('error', errorText); + } + + function end() { + stream.end(); + } + + function push(d: T) { + if (d === undefined) { + error('Stream chunk must not be undefined.'); + return; + } + // Initialize the stream type with the first push to the stream, + // otherwise check the integrity of the data to be pushed. + if (streamType === undefined) { + streamType = typeof d === 'string' ? 'string' : 'ndjson'; + } else if (streamType === 'string' && typeof d !== 'string') { + error('Must not push non-string chunks to a string based stream.'); + return; + } else if (streamType === 'ndjson' && typeof d === 'string') { + error('Must not push raw string chunks to an NDJSON based stream.'); + return; + } + + try { + const line = typeof d !== 'string' ? `${JSON.stringify(d)}${DELIMITER}` : d; + stream.write(line); + } catch (e) { + error(`Could not serialize or stream data chunk: ${e.toString()}`); + } + + // Calling .flush() on a compression stream will + // make zlib return as much output as currently possible. + if (isCompressed) { + stream.flush(); + } + } + + const responseWithHeaders: StreamFactoryReturnType['responseWithHeaders'] = { + body: stream, + ...(isCompressed + ? { + headers: { + 'content-encoding': 'gzip', + }, + } + : {}), + }; + + return { DELIMITER, end, error, push, responseWithHeaders }; +} diff --git a/packages/kbn-aiops-utils/src/lib/string_reducer.ts b/packages/kbn-aiops-utils/src/lib/string_reducer.ts new file mode 100644 index 0000000000000..352b8f8ddd3e5 --- /dev/null +++ b/packages/kbn-aiops-utils/src/lib/string_reducer.ts @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Reducer, ReducerAction, ReducerState } from 'react'; + +type StringReducerPayload = string | string[] | undefined; +export type StringReducer = Reducer; + +/** + * The `stringReducer` is provided to handle plain string based streams with `streamFactory()`. + * + * @param state - The current state, being the string fetched so far. + * @param payload — The state update can be a plain string, an array of strings or `undefined`. + * * An array of strings will be joined without a delimiter and added to the current string. + * In combination with `useFetchStream`'s buffering this allows to do bulk updates + * within the reducer without triggering a React/DOM update on every stream chunk. + * * `undefined` can be used to reset the state to an empty string, for example, when a + * UI has the option to trigger a refetch of a stream. + * + * @returns The updated state, a string that combines the previous string and the payload. + */ +export function stringReducer( + state: ReducerState, + payload: ReducerAction +): ReducerState { + if (payload === undefined) { + return ''; + } + + return `${state}${Array.isArray(payload) ? payload.join('') : payload}`; +} diff --git a/packages/kbn-aiops-utils/src/lib/use_fetch_stream.ts b/packages/kbn-aiops-utils/src/lib/use_fetch_stream.ts new file mode 100644 index 0000000000000..d3ab97e4cd2b1 --- /dev/null +++ b/packages/kbn-aiops-utils/src/lib/use_fetch_stream.ts @@ -0,0 +1,137 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { + useEffect, + useReducer, + useRef, + useState, + Dispatch, + Reducer, + ReducerAction, + ReducerState, +} from 'react'; + +import { fetchStream } from './fetch_stream'; +import { stringReducer, StringReducer } from './string_reducer'; + +/** + * Custom hook type definition of the base params for an NDJSON stream with custom reducer. + */ +export interface UseFetchStreamCustomReducerParams { + endpoint: string; + body: object; + reducer: Reducer; +} + +/** + * Custom hook type definition of the base params for a string base stream without a custom reducer. + */ +export interface UseFetchStreamParamsDefault { + endpoint: string; + body: object; + reducer: StringReducer; +} + +interface UseFetchStreamReturnType { + cancel: () => void; + data: Data; + dispatch: Dispatch; + error: string | undefined; + isCancelled: boolean; + isRunning: boolean; + start: () => Promise; +} + +// These overloads allow us to fall back to a simple reducer that just acts on a string as the reducer state +// if no options are supplied. Passing in options will use a custom reducer with appropriate type support. +export function useFetchStream( + endpoint: `${BasePath}${I['endpoint']}`, + body: I['body'] +): UseFetchStreamReturnType>; + +export function useFetchStream< + I extends UseFetchStreamCustomReducerParams, + BasePath extends string +>( + endpoint: `${BasePath}${I['endpoint']}`, + body: I['body'], + options: { reducer: I['reducer']; initialState: ReducerState } +): UseFetchStreamReturnType, ReducerAction>; + +/** + * Custom hook to receive streaming data. + * + * @param endpoint - API endpoint including Kibana base path. + * @param body - API request body. + * @param options - Optional custom reducer and initial state. + * @returns An object with streaming data and methods act on the stream. + */ +export function useFetchStream( + endpoint: `${BasePath}${I['endpoint']}`, + body: I['body'], + options?: { reducer: I['reducer']; initialState: ReducerState } +): UseFetchStreamReturnType, ReducerAction> { + const [error, setError] = useState(); + const [isCancelled, setIsCancelled] = useState(false); + const [isRunning, setIsRunning] = useState(false); + + const reducer = (options?.reducer ?? stringReducer) as I['reducer']; + const initialState = (options?.initialState ?? '') as ReducerState; + + const [data, dispatch] = useReducer(reducer, initialState); + + const abortCtrl = useRef(new AbortController()); + + const start = async () => { + if (isRunning) { + setError('Restart not supported yet.'); + return; + } + + setError(undefined); + setIsRunning(true); + setIsCancelled(false); + + abortCtrl.current = new AbortController(); + + for await (const [fetchStreamError, actions] of fetchStream< + UseFetchStreamCustomReducerParams, + BasePath + >(endpoint, abortCtrl, body, options !== undefined)) { + if (fetchStreamError !== null) { + setError(fetchStreamError); + } else if (actions.length > 0) { + dispatch(actions as ReducerAction); + } + } + + setIsRunning(false); + }; + + const cancel = () => { + abortCtrl.current.abort(); + setIsCancelled(true); + setIsRunning(false); + }; + + // If components using this custom hook get unmounted, cancel any ongoing request. + useEffect(() => { + return () => abortCtrl.current.abort(); + }, []); + + return { + cancel, + data, + dispatch, + error, + isCancelled, + isRunning, + start, + }; +} diff --git a/packages/kbn-aiops-utils/tsconfig.json b/packages/kbn-aiops-utils/tsconfig.json new file mode 100644 index 0000000000000..e4dca2b15c9c0 --- /dev/null +++ b/packages/kbn-aiops-utils/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "src/**/*" + ] +} diff --git a/packages/kbn-es-query/src/es_query/migrate_filter.test.ts b/packages/kbn-es-query/src/es_query/migrate_filter.test.ts index 8ec5a1083bc4a..a5b25d9493276 100644 --- a/packages/kbn-es-query/src/es_query/migrate_filter.test.ts +++ b/packages/kbn-es-query/src/es_query/migrate_filter.test.ts @@ -9,6 +9,7 @@ import { isEqual, cloneDeep } from 'lodash'; import { migrateFilter, DeprecatedMatchPhraseFilter } from './migrate_filter'; import { PhraseFilter, MatchAllFilter } from '../filters'; +import { Filter } from '../filters'; describe('migrateFilter', function () { const oldMatchPhraseFilter = { @@ -66,7 +67,23 @@ describe('migrateFilter', function () { } as MatchAllFilter; const migratedFilter = migrateFilter(originalFilter, undefined); - expect(migratedFilter).toBe(originalFilter); - expect(isEqual(migratedFilter, originalFilter)).toBe(true); + expect(migratedFilter).toEqual(originalFilter); + }); + + it('should handle the case where .query already exists and filter has other top level keys on there', function () { + const originalFilter = { + query: { match_all: {} }, + meta: {}, + size: 0, + } as Filter; + + const filterAfterMigrate = { + query: { match_all: {} }, + meta: {}, + } as Filter; + + const migratedFilter = migrateFilter(originalFilter, undefined); + + expect(migratedFilter).toEqual(filterAfterMigrate); }); }); diff --git a/packages/kbn-es-query/src/es_query/migrate_filter.ts b/packages/kbn-es-query/src/es_query/migrate_filter.ts index 383b06d4405a7..0a8aa8ee69f80 100644 --- a/packages/kbn-es-query/src/es_query/migrate_filter.ts +++ b/packages/kbn-es-query/src/es_query/migrate_filter.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { get, omit } from 'lodash'; +import { get, omit, pick } from 'lodash'; import { getConvertedValueForField } from '../filters'; import { Filter } from '../filters'; import { DataViewBase } from './types'; @@ -65,6 +65,9 @@ export function migrateFilter(filter: Filter, indexPattern?: DataViewBase) { if (!filter.query) { filter.query = {}; + } else { + // handle the case where .query already exists and filter has other top level keys on there + filter = pick(filter, ['meta', 'query', '$state']); } // @ts-ignore diff --git a/packages/kbn-handlebars/.gitignore b/packages/kbn-handlebars/.gitignore new file mode 100644 index 0000000000000..d36977dc47615 --- /dev/null +++ b/packages/kbn-handlebars/.gitignore @@ -0,0 +1 @@ +.tmp diff --git a/packages/kbn-handlebars/.patches/basic.patch b/packages/kbn-handlebars/.patches/basic.patch new file mode 100644 index 0000000000000..90027eedf0f40 --- /dev/null +++ b/packages/kbn-handlebars/.patches/basic.patch @@ -0,0 +1,612 @@ +1,11c1,21 +< global.handlebarsEnv = null; +< +< beforeEach(function() { +< global.handlebarsEnv = Handlebars.create(); +< }); +< +< describe('basic context', function() { +< it('most basic', function() { +< expectTemplate('{{foo}}') +< .withInput({ foo: 'foo' }) +< .toCompileTo('foo'); +--- +> /* +> * This file is forked from the handlebars project (https://github.com/handlebars-lang/handlebars.js), +> * and may include modifications made by Elasticsearch B.V. +> * Elasticsearch B.V. licenses this file to you under the MIT License. +> * See `packages/kbn-handlebars/LICENSE` for more information. +> */ +> +> import Handlebars from '..'; +> import { expectTemplate } from '../__jest__/test_bench'; +> +> describe('basic context', () => { +> it('most basic', () => { +> expectTemplate('{{foo}}').withInput({ foo: 'foo' }).toCompileTo('foo'); +> }); +> +> it('escaping', () => { +> expectTemplate('\\{{foo}}').withInput({ foo: 'food' }).toCompileTo('{{foo}}'); +> expectTemplate('content \\{{foo}}').withInput({ foo: 'food' }).toCompileTo('content {{foo}}'); +> expectTemplate('\\\\{{foo}}').withInput({ foo: 'food' }).toCompileTo('\\food'); +> expectTemplate('content \\\\{{foo}}').withInput({ foo: 'food' }).toCompileTo('content \\food'); +> expectTemplate('\\\\ {{foo}}').withInput({ foo: 'food' }).toCompileTo('\\\\ food'); +14,36c24 +< it('escaping', function() { +< expectTemplate('\\{{foo}}') +< .withInput({ foo: 'food' }) +< .toCompileTo('{{foo}}'); +< +< expectTemplate('content \\{{foo}}') +< .withInput({ foo: 'food' }) +< .toCompileTo('content {{foo}}'); +< +< expectTemplate('\\\\{{foo}}') +< .withInput({ foo: 'food' }) +< .toCompileTo('\\food'); +< +< expectTemplate('content \\\\{{foo}}') +< .withInput({ foo: 'food' }) +< .toCompileTo('content \\food'); +< +< expectTemplate('\\\\ {{foo}}') +< .withInput({ foo: 'food' }) +< .toCompileTo('\\\\ food'); +< }); +< +< it('compiling with a basic context', function() { +--- +> it('compiling with a basic context', () => { +40c28 +< world: 'world' +--- +> world: 'world', +42d29 +< .withMessage('It works if all the required keys are provided') +46,49c33,34 +< it('compiling with a string context', function() { +< expectTemplate('{{.}}{{length}}') +< .withInput('bye') +< .toCompileTo('bye3'); +--- +> it('compiling with a string context', () => { +> expectTemplate('{{.}}{{length}}').withInput('bye').toCompileTo('bye3'); +52c37 +< it('compiling with an undefined context', function() { +--- +> it('compiling with an undefined context', () => { +62c47 +< it('comments', function() { +--- +> it('comments', () => { +66c51 +< world: 'world' +--- +> world: 'world', +68d52 +< .withMessage('comments are ignored') +72,76c56 +< +< expectTemplate(' {{~!-- long-comment --~}} blah').toCompileTo( +< 'blah' +< ); +< +--- +> expectTemplate(' {{~!-- long-comment --~}} blah').toCompileTo('blah'); +78,82c58 +< +< expectTemplate(' {{!-- long-comment --~}} blah').toCompileTo( +< ' blah' +< ); +< +--- +> expectTemplate(' {{!-- long-comment --~}} blah').toCompileTo(' blah'); +84,87c60 +< +< expectTemplate(' {{~!-- long-comment --}} blah').toCompileTo( +< ' blah' +< ); +--- +> expectTemplate(' {{~!-- long-comment --}} blah').toCompileTo(' blah'); +90,91c63,64 +< it('boolean', function() { +< var string = '{{#goodbye}}GOODBYE {{/goodbye}}cruel {{world}}!'; +--- +> it('boolean', () => { +> const string = '{{#goodbye}}GOODBYE {{/goodbye}}cruel {{world}}!'; +95c68 +< world: 'world' +--- +> world: 'world', +97d69 +< .withMessage('booleans show the contents when true') +103c75 +< world: 'world' +--- +> world: 'world', +105d76 +< .withMessage('booleans do not show the contents when false') +109c80 +< it('zeros', function() { +--- +> it('zeros', () => { +113c84 +< num2: 0 +--- +> num2: 0, +117,119c88 +< expectTemplate('num: {{.}}') +< .withInput(0) +< .toCompileTo('num: 0'); +--- +> expectTemplate('num: {{.}}').withInput(0).toCompileTo('num: 0'); +126c95 +< it('false', function() { +--- +> it('false', () => { +131c100 +< val2: new Boolean(false) +--- +> val2: new Boolean(false), +135,137c104 +< expectTemplate('val: {{.}}') +< .withInput(false) +< .toCompileTo('val: false'); +--- +> expectTemplate('val: {{.}}').withInput(false).toCompileTo('val: false'); +146c113 +< val2: new Boolean(false) +--- +> val2: new Boolean(false), +156c123 +< it('should handle undefined and null', function() { +--- +> it('should handle undefined and null', () => { +159,167c126,128 +< awesome: function(_undefined, _null, options) { +< return ( +< (_undefined === undefined) + +< ' ' + +< (_null === null) + +< ' ' + +< typeof options +< ); +< } +--- +> awesome(_undefined: any, _null: any, options: any) { +> return (_undefined === undefined) + ' ' + (_null === null) + ' ' + typeof options; +> }, +173c134 +< undefined: function() { +--- +> undefined() { +175c136 +< } +--- +> }, +181c142 +< null: function() { +--- +> null() { +183c144 +< } +--- +> }, +188c149 +< it('newlines', function() { +--- +> it('newlines', () => { +190d150 +< +194,223c154,160 +< it('escaping text', function() { +< expectTemplate("Awesome's") +< .withMessage( +< "text is escaped so that it doesn't get caught on single quotes" +< ) +< .toCompileTo("Awesome's"); +< +< expectTemplate('Awesome\\') +< .withMessage("text is escaped so that the closing quote can't be ignored") +< .toCompileTo('Awesome\\'); +< +< expectTemplate('Awesome\\\\ foo') +< .withMessage("text is escaped so that it doesn't mess up backslashes") +< .toCompileTo('Awesome\\\\ foo'); +< +< expectTemplate('Awesome {{foo}}') +< .withInput({ foo: '\\' }) +< .withMessage("text is escaped so that it doesn't mess up backslashes") +< .toCompileTo('Awesome \\'); +< +< expectTemplate(" ' ' ") +< .withMessage('double quotes never produce invalid javascript') +< .toCompileTo(" ' ' "); +< }); +< +< it('escaping expressions', function() { +< expectTemplate('{{{awesome}}}') +< .withInput({ awesome: "&'\\<>" }) +< .withMessage("expressions with 3 handlebars aren't escaped") +< .toCompileTo("&'\\<>"); +--- +> it('escaping text', () => { +> expectTemplate("Awesome's").toCompileTo("Awesome's"); +> expectTemplate('Awesome\\').toCompileTo('Awesome\\'); +> expectTemplate('Awesome\\\\ foo').toCompileTo('Awesome\\\\ foo'); +> expectTemplate('Awesome {{foo}}').withInput({ foo: '\\' }).toCompileTo('Awesome \\'); +> expectTemplate(" ' ' ").toCompileTo(" ' ' "); +> }); +225,228c162,165 +< expectTemplate('{{&awesome}}') +< .withInput({ awesome: "&'\\<>" }) +< .withMessage("expressions with {{& handlebars aren't escaped") +< .toCompileTo("&'\\<>"); +--- +> it('escaping expressions', () => { +> expectTemplate('{{{awesome}}}').withInput({ awesome: "&'\\<>" }).toCompileTo("&'\\<>"); +> +> expectTemplate('{{&awesome}}').withInput({ awesome: "&'\\<>" }).toCompileTo("&'\\<>"); +232d168 +< .withMessage('by default expressions should be escaped') +237d172 +< .withMessage('escaping should properly handle amperstands') +241c176 +< it("functions returning safestrings shouldn't be escaped", function() { +--- +> it("functions returning safestrings shouldn't be escaped", () => { +244c179 +< awesome: function() { +--- +> awesome() { +246c181 +< } +--- +> }, +248d182 +< .withMessage("functions returning safestrings aren't escaped") +252c186 +< it('functions', function() { +--- +> it('functions', () => { +255c189 +< awesome: function() { +--- +> awesome() { +257c191 +< } +--- +> }, +259d192 +< .withMessage('functions are called and render their output') +264c197 +< awesome: function() { +--- +> awesome() { +267c200 +< more: 'More awesome' +--- +> more: 'More awesome', +269d201 +< .withMessage('functions are bound to the context') +273c205 +< it('functions with context argument', function() { +--- +> it('functions with context argument', () => { +276c208 +< awesome: function(context) { +--- +> awesome(context: any) { +279c211 +< frank: 'Frank' +--- +> frank: 'Frank', +281d212 +< .withMessage('functions are called with context arguments') +285c216 +< it('pathed functions with context argument', function() { +--- +> it('pathed functions with context argument', () => { +289c220 +< awesome: function(context) { +--- +> awesome(context: any) { +291c222 +< } +--- +> }, +293c224 +< frank: 'Frank' +--- +> frank: 'Frank', +295d225 +< .withMessage('functions are called with context arguments') +299c229 +< it('depthed functions with context argument', function() { +--- +> it('depthed functions with context argument', () => { +302c232 +< awesome: function(context) { +--- +> awesome(context: any) { +305c235 +< frank: 'Frank' +--- +> frank: 'Frank', +307d236 +< .withMessage('functions are called with context arguments') +311c240 +< it('block functions with context argument', function() { +--- +> it('block functions with context argument', () => { +314c243 +< awesome: function(context, options) { +--- +> awesome(context: any, options: any) { +316c245 +< } +--- +> }, +318d246 +< .withMessage('block functions are called with context and options') +322,325c250,251 +< it('depthed block functions with context argument', function() { +< expectTemplate( +< '{{#with value}}{{#../awesome 1}}inner {{.}}{{/../awesome}}{{/with}}' +< ) +--- +> it('depthed block functions with context argument', () => { +> expectTemplate('{{#with value}}{{#../awesome 1}}inner {{.}}{{/../awesome}}{{/with}}') +328c254 +< awesome: function(context, options) { +--- +> awesome(context: any, options: any) { +330c256 +< } +--- +> }, +332d257 +< .withMessage('block functions are called with context and options') +336c261 +< it('block functions without context argument', function() { +--- +> it('block functions without context argument', () => { +339c264 +< awesome: function(options) { +--- +> awesome(options: any) { +341c266 +< } +--- +> }, +343d267 +< .withMessage('block functions are called with options') +347c271 +< it('pathed block functions without context argument', function() { +--- +> it('pathed block functions without context argument', () => { +351c275 +< awesome: function() { +--- +> awesome() { +353,354c277,278 +< } +< } +--- +> }, +> }, +356d279 +< .withMessage('block functions are called with options') +360,363c283,284 +< it('depthed block functions without context argument', function() { +< expectTemplate( +< '{{#with value}}{{#../awesome}}inner{{/../awesome}}{{/with}}' +< ) +--- +> it('depthed block functions without context argument', () => { +> expectTemplate('{{#with value}}{{#../awesome}}inner{{/../awesome}}{{/with}}') +366c287 +< awesome: function() { +--- +> awesome() { +368c289 +< } +--- +> }, +370d290 +< .withMessage('block functions are called with options') +374,378c294,295 +< it('paths with hyphens', function() { +< expectTemplate('{{foo-bar}}') +< .withInput({ 'foo-bar': 'baz' }) +< .withMessage('Paths can contain hyphens (-)') +< .toCompileTo('baz'); +--- +> it('paths with hyphens', () => { +> expectTemplate('{{foo-bar}}').withInput({ 'foo-bar': 'baz' }).toCompileTo('baz'); +382d298 +< .withMessage('Paths can contain hyphens (-)') +387d302 +< .withMessage('Paths can contain hyphens (-)') +391c306 +< it('nested paths', function() { +--- +> it('nested paths', () => { +394d308 +< .withMessage('Nested paths access nested objects') +398c312 +< it('nested paths with empty string value', function() { +--- +> it('nested paths with empty string value', () => { +401d314 +< .withMessage('Nested paths access nested objects with empty string') +405c318 +< it('literal paths', function() { +--- +> it('literal paths', () => { +408d320 +< .withMessage('Literal paths can be used') +413d324 +< .withMessage('Literal paths can be used') +417c328 +< it('literal references', function() { +--- +> it('literal references', () => { +443c354 +< it("that current context path ({{.}}) doesn't hit helpers", function() { +--- +> it("that current context path ({{.}}) doesn't hit helpers", () => { +445a357 +> // @ts-expect-error Setting the helper to a string instead of a function doesn't make sense normally, but here it doesn't matter +450c362 +< it('complex but empty paths', function() { +--- +> it('complex but empty paths', () => { +455,457c367 +< expectTemplate('{{person/name}}') +< .withInput({ person: {} }) +< .toCompileTo(''); +--- +> expectTemplate('{{person/name}}').withInput({ person: {} }).toCompileTo(''); +460c370 +< it('this keyword in paths', function() { +--- +> it('this keyword in paths', () => { +463d372 +< .withMessage('This keyword in paths evaluates to current context') +468c377 +< hellos: [{ text: 'hello' }, { text: 'Hello' }, { text: 'HELLO' }] +--- +> hellos: [{ text: 'hello' }, { text: 'Hello' }, { text: 'HELLO' }], +470d378 +< .withMessage('This keyword evaluates in more complex paths') +474c382 +< it('this keyword nested inside path', function() { +--- +> it('this keyword nested inside path', () => { +476d383 +< Error, +480,482c387 +< expectTemplate('{{[this]}}') +< .withInput({ this: 'bar' }) +< .toCompileTo('bar'); +--- +> expectTemplate('{{[this]}}').withInput({ this: 'bar' }).toCompileTo('bar'); +489,491c394,396 +< it('this keyword in helpers', function() { +< var helpers = { +< foo: function(value) { +--- +> it('this keyword in helpers', () => { +> const helpers = { +> foo(value: any) { +493c398 +< } +--- +> }, +499d403 +< .withMessage('This keyword in paths evaluates to current context') +504c408 +< hellos: [{ text: 'hello' }, { text: 'Hello' }, { text: 'HELLO' }] +--- +> hellos: [{ text: 'hello' }, { text: 'Hello' }, { text: 'HELLO' }], +507d410 +< .withMessage('This keyword evaluates in more complex paths') +511c414 +< it('this keyword nested inside helpers param', function() { +--- +> it('this keyword nested inside helpers param', () => { +513d415 +< Error, +519c421 +< foo: function(value) { +--- +> foo(value: any) { +522c424 +< this: 'bar' +--- +> this: 'bar', +528c430 +< foo: function(value) { +--- +> foo(value: any) { +531c433 +< text: { this: 'bar' } +--- +> text: { this: 'bar' }, +536c438 +< it('pass string literals', function() { +--- +> it('pass string literals', () => { +538,541c440 +< +< expectTemplate('{{"foo"}}') +< .withInput({ foo: 'bar' }) +< .toCompileTo('bar'); +--- +> expectTemplate('{{"foo"}}').withInput({ foo: 'bar' }).toCompileTo('bar'); +545c444 +< foo: ['bar', 'baz'] +--- +> foo: ['bar', 'baz'], +550c449 +< it('pass number literals', function() { +--- +> it('pass number literals', () => { +552,556c451 +< +< expectTemplate('{{12}}') +< .withInput({ '12': 'bar' }) +< .toCompileTo('bar'); +< +--- +> expectTemplate('{{12}}').withInput({ '12': 'bar' }).toCompileTo('bar'); +558,562c453 +< +< expectTemplate('{{12.34}}') +< .withInput({ '12.34': 'bar' }) +< .toCompileTo('bar'); +< +--- +> expectTemplate('{{12.34}}').withInput({ '12.34': 'bar' }).toCompileTo('bar'); +565c456 +< '12.34': function(arg) { +--- +> '12.34'(arg: any) { +567c458 +< } +--- +> }, +572c463 +< it('pass boolean literals', function() { +--- +> it('pass boolean literals', () => { +574,581c465,466 +< +< expectTemplate('{{true}}') +< .withInput({ '': 'foo' }) +< .toCompileTo(''); +< +< expectTemplate('{{false}}') +< .withInput({ false: 'foo' }) +< .toCompileTo('foo'); +--- +> expectTemplate('{{true}}').withInput({ '': 'foo' }).toCompileTo(''); +> expectTemplate('{{false}}').withInput({ false: 'foo' }).toCompileTo('foo'); +584c469 +< it('should handle literals in subexpression', function() { +--- +> it('should handle literals in subexpression', () => { +587c472 +< false: function() { +--- +> false() { +589c474 +< } +--- +> }, +591c476 +< .withHelper('foo', function(arg) { +--- +> .withHelper('foo', function (arg) { diff --git a/packages/kbn-handlebars/.patches/blocks.patch b/packages/kbn-handlebars/.patches/blocks.patch new file mode 100644 index 0000000000000..731ee90e6e9b8 --- /dev/null +++ b/packages/kbn-handlebars/.patches/blocks.patch @@ -0,0 +1,461 @@ +1,3c1,12 +< describe('blocks', function() { +< it('array', function() { +< var string = '{{#goodbyes}}{{text}}! {{/goodbyes}}cruel {{world}}!'; +--- +> /* +> * This file is forked from the handlebars project (https://github.com/handlebars-lang/handlebars.js), +> * and may include modifications made by Elasticsearch B.V. +> * Elasticsearch B.V. licenses this file to you under the MIT License. +> * See `packages/kbn-handlebars/LICENSE` for more information. +> */ +> +> import { expectTemplate } from '../__jest__/test_bench'; +> +> describe('blocks', () => { +> it('array', () => { +> const string = '{{#goodbyes}}{{text}}! {{/goodbyes}}cruel {{world}}!'; +7,12c16,17 +< goodbyes: [ +< { text: 'goodbye' }, +< { text: 'Goodbye' }, +< { text: 'GOODBYE' } +< ], +< world: 'world' +--- +> goodbyes: [{ text: 'goodbye' }, { text: 'Goodbye' }, { text: 'GOODBYE' }], +> world: 'world', +14d18 +< .withMessage('Arrays iterate over the contents when not empty') +20c24 +< world: 'world' +--- +> world: 'world', +22d25 +< .withMessage('Arrays ignore the contents when empty') +26,29c29,30 +< it('array without data', function() { +< expectTemplate( +< '{{#goodbyes}}{{text}}{{/goodbyes}} {{#goodbyes}}{{text}}{{/goodbyes}}' +< ) +--- +> it('array without data', () => { +> expectTemplate('{{#goodbyes}}{{text}}{{/goodbyes}} {{#goodbyes}}{{text}}{{/goodbyes}}') +31,36c32,33 +< goodbyes: [ +< { text: 'goodbye' }, +< { text: 'Goodbye' }, +< { text: 'GOODBYE' } +< ], +< world: 'world' +--- +> goodbyes: [{ text: 'goodbye' }, { text: 'Goodbye' }, { text: 'GOODBYE' }], +> world: 'world', +38d34 +< .withCompileOptions({ compat: false }) +42,45c38,39 +< it('array with @index', function() { +< expectTemplate( +< '{{#goodbyes}}{{@index}}. {{text}}! {{/goodbyes}}cruel {{world}}!' +< ) +--- +> it('array with @index', () => { +> expectTemplate('{{#goodbyes}}{{@index}}. {{text}}! {{/goodbyes}}cruel {{world}}!') +47,52c41,42 +< goodbyes: [ +< { text: 'goodbye' }, +< { text: 'Goodbye' }, +< { text: 'GOODBYE' } +< ], +< world: 'world' +--- +> goodbyes: [{ text: 'goodbye' }, { text: 'Goodbye' }, { text: 'GOODBYE' }], +> world: 'world', +54d43 +< .withMessage('The @index variable is used') +58,59c47,48 +< it('empty block', function() { +< var string = '{{#goodbyes}}{{/goodbyes}}cruel {{world}}!'; +--- +> it('empty block', () => { +> const string = '{{#goodbyes}}{{/goodbyes}}cruel {{world}}!'; +63,68c52,53 +< goodbyes: [ +< { text: 'goodbye' }, +< { text: 'Goodbye' }, +< { text: 'GOODBYE' } +< ], +< world: 'world' +--- +> goodbyes: [{ text: 'goodbye' }, { text: 'Goodbye' }, { text: 'GOODBYE' }], +> world: 'world', +70d54 +< .withMessage('Arrays iterate over the contents when not empty') +76c60 +< world: 'world' +--- +> world: 'world', +78d61 +< .withMessage('Arrays ignore the contents when empty') +82c65 +< it('block with complex lookup', function() { +--- +> it('block with complex lookup', () => { +86,90c69 +< goodbyes: [ +< { text: 'goodbye' }, +< { text: 'Goodbye' }, +< { text: 'GOODBYE' } +< ] +--- +> goodbyes: [{ text: 'goodbye' }, { text: 'Goodbye' }, { text: 'GOODBYE' }], +92,97c71 +< .withMessage( +< 'Templates can access variables in contexts up the stack with relative path syntax' +< ) +< .toCompileTo( +< 'goodbye cruel Alan! Goodbye cruel Alan! GOODBYE cruel Alan! ' +< ); +--- +> .toCompileTo('goodbye cruel Alan! Goodbye cruel Alan! GOODBYE cruel Alan! '); +100c74 +< it('multiple blocks with complex lookup', function() { +--- +> it('multiple blocks with complex lookup', () => { +104,108c78 +< goodbyes: [ +< { text: 'goodbye' }, +< { text: 'Goodbye' }, +< { text: 'GOODBYE' } +< ] +--- +> goodbyes: [{ text: 'goodbye' }, { text: 'Goodbye' }, { text: 'GOODBYE' }], +113,116c83,84 +< it('block with complex lookup using nested context', function() { +< expectTemplate( +< '{{#goodbyes}}{{text}} cruel {{foo/../name}}! {{/goodbyes}}' +< ).toThrow(Error); +--- +> it('block with complex lookup using nested context', () => { +> expectTemplate('{{#goodbyes}}{{text}} cruel {{foo/../name}}! {{/goodbyes}}').toThrow(Error); +119c87 +< it('block with deep nested complex lookup', function() { +--- +> it('block with deep nested complex lookup', () => { +125c93 +< outer: [{ sibling: 'sad', inner: [{ text: 'goodbye' }] }] +--- +> outer: [{ sibling: 'sad', inner: [{ text: 'goodbye' }] }], +130,133c98,99 +< it('works with cached blocks', function() { +< expectTemplate( +< '{{#each person}}{{#with .}}{{first}} {{last}}{{/with}}{{/each}}' +< ) +--- +> it('works with cached blocks', () => { +> expectTemplate('{{#each person}}{{#with .}}{{first}} {{last}}{{/with}}{{/each}}') +138,139c104,105 +< { first: 'Alan', last: 'Johnson' } +< ] +--- +> { first: 'Alan', last: 'Johnson' }, +> ], +144,145c110,111 +< describe('inverted sections', function() { +< it('inverted sections with unset value', function() { +--- +> describe('inverted sections', () => { +> it('inverted sections with unset value', () => { +148,150c114 +< ) +< .withMessage("Inverted section rendered when value isn't set.") +< .toCompileTo('Right On!'); +--- +> ).toCompileTo('Right On!'); +153,156c117,118 +< it('inverted section with false value', function() { +< expectTemplate( +< '{{#goodbyes}}{{this}}{{/goodbyes}}{{^goodbyes}}Right On!{{/goodbyes}}' +< ) +--- +> it('inverted section with false value', () => { +> expectTemplate('{{#goodbyes}}{{this}}{{/goodbyes}}{{^goodbyes}}Right On!{{/goodbyes}}') +158d119 +< .withMessage('Inverted section rendered when value is false.') +162,165c123,124 +< it('inverted section with empty set', function() { +< expectTemplate( +< '{{#goodbyes}}{{this}}{{/goodbyes}}{{^goodbyes}}Right On!{{/goodbyes}}' +< ) +--- +> it('inverted section with empty set', () => { +> expectTemplate('{{#goodbyes}}{{this}}{{/goodbyes}}{{^goodbyes}}Right On!{{/goodbyes}}') +167d125 +< .withMessage('Inverted section rendered when value is empty set.') +171c129 +< it('block inverted sections', function() { +--- +> it('block inverted sections', () => { +177c135 +< it('chained inverted sections', function() { +--- +> it('chained inverted sections', () => { +188,190c146 +< expectTemplate( +< '{{#people}}{{name}}{{else if none}}{{none}}{{else}}fail{{/people}}' +< ) +--- +> expectTemplate('{{#people}}{{name}}{{else if none}}{{none}}{{else}}fail{{/people}}') +195,198c151,152 +< it('chained inverted sections with mismatch', function() { +< expectTemplate( +< '{{#people}}{{name}}{{else if none}}{{none}}{{/if}}' +< ).toThrow(Error); +--- +> it('chained inverted sections with mismatch', () => { +> expectTemplate('{{#people}}{{name}}{{else if none}}{{none}}{{/if}}').toThrow(Error); +201c155 +< it('block inverted sections with empty arrays', function() { +--- +> it('block inverted sections with empty arrays', () => { +205c159 +< people: [] +--- +> people: [], +211,212c165,166 +< describe('standalone sections', function() { +< it('block standalone else sections', function() { +--- +> describe('standalone sections', () => { +> it('block standalone else sections', () => { +226,241c180,181 +< it('block standalone else sections can be disabled', function() { +< expectTemplate('{{#people}}\n{{name}}\n{{^}}\n{{none}}\n{{/people}}\n') +< .withInput({ none: 'No people' }) +< .withCompileOptions({ ignoreStandalone: true }) +< .toCompileTo('\nNo people\n\n'); +< +< expectTemplate('{{#none}}\n{{.}}\n{{^}}\nFail\n{{/none}}\n') +< .withInput({ none: 'No people' }) +< .withCompileOptions({ ignoreStandalone: true }) +< .toCompileTo('\nNo people\n\n'); +< }); +< +< it('block standalone chained else sections', function() { +< expectTemplate( +< '{{#people}}\n{{name}}\n{{else if none}}\n{{none}}\n{{/people}}\n' +< ) +--- +> it('block standalone chained else sections', () => { +> expectTemplate('{{#people}}\n{{name}}\n{{else if none}}\n{{none}}\n{{/people}}\n') +245,247c185 +< expectTemplate( +< '{{#people}}\n{{name}}\n{{else if none}}\n{{none}}\n{{^}}\n{{/people}}\n' +< ) +--- +> expectTemplate('{{#people}}\n{{name}}\n{{else if none}}\n{{none}}\n{{^}}\n{{/people}}\n') +252c190 +< it('should handle nesting', function() { +--- +> it('should handle nesting', () => { +255c193 +< data: [1, 3, 5] +--- +> data: [1, 3, 5], +260,455d197 +< +< describe('compat mode', function() { +< it('block with deep recursive lookup lookup', function() { +< expectTemplate( +< '{{#outer}}Goodbye {{#inner}}cruel {{omg}}{{/inner}}{{/outer}}' +< ) +< .withInput({ omg: 'OMG!', outer: [{ inner: [{ text: 'goodbye' }] }] }) +< .withCompileOptions({ compat: true }) +< .toCompileTo('Goodbye cruel OMG!'); +< }); +< +< it('block with deep recursive pathed lookup', function() { +< expectTemplate( +< '{{#outer}}Goodbye {{#inner}}cruel {{omg.yes}}{{/inner}}{{/outer}}' +< ) +< .withInput({ +< omg: { yes: 'OMG!' }, +< outer: [{ inner: [{ yes: 'no', text: 'goodbye' }] }] +< }) +< .withCompileOptions({ compat: true }) +< .toCompileTo('Goodbye cruel OMG!'); +< }); +< +< it('block with missed recursive lookup', function() { +< expectTemplate( +< '{{#outer}}Goodbye {{#inner}}cruel {{omg.yes}}{{/inner}}{{/outer}}' +< ) +< .withInput({ +< omg: { no: 'OMG!' }, +< outer: [{ inner: [{ yes: 'no', text: 'goodbye' }] }] +< }) +< .withCompileOptions({ compat: true }) +< .toCompileTo('Goodbye cruel '); +< }); +< }); +< +< describe('decorators', function() { +< it('should apply mustache decorators', function() { +< expectTemplate('{{#helper}}{{*decorator}}{{/helper}}') +< .withHelper('helper', function(options) { +< return options.fn.run; +< }) +< .withDecorator('decorator', function(fn) { +< fn.run = 'success'; +< return fn; +< }) +< .toCompileTo('success'); +< }); +< +< it('should apply allow undefined return', function() { +< expectTemplate('{{#helper}}{{*decorator}}suc{{/helper}}') +< .withHelper('helper', function(options) { +< return options.fn() + options.fn.run; +< }) +< .withDecorator('decorator', function(fn) { +< fn.run = 'cess'; +< }) +< .toCompileTo('success'); +< }); +< +< it('should apply block decorators', function() { +< expectTemplate( +< '{{#helper}}{{#*decorator}}success{{/decorator}}{{/helper}}' +< ) +< .withHelper('helper', function(options) { +< return options.fn.run; +< }) +< .withDecorator('decorator', function(fn, props, container, options) { +< fn.run = options.fn(); +< return fn; +< }) +< .toCompileTo('success'); +< }); +< +< it('should support nested decorators', function() { +< expectTemplate( +< '{{#helper}}{{#*decorator}}{{#*nested}}suc{{/nested}}cess{{/decorator}}{{/helper}}' +< ) +< .withHelper('helper', function(options) { +< return options.fn.run; +< }) +< .withDecorators({ +< decorator: function(fn, props, container, options) { +< fn.run = options.fn.nested + options.fn(); +< return fn; +< }, +< nested: function(fn, props, container, options) { +< props.nested = options.fn(); +< } +< }) +< .toCompileTo('success'); +< }); +< +< it('should apply multiple decorators', function() { +< expectTemplate( +< '{{#helper}}{{#*decorator}}suc{{/decorator}}{{#*decorator}}cess{{/decorator}}{{/helper}}' +< ) +< .withHelper('helper', function(options) { +< return options.fn.run; +< }) +< .withDecorator('decorator', function(fn, props, container, options) { +< fn.run = (fn.run || '') + options.fn(); +< return fn; +< }) +< .toCompileTo('success'); +< }); +< +< it('should access parent variables', function() { +< expectTemplate('{{#helper}}{{*decorator foo}}{{/helper}}') +< .withHelper('helper', function(options) { +< return options.fn.run; +< }) +< .withDecorator('decorator', function(fn, props, container, options) { +< fn.run = options.args; +< return fn; +< }) +< .withInput({ foo: 'success' }) +< .toCompileTo('success'); +< }); +< +< it('should work with root program', function() { +< var run; +< expectTemplate('{{*decorator "success"}}') +< .withDecorator('decorator', function(fn, props, container, options) { +< equals(options.args[0], 'success'); +< run = true; +< return fn; +< }) +< .withInput({ foo: 'success' }) +< .toCompileTo(''); +< equals(run, true); +< }); +< +< it('should fail when accessing variables from root', function() { +< var run; +< expectTemplate('{{*decorator foo}}') +< .withDecorator('decorator', function(fn, props, container, options) { +< equals(options.args[0], undefined); +< run = true; +< return fn; +< }) +< .withInput({ foo: 'fail' }) +< .toCompileTo(''); +< equals(run, true); +< }); +< +< describe('registration', function() { +< it('unregisters', function() { +< handlebarsEnv.decorators = {}; +< +< handlebarsEnv.registerDecorator('foo', function() { +< return 'fail'; +< }); +< +< equals(!!handlebarsEnv.decorators.foo, true); +< handlebarsEnv.unregisterDecorator('foo'); +< equals(handlebarsEnv.decorators.foo, undefined); +< }); +< +< it('allows multiple globals', function() { +< handlebarsEnv.decorators = {}; +< +< handlebarsEnv.registerDecorator({ +< foo: function() {}, +< bar: function() {} +< }); +< +< equals(!!handlebarsEnv.decorators.foo, true); +< equals(!!handlebarsEnv.decorators.bar, true); +< handlebarsEnv.unregisterDecorator('foo'); +< handlebarsEnv.unregisterDecorator('bar'); +< equals(handlebarsEnv.decorators.foo, undefined); +< equals(handlebarsEnv.decorators.bar, undefined); +< }); +< +< it('fails with multiple and args', function() { +< shouldThrow( +< function() { +< handlebarsEnv.registerDecorator( +< { +< world: function() { +< return 'world!'; +< }, +< testHelper: function() { +< return 'found it!'; +< } +< }, +< {} +< ); +< }, +< Error, +< 'Arg not supported with multiple decorators' +< ); +< }); +< }); +< }); diff --git a/packages/kbn-handlebars/.patches/builtins.patch b/packages/kbn-handlebars/.patches/builtins.patch new file mode 100644 index 0000000000000..64e3294009a85 --- /dev/null +++ b/packages/kbn-handlebars/.patches/builtins.patch @@ -0,0 +1,872 @@ +1,4c1,16 +< describe('builtin helpers', function() { +< describe('#if', function() { +< it('if', function() { +< var string = '{{#if goodbye}}GOODBYE {{/if}}cruel {{world}}!'; +--- +> /* +> * This file is forked from the handlebars project (https://github.com/handlebars-lang/handlebars.js), +> * and may include modifications made by Elasticsearch B.V. +> * Elasticsearch B.V. licenses this file to you under the MIT License. +> * See `packages/kbn-handlebars/LICENSE` for more information. +> */ +> +> /* eslint-disable max-classes-per-file */ +> +> import Handlebars from '..'; +> import { expectTemplate } from '../__jest__/test_bench'; +> +> describe('builtin helpers', () => { +> describe('#if', () => { +> it('if', () => { +> const string = '{{#if goodbye}}GOODBYE {{/if}}cruel {{world}}!'; +9c21 +< world: 'world' +--- +> world: 'world', +11d22 +< .withMessage('if with boolean argument shows the contents when true') +17c28 +< world: 'world' +--- +> world: 'world', +19d29 +< .withMessage('if with string argument shows the contents') +25c35 +< world: 'world' +--- +> world: 'world', +27,29d36 +< .withMessage( +< 'if with boolean argument does not show the contents when false' +< ) +32,35c39 +< expectTemplate(string) +< .withInput({ world: 'world' }) +< .withMessage('if with undefined does not show the contents') +< .toCompileTo('cruel world!'); +--- +> expectTemplate(string).withInput({ world: 'world' }).toCompileTo('cruel world!'); +40c44 +< world: 'world' +--- +> world: 'world', +42d45 +< .withMessage('if with non-empty array shows the contents') +48c51 +< world: 'world' +--- +> world: 'world', +50d52 +< .withMessage('if with empty array does not show the contents') +56c58 +< world: 'world' +--- +> world: 'world', +58d59 +< .withMessage('if with zero does not show the contents') +61,63c62 +< expectTemplate( +< '{{#if goodbye includeZero=true}}GOODBYE {{/if}}cruel {{world}}!' +< ) +--- +> expectTemplate('{{#if goodbye includeZero=true}}GOODBYE {{/if}}cruel {{world}}!') +66c65 +< world: 'world' +--- +> world: 'world', +68d66 +< .withMessage('if with zero does not show the contents') +72,73c70,71 +< it('if with function argument', function() { +< var string = '{{#if goodbye}}GOODBYE {{/if}}cruel {{world}}!'; +--- +> it('if with function argument', () => { +> const string = '{{#if goodbye}}GOODBYE {{/if}}cruel {{world}}!'; +77c75 +< goodbye: function() { +--- +> goodbye() { +80c78 +< world: 'world' +--- +> world: 'world', +82,84d79 +< .withMessage( +< 'if with function shows the contents when function returns true' +< ) +89c84 +< goodbye: function() { +--- +> goodbye() { +92c87 +< world: 'world' +--- +> world: 'world', +94,96d88 +< .withMessage( +< 'if with function shows the contents when function returns string' +< ) +101c93 +< goodbye: function() { +--- +> goodbye() { +104c96 +< world: 'world' +--- +> world: 'world', +106,108d97 +< .withMessage( +< 'if with function does not show the contents when returns false' +< ) +113c102 +< goodbye: function() { +--- +> goodbye() { +116c105 +< world: 'world' +--- +> world: 'world', +118,120d106 +< .withMessage( +< 'if with function does not show the contents when returns undefined' +< ) +124,127c110,111 +< it('should not change the depth list', function() { +< expectTemplate( +< '{{#with foo}}{{#if goodbye}}GOODBYE cruel {{../world}}!{{/if}}{{/with}}' +< ) +--- +> it('should not change the depth list', () => { +> expectTemplate('{{#with foo}}{{#if goodbye}}GOODBYE cruel {{../world}}!{{/if}}{{/with}}') +130c114 +< world: 'world' +--- +> world: 'world', +136,137c120,121 +< describe('#with', function() { +< it('with', function() { +--- +> describe('#with', () => { +> it('with', () => { +142,143c126,127 +< last: 'Johnson' +< } +--- +> last: 'Johnson', +> }, +148c132 +< it('with with function argument', function() { +--- +> it('with with function argument', () => { +151c135 +< person: function() { +--- +> person() { +154c138 +< last: 'Johnson' +--- +> last: 'Johnson', +156c140 +< } +--- +> }, +161c145 +< it('with with else', function() { +--- +> it('with with else', () => { +167c151 +< it('with provides block parameter', function() { +--- +> it('with provides block parameter', () => { +172,173c156,157 +< last: 'Johnson' +< } +--- +> last: 'Johnson', +> }, +178c162 +< it('works when data is disabled', function() { +--- +> it('works when data is disabled', () => { +186,194c170,172 +< describe('#each', function() { +< beforeEach(function() { +< handlebarsEnv.registerHelper('detectDataInsideEach', function(options) { +< return options.data && options.data.exclaim; +< }); +< }); +< +< it('each', function() { +< var string = '{{#each goodbyes}}{{text}}! {{/each}}cruel {{world}}!'; +--- +> describe('#each', () => { +> it('each', () => { +> const string = '{{#each goodbyes}}{{text}}! {{/each}}cruel {{world}}!'; +198,203c176,177 +< goodbyes: [ +< { text: 'goodbye' }, +< { text: 'Goodbye' }, +< { text: 'GOODBYE' } +< ], +< world: 'world' +--- +> goodbyes: [{ text: 'goodbye' }, { text: 'Goodbye' }, { text: 'GOODBYE' }], +> world: 'world', +205,207d178 +< .withMessage( +< 'each with array argument iterates over the contents when not empty' +< ) +213c184 +< world: 'world' +--- +> world: 'world', +215d185 +< .withMessage('each with array argument ignores the contents when empty') +219c189 +< it('each without data', function() { +--- +> it('each without data', () => { +222,227c192,193 +< goodbyes: [ +< { text: 'goodbye' }, +< { text: 'Goodbye' }, +< { text: 'GOODBYE' } +< ], +< world: 'world' +--- +> goodbyes: [{ text: 'goodbye' }, { text: 'Goodbye' }, { text: 'GOODBYE' }], +> world: 'world', +240c206 +< it('each without context', function() { +--- +> it('each without context', () => { +246,248c212,213 +< it('each with an object and @key', function() { +< var string = +< '{{#each goodbyes}}{{@key}}. {{text}}! {{/each}}cruel {{world}}!'; +--- +> it('each with an object and @key', () => { +> const string = '{{#each goodbyes}}{{@key}}. {{text}}! {{/each}}cruel {{world}}!'; +250c215 +< function Clazz() { +--- +> function Clazz(this: any) { +255c220 +< var hash = { goodbyes: new Clazz(), world: 'world' }; +--- +> const hash = { goodbyes: new (Clazz as any)(), world: 'world' }; +260,270c225,233 +< var actual = compileWithPartials(string, hash); +< var expected1 = +< '<b>#1</b>. goodbye! 2. GOODBYE! cruel world!'; +< var expected2 = +< '2. GOODBYE! <b>#1</b>. goodbye! cruel world!'; +< +< equals( +< actual === expected1 || actual === expected2, +< true, +< 'each with object argument iterates over the contents when not empty' +< ); +--- +> try { +> expectTemplate(string) +> .withInput(hash) +> .toCompileTo('<b>#1</b>. goodbye! 2. GOODBYE! cruel world!'); +> } catch (e) { +> expectTemplate(string) +> .withInput(hash) +> .toCompileTo('2. GOODBYE! <b>#1</b>. goodbye! cruel world!'); +> } +275c238 +< world: 'world' +--- +> world: 'world', +280,283c243,244 +< it('each with @index', function() { +< expectTemplate( +< '{{#each goodbyes}}{{@index}}. {{text}}! {{/each}}cruel {{world}}!' +< ) +--- +> it('each with @index', () => { +> expectTemplate('{{#each goodbyes}}{{@index}}. {{text}}! {{/each}}cruel {{world}}!') +285,290c246,247 +< goodbyes: [ +< { text: 'goodbye' }, +< { text: 'Goodbye' }, +< { text: 'GOODBYE' } +< ], +< world: 'world' +--- +> goodbyes: [{ text: 'goodbye' }, { text: 'Goodbye' }, { text: 'GOODBYE' }], +> world: 'world', +292d248 +< .withMessage('The @index variable is used') +296c252 +< it('each with nested @index', function() { +--- +> it('each with nested @index', () => { +301,306c257,258 +< goodbyes: [ +< { text: 'goodbye' }, +< { text: 'Goodbye' }, +< { text: 'GOODBYE' } +< ], +< world: 'world' +--- +> goodbyes: [{ text: 'goodbye' }, { text: 'Goodbye' }, { text: 'GOODBYE' }], +> world: 'world', +308d259 +< .withMessage('The @index variable is used') +314c265 +< it('each with block params', function() { +--- +> it('each with block params', () => { +320c271 +< world: 'world' +--- +> world: 'world', +322,324c273 +< .toCompileTo( +< '0. goodbye! 0 0 0 1 After 0 1. Goodbye! 1 0 1 1 After 1 cruel world!' +< ); +--- +> .toCompileTo('0. goodbye! 0 0 0 1 After 0 1. Goodbye! 1 0 1 1 After 1 cruel world!'); +327,330c276,277 +< it('each object with @index', function() { +< expectTemplate( +< '{{#each goodbyes}}{{@index}}. {{text}}! {{/each}}cruel {{world}}!' +< ) +--- +> it('each object with @index', () => { +> expectTemplate('{{#each goodbyes}}{{@index}}. {{text}}! {{/each}}cruel {{world}}!') +335c282 +< c: { text: 'GOODBYE' } +--- +> c: { text: 'GOODBYE' }, +337c284 +< world: 'world' +--- +> world: 'world', +339d285 +< .withMessage('The @index variable is used') +343,346c289,290 +< it('each with @first', function() { +< expectTemplate( +< '{{#each goodbyes}}{{#if @first}}{{text}}! {{/if}}{{/each}}cruel {{world}}!' +< ) +--- +> it('each with @first', () => { +> expectTemplate('{{#each goodbyes}}{{#if @first}}{{text}}! {{/if}}{{/each}}cruel {{world}}!') +348,353c292,293 +< goodbyes: [ +< { text: 'goodbye' }, +< { text: 'Goodbye' }, +< { text: 'GOODBYE' } +< ], +< world: 'world' +--- +> goodbyes: [{ text: 'goodbye' }, { text: 'Goodbye' }, { text: 'GOODBYE' }], +> world: 'world', +355d294 +< .withMessage('The @first variable is used') +359c298 +< it('each with nested @first', function() { +--- +> it('each with nested @first', () => { +364,369c303,304 +< goodbyes: [ +< { text: 'goodbye' }, +< { text: 'Goodbye' }, +< { text: 'GOODBYE' } +< ], +< world: 'world' +--- +> goodbyes: [{ text: 'goodbye' }, { text: 'Goodbye' }, { text: 'GOODBYE' }], +> world: 'world', +371,374c306 +< .withMessage('The @first variable is used') +< .toCompileTo( +< '(goodbye! goodbye! goodbye!) (goodbye!) (goodbye!) cruel world!' +< ); +--- +> .toCompileTo('(goodbye! goodbye! goodbye!) (goodbye!) (goodbye!) cruel world!'); +377,380c309,310 +< it('each object with @first', function() { +< expectTemplate( +< '{{#each goodbyes}}{{#if @first}}{{text}}! {{/if}}{{/each}}cruel {{world}}!' +< ) +--- +> it('each object with @first', () => { +> expectTemplate('{{#each goodbyes}}{{#if @first}}{{text}}! {{/if}}{{/each}}cruel {{world}}!') +383c313 +< world: 'world' +--- +> world: 'world', +385d314 +< .withMessage('The @first variable is used') +389,392c318,319 +< it('each with @last', function() { +< expectTemplate( +< '{{#each goodbyes}}{{#if @last}}{{text}}! {{/if}}{{/each}}cruel {{world}}!' +< ) +--- +> it('each with @last', () => { +> expectTemplate('{{#each goodbyes}}{{#if @last}}{{text}}! {{/if}}{{/each}}cruel {{world}}!') +394,399c321,322 +< goodbyes: [ +< { text: 'goodbye' }, +< { text: 'Goodbye' }, +< { text: 'GOODBYE' } +< ], +< world: 'world' +--- +> goodbyes: [{ text: 'goodbye' }, { text: 'Goodbye' }, { text: 'GOODBYE' }], +> world: 'world', +401d323 +< .withMessage('The @last variable is used') +405,408c327,328 +< it('each object with @last', function() { +< expectTemplate( +< '{{#each goodbyes}}{{#if @last}}{{text}}! {{/if}}{{/each}}cruel {{world}}!' +< ) +--- +> it('each object with @last', () => { +> expectTemplate('{{#each goodbyes}}{{#if @last}}{{text}}! {{/if}}{{/each}}cruel {{world}}!') +411c331 +< world: 'world' +--- +> world: 'world', +413d332 +< .withMessage('The @last variable is used') +417c336 +< it('each with nested @last', function() { +--- +> it('each with nested @last', () => { +422,427c341,342 +< goodbyes: [ +< { text: 'goodbye' }, +< { text: 'Goodbye' }, +< { text: 'GOODBYE' } +< ], +< world: 'world' +--- +> goodbyes: [{ text: 'goodbye' }, { text: 'Goodbye' }, { text: 'GOODBYE' }], +> world: 'world', +429,432c344 +< .withMessage('The @last variable is used') +< .toCompileTo( +< '(GOODBYE!) (GOODBYE!) (GOODBYE! GOODBYE! GOODBYE!) cruel world!' +< ); +--- +> .toCompileTo('(GOODBYE!) (GOODBYE!) (GOODBYE! GOODBYE! GOODBYE!) cruel world!'); +435,436c347,348 +< it('each with function argument', function() { +< var string = '{{#each goodbyes}}{{text}}! {{/each}}cruel {{world}}!'; +--- +> it('each with function argument', () => { +> const string = '{{#each goodbyes}}{{text}}! {{/each}}cruel {{world}}!'; +440,445c352,353 +< goodbyes: function() { +< return [ +< { text: 'goodbye' }, +< { text: 'Goodbye' }, +< { text: 'GOODBYE' } +< ]; +--- +> goodbyes() { +> return [{ text: 'goodbye' }, { text: 'Goodbye' }, { text: 'GOODBYE' }]; +447c355 +< world: 'world' +--- +> world: 'world', +449,451d356 +< .withMessage( +< 'each with array function argument iterates over the contents when not empty' +< ) +457c362 +< world: 'world' +--- +> world: 'world', +459,461d363 +< .withMessage( +< 'each with array function argument ignores the contents when empty' +< ) +465,468c367,368 +< it('each object when last key is an empty string', function() { +< expectTemplate( +< '{{#each goodbyes}}{{@index}}. {{text}}! {{/each}}cruel {{world}}!' +< ) +--- +> it('each object when last key is an empty string', () => { +> expectTemplate('{{#each goodbyes}}{{@index}}. {{text}}! {{/each}}cruel {{world}}!') +473c373 +< '': { text: 'GOODBYE' } +--- +> '': { text: 'GOODBYE' }, +475c375 +< world: 'world' +--- +> world: 'world', +477d376 +< .withMessage('Empty string key is not skipped') +481,484c380,381 +< it('data passed to helpers', function() { +< expectTemplate( +< '{{#each letters}}{{this}}{{detectDataInsideEach}}{{/each}}' +< ) +--- +> it('data passed to helpers', () => { +> expectTemplate('{{#each letters}}{{this}}{{detectDataInsideEach}}{{/each}}') +486c383,385 +< .withMessage('should output data') +--- +> .withHelper('detectDataInsideEach', function (options) { +> return options.data && options.data.exclaim; +> }) +489,490c388,389 +< exclaim: '!' +< } +--- +> exclaim: '!', +> }, +495,499c394,395 +< it('each on implicit context', function() { +< expectTemplate('{{#each}}{{text}}! {{/each}}cruel world!').toThrow( +< handlebarsEnv.Exception, +< 'Must pass iterator to #each' +< ); +--- +> it('each on implicit context', () => { +> expectTemplate('{{#each}}{{text}}! {{/each}}cruel world!').toThrow(Handlebars.Exception); +502,504c398,403 +< if (global.Symbol && global.Symbol.iterator) { +< it('each on iterable', function() { +< function Iterator(arr) { +--- +> it('each on iterable', () => { +> class Iterator { +> private arr: any[]; +> private index: number = 0; +> +> constructor(arr: any[]) { +506d404 +< this.index = 0; +508,510c406,409 +< Iterator.prototype.next = function() { +< var value = this.arr[this.index]; +< var done = this.index === this.arr.length; +--- +> +> next() { +> const value = this.arr[this.index]; +> const done = this.index === this.arr.length; +514,516c413,420 +< return { value: value, done: done }; +< }; +< function Iterable(arr) { +--- +> return { value, done }; +> } +> } +> +> class Iterable { +> private arr: any[]; +> +> constructor(arr: any[]) { +519c423,424 +< Iterable.prototype[global.Symbol.iterator] = function() { +--- +> +> [Symbol.iterator]() { +521,522c426,427 +< }; +< var string = '{{#each goodbyes}}{{text}}! {{/each}}cruel {{world}}!'; +--- +> } +> } +524,536c429 +< expectTemplate(string) +< .withInput({ +< goodbyes: new Iterable([ +< { text: 'goodbye' }, +< { text: 'Goodbye' }, +< { text: 'GOODBYE' } +< ]), +< world: 'world' +< }) +< .withMessage( +< 'each with array argument iterates over the contents when not empty' +< ) +< .toCompileTo('goodbye! Goodbye! GOODBYE! cruel world!'); +--- +> const string = '{{#each goodbyes}}{{text}}! {{/each}}cruel {{world}}!'; +538,548c431,444 +< expectTemplate(string) +< .withInput({ +< goodbyes: new Iterable([]), +< world: 'world' +< }) +< .withMessage( +< 'each with array argument ignores the contents when empty' +< ) +< .toCompileTo('cruel world!'); +< }); +< } +--- +> expectTemplate(string) +> .withInput({ +> goodbyes: new Iterable([{ text: 'goodbye' }, { text: 'Goodbye' }, { text: 'GOODBYE' }]), +> world: 'world', +> }) +> .toCompileTo('goodbye! Goodbye! GOODBYE! cruel world!'); +> +> expectTemplate(string) +> .withInput({ +> goodbyes: new Iterable([]), +> world: 'world', +> }) +> .toCompileTo('cruel world!'); +> }); +551c447 +< describe('#log', function() { +--- +> describe('#log', function () { +553,555c449,451 +< if (typeof console === 'undefined') { +< return; +< } +--- +> let $log: typeof console.log; +> let $info: typeof console.info; +> let $error: typeof console.error; +557,558c453 +< var $log, $info, $error; +< beforeEach(function() { +--- +> beforeEach(function () { +561a457,458 +> +> global.kbnHandlebarsEnv = Handlebars.create(); +563c460,461 +< afterEach(function() { +--- +> +> afterEach(function () { +569,571c467,470 +< it('should call logger at default level', function() { +< var levelArg, logArg; +< handlebarsEnv.log = function(level, arg) { +--- +> it('should call logger at default level', function () { +> let levelArg; +> let logArg; +> kbnHandlebarsEnv!.log = function (level, arg) { +576,581c475,477 +< expectTemplate('{{log blah}}') +< .withInput({ blah: 'whee' }) +< .withMessage('log should not display') +< .toCompileTo(''); +< equals(1, levelArg, 'should call log with 1'); +< equals('whee', logArg, "should call log with 'whee'"); +--- +> expectTemplate('{{log blah}}').withInput({ blah: 'whee' }).toCompileTo(''); +> expect(1).toEqual(levelArg); +> expect('whee').toEqual(logArg); +584,586c480,483 +< it('should call logger at data level', function() { +< var levelArg, logArg; +< handlebarsEnv.log = function(level, arg) { +--- +> it('should call logger at data level', function () { +> let levelArg; +> let logArg; +> kbnHandlebarsEnv!.log = function (level, arg) { +596,597c493,494 +< equals('03', levelArg); +< equals('whee', logArg); +--- +> expect('03').toEqual(levelArg); +> expect('whee').toEqual(logArg); +600,601c497,498 +< it('should output to info', function() { +< var called; +--- +> it('should output to info', function () { +> let called; +603,604c500,501 +< console.info = function(info) { +< equals('whee', info); +--- +> console.info = function (info) { +> expect('whee').toEqual(info); +609,610c506,507 +< console.log = function(log) { +< equals('whee', log); +--- +> console.log = function (log) { +> expect('whee').toEqual(log); +616,619c513,514 +< expectTemplate('{{log blah}}') +< .withInput({ blah: 'whee' }) +< .toCompileTo(''); +< equals(true, called); +--- +> expectTemplate('{{log blah}}').withInput({ blah: 'whee' }).toCompileTo(''); +> expect(true).toEqual(called); +622,623c517,518 +< it('should log at data level', function() { +< var called; +--- +> it('should log at data level', function () { +> let called; +625,626c520,521 +< console.error = function(log) { +< equals('whee', log); +--- +> console.error = function (log) { +> expect('whee').toEqual(log); +636c531 +< equals(true, called); +--- +> expect(true).toEqual(called); +639,640c534,535 +< it('should handle missing logger', function() { +< var called = false; +--- +> it('should handle missing logger', function () { +> let called = false; +641a537 +> // @ts-expect-error +643,644c539,540 +< console.log = function(log) { +< equals('whee', log); +--- +> console.log = function (log) { +> expect('whee').toEqual(log); +654c550 +< equals(true, called); +--- +> expect(true).toEqual(called); +657,658c553,554 +< it('should handle string log levels', function() { +< var called; +--- +> it('should handle string log levels', function () { +> let called; +660,661c556,557 +< console.error = function(log) { +< equals('whee', log); +--- +> console.error = function (log) { +> expect('whee').toEqual(log); +670c566 +< equals(true, called); +--- +> expect(true).toEqual(called); +679c575 +< equals(true, called); +--- +> expect(true).toEqual(called); +682,683c578,579 +< it('should handle hash log levels', function() { +< var called; +--- +> it('should handle hash log levels [1]', function () { +> let called; +685,686c581,582 +< console.error = function(log) { +< equals('whee', log); +--- +> console.error = function (log) { +> expect('whee').toEqual(log); +690,693c586,587 +< expectTemplate('{{log blah level="error"}}') +< .withInput({ blah: 'whee' }) +< .toCompileTo(''); +< equals(true, called); +--- +> expectTemplate('{{log blah level="error"}}').withInput({ blah: 'whee' }).toCompileTo(''); +> expect(true).toEqual(called); +696,697c590,591 +< it('should handle hash log levels', function() { +< var called = false; +--- +> it('should handle hash log levels [2]', function () { +> let called = false; +699,702c593,600 +< console.info = console.log = console.error = console.debug = function() { +< called = true; +< console.info = console.log = console.error = console.debug = $log; +< }; +--- +> console.info = +> console.log = +> console.error = +> console.debug = +> function () { +> called = true; +> console.info = console.log = console.error = console.debug = $log; +> }; +704,707c602,603 +< expectTemplate('{{log blah level="debug"}}') +< .withInput({ blah: 'whee' }) +< .toCompileTo(''); +< equals(false, called); +--- +> expectTemplate('{{log blah level="debug"}}').withInput({ blah: 'whee' }).toCompileTo(''); +> expect(false).toEqual(called); +710,711c606,607 +< it('should pass multiple log arguments', function() { +< var called; +--- +> it('should pass multiple log arguments', function () { +> let called; +713,716c609,612 +< console.info = console.log = function(log1, log2, log3) { +< equals('whee', log1); +< equals('foo', log2); +< equals(1, log3); +--- +> console.info = console.log = function (log1, log2, log3) { +> expect('whee').toEqual(log1); +> expect('foo').toEqual(log2); +> expect(1).toEqual(log3); +721,724c617,618 +< expectTemplate('{{log blah "foo" 1}}') +< .withInput({ blah: 'whee' }) +< .toCompileTo(''); +< equals(true, called); +--- +> expectTemplate('{{log blah "foo" 1}}').withInput({ blah: 'whee' }).toCompileTo(''); +> expect(true).toEqual(called); +727,728c621,622 +< it('should pass zero log arguments', function() { +< var called; +--- +> it('should pass zero log arguments', function () { +> let called; +730,731c624,625 +< console.info = console.log = function() { +< expect(arguments.length).to.equal(0); +--- +> console.info = console.log = function () { +> expect(arguments.length).toEqual(0); +736,739c630,631 +< expectTemplate('{{log}}') +< .withInput({ blah: 'whee' }) +< .toCompileTo(''); +< expect(called).to.be.true(); +--- +> expectTemplate('{{log}}').withInput({ blah: 'whee' }).toCompileTo(''); +> expect(called).toEqual(true); +744,745c636,637 +< describe('#lookup', function() { +< it('should lookup arbitrary content', function() { +--- +> describe('#lookup', () => { +> it('should lookup arbitrary content', () => { +751c643 +< it('should not fail on undefined value', function() { +--- +> it('should not fail on undefined value', () => { diff --git a/packages/kbn-handlebars/.patches/compiler.patch b/packages/kbn-handlebars/.patches/compiler.patch new file mode 100644 index 0000000000000..0028d85e395e8 --- /dev/null +++ b/packages/kbn-handlebars/.patches/compiler.patch @@ -0,0 +1,272 @@ +1,92c1,24 +< describe('compiler', function() { +< if (!Handlebars.compile) { +< return; +< } +< +< describe('#equals', function() { +< function compile(string) { +< var ast = Handlebars.parse(string); +< return new Handlebars.Compiler().compile(ast, {}); +< } +< +< it('should treat as equal', function() { +< equal(compile('foo').equals(compile('foo')), true); +< equal(compile('{{foo}}').equals(compile('{{foo}}')), true); +< equal(compile('{{foo.bar}}').equals(compile('{{foo.bar}}')), true); +< equal( +< compile('{{foo.bar baz "foo" true false bat=1}}').equals( +< compile('{{foo.bar baz "foo" true false bat=1}}') +< ), +< true +< ); +< equal( +< compile('{{foo.bar (baz bat=1)}}').equals( +< compile('{{foo.bar (baz bat=1)}}') +< ), +< true +< ); +< equal( +< compile('{{#foo}} {{/foo}}').equals(compile('{{#foo}} {{/foo}}')), +< true +< ); +< }); +< it('should treat as not equal', function() { +< equal(compile('foo').equals(compile('bar')), false); +< equal(compile('{{foo}}').equals(compile('{{bar}}')), false); +< equal(compile('{{foo.bar}}').equals(compile('{{bar.bar}}')), false); +< equal( +< compile('{{foo.bar baz bat=1}}').equals( +< compile('{{foo.bar bar bat=1}}') +< ), +< false +< ); +< equal( +< compile('{{foo.bar (baz bat=1)}}').equals( +< compile('{{foo.bar (bar bat=1)}}') +< ), +< false +< ); +< equal( +< compile('{{#foo}} {{/foo}}').equals(compile('{{#bar}} {{/bar}}')), +< false +< ); +< equal( +< compile('{{#foo}} {{/foo}}').equals( +< compile('{{#foo}} {{foo}}{{/foo}}') +< ), +< false +< ); +< }); +< }); +< +< describe('#compile', function() { +< it('should fail with invalid input', function() { +< shouldThrow( +< function() { +< Handlebars.compile(null); +< }, +< Error, +< 'You must pass a string or Handlebars AST to Handlebars.compile. You passed null' +< ); +< shouldThrow( +< function() { +< Handlebars.compile({}); +< }, +< Error, +< 'You must pass a string or Handlebars AST to Handlebars.compile. You passed [object Object]' +< ); +< }); +< +< it('should include the location in the error (row and column)', function() { +< try { +< Handlebars.compile(' \n {{#if}}\n{{/def}}')(); +< equal( +< true, +< false, +< 'Statement must throw exception. This line should not be executed.' +< ); +< } catch (err) { +< equal( +< err.message, +< "if doesn't match def - 2:5", +< 'Checking error message' +--- +> /* +> * This file is forked from the handlebars project (https://github.com/handlebars-lang/handlebars.js), +> * and may include modifications made by Elasticsearch B.V. +> * Elasticsearch B.V. licenses this file to you under the MIT License. +> * See `packages/kbn-handlebars/LICENSE` for more information. +> */ +> +> import Handlebars from '..'; +> +> describe('compiler', () => { +> const compileFns = ['compile', 'compileAST']; +> if (process.env.AST) compileFns.splice(0, 1); +> else if (process.env.EVAL) compileFns.splice(1, 1); +> +> compileFns.forEach((compileName) => { +> // @ts-expect-error +> const compile = Handlebars[compileName]; +> +> describe(`#${compileName}`, () => { +> it('should fail with invalid input', () => { +> expect(function () { +> compile(null); +> }).toThrow( +> `You must pass a string or Handlebars AST to Handlebars.${compileName}. You passed null` +94,102d25 +< if (Object.getOwnPropertyDescriptor(err, 'column').writable) { +< // In Safari 8, the column-property is read-only. This means that even if it is set with defineProperty, +< // its value won't change (https://github.com/jquery/esprima/issues/1290#issuecomment-132455482) +< // Since this was neither working in Handlebars 3 nor in 4.0.5, we only check the column for other browsers. +< equal(err.column, 5, 'Checking error column'); +< } +< equal(err.lineNumber, 2, 'Checking error row'); +< } +< }); +104,116c27,30 +< it('should include the location as enumerable property', function() { +< try { +< Handlebars.compile(' \n {{#if}}\n{{/def}}')(); +< equal( +< true, +< false, +< 'Statement must throw exception. This line should not be executed.' +< ); +< } catch (err) { +< equal( +< Object.prototype.propertyIsEnumerable.call(err, 'column'), +< true, +< 'Checking error column' +--- +> expect(function () { +> compile({}); +> }).toThrow( +> `You must pass a string or Handlebars AST to Handlebars.${compileName}. You passed [object Object]` +118,129c32 +< } +< }); +< +< it('can utilize AST instance', function() { +< equal( +< Handlebars.compile({ +< type: 'Program', +< body: [{ type: 'ContentStatement', value: 'Hello' }] +< })(), +< 'Hello' +< ); +< }); +--- +> }); +131,152c34,48 +< it('can pass through an empty string', function() { +< equal(Handlebars.compile('')(), ''); +< }); +< +< it('should not modify the options.data property(GH-1327)', function() { +< var options = { data: [{ a: 'foo' }, { a: 'bar' }] }; +< Handlebars.compile('{{#each data}}{{@index}}:{{a}} {{/each}}', options)(); +< equal( +< JSON.stringify(options, 0, 2), +< JSON.stringify({ data: [{ a: 'foo' }, { a: 'bar' }] }, 0, 2) +< ); +< }); +< +< it('should not modify the options.knownHelpers property(GH-1327)', function() { +< var options = { knownHelpers: {} }; +< Handlebars.compile('{{#each data}}{{@index}}:{{a}} {{/each}}', options)(); +< equal( +< JSON.stringify(options, 0, 2), +< JSON.stringify({ knownHelpers: {} }, 0, 2) +< ); +< }); +< }); +--- +> it('should include the location in the error (row and column)', () => { +> try { +> compile(' \n {{#if}}\n{{/def}}')({}); +> expect(true).toEqual(false); +> } catch (err) { +> expect(err.message).toEqual("if doesn't match def - 2:5"); +> if (Object.getOwnPropertyDescriptor(err, 'column')!.writable) { +> // In Safari 8, the column-property is read-only. This means that even if it is set with defineProperty, +> // its value won't change (https://github.com/jquery/esprima/issues/1290#issuecomment-132455482) +> // Since this was neither working in Handlebars 3 nor in 4.0.5, we only check the column for other browsers. +> expect(err.column).toEqual(5); +> } +> expect(err.lineNumber).toEqual(2); +> } +> }); +154,170c50,57 +< describe('#precompile', function() { +< it('should fail with invalid input', function() { +< shouldThrow( +< function() { +< Handlebars.precompile(null); +< }, +< Error, +< 'You must pass a string or Handlebars AST to Handlebars.precompile. You passed null' +< ); +< shouldThrow( +< function() { +< Handlebars.precompile({}); +< }, +< Error, +< 'You must pass a string or Handlebars AST to Handlebars.precompile. You passed [object Object]' +< ); +< }); +--- +> it('should include the location as enumerable property', () => { +> try { +> compile(' \n {{#if}}\n{{/def}}')({}); +> expect(true).toEqual(false); +> } catch (err) { +> expect(Object.prototype.propertyIsEnumerable.call(err, 'column')).toEqual(true); +> } +> }); +172,175c59,61 +< it('can utilize AST instance', function() { +< equal( +< /return "Hello"/.test( +< Handlebars.precompile({ +--- +> it('can utilize AST instance', () => { +> expect( +> compile({ +177,182c63,78 +< body: [{ type: 'ContentStatement', value: 'Hello' }] +< }) +< ), +< true +< ); +< }); +--- +> body: [{ type: 'ContentStatement', value: 'Hello' }], +> })({}) +> ).toEqual('Hello'); +> }); +> +> it('can pass through an empty string', () => { +> expect(compile('')({})).toEqual(''); +> }); +> +> it('should not modify the options.data property(GH-1327)', () => { +> const options = { data: [{ a: 'foo' }, { a: 'bar' }] }; +> compile('{{#each data}}{{@index}}:{{a}} {{/each}}', options)({}); +> expect(JSON.stringify(options, null, 2)).toEqual( +> JSON.stringify({ data: [{ a: 'foo' }, { a: 'bar' }] }, null, 2) +> ); +> }); +184,185c80,86 +< it('can pass through an empty string', function() { +< equal(/return ""/.test(Handlebars.precompile('')), true); +--- +> it('should not modify the options.knownHelpers property(GH-1327)', () => { +> const options = { knownHelpers: {} }; +> compile('{{#each data}}{{@index}}:{{a}} {{/each}}', options)({}); +> expect(JSON.stringify(options, null, 2)).toEqual( +> JSON.stringify({ knownHelpers: {} }, null, 2) +> ); +> }); diff --git a/packages/kbn-handlebars/.patches/data.patch b/packages/kbn-handlebars/.patches/data.patch new file mode 100644 index 0000000000000..2da3fdb2e2591 --- /dev/null +++ b/packages/kbn-handlebars/.patches/data.patch @@ -0,0 +1,273 @@ +1,2c1,12 +< describe('data', function() { +< it('passing in data to a compiled function that expects data - works with helpers', function() { +--- +> /* +> * This file is forked from the handlebars project (https://github.com/handlebars-lang/handlebars.js), +> * and may include modifications made by Elasticsearch B.V. +> * Elasticsearch B.V. licenses this file to you under the MIT License. +> * See `packages/kbn-handlebars/LICENSE` for more information. +> */ +> +> import Handlebars from '..'; +> import { expectTemplate } from '../__jest__/test_bench'; +> +> describe('data', () => { +> it('passing in data to a compiled function that expects data - works with helpers', () => { +5c15 +< .withHelper('hello', function(options) { +--- +> .withHelper('hello', function (this: any, options) { +10d19 +< .withMessage('Data output by helper') +14c23 +< it('data can be looked up via @foo', function() { +--- +> it('data can be looked up via @foo', () => { +17d25 +< .withMessage('@foo retrieves template data') +21,22c29,31 +< it('deep @foo triggers automatic top-level data', function() { +< var helpers = Handlebars.createFrame(handlebarsEnv.helpers); +--- +> it('deep @foo triggers automatic top-level data', () => { +> global.kbnHandlebarsEnv = Handlebars.create(); +> const helpers = Handlebars.createFrame(kbnHandlebarsEnv!.helpers); +24,25c33,34 +< helpers.let = function(options) { +< var frame = Handlebars.createFrame(options.data); +--- +> helpers.let = function (options: Handlebars.HelperOptions) { +> const frame = Handlebars.createFrame(options.data); +27c36 +< for (var prop in options.hash) { +--- +> for (const prop in options.hash) { +40d48 +< .withMessage('Automatic data was triggered') +44c52 +< it('parameter data can be looked up via @foo', function() { +--- +> it('parameter data can be looked up via @foo', () => { +47c55 +< .withHelper('hello', function(noun) { +--- +> .withHelper('hello', function (noun) { +50d57 +< .withMessage('@foo as a parameter retrieves template data') +54c61 +< it('hash values can be looked up via @foo', function() { +--- +> it('hash values can be looked up via @foo', () => { +57c64 +< .withHelper('hello', function(options) { +--- +> .withHelper('hello', function (options) { +60d66 +< .withMessage('@foo as a parameter retrieves template data') +64c70 +< it('nested parameter data can be looked up via @foo.bar', function() { +--- +> it('nested parameter data can be looked up via @foo.bar', () => { +67c73 +< .withHelper('hello', function(noun) { +--- +> .withHelper('hello', function (noun) { +70d75 +< .withMessage('@foo as a parameter retrieves template data') +74c79 +< it('nested parameter data does not fail with @world.bar', function() { +--- +> it('nested parameter data does not fail with @world.bar', () => { +77c82 +< .withHelper('hello', function(noun) { +--- +> .withHelper('hello', function (noun) { +80d84 +< .withMessage('@foo as a parameter retrieves template data') +84,87c88,89 +< it('parameter data throws when using complex scope references', function() { +< expectTemplate( +< '{{#goodbyes}}{{text}} cruel {{@foo/../name}}! {{/goodbyes}}' +< ).toThrow(Error); +--- +> it('parameter data throws when using complex scope references', () => { +> expectTemplate('{{#goodbyes}}{{text}} cruel {{@foo/../name}}! {{/goodbyes}}').toThrow(Error); +90c92 +< it('data can be functions', function() { +--- +> it('data can be functions', () => { +94c96 +< hello: function() { +--- +> hello() { +96,97c98,99 +< } +< } +--- +> }, +> }, +102c104 +< it('data can be functions with params', function() { +--- +> it('data can be functions with params', () => { +106c108 +< hello: function(arg) { +--- +> hello(arg: any) { +108,109c110,111 +< } +< } +--- +> }, +> }, +114c116 +< it('data is inherited downstream', function() { +--- +> it('data is inherited downstream', () => { +120,122c122,124 +< .withHelper('let', function(options) { +< var frame = Handlebars.createFrame(options.data); +< for (var prop in options.hash) { +--- +> .withHelper('let', function (this: any, options) { +> const frame = Handlebars.createFrame(options.data); +> for (const prop in options.hash) { +130d131 +< .withMessage('data variables are inherited downstream') +134,147c135 +< it('passing in data to a compiled function that expects data - works with helpers in partials', function() { +< expectTemplate('{{>myPartial}}') +< .withCompileOptions({ data: true }) +< .withPartial('myPartial', '{{hello}}') +< .withHelper('hello', function(options) { +< return options.data.adjective + ' ' + this.noun; +< }) +< .withInput({ noun: 'cat' }) +< .withRuntimeOptions({ data: { adjective: 'happy' } }) +< .withMessage('Data output by helper inside partial') +< .toCompileTo('happy cat'); +< }); +< +< it('passing in data to a compiled function that expects data - works with helpers and parameters', function() { +--- +> it('passing in data to a compiled function that expects data - works with helpers and parameters', () => { +150c138 +< .withHelper('hello', function(noun, options) { +--- +> .withHelper('hello', function (this: any, noun, options) { +155d142 +< .withMessage('Data output by helper') +159c146 +< it('passing in data to a compiled function that expects data - works with block helpers', function() { +--- +> it('passing in data to a compiled function that expects data - works with block helpers', () => { +162c149 +< data: true +--- +> data: true, +164c151 +< .withHelper('hello', function(options) { +--- +> .withHelper('hello', function (this: any, options) { +167c154 +< .withHelper('world', function(options) { +--- +> .withHelper('world', function (this: any, options) { +172d158 +< .withMessage('Data output by helper') +176c162 +< it('passing in data to a compiled function that expects data - works with block helpers that use ..', function() { +--- +> it('passing in data to a compiled function that expects data - works with block helpers that use ..', () => { +179c165 +< .withHelper('hello', function(options) { +--- +> .withHelper('hello', function (options) { +182c168 +< .withHelper('world', function(thing, options) { +--- +> .withHelper('world', function (this: any, thing, options) { +187d172 +< .withMessage('Data output by helper') +191c176 +< it('passing in data to a compiled function that expects data - data is passed to with block helpers where children use ..', function() { +--- +> it('passing in data to a compiled function that expects data - data is passed to with block helpers where children use ..', () => { +194c179 +< .withHelper('hello', function(options) { +--- +> .withHelper('hello', function (options) { +197c182 +< .withHelper('world', function(thing, options) { +--- +> .withHelper('world', function (this: any, thing, options) { +202d186 +< .withMessage('Data output by helper') +206c190 +< it('you can override inherited data when invoking a helper', function() { +--- +> it('you can override inherited data when invoking a helper', () => { +209,213c193,194 +< .withHelper('hello', function(options) { +< return options.fn( +< { exclaim: '?', zomg: 'world' }, +< { data: { adjective: 'sad' } } +< ); +--- +> .withHelper('hello', function (options) { +> return options.fn({ exclaim: '?', zomg: 'world' }, { data: { adjective: 'sad' } }); +215c196 +< .withHelper('world', function(thing, options) { +--- +> .withHelper('world', function (this: any, thing, options) { +220d200 +< .withMessage('Overriden data output by helper') +224c204 +< it('you can override inherited data when invoking a helper with depth', function() { +--- +> it('you can override inherited data when invoking a helper with depth', () => { +227c207 +< .withHelper('hello', function(options) { +--- +> .withHelper('hello', function (options) { +230c210 +< .withHelper('world', function(thing, options) { +--- +> .withHelper('world', function (this: any, thing, options) { +235d214 +< .withMessage('Overriden data output by helper') +239,240c218,219 +< describe('@root', function() { +< it('the root context can be looked up via @root', function() { +--- +> describe('@root', () => { +> it('the root context can be looked up via @root', () => { +246,248c225 +< expectTemplate('{{@root.foo}}') +< .withInput({ foo: 'hello' }) +< .toCompileTo('hello'); +--- +> expectTemplate('{{@root.foo}}').withInput({ foo: 'hello' }).toCompileTo('hello'); +251c228 +< it('passed root values take priority', function() { +--- +> it('passed root values take priority', () => { +259,260c236,237 +< describe('nesting', function() { +< it('the root context can be looked up via @root', function() { +--- +> describe('nesting', () => { +> it('the root context can be looked up via @root', () => { +265,266c242,243 +< .withHelper('helper', function(options) { +< var frame = Handlebars.createFrame(options.data); +--- +> .withHelper('helper', function (this: any, options) { +> const frame = Handlebars.createFrame(options.data); +272,273c249,250 +< depth: 0 +< } +--- +> depth: 0, +> }, diff --git a/packages/kbn-handlebars/.patches/helpers.patch b/packages/kbn-handlebars/.patches/helpers.patch new file mode 100644 index 0000000000000..f744c9cde9f52 --- /dev/null +++ b/packages/kbn-handlebars/.patches/helpers.patch @@ -0,0 +1,1096 @@ +1,2c1,16 +< describe('helpers', function() { +< it('helper with complex lookup$', function() { +--- +> /* +> * This file is forked from the handlebars project (https://github.com/handlebars-lang/handlebars.js), +> * and may include modifications made by Elasticsearch B.V. +> * Elasticsearch B.V. licenses this file to you under the MIT License. +> * See `packages/kbn-handlebars/LICENSE` for more information. +> */ +> +> import Handlebars from '..'; +> import { expectTemplate } from '../__jest__/test_bench'; +> +> beforeEach(() => { +> global.kbnHandlebarsEnv = Handlebars.create(); +> }); +> +> describe('helpers', () => { +> it('helper with complex lookup$', () => { +6c20 +< goodbyes: [{ text: 'Goodbye', url: 'goodbye' }] +--- +> goodbyes: [{ text: 'Goodbye', url: 'goodbye' }], +8,11c22,23 +< .withHelper('link', function(prefix) { +< return ( +< '' + this.text + '' +< ); +--- +> .withHelper('link', function (this: any, prefix) { +> return '' + this.text + ''; +16c28 +< it('helper for raw block gets raw content', function() { +--- +> it('helper for raw block gets raw content', () => { +19c31 +< .withHelper('raw', function(options) { +--- +> .withHelper('raw', function (options) { +22d33 +< .withMessage('raw block helper gets raw content') +26c37 +< it('helper for raw block gets parameters', function() { +--- +> it('helper for raw block gets parameters', () => { +29,30c40,42 +< .withHelper('raw', function(a, b, c, options) { +< return options.fn() + a + b + c; +--- +> .withHelper('raw', function (a, b, c, options) { +> const ret = options.fn() + a + b + c; +> return ret; +32d43 +< .withMessage('raw block helper gets raw content') +36,37c47,48 +< describe('raw block parsing (with identity helper-function)', function() { +< function runWithIdentityHelper(template, expected) { +--- +> describe('raw block parsing (with identity helper-function)', () => { +> function runWithIdentityHelper(template: string, expected: string) { +39c50 +< .withHelper('identity', function(options) { +--- +> .withHelper('identity', function (options) { +45c56 +< it('helper for nested raw block gets raw content', function() { +--- +> it('helper for nested raw block gets raw content', () => { +52c63 +< it('helper for nested raw block works with empty content', function() { +--- +> it('helper for nested raw block works with empty content', () => { +56c67 +< xit('helper for nested raw block works if nested raw blocks are broken', function() { +--- +> it.skip('helper for nested raw block works if nested raw blocks are broken', () => { +67c78 +< it('helper for nested raw block closes after first matching close', function() { +--- +> it('helper for nested raw block closes after first matching close', () => { +74,75c85,86 +< it('helper for nested raw block throw exception when with missing closing braces', function() { +< var string = '{{{{a}}}} {{{{/a'; +--- +> it('helper for nested raw block throw exception when with missing closing braces', () => { +> const string = '{{{{a}}}} {{{{/a'; +80c91 +< it('helper block with identical context', function() { +--- +> it('helper block with identical context', () => { +83,86c94,97 +< .withHelper('goodbyes', function(options) { +< var out = ''; +< var byes = ['Goodbye', 'goodbye', 'GOODBYE']; +< for (var i = 0, j = byes.length; i < j; i++) { +--- +> .withHelper('goodbyes', function (this: any, options) { +> let out = ''; +> const byes = ['Goodbye', 'goodbye', 'GOODBYE']; +> for (let i = 0, j = byes.length; i < j; i++) { +94c105 +< it('helper block with complex lookup expression', function() { +--- +> it('helper block with complex lookup expression', () => { +97,100c108,111 +< .withHelper('goodbyes', function(options) { +< var out = ''; +< var byes = ['Goodbye', 'goodbye', 'GOODBYE']; +< for (var i = 0, j = byes.length; i < j; i++) { +--- +> .withHelper('goodbyes', function (options) { +> let out = ''; +> const byes = ['Goodbye', 'goodbye', 'GOODBYE']; +> for (let i = 0, j = byes.length; i < j; i++) { +108,111c119,120 +< it('helper with complex lookup and nested template', function() { +< expectTemplate( +< '{{#goodbyes}}{{#link ../prefix}}{{text}}{{/link}}{{/goodbyes}}' +< ) +--- +> it('helper with complex lookup and nested template', () => { +> expectTemplate('{{#goodbyes}}{{#link ../prefix}}{{text}}{{/link}}{{/goodbyes}}') +114c123 +< goodbyes: [{ text: 'Goodbye', url: 'goodbye' }] +--- +> goodbyes: [{ text: 'Goodbye', url: 'goodbye' }], +116,125c125,126 +< .withHelper('link', function(prefix, options) { +< return ( +< '' + +< options.fn(this) + +< '' +< ); +--- +> .withHelper('link', function (this: any, prefix, options) { +> return '' + options.fn(this) + ''; +130,133c131,132 +< it('helper with complex lookup and nested template in VM+Compiler', function() { +< expectTemplate( +< '{{#goodbyes}}{{#link ../prefix}}{{text}}{{/link}}{{/goodbyes}}' +< ) +--- +> it('helper with complex lookup and nested template in VM+Compiler', () => { +> expectTemplate('{{#goodbyes}}{{#link ../prefix}}{{text}}{{/link}}{{/goodbyes}}') +136c135 +< goodbyes: [{ text: 'Goodbye', url: 'goodbye' }] +--- +> goodbyes: [{ text: 'Goodbye', url: 'goodbye' }], +138,147c137,138 +< .withHelper('link', function(prefix, options) { +< return ( +< '' + +< options.fn(this) + +< '' +< ); +--- +> .withHelper('link', function (this: any, prefix, options) { +> return '' + options.fn(this) + ''; +152c143 +< it('helper returning undefined value', function() { +--- +> it('helper returning undefined value', () => { +155c146 +< nothere: function() {} +--- +> nothere() {}, +161c152 +< nothere: function() {} +--- +> nothere() {}, +166c157 +< it('block helper', function() { +--- +> it('block helper', () => { +169c160 +< .withHelper('goodbyes', function(options) { +--- +> .withHelper('goodbyes', function (options) { +172d162 +< .withMessage('Block helper executed') +176c166 +< it('block helper staying in the same context', function() { +--- +> it('block helper staying in the same context', () => { +179c169 +< .withHelper('form', function(options) { +--- +> .withHelper('form', function (this: any, options) { +182d171 +< .withMessage('Block helper executed with current context') +186,187c175,176 +< it('block helper should have context in this', function() { +< function link(options) { +--- +> it('block helper should have context in this', () => { +> function link(this: any, options: Handlebars.HelperOptions) { +191,193c180 +< expectTemplate( +< '
    {{#people}}
  • {{#link}}{{name}}{{/link}}
  • {{/people}}
' +< ) +--- +> expectTemplate('
    {{#people}}
  • {{#link}}{{name}}{{/link}}
  • {{/people}}
') +197,198c184,185 +< { name: 'Yehuda', id: 2 } +< ] +--- +> { name: 'Yehuda', id: 2 }, +> ], +206c193 +< it('block helper for undefined value', function() { +--- +> it('block helper for undefined value', () => { +210c197 +< it('block helper passing a new context', function() { +--- +> it('block helper passing a new context', () => { +213c200 +< .withHelper('form', function(context, options) { +--- +> .withHelper('form', function (context, options) { +216d202 +< .withMessage('Context variable resolved') +220c206 +< it('block helper passing a complex path context', function() { +--- +> it('block helper passing a complex path context', () => { +223c209 +< .withHelper('form', function(context, options) { +--- +> .withHelper('form', function (context, options) { +226d211 +< .withMessage('Complex path variable resolved') +230,233c215,216 +< it('nested block helpers', function() { +< expectTemplate( +< '{{#form yehuda}}

{{name}}

{{#link}}Hello{{/link}}{{/form}}' +< ) +--- +> it('nested block helpers', () => { +> expectTemplate('{{#form yehuda}}

{{name}}

{{#link}}Hello{{/link}}{{/form}}') +235c218 +< yehuda: { name: 'Yehuda' } +--- +> yehuda: { name: 'Yehuda' }, +237c220 +< .withHelper('link', function(options) { +--- +> .withHelper('link', function (this: any, options) { +240c223 +< .withHelper('form', function(context, options) { +--- +> .withHelper('form', function (context, options) { +243d225 +< .withMessage('Both blocks executed') +247,249c229,231 +< it('block helper inverted sections', function() { +< var string = "{{#list people}}{{name}}{{^}}Nobody's here{{/list}}"; +< function list(context, options) { +--- +> it('block helper inverted sections', () => { +> const string = "{{#list people}}{{name}}{{^}}Nobody's here{{/list}}"; +> function list(this: any, context: any, options: Handlebars.HelperOptions) { +251,252c233,234 +< var out = '
    '; +< for (var i = 0, j = context.length; i < j; i++) { +--- +> let out = '
      '; +> for (let i = 0, j = context.length; i < j; i++) { +268,269c250 +< .withHelpers({ list: list }) +< .withMessage('an inverse wrapper is passed in as a new context') +--- +> .withHelpers({ list }) +274,275c255 +< .withHelpers({ list: list }) +< .withMessage('an inverse wrapper can be optionally called') +--- +> .withHelpers({ list }) +281c261 +< message: "Nobody's here" +--- +> message: "Nobody's here", +283,284c263 +< .withHelpers({ list: list }) +< .withMessage('the context of an inverse is the parent of the block') +--- +> .withHelpers({ list }) +288,292c267,269 +< it('pathed lambas with parameters', function() { +< var hash = { +< helper: function() { +< return 'winning'; +< } +--- +> it('pathed lambas with parameters', () => { +> const hash = { +> helper: () => 'winning', +293a271 +> // @ts-expect-error +295,298c273,275 +< var helpers = { +< './helper': function() { +< return 'fail'; +< } +--- +> +> const helpers = { +> './helper': () => 'fail', +301,309c278,279 +< expectTemplate('{{./helper 1}}') +< .withInput(hash) +< .withHelpers(helpers) +< .toCompileTo('winning'); +< +< expectTemplate('{{hash/helper 1}}') +< .withInput(hash) +< .withHelpers(helpers) +< .toCompileTo('winning'); +--- +> expectTemplate('{{./helper 1}}').withInput(hash).withHelpers(helpers).toCompileTo('winning'); +> expectTemplate('{{hash/helper 1}}').withInput(hash).withHelpers(helpers).toCompileTo('winning'); +312,313c282,283 +< describe('helpers hash', function() { +< it('providing a helpers hash', function() { +--- +> describe('helpers hash', () => { +> it('providing a helpers hash', () => { +317c287 +< world: function() { +--- +> world() { +319c289 +< } +--- +> }, +321d290 +< .withMessage('helpers hash is available') +327c296 +< world: function() { +--- +> world() { +329c298 +< } +--- +> }, +331d299 +< .withMessage('helpers hash is available inside other blocks') +335c303 +< it('in cases of conflict, helpers win', function() { +--- +> it('in cases of conflict, helpers win', () => { +339c307 +< lookup: function() { +--- +> lookup() { +341c309 +< } +--- +> }, +343d310 +< .withMessage('helpers hash has precedence escaped expansion') +349c316 +< lookup: function() { +--- +> lookup() { +351c318 +< } +--- +> }, +353d319 +< .withMessage('helpers hash has precedence simple expansion') +357c323 +< it('the helpers hash is available is nested contexts', function() { +--- +> it('the helpers hash is available is nested contexts', () => { +361c327 +< helper: function() { +--- +> helper() { +363c329 +< } +--- +> }, +365d330 +< .withMessage('helpers hash is available in nested contexts.') +369,370c334,335 +< it('the helper hash should augment the global hash', function() { +< handlebarsEnv.registerHelper('test_helper', function() { +--- +> it('the helper hash should augment the global hash', () => { +> kbnHandlebarsEnv!.registerHelper('test_helper', function () { +374,376c339 +< expectTemplate( +< '{{test_helper}} {{#if cruel}}Goodbye {{cruel}} {{world}}!{{/if}}' +< ) +--- +> expectTemplate('{{test_helper}} {{#if cruel}}Goodbye {{cruel}} {{world}}!{{/if}}') +379c342 +< world: function() { +--- +> world() { +381c344 +< } +--- +> }, +387,389c350,352 +< describe('registration', function() { +< it('unregisters', function() { +< handlebarsEnv.helpers = {}; +--- +> describe('registration', () => { +> it('unregisters', () => { +> deleteAllKeys(kbnHandlebarsEnv!.helpers); +391c354 +< handlebarsEnv.registerHelper('foo', function() { +--- +> kbnHandlebarsEnv!.registerHelper('foo', function () { +394,395c357,359 +< handlebarsEnv.unregisterHelper('foo'); +< equals(handlebarsEnv.helpers.foo, undefined); +--- +> expect(kbnHandlebarsEnv!.helpers.foo).toBeDefined(); +> kbnHandlebarsEnv!.unregisterHelper('foo'); +> expect(kbnHandlebarsEnv!.helpers.foo).toBeUndefined(); +398,404c362,368 +< it('allows multiple globals', function() { +< var helpers = handlebarsEnv.helpers; +< handlebarsEnv.helpers = {}; +< +< handlebarsEnv.registerHelper({ +< if: helpers['if'], +< world: function() { +--- +> it('allows multiple globals', () => { +> const ifHelper = kbnHandlebarsEnv!.helpers.if; +> deleteAllKeys(kbnHandlebarsEnv!.helpers); +> +> kbnHandlebarsEnv!.registerHelper({ +> if: ifHelper, +> world() { +407c371 +< testHelper: function() { +--- +> testHelper() { +409c373 +< } +--- +> }, +412,414c376 +< expectTemplate( +< '{{testHelper}} {{#if cruel}}Goodbye {{cruel}} {{world}}!{{/if}}' +< ) +--- +> expectTemplate('{{testHelper}} {{#if cruel}}Goodbye {{cruel}} {{world}}!{{/if}}') +419,429c381,387 +< it('fails with multiple and args', function() { +< shouldThrow( +< function() { +< handlebarsEnv.registerHelper( +< { +< world: function() { +< return 'world!'; +< }, +< testHelper: function() { +< return 'found it!'; +< } +--- +> it('fails with multiple and args', () => { +> expect(() => { +> kbnHandlebarsEnv!.registerHelper( +> // @ts-expect-error TypeScript is complaining about the invalid input just as the thrown error +> { +> world() { +> return 'world!'; +431,436c389,395 +< {} +< ); +< }, +< Error, +< 'Arg not supported with multiple helpers' +< ); +--- +> testHelper() { +> return 'found it!'; +> }, +> }, +> {} +> ); +> }).toThrow('Arg not supported with multiple helpers'); +440c399 +< it('decimal number literals work', function() { +--- +> it('decimal number literals work', () => { +442c401 +< .withHelper('hello', function(times, times2) { +--- +> .withHelper('hello', function (times, times2) { +451d409 +< .withMessage('template with a negative integer literal') +455c413 +< it('negative number literals work', function() { +--- +> it('negative number literals work', () => { +457c415 +< .withHelper('hello', function(times) { +--- +> .withHelper('hello', function (times) { +463d420 +< .withMessage('template with a negative integer literal') +467,468c424,425 +< describe('String literal parameters', function() { +< it('simple literals work', function() { +--- +> describe('String literal parameters', () => { +> it('simple literals work', () => { +470c427 +< .withHelper('hello', function(param, times, bool1, bool2) { +--- +> .withHelper('hello', function (param, times, bool1, bool2) { +480,482c437 +< return ( +< 'Hello ' + param + ' ' + times + ' times: ' + bool1 + ' ' + bool2 +< ); +--- +> return 'Hello ' + param + ' ' + times + ' times: ' + bool1 + ' ' + bool2; +484d438 +< .withMessage('template with a simple String literal') +488c442 +< it('using a quote in the middle of a parameter raises an error', function() { +--- +> it('using a quote in the middle of a parameter raises an error', () => { +492c446 +< it('escaping a String is possible', function() { +--- +> it('escaping a String is possible', () => { +494c448 +< .withHelper('hello', function(param) { +--- +> .withHelper('hello', function (param) { +497d450 +< .withMessage('template with an escaped String literal') +501c454 +< it("it works with ' marks", function() { +--- +> it("it works with ' marks", () => { +503c456 +< .withHelper('hello', function(param) { +--- +> .withHelper('hello', function (param) { +506d458 +< .withMessage("template with a ' mark") +511,524c463,464 +< it('negative number literals work', function() { +< expectTemplate('Message: {{hello -12}}') +< .withHelper('hello', function(times) { +< if (typeof times !== 'number') { +< times = 'NaN'; +< } +< return 'Hello ' + times + ' times'; +< }) +< .withMessage('template with a negative integer literal') +< .toCompileTo('Message: Hello -12 times'); +< }); +< +< describe('multiple parameters', function() { +< it('simple multi-params work', function() { +--- +> describe('multiple parameters', () => { +> it('simple multi-params work', () => { +527c467 +< .withHelper('goodbye', function(cruel, world) { +--- +> .withHelper('goodbye', function (cruel, world) { +530d469 +< .withMessage('regular helpers with multiple params') +534,537c473,474 +< it('block multi-params work', function() { +< expectTemplate( +< 'Message: {{#goodbye cruel world}}{{greeting}} {{adj}} {{noun}}{{/goodbye}}' +< ) +--- +> it('block multi-params work', () => { +> expectTemplate('Message: {{#goodbye cruel world}}{{greeting}} {{adj}} {{noun}}{{/goodbye}}') +539c476 +< .withHelper('goodbye', function(cruel, world, options) { +--- +> .withHelper('goodbye', function (cruel, world, options) { +542d478 +< .withMessage('block helpers with multiple params') +547,548c483,484 +< describe('hash', function() { +< it('helpers can take an optional hash', function() { +--- +> describe('hash', () => { +> it('helpers can take an optional hash', () => { +550c486 +< .withHelper('goodbye', function(options) { +--- +> .withHelper('goodbye', function (options) { +561d496 +< .withMessage('Helper output hash') +565,566c500,501 +< it('helpers can take an optional hash with booleans', function() { +< function goodbye(options) { +--- +> it('helpers can take an optional hash with booleans', () => { +> function goodbye(options: Handlebars.HelperOptions) { +578d512 +< .withMessage('Helper output hash') +583d516 +< .withMessage('Boolean helper parameter honored') +587c520 +< it('block helpers can take an optional hash', function() { +--- +> it('block helpers can take an optional hash', () => { +589c522 +< .withHelper('goodbye', function(options) { +--- +> .withHelper('goodbye', function (this: any, options) { +600d532 +< .withMessage('Hash parameters output') +604c536 +< it('block helpers can take an optional hash with single quoted stings', function() { +--- +> it('block helpers can take an optional hash with single quoted stings', () => { +606c538 +< .withHelper('goodbye', function(options) { +--- +> .withHelper('goodbye', function (this: any, options) { +617d548 +< .withMessage('Hash parameters output') +621,622c552,553 +< it('block helpers can take an optional hash with booleans', function() { +< function goodbye(options) { +--- +> it('block helpers can take an optional hash with booleans', () => { +> function goodbye(this: any, options: Handlebars.HelperOptions) { +634d564 +< .withMessage('Boolean hash parameter honored') +639d568 +< .withMessage('Boolean hash parameter honored') +644,648c573,575 +< describe('helperMissing', function() { +< it('if a context is not found, helperMissing is used', function() { +< expectTemplate('{{hello}} {{link_to world}}').toThrow( +< /Missing helper: "link_to"/ +< ); +--- +> describe('helperMissing', () => { +> it('if a context is not found, helperMissing is used', () => { +> expectTemplate('{{hello}} {{link_to world}}').toThrow(/Missing helper: "link_to"/); +651c578 +< it('if a context is not found, custom helperMissing is used', function() { +--- +> it('if a context is not found, custom helperMissing is used', () => { +654c581 +< .withHelper('helperMissing', function(mesg, options) { +--- +> .withHelper('helperMissing', function (mesg, options) { +662c589 +< it('if a value is not found, custom helperMissing is used', function() { +--- +> it('if a value is not found, custom helperMissing is used', () => { +665c592 +< .withHelper('helperMissing', function(options) { +--- +> .withHelper('helperMissing', function (options) { +674,675c601,602 +< describe('knownHelpers', function() { +< it('Known helper should render helper', function() { +--- +> describe('knownHelpers', () => { +> it('Known helper should render helper', () => { +678c605 +< knownHelpers: { hello: true } +--- +> knownHelpers: { hello: true }, +680c607 +< .withHelper('hello', function() { +--- +> .withHelper('hello', function () { +686c613 +< it('Unknown helper in knownHelpers only mode should be passed as undefined', function() { +--- +> it('Unknown helper in knownHelpers only mode should be passed as undefined', () => { +690c617 +< knownHelpersOnly: true +--- +> knownHelpersOnly: true, +692c619 +< .withHelper('typeof', function(arg) { +--- +> .withHelper('typeof', function (arg) { +695c622 +< .withHelper('hello', function() { +--- +> .withHelper('hello', function () { +701c628 +< it('Builtin helpers available in knownHelpers only mode', function() { +--- +> it('Builtin helpers available in knownHelpers only mode', () => { +704c631 +< knownHelpersOnly: true +--- +> knownHelpersOnly: true, +709c636 +< it('Field lookup works in knownHelpers only mode', function() { +--- +> it('Field lookup works in knownHelpers only mode', () => { +712c639 +< knownHelpersOnly: true +--- +> knownHelpersOnly: true, +718c645 +< it('Conditional blocks work in knownHelpers only mode', function() { +--- +> it('Conditional blocks work in knownHelpers only mode', () => { +721c648 +< knownHelpersOnly: true +--- +> knownHelpersOnly: true, +727c654 +< it('Invert blocks work in knownHelpers only mode', function() { +--- +> it('Invert blocks work in knownHelpers only mode', () => { +730c657 +< knownHelpersOnly: true +--- +> knownHelpersOnly: true, +736c663 +< it('Functions are bound to the context in knownHelpers only mode', function() { +--- +> it('Functions are bound to the context in knownHelpers only mode', () => { +739c666 +< knownHelpersOnly: true +--- +> knownHelpersOnly: true, +742c669 +< foo: function() { +--- +> foo() { +745c672 +< bar: 'bar' +--- +> bar: 'bar', +750c677 +< it('Unknown helper call in knownHelpers only mode should throw', function() { +--- +> it('Unknown helper call in knownHelpers only mode should throw', () => { +757,758c684,685 +< describe('blockHelperMissing', function() { +< it('lambdas are resolved by blockHelperMissing, not handlebars proper', function() { +--- +> describe('blockHelperMissing', () => { +> it('lambdas are resolved by blockHelperMissing, not handlebars proper', () => { +761c688 +< truthy: function() { +--- +> truthy() { +763c690 +< } +--- +> }, +768c695 +< it('lambdas resolved by blockHelperMissing are bound to the context', function() { +--- +> it('lambdas resolved by blockHelperMissing are bound to the context', () => { +771c698 +< truthy: function() { +--- +> truthy() { +774c701 +< truthiness: function() { +--- +> truthiness() { +776c703 +< } +--- +> }, +782,785c709,712 +< describe('name field', function() { +< var helpers = { +< blockHelperMissing: function() { +< return 'missing: ' + arguments[arguments.length - 1].name; +--- +> describe('name field', () => { +> const helpers = { +> blockHelperMissing(...args: any[]) { +> return 'missing: ' + args[args.length - 1].name; +787,788c714,718 +< helperMissing: function() { +< return 'helper missing: ' + arguments[arguments.length - 1].name; +--- +> helperMissing(...args: any[]) { +> return 'helper missing: ' + args[args.length - 1].name; +> }, +> helper(...args: any[]) { +> return 'ran: ' + args[args.length - 1].name; +790,792d719 +< helper: function() { +< return 'ran: ' + arguments[arguments.length - 1].name; +< } +795,798c722,723 +< it('should include in ambiguous mustache calls', function() { +< expectTemplate('{{helper}}') +< .withHelpers(helpers) +< .toCompileTo('ran: helper'); +--- +> it('should include in ambiguous mustache calls', () => { +> expectTemplate('{{helper}}').withHelpers(helpers).toCompileTo('ran: helper'); +801,804c726,727 +< it('should include in helper mustache calls', function() { +< expectTemplate('{{helper 1}}') +< .withHelpers(helpers) +< .toCompileTo('ran: helper'); +--- +> it('should include in helper mustache calls', () => { +> expectTemplate('{{helper 1}}').withHelpers(helpers).toCompileTo('ran: helper'); +807,810c730,731 +< it('should include in ambiguous block calls', function() { +< expectTemplate('{{#helper}}{{/helper}}') +< .withHelpers(helpers) +< .toCompileTo('ran: helper'); +--- +> it('should include in ambiguous block calls', () => { +> expectTemplate('{{#helper}}{{/helper}}').withHelpers(helpers).toCompileTo('ran: helper'); +813c734 +< it('should include in simple block calls', function() { +--- +> it('should include in simple block calls', () => { +819,822c740,741 +< it('should include in helper block calls', function() { +< expectTemplate('{{#helper 1}}{{/helper}}') +< .withHelpers(helpers) +< .toCompileTo('ran: helper'); +--- +> it('should include in helper block calls', () => { +> expectTemplate('{{#helper 1}}{{/helper}}').withHelpers(helpers).toCompileTo('ran: helper'); +825c744 +< it('should include in known helper calls', function() { +--- +> it('should include in known helper calls', () => { +829c748 +< knownHelpersOnly: true +--- +> knownHelpersOnly: true, +835c754 +< it('should include full id', function() { +--- +> it('should include full id', () => { +842c761 +< it('should include full id if a hash is passed', function() { +--- +> it('should include full id if a hash is passed', () => { +850,851c769,770 +< describe('name conflicts', function() { +< it('helpers take precedence over same-named context properties', function() { +--- +> describe('name conflicts', () => { +> it('helpers take precedence over same-named context properties', () => { +853c772 +< .withHelper('goodbye', function() { +--- +> .withHelper('goodbye', function (this: any) { +856c775 +< .withHelper('cruel', function(world) { +--- +> .withHelper('cruel', function (world) { +861c780 +< world: 'world' +--- +> world: 'world', +863d781 +< .withMessage('Helper executed') +867c785 +< it('helpers take precedence over same-named context properties$', function() { +--- +> it('helpers take precedence over same-named context properties$', () => { +869c787 +< .withHelper('goodbye', function(options) { +--- +> .withHelper('goodbye', function (this: any, options) { +872c790 +< .withHelper('cruel', function(world) { +--- +> .withHelper('cruel', function (world) { +877c795 +< world: 'world' +--- +> world: 'world', +879d796 +< .withMessage('Helper executed') +883c800 +< it('Scoped names take precedence over helpers', function() { +--- +> it('Scoped names take precedence over helpers', () => { +885c802 +< .withHelper('goodbye', function() { +--- +> .withHelper('goodbye', function (this: any) { +888c805 +< .withHelper('cruel', function(world) { +--- +> .withHelper('cruel', function (world) { +893c810 +< world: 'world' +--- +> world: 'world', +895d811 +< .withMessage('Helper not executed') +899,903c815,817 +< it('Scoped names take precedence over block helpers', function() { +< expectTemplate( +< '{{#goodbye}} {{cruel world}}{{/goodbye}} {{this.goodbye}}' +< ) +< .withHelper('goodbye', function(options) { +--- +> it('Scoped names take precedence over block helpers', () => { +> expectTemplate('{{#goodbye}} {{cruel world}}{{/goodbye}} {{this.goodbye}}') +> .withHelper('goodbye', function (this: any, options) { +906c820 +< .withHelper('cruel', function(world) { +--- +> .withHelper('cruel', function (world) { +911c825 +< world: 'world' +--- +> world: 'world', +913d826 +< .withMessage('Helper executed') +918,919c831,832 +< describe('block params', function() { +< it('should take presedence over context values', function() { +--- +> describe('block params', () => { +> it('should take presedence over context values', () => { +922,923c835,836 +< .withHelper('goodbyes', function(options) { +< equals(options.fn.blockParams, 1); +--- +> .withHelper('goodbyes', function (options) { +> expect(options.fn.blockParams).toEqual(1); +929c842 +< it('should take presedence over helper values', function() { +--- +> it('should take presedence over helper values', () => { +931c844 +< .withHelper('value', function() { +--- +> .withHelper('value', function () { +934,935c847,848 +< .withHelper('goodbyes', function(options) { +< equals(options.fn.blockParams, 1); +--- +> .withHelper('goodbyes', function (options) { +> expect(options.fn.blockParams).toEqual(1); +941,944c854,855 +< it('should not take presedence over pathed values', function() { +< expectTemplate( +< '{{#goodbyes as |value|}}{{./value}}{{/goodbyes}}{{value}}' +< ) +--- +> it('should not take presedence over pathed values', () => { +> expectTemplate('{{#goodbyes as |value|}}{{./value}}{{/goodbyes}}{{value}}') +946c857 +< .withHelper('value', function() { +--- +> .withHelper('value', function () { +949,950c860,861 +< .withHelper('goodbyes', function(options) { +< equals(options.fn.blockParams, 1); +--- +> .withHelper('goodbyes', function (this: any, options) { +> expect(options.fn.blockParams).toEqual(1); +956,957c867,868 +< it('should take presednece over parent block params', function() { +< var value = 1; +--- +> it('should take presednece over parent block params', () => { +> let value: number; +959c870,875 +< '{{#goodbyes as |value|}}{{#goodbyes}}{{value}}{{#goodbyes as |value|}}{{value}}{{/goodbyes}}{{/goodbyes}}{{/goodbyes}}{{value}}' +--- +> '{{#goodbyes as |value|}}{{#goodbyes}}{{value}}{{#goodbyes as |value|}}{{value}}{{/goodbyes}}{{/goodbyes}}{{/goodbyes}}{{value}}', +> { +> beforeEach() { +> value = 1; +> }, +> } +962c878 +< .withHelper('goodbyes', function(options) { +--- +> .withHelper('goodbyes', function (options) { +966,967c882 +< blockParams: +< options.fn.blockParams === 1 ? [value++, value++] : undefined +--- +> blockParams: options.fn.blockParams === 1 ? [value++, value++] : undefined, +974,977c889,890 +< it('should allow block params on chained helpers', function() { +< expectTemplate( +< '{{#if bar}}{{else goodbyes as |value|}}{{value}}{{/if}}{{value}}' +< ) +--- +> it('should allow block params on chained helpers', () => { +> expectTemplate('{{#if bar}}{{else goodbyes as |value|}}{{value}}{{/if}}{{value}}') +979,980c892,893 +< .withHelper('goodbyes', function(options) { +< equals(options.fn.blockParams, 1); +--- +> .withHelper('goodbyes', function (options) { +> expect(options.fn.blockParams).toEqual(1); +987,991c900,902 +< describe('built-in helpers malformed arguments ', function() { +< it('if helper - too few arguments', function() { +< expectTemplate('{{#if}}{{/if}}').toThrow( +< /#if requires exactly one argument/ +< ); +--- +> describe('built-in helpers malformed arguments ', () => { +> it('if helper - too few arguments', () => { +> expectTemplate('{{#if}}{{/if}}').toThrow(/#if requires exactly one argument/); +994,997c905,906 +< it('if helper - too many arguments, string', function() { +< expectTemplate('{{#if test "string"}}{{/if}}').toThrow( +< /#if requires exactly one argument/ +< ); +--- +> it('if helper - too many arguments, string', () => { +> expectTemplate('{{#if test "string"}}{{/if}}').toThrow(/#if requires exactly one argument/); +1000,1003c909,910 +< it('if helper - too many arguments, undefined', function() { +< expectTemplate('{{#if test undefined}}{{/if}}').toThrow( +< /#if requires exactly one argument/ +< ); +--- +> it('if helper - too many arguments, undefined', () => { +> expectTemplate('{{#if test undefined}}{{/if}}').toThrow(/#if requires exactly one argument/); +1006,1009c913,914 +< it('if helper - too many arguments, null', function() { +< expectTemplate('{{#if test null}}{{/if}}').toThrow( +< /#if requires exactly one argument/ +< ); +--- +> it('if helper - too many arguments, null', () => { +> expectTemplate('{{#if test null}}{{/if}}').toThrow(/#if requires exactly one argument/); +1012,1015c917,918 +< it('unless helper - too few arguments', function() { +< expectTemplate('{{#unless}}{{/unless}}').toThrow( +< /#unless requires exactly one argument/ +< ); +--- +> it('unless helper - too few arguments', () => { +> expectTemplate('{{#unless}}{{/unless}}').toThrow(/#unless requires exactly one argument/); +1018c921 +< it('unless helper - too many arguments', function() { +--- +> it('unless helper - too many arguments', () => { +1024,1027c927,928 +< it('with helper - too few arguments', function() { +< expectTemplate('{{#with}}{{/with}}').toThrow( +< /#with requires exactly one argument/ +< ); +--- +> it('with helper - too few arguments', () => { +> expectTemplate('{{#with}}{{/with}}').toThrow(/#with requires exactly one argument/); +1030c931 +< it('with helper - too many arguments', function() { +--- +> it('with helper - too many arguments', () => { +1037,1038c938,939 +< describe('the lookupProperty-option', function() { +< it('should be passed to custom helpers', function() { +--- +> describe('the lookupProperty-option', () => { +> it('should be passed to custom helpers', () => { +1040c941 +< .withHelper('testHelper', function testHelper(options) { +--- +> .withHelper('testHelper', function testHelper(this: any, options) { +1047a949,954 +> +> function deleteAllKeys(obj: { [key: string]: any }) { +> for (const key of Object.keys(obj)) { +> delete obj[key]; +> } +> } diff --git a/packages/kbn-handlebars/.patches/regressions.patch b/packages/kbn-handlebars/.patches/regressions.patch new file mode 100644 index 0000000000000..2fcd491310619 --- /dev/null +++ b/packages/kbn-handlebars/.patches/regressions.patch @@ -0,0 +1,518 @@ +1,2c1,11 +< describe('Regressions', function() { +< it('GH-94: Cannot read property of undefined', function() { +--- +> /* +> * This file is forked from the handlebars project (https://github.com/handlebars-lang/handlebars.js), +> * and may include modifications made by Elasticsearch B.V. +> * Elasticsearch B.V. licenses this file to you under the MIT License. +> * See `packages/kbn-handlebars/LICENSE` for more information. +> */ +> +> import { expectTemplate } from '../__jest__/test_bench'; +> +> describe('Regressions', () => { +> it('GH-94: Cannot read property of undefined', () => { +9,10c18,19 +< name: 'Charles Darwin' +< } +--- +> name: 'Charles Darwin', +> }, +13,15c22,24 +< title: 'Lazarillo de Tormes' +< } +< ] +--- +> title: 'Lazarillo de Tormes', +> }, +> ], +17d25 +< .withMessage('Renders without an undefined property error') +21,43c29,34 +< it("GH-150: Inverted sections print when they shouldn't", function() { +< var string = '{{^set}}not set{{/set}} :: {{#set}}set{{/set}}'; +< +< expectTemplate(string) +< .withMessage( +< "inverted sections run when property isn't present in context" +< ) +< .toCompileTo('not set :: '); +< +< expectTemplate(string) +< .withInput({ set: undefined }) +< .withMessage('inverted sections run when property is undefined') +< .toCompileTo('not set :: '); +< +< expectTemplate(string) +< .withInput({ set: false }) +< .withMessage('inverted sections run when property is false') +< .toCompileTo('not set :: '); +< +< expectTemplate(string) +< .withInput({ set: true }) +< .withMessage("inverted sections don't run when property is true") +< .toCompileTo(' :: set'); +--- +> it("GH-150: Inverted sections print when they shouldn't", () => { +> const string = '{{^set}}not set{{/set}} :: {{#set}}set{{/set}}'; +> expectTemplate(string).toCompileTo('not set :: '); +> expectTemplate(string).withInput({ set: undefined }).toCompileTo('not set :: '); +> expectTemplate(string).withInput({ set: false }).toCompileTo('not set :: '); +> expectTemplate(string).withInput({ set: true }).toCompileTo(' :: set'); +46c37 +< it('GH-158: Using array index twice, breaks the template', function() { +--- +> it('GH-158: Using array index twice, breaks the template', () => { +49d39 +< .withMessage('it works as expected') +53,54c43,44 +< it("bug reported by @fat where lambdas weren't being properly resolved", function() { +< var string = +--- +> it("bug reported by @fat where lambdas weren't being properly resolved", () => { +> const string = +69,70c59,60 +< var data = { +< thing: function() { +--- +> const data = { +> thing() { +76c66 +< { className: 'three', word: '@sayrer' } +--- +> { className: 'three', word: '@sayrer' }, +78c68 +< hasThings: function() { +--- +> hasThings() { +80c70 +< } +--- +> }, +83c73 +< var output = +--- +> const output = +92,94c82 +< expectTemplate(string) +< .withInput(data) +< .toCompileTo(output); +--- +> expectTemplate(string).withInput(data).toCompileTo(output); +97,100c85,86 +< it('GH-408: Multiple loops fail', function() { +< expectTemplate( +< '{{#.}}{{name}}{{/.}}{{#.}}{{name}}{{/.}}{{#.}}{{name}}{{/.}}' +< ) +--- +> it('GH-408: Multiple loops fail', () => { +> expectTemplate('{{#.}}{{name}}{{/.}}{{#.}}{{name}}{{/.}}{{#.}}{{name}}{{/.}}') +103c89 +< { name: 'Jane Doe', location: { city: 'New York' } } +--- +> { name: 'Jane Doe', location: { city: 'New York' } }, +105d90 +< .withMessage('It should output multiple times') +109,110c94,95 +< it('GS-428: Nested if else rendering', function() { +< var succeedingTemplate = +--- +> it('GS-428: Nested if else rendering', () => { +> const succeedingTemplate = +112c97 +< var failingTemplate = +--- +> const failingTemplate = +115,116c100,101 +< var helpers = { +< blk: function(block) { +--- +> const helpers = { +> blk(block: Handlebars.HelperOptions) { +119c104 +< inverse: function(block) { +--- +> inverse(block: Handlebars.HelperOptions) { +121c106 +< } +--- +> }, +124,130c109,110 +< expectTemplate(succeedingTemplate) +< .withHelpers(helpers) +< .toCompileTo(' Expected '); +< +< expectTemplate(failingTemplate) +< .withHelpers(helpers) +< .toCompileTo(' Expected '); +--- +> expectTemplate(succeedingTemplate).withHelpers(helpers).toCompileTo(' Expected '); +> expectTemplate(failingTemplate).withHelpers(helpers).toCompileTo(' Expected '); +133,136c113,114 +< it('GH-458: Scoped this identifier', function() { +< expectTemplate('{{./foo}}') +< .withInput({ foo: 'bar' }) +< .toCompileTo('bar'); +--- +> it('GH-458: Scoped this identifier', () => { +> expectTemplate('{{./foo}}').withInput({ foo: 'bar' }).toCompileTo('bar'); +139c117 +< it('GH-375: Unicode line terminators', function() { +--- +> it('GH-375: Unicode line terminators', () => { +143c121 +< it('GH-534: Object prototype aliases', function() { +--- +> it('GH-534: Object prototype aliases', () => { +144a123 +> // @ts-expect-error +147,149c126 +< expectTemplate('{{foo}}') +< .withInput({ foo: 'bar' }) +< .toCompileTo('bar'); +--- +> expectTemplate('{{foo}}').withInput({ foo: 'bar' }).toCompileTo('bar'); +150a128 +> // @ts-expect-error +155,157c133,135 +< it('GH-437: Matching escaping', function() { +< expectTemplate('{{{a}}').toThrow(Error, /Parse error on/); +< expectTemplate('{{a}}}').toThrow(Error, /Parse error on/); +--- +> it('GH-437: Matching escaping', () => { +> expectTemplate('{{{a}}').toThrow(/Parse error on/); +> expectTemplate('{{a}}}').toThrow(/Parse error on/); +160,166c138,140 +< it('GH-676: Using array in escaping mustache fails', function() { +< var data = { arr: [1, 2] }; +< +< expectTemplate('{{arr}}') +< .withInput(data) +< .withMessage('it works as expected') +< .toCompileTo(data.arr.toString()); +--- +> it('GH-676: Using array in escaping mustache fails', () => { +> const data = { arr: [1, 2] }; +> expectTemplate('{{arr}}').withInput(data).toCompileTo(data.arr.toString()); +169c143 +< it('Mustache man page', function() { +--- +> it('Mustache man page', () => { +177c151 +< in_ca: true +--- +> in_ca: true, +179,182c153 +< .withMessage('the hello world mustache example works') +< .toCompileTo( +< 'Hello Chris. You have just won $10000! Well, $6000, after taxes.' +< ); +--- +> .toCompileTo('Hello Chris. You have just won $10000! Well, $6000, after taxes.'); +185c156 +< it('GH-731: zero context rendering', function() { +--- +> it('GH-731: zero context rendering', () => { +189c160 +< bar: 'OK' +--- +> bar: 'OK', +194,197c165,166 +< it('GH-820: zero pathed rendering', function() { +< expectTemplate('{{foo.bar}}') +< .withInput({ foo: 0 }) +< .toCompileTo(''); +--- +> it('GH-820: zero pathed rendering', () => { +> expectTemplate('{{foo.bar}}').withInput({ foo: 0 }).toCompileTo(''); +200c169 +< it('GH-837: undefined values for helpers', function() { +--- +> it('GH-837: undefined values for helpers', () => { +203c172 +< str: function(value) { +--- +> str(value) { +205c174 +< } +--- +> }, +210c179 +< it('GH-926: Depths and de-dupe', function() { +--- +> it('GH-926: Depths and de-dupe', () => { +217c186 +< notData: [1] +--- +> notData: [1], +222c191 +< it('GH-1021: Each empty string key', function() { +--- +> it('GH-1021: Each empty string key', () => { +228,229c197,198 +< value: 10000 +< } +--- +> value: 10000, +> }, +234,248c203,204 +< it('GH-1054: Should handle simple safe string responses', function() { +< expectTemplate('{{#wrap}}{{>partial}}{{/wrap}}') +< .withHelpers({ +< wrap: function(options) { +< return new Handlebars.SafeString(options.fn()); +< } +< }) +< .withPartials({ +< partial: '{{#wrap}}{{/wrap}}' +< }) +< .toCompileTo(''); +< }); +< +< it('GH-1065: Sparse arrays', function() { +< var array = []; +--- +> it('GH-1065: Sparse arrays', () => { +> const array = []; +252c208 +< .withInput({ array: array }) +--- +> .withInput({ array }) +256c212 +< it('GH-1093: Undefined helper context', function() { +--- +> it('GH-1093: Undefined helper context', () => { +260c216 +< helper: function() { +--- +> helper(this: any) { +263c219 +< for (var name in this) { +--- +> for (const name in this) { +270c226 +< } +--- +> }, +275,306c231 +< it('should support multiple levels of inline partials', function() { +< expectTemplate( +< '{{#> layout}}{{#*inline "subcontent"}}subcontent{{/inline}}{{/layout}}' +< ) +< .withPartials({ +< doctype: 'doctype{{> content}}', +< layout: +< '{{#> doctype}}{{#*inline "content"}}layout{{> subcontent}}{{/inline}}{{/doctype}}' +< }) +< .toCompileTo('doctypelayoutsubcontent'); +< }); +< +< it('GH-1089: should support failover content in multiple levels of inline partials', function() { +< expectTemplate('{{#> layout}}{{/layout}}') +< .withPartials({ +< doctype: 'doctype{{> content}}', +< layout: +< '{{#> doctype}}{{#*inline "content"}}layout{{#> subcontent}}subcontent{{/subcontent}}{{/inline}}{{/doctype}}' +< }) +< .toCompileTo('doctypelayoutsubcontent'); +< }); +< +< it('GH-1099: should support greater than 3 nested levels of inline partials', function() { +< expectTemplate('{{#> layout}}Outer{{/layout}}') +< .withPartials({ +< layout: '{{#> inner}}Inner{{/inner}}{{> @partial-block }}', +< inner: '' +< }) +< .toCompileTo('Outer'); +< }); +< +< it('GH-1135 : Context handling within each iteration', function() { +--- +> it('GH-1135 : Context handling within each iteration', () => { +315c240 +< myif: function(conditional, options) { +--- +> myif(conditional, options) { +321c246 +< } +--- +> }, +326,343c251,252 +< it('GH-1186: Support block params for existing programs', function() { +< expectTemplate( +< '{{#*inline "test"}}{{> @partial-block }}{{/inline}}' + +< '{{#>test }}{{#each listOne as |item|}}{{ item }}{{/each}}{{/test}}' + +< '{{#>test }}{{#each listTwo as |item|}}{{ item }}{{/each}}{{/test}}' +< ) +< .withInput({ +< listOne: ['a'], +< listTwo: ['b'] +< }) +< .withMessage('') +< .toCompileTo('ab'); +< }); +< +< it('GH-1319: "unless" breaks when "each" value equals "null"', function() { +< expectTemplate( +< '{{#each list}}{{#unless ./prop}}parent={{../value}} {{/unless}}{{/each}}' +< ) +--- +> it('GH-1319: "unless" breaks when "each" value equals "null"', () => { +> expectTemplate('{{#each list}}{{#unless ./prop}}parent={{../value}} {{/unless}}{{/each}}') +346c255 +< list: [null, 'a'] +--- +> list: [null, 'a'], +348d256 +< .withMessage('') +352,457c260 +< it('GH-1341: 4.0.7 release breaks {{#if @partial-block}} usage', function() { +< expectTemplate('template {{>partial}} template') +< .withPartials({ +< partialWithBlock: +< '{{#if @partial-block}} block {{> @partial-block}} block {{/if}}', +< partial: '{{#> partialWithBlock}} partial {{/partialWithBlock}}' +< }) +< .toCompileTo('template block partial block template'); +< }); +< +< describe('GH-1561: 4.3.x should still work with precompiled templates from 4.0.0 <= x < 4.3.0', function() { +< it('should compile and execute templates', function() { +< var newHandlebarsInstance = Handlebars.create(); +< +< registerTemplate(newHandlebarsInstance, compiledTemplateVersion7()); +< newHandlebarsInstance.registerHelper('loud', function(value) { +< return value.toUpperCase(); +< }); +< var result = newHandlebarsInstance.templates['test.hbs']({ +< name: 'yehuda' +< }); +< equals(result.trim(), 'YEHUDA'); +< }); +< +< it('should call "helperMissing" if a helper is missing', function() { +< var newHandlebarsInstance = Handlebars.create(); +< +< shouldThrow( +< function() { +< registerTemplate(newHandlebarsInstance, compiledTemplateVersion7()); +< newHandlebarsInstance.templates['test.hbs']({}); +< }, +< Handlebars.Exception, +< 'Missing helper: "loud"' +< ); +< }); +< +< it('should pass "options.lookupProperty" to "lookup"-helper, even with old templates', function() { +< var newHandlebarsInstance = Handlebars.create(); +< registerTemplate( +< newHandlebarsInstance, +< compiledTemplateVersion7_usingLookupHelper() +< ); +< +< newHandlebarsInstance.templates['test.hbs']({}); +< +< expect( +< newHandlebarsInstance.templates['test.hbs']({ +< property: 'a', +< test: { a: 'b' } +< }) +< ).to.equal('b'); +< }); +< +< function registerTemplate(Handlebars, compileTemplate) { +< var template = Handlebars.template, +< templates = (Handlebars.templates = Handlebars.templates || {}); +< templates['test.hbs'] = template(compileTemplate); +< } +< +< function compiledTemplateVersion7() { +< return { +< compiler: [7, '>= 4.0.0'], +< main: function(container, depth0, helpers, partials, data) { +< return ( +< container.escapeExpression( +< ( +< helpers.loud || +< (depth0 && depth0.loud) || +< helpers.helperMissing +< ).call( +< depth0 != null ? depth0 : container.nullContext || {}, +< depth0 != null ? depth0.name : depth0, +< { name: 'loud', hash: {}, data: data } +< ) +< ) + '\n\n' +< ); +< }, +< useData: true +< }; +< } +< +< function compiledTemplateVersion7_usingLookupHelper() { +< // This is the compiled version of "{{lookup test property}}" +< return { +< compiler: [7, '>= 4.0.0'], +< main: function(container, depth0, helpers, partials, data) { +< return container.escapeExpression( +< helpers.lookup.call( +< depth0 != null ? depth0 : container.nullContext || {}, +< depth0 != null ? depth0.test : depth0, +< depth0 != null ? depth0.property : depth0, +< { +< name: 'lookup', +< hash: {}, +< data: data +< } +< ) +< ); +< }, +< useData: true +< }; +< } +< }); +< +< it('should allow hash with protected array names', function() { +--- +> it('should allow hash with protected array names', () => { +461c264 +< helpa: function(options) { +--- +> helpa(options) { +463c266 +< } +--- +> }, +468,496c271,272 +< describe('GH-1598: Performance degradation for partials since v4.3.0', function() { +< // Do not run test for runs without compiler +< if (!Handlebars.compile) { +< return; +< } +< +< var newHandlebarsInstance; +< beforeEach(function() { +< newHandlebarsInstance = Handlebars.create(); +< }); +< afterEach(function() { +< sinon.restore(); +< }); +< +< it('should only compile global partials once', function() { +< var templateSpy = sinon.spy(newHandlebarsInstance, 'template'); +< newHandlebarsInstance.registerPartial({ +< dude: 'I am a partial' +< }); +< var string = 'Dudes: {{> dude}} {{> dude}}'; +< newHandlebarsInstance.compile(string)(); // This should compile template + partial once +< newHandlebarsInstance.compile(string)(); // This should only compile template +< equal(templateSpy.callCount, 3); +< sinon.restore(); +< }); +< }); +< +< describe("GH-1639: TypeError: Cannot read property 'apply' of undefined\" when handlebars version > 4.6.0 (undocumented, deprecated usage)", function() { +< it('should treat undefined helpers like non-existing helpers', function() { +--- +> describe("GH-1639: TypeError: Cannot read property 'apply' of undefined\" when handlebars version > 4.6.0 (undocumented, deprecated usage)", () => { +> it('should treat undefined helpers like non-existing helpers', () => { diff --git a/packages/kbn-handlebars/.patches/security.patch b/packages/kbn-handlebars/.patches/security.patch new file mode 100644 index 0000000000000..89d2060d8977b --- /dev/null +++ b/packages/kbn-handlebars/.patches/security.patch @@ -0,0 +1,443 @@ +1,10c1,15 +< describe('security issues', function() { +< describe('GH-1495: Prevent Remote Code Execution via constructor', function() { +< it('should not allow constructors to be accessed', function() { +< expectTemplate('{{lookup (lookup this "constructor") "name"}}') +< .withInput({}) +< .toCompileTo(''); +< +< expectTemplate('{{constructor.name}}') +< .withInput({}) +< .toCompileTo(''); +--- +> /* +> * This file is forked from the handlebars project (https://github.com/handlebars-lang/handlebars.js), +> * and may include modifications made by Elasticsearch B.V. +> * Elasticsearch B.V. licenses this file to you under the MIT License. +> * See `packages/kbn-handlebars/LICENSE` for more information. +> */ +> +> import Handlebars from '..'; +> import { expectTemplate } from '../__jest__/test_bench'; +> +> describe('security issues', () => { +> describe('GH-1495: Prevent Remote Code Execution via constructor', () => { +> it('should not allow constructors to be accessed', () => { +> expectTemplate('{{lookup (lookup this "constructor") "name"}}').withInput({}).toCompileTo(''); +> expectTemplate('{{constructor.name}}').withInput({}).toCompileTo(''); +13c18 +< it('GH-1603: should not allow constructors to be accessed (lookup via toString)', function() { +--- +> it('GH-1603: should not allow constructors to be accessed (lookup via toString)', () => { +16c21 +< .withHelper('list', function(element) { +--- +> .withHelper('list', function (element) { +22c27 +< it('should allow the "constructor" property to be accessed if it is an "ownProperty"', function() { +--- +> it('should allow the "constructor" property to be accessed if it is an "ownProperty"', () => { +32c37 +< it('should allow the "constructor" property to be accessed if it is an "own property"', function() { +--- +> it('should allow the "constructor" property to be accessed if it is an "own property"', () => { +39,45c44,46 +< describe('GH-1558: Prevent explicit call of helperMissing-helpers', function() { +< if (!Handlebars.compile) { +< return; +< } +< +< describe('without the option "allowExplicitCallOfHelperMissing"', function() { +< it('should throw an exception when calling "{{helperMissing}}" ', function() { +--- +> describe('GH-1558: Prevent explicit call of helperMissing-helpers', () => { +> describe('without the option "allowExplicitCallOfHelperMissing"', () => { +> it('should throw an exception when calling "{{helperMissing}}" ', () => { +49c50 +< it('should throw an exception when calling "{{#helperMissing}}{{/helperMissing}}" ', function() { +--- +> it('should throw an exception when calling "{{#helperMissing}}{{/helperMissing}}" ', () => { +53,56c54,57 +< it('should throw an exception when calling "{{blockHelperMissing "abc" .}}" ', function() { +< var functionCalls = []; +< expect(function() { +< var template = Handlebars.compile('{{blockHelperMissing "abc" .}}'); +--- +> it('should throw an exception when calling "{{blockHelperMissing "abc" .}}" ', () => { +> const functionCalls = []; +> expect(() => { +> const template = Handlebars.compile('{{blockHelperMissing "abc" .}}'); +58c59 +< fn: function() { +--- +> fn() { +60c61 +< } +--- +> }, +62,63c63,64 +< }).to.throw(Error); +< expect(functionCalls.length).to.equal(0); +--- +> }).toThrow(Error); +> expect(functionCalls.length).toEqual(0); +66c67 +< it('should throw an exception when calling "{{#blockHelperMissing .}}{{/blockHelperMissing}}"', function() { +--- +> it('should throw an exception when calling "{{#blockHelperMissing .}}{{/blockHelperMissing}}"', () => { +69c70 +< fn: function() { +--- +> fn() { +71c72 +< } +--- +> }, +76,110d76 +< +< describe('with the option "allowCallsToHelperMissing" set to true', function() { +< it('should not throw an exception when calling "{{helperMissing}}" ', function() { +< var template = Handlebars.compile('{{helperMissing}}'); +< template({}, { allowCallsToHelperMissing: true }); +< }); +< +< it('should not throw an exception when calling "{{#helperMissing}}{{/helperMissing}}" ', function() { +< var template = Handlebars.compile( +< '{{#helperMissing}}{{/helperMissing}}' +< ); +< template({}, { allowCallsToHelperMissing: true }); +< }); +< +< it('should not throw an exception when calling "{{blockHelperMissing "abc" .}}" ', function() { +< var functionCalls = []; +< var template = Handlebars.compile('{{blockHelperMissing "abc" .}}'); +< template( +< { +< fn: function() { +< functionCalls.push('called'); +< } +< }, +< { allowCallsToHelperMissing: true } +< ); +< equals(functionCalls.length, 1); +< }); +< +< it('should not throw an exception when calling "{{#blockHelperMissing .}}{{/blockHelperMissing}}"', function() { +< var template = Handlebars.compile( +< '{{#blockHelperMissing true}}sdads{{/blockHelperMissing}}' +< ); +< template({}, { allowCallsToHelperMissing: true }); +< }); +< }); +113,114c79,81 +< describe('GH-1563', function() { +< it('should not allow to access constructor after overriding via __defineGetter__', function() { +--- +> describe('GH-1563', () => { +> it('should not allow to access constructor after overriding via __defineGetter__', () => { +> // @ts-expect-error +116c83 +< return this.skip(); // Browser does not support this exploit anyway +--- +> return; // Browser does not support this exploit anyway +130,131c97,98 +< describe('GH-1595: dangerous properties', function() { +< var templates = [ +--- +> describe('GH-1595: dangerous properties', () => { +> const templates = [ +141c108 +< '{{lookup this "__proto__"}}' +--- +> '{{lookup this "__proto__"}}', +144,257c111,114 +< templates.forEach(function(template) { +< describe('access should be denied to ' + template, function() { +< it('by default', function() { +< expectTemplate(template) +< .withInput({}) +< .toCompileTo(''); +< }); +< it(' with proto-access enabled', function() { +< expectTemplate(template) +< .withInput({}) +< .withRuntimeOptions({ +< allowProtoPropertiesByDefault: true, +< allowProtoMethodsByDefault: true +< }) +< .toCompileTo(''); +< }); +< }); +< }); +< }); +< describe('GH-1631: disallow access to prototype functions', function() { +< function TestClass() {} +< +< TestClass.prototype.aProperty = 'propertyValue'; +< TestClass.prototype.aMethod = function() { +< return 'returnValue'; +< }; +< +< beforeEach(function() { +< handlebarsEnv.resetLoggedPropertyAccesses(); +< }); +< +< afterEach(function() { +< sinon.restore(); +< }); +< +< describe('control access to prototype methods via "allowedProtoMethods"', function() { +< checkProtoMethodAccess({}); +< +< describe('in compat mode', function() { +< checkProtoMethodAccess({ compat: true }); +< }); +< +< function checkProtoMethodAccess(compileOptions) { +< it('should be prohibited by default and log a warning', function() { +< var spy = sinon.spy(console, 'error'); +< +< expectTemplate('{{aMethod}}') +< .withInput(new TestClass()) +< .withCompileOptions(compileOptions) +< .toCompileTo(''); +< +< expect(spy.calledOnce).to.be.true(); +< expect(spy.args[0][0]).to.match(/Handlebars: Access has been denied/); +< }); +< +< it('should only log the warning once', function() { +< var spy = sinon.spy(console, 'error'); +< +< expectTemplate('{{aMethod}}') +< .withInput(new TestClass()) +< .withCompileOptions(compileOptions) +< .toCompileTo(''); +< +< expectTemplate('{{aMethod}}') +< .withInput(new TestClass()) +< .withCompileOptions(compileOptions) +< .toCompileTo(''); +< +< expect(spy.calledOnce).to.be.true(); +< expect(spy.args[0][0]).to.match(/Handlebars: Access has been denied/); +< }); +< +< it('can be allowed, which disables the warning', function() { +< var spy = sinon.spy(console, 'error'); +< +< expectTemplate('{{aMethod}}') +< .withInput(new TestClass()) +< .withCompileOptions(compileOptions) +< .withRuntimeOptions({ +< allowedProtoMethods: { +< aMethod: true +< } +< }) +< .toCompileTo('returnValue'); +< +< expect(spy.callCount).to.equal(0); +< }); +< +< it('can be turned on by default, which disables the warning', function() { +< var spy = sinon.spy(console, 'error'); +< +< expectTemplate('{{aMethod}}') +< .withInput(new TestClass()) +< .withCompileOptions(compileOptions) +< .withRuntimeOptions({ +< allowProtoMethodsByDefault: true +< }) +< .toCompileTo('returnValue'); +< +< expect(spy.callCount).to.equal(0); +< }); +< +< it('can be turned off by default, which disables the warning', function() { +< var spy = sinon.spy(console, 'error'); +< +< expectTemplate('{{aMethod}}') +< .withInput(new TestClass()) +< .withCompileOptions(compileOptions) +< .withRuntimeOptions({ +< allowProtoMethodsByDefault: false +< }) +< .toCompileTo(''); +< +< expect(spy.callCount).to.equal(0); +--- +> templates.forEach((template) => { +> describe('access should be denied to ' + template, () => { +> it('by default', () => { +> expectTemplate(template).withInput({}).toCompileTo(''); +259,399d115 +< +< it('can be turned off, if turned on by default', function() { +< expectTemplate('{{aMethod}}') +< .withInput(new TestClass()) +< .withCompileOptions(compileOptions) +< .withRuntimeOptions({ +< allowProtoMethodsByDefault: true, +< allowedProtoMethods: { +< aMethod: false +< } +< }) +< .toCompileTo(''); +< }); +< } +< +< it('should cause the recursive lookup by default (in "compat" mode)', function() { +< expectTemplate('{{#aString}}{{trim}}{{/aString}}') +< .withInput({ aString: ' abc ', trim: 'trim' }) +< .withCompileOptions({ compat: true }) +< .toCompileTo('trim'); +< }); +< +< it('should not cause the recursive lookup if allowed through options(in "compat" mode)', function() { +< expectTemplate('{{#aString}}{{trim}}{{/aString}}') +< .withInput({ aString: ' abc ', trim: 'trim' }) +< .withCompileOptions({ compat: true }) +< .withRuntimeOptions({ +< allowedProtoMethods: { +< trim: true +< } +< }) +< .toCompileTo('abc'); +< }); +< }); +< +< describe('control access to prototype non-methods via "allowedProtoProperties" and "allowProtoPropertiesByDefault', function() { +< checkProtoPropertyAccess({}); +< +< describe('in compat-mode', function() { +< checkProtoPropertyAccess({ compat: true }); +< }); +< +< describe('in strict-mode', function() { +< checkProtoPropertyAccess({ strict: true }); +< }); +< +< function checkProtoPropertyAccess(compileOptions) { +< it('should be prohibited by default and log a warning', function() { +< var spy = sinon.spy(console, 'error'); +< +< expectTemplate('{{aProperty}}') +< .withInput(new TestClass()) +< .withCompileOptions(compileOptions) +< .toCompileTo(''); +< +< expect(spy.calledOnce).to.be.true(); +< expect(spy.args[0][0]).to.match(/Handlebars: Access has been denied/); +< }); +< +< it('can be explicitly prohibited by default, which disables the warning', function() { +< var spy = sinon.spy(console, 'error'); +< +< expectTemplate('{{aProperty}}') +< .withInput(new TestClass()) +< .withCompileOptions(compileOptions) +< .withRuntimeOptions({ +< allowProtoPropertiesByDefault: false +< }) +< .toCompileTo(''); +< +< expect(spy.callCount).to.equal(0); +< }); +< +< it('can be turned on, which disables the warning', function() { +< var spy = sinon.spy(console, 'error'); +< +< expectTemplate('{{aProperty}}') +< .withInput(new TestClass()) +< .withCompileOptions(compileOptions) +< .withRuntimeOptions({ +< allowedProtoProperties: { +< aProperty: true +< } +< }) +< .toCompileTo('propertyValue'); +< +< expect(spy.callCount).to.equal(0); +< }); +< +< it('can be turned on by default, which disables the warning', function() { +< var spy = sinon.spy(console, 'error'); +< +< expectTemplate('{{aProperty}}') +< .withInput(new TestClass()) +< .withCompileOptions(compileOptions) +< .withRuntimeOptions({ +< allowProtoPropertiesByDefault: true +< }) +< .toCompileTo('propertyValue'); +< +< expect(spy.callCount).to.equal(0); +< }); +< +< it('can be turned off, if turned on by default', function() { +< expectTemplate('{{aProperty}}') +< .withInput(new TestClass()) +< .withCompileOptions(compileOptions) +< .withRuntimeOptions({ +< allowProtoPropertiesByDefault: true, +< allowedProtoProperties: { +< aProperty: false +< } +< }) +< .toCompileTo(''); +< }); +< } +< }); +< +< describe('compatibility with old runtimes, that do not provide the function "container.lookupProperty"', function() { +< beforeEach(function simulateRuntimeWithoutLookupProperty() { +< var oldTemplateMethod = handlebarsEnv.template; +< sinon.replace(handlebarsEnv, 'template', function(templateSpec) { +< templateSpec.main = wrapToAdjustContainer(templateSpec.main); +< return oldTemplateMethod.call(this, templateSpec); +< }); +< }); +< +< afterEach(function() { +< sinon.restore(); +< }); +< +< it('should work with simple properties', function() { +< expectTemplate('{{aProperty}}') +< .withInput({ aProperty: 'propertyValue' }) +< .toCompileTo('propertyValue'); +< }); +< +< it('should work with Array.prototype.length', function() { +< expectTemplate('{{anArray.length}}') +< .withInput({ anArray: ['a', 'b', 'c'] }) +< .toCompileTo('3'); +404,409c120,122 +< describe('escapes template variables', function() { +< it('in compat mode', function() { +< expectTemplate("{{'a\\b'}}") +< .withCompileOptions({ compat: true }) +< .withInput({ 'a\\b': 'c' }) +< .toCompileTo('c'); +--- +> describe('escapes template variables', () => { +> it('in default mode', () => { +> expectTemplate("{{'a\\b'}}").withCompileOptions().withInput({ 'a\\b': 'c' }).toCompileTo('c'); +412,418c125 +< it('in default mode', function() { +< expectTemplate("{{'a\\b'}}") +< .withCompileOptions() +< .withInput({ 'a\\b': 'c' }) +< .toCompileTo('c'); +< }); +< it('in default mode', function() { +--- +> it('in strict mode', () => { +426,432d132 +< +< function wrapToAdjustContainer(precompiledTemplateFunction) { +< return function templateFunctionWrapper(container /*, more args */) { +< delete container.lookupProperty; +< return precompiledTemplateFunction.apply(this, arguments); +< }; +< } diff --git a/packages/kbn-handlebars/.patches/strict.patch b/packages/kbn-handlebars/.patches/strict.patch new file mode 100644 index 0000000000000..be50113e1416d --- /dev/null +++ b/packages/kbn-handlebars/.patches/strict.patch @@ -0,0 +1,180 @@ +1,5c1,12 +< var Exception = Handlebars.Exception; +< +< describe('strict', function() { +< describe('strict mode', function() { +< it('should error on missing property lookup', function() { +--- +> /* +> * This file is forked from the handlebars project (https://github.com/handlebars-lang/handlebars.js), +> * and may include modifications made by Elasticsearch B.V. +> * Elasticsearch B.V. licenses this file to you under the MIT License. +> * See `packages/kbn-handlebars/LICENSE` for more information. +> */ +> +> import { expectTemplate } from '../__jest__/test_bench'; +> +> describe('strict', () => { +> describe('strict mode', () => { +> it('should error on missing property lookup', () => { +8c15 +< .toThrow(Exception, /"hello" not defined in/); +--- +> .toThrow(/"hello" not defined in/); +11c18 +< it('should error on missing child', function() { +--- +> it('should error on missing child', () => { +20c27 +< .toThrow(Exception, /"bar" not defined in/); +--- +> .toThrow(/"bar" not defined in/); +23c30 +< it('should handle explicit undefined', function() { +--- +> it('should handle explicit undefined', () => { +30c37 +< it('should error on missing property lookup in known helpers mode', function() { +--- +> it('should error on missing property lookup in known helpers mode', () => { +34c41 +< knownHelpersOnly: true +--- +> knownHelpersOnly: true, +36c43 +< .toThrow(Exception, /"hello" not defined in/); +--- +> .toThrow(/"hello" not defined in/); +39,42c46,47 +< it('should error on missing context', function() { +< expectTemplate('{{hello}}') +< .withCompileOptions({ strict: true }) +< .toThrow(Error); +--- +> it('should error on missing context', () => { +> expectTemplate('{{hello}}').withCompileOptions({ strict: true }).toThrow(Error); +45,47c50,52 +< it('should error on missing data lookup', function() { +< var xt = expectTemplate('{{@hello}}').withCompileOptions({ +< strict: true +--- +> it('should error on missing data lookup', () => { +> const xt = expectTemplate('{{@hello}}').withCompileOptions({ +> strict: true, +55c60 +< it('should not run helperMissing for helper calls', function() { +--- +> it('should not run helperMissing for helper calls', () => { +59c64 +< .toThrow(Exception, /"hello" not defined in/); +--- +> .toThrow(/"hello" not defined in/); +64c69 +< .toThrow(Exception, /"hello" not defined in/); +--- +> .toThrow(/"hello" not defined in/); +67c72 +< it('should throw on ambiguous blocks', function() { +--- +> it('should throw on ambiguous blocks', () => { +70c75 +< .toThrow(Exception, /"hello" not defined in/); +--- +> .toThrow(/"hello" not defined in/); +74c79 +< .toThrow(Exception, /"hello" not defined in/); +--- +> .toThrow(/"hello" not defined in/); +79c84 +< .toThrow(Exception, /"bar" not defined in/); +--- +> .toThrow(/"bar" not defined in/); +82c87 +< it('should allow undefined parameters when passed to helpers', function() { +--- +> it('should allow undefined parameters when passed to helpers', () => { +88c93 +< it('should allow undefined hash when passed to helpers', function() { +--- +> it('should allow undefined hash when passed to helpers', () => { +91c96 +< strict: true +--- +> strict: true, +94,96c99,101 +< helper: function(options) { +< equals('value' in options.hash, true); +< equals(options.hash.value, undefined); +--- +> helper(options) { +> expect('value' in options.hash).toEqual(true); +> expect(options.hash.value).toBeUndefined(); +98c103 +< } +--- +> }, +103c108 +< it('should show error location on missing property lookup', function() { +--- +> it('should show error location on missing property lookup', () => { +106c111 +< .toThrow(Exception, '"hello" not defined in [object Object] - 4:5'); +--- +> .toThrow('"hello" not defined in [object Object] - 4:5'); +109c114 +< it('should error contains correct location properties on missing property lookup', function() { +--- +> it('should error contains correct location properties on missing property lookup', () => { +111,114c116,118 +< var template = CompilerContext.compile('\n\n\n {{hello}}', { +< strict: true +< }); +< template({}); +--- +> expectTemplate('\n\n\n {{hello}}') +> .withCompileOptions({ strict: true }) +> .toCompileTo('throw before asserting this'); +116,119c120,123 +< equals(error.lineNumber, 4); +< equals(error.endLineNumber, 4); +< equals(error.column, 5); +< equals(error.endColumn, 10); +--- +> expect(error.lineNumber).toEqual(4); +> expect(error.endLineNumber).toEqual(4); +> expect(error.column).toEqual(5); +> expect(error.endColumn).toEqual(10); +124,128c128,130 +< describe('assume objects', function() { +< it('should ignore missing property', function() { +< expectTemplate('{{hello}}') +< .withCompileOptions({ assumeObjects: true }) +< .toCompileTo(''); +--- +> describe('assume objects', () => { +> it('should ignore missing property', () => { +> expectTemplate('{{hello}}').withCompileOptions({ assumeObjects: true }).toCompileTo(''); +131c133 +< it('should ignore missing child', function() { +--- +> it('should ignore missing child', () => { +138,141c140,141 +< it('should error on missing object', function() { +< expectTemplate('{{hello.bar}}') +< .withCompileOptions({ assumeObjects: true }) +< .toThrow(Error); +--- +> it('should error on missing object', () => { +> expectTemplate('{{hello.bar}}').withCompileOptions({ assumeObjects: true }).toThrow(Error); +144c144 +< it('should error on missing context', function() { +--- +> it('should error on missing context', () => { +151c151 +< it('should error on missing data lookup', function() { +--- +> it('should error on missing data lookup', () => { +158c158 +< it('should execute blockHelperMissing', function() { +--- +> it('should execute blockHelperMissing', () => { diff --git a/packages/kbn-handlebars/.patches/subexpressions.patch b/packages/kbn-handlebars/.patches/subexpressions.patch new file mode 100644 index 0000000000000..bc29db240f3c1 --- /dev/null +++ b/packages/kbn-handlebars/.patches/subexpressions.patch @@ -0,0 +1,318 @@ +1,2c1,12 +< describe('subexpressions', function() { +< it('arg-less helper', function() { +--- +> /* +> * This file is forked from the handlebars project (https://github.com/handlebars-lang/handlebars.js), +> * and may include modifications made by Elasticsearch B.V. +> * Elasticsearch B.V. licenses this file to you under the MIT License. +> * See `packages/kbn-handlebars/LICENSE` for more information. +> */ +> +> import Handlebars from '..'; +> import { expectTemplate } from '../__jest__/test_bench'; +> +> describe('subexpressions', () => { +> it('arg-less helper', () => { +5c15 +< foo: function(val) { +--- +> foo(val) { +8c18 +< bar: function() { +--- +> bar() { +10c20 +< } +--- +> }, +15c25 +< it('helper w args', function() { +--- +> it('helper w args', () => { +19c29 +< blog: function(val) { +--- +> blog(val) { +22c32 +< equal: function(x, y) { +--- +> equal(x, y) { +24c34 +< } +--- +> }, +29c39 +< it('mixed paths and helpers', function() { +--- +> it('mixed paths and helpers', () => { +33c43 +< blog: function(val, that, theOther) { +--- +> blog(val, that, theOther) { +36c46 +< equal: function(x, y) { +--- +> equal(x, y) { +38c48 +< } +--- +> }, +43c53 +< it('supports much nesting', function() { +--- +> it('supports much nesting', () => { +47c57 +< blog: function(val) { +--- +> blog(val) { +50c60 +< equal: function(x, y) { +--- +> equal(x, y) { +52c62 +< } +--- +> }, +57,60c67,70 +< it('GH-800 : Complex subexpressions', function() { +< var context = { a: 'a', b: 'b', c: { c: 'c' }, d: 'd', e: { e: 'e' } }; +< var helpers = { +< dash: function(a, b) { +--- +> it('GH-800 : Complex subexpressions', () => { +> const context = { a: 'a', b: 'b', c: { c: 'c' }, d: 'd', e: { e: 'e' } }; +> const helpers = { +> dash(a: any, b: any) { +63c73 +< concat: function(a, b) { +--- +> concat(a: any, b: any) { +65c75 +< } +--- +> }, +94,97c104,107 +< it('provides each nested helper invocation its own options hash', function() { +< var lastOptions = null; +< var helpers = { +< equal: function(x, y, options) { +--- +> it('provides each nested helper invocation its own options hash', () => { +> let lastOptions: Handlebars.HelperOptions; +> const helpers = { +> equal(x: any, y: any, options: Handlebars.HelperOptions) { +103c113 +< } +--- +> }, +105,107c115 +< expectTemplate('{{equal (equal true true) true}}') +< .withHelpers(helpers) +< .toCompileTo('true'); +--- +> expectTemplate('{{equal (equal true true) true}}').withHelpers(helpers).toCompileTo('true'); +110c118 +< it('with hashes', function() { +--- +> it('with hashes', () => { +114c122 +< blog: function(val) { +--- +> blog(val) { +117c125 +< equal: function(x, y) { +--- +> equal(x, y) { +119c127 +< } +--- +> }, +124c132 +< it('as hashes', function() { +--- +> it('as hashes', () => { +127c135 +< blog: function(options) { +--- +> blog(options) { +130c138 +< equal: function(x, y) { +--- +> equal(x, y) { +132c140 +< } +--- +> }, +137,140c145,146 +< it('multiple subexpressions in a hash', function() { +< expectTemplate( +< '{{input aria-label=(t "Name") placeholder=(t "Example User")}}' +< ) +--- +> it('multiple subexpressions in a hash', () => { +> expectTemplate('{{input aria-label=(t "Name") placeholder=(t "Example User")}}') +142,145c148,151 +< input: function(options) { +< var hash = options.hash; +< var ariaLabel = Handlebars.Utils.escapeExpression(hash['aria-label']); +< var placeholder = Handlebars.Utils.escapeExpression(hash.placeholder); +--- +> input(options) { +> const hash = options.hash; +> const ariaLabel = Handlebars.Utils.escapeExpression(hash['aria-label']); +> const placeholder = Handlebars.Utils.escapeExpression(hash.placeholder); +147,151c153 +< '' +--- +> '' +154c156 +< t: function(defaultString) { +--- +> t(defaultString) { +156c158 +< } +--- +> }, +161,164c163,164 +< it('multiple subexpressions in a hash with context', function() { +< expectTemplate( +< '{{input aria-label=(t item.field) placeholder=(t item.placeholder)}}' +< ) +--- +> it('multiple subexpressions in a hash with context', () => { +> expectTemplate('{{input aria-label=(t item.field) placeholder=(t item.placeholder)}}') +168,169c168,169 +< placeholder: 'Example User' +< } +--- +> placeholder: 'Example User', +> }, +172,175c172,175 +< input: function(options) { +< var hash = options.hash; +< var ariaLabel = Handlebars.Utils.escapeExpression(hash['aria-label']); +< var placeholder = Handlebars.Utils.escapeExpression(hash.placeholder); +--- +> input(options) { +> const hash = options.hash; +> const ariaLabel = Handlebars.Utils.escapeExpression(hash['aria-label']); +> const placeholder = Handlebars.Utils.escapeExpression(hash.placeholder); +177,181c177 +< '' +--- +> '' +184c180 +< t: function(defaultString) { +--- +> t(defaultString) { +186,212d181 +< } +< }) +< .toCompileTo(''); +< }); +< +< it('in string params mode,', function() { +< expectTemplate('{{snog (blorg foo x=y) yeah a=b}}') +< .withCompileOptions({ stringParams: true }) +< .withHelpers({ +< snog: function(a, b, options) { +< equals(a, 'foo'); +< equals( +< options.types.length, +< 2, +< 'string params for outer helper processed correctly' +< ); +< equals( +< options.types[0], +< 'SubExpression', +< 'string params for outer helper processed correctly' +< ); +< equals( +< options.types[1], +< 'PathExpression', +< 'string params for outer helper processed correctly' +< ); +< return a + b; +214,231d182 +< +< blorg: function(a, options) { +< equals( +< options.types.length, +< 1, +< 'string params for inner helper processed correctly' +< ); +< equals( +< options.types[0], +< 'PathExpression', +< 'string params for inner helper processed correctly' +< ); +< return a; +< } +< }) +< .withInput({ +< foo: {}, +< yeah: {} +233,248c184 +< .toCompileTo('fooyeah'); +< }); +< +< it('as hashes in string params mode', function() { +< expectTemplate('{{blog fun=(bork)}}') +< .withCompileOptions({ stringParams: true }) +< .withHelpers({ +< blog: function(options) { +< equals(options.hashTypes.fun, 'SubExpression'); +< return 'val is ' + options.hash.fun; +< }, +< bork: function() { +< return 'BORK'; +< } +< }) +< .toCompileTo('val is BORK'); +--- +> .toCompileTo(''); +251c187 +< it('subexpression functions on the context', function() { +--- +> it('subexpression functions on the context', () => { +254c190 +< bar: function() { +--- +> bar() { +256c192 +< } +--- +> }, +259c195 +< foo: function(val) { +--- +> foo(val) { +261c197 +< } +--- +> }, +266c202 +< it("subexpressions can't just be property lookups", function() { +--- +> it("subexpressions can't just be property lookups", () => { +269c205 +< bar: 'LOL' +--- +> bar: 'LOL', +272c208 +< foo: function(val) { +--- +> foo(val) { +274c210 +< } +--- +> }, diff --git a/packages/kbn-handlebars/.patches/utils.patch b/packages/kbn-handlebars/.patches/utils.patch new file mode 100644 index 0000000000000..485d69652544c --- /dev/null +++ b/packages/kbn-handlebars/.patches/utils.patch @@ -0,0 +1,109 @@ +1,86c1,21 +< describe('utils', function() { +< describe('#SafeString', function() { +< it('constructing a safestring from a string and checking its type', function() { +< var safe = new Handlebars.SafeString('testing 1, 2, 3'); +< if (!(safe instanceof Handlebars.SafeString)) { +< throw new Error('Must be instance of SafeString'); +< } +< equals( +< safe.toString(), +< 'testing 1, 2, 3', +< 'SafeString is equivalent to its underlying string' +< ); +< }); +< +< it('it should not escape SafeString properties', function() { +< var name = new Handlebars.SafeString('Sean O'Malley'); +< +< expectTemplate('{{name}}') +< .withInput({ name: name }) +< .toCompileTo('Sean O'Malley'); +< }); +< }); +< +< describe('#escapeExpression', function() { +< it('shouhld escape html', function() { +< equals( +< Handlebars.Utils.escapeExpression('foo<&"\'>'), +< 'foo<&"'>' +< ); +< equals(Handlebars.Utils.escapeExpression('foo='), 'foo='); +< }); +< it('should not escape SafeString', function() { +< var string = new Handlebars.SafeString('foo<&"\'>'); +< equals(Handlebars.Utils.escapeExpression(string), 'foo<&"\'>'); +< +< var obj = { +< toHTML: function() { +< return 'foo<&"\'>'; +< } +< }; +< equals(Handlebars.Utils.escapeExpression(obj), 'foo<&"\'>'); +< }); +< it('should handle falsy', function() { +< equals(Handlebars.Utils.escapeExpression(''), ''); +< equals(Handlebars.Utils.escapeExpression(undefined), ''); +< equals(Handlebars.Utils.escapeExpression(null), ''); +< +< equals(Handlebars.Utils.escapeExpression(false), 'false'); +< equals(Handlebars.Utils.escapeExpression(0), '0'); +< }); +< it('should handle empty objects', function() { +< equals(Handlebars.Utils.escapeExpression({}), {}.toString()); +< equals(Handlebars.Utils.escapeExpression([]), [].toString()); +< }); +< }); +< +< describe('#isEmpty', function() { +< it('should not be empty', function() { +< equals(Handlebars.Utils.isEmpty(undefined), true); +< equals(Handlebars.Utils.isEmpty(null), true); +< equals(Handlebars.Utils.isEmpty(false), true); +< equals(Handlebars.Utils.isEmpty(''), true); +< equals(Handlebars.Utils.isEmpty([]), true); +< }); +< +< it('should be empty', function() { +< equals(Handlebars.Utils.isEmpty(0), false); +< equals(Handlebars.Utils.isEmpty([1]), false); +< equals(Handlebars.Utils.isEmpty('foo'), false); +< equals(Handlebars.Utils.isEmpty({ bar: 1 }), false); +< }); +< }); +< +< describe('#extend', function() { +< it('should ignore prototype values', function() { +< function A() { +< this.a = 1; +< } +< A.prototype.b = 4; +< +< var b = { b: 2 }; +< +< Handlebars.Utils.extend(b, new A()); +< +< equals(b.a, 1); +< equals(b.b, 2); +--- +> /* +> * This file is forked from the handlebars project (https://github.com/handlebars-lang/handlebars.js), +> * and may include modifications made by Elasticsearch B.V. +> * Elasticsearch B.V. licenses this file to you under the MIT License. +> * See `packages/kbn-handlebars/LICENSE` for more information. +> */ +> +> import Handlebars from '..'; +> import { expectTemplate } from '../__jest__/test_bench'; +> +> describe('utils', function () { +> describe('#SafeString', function () { +> it('constructing a safestring from a string and checking its type', function () { +> const safe = new Handlebars.SafeString('testing 1, 2, 3'); +> expect(safe).toBeInstanceOf(Handlebars.SafeString); +> expect(safe.toString()).toEqual('testing 1, 2, 3'); +> }); +> +> it('it should not escape SafeString properties', function () { +> const name = new Handlebars.SafeString('Sean O'Malley'); +> expectTemplate('{{name}}').withInput({ name }).toCompileTo('Sean O'Malley'); diff --git a/packages/kbn-handlebars/.patches/whitespace-control.patch b/packages/kbn-handlebars/.patches/whitespace-control.patch new file mode 100644 index 0000000000000..f9e32bc2260ca --- /dev/null +++ b/packages/kbn-handlebars/.patches/whitespace-control.patch @@ -0,0 +1,187 @@ +1,24c1,17 +< describe('whitespace control', function() { +< it('should strip whitespace around mustache calls', function() { +< var hash = { foo: 'bar<' }; +< +< expectTemplate(' {{~foo~}} ') +< .withInput(hash) +< .toCompileTo('bar<'); +< +< expectTemplate(' {{~foo}} ') +< .withInput(hash) +< .toCompileTo('bar< '); +< +< expectTemplate(' {{foo~}} ') +< .withInput(hash) +< .toCompileTo(' bar<'); +< +< expectTemplate(' {{~&foo~}} ') +< .withInput(hash) +< .toCompileTo('bar<'); +< +< expectTemplate(' {{~{foo}~}} ') +< .withInput(hash) +< .toCompileTo('bar<'); +< +--- +> /* +> * This file is forked from the handlebars project (https://github.com/handlebars-lang/handlebars.js), +> * and may include modifications made by Elasticsearch B.V. +> * Elasticsearch B.V. licenses this file to you under the MIT License. +> * See `packages/kbn-handlebars/LICENSE` for more information. +> */ +> +> import { expectTemplate } from '../__jest__/test_bench'; +> +> describe('whitespace control', () => { +> it('should strip whitespace around mustache calls', () => { +> const hash = { foo: 'bar<' }; +> expectTemplate(' {{~foo~}} ').withInput(hash).toCompileTo('bar<'); +> expectTemplate(' {{~foo}} ').withInput(hash).toCompileTo('bar< '); +> expectTemplate(' {{foo~}} ').withInput(hash).toCompileTo(' bar<'); +> expectTemplate(' {{~&foo~}} ').withInput(hash).toCompileTo('bar<'); +> expectTemplate(' {{~{foo}~}} ').withInput(hash).toCompileTo('bar<'); +28,46c21,28 +< describe('blocks', function() { +< it('should strip whitespace around simple block calls', function() { +< var hash = { foo: 'bar<' }; +< +< expectTemplate(' {{~#if foo~}} bar {{~/if~}} ') +< .withInput(hash) +< .toCompileTo('bar'); +< +< expectTemplate(' {{#if foo~}} bar {{/if~}} ') +< .withInput(hash) +< .toCompileTo(' bar '); +< +< expectTemplate(' {{~#if foo}} bar {{~/if}} ') +< .withInput(hash) +< .toCompileTo(' bar '); +< +< expectTemplate(' {{#if foo}} bar {{/if}} ') +< .withInput(hash) +< .toCompileTo(' bar '); +--- +> describe('blocks', () => { +> it('should strip whitespace around simple block calls', () => { +> const hash = { foo: 'bar<' }; +> +> expectTemplate(' {{~#if foo~}} bar {{~/if~}} ').withInput(hash).toCompileTo('bar'); +> expectTemplate(' {{#if foo~}} bar {{/if~}} ').withInput(hash).toCompileTo(' bar '); +> expectTemplate(' {{~#if foo}} bar {{~/if}} ').withInput(hash).toCompileTo(' bar '); +> expectTemplate(' {{#if foo}} bar {{/if}} ').withInput(hash).toCompileTo(' bar '); +57c39 +< it('should strip whitespace around inverse block calls', function() { +--- +> it('should strip whitespace around inverse block calls', () => { +59d40 +< +61d41 +< +63d42 +< +65,68c44 +< +< expectTemplate( +< ' \n\n{{~^if foo~}} \n\nbar \n\n{{~/if~}}\n\n ' +< ).toCompileTo('bar'); +--- +> expectTemplate(' \n\n{{~^if foo~}} \n\nbar \n\n{{~/if~}}\n\n ').toCompileTo('bar'); +71,80c47,48 +< it('should strip whitespace around complex block calls', function() { +< var hash = { foo: 'bar<' }; +< +< expectTemplate('{{#if foo~}} bar {{~^~}} baz {{~/if}}') +< .withInput(hash) +< .toCompileTo('bar'); +< +< expectTemplate('{{#if foo~}} bar {{^~}} baz {{/if}}') +< .withInput(hash) +< .toCompileTo('bar '); +--- +> it('should strip whitespace around complex block calls', () => { +> const hash = { foo: 'bar<' }; +82,84c50,54 +< expectTemplate('{{#if foo}} bar {{~^~}} baz {{~/if}}') +< .withInput(hash) +< .toCompileTo(' bar'); +--- +> expectTemplate('{{#if foo~}} bar {{~^~}} baz {{~/if}}').withInput(hash).toCompileTo('bar'); +> expectTemplate('{{#if foo~}} bar {{^~}} baz {{/if}}').withInput(hash).toCompileTo('bar '); +> expectTemplate('{{#if foo}} bar {{~^~}} baz {{~/if}}').withInput(hash).toCompileTo(' bar'); +> expectTemplate('{{#if foo}} bar {{^~}} baz {{/if}}').withInput(hash).toCompileTo(' bar '); +> expectTemplate('{{#if foo~}} bar {{~else~}} baz {{~/if}}').withInput(hash).toCompileTo('bar'); +86,90c56 +< expectTemplate('{{#if foo}} bar {{^~}} baz {{/if}}') +< .withInput(hash) +< .toCompileTo(' bar '); +< +< expectTemplate('{{#if foo~}} bar {{~else~}} baz {{~/if}}') +--- +> expectTemplate('\n\n{{~#if foo~}} \n\nbar \n\n{{~^~}} \n\nbaz \n\n{{~/if~}}\n\n') +94,102c60 +< expectTemplate( +< '\n\n{{~#if foo~}} \n\nbar \n\n{{~^~}} \n\nbaz \n\n{{~/if~}}\n\n' +< ) +< .withInput(hash) +< .toCompileTo('bar'); +< +< expectTemplate( +< '\n\n{{~#if foo~}} \n\n{{{foo}}} \n\n{{~^~}} \n\nbaz \n\n{{~/if~}}\n\n' +< ) +--- +> expectTemplate('\n\n{{~#if foo~}} \n\n{{{foo}}} \n\n{{~^~}} \n\nbaz \n\n{{~/if~}}\n\n') +106,109c64 +< expectTemplate('{{#if foo~}} bar {{~^~}} baz {{~/if}}').toCompileTo( +< 'baz' +< ); +< +--- +> expectTemplate('{{#if foo~}} bar {{~^~}} baz {{~/if}}').toCompileTo('baz'); +111,120c66,69 +< +< expectTemplate('{{#if foo~}} bar {{~^}} baz {{~/if}}').toCompileTo( +< ' baz' +< ); +< +< expectTemplate('{{#if foo~}} bar {{~^}} baz {{/if}}').toCompileTo( +< ' baz ' +< ); +< +< expectTemplate('{{#if foo~}} bar {{~else~}} baz {{~/if}}').toCompileTo( +--- +> expectTemplate('{{#if foo~}} bar {{~^}} baz {{~/if}}').toCompileTo(' baz'); +> expectTemplate('{{#if foo~}} bar {{~^}} baz {{/if}}').toCompileTo(' baz '); +> expectTemplate('{{#if foo~}} bar {{~else~}} baz {{~/if}}').toCompileTo('baz'); +> expectTemplate('\n\n{{~#if foo~}} \n\nbar \n\n{{~^~}} \n\nbaz \n\n{{~/if~}}\n\n').toCompileTo( +123,126d71 +< +< expectTemplate( +< '\n\n{{~#if foo~}} \n\nbar \n\n{{~^~}} \n\nbaz \n\n{{~/if~}}\n\n' +< ).toCompileTo('baz'); +130,152c75 +< it('should strip whitespace around partials', function() { +< expectTemplate('foo {{~> dude~}} ') +< .withPartials({ dude: 'bar' }) +< .toCompileTo('foobar'); +< +< expectTemplate('foo {{> dude~}} ') +< .withPartials({ dude: 'bar' }) +< .toCompileTo('foo bar'); +< +< expectTemplate('foo {{> dude}} ') +< .withPartials({ dude: 'bar' }) +< .toCompileTo('foo bar '); +< +< expectTemplate('foo\n {{~> dude}} ') +< .withPartials({ dude: 'bar' }) +< .toCompileTo('foobar'); +< +< expectTemplate('foo\n {{> dude}} ') +< .withPartials({ dude: 'bar' }) +< .toCompileTo('foo\n bar'); +< }); +< +< it('should only strip whitespace once', function() { +--- +> it('should only strip whitespace once', () => { diff --git a/packages/kbn-handlebars/BUILD.bazel b/packages/kbn-handlebars/BUILD.bazel new file mode 100644 index 0000000000000..362c153fb90af --- /dev/null +++ b/packages/kbn-handlebars/BUILD.bazel @@ -0,0 +1,115 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_BASE_NAME = "kbn-handlebars" +PKG_REQUIRE_NAME = "@kbn/handlebars" +TYPES_PKG_REQUIRE_NAME = "@types/kbn__handlebars" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + ], + exclude = [ + "**/*.test.*", + "**/__jest__/**", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", + "README.md", +] + +RUNTIME_DEPS = [ + "@npm//handlebars", +] + +TYPES_DEPS = [ + "@npm//@types/jest", + "@npm//@types/node", + "@npm//handlebars", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + web = True, +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + declaration_map = True, + emit_declaration_only = True, + out_dir = "target_types", + source_map = True, + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_BASE_NAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [ + ":%s" % PKG_BASE_NAME, + ] +) + +filegroup( + name = "build", + srcs = [ + ":npm_module", + ], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = TYPES_PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [ + ":npm_module_types", + ], + visibility = ["//visibility:public"], +) diff --git a/packages/kbn-handlebars/LICENSE b/packages/kbn-handlebars/LICENSE new file mode 100644 index 0000000000000..55b4f257a1e98 --- /dev/null +++ b/packages/kbn-handlebars/LICENSE @@ -0,0 +1,29 @@ +The MIT License (MIT) + +Copyright (c) Elasticsearch BV +Copyright (c) Copyright (C) 2011-2019 by Yehuda Katz + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at the following locations: + - https://github.com/handlebars-lang/handlebars.js + - https://github.com/elastic/kibana/tree/main/packages/kbn-handlebars + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/kbn-handlebars/README.md b/packages/kbn-handlebars/README.md new file mode 100644 index 0000000000000..e9a6a8c839fd9 --- /dev/null +++ b/packages/kbn-handlebars/README.md @@ -0,0 +1,192 @@ +# @kbn/handlebars + +A custom version of the handlebars package which, to improve security, does not use `eval` or `new Function`. This means that templates can't be compiled into JavaScript functions in advance and hence, rendering the templates is a lot slower. + +## Limitations + +- Only the following compile options are supported: + - `knownHelpers` + - `knownHelpersOnly` + - `strict` + - `assumeObjects` + - `noEscape` + - `data` + +- Only the following runtime options are supported: + - `helpers` + - `blockParams` + - `data` + +The [Inline partials](https://handlebarsjs.com/guide/partials.html#inline-partials) handlebars template feature is currently not supported by `@kbn/handlebars`. + +## Implementation differences + +The standard `handlebars` implementation: + +1. When given a template string, e.g. `Hello {{x}}`, return a "render" function which takes an "input" object, e.g. `{ x: 'World' }`. +1. The first time the "render" function is called the following happens: + 1. Turn the template string into an Abstract Syntax Tree (AST). + 1. Convert the AST into a hyper optimized JavaScript function which takes the input object as an argument. + 1. Call the generate JavaScript function with the given "input" object to produce and return the final output string (`Hello World`). +1. Subsequent calls to the "render" function will re-use the already generated JavaScript function. + +The custom `@kbn/handlebars` implementation: + +1. When given a template string, e.g. `Hello {{x}}`, return a "render" function which takes an "input" object, e.g. `{ x: 'World' }`. +1. The first time the "render" function is called the following happens: + 1. Turn the template string into an Abstract Syntax Tree (AST). + 1. Process the AST with the given "input" object to produce and return the final output string (`Hello World`). +1. Subsequent calls to the "render" function will re-use the already generated AST. + +_Note: Not parsing of the template string until the first call to the "render" function is deliberate as it mimics the original `handlebars` implementation. This means that any errors that occur due to an invalid template string will not be thrown until the first call to the "render" function._ + +## Technical details + +The `handlebars` library exposes the API for both [generating the AST](https://github.com/handlebars-lang/handlebars.js/blob/master/docs/compiler-api.md#ast) and walking it by implementing the [Visitor API](https://github.com/handlebars-lang/handlebars.js/blob/master/docs/compiler-api.md#ast-visitor). We can leverage that to our advantage and create our own "render" function, which internally calls this API to generate the AST and then the API to walk the AST. + +The `@kbn/handlebars` implementation of the `Visitor` class implements all the necessary methods called by the parent `Visitor` code when instructed to walk the AST. They all start with an upppercase letter, e.g. `MustacheStatement` or `SubExpression`. We call this class `ElasticHandlebarsVisitor`. + +To parse the template string to an AST representation, we call `Handlebars.parse(templateString)`, which returns an AST object. + +The AST object contains a bunch of nodes, one for each element of the template string, all arranged in a tree-like structure. The root of the AST object is a node of type `Program`. This is a special node, which we do not need to worry about, but each of its direct children has a type named like the method which will be called when the walking algorithm reaches that node, e.g. `ContentStatement` or `BlockStatement`. These are the methods that our `Visitor` implementation implements. + +To instruct our `ElasticHandlebarsVisitor` class to start walking the AST object, we call the `accept()` method inherited from the parent `Visitor` class with the main AST object. The `Visitor` will walk each node in turn that is directly attached to the root `Program` node. For each node it traverses, it will call the matching method in our `ElasticHandlebarsVisitor` class. + +To instruct the `Visitor` code to traverse any child nodes of a given node, our implementation needs to manually call `accept(childNode)`, `acceptArray(arrayOfChildNodes)`, `acceptKey(node, childKeyName)`, or `acceptRequired(node, childKeyName)` from within any of the "node" methods, otherwise the child nodes are ignored. + +### State + +We keep state internally in the `ElasticHandlebarsVisitor` object using the following private properties: + +- `scopes`: An array (stack) of `context` objects. In a simple template this array will always only contain a single element: The main `context` object. In more complicated scenarios, new `context` objects will be pushed and popped to and from the `scopes` stack as needed. +- `output`: An array containing the "rendered" output of each node (normally just one element per node). In the most simple template, this is simply joined together into a the final output string after the AST has been traversed. In more complicated templates, we use this array temporarily to collect parameters to give to helper functions (see the `getParams` function). + +## Development + +Some of the tests have been copied from the upstream `handlebars` project and modified to fit our use-case, test-suite, and coding conventions. They are all located under the `packages/kbn-handlebars/src/upstream` directory. To check if any of the copied files have received updates upstream that we might want to include in our copies, you can run the following script: + +```sh +./packages/kbn-handlebars/scripts/check_for_test_changes.sh +``` + +If the script outputs a diff for a given file, it means that this file has been updated. + +Once all updates have been manually merged with our versions of the files, run the following script to "lock" us into the new updates: + +```sh +./packages/kbn-handlebars/scripts/update_test_patches.sh +``` + +This will update the `.patch` files inside the `packages/kbn-handlebars/.patches` directory. Make sure to commit those changes. + +_Note: If we manually make changes to our test files in the `upstream` directory, we need to run the `update_test_patches.sh` script as well._ + +## Debugging + +### Print AST + +To output the generated AST object structure in a somewhat readable form, use the following script: + +```sh +./packages/kbn-handlebars/scripts/print_ast.js +``` + +Example: + +```sh +./packages/kbn-handlebars/scripts/print_ast.js '{{value}}' +``` + +Output: + +```js +{ + type: 'Program', + body: [ + { + type: 'MustacheStatement', + path: { + type: 'PathExpression', + data: false, + depth: 0, + parts: [ 'value' ], + original: 'value' + }, + params: [], + hash: undefined, + escaped: true, + strip: { open: false, close: false } + } + ], + strip: {} +} +``` + +You can also filter which properties not to display, e.g: + +```sh +./packages/kbn-handlebars/scripts/print_ast.js '{{#myBlock}}Hello {{name}}{{/myBlock}}' params,hash,loc,strip,data,depth,parts,inverse,openStrip,inverseStrip,closeStrip,blockParams,escaped +``` + +Output: + +```js +{ + type: 'Program', + body: [ + { + type: 'BlockStatement', + path: { type: 'PathExpression', original: 'myBlock' }, + program: { + type: 'Program', + body: [ + { + type: 'ContentStatement', + original: 'Hello ', + value: 'Hello ' + }, + { + type: 'MustacheStatement', + path: { type: 'PathExpression', original: 'name' } + } + ] + } + } + ] +} +``` + +### Environment variables + +By default each test will run both the original `handlebars` code and the modified `@kbn/handlebars` code to compare if the output of the two are identical. When debugging, it can be beneficial to isolate a test run to just one or the other. To control this, you can use the following environment variables: + +- `EVAL=1` - Set to only run the original `handlebars` implementation that uses `eval`. +- `AST=1` - Set to only run the modified `@kbn/handlebars` implementation that doesn't use `eval`. + +### Print generated code + +It's possible to see the generated JavaScript code that `handlebars` create for a given template using the following command line tool: + +```sh +./node_modules/handlebars/print-script