diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index fc9c55e7868f4..d1cf0300b9e17 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -17,6 +17,7 @@
/src/plugins/input_control_vis/ @elastic/kibana-app
/src/plugins/management/ @elastic/kibana-app
/src/plugins/kibana_legacy/ @elastic/kibana-app
+/src/plugins/timelion/ @elastic/kibana-app
/src/plugins/vis_default_editor/ @elastic/kibana-app
/src/plugins/vis_type_markdown/ @elastic/kibana-app
/src/plugins/vis_type_metric/ @elastic/kibana-app
@@ -30,32 +31,23 @@
/src/plugins/visualize/ @elastic/kibana-app
/src/plugins/visualizations/ @elastic/kibana-app
#CC# /src/legacy/core_plugins/kibana/public/local_application_service/ @elastic/kibana-app
-#CC# /src/plugins/vis_type @elastic/kibana-app
#CC# /src/legacy/core_plugins/kibana/ @elastic/kibana-app
#CC# /src/legacy/core_plugins/kibana/common/utils @elastic/kibana-app
#CC# /src/legacy/core_plugins/kibana/migrations @elastic/kibana-app
#CC# /src/legacy/core_plugins/kibana/public @elastic/kibana-app
#CC# /src/legacy/core_plugins/kibana/public/dashboard/ @elastic/kibana-app
-#CC# /src/legacy/core_plugins/kibana/public/dev_tools/ @elastic/kibana-app
#CC# /src/legacy/core_plugins/kibana/public/discover/ @elastic/kibana-app
#CC# /src/legacy/core_plugins/kibana/public/local_application_service/ @elastic/kibana-app
-#CC# /src/legacy/core_plugins/console_legacy @elastic/kibana-app
#CC# /src/legacy/core_plugins/input_control_vis @elastic/kibana-app
#CC# /src/legacy/core_plugins/timelion @elastic/kibana-app
#CC# /src/legacy/core_plugins/vis_type_tagcloud @elastic/kibana-app
#CC# /src/legacy/core_plugins/vis_type_vega @elastic/kibana-app
#CC# /src/legacy/core_plugins/vis_type_vislib/ @elastic/kibana-app
-#CC# /src/legacy/server/sample_data/ @elastic/kibana-app
#CC# /src/legacy/server/url_shortening/ @elastic/kibana-app
#CC# /src/legacy/ui/public/state_management @elastic/kibana-app
-#CC# /src/plugins/charts/public/static/color_maps @elastic/kibana-app
#CC# /src/plugins/index_pattern_management/public @elastic/kibana-app
-#CC# /src/plugins/input_control_vis/ @elastic/kibana-app
-#CC# /src/plugins/kibana_legacy/ @elastic/kibana-app
-#CC# /src/plugins/timelion @elastic/kibana-app
#CC# /x-pack/legacy/plugins/dashboard_mode/ @elastic/kibana-app
#CC# /x-pack/plugins/dashboard_mode @elastic/kibana-app
-#CC# /x-pack/plugins/lens/ @elastic/kibana-app
# App Architecture
/examples/bfetch_explorer/ @elastic/kibana-app-arch
@@ -147,6 +139,7 @@
/src/plugins/home/server/services/ @elastic/kibana-core-ui
/x-pack/plugins/global_search_bar/ @elastic/kibana-core-ui
#CC# /src/legacy/core_plugins/newsfeed @elastic/kibana-core-ui
+#CC# /src/legacy/server/sample_data/ @elastic/kibana-core-ui
#CC# /src/plugins/newsfeed @elastic/kibana-core-ui
#CC# /src/plugins/home/public @elastic/kibana-core-ui
#CC# /src/plugins/home/server/services/ @elastic/kibana-core-ui
@@ -351,6 +344,8 @@ x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @elastic/kib
/x-pack/plugins/ingest_pipelines/ @elastic/es-ui
/packages/kbn-ace/ @elastic/es-ui
/packages/kbn-monaco/ @elastic/es-ui
+#CC# /src/legacy/core_plugins/kibana/public/dev_tools/ @elastic/es-ui
+#CC# /src/legacy/core_plugins/console_legacy @elastic/es-ui
#CC# /x-pack/legacy/plugins/rollup/ @elastic/es-ui
#CC# /x-pack/legacy/server/lib/create_router/ @elastic/es-ui
#CC# /x-pack/legacy/server/lib/check_license/ @elastic/es-ui
diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc
index ed58e77427d47..67b7aa8e6a011 100644
--- a/docs/developer/plugin-list.asciidoc
+++ b/docs/developer/plugin-list.asciidoc
@@ -16,7 +16,7 @@ NOTE:
[discrete]
=== src/plugins
-[%header,cols=2*]
+[%header,cols=2*]
|===
|Name
|Description
@@ -168,7 +168,7 @@ It also provides a stateful version of it on the start contract.
|{kib-repo}blob/{branch}/src/plugins/telemetry_management_section/README.md[telemetryManagementSection]
-|This plugin adds the Advanced Settings section for the Usage Data collection (aka Telemetry).
+|This plugin adds the Advanced Settings section for the Usage and Security Data collection (aka Telemetry).
|{kib-repo}blob/{branch}/src/plugins/tile_map[tileMap]
@@ -259,7 +259,7 @@ which will load the visualization's editor.
[discrete]
=== x-pack/plugins
-[%header,cols=2*]
+[%header,cols=2*]
|===
|Name
|Description
@@ -515,6 +515,10 @@ As a developer you can reuse and extend built-in alerts and actions UI functiona
in their infrastructure.
+|{kib-repo}blob/{branch}/x-pack/plugins/drilldowns/url_drilldown/README.md[urlDrilldown]
+|NOTE: This plugin contains implementation of URL drilldown. For drilldowns infrastructure code refer to ui_actions_enhanced plugin.
+
+
|{kib-repo}blob/{branch}/x-pack/plugins/watcher/README.md[watcher]
|This plugins adopts some conventions in addition to or in place of conventions in Kibana (at the time of the plugin's creation):
@@ -523,10 +527,6 @@ in their infrastructure.
|Contains HTTP endpoints and UiSettings that are slated for removal.
-|{kib-repo}blob/{branch}/x-pack/plugins/drilldowns/url_drilldown/README.md[urlDrilldown]
-|NOTE: This plugin contains implementation of URL drilldown. For drilldowns infrastructure code refer to ui_actions_enhanced plugin.
-
-
|===
include::{kibana-root}/src/plugins/dashboard/README.asciidoc[leveloffset=+1]
diff --git a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md
index f7b55b0650d8b..3afd5eaa6f1f7 100644
--- a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md
+++ b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md
@@ -91,6 +91,7 @@ readonly links: {
readonly gettingStarted: string;
};
readonly query: {
+ readonly eql: string;
readonly luceneQuerySyntax: string;
readonly queryDsl: string;
readonly kueryQuerySyntax: string;
diff --git a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md
index 3f58cf08ee6b6..5249381969b98 100644
--- a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md
+++ b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md
@@ -17,5 +17,5 @@ export interface DocLinksStart
| --- | --- | --- |
| [DOC\_LINK\_VERSION](./kibana-plugin-core-public.doclinksstart.doc_link_version.md) | string
| |
| [ELASTIC\_WEBSITE\_URL](./kibana-plugin-core-public.doclinksstart.elastic_website_url.md) | string
| |
-| [links](./kibana-plugin-core-public.doclinksstart.links.md) | {
readonly dashboard: {
readonly drilldowns: string;
readonly drilldownsTriggerPicker: string;
readonly urlDrilldownTemplateSyntax: string;
readonly urlDrilldownVariables: string;
};
readonly filebeat: {
readonly base: string;
readonly installation: string;
readonly configuration: string;
readonly elasticsearchOutput: string;
readonly startup: string;
readonly exportedFields: string;
};
readonly auditbeat: {
readonly base: string;
};
readonly metricbeat: {
readonly base: string;
};
readonly heartbeat: {
readonly base: string;
};
readonly logstash: {
readonly base: string;
};
readonly functionbeat: {
readonly base: string;
};
readonly winlogbeat: {
readonly base: string;
};
readonly aggs: {
readonly date_histogram: string;
readonly date_range: string;
readonly filter: string;
readonly filters: string;
readonly geohash_grid: string;
readonly histogram: string;
readonly ip_range: string;
readonly range: string;
readonly significant_terms: string;
readonly terms: string;
readonly avg: string;
readonly avg_bucket: string;
readonly max_bucket: string;
readonly min_bucket: string;
readonly sum_bucket: string;
readonly cardinality: string;
readonly count: string;
readonly cumulative_sum: string;
readonly derivative: string;
readonly geo_bounds: string;
readonly geo_centroid: string;
readonly max: string;
readonly median: string;
readonly min: string;
readonly moving_avg: string;
readonly percentile_ranks: string;
readonly serial_diff: string;
readonly std_dev: string;
readonly sum: string;
readonly top_hits: string;
};
readonly scriptedFields: {
readonly scriptFields: string;
readonly scriptAggs: string;
readonly painless: string;
readonly painlessApi: string;
readonly painlessSyntax: string;
readonly luceneExpressions: string;
};
readonly indexPatterns: {
readonly loadingData: string;
readonly introduction: string;
};
readonly addData: string;
readonly kibana: string;
readonly siem: {
readonly guide: string;
readonly gettingStarted: string;
};
readonly query: {
readonly luceneQuerySyntax: string;
readonly queryDsl: string;
readonly kueryQuerySyntax: string;
};
readonly date: {
readonly dateMath: string;
};
readonly management: Record<string, string>;
readonly visualize: Record<string, string>;
}
| |
+| [links](./kibana-plugin-core-public.doclinksstart.links.md) | {
readonly dashboard: {
readonly drilldowns: string;
readonly drilldownsTriggerPicker: string;
readonly urlDrilldownTemplateSyntax: string;
readonly urlDrilldownVariables: string;
};
readonly filebeat: {
readonly base: string;
readonly installation: string;
readonly configuration: string;
readonly elasticsearchOutput: string;
readonly startup: string;
readonly exportedFields: string;
};
readonly auditbeat: {
readonly base: string;
};
readonly metricbeat: {
readonly base: string;
};
readonly heartbeat: {
readonly base: string;
};
readonly logstash: {
readonly base: string;
};
readonly functionbeat: {
readonly base: string;
};
readonly winlogbeat: {
readonly base: string;
};
readonly aggs: {
readonly date_histogram: string;
readonly date_range: string;
readonly filter: string;
readonly filters: string;
readonly geohash_grid: string;
readonly histogram: string;
readonly ip_range: string;
readonly range: string;
readonly significant_terms: string;
readonly terms: string;
readonly avg: string;
readonly avg_bucket: string;
readonly max_bucket: string;
readonly min_bucket: string;
readonly sum_bucket: string;
readonly cardinality: string;
readonly count: string;
readonly cumulative_sum: string;
readonly derivative: string;
readonly geo_bounds: string;
readonly geo_centroid: string;
readonly max: string;
readonly median: string;
readonly min: string;
readonly moving_avg: string;
readonly percentile_ranks: string;
readonly serial_diff: string;
readonly std_dev: string;
readonly sum: string;
readonly top_hits: string;
};
readonly scriptedFields: {
readonly scriptFields: string;
readonly scriptAggs: string;
readonly painless: string;
readonly painlessApi: string;
readonly painlessSyntax: string;
readonly luceneExpressions: string;
};
readonly indexPatterns: {
readonly loadingData: string;
readonly introduction: string;
};
readonly addData: string;
readonly kibana: string;
readonly siem: {
readonly guide: string;
readonly gettingStarted: string;
};
readonly query: {
readonly eql: string;
readonly luceneQuerySyntax: string;
readonly queryDsl: string;
readonly kueryQuerySyntax: string;
};
readonly date: {
readonly dateMath: string;
};
readonly management: Record<string, string>;
readonly visualize: Record<string, string>;
}
| |
diff --git a/docs/setup/production.asciidoc b/docs/setup/production.asciidoc
index 3075220e3a47c..e097704e05d40 100644
--- a/docs/setup/production.asciidoc
+++ b/docs/setup/production.asciidoc
@@ -135,6 +135,7 @@ Settings that must be the same:
xpack.security.encryptionKey //decrypting session information
xpack.reporting.encryptionKey //decrypting reports
xpack.encryptedSavedObjects.encryptionKey // decrypting saved objects
+xpack.encryptedSavedObjects.keyRotation.decryptionOnlyKeys // saved objects encryption key rotation, if any
--------
Separate configuration files can be used from the command line by using the `-c` flag:
diff --git a/docs/user/security/authorization/index.asciidoc b/docs/user/security/authorization/index.asciidoc
index 44ca96e4aece5..3af49753db664 100644
--- a/docs/user/security/authorization/index.asciidoc
+++ b/docs/user/security/authorization/index.asciidoc
@@ -2,11 +2,11 @@
[[xpack-security-authorization]]
=== Granting access to {kib}
-The Elastic Stack comes with the `kibana_admin` {ref}/built-in-roles.html[built-in role], which you can use to grant access to all Kibana features in all spaces. To grant users access to a subset of spaces or features, you can create a custom role that grants the desired Kibana privileges.
+The Elastic Stack comes with the `kibana_admin` {ref}/built-in-roles.html[built-in role], which you can use to grant access to all {kib} features in all spaces. To grant users access to a subset of spaces or features, you can create a custom role that grants the desired {kib} privileges.
-When you assign a user multiple roles, the user receives a union of the roles’ privileges. Therefore, assigning the `kibana_admin` role in addition to a custom role that grants Kibana privileges is ineffective because `kibana_admin` has access to all the features in all spaces.
+When you assign a user multiple roles, the user receives a union of the roles’ privileges. Therefore, assigning the `kibana_admin` role in addition to a custom role that grants {kib} privileges is ineffective because `kibana_admin` has access to all the features in all spaces.
-NOTE: When running multiple tenants of Kibana by changing the `kibana.index` in your `kibana.yml`, you cannot use `kibana_admin` to grant access. You must create custom roles that authorize the user for that specific tenant. Although multi-tenant installations are supported, the recommended approach to securing access to Kibana segments is to grant users access to specific spaces.
+NOTE: When running multiple tenants of {kib} by changing the `kibana.index` in your `kibana.yml`, you cannot use `kibana_admin` to grant access. You must create custom roles that authorize the user for that specific tenant. Although multi-tenant installations are supported, the recommended approach to securing access to {kib} segments is to grant users access to specific spaces.
[role="xpack"]
[[xpack-kibana-role-management]]
@@ -17,26 +17,26 @@ To create a role that grants {kib} privileges, open the menu, go to *Stack Manag
[[adding_kibana_privileges]]
==== Adding {kib} privileges
-To assign {kib} privileges to the role, click **Add space privilege** in the Kibana section.
+To assign {kib} privileges to the role, click **Add {kib} privilege** in the {kib} section.
[role="screenshot"]
-image::user/security/images/add-space-privileges.png[Add space privileges]
+image::user/security/images/add-space-privileges.png[Add {kib} privileges]
Open the **Spaces** selection control to specify whether to grant the role access to all spaces *** Global (all spaces)** or one or more individual spaces. If you select *** Global (all spaces)**, you can’t select individual spaces until you clear your selection.
Use the **Privilege** menu to grant access to features. The default is **Custom**, which you can use to grant access to individual features. Otherwise, you can grant read and write access to all current and future features by selecting **All**, or grant read access to all current and future features by selecting **Read**.
-When using the **Customize by feature** option, you can choose either **All**, **Read** or **None** for access to each feature. As new features are added to Kibana, roles that use the custom option do not automatically get access to the new features. You must manually update the roles.
+When using the **Customize by feature** option, you can choose either **All**, **Read** or **None** for access to each feature. As new features are added to {kib}, roles that use the custom option do not automatically get access to the new features. You must manually update the roles.
NOTE: *{stack-monitor-app}* relies on built-in roles to grant access. When a
user is assigned the appropriate roles, the *{stack-monitor-app}* application is
available; otherwise, it is not visible.
-To apply your changes, click **Create space privilege**. The space privilege shows up under the Kibana privileges section of the role.
+To apply your changes, click **Add {kib} privilege**. The privilege shows up under the {kib} privileges section of the role.
[role="screenshot"]
-image::user/security/images/create-space-privilege.png[Create space privilege]
+image::user/security/images/create-space-privilege.png[Add {kib} privilege]
==== Feature availability
@@ -64,9 +64,9 @@ Features are available to users when their roles grant access to the features, *
==== Assigning different privileges to different spaces
-Using the same role, it’s possible to assign different privileges to different spaces. After you’ve added space privileges, click **Add space privilege**. If you’ve already added privileges for either *** Global (all spaces)** or an individual space, you will not be able to select these in the **Spaces** selection control.
+Using the same role, it’s possible to assign different privileges to different spaces. After you’ve added privileges, click **Add {kib} privilege**. If you’ve already added privileges for either *** Global (all spaces)** or an individual space, you will not be able to select these in the **Spaces** selection control.
-Additionally, if you’ve already assigned privileges at *** Global (all spaces)**, you are only able to assign additional privileges to individual spaces. Similar to the behavior of multiple roles granting the union of all privileges, space privileges are also a union. If you’ve already granted the user the **All** privilege at *** Global (all spaces)**, you’re not able to restrict the role to only the **Read** privilege at an individual space.
+Additionally, if you’ve already assigned privileges at *** Global (all spaces)**, you are only able to assign additional privileges to individual spaces. Similar to the behavior of multiple roles granting the union of all privileges, {kib} privileges are also a union. If you’ve already granted the user the **All** privilege at *** Global (all spaces)**, you’re not able to restrict the role to only the **Read** privilege at an individual space.
==== Privilege summary
@@ -78,39 +78,37 @@ image::user/security/images/view-privilege-summary.png[View privilege summary]
==== Example 1: Grant all access to Dashboard at an individual space
-. Click **Add space privilege**.
+. Click **Add {kib} privilege**.
. For **Spaces**, select an individual space.
. For **Privilege**, leave the default selection of **Custom**.
. For the Dashboard feature, select **All**
-. Click **Create space privilege**.
+. Click **Add {kib} privilege**.
[role="screenshot"]
image::user/security/images/privilege-example-1.png[Privilege example 1]
==== Example 2: Grant all access to one space and read access to another
-. Click **Add space privilege**.
+. Click **Add {kib} privilege**.
. For **Spaces**, select the first space.
. For **Privilege**, select **All**.
-. Click **Create space privilege**.
-. Click **Add space privilege**.
+. Click **Add {kib} privilege**.
. For **Spaces**, select the second space.
. For **Privilege**, select **Read**.
-. Click **Create space privilege**.
+. Click **Add {kib} privilege**.
[role="screenshot"]
image::user/security/images/privilege-example-2.png[Privilege example 2]
==== Example 3: Grant read access to all spaces and write access to an individual space
-. Click **Add space privilege**.
+. Click **Add {kib} privilege**.
. For **Spaces**, select *** Global (all spaces)**.
. For **Privilege**, select **Read**.
-. Click **Create space privilege**.
-. Click **Add space privilege**.
+. Click **Add {kib} privilege**.
. For **Spaces**, select the individual space.
. For **Privilege**, select **All**.
-. Click **Create space privilege**.
+. Click **Add {kib} privilege**.
[role="screenshot"]
image::user/security/images/privilege-example-3.png[Privilege example 3]
diff --git a/package.json b/package.json
index 0eda8dd9f4114..5089e6e1a140d 100644
--- a/package.json
+++ b/package.json
@@ -151,7 +151,7 @@
"angular-sanitize": "^1.8.0",
"bluebird": "3.5.5",
"boom": "^7.2.0",
- "chalk": "^2.4.2",
+ "chalk": "^4.1.0",
"check-disk-space": "^2.1.0",
"chokidar": "^3.4.2",
"color": "1.0.3",
@@ -230,7 +230,7 @@
"@babel/parser": "^7.11.2",
"@babel/types": "^7.11.0",
"@elastic/apm-rum": "^5.6.1",
- "@elastic/charts": "21.1.2",
+ "@elastic/charts": "23.0.0",
"@elastic/ems-client": "7.10.0",
"@elastic/eslint-config-kibana": "0.15.0",
"@elastic/eslint-plugin-eui": "0.0.2",
@@ -331,7 +331,7 @@
"@types/selenium-webdriver": "^4.0.9",
"@types/semver": "^5.5.0",
"@types/sinon": "^7.0.13",
- "@types/strip-ansi": "^3.0.0",
+ "@types/strip-ansi": "^5.2.1",
"@types/styled-components": "^5.1.0",
"@types/supertest": "^2.0.5",
"@types/supertest-as-promised": "^2.0.38",
@@ -343,7 +343,7 @@
"@types/uuid": "^3.4.4",
"@types/vinyl": "^2.0.4",
"@types/vinyl-fs": "^2.4.11",
- "@types/webpack": "^4.41.21",
+ "@types/webpack": "^4.41.3",
"@types/webpack-env": "^1.15.2",
"@types/zen-observable": "^0.8.0",
"@typescript-eslint/eslint-plugin": "^3.10.0",
@@ -470,10 +470,10 @@
"selenium-webdriver": "^4.0.0-alpha.7",
"simple-git": "1.116.0",
"sinon": "^7.4.2",
- "strip-ansi": "^3.0.1",
+ "strip-ansi": "^6.0.0",
"supertest": "^3.1.0",
"supertest-as-promised": "^4.0.2",
- "tape": "^4.13.0",
+ "tape": "^5.0.1",
"topojson-client": "3.0.0",
"tree-kill": "^1.2.2",
"typescript": "4.0.2",
diff --git a/packages/kbn-apm-config-loader/package.json b/packages/kbn-apm-config-loader/package.json
index 1982ccdeda0ff..c570fdc0218b9 100644
--- a/packages/kbn-apm-config-loader/package.json
+++ b/packages/kbn-apm-config-loader/package.json
@@ -18,6 +18,6 @@
},
"devDependencies": {
"typescript": "4.0.2",
- "tsd": "^0.7.4"
+ "tsd": "^0.13.1"
}
}
diff --git a/packages/kbn-babel-preset/package.json b/packages/kbn-babel-preset/package.json
index d6d1a78dd4a23..bc4e0ec338f94 100644
--- a/packages/kbn-babel-preset/package.json
+++ b/packages/kbn-babel-preset/package.json
@@ -15,6 +15,7 @@
"babel-plugin-add-module-exports": "^1.0.2",
"babel-plugin-styled-components": "^1.10.7",
"babel-plugin-transform-define": "^1.3.1",
+ "babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"react-is": "^16.8.0",
"styled-components": "^5.1.0"
}
diff --git a/packages/kbn-babel-preset/webpack_preset.js b/packages/kbn-babel-preset/webpack_preset.js
index a43d607edb17c..503b99d3c3e8a 100644
--- a/packages/kbn-babel-preset/webpack_preset.js
+++ b/packages/kbn-babel-preset/webpack_preset.js
@@ -40,5 +40,18 @@ module.exports = () => {
},
],
],
+ env: {
+ production: {
+ plugins: [
+ [
+ require.resolve('babel-plugin-transform-react-remove-prop-types'),
+ {
+ mode: 'remove',
+ removeImport: true,
+ },
+ ],
+ ],
+ },
+ },
};
};
diff --git a/packages/kbn-dev-utils/src/plugin_list/discover_plugins.ts b/packages/kbn-dev-utils/src/plugin_list/discover_plugins.ts
index 5d92ddb600aa9..e8f6735205b19 100644
--- a/packages/kbn-dev-utils/src/plugin_list/discover_plugins.ts
+++ b/packages/kbn-dev-utils/src/plugin_list/discover_plugins.ts
@@ -29,7 +29,7 @@ import { extractAsciidocInfo } from './extract_asciidoc_info';
export interface Plugin {
id: string;
- relativeDir?: string;
+ relativeDir: string;
relativeReadmePath?: string;
readmeSnippet?: string;
readmeAsciidocAnchor?: string;
diff --git a/packages/kbn-dev-utils/src/plugin_list/generate_plugin_list.ts b/packages/kbn-dev-utils/src/plugin_list/generate_plugin_list.ts
index e1a1323553113..680c220adb18c 100644
--- a/packages/kbn-dev-utils/src/plugin_list/generate_plugin_list.ts
+++ b/packages/kbn-dev-utils/src/plugin_list/generate_plugin_list.ts
@@ -24,9 +24,11 @@ import { REPO_ROOT } from '@kbn/utils';
import { Plugins } from './discover_plugins';
+const sortPlugins = (plugins: Plugins) => plugins.sort((a, b) => a.id.localeCompare(b.id));
+
function* printPlugins(plugins: Plugins, includes: string[]) {
- for (const plugin of plugins) {
- const path = plugin.relativeReadmePath || plugin.relativeDir;
+ for (const plugin of sortPlugins(plugins)) {
+ const path = normalizePath(plugin.relativeReadmePath || plugin.relativeDir);
yield '';
if (plugin.readmeAsciidocAnchor) {
@@ -67,7 +69,7 @@ NOTE:
[discrete]
=== src/plugins
-[%header,cols=2*]
+[%header,cols=2*]
|===
|Name
|Description
@@ -79,7 +81,7 @@ ${Array.from(printPlugins(ossPlugins, includes)).join('\n')}
[discrete]
=== x-pack/plugins
-[%header,cols=2*]
+[%header,cols=2*]
|===
|Name
|Description
diff --git a/packages/kbn-es/package.json b/packages/kbn-es/package.json
index 40d34c5d710bb..c3733094350be 100644
--- a/packages/kbn-es/package.json
+++ b/packages/kbn-es/package.json
@@ -9,7 +9,7 @@
"kbn:watch": "node scripts/build --watch"
},
"dependencies": {
- "@elastic/elasticsearch": "7.9.0-rc.1",
+ "@elastic/elasticsearch": "7.9.1",
"@kbn/dev-utils": "1.0.0",
"abort-controller": "^3.0.0",
"chalk": "^4.1.0",
diff --git a/packages/kbn-optimizer/src/worker/webpack.config.ts b/packages/kbn-optimizer/src/worker/webpack.config.ts
index 2edf1c999888e..9678dd5de868b 100644
--- a/packages/kbn-optimizer/src/worker/webpack.config.ts
+++ b/packages/kbn-optimizer/src/worker/webpack.config.ts
@@ -200,6 +200,7 @@ export function getWebpackConfig(bundle: Bundle, bundleRefs: BundleRefs, worker:
loader: 'babel-loader',
options: {
babelrc: false,
+ envName: worker.dist ? 'production' : 'development',
presets: IS_CODE_COVERAGE
? [ISTANBUL_PRESET_PATH, BABEL_PRESET_PATH]
: [BABEL_PRESET_PATH],
diff --git a/packages/kbn-plugin-helpers/package.json b/packages/kbn-plugin-helpers/package.json
index 65b44b6965048..a2c4e1e2134e7 100644
--- a/packages/kbn-plugin-helpers/package.json
+++ b/packages/kbn-plugin-helpers/package.json
@@ -18,7 +18,7 @@
"del": "^5.1.0",
"execa": "^4.0.2",
"gulp-zip": "^5.0.2",
- "inquirer": "^1.2.2",
+ "inquirer": "^7.3.3",
"load-json-file": "^6.2.0",
"vinyl-fs": "^3.0.3"
},
diff --git a/packages/kbn-pm/dist/index.js b/packages/kbn-pm/dist/index.js
index 7dcfc1d778ea8..2882a72b3ac9d 100644
--- a/packages/kbn-pm/dist/index.js
+++ b/packages/kbn-pm/dist/index.js
@@ -94,7 +94,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _cli__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "run", function() { return _cli__WEBPACK_IMPORTED_MODULE_0__["run"]; });
-/* harmony import */ var _production__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(496);
+/* harmony import */ var _production__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(500);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buildProductionProjects", function() { return _production__WEBPACK_IMPORTED_MODULE_1__["buildProductionProjects"]; });
/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(145);
@@ -103,10 +103,10 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _utils_project__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(163);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Project", function() { return _utils_project__WEBPACK_IMPORTED_MODULE_3__["Project"]; });
-/* harmony import */ var _utils_workspaces__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(275);
+/* harmony import */ var _utils_workspaces__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(270);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "copyWorkspacePackages", function() { return _utils_workspaces__WEBPACK_IMPORTED_MODULE_4__["copyWorkspacePackages"]; });
-/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(276);
+/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(271);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getProjectPaths", function() { return _config__WEBPACK_IMPORTED_MODULE_5__["getProjectPaths"]; });
/*
@@ -150,7 +150,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _kbn_dev_utils_tooling_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5);
/* harmony import */ var _kbn_dev_utils_tooling_log__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_kbn_dev_utils_tooling_log__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(127);
-/* harmony import */ var _run__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(489);
+/* harmony import */ var _run__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(493);
/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(143);
/*
* Licensed to Elasticsearch B.V. under one or more contributor
@@ -8763,9 +8763,9 @@ exports.ToolingLogCollectingWriter = ToolingLogCollectingWriter;
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commands", function() { return commands; });
/* harmony import */ var _bootstrap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(128);
-/* harmony import */ var _clean__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(284);
-/* harmony import */ var _run__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(388);
-/* harmony import */ var _watch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(389);
+/* harmony import */ var _clean__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(279);
+/* harmony import */ var _run__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(392);
+/* harmony import */ var _watch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(393);
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
@@ -8806,10 +8806,10 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143);
/* harmony import */ var _utils_parallelize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(144);
/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(145);
-/* harmony import */ var _utils_project_checksums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(277);
-/* harmony import */ var _utils_bootstrap_cache_file__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(282);
-/* harmony import */ var _utils_yarn_lock__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(279);
-/* harmony import */ var _utils_validate_yarn_lock__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(283);
+/* harmony import */ var _utils_project_checksums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(272);
+/* harmony import */ var _utils_bootstrap_cache_file__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(277);
+/* harmony import */ var _utils_yarn_lock__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(274);
+/* harmony import */ var _utils_validate_yarn_lock__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(278);
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
@@ -10831,7 +10831,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(162);
/* harmony import */ var _project__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(163);
-/* harmony import */ var _workspaces__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(275);
+/* harmony import */ var _workspaces__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(270);
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
@@ -23648,11 +23648,11 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "spawnStreaming", function() { return spawnStreaming; });
/* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(137);
/* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(227);
+/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(112);
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var execa__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(232);
+/* harmony import */ var execa__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(227);
/* harmony import */ var execa__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(execa__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var strong_log_transformer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(267);
+/* harmony import */ var strong_log_transformer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(262);
/* harmony import */ var strong_log_transformer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(strong_log_transformer__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(143);
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
@@ -23743,602 +23743,18 @@ function spawnStreaming(command, args, opts, {
"use strict";
-const ansiStyles = __webpack_require__(113);
-const {stdout: stdoutColor, stderr: stderrColor} = __webpack_require__(228);
-const {
- stringReplaceAll,
- stringEncaseCRLFWithFirstIndex
-} = __webpack_require__(230);
-
-const {isArray} = Array;
-
-// `supportsColor.level` → `ansiStyles.color[name]` mapping
-const levelMapping = [
- 'ansi',
- 'ansi',
- 'ansi256',
- 'ansi16m'
-];
-
-const styles = Object.create(null);
-
-const applyOptions = (object, options = {}) => {
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
- throw new Error('The `level` option should be an integer from 0 to 3');
- }
-
- // Detect level if not set manually
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
- object.level = options.level === undefined ? colorLevel : options.level;
-};
-
-class ChalkClass {
- constructor(options) {
- // eslint-disable-next-line no-constructor-return
- return chalkFactory(options);
- }
-}
-
-const chalkFactory = options => {
- const chalk = {};
- applyOptions(chalk, options);
-
- chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_);
-
- Object.setPrototypeOf(chalk, Chalk.prototype);
- Object.setPrototypeOf(chalk.template, chalk);
-
- chalk.template.constructor = () => {
- throw new Error('`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.');
- };
-
- chalk.template.Instance = ChalkClass;
-
- return chalk.template;
-};
-
-function Chalk(options) {
- return chalkFactory(options);
-}
-
-for (const [styleName, style] of Object.entries(ansiStyles)) {
- styles[styleName] = {
- get() {
- const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
- Object.defineProperty(this, styleName, {value: builder});
- return builder;
- }
- };
-}
-
-styles.visible = {
- get() {
- const builder = createBuilder(this, this._styler, true);
- Object.defineProperty(this, 'visible', {value: builder});
- return builder;
- }
-};
-
-const usedModels = ['rgb', 'hex', 'keyword', 'hsl', 'hsv', 'hwb', 'ansi', 'ansi256'];
-
-for (const model of usedModels) {
- styles[model] = {
- get() {
- const {level} = this;
- return function (...arguments_) {
- const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
- return createBuilder(this, styler, this._isEmpty);
- };
- }
- };
-}
-
-for (const model of usedModels) {
- const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
- styles[bgModel] = {
- get() {
- const {level} = this;
- return function (...arguments_) {
- const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
- return createBuilder(this, styler, this._isEmpty);
- };
- }
- };
-}
-
-const proto = Object.defineProperties(() => {}, {
- ...styles,
- level: {
- enumerable: true,
- get() {
- return this._generator.level;
- },
- set(level) {
- this._generator.level = level;
- }
- }
-});
-
-const createStyler = (open, close, parent) => {
- let openAll;
- let closeAll;
- if (parent === undefined) {
- openAll = open;
- closeAll = close;
- } else {
- openAll = parent.openAll + open;
- closeAll = close + parent.closeAll;
- }
-
- return {
- open,
- close,
- openAll,
- closeAll,
- parent
- };
-};
-
-const createBuilder = (self, _styler, _isEmpty) => {
- const builder = (...arguments_) => {
- if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
- // Called as a template literal, for example: chalk.red`2 + 3 = {bold ${2+3}}`
- return applyStyle(builder, chalkTag(builder, ...arguments_));
- }
-
- // Single argument is hot path, implicit coercion is faster than anything
- // eslint-disable-next-line no-implicit-coercion
- return applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));
- };
-
- // We alter the prototype because we must return a function, but there is
- // no way to create a function with a different prototype
- Object.setPrototypeOf(builder, proto);
-
- builder._generator = self;
- builder._styler = _styler;
- builder._isEmpty = _isEmpty;
-
- return builder;
-};
-
-const applyStyle = (self, string) => {
- if (self.level <= 0 || !string) {
- return self._isEmpty ? '' : string;
- }
-
- let styler = self._styler;
-
- if (styler === undefined) {
- return string;
- }
-
- const {openAll, closeAll} = styler;
- if (string.indexOf('\u001B') !== -1) {
- while (styler !== undefined) {
- // Replace any instances already present with a re-opening code
- // otherwise only the part of the string until said closing code
- // will be colored, and the rest will simply be 'plain'.
- string = stringReplaceAll(string, styler.close, styler.open);
-
- styler = styler.parent;
- }
- }
-
- // We can move both next actions out of loop, because remaining actions in loop won't have
- // any/visible effect on parts we add here. Close the styling before a linebreak and reopen
- // after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92
- const lfIndex = string.indexOf('\n');
- if (lfIndex !== -1) {
- string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
- }
-
- return openAll + string + closeAll;
-};
-
-let template;
-const chalkTag = (chalk, ...strings) => {
- const [firstString] = strings;
-
- if (!isArray(firstString) || !isArray(firstString.raw)) {
- // If chalk() was called by itself or with a string,
- // return the string itself as a string.
- return strings.join(' ');
- }
-
- const arguments_ = strings.slice(1);
- const parts = [firstString.raw[0]];
-
- for (let i = 1; i < firstString.length; i++) {
- parts.push(
- String(arguments_[i - 1]).replace(/[{}\\]/g, '\\$&'),
- String(firstString.raw[i])
- );
- }
-
- if (template === undefined) {
- template = __webpack_require__(231);
- }
-
- return template(chalk, parts.join(''));
-};
-
-Object.defineProperties(Chalk.prototype, styles);
-
-const chalk = Chalk(); // eslint-disable-line new-cap
-chalk.supportsColor = stdoutColor;
-chalk.stderr = Chalk({level: stderrColor ? stderrColor.level : 0}); // eslint-disable-line new-cap
-chalk.stderr.supportsColor = stderrColor;
-
-module.exports = chalk;
-
-
-/***/ }),
-/* 228 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-const os = __webpack_require__(120);
-const tty = __webpack_require__(121);
-const hasFlag = __webpack_require__(229);
-
-const {env} = process;
-
-let forceColor;
-if (hasFlag('no-color') ||
- hasFlag('no-colors') ||
- hasFlag('color=false') ||
- hasFlag('color=never')) {
- forceColor = 0;
-} else if (hasFlag('color') ||
- hasFlag('colors') ||
- hasFlag('color=true') ||
- hasFlag('color=always')) {
- forceColor = 1;
-}
-
-if ('FORCE_COLOR' in env) {
- if (env.FORCE_COLOR === 'true') {
- forceColor = 1;
- } else if (env.FORCE_COLOR === 'false') {
- forceColor = 0;
- } else {
- forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
- }
-}
-
-function translateLevel(level) {
- if (level === 0) {
- return false;
- }
-
- return {
- level,
- hasBasic: true,
- has256: level >= 2,
- has16m: level >= 3
- };
-}
-
-function supportsColor(haveStream, streamIsTTY) {
- if (forceColor === 0) {
- return 0;
- }
-
- if (hasFlag('color=16m') ||
- hasFlag('color=full') ||
- hasFlag('color=truecolor')) {
- return 3;
- }
-
- if (hasFlag('color=256')) {
- return 2;
- }
-
- if (haveStream && !streamIsTTY && forceColor === undefined) {
- return 0;
- }
-
- const min = forceColor || 0;
-
- if (env.TERM === 'dumb') {
- return min;
- }
-
- if (process.platform === 'win32') {
- // Windows 10 build 10586 is the first Windows release that supports 256 colors.
- // Windows 10 build 14931 is the first release that supports 16m/TrueColor.
- const osRelease = os.release().split('.');
- if (
- Number(osRelease[0]) >= 10 &&
- Number(osRelease[2]) >= 10586
- ) {
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
- }
-
- return 1;
- }
-
- if ('CI' in env) {
- if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
- return 1;
- }
-
- return min;
- }
-
- if ('TEAMCITY_VERSION' in env) {
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
- }
-
- if ('GITHUB_ACTIONS' in env) {
- return 1;
- }
-
- if (env.COLORTERM === 'truecolor') {
- return 3;
- }
-
- if ('TERM_PROGRAM' in env) {
- const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
-
- switch (env.TERM_PROGRAM) {
- case 'iTerm.app':
- return version >= 3 ? 3 : 2;
- case 'Apple_Terminal':
- return 2;
- // No default
- }
- }
-
- if (/-256(color)?$/i.test(env.TERM)) {
- return 2;
- }
-
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
- return 1;
- }
-
- if ('COLORTERM' in env) {
- return 1;
- }
-
- return min;
-}
-
-function getSupportLevel(stream) {
- const level = supportsColor(stream, stream && stream.isTTY);
- return translateLevel(level);
-}
-
-module.exports = {
- supportsColor: getSupportLevel,
- stdout: translateLevel(supportsColor(true, tty.isatty(1))),
- stderr: translateLevel(supportsColor(true, tty.isatty(2)))
-};
-
-
-/***/ }),
-/* 229 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-module.exports = (flag, argv = process.argv) => {
- const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
- const position = argv.indexOf(prefix + flag);
- const terminatorPosition = argv.indexOf('--');
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
-};
-
-
-/***/ }),
-/* 230 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-const stringReplaceAll = (string, substring, replacer) => {
- let index = string.indexOf(substring);
- if (index === -1) {
- return string;
- }
-
- const substringLength = substring.length;
- let endIndex = 0;
- let returnValue = '';
- do {
- returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
- endIndex = index + substringLength;
- index = string.indexOf(substring, endIndex);
- } while (index !== -1);
-
- returnValue += string.substr(endIndex);
- return returnValue;
-};
-
-const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
- let endIndex = 0;
- let returnValue = '';
- do {
- const gotCR = string[index - 1] === '\r';
- returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? '\r\n' : '\n') + postfix;
- endIndex = index + 1;
- index = string.indexOf('\n', endIndex);
- } while (index !== -1);
-
- returnValue += string.substr(endIndex);
- return returnValue;
-};
-
-module.exports = {
- stringReplaceAll,
- stringEncaseCRLFWithFirstIndex
-};
-
-
-/***/ }),
-/* 231 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
-const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
-const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
-const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
-
-const ESCAPES = new Map([
- ['n', '\n'],
- ['r', '\r'],
- ['t', '\t'],
- ['b', '\b'],
- ['f', '\f'],
- ['v', '\v'],
- ['0', '\0'],
- ['\\', '\\'],
- ['e', '\u001B'],
- ['a', '\u0007']
-]);
-
-function unescape(c) {
- const u = c[0] === 'u';
- const bracket = c[1] === '{';
-
- if ((u && !bracket && c.length === 5) || (c[0] === 'x' && c.length === 3)) {
- return String.fromCharCode(parseInt(c.slice(1), 16));
- }
-
- if (u && bracket) {
- return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
- }
-
- return ESCAPES.get(c) || c;
-}
-
-function parseArguments(name, arguments_) {
- const results = [];
- const chunks = arguments_.trim().split(/\s*,\s*/g);
- let matches;
-
- for (const chunk of chunks) {
- const number = Number(chunk);
- if (!Number.isNaN(number)) {
- results.push(number);
- } else if ((matches = chunk.match(STRING_REGEX))) {
- results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
- } else {
- throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
- }
- }
-
- return results;
-}
-
-function parseStyle(style) {
- STYLE_REGEX.lastIndex = 0;
-
- const results = [];
- let matches;
-
- while ((matches = STYLE_REGEX.exec(style)) !== null) {
- const name = matches[1];
-
- if (matches[2]) {
- const args = parseArguments(name, matches[2]);
- results.push([name].concat(args));
- } else {
- results.push([name]);
- }
- }
-
- return results;
-}
-
-function buildStyle(chalk, styles) {
- const enabled = {};
-
- for (const layer of styles) {
- for (const style of layer.styles) {
- enabled[style[0]] = layer.inverse ? null : style.slice(1);
- }
- }
-
- let current = chalk;
- for (const [styleName, styles] of Object.entries(enabled)) {
- if (!Array.isArray(styles)) {
- continue;
- }
-
- if (!(styleName in current)) {
- throw new Error(`Unknown Chalk style: ${styleName}`);
- }
-
- current = styles.length > 0 ? current[styleName](...styles) : current[styleName];
- }
-
- return current;
-}
-
-module.exports = (chalk, temporary) => {
- const styles = [];
- const chunks = [];
- let chunk = [];
-
- // eslint-disable-next-line max-params
- temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
- if (escapeCharacter) {
- chunk.push(unescape(escapeCharacter));
- } else if (style) {
- const string = chunk.join('');
- chunk = [];
- chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string));
- styles.push({inverse, styles: parseStyle(style)});
- } else if (close) {
- if (styles.length === 0) {
- throw new Error('Found extraneous } in Chalk template literal');
- }
-
- chunks.push(buildStyle(chalk, styles)(chunk.join('')));
- chunk = [];
- styles.pop();
- } else {
- chunk.push(character);
- }
- });
-
- chunks.push(chunk.join(''));
-
- if (styles.length > 0) {
- const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`;
- throw new Error(errMessage);
- }
-
- return chunks.join('');
-};
-
-
-/***/ }),
-/* 232 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
const path = __webpack_require__(4);
-const childProcess = __webpack_require__(233);
-const crossSpawn = __webpack_require__(234);
-const stripFinalNewline = __webpack_require__(247);
-const npmRunPath = __webpack_require__(248);
-const onetime = __webpack_require__(249);
-const makeError = __webpack_require__(251);
-const normalizeStdio = __webpack_require__(256);
-const {spawnedKill, spawnedCancel, setupTimeout, setExitHandler} = __webpack_require__(257);
-const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = __webpack_require__(258);
-const {mergePromise, getSpawnedPromise} = __webpack_require__(265);
-const {joinCommand, parseCommand} = __webpack_require__(266);
+const childProcess = __webpack_require__(228);
+const crossSpawn = __webpack_require__(229);
+const stripFinalNewline = __webpack_require__(242);
+const npmRunPath = __webpack_require__(243);
+const onetime = __webpack_require__(244);
+const makeError = __webpack_require__(246);
+const normalizeStdio = __webpack_require__(251);
+const {spawnedKill, spawnedCancel, setupTimeout, setExitHandler} = __webpack_require__(252);
+const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = __webpack_require__(253);
+const {mergePromise, getSpawnedPromise} = __webpack_require__(260);
+const {joinCommand, parseCommand} = __webpack_require__(261);
const DEFAULT_MAX_BUFFER = 1000 * 1000 * 100;
@@ -24585,21 +24001,21 @@ module.exports.node = (scriptPath, args, options = {}) => {
/***/ }),
-/* 233 */
+/* 228 */
/***/ (function(module, exports) {
module.exports = require("child_process");
/***/ }),
-/* 234 */
+/* 229 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const cp = __webpack_require__(233);
-const parse = __webpack_require__(235);
-const enoent = __webpack_require__(246);
+const cp = __webpack_require__(228);
+const parse = __webpack_require__(230);
+const enoent = __webpack_require__(241);
function spawn(command, args, options) {
// Parse the arguments
@@ -24637,16 +24053,16 @@ module.exports._enoent = enoent;
/***/ }),
-/* 235 */
+/* 230 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const path = __webpack_require__(4);
-const resolveCommand = __webpack_require__(236);
-const escape = __webpack_require__(242);
-const readShebang = __webpack_require__(243);
+const resolveCommand = __webpack_require__(231);
+const escape = __webpack_require__(237);
+const readShebang = __webpack_require__(238);
const isWin = process.platform === 'win32';
const isExecutableRegExp = /\.(?:com|exe)$/i;
@@ -24735,15 +24151,15 @@ module.exports = parse;
/***/ }),
-/* 236 */
+/* 231 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const path = __webpack_require__(4);
-const which = __webpack_require__(237);
-const pathKey = __webpack_require__(241)();
+const which = __webpack_require__(232);
+const pathKey = __webpack_require__(236)();
function resolveCommandAttempt(parsed, withoutPathExt) {
const cwd = process.cwd();
@@ -24793,7 +24209,7 @@ module.exports = resolveCommand;
/***/ }),
-/* 237 */
+/* 232 */
/***/ (function(module, exports, __webpack_require__) {
const isWindows = process.platform === 'win32' ||
@@ -24802,7 +24218,7 @@ const isWindows = process.platform === 'win32' ||
const path = __webpack_require__(4)
const COLON = isWindows ? ';' : ':'
-const isexe = __webpack_require__(238)
+const isexe = __webpack_require__(233)
const getNotFoundError = (cmd) =>
Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })
@@ -24924,15 +24340,15 @@ which.sync = whichSync
/***/ }),
-/* 238 */
+/* 233 */
/***/ (function(module, exports, __webpack_require__) {
var fs = __webpack_require__(133)
var core
if (process.platform === 'win32' || global.TESTING_WINDOWS) {
- core = __webpack_require__(239)
+ core = __webpack_require__(234)
} else {
- core = __webpack_require__(240)
+ core = __webpack_require__(235)
}
module.exports = isexe
@@ -24987,7 +24403,7 @@ function sync (path, options) {
/***/ }),
-/* 239 */
+/* 234 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = isexe
@@ -25035,7 +24451,7 @@ function sync (path, options) {
/***/ }),
-/* 240 */
+/* 235 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = isexe
@@ -25082,7 +24498,7 @@ function checkMode (stat, options) {
/***/ }),
-/* 241 */
+/* 236 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -25105,7 +24521,7 @@ module.exports.default = pathKey;
/***/ }),
-/* 242 */
+/* 237 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -25157,14 +24573,14 @@ module.exports.argument = escapeArgument;
/***/ }),
-/* 243 */
+/* 238 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const fs = __webpack_require__(133);
-const shebangCommand = __webpack_require__(244);
+const shebangCommand = __webpack_require__(239);
function readShebang(command) {
// Read the first 150 bytes from the file
@@ -25187,12 +24603,12 @@ module.exports = readShebang;
/***/ }),
-/* 244 */
+/* 239 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const shebangRegex = __webpack_require__(245);
+const shebangRegex = __webpack_require__(240);
module.exports = (string = '') => {
const match = string.match(shebangRegex);
@@ -25213,7 +24629,7 @@ module.exports = (string = '') => {
/***/ }),
-/* 245 */
+/* 240 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -25222,7 +24638,7 @@ module.exports = /^#!(.*)/;
/***/ }),
-/* 246 */
+/* 241 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -25288,7 +24704,7 @@ module.exports = {
/***/ }),
-/* 247 */
+/* 242 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -25311,13 +24727,13 @@ module.exports = input => {
/***/ }),
-/* 248 */
+/* 243 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const path = __webpack_require__(4);
-const pathKey = __webpack_require__(241);
+const pathKey = __webpack_require__(236);
const npmRunPath = options => {
options = {
@@ -25365,12 +24781,12 @@ module.exports.env = options => {
/***/ }),
-/* 249 */
+/* 244 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const mimicFn = __webpack_require__(250);
+const mimicFn = __webpack_require__(245);
const calledFunctions = new WeakMap();
@@ -25422,7 +24838,7 @@ module.exports.callCount = fn => {
/***/ }),
-/* 250 */
+/* 245 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -25442,12 +24858,12 @@ module.exports.default = mimicFn;
/***/ }),
-/* 251 */
+/* 246 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const {signalsByName} = __webpack_require__(252);
+const {signalsByName} = __webpack_require__(247);
const getErrorPrefix = ({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}) => {
if (timedOut) {
@@ -25535,14 +24951,14 @@ module.exports = makeError;
/***/ }),
-/* 252 */
+/* 247 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports,"__esModule",{value:true});exports.signalsByNumber=exports.signalsByName=void 0;var _os=__webpack_require__(120);
-var _signals=__webpack_require__(253);
-var _realtime=__webpack_require__(255);
+var _signals=__webpack_require__(248);
+var _realtime=__webpack_require__(250);
@@ -25612,14 +25028,14 @@ const signalsByNumber=getSignalsByNumber();exports.signalsByNumber=signalsByNumb
//# sourceMappingURL=main.js.map
/***/ }),
-/* 253 */
+/* 248 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports,"__esModule",{value:true});exports.getSignals=void 0;var _os=__webpack_require__(120);
-var _core=__webpack_require__(254);
-var _realtime=__webpack_require__(255);
+var _core=__webpack_require__(249);
+var _realtime=__webpack_require__(250);
@@ -25653,7 +25069,7 @@ return{name,number,description,supported,action,forced,standard};
//# sourceMappingURL=signals.js.map
/***/ }),
-/* 254 */
+/* 249 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -25932,7 +25348,7 @@ standard:"other"}];exports.SIGNALS=SIGNALS;
//# sourceMappingURL=core.js.map
/***/ }),
-/* 255 */
+/* 250 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -25957,7 +25373,7 @@ const SIGRTMAX=64;exports.SIGRTMAX=SIGRTMAX;
//# sourceMappingURL=realtime.js.map
/***/ }),
-/* 256 */
+/* 251 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -26016,7 +25432,7 @@ module.exports.node = opts => {
/***/ }),
-/* 257 */
+/* 252 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -26135,14 +25551,14 @@ module.exports = {
/***/ }),
-/* 258 */
+/* 253 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const isStream = __webpack_require__(259);
-const getStream = __webpack_require__(260);
-const mergeStream = __webpack_require__(264);
+const isStream = __webpack_require__(254);
+const getStream = __webpack_require__(255);
+const mergeStream = __webpack_require__(259);
// `input` option
const handleInput = (spawned, input) => {
@@ -26239,7 +25655,7 @@ module.exports = {
/***/ }),
-/* 259 */
+/* 254 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -26275,13 +25691,13 @@ module.exports = isStream;
/***/ }),
-/* 260 */
+/* 255 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const pump = __webpack_require__(261);
-const bufferStream = __webpack_require__(263);
+const pump = __webpack_require__(256);
+const bufferStream = __webpack_require__(258);
class MaxBufferError extends Error {
constructor() {
@@ -26340,11 +25756,11 @@ module.exports.MaxBufferError = MaxBufferError;
/***/ }),
-/* 261 */
+/* 256 */
/***/ (function(module, exports, __webpack_require__) {
var once = __webpack_require__(161)
-var eos = __webpack_require__(262)
+var eos = __webpack_require__(257)
var fs = __webpack_require__(133) // we only need fs to get the ReadStream and WriteStream prototypes
var noop = function () {}
@@ -26428,7 +25844,7 @@ module.exports = pump
/***/ }),
-/* 262 */
+/* 257 */
/***/ (function(module, exports, __webpack_require__) {
var once = __webpack_require__(161);
@@ -26528,7 +25944,7 @@ module.exports = eos;
/***/ }),
-/* 263 */
+/* 258 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -26587,7 +26003,7 @@ module.exports = options => {
/***/ }),
-/* 264 */
+/* 259 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -26635,7 +26051,7 @@ module.exports = function (/*streams...*/) {
/***/ }),
-/* 265 */
+/* 260 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -26688,7 +26104,7 @@ module.exports = {
/***/ }),
-/* 266 */
+/* 261 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -26733,7 +26149,7 @@ module.exports = {
/***/ }),
-/* 267 */
+/* 262 */
/***/ (function(module, exports, __webpack_require__) {
// Copyright IBM Corp. 2014,2018. All Rights Reserved.
@@ -26741,12 +26157,12 @@ module.exports = {
// This file is licensed under the Apache License 2.0.
// License text available at https://opensource.org/licenses/Apache-2.0
-module.exports = __webpack_require__(268);
-module.exports.cli = __webpack_require__(272);
+module.exports = __webpack_require__(263);
+module.exports.cli = __webpack_require__(267);
/***/ }),
-/* 268 */
+/* 263 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -26761,9 +26177,9 @@ var stream = __webpack_require__(137);
var util = __webpack_require__(111);
var fs = __webpack_require__(133);
-var through = __webpack_require__(269);
-var duplexer = __webpack_require__(270);
-var StringDecoder = __webpack_require__(271).StringDecoder;
+var through = __webpack_require__(264);
+var duplexer = __webpack_require__(265);
+var StringDecoder = __webpack_require__(266).StringDecoder;
module.exports = Logger;
@@ -26952,7 +26368,7 @@ function lineMerger(host) {
/***/ }),
-/* 269 */
+/* 264 */
/***/ (function(module, exports, __webpack_require__) {
var Stream = __webpack_require__(137)
@@ -27066,7 +26482,7 @@ function through (write, end, opts) {
/***/ }),
-/* 270 */
+/* 265 */
/***/ (function(module, exports, __webpack_require__) {
var Stream = __webpack_require__(137)
@@ -27159,13 +26575,13 @@ function duplex(writer, reader) {
/***/ }),
-/* 271 */
+/* 266 */
/***/ (function(module, exports) {
module.exports = require("string_decoder");
/***/ }),
-/* 272 */
+/* 267 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -27176,11 +26592,11 @@ module.exports = require("string_decoder");
-var minimist = __webpack_require__(273);
+var minimist = __webpack_require__(268);
var path = __webpack_require__(4);
-var Logger = __webpack_require__(268);
-var pkg = __webpack_require__(274);
+var Logger = __webpack_require__(263);
+var pkg = __webpack_require__(269);
module.exports = cli;
@@ -27234,7 +26650,7 @@ function usage($0, p) {
/***/ }),
-/* 273 */
+/* 268 */
/***/ (function(module, exports) {
module.exports = function (args, opts) {
@@ -27485,13 +26901,13 @@ function isNumber (x) {
/***/ }),
-/* 274 */
+/* 269 */
/***/ (function(module) {
module.exports = JSON.parse("{\"name\":\"strong-log-transformer\",\"version\":\"2.1.0\",\"description\":\"Stream transformer that prefixes lines with timestamps and other things.\",\"author\":\"Ryan Graham \",\"license\":\"Apache-2.0\",\"repository\":{\"type\":\"git\",\"url\":\"git://github.com/strongloop/strong-log-transformer\"},\"keywords\":[\"logging\",\"streams\"],\"bugs\":{\"url\":\"https://github.com/strongloop/strong-log-transformer/issues\"},\"homepage\":\"https://github.com/strongloop/strong-log-transformer\",\"directories\":{\"test\":\"test\"},\"bin\":{\"sl-log-transformer\":\"bin/sl-log-transformer.js\"},\"main\":\"index.js\",\"scripts\":{\"test\":\"tap --100 test/test-*\"},\"dependencies\":{\"duplexer\":\"^0.1.1\",\"minimist\":\"^1.2.0\",\"through\":\"^2.3.4\"},\"devDependencies\":{\"tap\":\"^12.0.1\"},\"engines\":{\"node\":\">=4\"}}");
/***/ }),
-/* 275 */
+/* 270 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -27504,7 +26920,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(111);
/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(276);
+/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(271);
/* harmony import */ var _fs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(130);
/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(164);
/* harmony import */ var _projects__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(145);
@@ -27599,7 +27015,7 @@ function packagesFromGlobPattern({
}
/***/ }),
-/* 276 */
+/* 271 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -27669,7 +27085,7 @@ function getProjectPaths({
}
/***/ }),
-/* 277 */
+/* 272 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -27677,13 +27093,13 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAllChecksums", function() { return getAllChecksums; });
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(133);
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(278);
+/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(273);
/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(111);
/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var execa__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(232);
+/* harmony import */ var execa__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(227);
/* harmony import */ var execa__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(execa__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _yarn_lock__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(279);
+/* harmony import */ var _yarn_lock__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(274);
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
@@ -27882,20 +27298,20 @@ async function getAllChecksums(kbn, log, yarnLock) {
}
/***/ }),
-/* 278 */
+/* 273 */
/***/ (function(module, exports) {
module.exports = require("crypto");
/***/ }),
-/* 279 */
+/* 274 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "readYarnLock", function() { return readYarnLock; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resolveDepsForProject", function() { return resolveDepsForProject; });
-/* harmony import */ var _yarnpkg_lockfile__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(280);
+/* harmony import */ var _yarnpkg_lockfile__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(275);
/* harmony import */ var _yarnpkg_lockfile__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_yarnpkg_lockfile__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _utils_fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(130);
/*
@@ -28008,7 +27424,7 @@ function resolveDepsForProject({
}
/***/ }),
-/* 280 */
+/* 275 */
/***/ (function(module, exports, __webpack_require__) {
module.exports =
@@ -29567,7 +28983,7 @@ module.exports = invariant;
/* 9 */
/***/ (function(module, exports) {
-module.exports = __webpack_require__(278);
+module.exports = __webpack_require__(273);
/***/ }),
/* 10 */,
@@ -31891,7 +31307,7 @@ function onceStrict (fn) {
/* 63 */
/***/ (function(module, exports) {
-module.exports = __webpack_require__(281);
+module.exports = __webpack_require__(276);
/***/ }),
/* 64 */,
@@ -38286,13 +37702,13 @@ module.exports = process && support(supportLevel);
/******/ ]);
/***/ }),
-/* 281 */
+/* 276 */
/***/ (function(module, exports) {
module.exports = require("buffer");
/***/ }),
-/* 282 */
+/* 277 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -38389,13 +37805,13 @@ class BootstrapCacheFile {
}
/***/ }),
-/* 283 */
+/* 278 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateYarnLock", function() { return validateYarnLock; });
-/* harmony import */ var _yarnpkg_lockfile__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(280);
+/* harmony import */ var _yarnpkg_lockfile__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(275);
/* harmony import */ var _yarnpkg_lockfile__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_yarnpkg_lockfile__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var dedent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
/* harmony import */ var dedent__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dedent__WEBPACK_IMPORTED_MODULE_1__);
@@ -38490,21 +37906,73 @@ async function validateYarnLock(kbn, yarnLock) {
`);
process.exit(1);
+ } // TODO: remove this once we move into a single package.json
+ // look through all the package.json files to find packages which have mismatched version ranges
+
+
+ const depRanges = new Map();
+
+ for (const project of kbn.getAllProjects().values()) {
+ for (const [dep, range] of Object.entries(project.allDependencies)) {
+ const existingDep = depRanges.get(dep);
+
+ if (!existingDep) {
+ depRanges.set(dep, [{
+ range,
+ projects: [project]
+ }]);
+ continue;
+ }
+
+ const existingRange = existingDep.find(existing => existing.range === range);
+
+ if (!existingRange) {
+ existingDep.push({
+ range,
+ projects: [project]
+ });
+ continue;
+ }
+
+ existingRange.projects.push(project);
+ }
+ }
+
+ const duplicateRanges = Array.from(depRanges.entries()).filter(([, ranges]) => ranges.length > 1).reduce((acc, [dep, ranges]) => [...acc, dep, ...ranges.map(({
+ range,
+ projects
+ }) => ` ${range} => ${projects.map(p => p.name).join(', ')}`)], []).join('\n ');
+
+ if (duplicateRanges) {
+ _log__WEBPACK_IMPORTED_MODULE_3__["log"].error(dedent__WEBPACK_IMPORTED_MODULE_1___default.a`
+
+ [single_version_dependencies] Multiple version ranges for the same dependency
+ were found declared across different package.json files. Please consolidate
+ those to match across all package.json files. Different versions for the
+ same dependency is not supported.
+
+ If you have questions about this please reach out to the operations team.
+
+ The conflicting dependencies are:
+
+ ${duplicateRanges}
+ `);
+ process.exit(1);
}
_log__WEBPACK_IMPORTED_MODULE_3__["log"].success('yarn.lock analysis completed without any issues');
}
/***/ }),
-/* 284 */
+/* 279 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CleanCommand", function() { return CleanCommand; });
-/* harmony import */ var del__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(285);
+/* harmony import */ var del__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(280);
/* harmony import */ var del__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(del__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var ora__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(372);
+/* harmony import */ var ora__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(367);
/* harmony import */ var ora__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(ora__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4);
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__);
@@ -38604,21 +38072,21 @@ const CleanCommand = {
};
/***/ }),
-/* 285 */
+/* 280 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const {promisify} = __webpack_require__(111);
const path = __webpack_require__(4);
-const globby = __webpack_require__(286);
-const isGlob = __webpack_require__(364);
-const slash = __webpack_require__(362);
+const globby = __webpack_require__(281);
+const isGlob = __webpack_require__(359);
+const slash = __webpack_require__(357);
const gracefulFs = __webpack_require__(132);
-const isPathCwd = __webpack_require__(365);
-const isPathInside = __webpack_require__(366);
-const rimraf = __webpack_require__(367);
-const pMap = __webpack_require__(368);
+const isPathCwd = __webpack_require__(360);
+const isPathInside = __webpack_require__(361);
+const rimraf = __webpack_require__(362);
+const pMap = __webpack_require__(363);
const rimrafP = promisify(rimraf);
@@ -38732,19 +38200,19 @@ module.exports.sync = (patterns, {force, dryRun, cwd = process.cwd(), ...options
/***/ }),
-/* 286 */
+/* 281 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const fs = __webpack_require__(133);
-const arrayUnion = __webpack_require__(287);
-const merge2 = __webpack_require__(288);
+const arrayUnion = __webpack_require__(282);
+const merge2 = __webpack_require__(283);
const glob = __webpack_require__(146);
-const fastGlob = __webpack_require__(289);
-const dirGlob = __webpack_require__(358);
-const gitignore = __webpack_require__(360);
-const {FilterStream, UniqueStream} = __webpack_require__(363);
+const fastGlob = __webpack_require__(284);
+const dirGlob = __webpack_require__(353);
+const gitignore = __webpack_require__(355);
+const {FilterStream, UniqueStream} = __webpack_require__(358);
const DEFAULT_FILTER = () => false;
@@ -38917,7 +38385,7 @@ module.exports.gitignore = gitignore;
/***/ }),
-/* 287 */
+/* 282 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -38929,7 +38397,7 @@ module.exports = (...arguments_) => {
/***/ }),
-/* 288 */
+/* 283 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -39080,17 +38548,17 @@ function pauseStreams (streams, options) {
/***/ }),
-/* 289 */
+/* 284 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const taskManager = __webpack_require__(290);
-const async_1 = __webpack_require__(319);
-const stream_1 = __webpack_require__(354);
-const sync_1 = __webpack_require__(355);
-const settings_1 = __webpack_require__(357);
-const utils = __webpack_require__(291);
+const taskManager = __webpack_require__(285);
+const async_1 = __webpack_require__(314);
+const stream_1 = __webpack_require__(349);
+const sync_1 = __webpack_require__(350);
+const settings_1 = __webpack_require__(352);
+const utils = __webpack_require__(286);
async function FastGlob(source, options) {
assertPatternsInput(source);
const works = getWorks(source, async_1.default, options);
@@ -39154,13 +38622,13 @@ module.exports = FastGlob;
/***/ }),
-/* 290 */
+/* 285 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const utils = __webpack_require__(291);
+const utils = __webpack_require__(286);
function generate(patterns, settings) {
const positivePatterns = getPositivePatterns(patterns);
const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore);
@@ -39225,30 +38693,30 @@ exports.convertPatternGroupToTask = convertPatternGroupToTask;
/***/ }),
-/* 291 */
+/* 286 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const array = __webpack_require__(292);
+const array = __webpack_require__(287);
exports.array = array;
-const errno = __webpack_require__(293);
+const errno = __webpack_require__(288);
exports.errno = errno;
-const fs = __webpack_require__(294);
+const fs = __webpack_require__(289);
exports.fs = fs;
-const path = __webpack_require__(295);
+const path = __webpack_require__(290);
exports.path = path;
-const pattern = __webpack_require__(296);
+const pattern = __webpack_require__(291);
exports.pattern = pattern;
-const stream = __webpack_require__(317);
+const stream = __webpack_require__(312);
exports.stream = stream;
-const string = __webpack_require__(318);
+const string = __webpack_require__(313);
exports.string = string;
/***/ }),
-/* 292 */
+/* 287 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -39276,7 +38744,7 @@ exports.splitWhen = splitWhen;
/***/ }),
-/* 293 */
+/* 288 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -39289,7 +38757,7 @@ exports.isEnoentCodeError = isEnoentCodeError;
/***/ }),
-/* 294 */
+/* 289 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -39314,7 +38782,7 @@ exports.createDirentFromStats = createDirentFromStats;
/***/ }),
-/* 295 */
+/* 290 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -39353,16 +38821,16 @@ exports.removeLeadingDotSegment = removeLeadingDotSegment;
/***/ }),
-/* 296 */
+/* 291 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const path = __webpack_require__(4);
-const globParent = __webpack_require__(297);
-const micromatch = __webpack_require__(300);
-const picomatch = __webpack_require__(311);
+const globParent = __webpack_require__(292);
+const micromatch = __webpack_require__(295);
+const picomatch = __webpack_require__(306);
const GLOBSTAR = '**';
const ESCAPE_SYMBOL = '\\';
const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
@@ -39472,13 +38940,13 @@ exports.matchAny = matchAny;
/***/ }),
-/* 297 */
+/* 292 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var isGlob = __webpack_require__(298);
+var isGlob = __webpack_require__(293);
var pathPosixDirname = __webpack_require__(4).posix.dirname;
var isWin32 = __webpack_require__(120).platform() === 'win32';
@@ -39520,7 +38988,7 @@ module.exports = function globParent(str, opts) {
/***/ }),
-/* 298 */
+/* 293 */
/***/ (function(module, exports, __webpack_require__) {
/*!
@@ -39530,7 +38998,7 @@ module.exports = function globParent(str, opts) {
* Released under the MIT License.
*/
-var isExtglob = __webpack_require__(299);
+var isExtglob = __webpack_require__(294);
var chars = { '{': '}', '(': ')', '[': ']'};
var strictRegex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
var relaxedRegex = /\\(.)|(^!|[*?{}()[\]]|\(\?)/;
@@ -39574,7 +39042,7 @@ module.exports = function isGlob(str, options) {
/***/ }),
-/* 299 */
+/* 294 */
/***/ (function(module, exports) {
/*!
@@ -39600,16 +39068,16 @@ module.exports = function isExtglob(str) {
/***/ }),
-/* 300 */
+/* 295 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const util = __webpack_require__(111);
-const braces = __webpack_require__(301);
-const picomatch = __webpack_require__(311);
-const utils = __webpack_require__(314);
+const braces = __webpack_require__(296);
+const picomatch = __webpack_require__(306);
+const utils = __webpack_require__(309);
const isEmptyString = val => typeof val === 'string' && (val === '' || val === './');
/**
@@ -40074,16 +39542,16 @@ module.exports = micromatch;
/***/ }),
-/* 301 */
+/* 296 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const stringify = __webpack_require__(302);
-const compile = __webpack_require__(304);
-const expand = __webpack_require__(308);
-const parse = __webpack_require__(309);
+const stringify = __webpack_require__(297);
+const compile = __webpack_require__(299);
+const expand = __webpack_require__(303);
+const parse = __webpack_require__(304);
/**
* Expand the given pattern or create a regex-compatible string.
@@ -40251,13 +39719,13 @@ module.exports = braces;
/***/ }),
-/* 302 */
+/* 297 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const utils = __webpack_require__(303);
+const utils = __webpack_require__(298);
module.exports = (ast, options = {}) => {
let stringify = (node, parent = {}) => {
@@ -40290,7 +39758,7 @@ module.exports = (ast, options = {}) => {
/***/ }),
-/* 303 */
+/* 298 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -40409,14 +39877,14 @@ exports.flatten = (...args) => {
/***/ }),
-/* 304 */
+/* 299 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const fill = __webpack_require__(305);
-const utils = __webpack_require__(303);
+const fill = __webpack_require__(300);
+const utils = __webpack_require__(298);
const compile = (ast, options = {}) => {
let walk = (node, parent = {}) => {
@@ -40473,7 +39941,7 @@ module.exports = compile;
/***/ }),
-/* 305 */
+/* 300 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -40487,7 +39955,7 @@ module.exports = compile;
const util = __webpack_require__(111);
-const toRegexRange = __webpack_require__(306);
+const toRegexRange = __webpack_require__(301);
const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
@@ -40729,7 +40197,7 @@ module.exports = fill;
/***/ }),
-/* 306 */
+/* 301 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -40742,7 +40210,7 @@ module.exports = fill;
-const isNumber = __webpack_require__(307);
+const isNumber = __webpack_require__(302);
const toRegexRange = (min, max, options) => {
if (isNumber(min) === false) {
@@ -41024,7 +40492,7 @@ module.exports = toRegexRange;
/***/ }),
-/* 307 */
+/* 302 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -41049,15 +40517,15 @@ module.exports = function(num) {
/***/ }),
-/* 308 */
+/* 303 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const fill = __webpack_require__(305);
-const stringify = __webpack_require__(302);
-const utils = __webpack_require__(303);
+const fill = __webpack_require__(300);
+const stringify = __webpack_require__(297);
+const utils = __webpack_require__(298);
const append = (queue = '', stash = '', enclose = false) => {
let result = [];
@@ -41169,13 +40637,13 @@ module.exports = expand;
/***/ }),
-/* 309 */
+/* 304 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const stringify = __webpack_require__(302);
+const stringify = __webpack_require__(297);
/**
* Constants
@@ -41197,7 +40665,7 @@ const {
CHAR_SINGLE_QUOTE, /* ' */
CHAR_NO_BREAK_SPACE,
CHAR_ZERO_WIDTH_NOBREAK_SPACE
-} = __webpack_require__(310);
+} = __webpack_require__(305);
/**
* parse
@@ -41509,7 +40977,7 @@ module.exports = parse;
/***/ }),
-/* 310 */
+/* 305 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -41573,27 +41041,27 @@ module.exports = {
/***/ }),
-/* 311 */
+/* 306 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-module.exports = __webpack_require__(312);
+module.exports = __webpack_require__(307);
/***/ }),
-/* 312 */
+/* 307 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const path = __webpack_require__(4);
-const scan = __webpack_require__(313);
-const parse = __webpack_require__(316);
-const utils = __webpack_require__(314);
-const constants = __webpack_require__(315);
+const scan = __webpack_require__(308);
+const parse = __webpack_require__(311);
+const utils = __webpack_require__(309);
+const constants = __webpack_require__(310);
const isObject = val => val && typeof val === 'object' && !Array.isArray(val);
/**
@@ -41929,13 +41397,13 @@ module.exports = picomatch;
/***/ }),
-/* 313 */
+/* 308 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const utils = __webpack_require__(314);
+const utils = __webpack_require__(309);
const {
CHAR_ASTERISK, /* * */
CHAR_AT, /* @ */
@@ -41952,7 +41420,7 @@ const {
CHAR_RIGHT_CURLY_BRACE, /* } */
CHAR_RIGHT_PARENTHESES, /* ) */
CHAR_RIGHT_SQUARE_BRACKET /* ] */
-} = __webpack_require__(315);
+} = __webpack_require__(310);
const isPathSeparator = code => {
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
@@ -42319,7 +41787,7 @@ module.exports = scan;
/***/ }),
-/* 314 */
+/* 309 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -42332,7 +41800,7 @@ const {
REGEX_REMOVE_BACKSLASH,
REGEX_SPECIAL_CHARS,
REGEX_SPECIAL_CHARS_GLOBAL
-} = __webpack_require__(315);
+} = __webpack_require__(310);
exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
@@ -42390,7 +41858,7 @@ exports.wrapOutput = (input, state = {}, options = {}) => {
/***/ }),
-/* 315 */
+/* 310 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -42576,14 +42044,14 @@ module.exports = {
/***/ }),
-/* 316 */
+/* 311 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const constants = __webpack_require__(315);
-const utils = __webpack_require__(314);
+const constants = __webpack_require__(310);
+const utils = __webpack_require__(309);
/**
* Constants
@@ -43661,13 +43129,13 @@ module.exports = parse;
/***/ }),
-/* 317 */
+/* 312 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const merge2 = __webpack_require__(288);
+const merge2 = __webpack_require__(283);
function merge(streams) {
const mergedStream = merge2(streams);
streams.forEach((stream) => {
@@ -43684,7 +43152,7 @@ function propagateCloseEventToSources(streams) {
/***/ }),
-/* 318 */
+/* 313 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -43701,14 +43169,14 @@ exports.isEmpty = isEmpty;
/***/ }),
-/* 319 */
+/* 314 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const stream_1 = __webpack_require__(320);
-const provider_1 = __webpack_require__(347);
+const stream_1 = __webpack_require__(315);
+const provider_1 = __webpack_require__(342);
class ProviderAsync extends provider_1.default {
constructor() {
super(...arguments);
@@ -43736,16 +43204,16 @@ exports.default = ProviderAsync;
/***/ }),
-/* 320 */
+/* 315 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const stream_1 = __webpack_require__(137);
-const fsStat = __webpack_require__(321);
-const fsWalk = __webpack_require__(326);
-const reader_1 = __webpack_require__(346);
+const fsStat = __webpack_require__(316);
+const fsWalk = __webpack_require__(321);
+const reader_1 = __webpack_require__(341);
class ReaderStream extends reader_1.default {
constructor() {
super(...arguments);
@@ -43798,15 +43266,15 @@ exports.default = ReaderStream;
/***/ }),
-/* 321 */
+/* 316 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const async = __webpack_require__(322);
-const sync = __webpack_require__(323);
-const settings_1 = __webpack_require__(324);
+const async = __webpack_require__(317);
+const sync = __webpack_require__(318);
+const settings_1 = __webpack_require__(319);
exports.Settings = settings_1.default;
function stat(path, optionsOrSettingsOrCallback, callback) {
if (typeof optionsOrSettingsOrCallback === 'function') {
@@ -43829,7 +43297,7 @@ function getSettings(settingsOrOptions = {}) {
/***/ }),
-/* 322 */
+/* 317 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -43867,7 +43335,7 @@ function callSuccessCallback(callback, result) {
/***/ }),
-/* 323 */
+/* 318 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -43896,13 +43364,13 @@ exports.read = read;
/***/ }),
-/* 324 */
+/* 319 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const fs = __webpack_require__(325);
+const fs = __webpack_require__(320);
class Settings {
constructor(_options = {}) {
this._options = _options;
@@ -43919,7 +43387,7 @@ exports.default = Settings;
/***/ }),
-/* 325 */
+/* 320 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -43942,16 +43410,16 @@ exports.createFileSystemAdapter = createFileSystemAdapter;
/***/ }),
-/* 326 */
+/* 321 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const async_1 = __webpack_require__(327);
-const stream_1 = __webpack_require__(342);
-const sync_1 = __webpack_require__(343);
-const settings_1 = __webpack_require__(345);
+const async_1 = __webpack_require__(322);
+const stream_1 = __webpack_require__(337);
+const sync_1 = __webpack_require__(338);
+const settings_1 = __webpack_require__(340);
exports.Settings = settings_1.default;
function walk(directory, optionsOrSettingsOrCallback, callback) {
if (typeof optionsOrSettingsOrCallback === 'function') {
@@ -43981,13 +43449,13 @@ function getSettings(settingsOrOptions = {}) {
/***/ }),
-/* 327 */
+/* 322 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const async_1 = __webpack_require__(328);
+const async_1 = __webpack_require__(323);
class AsyncProvider {
constructor(_root, _settings) {
this._root = _root;
@@ -44018,17 +43486,17 @@ function callSuccessCallback(callback, entries) {
/***/ }),
-/* 328 */
+/* 323 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const events_1 = __webpack_require__(155);
-const fsScandir = __webpack_require__(329);
-const fastq = __webpack_require__(338);
-const common = __webpack_require__(340);
-const reader_1 = __webpack_require__(341);
+const fsScandir = __webpack_require__(324);
+const fastq = __webpack_require__(333);
+const common = __webpack_require__(335);
+const reader_1 = __webpack_require__(336);
class AsyncReader extends reader_1.default {
constructor(_root, _settings) {
super(_root, _settings);
@@ -44118,15 +43586,15 @@ exports.default = AsyncReader;
/***/ }),
-/* 329 */
+/* 324 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const async = __webpack_require__(330);
-const sync = __webpack_require__(335);
-const settings_1 = __webpack_require__(336);
+const async = __webpack_require__(325);
+const sync = __webpack_require__(330);
+const settings_1 = __webpack_require__(331);
exports.Settings = settings_1.default;
function scandir(path, optionsOrSettingsOrCallback, callback) {
if (typeof optionsOrSettingsOrCallback === 'function') {
@@ -44149,16 +43617,16 @@ function getSettings(settingsOrOptions = {}) {
/***/ }),
-/* 330 */
+/* 325 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const fsStat = __webpack_require__(321);
-const rpl = __webpack_require__(331);
-const constants_1 = __webpack_require__(332);
-const utils = __webpack_require__(333);
+const fsStat = __webpack_require__(316);
+const rpl = __webpack_require__(326);
+const constants_1 = __webpack_require__(327);
+const utils = __webpack_require__(328);
function read(directory, settings, callback) {
if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
return readdirWithFileTypes(directory, settings, callback);
@@ -44246,7 +43714,7 @@ function callSuccessCallback(callback, result) {
/***/ }),
-/* 331 */
+/* 326 */
/***/ (function(module, exports) {
module.exports = runParallel
@@ -44300,7 +43768,7 @@ function runParallel (tasks, cb) {
/***/ }),
-/* 332 */
+/* 327 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -44320,18 +43788,18 @@ exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_B
/***/ }),
-/* 333 */
+/* 328 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const fs = __webpack_require__(334);
+const fs = __webpack_require__(329);
exports.fs = fs;
/***/ }),
-/* 334 */
+/* 329 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -44356,15 +43824,15 @@ exports.createDirentFromStats = createDirentFromStats;
/***/ }),
-/* 335 */
+/* 330 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const fsStat = __webpack_require__(321);
-const constants_1 = __webpack_require__(332);
-const utils = __webpack_require__(333);
+const fsStat = __webpack_require__(316);
+const constants_1 = __webpack_require__(327);
+const utils = __webpack_require__(328);
function read(directory, settings) {
if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
return readdirWithFileTypes(directory, settings);
@@ -44415,15 +43883,15 @@ exports.readdir = readdir;
/***/ }),
-/* 336 */
+/* 331 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const path = __webpack_require__(4);
-const fsStat = __webpack_require__(321);
-const fs = __webpack_require__(337);
+const fsStat = __webpack_require__(316);
+const fs = __webpack_require__(332);
class Settings {
constructor(_options = {}) {
this._options = _options;
@@ -44446,7 +43914,7 @@ exports.default = Settings;
/***/ }),
-/* 337 */
+/* 332 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -44471,13 +43939,13 @@ exports.createFileSystemAdapter = createFileSystemAdapter;
/***/ }),
-/* 338 */
+/* 333 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var reusify = __webpack_require__(339)
+var reusify = __webpack_require__(334)
function fastqueue (context, worker, concurrency) {
if (typeof context === 'function') {
@@ -44651,7 +44119,7 @@ module.exports = fastqueue
/***/ }),
-/* 339 */
+/* 334 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -44691,7 +44159,7 @@ module.exports = reusify
/***/ }),
-/* 340 */
+/* 335 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -44722,13 +44190,13 @@ exports.joinPathSegments = joinPathSegments;
/***/ }),
-/* 341 */
+/* 336 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const common = __webpack_require__(340);
+const common = __webpack_require__(335);
class Reader {
constructor(_root, _settings) {
this._root = _root;
@@ -44740,14 +44208,14 @@ exports.default = Reader;
/***/ }),
-/* 342 */
+/* 337 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const stream_1 = __webpack_require__(137);
-const async_1 = __webpack_require__(328);
+const async_1 = __webpack_require__(323);
class StreamProvider {
constructor(_root, _settings) {
this._root = _root;
@@ -44777,13 +44245,13 @@ exports.default = StreamProvider;
/***/ }),
-/* 343 */
+/* 338 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const sync_1 = __webpack_require__(344);
+const sync_1 = __webpack_require__(339);
class SyncProvider {
constructor(_root, _settings) {
this._root = _root;
@@ -44798,15 +44266,15 @@ exports.default = SyncProvider;
/***/ }),
-/* 344 */
+/* 339 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const fsScandir = __webpack_require__(329);
-const common = __webpack_require__(340);
-const reader_1 = __webpack_require__(341);
+const fsScandir = __webpack_require__(324);
+const common = __webpack_require__(335);
+const reader_1 = __webpack_require__(336);
class SyncReader extends reader_1.default {
constructor() {
super(...arguments);
@@ -44864,14 +44332,14 @@ exports.default = SyncReader;
/***/ }),
-/* 345 */
+/* 340 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const path = __webpack_require__(4);
-const fsScandir = __webpack_require__(329);
+const fsScandir = __webpack_require__(324);
class Settings {
constructor(_options = {}) {
this._options = _options;
@@ -44897,15 +44365,15 @@ exports.default = Settings;
/***/ }),
-/* 346 */
+/* 341 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const path = __webpack_require__(4);
-const fsStat = __webpack_require__(321);
-const utils = __webpack_require__(291);
+const fsStat = __webpack_require__(316);
+const utils = __webpack_require__(286);
class Reader {
constructor(_settings) {
this._settings = _settings;
@@ -44937,17 +44405,17 @@ exports.default = Reader;
/***/ }),
-/* 347 */
+/* 342 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const path = __webpack_require__(4);
-const deep_1 = __webpack_require__(348);
-const entry_1 = __webpack_require__(351);
-const error_1 = __webpack_require__(352);
-const entry_2 = __webpack_require__(353);
+const deep_1 = __webpack_require__(343);
+const entry_1 = __webpack_require__(346);
+const error_1 = __webpack_require__(347);
+const entry_2 = __webpack_require__(348);
class Provider {
constructor(_settings) {
this._settings = _settings;
@@ -44992,14 +44460,14 @@ exports.default = Provider;
/***/ }),
-/* 348 */
+/* 343 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const utils = __webpack_require__(291);
-const partial_1 = __webpack_require__(349);
+const utils = __webpack_require__(286);
+const partial_1 = __webpack_require__(344);
class DeepFilter {
constructor(_settings, _micromatchOptions) {
this._settings = _settings;
@@ -45053,13 +44521,13 @@ exports.default = DeepFilter;
/***/ }),
-/* 349 */
+/* 344 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const matcher_1 = __webpack_require__(350);
+const matcher_1 = __webpack_require__(345);
class PartialMatcher extends matcher_1.default {
match(filepath) {
const parts = filepath.split('/');
@@ -45098,13 +44566,13 @@ exports.default = PartialMatcher;
/***/ }),
-/* 350 */
+/* 345 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const utils = __webpack_require__(291);
+const utils = __webpack_require__(286);
class Matcher {
constructor(_patterns, _settings, _micromatchOptions) {
this._patterns = _patterns;
@@ -45155,13 +44623,13 @@ exports.default = Matcher;
/***/ }),
-/* 351 */
+/* 346 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const utils = __webpack_require__(291);
+const utils = __webpack_require__(286);
class EntryFilter {
constructor(_settings, _micromatchOptions) {
this._settings = _settings;
@@ -45217,13 +44685,13 @@ exports.default = EntryFilter;
/***/ }),
-/* 352 */
+/* 347 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const utils = __webpack_require__(291);
+const utils = __webpack_require__(286);
class ErrorFilter {
constructor(_settings) {
this._settings = _settings;
@@ -45239,13 +44707,13 @@ exports.default = ErrorFilter;
/***/ }),
-/* 353 */
+/* 348 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const utils = __webpack_require__(291);
+const utils = __webpack_require__(286);
class EntryTransformer {
constructor(_settings) {
this._settings = _settings;
@@ -45272,15 +44740,15 @@ exports.default = EntryTransformer;
/***/ }),
-/* 354 */
+/* 349 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const stream_1 = __webpack_require__(137);
-const stream_2 = __webpack_require__(320);
-const provider_1 = __webpack_require__(347);
+const stream_2 = __webpack_require__(315);
+const provider_1 = __webpack_require__(342);
class ProviderStream extends provider_1.default {
constructor() {
super(...arguments);
@@ -45310,14 +44778,14 @@ exports.default = ProviderStream;
/***/ }),
-/* 355 */
+/* 350 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const sync_1 = __webpack_require__(356);
-const provider_1 = __webpack_require__(347);
+const sync_1 = __webpack_require__(351);
+const provider_1 = __webpack_require__(342);
class ProviderSync extends provider_1.default {
constructor() {
super(...arguments);
@@ -45340,15 +44808,15 @@ exports.default = ProviderSync;
/***/ }),
-/* 356 */
+/* 351 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const fsStat = __webpack_require__(321);
-const fsWalk = __webpack_require__(326);
-const reader_1 = __webpack_require__(346);
+const fsStat = __webpack_require__(316);
+const fsWalk = __webpack_require__(321);
+const reader_1 = __webpack_require__(341);
class ReaderSync extends reader_1.default {
constructor() {
super(...arguments);
@@ -45390,7 +44858,7 @@ exports.default = ReaderSync;
/***/ }),
-/* 357 */
+/* 352 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -45449,13 +44917,13 @@ exports.default = Settings;
/***/ }),
-/* 358 */
+/* 353 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const path = __webpack_require__(4);
-const pathType = __webpack_require__(359);
+const pathType = __webpack_require__(354);
const getExtensions = extensions => extensions.length > 1 ? `{${extensions.join(',')}}` : extensions[0];
@@ -45531,7 +44999,7 @@ module.exports.sync = (input, options) => {
/***/ }),
-/* 359 */
+/* 354 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -45581,7 +45049,7 @@ exports.isSymlinkSync = isTypeSync.bind(null, 'lstatSync', 'isSymbolicLink');
/***/ }),
-/* 360 */
+/* 355 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -45589,9 +45057,9 @@ exports.isSymlinkSync = isTypeSync.bind(null, 'lstatSync', 'isSymbolicLink');
const {promisify} = __webpack_require__(111);
const fs = __webpack_require__(133);
const path = __webpack_require__(4);
-const fastGlob = __webpack_require__(289);
-const gitIgnore = __webpack_require__(361);
-const slash = __webpack_require__(362);
+const fastGlob = __webpack_require__(284);
+const gitIgnore = __webpack_require__(356);
+const slash = __webpack_require__(357);
const DEFAULT_IGNORE = [
'**/node_modules/**',
@@ -45705,7 +45173,7 @@ module.exports.sync = options => {
/***/ }),
-/* 361 */
+/* 356 */
/***/ (function(module, exports) {
// A simple implementation of make-array
@@ -46308,7 +45776,7 @@ if (
/***/ }),
-/* 362 */
+/* 357 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -46326,7 +45794,7 @@ module.exports = path => {
/***/ }),
-/* 363 */
+/* 358 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -46379,7 +45847,7 @@ module.exports = {
/***/ }),
-/* 364 */
+/* 359 */
/***/ (function(module, exports, __webpack_require__) {
/*!
@@ -46389,7 +45857,7 @@ module.exports = {
* Released under the MIT License.
*/
-var isExtglob = __webpack_require__(299);
+var isExtglob = __webpack_require__(294);
var chars = { '{': '}', '(': ')', '[': ']'};
var strictRegex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
var relaxedRegex = /\\(.)|(^!|[*?{}()[\]]|\(\?)/;
@@ -46433,7 +45901,7 @@ module.exports = function isGlob(str, options) {
/***/ }),
-/* 365 */
+/* 360 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -46455,7 +45923,7 @@ module.exports = path_ => {
/***/ }),
-/* 366 */
+/* 361 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -46483,7 +45951,7 @@ module.exports = (childPath, parentPath) => {
/***/ }),
-/* 367 */
+/* 362 */
/***/ (function(module, exports, __webpack_require__) {
const assert = __webpack_require__(139)
@@ -46849,12 +46317,12 @@ rimraf.sync = rimrafSync
/***/ }),
-/* 368 */
+/* 363 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const AggregateError = __webpack_require__(369);
+const AggregateError = __webpack_require__(364);
module.exports = async (
iterable,
@@ -46937,13 +46405,13 @@ module.exports = async (
/***/ }),
-/* 369 */
+/* 364 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const indentString = __webpack_require__(370);
-const cleanStack = __webpack_require__(371);
+const indentString = __webpack_require__(365);
+const cleanStack = __webpack_require__(366);
const cleanInternalStack = stack => stack.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g, '');
@@ -46991,7 +46459,7 @@ module.exports = AggregateError;
/***/ }),
-/* 370 */
+/* 365 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -47033,7 +46501,7 @@ module.exports = (string, count = 1, options) => {
/***/ }),
-/* 371 */
+/* 366 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -47080,47 +46548,221 @@ module.exports = (stack, options) => {
/***/ }),
-/* 372 */
+/* 367 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const chalk = __webpack_require__(373);
-const cliCursor = __webpack_require__(378);
-const cliSpinners = __webpack_require__(382);
-const logSymbols = __webpack_require__(384);
+const readline = __webpack_require__(368);
+const chalk = __webpack_require__(369);
+const cliCursor = __webpack_require__(374);
+const cliSpinners = __webpack_require__(376);
+const logSymbols = __webpack_require__(378);
+const stripAnsi = __webpack_require__(384);
+const wcwidth = __webpack_require__(386);
+const isInteractive = __webpack_require__(390);
+const MuteStream = __webpack_require__(391);
+
+const TEXT = Symbol('text');
+const PREFIX_TEXT = Symbol('prefixText');
+
+const ASCII_ETX_CODE = 0x03; // Ctrl+C emits this code
+
+class StdinDiscarder {
+ constructor() {
+ this.requests = 0;
+
+ this.mutedStream = new MuteStream();
+ this.mutedStream.pipe(process.stdout);
+ this.mutedStream.mute();
+
+ const self = this;
+ this.ourEmit = function (event, data, ...args) {
+ const {stdin} = process;
+ if (self.requests > 0 || stdin.emit === self.ourEmit) {
+ if (event === 'keypress') { // Fixes readline behavior
+ return;
+ }
+
+ if (event === 'data' && data.includes(ASCII_ETX_CODE)) {
+ process.emit('SIGINT');
+ }
+
+ Reflect.apply(self.oldEmit, this, [event, data, ...args]);
+ } else {
+ Reflect.apply(process.stdin.emit, this, [event, data, ...args]);
+ }
+ };
+ }
+
+ start() {
+ this.requests++;
+
+ if (this.requests === 1) {
+ this.realStart();
+ }
+ }
+
+ stop() {
+ if (this.requests <= 0) {
+ throw new Error('`stop` called more times than `start`');
+ }
+
+ this.requests--;
+
+ if (this.requests === 0) {
+ this.realStop();
+ }
+ }
+
+ realStart() {
+ // No known way to make it work reliably on Windows
+ if (process.platform === 'win32') {
+ return;
+ }
+
+ this.rl = readline.createInterface({
+ input: process.stdin,
+ output: this.mutedStream
+ });
+
+ this.rl.on('SIGINT', () => {
+ if (process.listenerCount('SIGINT') === 0) {
+ process.emit('SIGINT');
+ } else {
+ this.rl.close();
+ process.kill(process.pid, 'SIGINT');
+ }
+ });
+ }
+
+ realStop() {
+ if (process.platform === 'win32') {
+ return;
+ }
+
+ this.rl.close();
+ this.rl = undefined;
+ }
+}
+
+let stdinDiscarder;
class Ora {
constructor(options) {
+ if (!stdinDiscarder) {
+ stdinDiscarder = new StdinDiscarder();
+ }
+
if (typeof options === 'string') {
options = {
text: options
};
}
- this.options = Object.assign({
+ this.options = {
text: '',
color: 'cyan',
- stream: process.stderr
- }, options);
-
- const sp = this.options.spinner;
- this.spinner = typeof sp === 'object' ? sp : (process.platform === 'win32' ? cliSpinners.line : (cliSpinners[sp] || cliSpinners.dots)); // eslint-disable-line no-nested-ternary
+ stream: process.stderr,
+ discardStdin: true,
+ ...options
+ };
- if (this.spinner.frames === undefined) {
- throw new Error('Spinner must define `frames`');
- }
+ this.spinner = this.options.spinner;
- this.text = this.options.text;
this.color = this.options.color;
+ this.hideCursor = this.options.hideCursor !== false;
this.interval = this.options.interval || this.spinner.interval || 100;
this.stream = this.options.stream;
- this.id = null;
+ this.id = undefined;
+ this.isEnabled = typeof this.options.isEnabled === 'boolean' ? this.options.isEnabled : isInteractive({stream: this.stream});
+
+ // Set *after* `this.stream`
+ this.text = this.options.text;
+ this.prefixText = this.options.prefixText;
+ this.linesToClear = 0;
+ this.indent = this.options.indent;
+ this.discardStdin = this.options.discardStdin;
+ this.isDiscardingStdin = false;
+ }
+
+ get indent() {
+ return this._indent;
+ }
+
+ set indent(indent = 0) {
+ if (!(indent >= 0 && Number.isInteger(indent))) {
+ throw new Error('The `indent` option must be an integer from 0 and up');
+ }
+
+ this._indent = indent;
+ }
+
+ _updateInterval(interval) {
+ if (interval !== undefined) {
+ this.interval = interval;
+ }
+ }
+
+ get spinner() {
+ return this._spinner;
+ }
+
+ set spinner(spinner) {
this.frameIndex = 0;
- this.enabled = typeof this.options.enabled === 'boolean' ? this.options.enabled : ((this.stream && this.stream.isTTY) && !process.env.CI);
+
+ if (typeof spinner === 'object') {
+ if (spinner.frames === undefined) {
+ throw new Error('The given spinner must have a `frames` property');
+ }
+
+ this._spinner = spinner;
+ } else if (process.platform === 'win32') {
+ this._spinner = cliSpinners.line;
+ } else if (spinner === undefined) {
+ // Set default spinner
+ this._spinner = cliSpinners.dots;
+ } else if (cliSpinners[spinner]) {
+ this._spinner = cliSpinners[spinner];
+ } else {
+ throw new Error(`There is no built-in spinner named '${spinner}'. See https://github.com/sindresorhus/cli-spinners/blob/master/spinners.json for a full list.`);
+ }
+
+ this._updateInterval(this._spinner.interval);
+ }
+
+ get text() {
+ return this[TEXT];
+ }
+
+ get prefixText() {
+ return this[PREFIX_TEXT];
+ }
+
+ get isSpinning() {
+ return this.id !== undefined;
}
+
+ updateLineCount() {
+ const columns = this.stream.columns || 80;
+ const fullPrefixText = (typeof this[PREFIX_TEXT] === 'string') ? this[PREFIX_TEXT] + '-' : '';
+ this.lineCount = stripAnsi(fullPrefixText + '--' + this[TEXT]).split('\n').reduce((count, line) => {
+ return count + Math.max(1, Math.ceil(wcwidth(line) / columns));
+ }, 0);
+ }
+
+ set text(value) {
+ this[TEXT] = value;
+ this.updateLineCount();
+ }
+
+ set prefixText(value) {
+ this[PREFIX_TEXT] = value;
+ this.updateLineCount();
+ }
+
frame() {
- const frames = this.spinner.frames;
+ const {frames} = this.spinner;
let frame = frames[this.frameIndex];
if (this.color) {
@@ -47128,92 +46770,129 @@ class Ora {
}
this.frameIndex = ++this.frameIndex % frames.length;
+ const fullPrefixText = (typeof this.prefixText === 'string' && this.prefixText !== '') ? this.prefixText + ' ' : '';
+ const fullText = typeof this.text === 'string' ? ' ' + this.text : '';
- return frame + ' ' + this.text;
+ return fullPrefixText + frame + fullText;
}
+
clear() {
- if (!this.enabled) {
+ if (!this.isEnabled || !this.stream.isTTY) {
return this;
}
- this.stream.clearLine();
- this.stream.cursorTo(0);
+ for (let i = 0; i < this.linesToClear; i++) {
+ if (i > 0) {
+ this.stream.moveCursor(0, -1);
+ }
+
+ this.stream.clearLine();
+ this.stream.cursorTo(this.indent);
+ }
+
+ this.linesToClear = 0;
return this;
}
+
render() {
this.clear();
this.stream.write(this.frame());
+ this.linesToClear = this.lineCount;
return this;
}
+
start(text) {
if (text) {
this.text = text;
}
- if (!this.enabled || this.id) {
+ if (!this.isEnabled) {
+ if (this.text) {
+ this.stream.write(`- ${this.text}\n`);
+ }
+
+ return this;
+ }
+
+ if (this.isSpinning) {
return this;
}
- cliCursor.hide(this.stream);
+ if (this.hideCursor) {
+ cliCursor.hide(this.stream);
+ }
+
+ if (this.discardStdin && process.stdin.isTTY) {
+ this.isDiscardingStdin = true;
+ stdinDiscarder.start();
+ }
+
this.render();
this.id = setInterval(this.render.bind(this), this.interval);
return this;
}
+
stop() {
- if (!this.enabled) {
+ if (!this.isEnabled) {
return this;
}
clearInterval(this.id);
- this.id = null;
+ this.id = undefined;
this.frameIndex = 0;
this.clear();
- cliCursor.show(this.stream);
+ if (this.hideCursor) {
+ cliCursor.show(this.stream);
+ }
+
+ if (this.discardStdin && process.stdin.isTTY && this.isDiscardingStdin) {
+ stdinDiscarder.stop();
+ this.isDiscardingStdin = false;
+ }
return this;
}
+
succeed(text) {
return this.stopAndPersist({symbol: logSymbols.success, text});
}
+
fail(text) {
return this.stopAndPersist({symbol: logSymbols.error, text});
}
+
warn(text) {
return this.stopAndPersist({symbol: logSymbols.warning, text});
}
- info(text) {
- return this.stopAndPersist({symbol: logSymbols.info, text});
- }
- stopAndPersist(options) {
- if (!this.enabled) {
- return this;
- }
- // Legacy argument
- // TODO: Deprecate sometime in the future
- if (typeof options === 'string') {
- options = {
- symbol: options
- };
- }
+ info(text) {
+ return this.stopAndPersist({symbol: logSymbols.info, text});
+ }
- options = options || {};
+ stopAndPersist(options = {}) {
+ const prefixText = options.prefixText || this.prefixText;
+ const fullPrefixText = (typeof prefixText === 'string' && prefixText !== '') ? prefixText + ' ' : '';
+ const text = options.text || this.text;
+ const fullText = (typeof text === 'string') ? ' ' + text : '';
this.stop();
- this.stream.write(`${options.symbol || ' '} ${options.text || this.text}\n`);
+ this.stream.write(`${fullPrefixText}${options.symbol || ' '}${fullText}\n`);
return this;
}
}
-module.exports = function (opts) {
- return new Ora(opts);
+const oraFactory = function (options) {
+ return new Ora(options);
};
+module.exports = oraFactory;
+
module.exports.promise = (action, options) => {
+ // eslint-disable-next-line promise/prefer-await-to-then
if (typeof action.then !== 'function') {
throw new TypeError('Parameter `action` must be a Promise');
}
@@ -47221,451 +46900,298 @@ module.exports.promise = (action, options) => {
const spinner = new Ora(options);
spinner.start();
- action.then(
- () => {
+ (async () => {
+ try {
+ await action;
spinner.succeed();
- },
- () => {
+ } catch (_) {
spinner.fail();
}
- );
+ })();
return spinner;
};
/***/ }),
-/* 373 */
-/***/ (function(module, exports, __webpack_require__) {
+/* 368 */
+/***/ (function(module, exports) {
-"use strict";
+module.exports = require("readline");
-const escapeStringRegexp = __webpack_require__(178);
-const ansiStyles = __webpack_require__(374);
-const stdoutColor = __webpack_require__(375).stdout;
+/***/ }),
+/* 369 */
+/***/ (function(module, exports, __webpack_require__) {
-const template = __webpack_require__(377);
+"use strict";
-const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm');
+const ansiStyles = __webpack_require__(113);
+const {stdout: stdoutColor, stderr: stderrColor} = __webpack_require__(370);
+const {
+ stringReplaceAll,
+ stringEncaseCRLFWithFirstIndex
+} = __webpack_require__(372);
// `supportsColor.level` → `ansiStyles.color[name]` mapping
-const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m'];
-
-// `color-convert` models to exclude from the Chalk API due to conflicts and such
-const skipModels = new Set(['gray']);
+const levelMapping = [
+ 'ansi',
+ 'ansi',
+ 'ansi256',
+ 'ansi16m'
+];
const styles = Object.create(null);
-function applyOptions(obj, options) {
- options = options || {};
+const applyOptions = (object, options = {}) => {
+ if (options.level > 3 || options.level < 0) {
+ throw new Error('The `level` option should be an integer from 0 to 3');
+ }
// Detect level if not set manually
- const scLevel = stdoutColor ? stdoutColor.level : 0;
- obj.level = options.level === undefined ? scLevel : options.level;
- obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0;
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
+ object.level = options.level === undefined ? colorLevel : options.level;
+};
+
+class ChalkClass {
+ constructor(options) {
+ return chalkFactory(options);
+ }
}
-function Chalk(options) {
- // We check for this.template here since calling `chalk.constructor()`
- // by itself will have a `this` of a previously constructed chalk object
- if (!this || !(this instanceof Chalk) || this.template) {
- const chalk = {};
- applyOptions(chalk, options);
+const chalkFactory = options => {
+ const chalk = {};
+ applyOptions(chalk, options);
- chalk.template = function () {
- const args = [].slice.call(arguments);
- return chalkTag.apply(null, [chalk.template].concat(args));
- };
+ chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_);
- Object.setPrototypeOf(chalk, Chalk.prototype);
- Object.setPrototypeOf(chalk.template, chalk);
+ Object.setPrototypeOf(chalk, Chalk.prototype);
+ Object.setPrototypeOf(chalk.template, chalk);
- chalk.template.constructor = Chalk;
+ chalk.template.constructor = () => {
+ throw new Error('`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.');
+ };
- return chalk.template;
- }
+ chalk.template.Instance = ChalkClass;
- applyOptions(this, options);
-}
+ return chalk.template;
+};
-// Use bright blue on Windows as the normal blue color is illegible
-if (isSimpleWindowsTerm) {
- ansiStyles.blue.open = '\u001B[94m';
+function Chalk(options) {
+ return chalkFactory(options);
}
-for (const key of Object.keys(ansiStyles)) {
- ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
-
- styles[key] = {
+for (const [styleName, style] of Object.entries(ansiStyles)) {
+ styles[styleName] = {
get() {
- const codes = ansiStyles[key];
- return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key);
+ const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
+ Object.defineProperty(this, styleName, {value: builder});
+ return builder;
}
};
}
styles.visible = {
get() {
- return build.call(this, this._styles || [], true, 'visible');
+ const builder = createBuilder(this, this._styler, true);
+ Object.defineProperty(this, 'visible', {value: builder});
+ return builder;
}
};
-ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g');
-for (const model of Object.keys(ansiStyles.color.ansi)) {
- if (skipModels.has(model)) {
- continue;
- }
+const usedModels = ['rgb', 'hex', 'keyword', 'hsl', 'hsv', 'hwb', 'ansi', 'ansi256'];
+for (const model of usedModels) {
styles[model] = {
get() {
- const level = this.level;
- return function () {
- const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments);
- const codes = {
- open,
- close: ansiStyles.color.close,
- closeRe: ansiStyles.color.closeRe
- };
- return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
+ const {level} = this;
+ return function (...arguments_) {
+ const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
+ return createBuilder(this, styler, this._isEmpty);
};
}
};
}
-ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g');
-for (const model of Object.keys(ansiStyles.bgColor.ansi)) {
- if (skipModels.has(model)) {
- continue;
- }
-
+for (const model of usedModels) {
const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
styles[bgModel] = {
get() {
- const level = this.level;
- return function () {
- const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments);
- const codes = {
- open,
- close: ansiStyles.bgColor.close,
- closeRe: ansiStyles.bgColor.closeRe
- };
- return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
+ const {level} = this;
+ return function (...arguments_) {
+ const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
+ return createBuilder(this, styler, this._isEmpty);
};
}
};
}
-const proto = Object.defineProperties(() => {}, styles);
-
-function build(_styles, _empty, key) {
- const builder = function () {
- return applyStyle.apply(builder, arguments);
- };
-
- builder._styles = _styles;
- builder._empty = _empty;
-
- const self = this;
-
- Object.defineProperty(builder, 'level', {
+const proto = Object.defineProperties(() => {}, {
+ ...styles,
+ level: {
enumerable: true,
get() {
- return self.level;
+ return this._generator.level;
},
set(level) {
- self.level = level;
+ this._generator.level = level;
}
- });
+ }
+});
- Object.defineProperty(builder, 'enabled', {
- enumerable: true,
- get() {
- return self.enabled;
- },
- set(enabled) {
- self.enabled = enabled;
- }
- });
+const createStyler = (open, close, parent) => {
+ let openAll;
+ let closeAll;
+ if (parent === undefined) {
+ openAll = open;
+ closeAll = close;
+ } else {
+ openAll = parent.openAll + open;
+ closeAll = close + parent.closeAll;
+ }
- // See below for fix regarding invisible grey/dim combination on Windows
- builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey';
+ return {
+ open,
+ close,
+ openAll,
+ closeAll,
+ parent
+ };
+};
+
+const createBuilder = (self, _styler, _isEmpty) => {
+ const builder = (...arguments_) => {
+ // Single argument is hot path, implicit coercion is faster than anything
+ // eslint-disable-next-line no-implicit-coercion
+ return applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));
+ };
// `__proto__` is used because we must return a function, but there is
// no way to create a function with a different prototype
builder.__proto__ = proto; // eslint-disable-line no-proto
- return builder;
-}
+ builder._generator = self;
+ builder._styler = _styler;
+ builder._isEmpty = _isEmpty;
-function applyStyle() {
- // Support varags, but simply cast to string in case there's only one arg
- const args = arguments;
- const argsLen = args.length;
- let str = String(arguments[0]);
+ return builder;
+};
- if (argsLen === 0) {
- return '';
+const applyStyle = (self, string) => {
+ if (self.level <= 0 || !string) {
+ return self._isEmpty ? '' : string;
}
- if (argsLen > 1) {
- // Don't slice `arguments`, it prevents V8 optimizations
- for (let a = 1; a < argsLen; a++) {
- str += ' ' + args[a];
- }
- }
+ let styler = self._styler;
- if (!this.enabled || this.level <= 0 || !str) {
- return this._empty ? '' : str;
+ if (styler === undefined) {
+ return string;
}
- // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe,
- // see https://github.com/chalk/chalk/issues/58
- // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.
- const originalDim = ansiStyles.dim.open;
- if (isSimpleWindowsTerm && this.hasGrey) {
- ansiStyles.dim.open = '';
- }
+ const {openAll, closeAll} = styler;
+ if (string.indexOf('\u001B') !== -1) {
+ while (styler !== undefined) {
+ // Replace any instances already present with a re-opening code
+ // otherwise only the part of the string until said closing code
+ // will be colored, and the rest will simply be 'plain'.
+ string = stringReplaceAll(string, styler.close, styler.open);
- for (const code of this._styles.slice().reverse()) {
- // Replace any instances already present with a re-opening code
- // otherwise only the part of the string until said closing code
- // will be colored, and the rest will simply be 'plain'.
- str = code.open + str.replace(code.closeRe, code.open) + code.close;
+ styler = styler.parent;
+ }
+ }
- // Close the styling before a linebreak and reopen
- // after next line to fix a bleed issue on macOS
- // https://github.com/chalk/chalk/pull/92
- str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`);
+ // We can move both next actions out of loop, because remaining actions in loop won't have
+ // any/visible effect on parts we add here. Close the styling before a linebreak and reopen
+ // after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92
+ const lfIndex = string.indexOf('\n');
+ if (lfIndex !== -1) {
+ string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
}
- // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue
- ansiStyles.dim.open = originalDim;
+ return openAll + string + closeAll;
+};
- return str;
-}
+let template;
+const chalkTag = (chalk, ...strings) => {
+ const [firstString] = strings;
-function chalkTag(chalk, strings) {
- if (!Array.isArray(strings)) {
+ if (!Array.isArray(firstString)) {
// If chalk() was called by itself or with a string,
// return the string itself as a string.
- return [].slice.call(arguments, 1).join(' ');
+ return strings.join(' ');
}
- const args = [].slice.call(arguments, 2);
- const parts = [strings.raw[0]];
+ const arguments_ = strings.slice(1);
+ const parts = [firstString.raw[0]];
- for (let i = 1; i < strings.length; i++) {
- parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&'));
- parts.push(String(strings.raw[i]));
+ for (let i = 1; i < firstString.length; i++) {
+ parts.push(
+ String(arguments_[i - 1]).replace(/[{}\\]/g, '\\$&'),
+ String(firstString.raw[i])
+ );
+ }
+
+ if (template === undefined) {
+ template = __webpack_require__(373);
}
return template(chalk, parts.join(''));
-}
+};
Object.defineProperties(Chalk.prototype, styles);
-module.exports = Chalk(); // eslint-disable-line new-cap
-module.exports.supportsColor = stdoutColor;
-module.exports.default = module.exports; // For TypeScript
-
-
-/***/ }),
-/* 374 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* WEBPACK VAR INJECTION */(function(module) {
-const colorConvert = __webpack_require__(180);
-
-const wrapAnsi16 = (fn, offset) => function () {
- const code = fn.apply(colorConvert, arguments);
- return `\u001B[${code + offset}m`;
-};
-
-const wrapAnsi256 = (fn, offset) => function () {
- const code = fn.apply(colorConvert, arguments);
- return `\u001B[${38 + offset};5;${code}m`;
-};
+const chalk = Chalk(); // eslint-disable-line new-cap
+chalk.supportsColor = stdoutColor;
+chalk.stderr = Chalk({level: stderrColor ? stderrColor.level : 0}); // eslint-disable-line new-cap
+chalk.stderr.supportsColor = stderrColor;
-const wrapAnsi16m = (fn, offset) => function () {
- const rgb = fn.apply(colorConvert, arguments);
- return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
+// For TypeScript
+chalk.Level = {
+ None: 0,
+ Basic: 1,
+ Ansi256: 2,
+ TrueColor: 3,
+ 0: 'None',
+ 1: 'Basic',
+ 2: 'Ansi256',
+ 3: 'TrueColor'
};
-function assembleStyles() {
- const codes = new Map();
- const styles = {
- modifier: {
- reset: [0, 0],
- // 21 isn't widely supported and 22 does the same thing
- bold: [1, 22],
- dim: [2, 22],
- italic: [3, 23],
- underline: [4, 24],
- inverse: [7, 27],
- hidden: [8, 28],
- strikethrough: [9, 29]
- },
- color: {
- black: [30, 39],
- red: [31, 39],
- green: [32, 39],
- yellow: [33, 39],
- blue: [34, 39],
- magenta: [35, 39],
- cyan: [36, 39],
- white: [37, 39],
- gray: [90, 39],
-
- // Bright color
- redBright: [91, 39],
- greenBright: [92, 39],
- yellowBright: [93, 39],
- blueBright: [94, 39],
- magentaBright: [95, 39],
- cyanBright: [96, 39],
- whiteBright: [97, 39]
- },
- bgColor: {
- bgBlack: [40, 49],
- bgRed: [41, 49],
- bgGreen: [42, 49],
- bgYellow: [43, 49],
- bgBlue: [44, 49],
- bgMagenta: [45, 49],
- bgCyan: [46, 49],
- bgWhite: [47, 49],
-
- // Bright color
- bgBlackBright: [100, 49],
- bgRedBright: [101, 49],
- bgGreenBright: [102, 49],
- bgYellowBright: [103, 49],
- bgBlueBright: [104, 49],
- bgMagentaBright: [105, 49],
- bgCyanBright: [106, 49],
- bgWhiteBright: [107, 49]
- }
- };
-
- // Fix humans
- styles.color.grey = styles.color.gray;
-
- for (const groupName of Object.keys(styles)) {
- const group = styles[groupName];
-
- for (const styleName of Object.keys(group)) {
- const style = group[styleName];
-
- styles[styleName] = {
- open: `\u001B[${style[0]}m`,
- close: `\u001B[${style[1]}m`
- };
-
- group[styleName] = styles[styleName];
-
- codes.set(style[0], style[1]);
- }
-
- Object.defineProperty(styles, groupName, {
- value: group,
- enumerable: false
- });
-
- Object.defineProperty(styles, 'codes', {
- value: codes,
- enumerable: false
- });
- }
-
- const ansi2ansi = n => n;
- const rgb2rgb = (r, g, b) => [r, g, b];
-
- styles.color.close = '\u001B[39m';
- styles.bgColor.close = '\u001B[49m';
-
- styles.color.ansi = {
- ansi: wrapAnsi16(ansi2ansi, 0)
- };
- styles.color.ansi256 = {
- ansi256: wrapAnsi256(ansi2ansi, 0)
- };
- styles.color.ansi16m = {
- rgb: wrapAnsi16m(rgb2rgb, 0)
- };
-
- styles.bgColor.ansi = {
- ansi: wrapAnsi16(ansi2ansi, 10)
- };
- styles.bgColor.ansi256 = {
- ansi256: wrapAnsi256(ansi2ansi, 10)
- };
- styles.bgColor.ansi16m = {
- rgb: wrapAnsi16m(rgb2rgb, 10)
- };
-
- for (let key of Object.keys(colorConvert)) {
- if (typeof colorConvert[key] !== 'object') {
- continue;
- }
-
- const suite = colorConvert[key];
-
- if (key === 'ansi16') {
- key = 'ansi';
- }
-
- if ('ansi16' in suite) {
- styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);
- styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10);
- }
-
- if ('ansi256' in suite) {
- styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0);
- styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10);
- }
-
- if ('rgb' in suite) {
- styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0);
- styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10);
- }
- }
-
- return styles;
-}
-
-// Make the export immutable
-Object.defineProperty(module, 'exports', {
- enumerable: true,
- get: assembleStyles
-});
+module.exports = chalk;
-/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(114)(module)))
/***/ }),
-/* 375 */
+/* 370 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const os = __webpack_require__(120);
-const hasFlag = __webpack_require__(376);
+const tty = __webpack_require__(121);
+const hasFlag = __webpack_require__(371);
-const env = process.env;
+const {env} = process;
let forceColor;
if (hasFlag('no-color') ||
hasFlag('no-colors') ||
- hasFlag('color=false')) {
- forceColor = false;
+ hasFlag('color=false') ||
+ hasFlag('color=never')) {
+ forceColor = 0;
} else if (hasFlag('color') ||
hasFlag('colors') ||
hasFlag('color=true') ||
hasFlag('color=always')) {
- forceColor = true;
+ forceColor = 1;
}
+
if ('FORCE_COLOR' in env) {
- forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
+ if (env.FORCE_COLOR === 'true') {
+ forceColor = 1;
+ } else if (env.FORCE_COLOR === 'false') {
+ forceColor = 0;
+ } else {
+ forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
+ }
}
function translateLevel(level) {
@@ -47681,8 +47207,8 @@ function translateLevel(level) {
};
}
-function supportsColor(stream) {
- if (forceColor === false) {
+function supportsColor(haveStream, streamIsTTY) {
+ if (forceColor === 0) {
return 0;
}
@@ -47696,22 +47222,21 @@ function supportsColor(stream) {
return 2;
}
- if (stream && !stream.isTTY && forceColor !== true) {
+ if (haveStream && !streamIsTTY && forceColor === undefined) {
return 0;
}
- const min = forceColor ? 1 : 0;
+ const min = forceColor || 0;
+
+ if (env.TERM === 'dumb') {
+ return min;
+ }
if (process.platform === 'win32') {
- // Node.js 7.5.0 is the first version of Node.js to include a patch to
- // libuv that enables 256 color output on Windows. Anything earlier and it
- // won't work. However, here we target Node.js 8 at minimum as it is an LTS
- // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
- // release that supports 256 colors. Windows 10 build 14931 is the first release
- // that supports 16m/TrueColor.
+ // Windows 10 build 10586 is the first Windows release that supports 256 colors.
+ // Windows 10 build 14931 is the first release that supports 16m/TrueColor.
const osRelease = os.release().split('.');
if (
- Number(process.versions.node.split('.')[0]) >= 8 &&
Number(osRelease[0]) >= 10 &&
Number(osRelease[2]) >= 10586
) {
@@ -47733,6 +47258,10 @@ function supportsColor(stream) {
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
}
+ if ('GITHUB_ACTIONS' in env) {
+ return 1;
+ }
+
if (env.COLORTERM === 'truecolor') {
return 3;
}
@@ -47761,50 +47290,92 @@ function supportsColor(stream) {
return 1;
}
- if (env.TERM === 'dumb') {
- return min;
- }
-
return min;
}
function getSupportLevel(stream) {
- const level = supportsColor(stream);
+ const level = supportsColor(stream, stream && stream.isTTY);
return translateLevel(level);
}
module.exports = {
supportsColor: getSupportLevel,
- stdout: getSupportLevel(process.stdout),
- stderr: getSupportLevel(process.stderr)
+ stdout: translateLevel(supportsColor(true, tty.isatty(1))),
+ stderr: translateLevel(supportsColor(true, tty.isatty(2)))
};
/***/ }),
-/* 376 */
+/* 371 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-module.exports = (flag, argv) => {
- argv = argv || process.argv;
+
+module.exports = (flag, argv = process.argv) => {
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
- const pos = argv.indexOf(prefix + flag);
- const terminatorPos = argv.indexOf('--');
- return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
+ const position = argv.indexOf(prefix + flag);
+ const terminatorPosition = argv.indexOf('--');
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
};
/***/ }),
-/* 377 */
+/* 372 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
+
+const stringReplaceAll = (string, substring, replacer) => {
+ let index = string.indexOf(substring);
+ if (index === -1) {
+ return string;
+ }
+
+ const substringLength = substring.length;
+ let endIndex = 0;
+ let returnValue = '';
+ do {
+ returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
+ endIndex = index + substringLength;
+ index = string.indexOf(substring, endIndex);
+ } while (index !== -1);
+
+ returnValue += string.substr(endIndex);
+ return returnValue;
+};
+
+const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
+ let endIndex = 0;
+ let returnValue = '';
+ do {
+ const gotCR = string[index - 1] === '\r';
+ returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? '\r\n' : '\n') + postfix;
+ endIndex = index + 1;
+ index = string.indexOf('\n', endIndex);
+ } while (index !== -1);
+
+ returnValue += string.substr(endIndex);
+ return returnValue;
+};
+
+module.exports = {
+ stringReplaceAll,
+ stringEncaseCRLFWithFirstIndex
+};
+
+
+/***/ }),
+/* 373 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
-const ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;
+const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi;
const ESCAPES = new Map([
['n', '\n'],
@@ -47820,23 +47391,31 @@ const ESCAPES = new Map([
]);
function unescape(c) {
- if ((c[0] === 'u' && c.length === 5) || (c[0] === 'x' && c.length === 3)) {
+ const u = c[0] === 'u';
+ const bracket = c[1] === '{';
+
+ if ((u && !bracket && c.length === 5) || (c[0] === 'x' && c.length === 3)) {
return String.fromCharCode(parseInt(c.slice(1), 16));
}
+ if (u && bracket) {
+ return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
+ }
+
return ESCAPES.get(c) || c;
}
-function parseArguments(name, args) {
+function parseArguments(name, arguments_) {
const results = [];
- const chunks = args.trim().split(/\s*,\s*/g);
+ const chunks = arguments_.trim().split(/\s*,\s*/g);
let matches;
for (const chunk of chunks) {
- if (!isNaN(chunk)) {
- results.push(Number(chunk));
+ const number = Number(chunk);
+ if (!Number.isNaN(number)) {
+ results.push(number);
} else if ((matches = chunk.match(STRING_REGEX))) {
- results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape(escape) : chr));
+ results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
} else {
throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
}
@@ -47875,36 +47454,34 @@ function buildStyle(chalk, styles) {
}
let current = chalk;
- for (const styleName of Object.keys(enabled)) {
- if (Array.isArray(enabled[styleName])) {
- if (!(styleName in current)) {
- throw new Error(`Unknown Chalk style: ${styleName}`);
- }
+ for (const [styleName, styles] of Object.entries(enabled)) {
+ if (!Array.isArray(styles)) {
+ continue;
+ }
- if (enabled[styleName].length > 0) {
- current = current[styleName].apply(current, enabled[styleName]);
- } else {
- current = current[styleName];
- }
+ if (!(styleName in current)) {
+ throw new Error(`Unknown Chalk style: ${styleName}`);
}
+
+ current = styles.length > 0 ? current[styleName](...styles) : current[styleName];
}
return current;
}
-module.exports = (chalk, tmp) => {
+module.exports = (chalk, temporary) => {
const styles = [];
const chunks = [];
let chunk = [];
// eslint-disable-next-line max-params
- tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => {
- if (escapeChar) {
- chunk.push(unescape(escapeChar));
+ temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
+ if (escapeCharacter) {
+ chunk.push(unescape(escapeCharacter));
} else if (style) {
- const str = chunk.join('');
+ const string = chunk.join('');
chunk = [];
- chunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str));
+ chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string));
styles.push({inverse, styles: parseStyle(style)});
} else if (close) {
if (styles.length === 0) {
@@ -47915,7 +47492,7 @@ module.exports = (chalk, tmp) => {
chunk = [];
styles.pop();
} else {
- chunk.push(chr);
+ chunk.push(character);
}
});
@@ -47931,151 +47508,100 @@ module.exports = (chalk, tmp) => {
/***/ }),
-/* 378 */
+/* 374 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const restoreCursor = __webpack_require__(379);
-
-let hidden = false;
+const restoreCursor = __webpack_require__(375);
-exports.show = stream => {
- const s = stream || process.stderr;
+let isHidden = false;
- if (!s.isTTY) {
+exports.show = (writableStream = process.stderr) => {
+ if (!writableStream.isTTY) {
return;
}
- hidden = false;
- s.write('\u001b[?25h');
+ isHidden = false;
+ writableStream.write('\u001B[?25h');
};
-exports.hide = stream => {
- const s = stream || process.stderr;
-
- if (!s.isTTY) {
+exports.hide = (writableStream = process.stderr) => {
+ if (!writableStream.isTTY) {
return;
}
restoreCursor();
- hidden = true;
- s.write('\u001b[?25l');
+ isHidden = true;
+ writableStream.write('\u001B[?25l');
};
-exports.toggle = (force, stream) => {
+exports.toggle = (force, writableStream) => {
if (force !== undefined) {
- hidden = force;
+ isHidden = force;
}
- if (hidden) {
- exports.show(stream);
+ if (isHidden) {
+ exports.show(writableStream);
} else {
- exports.hide(stream);
+ exports.hide(writableStream);
}
};
/***/ }),
-/* 379 */
+/* 375 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const onetime = __webpack_require__(380);
+const onetime = __webpack_require__(244);
const signalExit = __webpack_require__(217);
module.exports = onetime(() => {
signalExit(() => {
- process.stderr.write('\u001b[?25h');
+ process.stderr.write('\u001B[?25h');
}, {alwaysLast: true});
});
/***/ }),
-/* 380 */
+/* 376 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const mimicFn = __webpack_require__(381);
-
-module.exports = (fn, opts) => {
- // TODO: Remove this in v3
- if (opts === true) {
- throw new TypeError('The second argument is now an options object');
- }
-
- if (typeof fn !== 'function') {
- throw new TypeError('Expected a function');
- }
-
- opts = opts || {};
-
- let ret;
- let called = false;
- const fnName = fn.displayName || fn.name || '';
-
- const onetime = function () {
- if (called) {
- if (opts.throw === true) {
- throw new Error(`Function \`${fnName}\` can only be called once`);
- }
-
- return ret;
- }
-
- called = true;
- ret = fn.apply(this, arguments);
- fn = null;
- return ret;
- };
+const spinners = Object.assign({}, __webpack_require__(377));
- mimicFn(onetime, fn);
+const spinnersList = Object.keys(spinners);
- return onetime;
-};
-
-
-/***/ }),
-/* 381 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-module.exports = (to, from) => {
- // TODO: use `Reflect.ownKeys()` when targeting Node.js 6
- for (const prop of Object.getOwnPropertyNames(from).concat(Object.getOwnPropertySymbols(from))) {
- Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));
+Object.defineProperty(spinners, 'random', {
+ get() {
+ const randomIndex = Math.floor(Math.random() * spinnersList.length);
+ const spinnerName = spinnersList[randomIndex];
+ return spinners[spinnerName];
}
+});
- return to;
-};
-
-
-/***/ }),
-/* 382 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-module.exports = __webpack_require__(383);
+module.exports = spinners;
+// TODO: Remove this for the next major release
+module.exports.default = spinners;
/***/ }),
-/* 383 */
+/* 377 */
/***/ (function(module) {
-module.exports = JSON.parse("{\"dots\":{\"interval\":80,\"frames\":[\"⠋\",\"⠙\",\"⠹\",\"⠸\",\"⠼\",\"⠴\",\"⠦\",\"⠧\",\"⠇\",\"⠏\"]},\"dots2\":{\"interval\":80,\"frames\":[\"⣾\",\"⣽\",\"⣻\",\"⢿\",\"⡿\",\"⣟\",\"⣯\",\"⣷\"]},\"dots3\":{\"interval\":80,\"frames\":[\"⠋\",\"⠙\",\"⠚\",\"⠞\",\"⠖\",\"⠦\",\"⠴\",\"⠲\",\"⠳\",\"⠓\"]},\"dots4\":{\"interval\":80,\"frames\":[\"⠄\",\"⠆\",\"⠇\",\"⠋\",\"⠙\",\"⠸\",\"⠰\",\"⠠\",\"⠰\",\"⠸\",\"⠙\",\"⠋\",\"⠇\",\"⠆\"]},\"dots5\":{\"interval\":80,\"frames\":[\"⠋\",\"⠙\",\"⠚\",\"⠒\",\"⠂\",\"⠂\",\"⠒\",\"⠲\",\"⠴\",\"⠦\",\"⠖\",\"⠒\",\"⠐\",\"⠐\",\"⠒\",\"⠓\",\"⠋\"]},\"dots6\":{\"interval\":80,\"frames\":[\"⠁\",\"⠉\",\"⠙\",\"⠚\",\"⠒\",\"⠂\",\"⠂\",\"⠒\",\"⠲\",\"⠴\",\"⠤\",\"⠄\",\"⠄\",\"⠤\",\"⠴\",\"⠲\",\"⠒\",\"⠂\",\"⠂\",\"⠒\",\"⠚\",\"⠙\",\"⠉\",\"⠁\"]},\"dots7\":{\"interval\":80,\"frames\":[\"⠈\",\"⠉\",\"⠋\",\"⠓\",\"⠒\",\"⠐\",\"⠐\",\"⠒\",\"⠖\",\"⠦\",\"⠤\",\"⠠\",\"⠠\",\"⠤\",\"⠦\",\"⠖\",\"⠒\",\"⠐\",\"⠐\",\"⠒\",\"⠓\",\"⠋\",\"⠉\",\"⠈\"]},\"dots8\":{\"interval\":80,\"frames\":[\"⠁\",\"⠁\",\"⠉\",\"⠙\",\"⠚\",\"⠒\",\"⠂\",\"⠂\",\"⠒\",\"⠲\",\"⠴\",\"⠤\",\"⠄\",\"⠄\",\"⠤\",\"⠠\",\"⠠\",\"⠤\",\"⠦\",\"⠖\",\"⠒\",\"⠐\",\"⠐\",\"⠒\",\"⠓\",\"⠋\",\"⠉\",\"⠈\",\"⠈\"]},\"dots9\":{\"interval\":80,\"frames\":[\"⢹\",\"⢺\",\"⢼\",\"⣸\",\"⣇\",\"⡧\",\"⡗\",\"⡏\"]},\"dots10\":{\"interval\":80,\"frames\":[\"⢄\",\"⢂\",\"⢁\",\"⡁\",\"⡈\",\"⡐\",\"⡠\"]},\"dots11\":{\"interval\":100,\"frames\":[\"⠁\",\"⠂\",\"⠄\",\"⡀\",\"⢀\",\"⠠\",\"⠐\",\"⠈\"]},\"dots12\":{\"interval\":80,\"frames\":[\"⢀⠀\",\"⡀⠀\",\"⠄⠀\",\"⢂⠀\",\"⡂⠀\",\"⠅⠀\",\"⢃⠀\",\"⡃⠀\",\"⠍⠀\",\"⢋⠀\",\"⡋⠀\",\"⠍⠁\",\"⢋⠁\",\"⡋⠁\",\"⠍⠉\",\"⠋⠉\",\"⠋⠉\",\"⠉⠙\",\"⠉⠙\",\"⠉⠩\",\"⠈⢙\",\"⠈⡙\",\"⢈⠩\",\"⡀⢙\",\"⠄⡙\",\"⢂⠩\",\"⡂⢘\",\"⠅⡘\",\"⢃⠨\",\"⡃⢐\",\"⠍⡐\",\"⢋⠠\",\"⡋⢀\",\"⠍⡁\",\"⢋⠁\",\"⡋⠁\",\"⠍⠉\",\"⠋⠉\",\"⠋⠉\",\"⠉⠙\",\"⠉⠙\",\"⠉⠩\",\"⠈⢙\",\"⠈⡙\",\"⠈⠩\",\"⠀⢙\",\"⠀⡙\",\"⠀⠩\",\"⠀⢘\",\"⠀⡘\",\"⠀⠨\",\"⠀⢐\",\"⠀⡐\",\"⠀⠠\",\"⠀⢀\",\"⠀⡀\"]},\"line\":{\"interval\":130,\"frames\":[\"-\",\"\\\\\",\"|\",\"/\"]},\"line2\":{\"interval\":100,\"frames\":[\"⠂\",\"-\",\"–\",\"—\",\"–\",\"-\"]},\"pipe\":{\"interval\":100,\"frames\":[\"┤\",\"┘\",\"┴\",\"└\",\"├\",\"┌\",\"┬\",\"┐\"]},\"simpleDots\":{\"interval\":400,\"frames\":[\". \",\".. \",\"...\",\" \"]},\"simpleDotsScrolling\":{\"interval\":200,\"frames\":[\". \",\".. \",\"...\",\" ..\",\" .\",\" \"]},\"star\":{\"interval\":70,\"frames\":[\"✶\",\"✸\",\"✹\",\"✺\",\"✹\",\"✷\"]},\"star2\":{\"interval\":80,\"frames\":[\"+\",\"x\",\"*\"]},\"flip\":{\"interval\":70,\"frames\":[\"_\",\"_\",\"_\",\"-\",\"`\",\"`\",\"'\",\"´\",\"-\",\"_\",\"_\",\"_\"]},\"hamburger\":{\"interval\":100,\"frames\":[\"☱\",\"☲\",\"☴\"]},\"growVertical\":{\"interval\":120,\"frames\":[\"▁\",\"▃\",\"▄\",\"▅\",\"▆\",\"▇\",\"▆\",\"▅\",\"▄\",\"▃\"]},\"growHorizontal\":{\"interval\":120,\"frames\":[\"▏\",\"▎\",\"▍\",\"▌\",\"▋\",\"▊\",\"▉\",\"▊\",\"▋\",\"▌\",\"▍\",\"▎\"]},\"balloon\":{\"interval\":140,\"frames\":[\" \",\".\",\"o\",\"O\",\"@\",\"*\",\" \"]},\"balloon2\":{\"interval\":120,\"frames\":[\".\",\"o\",\"O\",\"°\",\"O\",\"o\",\".\"]},\"noise\":{\"interval\":100,\"frames\":[\"▓\",\"▒\",\"░\"]},\"bounce\":{\"interval\":120,\"frames\":[\"⠁\",\"⠂\",\"⠄\",\"⠂\"]},\"boxBounce\":{\"interval\":120,\"frames\":[\"▖\",\"▘\",\"▝\",\"▗\"]},\"boxBounce2\":{\"interval\":100,\"frames\":[\"▌\",\"▀\",\"▐\",\"▄\"]},\"triangle\":{\"interval\":50,\"frames\":[\"◢\",\"◣\",\"◤\",\"◥\"]},\"arc\":{\"interval\":100,\"frames\":[\"◜\",\"◠\",\"◝\",\"◞\",\"◡\",\"◟\"]},\"circle\":{\"interval\":120,\"frames\":[\"◡\",\"⊙\",\"◠\"]},\"squareCorners\":{\"interval\":180,\"frames\":[\"◰\",\"◳\",\"◲\",\"◱\"]},\"circleQuarters\":{\"interval\":120,\"frames\":[\"◴\",\"◷\",\"◶\",\"◵\"]},\"circleHalves\":{\"interval\":50,\"frames\":[\"◐\",\"◓\",\"◑\",\"◒\"]},\"squish\":{\"interval\":100,\"frames\":[\"╫\",\"╪\"]},\"toggle\":{\"interval\":250,\"frames\":[\"⊶\",\"⊷\"]},\"toggle2\":{\"interval\":80,\"frames\":[\"▫\",\"▪\"]},\"toggle3\":{\"interval\":120,\"frames\":[\"□\",\"■\"]},\"toggle4\":{\"interval\":100,\"frames\":[\"■\",\"□\",\"▪\",\"▫\"]},\"toggle5\":{\"interval\":100,\"frames\":[\"▮\",\"▯\"]},\"toggle6\":{\"interval\":300,\"frames\":[\"ဝ\",\"၀\"]},\"toggle7\":{\"interval\":80,\"frames\":[\"⦾\",\"⦿\"]},\"toggle8\":{\"interval\":100,\"frames\":[\"◍\",\"◌\"]},\"toggle9\":{\"interval\":100,\"frames\":[\"◉\",\"◎\"]},\"toggle10\":{\"interval\":100,\"frames\":[\"㊂\",\"㊀\",\"㊁\"]},\"toggle11\":{\"interval\":50,\"frames\":[\"⧇\",\"⧆\"]},\"toggle12\":{\"interval\":120,\"frames\":[\"☗\",\"☖\"]},\"toggle13\":{\"interval\":80,\"frames\":[\"=\",\"*\",\"-\"]},\"arrow\":{\"interval\":100,\"frames\":[\"←\",\"↖\",\"↑\",\"↗\",\"→\",\"↘\",\"↓\",\"↙\"]},\"arrow2\":{\"interval\":80,\"frames\":[\"⬆️ \",\"↗️ \",\"➡️ \",\"↘️ \",\"⬇️ \",\"↙️ \",\"⬅️ \",\"↖️ \"]},\"arrow3\":{\"interval\":120,\"frames\":[\"▹▹▹▹▹\",\"▸▹▹▹▹\",\"▹▸▹▹▹\",\"▹▹▸▹▹\",\"▹▹▹▸▹\",\"▹▹▹▹▸\"]},\"bouncingBar\":{\"interval\":80,\"frames\":[\"[ ]\",\"[= ]\",\"[== ]\",\"[=== ]\",\"[ ===]\",\"[ ==]\",\"[ =]\",\"[ ]\",\"[ =]\",\"[ ==]\",\"[ ===]\",\"[====]\",\"[=== ]\",\"[== ]\",\"[= ]\"]},\"bouncingBall\":{\"interval\":80,\"frames\":[\"( ● )\",\"( ● )\",\"( ● )\",\"( ● )\",\"( ●)\",\"( ● )\",\"( ● )\",\"( ● )\",\"( ● )\",\"(● )\"]},\"smiley\":{\"interval\":200,\"frames\":[\"😄 \",\"😝 \"]},\"monkey\":{\"interval\":300,\"frames\":[\"🙈 \",\"🙈 \",\"🙉 \",\"🙊 \"]},\"hearts\":{\"interval\":100,\"frames\":[\"💛 \",\"💙 \",\"💜 \",\"💚 \",\"❤️ \"]},\"clock\":{\"interval\":100,\"frames\":[\"🕐 \",\"🕑 \",\"🕒 \",\"🕓 \",\"🕔 \",\"🕕 \",\"🕖 \",\"🕗 \",\"🕘 \",\"🕙 \",\"🕚 \"]},\"earth\":{\"interval\":180,\"frames\":[\"🌍 \",\"🌎 \",\"🌏 \"]},\"moon\":{\"interval\":80,\"frames\":[\"🌑 \",\"🌒 \",\"🌓 \",\"🌔 \",\"🌕 \",\"🌖 \",\"🌗 \",\"🌘 \"]},\"runner\":{\"interval\":140,\"frames\":[\"🚶 \",\"🏃 \"]},\"pong\":{\"interval\":80,\"frames\":[\"▐⠂ ▌\",\"▐⠈ ▌\",\"▐ ⠂ ▌\",\"▐ ⠠ ▌\",\"▐ ⡀ ▌\",\"▐ ⠠ ▌\",\"▐ ⠂ ▌\",\"▐ ⠈ ▌\",\"▐ ⠂ ▌\",\"▐ ⠠ ▌\",\"▐ ⡀ ▌\",\"▐ ⠠ ▌\",\"▐ ⠂ ▌\",\"▐ ⠈ ▌\",\"▐ ⠂▌\",\"▐ ⠠▌\",\"▐ ⡀▌\",\"▐ ⠠ ▌\",\"▐ ⠂ ▌\",\"▐ ⠈ ▌\",\"▐ ⠂ ▌\",\"▐ ⠠ ▌\",\"▐ ⡀ ▌\",\"▐ ⠠ ▌\",\"▐ ⠂ ▌\",\"▐ ⠈ ▌\",\"▐ ⠂ ▌\",\"▐ ⠠ ▌\",\"▐ ⡀ ▌\",\"▐⠠ ▌\"]},\"shark\":{\"interval\":120,\"frames\":[\"▐|\\\\____________▌\",\"▐_|\\\\___________▌\",\"▐__|\\\\__________▌\",\"▐___|\\\\_________▌\",\"▐____|\\\\________▌\",\"▐_____|\\\\_______▌\",\"▐______|\\\\______▌\",\"▐_______|\\\\_____▌\",\"▐________|\\\\____▌\",\"▐_________|\\\\___▌\",\"▐__________|\\\\__▌\",\"▐___________|\\\\_▌\",\"▐____________|\\\\▌\",\"▐____________/|▌\",\"▐___________/|_▌\",\"▐__________/|__▌\",\"▐_________/|___▌\",\"▐________/|____▌\",\"▐_______/|_____▌\",\"▐______/|______▌\",\"▐_____/|_______▌\",\"▐____/|________▌\",\"▐___/|_________▌\",\"▐__/|__________▌\",\"▐_/|___________▌\",\"▐/|____________▌\"]},\"dqpb\":{\"interval\":100,\"frames\":[\"d\",\"q\",\"p\",\"b\"]},\"weather\":{\"interval\":100,\"frames\":[\"☀️ \",\"☀️ \",\"☀️ \",\"🌤 \",\"⛅️ \",\"🌥 \",\"☁️ \",\"🌧 \",\"🌨 \",\"🌧 \",\"🌨 \",\"🌧 \",\"🌨 \",\"⛈ \",\"🌨 \",\"🌧 \",\"🌨 \",\"☁️ \",\"🌥 \",\"⛅️ \",\"🌤 \",\"☀️ \",\"☀️ \"]},\"christmas\":{\"interval\":400,\"frames\":[\"🌲\",\"🎄\"]}}");
+module.exports = JSON.parse("{\"dots\":{\"interval\":80,\"frames\":[\"⠋\",\"⠙\",\"⠹\",\"⠸\",\"⠼\",\"⠴\",\"⠦\",\"⠧\",\"⠇\",\"⠏\"]},\"dots2\":{\"interval\":80,\"frames\":[\"⣾\",\"⣽\",\"⣻\",\"⢿\",\"⡿\",\"⣟\",\"⣯\",\"⣷\"]},\"dots3\":{\"interval\":80,\"frames\":[\"⠋\",\"⠙\",\"⠚\",\"⠞\",\"⠖\",\"⠦\",\"⠴\",\"⠲\",\"⠳\",\"⠓\"]},\"dots4\":{\"interval\":80,\"frames\":[\"⠄\",\"⠆\",\"⠇\",\"⠋\",\"⠙\",\"⠸\",\"⠰\",\"⠠\",\"⠰\",\"⠸\",\"⠙\",\"⠋\",\"⠇\",\"⠆\"]},\"dots5\":{\"interval\":80,\"frames\":[\"⠋\",\"⠙\",\"⠚\",\"⠒\",\"⠂\",\"⠂\",\"⠒\",\"⠲\",\"⠴\",\"⠦\",\"⠖\",\"⠒\",\"⠐\",\"⠐\",\"⠒\",\"⠓\",\"⠋\"]},\"dots6\":{\"interval\":80,\"frames\":[\"⠁\",\"⠉\",\"⠙\",\"⠚\",\"⠒\",\"⠂\",\"⠂\",\"⠒\",\"⠲\",\"⠴\",\"⠤\",\"⠄\",\"⠄\",\"⠤\",\"⠴\",\"⠲\",\"⠒\",\"⠂\",\"⠂\",\"⠒\",\"⠚\",\"⠙\",\"⠉\",\"⠁\"]},\"dots7\":{\"interval\":80,\"frames\":[\"⠈\",\"⠉\",\"⠋\",\"⠓\",\"⠒\",\"⠐\",\"⠐\",\"⠒\",\"⠖\",\"⠦\",\"⠤\",\"⠠\",\"⠠\",\"⠤\",\"⠦\",\"⠖\",\"⠒\",\"⠐\",\"⠐\",\"⠒\",\"⠓\",\"⠋\",\"⠉\",\"⠈\"]},\"dots8\":{\"interval\":80,\"frames\":[\"⠁\",\"⠁\",\"⠉\",\"⠙\",\"⠚\",\"⠒\",\"⠂\",\"⠂\",\"⠒\",\"⠲\",\"⠴\",\"⠤\",\"⠄\",\"⠄\",\"⠤\",\"⠠\",\"⠠\",\"⠤\",\"⠦\",\"⠖\",\"⠒\",\"⠐\",\"⠐\",\"⠒\",\"⠓\",\"⠋\",\"⠉\",\"⠈\",\"⠈\"]},\"dots9\":{\"interval\":80,\"frames\":[\"⢹\",\"⢺\",\"⢼\",\"⣸\",\"⣇\",\"⡧\",\"⡗\",\"⡏\"]},\"dots10\":{\"interval\":80,\"frames\":[\"⢄\",\"⢂\",\"⢁\",\"⡁\",\"⡈\",\"⡐\",\"⡠\"]},\"dots11\":{\"interval\":100,\"frames\":[\"⠁\",\"⠂\",\"⠄\",\"⡀\",\"⢀\",\"⠠\",\"⠐\",\"⠈\"]},\"dots12\":{\"interval\":80,\"frames\":[\"⢀⠀\",\"⡀⠀\",\"⠄⠀\",\"⢂⠀\",\"⡂⠀\",\"⠅⠀\",\"⢃⠀\",\"⡃⠀\",\"⠍⠀\",\"⢋⠀\",\"⡋⠀\",\"⠍⠁\",\"⢋⠁\",\"⡋⠁\",\"⠍⠉\",\"⠋⠉\",\"⠋⠉\",\"⠉⠙\",\"⠉⠙\",\"⠉⠩\",\"⠈⢙\",\"⠈⡙\",\"⢈⠩\",\"⡀⢙\",\"⠄⡙\",\"⢂⠩\",\"⡂⢘\",\"⠅⡘\",\"⢃⠨\",\"⡃⢐\",\"⠍⡐\",\"⢋⠠\",\"⡋⢀\",\"⠍⡁\",\"⢋⠁\",\"⡋⠁\",\"⠍⠉\",\"⠋⠉\",\"⠋⠉\",\"⠉⠙\",\"⠉⠙\",\"⠉⠩\",\"⠈⢙\",\"⠈⡙\",\"⠈⠩\",\"⠀⢙\",\"⠀⡙\",\"⠀⠩\",\"⠀⢘\",\"⠀⡘\",\"⠀⠨\",\"⠀⢐\",\"⠀⡐\",\"⠀⠠\",\"⠀⢀\",\"⠀⡀\"]},\"dots8Bit\":{\"interval\":80,\"frames\":[\"⠀\",\"⠁\",\"⠂\",\"⠃\",\"⠄\",\"⠅\",\"⠆\",\"⠇\",\"⡀\",\"⡁\",\"⡂\",\"⡃\",\"⡄\",\"⡅\",\"⡆\",\"⡇\",\"⠈\",\"⠉\",\"⠊\",\"⠋\",\"⠌\",\"⠍\",\"⠎\",\"⠏\",\"⡈\",\"⡉\",\"⡊\",\"⡋\",\"⡌\",\"⡍\",\"⡎\",\"⡏\",\"⠐\",\"⠑\",\"⠒\",\"⠓\",\"⠔\",\"⠕\",\"⠖\",\"⠗\",\"⡐\",\"⡑\",\"⡒\",\"⡓\",\"⡔\",\"⡕\",\"⡖\",\"⡗\",\"⠘\",\"⠙\",\"⠚\",\"⠛\",\"⠜\",\"⠝\",\"⠞\",\"⠟\",\"⡘\",\"⡙\",\"⡚\",\"⡛\",\"⡜\",\"⡝\",\"⡞\",\"⡟\",\"⠠\",\"⠡\",\"⠢\",\"⠣\",\"⠤\",\"⠥\",\"⠦\",\"⠧\",\"⡠\",\"⡡\",\"⡢\",\"⡣\",\"⡤\",\"⡥\",\"⡦\",\"⡧\",\"⠨\",\"⠩\",\"⠪\",\"⠫\",\"⠬\",\"⠭\",\"⠮\",\"⠯\",\"⡨\",\"⡩\",\"⡪\",\"⡫\",\"⡬\",\"⡭\",\"⡮\",\"⡯\",\"⠰\",\"⠱\",\"⠲\",\"⠳\",\"⠴\",\"⠵\",\"⠶\",\"⠷\",\"⡰\",\"⡱\",\"⡲\",\"⡳\",\"⡴\",\"⡵\",\"⡶\",\"⡷\",\"⠸\",\"⠹\",\"⠺\",\"⠻\",\"⠼\",\"⠽\",\"⠾\",\"⠿\",\"⡸\",\"⡹\",\"⡺\",\"⡻\",\"⡼\",\"⡽\",\"⡾\",\"⡿\",\"⢀\",\"⢁\",\"⢂\",\"⢃\",\"⢄\",\"⢅\",\"⢆\",\"⢇\",\"⣀\",\"⣁\",\"⣂\",\"⣃\",\"⣄\",\"⣅\",\"⣆\",\"⣇\",\"⢈\",\"⢉\",\"⢊\",\"⢋\",\"⢌\",\"⢍\",\"⢎\",\"⢏\",\"⣈\",\"⣉\",\"⣊\",\"⣋\",\"⣌\",\"⣍\",\"⣎\",\"⣏\",\"⢐\",\"⢑\",\"⢒\",\"⢓\",\"⢔\",\"⢕\",\"⢖\",\"⢗\",\"⣐\",\"⣑\",\"⣒\",\"⣓\",\"⣔\",\"⣕\",\"⣖\",\"⣗\",\"⢘\",\"⢙\",\"⢚\",\"⢛\",\"⢜\",\"⢝\",\"⢞\",\"⢟\",\"⣘\",\"⣙\",\"⣚\",\"⣛\",\"⣜\",\"⣝\",\"⣞\",\"⣟\",\"⢠\",\"⢡\",\"⢢\",\"⢣\",\"⢤\",\"⢥\",\"⢦\",\"⢧\",\"⣠\",\"⣡\",\"⣢\",\"⣣\",\"⣤\",\"⣥\",\"⣦\",\"⣧\",\"⢨\",\"⢩\",\"⢪\",\"⢫\",\"⢬\",\"⢭\",\"⢮\",\"⢯\",\"⣨\",\"⣩\",\"⣪\",\"⣫\",\"⣬\",\"⣭\",\"⣮\",\"⣯\",\"⢰\",\"⢱\",\"⢲\",\"⢳\",\"⢴\",\"⢵\",\"⢶\",\"⢷\",\"⣰\",\"⣱\",\"⣲\",\"⣳\",\"⣴\",\"⣵\",\"⣶\",\"⣷\",\"⢸\",\"⢹\",\"⢺\",\"⢻\",\"⢼\",\"⢽\",\"⢾\",\"⢿\",\"⣸\",\"⣹\",\"⣺\",\"⣻\",\"⣼\",\"⣽\",\"⣾\",\"⣿\"]},\"line\":{\"interval\":130,\"frames\":[\"-\",\"\\\\\",\"|\",\"/\"]},\"line2\":{\"interval\":100,\"frames\":[\"⠂\",\"-\",\"–\",\"—\",\"–\",\"-\"]},\"pipe\":{\"interval\":100,\"frames\":[\"┤\",\"┘\",\"┴\",\"└\",\"├\",\"┌\",\"┬\",\"┐\"]},\"simpleDots\":{\"interval\":400,\"frames\":[\". \",\".. \",\"...\",\" \"]},\"simpleDotsScrolling\":{\"interval\":200,\"frames\":[\". \",\".. \",\"...\",\" ..\",\" .\",\" \"]},\"star\":{\"interval\":70,\"frames\":[\"✶\",\"✸\",\"✹\",\"✺\",\"✹\",\"✷\"]},\"star2\":{\"interval\":80,\"frames\":[\"+\",\"x\",\"*\"]},\"flip\":{\"interval\":70,\"frames\":[\"_\",\"_\",\"_\",\"-\",\"`\",\"`\",\"'\",\"´\",\"-\",\"_\",\"_\",\"_\"]},\"hamburger\":{\"interval\":100,\"frames\":[\"☱\",\"☲\",\"☴\"]},\"growVertical\":{\"interval\":120,\"frames\":[\"▁\",\"▃\",\"▄\",\"▅\",\"▆\",\"▇\",\"▆\",\"▅\",\"▄\",\"▃\"]},\"growHorizontal\":{\"interval\":120,\"frames\":[\"▏\",\"▎\",\"▍\",\"▌\",\"▋\",\"▊\",\"▉\",\"▊\",\"▋\",\"▌\",\"▍\",\"▎\"]},\"balloon\":{\"interval\":140,\"frames\":[\" \",\".\",\"o\",\"O\",\"@\",\"*\",\" \"]},\"balloon2\":{\"interval\":120,\"frames\":[\".\",\"o\",\"O\",\"°\",\"O\",\"o\",\".\"]},\"noise\":{\"interval\":100,\"frames\":[\"▓\",\"▒\",\"░\"]},\"bounce\":{\"interval\":120,\"frames\":[\"⠁\",\"⠂\",\"⠄\",\"⠂\"]},\"boxBounce\":{\"interval\":120,\"frames\":[\"▖\",\"▘\",\"▝\",\"▗\"]},\"boxBounce2\":{\"interval\":100,\"frames\":[\"▌\",\"▀\",\"▐\",\"▄\"]},\"triangle\":{\"interval\":50,\"frames\":[\"◢\",\"◣\",\"◤\",\"◥\"]},\"arc\":{\"interval\":100,\"frames\":[\"◜\",\"◠\",\"◝\",\"◞\",\"◡\",\"◟\"]},\"circle\":{\"interval\":120,\"frames\":[\"◡\",\"⊙\",\"◠\"]},\"squareCorners\":{\"interval\":180,\"frames\":[\"◰\",\"◳\",\"◲\",\"◱\"]},\"circleQuarters\":{\"interval\":120,\"frames\":[\"◴\",\"◷\",\"◶\",\"◵\"]},\"circleHalves\":{\"interval\":50,\"frames\":[\"◐\",\"◓\",\"◑\",\"◒\"]},\"squish\":{\"interval\":100,\"frames\":[\"╫\",\"╪\"]},\"toggle\":{\"interval\":250,\"frames\":[\"⊶\",\"⊷\"]},\"toggle2\":{\"interval\":80,\"frames\":[\"▫\",\"▪\"]},\"toggle3\":{\"interval\":120,\"frames\":[\"□\",\"■\"]},\"toggle4\":{\"interval\":100,\"frames\":[\"■\",\"□\",\"▪\",\"▫\"]},\"toggle5\":{\"interval\":100,\"frames\":[\"▮\",\"▯\"]},\"toggle6\":{\"interval\":300,\"frames\":[\"ဝ\",\"၀\"]},\"toggle7\":{\"interval\":80,\"frames\":[\"⦾\",\"⦿\"]},\"toggle8\":{\"interval\":100,\"frames\":[\"◍\",\"◌\"]},\"toggle9\":{\"interval\":100,\"frames\":[\"◉\",\"◎\"]},\"toggle10\":{\"interval\":100,\"frames\":[\"㊂\",\"㊀\",\"㊁\"]},\"toggle11\":{\"interval\":50,\"frames\":[\"⧇\",\"⧆\"]},\"toggle12\":{\"interval\":120,\"frames\":[\"☗\",\"☖\"]},\"toggle13\":{\"interval\":80,\"frames\":[\"=\",\"*\",\"-\"]},\"arrow\":{\"interval\":100,\"frames\":[\"←\",\"↖\",\"↑\",\"↗\",\"→\",\"↘\",\"↓\",\"↙\"]},\"arrow2\":{\"interval\":80,\"frames\":[\"⬆️ \",\"↗️ \",\"➡️ \",\"↘️ \",\"⬇️ \",\"↙️ \",\"⬅️ \",\"↖️ \"]},\"arrow3\":{\"interval\":120,\"frames\":[\"▹▹▹▹▹\",\"▸▹▹▹▹\",\"▹▸▹▹▹\",\"▹▹▸▹▹\",\"▹▹▹▸▹\",\"▹▹▹▹▸\"]},\"bouncingBar\":{\"interval\":80,\"frames\":[\"[ ]\",\"[= ]\",\"[== ]\",\"[=== ]\",\"[ ===]\",\"[ ==]\",\"[ =]\",\"[ ]\",\"[ =]\",\"[ ==]\",\"[ ===]\",\"[====]\",\"[=== ]\",\"[== ]\",\"[= ]\"]},\"bouncingBall\":{\"interval\":80,\"frames\":[\"( ● )\",\"( ● )\",\"( ● )\",\"( ● )\",\"( ●)\",\"( ● )\",\"( ● )\",\"( ● )\",\"( ● )\",\"(● )\"]},\"smiley\":{\"interval\":200,\"frames\":[\"😄 \",\"😝 \"]},\"monkey\":{\"interval\":300,\"frames\":[\"🙈 \",\"🙈 \",\"🙉 \",\"🙊 \"]},\"hearts\":{\"interval\":100,\"frames\":[\"💛 \",\"💙 \",\"💜 \",\"💚 \",\"❤️ \"]},\"clock\":{\"interval\":100,\"frames\":[\"🕛 \",\"🕐 \",\"🕑 \",\"🕒 \",\"🕓 \",\"🕔 \",\"🕕 \",\"🕖 \",\"🕗 \",\"🕘 \",\"🕙 \",\"🕚 \"]},\"earth\":{\"interval\":180,\"frames\":[\"🌍 \",\"🌎 \",\"🌏 \"]},\"material\":{\"interval\":17,\"frames\":[\"█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\"██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\"███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\"████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\"██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\"██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\"███████▁▁▁▁▁▁▁▁▁▁▁▁▁\",\"████████▁▁▁▁▁▁▁▁▁▁▁▁\",\"█████████▁▁▁▁▁▁▁▁▁▁▁\",\"█████████▁▁▁▁▁▁▁▁▁▁▁\",\"██████████▁▁▁▁▁▁▁▁▁▁\",\"███████████▁▁▁▁▁▁▁▁▁\",\"█████████████▁▁▁▁▁▁▁\",\"██████████████▁▁▁▁▁▁\",\"██████████████▁▁▁▁▁▁\",\"▁██████████████▁▁▁▁▁\",\"▁██████████████▁▁▁▁▁\",\"▁██████████████▁▁▁▁▁\",\"▁▁██████████████▁▁▁▁\",\"▁▁▁██████████████▁▁▁\",\"▁▁▁▁█████████████▁▁▁\",\"▁▁▁▁██████████████▁▁\",\"▁▁▁▁██████████████▁▁\",\"▁▁▁▁▁██████████████▁\",\"▁▁▁▁▁██████████████▁\",\"▁▁▁▁▁██████████████▁\",\"▁▁▁▁▁▁██████████████\",\"▁▁▁▁▁▁██████████████\",\"▁▁▁▁▁▁▁█████████████\",\"▁▁▁▁▁▁▁█████████████\",\"▁▁▁▁▁▁▁▁████████████\",\"▁▁▁▁▁▁▁▁████████████\",\"▁▁▁▁▁▁▁▁▁███████████\",\"▁▁▁▁▁▁▁▁▁███████████\",\"▁▁▁▁▁▁▁▁▁▁██████████\",\"▁▁▁▁▁▁▁▁▁▁██████████\",\"▁▁▁▁▁▁▁▁▁▁▁▁████████\",\"▁▁▁▁▁▁▁▁▁▁▁▁▁███████\",\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████\",\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████\",\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████\",\"█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████\",\"██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███\",\"██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███\",\"███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███\",\"████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██\",\"█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█\",\"█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█\",\"██████▁▁▁▁▁▁▁▁▁▁▁▁▁█\",\"████████▁▁▁▁▁▁▁▁▁▁▁▁\",\"█████████▁▁▁▁▁▁▁▁▁▁▁\",\"█████████▁▁▁▁▁▁▁▁▁▁▁\",\"█████████▁▁▁▁▁▁▁▁▁▁▁\",\"█████████▁▁▁▁▁▁▁▁▁▁▁\",\"███████████▁▁▁▁▁▁▁▁▁\",\"████████████▁▁▁▁▁▁▁▁\",\"████████████▁▁▁▁▁▁▁▁\",\"██████████████▁▁▁▁▁▁\",\"██████████████▁▁▁▁▁▁\",\"▁██████████████▁▁▁▁▁\",\"▁██████████████▁▁▁▁▁\",\"▁▁▁█████████████▁▁▁▁\",\"▁▁▁▁▁████████████▁▁▁\",\"▁▁▁▁▁████████████▁▁▁\",\"▁▁▁▁▁▁███████████▁▁▁\",\"▁▁▁▁▁▁▁▁█████████▁▁▁\",\"▁▁▁▁▁▁▁▁█████████▁▁▁\",\"▁▁▁▁▁▁▁▁▁█████████▁▁\",\"▁▁▁▁▁▁▁▁▁█████████▁▁\",\"▁▁▁▁▁▁▁▁▁▁█████████▁\",\"▁▁▁▁▁▁▁▁▁▁▁████████▁\",\"▁▁▁▁▁▁▁▁▁▁▁████████▁\",\"▁▁▁▁▁▁▁▁▁▁▁▁███████▁\",\"▁▁▁▁▁▁▁▁▁▁▁▁███████▁\",\"▁▁▁▁▁▁▁▁▁▁▁▁▁███████\",\"▁▁▁▁▁▁▁▁▁▁▁▁▁███████\",\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████\",\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████\",\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████\",\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████\",\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███\",\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███\",\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██\",\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██\",\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██\",\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█\",\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█\",\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█\",\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\"]},\"moon\":{\"interval\":80,\"frames\":[\"🌑 \",\"🌒 \",\"🌓 \",\"🌔 \",\"🌕 \",\"🌖 \",\"🌗 \",\"🌘 \"]},\"runner\":{\"interval\":140,\"frames\":[\"🚶 \",\"🏃 \"]},\"pong\":{\"interval\":80,\"frames\":[\"▐⠂ ▌\",\"▐⠈ ▌\",\"▐ ⠂ ▌\",\"▐ ⠠ ▌\",\"▐ ⡀ ▌\",\"▐ ⠠ ▌\",\"▐ ⠂ ▌\",\"▐ ⠈ ▌\",\"▐ ⠂ ▌\",\"▐ ⠠ ▌\",\"▐ ⡀ ▌\",\"▐ ⠠ ▌\",\"▐ ⠂ ▌\",\"▐ ⠈ ▌\",\"▐ ⠂▌\",\"▐ ⠠▌\",\"▐ ⡀▌\",\"▐ ⠠ ▌\",\"▐ ⠂ ▌\",\"▐ ⠈ ▌\",\"▐ ⠂ ▌\",\"▐ ⠠ ▌\",\"▐ ⡀ ▌\",\"▐ ⠠ ▌\",\"▐ ⠂ ▌\",\"▐ ⠈ ▌\",\"▐ ⠂ ▌\",\"▐ ⠠ ▌\",\"▐ ⡀ ▌\",\"▐⠠ ▌\"]},\"shark\":{\"interval\":120,\"frames\":[\"▐|\\\\____________▌\",\"▐_|\\\\___________▌\",\"▐__|\\\\__________▌\",\"▐___|\\\\_________▌\",\"▐____|\\\\________▌\",\"▐_____|\\\\_______▌\",\"▐______|\\\\______▌\",\"▐_______|\\\\_____▌\",\"▐________|\\\\____▌\",\"▐_________|\\\\___▌\",\"▐__________|\\\\__▌\",\"▐___________|\\\\_▌\",\"▐____________|\\\\▌\",\"▐____________/|▌\",\"▐___________/|_▌\",\"▐__________/|__▌\",\"▐_________/|___▌\",\"▐________/|____▌\",\"▐_______/|_____▌\",\"▐______/|______▌\",\"▐_____/|_______▌\",\"▐____/|________▌\",\"▐___/|_________▌\",\"▐__/|__________▌\",\"▐_/|___________▌\",\"▐/|____________▌\"]},\"dqpb\":{\"interval\":100,\"frames\":[\"d\",\"q\",\"p\",\"b\"]},\"weather\":{\"interval\":100,\"frames\":[\"☀️ \",\"☀️ \",\"☀️ \",\"🌤 \",\"⛅️ \",\"🌥 \",\"☁️ \",\"🌧 \",\"🌨 \",\"🌧 \",\"🌨 \",\"🌧 \",\"🌨 \",\"⛈ \",\"🌨 \",\"🌧 \",\"🌨 \",\"☁️ \",\"🌥 \",\"⛅️ \",\"🌤 \",\"☀️ \",\"☀️ \"]},\"christmas\":{\"interval\":400,\"frames\":[\"🌲\",\"🎄\"]},\"grenade\":{\"interval\":80,\"frames\":[\"، \",\"′ \",\" ´ \",\" ‾ \",\" ⸌\",\" ⸊\",\" |\",\" ⁎\",\" ⁕\",\" ෴ \",\" ⁓\",\" \",\" \",\" \"]},\"point\":{\"interval\":125,\"frames\":[\"∙∙∙\",\"●∙∙\",\"∙●∙\",\"∙∙●\",\"∙∙∙\"]},\"layer\":{\"interval\":150,\"frames\":[\"-\",\"=\",\"≡\"]},\"betaWave\":{\"interval\":80,\"frames\":[\"ρββββββ\",\"βρβββββ\",\"ββρββββ\",\"βββρβββ\",\"ββββρββ\",\"βββββρβ\",\"ββββββρ\"]}}");
/***/ }),
-/* 384 */
+/* 378 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const chalk = __webpack_require__(385);
+const chalk = __webpack_require__(379);
const isSupported = process.platform !== 'win32' || process.env.CI || process.env.TERM === 'xterm-256color';
@@ -48097,16 +47623,16 @@ module.exports = isSupported ? main : fallbacks;
/***/ }),
-/* 385 */
+/* 379 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const escapeStringRegexp = __webpack_require__(178);
-const ansiStyles = __webpack_require__(386);
-const stdoutColor = __webpack_require__(184).stdout;
+const ansiStyles = __webpack_require__(380);
+const stdoutColor = __webpack_require__(381).stdout;
-const template = __webpack_require__(387);
+const template = __webpack_require__(383);
const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm');
@@ -48332,7 +47858,7 @@ module.exports.default = module.exports; // For TypeScript
/***/ }),
-/* 386 */
+/* 380 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -48505,7 +48031,160 @@ Object.defineProperty(module, 'exports', {
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(114)(module)))
/***/ }),
-/* 387 */
+/* 381 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+const os = __webpack_require__(120);
+const hasFlag = __webpack_require__(382);
+
+const env = process.env;
+
+let forceColor;
+if (hasFlag('no-color') ||
+ hasFlag('no-colors') ||
+ hasFlag('color=false')) {
+ forceColor = false;
+} else if (hasFlag('color') ||
+ hasFlag('colors') ||
+ hasFlag('color=true') ||
+ hasFlag('color=always')) {
+ forceColor = true;
+}
+if ('FORCE_COLOR' in env) {
+ forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
+}
+
+function translateLevel(level) {
+ if (level === 0) {
+ return false;
+ }
+
+ return {
+ level,
+ hasBasic: true,
+ has256: level >= 2,
+ has16m: level >= 3
+ };
+}
+
+function supportsColor(stream) {
+ if (forceColor === false) {
+ return 0;
+ }
+
+ if (hasFlag('color=16m') ||
+ hasFlag('color=full') ||
+ hasFlag('color=truecolor')) {
+ return 3;
+ }
+
+ if (hasFlag('color=256')) {
+ return 2;
+ }
+
+ if (stream && !stream.isTTY && forceColor !== true) {
+ return 0;
+ }
+
+ const min = forceColor ? 1 : 0;
+
+ if (process.platform === 'win32') {
+ // Node.js 7.5.0 is the first version of Node.js to include a patch to
+ // libuv that enables 256 color output on Windows. Anything earlier and it
+ // won't work. However, here we target Node.js 8 at minimum as it is an LTS
+ // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
+ // release that supports 256 colors. Windows 10 build 14931 is the first release
+ // that supports 16m/TrueColor.
+ const osRelease = os.release().split('.');
+ if (
+ Number(process.versions.node.split('.')[0]) >= 8 &&
+ Number(osRelease[0]) >= 10 &&
+ Number(osRelease[2]) >= 10586
+ ) {
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
+ }
+
+ return 1;
+ }
+
+ if ('CI' in env) {
+ if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
+ return 1;
+ }
+
+ return min;
+ }
+
+ if ('TEAMCITY_VERSION' in env) {
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
+ }
+
+ if (env.COLORTERM === 'truecolor') {
+ return 3;
+ }
+
+ if ('TERM_PROGRAM' in env) {
+ const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
+
+ switch (env.TERM_PROGRAM) {
+ case 'iTerm.app':
+ return version >= 3 ? 3 : 2;
+ case 'Apple_Terminal':
+ return 2;
+ // No default
+ }
+ }
+
+ if (/-256(color)?$/i.test(env.TERM)) {
+ return 2;
+ }
+
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
+ return 1;
+ }
+
+ if ('COLORTERM' in env) {
+ return 1;
+ }
+
+ if (env.TERM === 'dumb') {
+ return min;
+ }
+
+ return min;
+}
+
+function getSupportLevel(stream) {
+ const level = supportsColor(stream);
+ return translateLevel(level);
+}
+
+module.exports = {
+ supportsColor: getSupportLevel,
+ stdout: getSupportLevel(process.stdout),
+ stderr: getSupportLevel(process.stderr)
+};
+
+
+/***/ }),
+/* 382 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+module.exports = (flag, argv) => {
+ argv = argv || process.argv;
+ const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
+ const pos = argv.indexOf(prefix + flag);
+ const terminatorPos = argv.indexOf('--');
+ return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
+};
+
+
+/***/ }),
+/* 383 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -48639,8 +48318,555 @@ module.exports = (chalk, tmp) => {
};
+/***/ }),
+/* 384 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+const ansiRegex = __webpack_require__(385);
+
+module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
+
+
+/***/ }),
+/* 385 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+module.exports = ({onlyFirst = false} = {}) => {
+ const pattern = [
+ '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
+ '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'
+ ].join('|');
+
+ return new RegExp(pattern, onlyFirst ? undefined : 'g');
+};
+
+
+/***/ }),
+/* 386 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var defaults = __webpack_require__(387)
+var combining = __webpack_require__(389)
+
+var DEFAULTS = {
+ nul: 0,
+ control: 0
+}
+
+module.exports = function wcwidth(str) {
+ return wcswidth(str, DEFAULTS)
+}
+
+module.exports.config = function(opts) {
+ opts = defaults(opts || {}, DEFAULTS)
+ return function wcwidth(str) {
+ return wcswidth(str, opts)
+ }
+}
+
+/*
+ * The following functions define the column width of an ISO 10646
+ * character as follows:
+ * - The null character (U+0000) has a column width of 0.
+ * - Other C0/C1 control characters and DEL will lead to a return value
+ * of -1.
+ * - Non-spacing and enclosing combining characters (general category
+ * code Mn or Me in the
+ * Unicode database) have a column width of 0.
+ * - SOFT HYPHEN (U+00AD) has a column width of 1.
+ * - Other format characters (general category code Cf in the Unicode
+ * database) and ZERO WIDTH
+ * SPACE (U+200B) have a column width of 0.
+ * - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF)
+ * have a column width of 0.
+ * - Spacing characters in the East Asian Wide (W) or East Asian
+ * Full-width (F) category as
+ * defined in Unicode Technical Report #11 have a column width of 2.
+ * - All remaining characters (including all printable ISO 8859-1 and
+ * WGL4 characters, Unicode control characters, etc.) have a column
+ * width of 1.
+ * This implementation assumes that characters are encoded in ISO 10646.
+*/
+
+function wcswidth(str, opts) {
+ if (typeof str !== 'string') return wcwidth(str, opts)
+
+ var s = 0
+ for (var i = 0; i < str.length; i++) {
+ var n = wcwidth(str.charCodeAt(i), opts)
+ if (n < 0) return -1
+ s += n
+ }
+
+ return s
+}
+
+function wcwidth(ucs, opts) {
+ // test for 8-bit control characters
+ if (ucs === 0) return opts.nul
+ if (ucs < 32 || (ucs >= 0x7f && ucs < 0xa0)) return opts.control
+
+ // binary search in table of non-spacing characters
+ if (bisearch(ucs)) return 0
+
+ // if we arrive here, ucs is not a combining or C0/C1 control character
+ return 1 +
+ (ucs >= 0x1100 &&
+ (ucs <= 0x115f || // Hangul Jamo init. consonants
+ ucs == 0x2329 || ucs == 0x232a ||
+ (ucs >= 0x2e80 && ucs <= 0xa4cf &&
+ ucs != 0x303f) || // CJK ... Yi
+ (ucs >= 0xac00 && ucs <= 0xd7a3) || // Hangul Syllables
+ (ucs >= 0xf900 && ucs <= 0xfaff) || // CJK Compatibility Ideographs
+ (ucs >= 0xfe10 && ucs <= 0xfe19) || // Vertical forms
+ (ucs >= 0xfe30 && ucs <= 0xfe6f) || // CJK Compatibility Forms
+ (ucs >= 0xff00 && ucs <= 0xff60) || // Fullwidth Forms
+ (ucs >= 0xffe0 && ucs <= 0xffe6) ||
+ (ucs >= 0x20000 && ucs <= 0x2fffd) ||
+ (ucs >= 0x30000 && ucs <= 0x3fffd)));
+}
+
+function bisearch(ucs) {
+ var min = 0
+ var max = combining.length - 1
+ var mid
+
+ if (ucs < combining[0][0] || ucs > combining[max][1]) return false
+
+ while (max >= min) {
+ mid = Math.floor((min + max) / 2)
+ if (ucs > combining[mid][1]) min = mid + 1
+ else if (ucs < combining[mid][0]) max = mid - 1
+ else return true
+ }
+
+ return false
+}
+
+
+/***/ }),
+/* 387 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var clone = __webpack_require__(388);
+
+module.exports = function(options, defaults) {
+ options = options || {};
+
+ Object.keys(defaults).forEach(function(key) {
+ if (typeof options[key] === 'undefined') {
+ options[key] = clone(defaults[key]);
+ }
+ });
+
+ return options;
+};
+
/***/ }),
/* 388 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var clone = (function() {
+'use strict';
+
+/**
+ * Clones (copies) an Object using deep copying.
+ *
+ * This function supports circular references by default, but if you are certain
+ * there are no circular references in your object, you can save some CPU time
+ * by calling clone(obj, false).
+ *
+ * Caution: if `circular` is false and `parent` contains circular references,
+ * your program may enter an infinite loop and crash.
+ *
+ * @param `parent` - the object to be cloned
+ * @param `circular` - set to true if the object to be cloned may contain
+ * circular references. (optional - true by default)
+ * @param `depth` - set to a number if the object is only to be cloned to
+ * a particular depth. (optional - defaults to Infinity)
+ * @param `prototype` - sets the prototype to be used when cloning an object.
+ * (optional - defaults to parent prototype).
+*/
+function clone(parent, circular, depth, prototype) {
+ var filter;
+ if (typeof circular === 'object') {
+ depth = circular.depth;
+ prototype = circular.prototype;
+ filter = circular.filter;
+ circular = circular.circular
+ }
+ // maintain two arrays for circular references, where corresponding parents
+ // and children have the same index
+ var allParents = [];
+ var allChildren = [];
+
+ var useBuffer = typeof Buffer != 'undefined';
+
+ if (typeof circular == 'undefined')
+ circular = true;
+
+ if (typeof depth == 'undefined')
+ depth = Infinity;
+
+ // recurse this function so we don't reset allParents and allChildren
+ function _clone(parent, depth) {
+ // cloning null always returns null
+ if (parent === null)
+ return null;
+
+ if (depth == 0)
+ return parent;
+
+ var child;
+ var proto;
+ if (typeof parent != 'object') {
+ return parent;
+ }
+
+ if (clone.__isArray(parent)) {
+ child = [];
+ } else if (clone.__isRegExp(parent)) {
+ child = new RegExp(parent.source, __getRegExpFlags(parent));
+ if (parent.lastIndex) child.lastIndex = parent.lastIndex;
+ } else if (clone.__isDate(parent)) {
+ child = new Date(parent.getTime());
+ } else if (useBuffer && Buffer.isBuffer(parent)) {
+ if (Buffer.allocUnsafe) {
+ // Node.js >= 4.5.0
+ child = Buffer.allocUnsafe(parent.length);
+ } else {
+ // Older Node.js versions
+ child = new Buffer(parent.length);
+ }
+ parent.copy(child);
+ return child;
+ } else {
+ if (typeof prototype == 'undefined') {
+ proto = Object.getPrototypeOf(parent);
+ child = Object.create(proto);
+ }
+ else {
+ child = Object.create(prototype);
+ proto = prototype;
+ }
+ }
+
+ if (circular) {
+ var index = allParents.indexOf(parent);
+
+ if (index != -1) {
+ return allChildren[index];
+ }
+ allParents.push(parent);
+ allChildren.push(child);
+ }
+
+ for (var i in parent) {
+ var attrs;
+ if (proto) {
+ attrs = Object.getOwnPropertyDescriptor(proto, i);
+ }
+
+ if (attrs && attrs.set == null) {
+ continue;
+ }
+ child[i] = _clone(parent[i], depth - 1);
+ }
+
+ return child;
+ }
+
+ return _clone(parent, depth);
+}
+
+/**
+ * Simple flat clone using prototype, accepts only objects, usefull for property
+ * override on FLAT configuration object (no nested props).
+ *
+ * USE WITH CAUTION! This may not behave as you wish if you do not know how this
+ * works.
+ */
+clone.clonePrototype = function clonePrototype(parent) {
+ if (parent === null)
+ return null;
+
+ var c = function () {};
+ c.prototype = parent;
+ return new c();
+};
+
+// private utility functions
+
+function __objToStr(o) {
+ return Object.prototype.toString.call(o);
+};
+clone.__objToStr = __objToStr;
+
+function __isDate(o) {
+ return typeof o === 'object' && __objToStr(o) === '[object Date]';
+};
+clone.__isDate = __isDate;
+
+function __isArray(o) {
+ return typeof o === 'object' && __objToStr(o) === '[object Array]';
+};
+clone.__isArray = __isArray;
+
+function __isRegExp(o) {
+ return typeof o === 'object' && __objToStr(o) === '[object RegExp]';
+};
+clone.__isRegExp = __isRegExp;
+
+function __getRegExpFlags(re) {
+ var flags = '';
+ if (re.global) flags += 'g';
+ if (re.ignoreCase) flags += 'i';
+ if (re.multiline) flags += 'm';
+ return flags;
+};
+clone.__getRegExpFlags = __getRegExpFlags;
+
+return clone;
+})();
+
+if ( true && module.exports) {
+ module.exports = clone;
+}
+
+
+/***/ }),
+/* 389 */
+/***/ (function(module, exports) {
+
+module.exports = [
+ [ 0x0300, 0x036F ], [ 0x0483, 0x0486 ], [ 0x0488, 0x0489 ],
+ [ 0x0591, 0x05BD ], [ 0x05BF, 0x05BF ], [ 0x05C1, 0x05C2 ],
+ [ 0x05C4, 0x05C5 ], [ 0x05C7, 0x05C7 ], [ 0x0600, 0x0603 ],
+ [ 0x0610, 0x0615 ], [ 0x064B, 0x065E ], [ 0x0670, 0x0670 ],
+ [ 0x06D6, 0x06E4 ], [ 0x06E7, 0x06E8 ], [ 0x06EA, 0x06ED ],
+ [ 0x070F, 0x070F ], [ 0x0711, 0x0711 ], [ 0x0730, 0x074A ],
+ [ 0x07A6, 0x07B0 ], [ 0x07EB, 0x07F3 ], [ 0x0901, 0x0902 ],
+ [ 0x093C, 0x093C ], [ 0x0941, 0x0948 ], [ 0x094D, 0x094D ],
+ [ 0x0951, 0x0954 ], [ 0x0962, 0x0963 ], [ 0x0981, 0x0981 ],
+ [ 0x09BC, 0x09BC ], [ 0x09C1, 0x09C4 ], [ 0x09CD, 0x09CD ],
+ [ 0x09E2, 0x09E3 ], [ 0x0A01, 0x0A02 ], [ 0x0A3C, 0x0A3C ],
+ [ 0x0A41, 0x0A42 ], [ 0x0A47, 0x0A48 ], [ 0x0A4B, 0x0A4D ],
+ [ 0x0A70, 0x0A71 ], [ 0x0A81, 0x0A82 ], [ 0x0ABC, 0x0ABC ],
+ [ 0x0AC1, 0x0AC5 ], [ 0x0AC7, 0x0AC8 ], [ 0x0ACD, 0x0ACD ],
+ [ 0x0AE2, 0x0AE3 ], [ 0x0B01, 0x0B01 ], [ 0x0B3C, 0x0B3C ],
+ [ 0x0B3F, 0x0B3F ], [ 0x0B41, 0x0B43 ], [ 0x0B4D, 0x0B4D ],
+ [ 0x0B56, 0x0B56 ], [ 0x0B82, 0x0B82 ], [ 0x0BC0, 0x0BC0 ],
+ [ 0x0BCD, 0x0BCD ], [ 0x0C3E, 0x0C40 ], [ 0x0C46, 0x0C48 ],
+ [ 0x0C4A, 0x0C4D ], [ 0x0C55, 0x0C56 ], [ 0x0CBC, 0x0CBC ],
+ [ 0x0CBF, 0x0CBF ], [ 0x0CC6, 0x0CC6 ], [ 0x0CCC, 0x0CCD ],
+ [ 0x0CE2, 0x0CE3 ], [ 0x0D41, 0x0D43 ], [ 0x0D4D, 0x0D4D ],
+ [ 0x0DCA, 0x0DCA ], [ 0x0DD2, 0x0DD4 ], [ 0x0DD6, 0x0DD6 ],
+ [ 0x0E31, 0x0E31 ], [ 0x0E34, 0x0E3A ], [ 0x0E47, 0x0E4E ],
+ [ 0x0EB1, 0x0EB1 ], [ 0x0EB4, 0x0EB9 ], [ 0x0EBB, 0x0EBC ],
+ [ 0x0EC8, 0x0ECD ], [ 0x0F18, 0x0F19 ], [ 0x0F35, 0x0F35 ],
+ [ 0x0F37, 0x0F37 ], [ 0x0F39, 0x0F39 ], [ 0x0F71, 0x0F7E ],
+ [ 0x0F80, 0x0F84 ], [ 0x0F86, 0x0F87 ], [ 0x0F90, 0x0F97 ],
+ [ 0x0F99, 0x0FBC ], [ 0x0FC6, 0x0FC6 ], [ 0x102D, 0x1030 ],
+ [ 0x1032, 0x1032 ], [ 0x1036, 0x1037 ], [ 0x1039, 0x1039 ],
+ [ 0x1058, 0x1059 ], [ 0x1160, 0x11FF ], [ 0x135F, 0x135F ],
+ [ 0x1712, 0x1714 ], [ 0x1732, 0x1734 ], [ 0x1752, 0x1753 ],
+ [ 0x1772, 0x1773 ], [ 0x17B4, 0x17B5 ], [ 0x17B7, 0x17BD ],
+ [ 0x17C6, 0x17C6 ], [ 0x17C9, 0x17D3 ], [ 0x17DD, 0x17DD ],
+ [ 0x180B, 0x180D ], [ 0x18A9, 0x18A9 ], [ 0x1920, 0x1922 ],
+ [ 0x1927, 0x1928 ], [ 0x1932, 0x1932 ], [ 0x1939, 0x193B ],
+ [ 0x1A17, 0x1A18 ], [ 0x1B00, 0x1B03 ], [ 0x1B34, 0x1B34 ],
+ [ 0x1B36, 0x1B3A ], [ 0x1B3C, 0x1B3C ], [ 0x1B42, 0x1B42 ],
+ [ 0x1B6B, 0x1B73 ], [ 0x1DC0, 0x1DCA ], [ 0x1DFE, 0x1DFF ],
+ [ 0x200B, 0x200F ], [ 0x202A, 0x202E ], [ 0x2060, 0x2063 ],
+ [ 0x206A, 0x206F ], [ 0x20D0, 0x20EF ], [ 0x302A, 0x302F ],
+ [ 0x3099, 0x309A ], [ 0xA806, 0xA806 ], [ 0xA80B, 0xA80B ],
+ [ 0xA825, 0xA826 ], [ 0xFB1E, 0xFB1E ], [ 0xFE00, 0xFE0F ],
+ [ 0xFE20, 0xFE23 ], [ 0xFEFF, 0xFEFF ], [ 0xFFF9, 0xFFFB ],
+ [ 0x10A01, 0x10A03 ], [ 0x10A05, 0x10A06 ], [ 0x10A0C, 0x10A0F ],
+ [ 0x10A38, 0x10A3A ], [ 0x10A3F, 0x10A3F ], [ 0x1D167, 0x1D169 ],
+ [ 0x1D173, 0x1D182 ], [ 0x1D185, 0x1D18B ], [ 0x1D1AA, 0x1D1AD ],
+ [ 0x1D242, 0x1D244 ], [ 0xE0001, 0xE0001 ], [ 0xE0020, 0xE007F ],
+ [ 0xE0100, 0xE01EF ]
+]
+
+
+/***/ }),
+/* 390 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+module.exports = ({stream = process.stdout} = {}) => {
+ return Boolean(
+ stream && stream.isTTY &&
+ process.env.TERM !== 'dumb' &&
+ !('CI' in process.env)
+ );
+};
+
+
+/***/ }),
+/* 391 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var Stream = __webpack_require__(137)
+
+module.exports = MuteStream
+
+// var out = new MuteStream(process.stdout)
+// argument auto-pipes
+function MuteStream (opts) {
+ Stream.apply(this)
+ opts = opts || {}
+ this.writable = this.readable = true
+ this.muted = false
+ this.on('pipe', this._onpipe)
+ this.replace = opts.replace
+
+ // For readline-type situations
+ // This much at the start of a line being redrawn after a ctrl char
+ // is seen (such as backspace) won't be redrawn as the replacement
+ this._prompt = opts.prompt || null
+ this._hadControl = false
+}
+
+MuteStream.prototype = Object.create(Stream.prototype)
+
+Object.defineProperty(MuteStream.prototype, 'constructor', {
+ value: MuteStream,
+ enumerable: false
+})
+
+MuteStream.prototype.mute = function () {
+ this.muted = true
+}
+
+MuteStream.prototype.unmute = function () {
+ this.muted = false
+}
+
+Object.defineProperty(MuteStream.prototype, '_onpipe', {
+ value: onPipe,
+ enumerable: false,
+ writable: true,
+ configurable: true
+})
+
+function onPipe (src) {
+ this._src = src
+}
+
+Object.defineProperty(MuteStream.prototype, 'isTTY', {
+ get: getIsTTY,
+ set: setIsTTY,
+ enumerable: true,
+ configurable: true
+})
+
+function getIsTTY () {
+ return( (this._dest) ? this._dest.isTTY
+ : (this._src) ? this._src.isTTY
+ : false
+ )
+}
+
+// basically just get replace the getter/setter with a regular value
+function setIsTTY (isTTY) {
+ Object.defineProperty(this, 'isTTY', {
+ value: isTTY,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ })
+}
+
+Object.defineProperty(MuteStream.prototype, 'rows', {
+ get: function () {
+ return( this._dest ? this._dest.rows
+ : this._src ? this._src.rows
+ : undefined )
+ }, enumerable: true, configurable: true })
+
+Object.defineProperty(MuteStream.prototype, 'columns', {
+ get: function () {
+ return( this._dest ? this._dest.columns
+ : this._src ? this._src.columns
+ : undefined )
+ }, enumerable: true, configurable: true })
+
+
+MuteStream.prototype.pipe = function (dest, options) {
+ this._dest = dest
+ return Stream.prototype.pipe.call(this, dest, options)
+}
+
+MuteStream.prototype.pause = function () {
+ if (this._src) return this._src.pause()
+}
+
+MuteStream.prototype.resume = function () {
+ if (this._src) return this._src.resume()
+}
+
+MuteStream.prototype.write = function (c) {
+ if (this.muted) {
+ if (!this.replace) return true
+ if (c.match(/^\u001b/)) {
+ if(c.indexOf(this._prompt) === 0) {
+ c = c.substr(this._prompt.length);
+ c = c.replace(/./g, this.replace);
+ c = this._prompt + c;
+ }
+ this._hadControl = true
+ return this.emit('data', c)
+ } else {
+ if (this._prompt && this._hadControl &&
+ c.indexOf(this._prompt) === 0) {
+ this._hadControl = false
+ this.emit('data', this._prompt)
+ c = c.substr(this._prompt.length)
+ }
+ c = c.toString().replace(/./g, this.replace)
+ }
+ }
+ this.emit('data', c)
+}
+
+MuteStream.prototype.end = function (c) {
+ if (this.muted) {
+ if (c && this.replace) {
+ c = c.toString().replace(/./g, this.replace)
+ } else {
+ c = null
+ }
+ }
+ if (c) this.emit('data', c)
+ this.emit('end')
+}
+
+function proxy (fn) { return function () {
+ var d = this._dest
+ var s = this._src
+ if (d && d[fn]) d[fn].apply(d, arguments)
+ if (s && s[fn]) s[fn].apply(s, arguments)
+}}
+
+MuteStream.prototype.destroy = proxy('destroy')
+MuteStream.prototype.destroySoon = proxy('destroySoon')
+MuteStream.prototype.close = proxy('close')
+
+
+/***/ }),
+/* 392 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -48701,7 +48927,7 @@ const RunCommand = {
};
/***/ }),
-/* 389 */
+/* 393 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -48711,7 +48937,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143);
/* harmony import */ var _utils_parallelize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(144);
/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(145);
-/* harmony import */ var _utils_watch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(390);
+/* harmony import */ var _utils_watch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(394);
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
@@ -48796,14 +49022,14 @@ const WatchCommand = {
};
/***/ }),
-/* 390 */
+/* 394 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "waitUntilWatchIsReady", function() { return waitUntilWatchIsReady; });
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(391);
+/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(395);
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
@@ -48870,141 +49096,141 @@ function waitUntilWatchIsReady(stream, opts = {}) {
}
/***/ }),
-/* 391 */
+/* 395 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _internal_operators_audit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(392);
+/* harmony import */ var _internal_operators_audit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(396);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "audit", function() { return _internal_operators_audit__WEBPACK_IMPORTED_MODULE_0__["audit"]; });
-/* harmony import */ var _internal_operators_auditTime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(393);
+/* harmony import */ var _internal_operators_auditTime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(397);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "auditTime", function() { return _internal_operators_auditTime__WEBPACK_IMPORTED_MODULE_1__["auditTime"]; });
-/* harmony import */ var _internal_operators_buffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(394);
+/* harmony import */ var _internal_operators_buffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(398);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buffer", function() { return _internal_operators_buffer__WEBPACK_IMPORTED_MODULE_2__["buffer"]; });
-/* harmony import */ var _internal_operators_bufferCount__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(395);
+/* harmony import */ var _internal_operators_bufferCount__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(399);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferCount", function() { return _internal_operators_bufferCount__WEBPACK_IMPORTED_MODULE_3__["bufferCount"]; });
-/* harmony import */ var _internal_operators_bufferTime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(396);
+/* harmony import */ var _internal_operators_bufferTime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(400);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferTime", function() { return _internal_operators_bufferTime__WEBPACK_IMPORTED_MODULE_4__["bufferTime"]; });
-/* harmony import */ var _internal_operators_bufferToggle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(397);
+/* harmony import */ var _internal_operators_bufferToggle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(401);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferToggle", function() { return _internal_operators_bufferToggle__WEBPACK_IMPORTED_MODULE_5__["bufferToggle"]; });
-/* harmony import */ var _internal_operators_bufferWhen__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(398);
+/* harmony import */ var _internal_operators_bufferWhen__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(402);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferWhen", function() { return _internal_operators_bufferWhen__WEBPACK_IMPORTED_MODULE_6__["bufferWhen"]; });
-/* harmony import */ var _internal_operators_catchError__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(399);
+/* harmony import */ var _internal_operators_catchError__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(403);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "catchError", function() { return _internal_operators_catchError__WEBPACK_IMPORTED_MODULE_7__["catchError"]; });
-/* harmony import */ var _internal_operators_combineAll__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(400);
+/* harmony import */ var _internal_operators_combineAll__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(404);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "combineAll", function() { return _internal_operators_combineAll__WEBPACK_IMPORTED_MODULE_8__["combineAll"]; });
-/* harmony import */ var _internal_operators_combineLatest__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(401);
+/* harmony import */ var _internal_operators_combineLatest__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(405);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return _internal_operators_combineLatest__WEBPACK_IMPORTED_MODULE_9__["combineLatest"]; });
-/* harmony import */ var _internal_operators_concat__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(402);
+/* harmony import */ var _internal_operators_concat__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(406);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return _internal_operators_concat__WEBPACK_IMPORTED_MODULE_10__["concat"]; });
/* harmony import */ var _internal_operators_concatAll__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(80);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concatAll", function() { return _internal_operators_concatAll__WEBPACK_IMPORTED_MODULE_11__["concatAll"]; });
-/* harmony import */ var _internal_operators_concatMap__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(403);
+/* harmony import */ var _internal_operators_concatMap__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(407);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concatMap", function() { return _internal_operators_concatMap__WEBPACK_IMPORTED_MODULE_12__["concatMap"]; });
-/* harmony import */ var _internal_operators_concatMapTo__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(404);
+/* harmony import */ var _internal_operators_concatMapTo__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(408);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concatMapTo", function() { return _internal_operators_concatMapTo__WEBPACK_IMPORTED_MODULE_13__["concatMapTo"]; });
-/* harmony import */ var _internal_operators_count__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(405);
+/* harmony import */ var _internal_operators_count__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(409);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "count", function() { return _internal_operators_count__WEBPACK_IMPORTED_MODULE_14__["count"]; });
-/* harmony import */ var _internal_operators_debounce__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(406);
+/* harmony import */ var _internal_operators_debounce__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(410);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return _internal_operators_debounce__WEBPACK_IMPORTED_MODULE_15__["debounce"]; });
-/* harmony import */ var _internal_operators_debounceTime__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(407);
+/* harmony import */ var _internal_operators_debounceTime__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(411);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounceTime", function() { return _internal_operators_debounceTime__WEBPACK_IMPORTED_MODULE_16__["debounceTime"]; });
-/* harmony import */ var _internal_operators_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(408);
+/* harmony import */ var _internal_operators_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(412);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultIfEmpty", function() { return _internal_operators_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_17__["defaultIfEmpty"]; });
-/* harmony import */ var _internal_operators_delay__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(409);
+/* harmony import */ var _internal_operators_delay__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(413);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return _internal_operators_delay__WEBPACK_IMPORTED_MODULE_18__["delay"]; });
-/* harmony import */ var _internal_operators_delayWhen__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(411);
+/* harmony import */ var _internal_operators_delayWhen__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(415);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "delayWhen", function() { return _internal_operators_delayWhen__WEBPACK_IMPORTED_MODULE_19__["delayWhen"]; });
-/* harmony import */ var _internal_operators_dematerialize__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(412);
+/* harmony import */ var _internal_operators_dematerialize__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(416);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dematerialize", function() { return _internal_operators_dematerialize__WEBPACK_IMPORTED_MODULE_20__["dematerialize"]; });
-/* harmony import */ var _internal_operators_distinct__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(413);
+/* harmony import */ var _internal_operators_distinct__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(417);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "distinct", function() { return _internal_operators_distinct__WEBPACK_IMPORTED_MODULE_21__["distinct"]; });
-/* harmony import */ var _internal_operators_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(414);
+/* harmony import */ var _internal_operators_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(418);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "distinctUntilChanged", function() { return _internal_operators_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_22__["distinctUntilChanged"]; });
-/* harmony import */ var _internal_operators_distinctUntilKeyChanged__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(415);
+/* harmony import */ var _internal_operators_distinctUntilKeyChanged__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(419);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "distinctUntilKeyChanged", function() { return _internal_operators_distinctUntilKeyChanged__WEBPACK_IMPORTED_MODULE_23__["distinctUntilKeyChanged"]; });
-/* harmony import */ var _internal_operators_elementAt__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(416);
+/* harmony import */ var _internal_operators_elementAt__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(420);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "elementAt", function() { return _internal_operators_elementAt__WEBPACK_IMPORTED_MODULE_24__["elementAt"]; });
-/* harmony import */ var _internal_operators_endWith__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(419);
+/* harmony import */ var _internal_operators_endWith__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(423);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endWith", function() { return _internal_operators_endWith__WEBPACK_IMPORTED_MODULE_25__["endWith"]; });
-/* harmony import */ var _internal_operators_every__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(420);
+/* harmony import */ var _internal_operators_every__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(424);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "every", function() { return _internal_operators_every__WEBPACK_IMPORTED_MODULE_26__["every"]; });
-/* harmony import */ var _internal_operators_exhaust__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(421);
+/* harmony import */ var _internal_operators_exhaust__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(425);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exhaust", function() { return _internal_operators_exhaust__WEBPACK_IMPORTED_MODULE_27__["exhaust"]; });
-/* harmony import */ var _internal_operators_exhaustMap__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(422);
+/* harmony import */ var _internal_operators_exhaustMap__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(426);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exhaustMap", function() { return _internal_operators_exhaustMap__WEBPACK_IMPORTED_MODULE_28__["exhaustMap"]; });
-/* harmony import */ var _internal_operators_expand__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(423);
+/* harmony import */ var _internal_operators_expand__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(427);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "expand", function() { return _internal_operators_expand__WEBPACK_IMPORTED_MODULE_29__["expand"]; });
/* harmony import */ var _internal_operators_filter__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(104);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return _internal_operators_filter__WEBPACK_IMPORTED_MODULE_30__["filter"]; });
-/* harmony import */ var _internal_operators_finalize__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(424);
+/* harmony import */ var _internal_operators_finalize__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(428);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "finalize", function() { return _internal_operators_finalize__WEBPACK_IMPORTED_MODULE_31__["finalize"]; });
-/* harmony import */ var _internal_operators_find__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(425);
+/* harmony import */ var _internal_operators_find__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(429);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "find", function() { return _internal_operators_find__WEBPACK_IMPORTED_MODULE_32__["find"]; });
-/* harmony import */ var _internal_operators_findIndex__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(426);
+/* harmony import */ var _internal_operators_findIndex__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(430);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return _internal_operators_findIndex__WEBPACK_IMPORTED_MODULE_33__["findIndex"]; });
-/* harmony import */ var _internal_operators_first__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(427);
+/* harmony import */ var _internal_operators_first__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(431);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "first", function() { return _internal_operators_first__WEBPACK_IMPORTED_MODULE_34__["first"]; });
/* harmony import */ var _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(31);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_35__["groupBy"]; });
-/* harmony import */ var _internal_operators_ignoreElements__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(428);
+/* harmony import */ var _internal_operators_ignoreElements__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(432);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ignoreElements", function() { return _internal_operators_ignoreElements__WEBPACK_IMPORTED_MODULE_36__["ignoreElements"]; });
-/* harmony import */ var _internal_operators_isEmpty__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(429);
+/* harmony import */ var _internal_operators_isEmpty__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(433);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return _internal_operators_isEmpty__WEBPACK_IMPORTED_MODULE_37__["isEmpty"]; });
-/* harmony import */ var _internal_operators_last__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(430);
+/* harmony import */ var _internal_operators_last__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(434);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "last", function() { return _internal_operators_last__WEBPACK_IMPORTED_MODULE_38__["last"]; });
/* harmony import */ var _internal_operators_map__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(66);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "map", function() { return _internal_operators_map__WEBPACK_IMPORTED_MODULE_39__["map"]; });
-/* harmony import */ var _internal_operators_mapTo__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(432);
+/* harmony import */ var _internal_operators_mapTo__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(436);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapTo", function() { return _internal_operators_mapTo__WEBPACK_IMPORTED_MODULE_40__["mapTo"]; });
-/* harmony import */ var _internal_operators_materialize__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(433);
+/* harmony import */ var _internal_operators_materialize__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(437);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "materialize", function() { return _internal_operators_materialize__WEBPACK_IMPORTED_MODULE_41__["materialize"]; });
-/* harmony import */ var _internal_operators_max__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(434);
+/* harmony import */ var _internal_operators_max__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(438);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "max", function() { return _internal_operators_max__WEBPACK_IMPORTED_MODULE_42__["max"]; });
-/* harmony import */ var _internal_operators_merge__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(437);
+/* harmony import */ var _internal_operators_merge__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(441);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return _internal_operators_merge__WEBPACK_IMPORTED_MODULE_43__["merge"]; });
/* harmony import */ var _internal_operators_mergeAll__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(81);
@@ -49015,175 +49241,175 @@ __webpack_require__.r(__webpack_exports__);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMap", function() { return _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_45__["mergeMap"]; });
-/* harmony import */ var _internal_operators_mergeMapTo__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(438);
+/* harmony import */ var _internal_operators_mergeMapTo__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(442);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeMapTo", function() { return _internal_operators_mergeMapTo__WEBPACK_IMPORTED_MODULE_46__["mergeMapTo"]; });
-/* harmony import */ var _internal_operators_mergeScan__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(439);
+/* harmony import */ var _internal_operators_mergeScan__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(443);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeScan", function() { return _internal_operators_mergeScan__WEBPACK_IMPORTED_MODULE_47__["mergeScan"]; });
-/* harmony import */ var _internal_operators_min__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(440);
+/* harmony import */ var _internal_operators_min__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(444);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "min", function() { return _internal_operators_min__WEBPACK_IMPORTED_MODULE_48__["min"]; });
-/* harmony import */ var _internal_operators_multicast__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(441);
+/* harmony import */ var _internal_operators_multicast__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(445);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "multicast", function() { return _internal_operators_multicast__WEBPACK_IMPORTED_MODULE_49__["multicast"]; });
/* harmony import */ var _internal_operators_observeOn__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(41);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "observeOn", function() { return _internal_operators_observeOn__WEBPACK_IMPORTED_MODULE_50__["observeOn"]; });
-/* harmony import */ var _internal_operators_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(442);
+/* harmony import */ var _internal_operators_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(446);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return _internal_operators_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_51__["onErrorResumeNext"]; });
-/* harmony import */ var _internal_operators_pairwise__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(443);
+/* harmony import */ var _internal_operators_pairwise__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(447);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pairwise", function() { return _internal_operators_pairwise__WEBPACK_IMPORTED_MODULE_52__["pairwise"]; });
-/* harmony import */ var _internal_operators_partition__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(444);
+/* harmony import */ var _internal_operators_partition__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(448);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return _internal_operators_partition__WEBPACK_IMPORTED_MODULE_53__["partition"]; });
-/* harmony import */ var _internal_operators_pluck__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(445);
+/* harmony import */ var _internal_operators_pluck__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(449);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return _internal_operators_pluck__WEBPACK_IMPORTED_MODULE_54__["pluck"]; });
-/* harmony import */ var _internal_operators_publish__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(446);
+/* harmony import */ var _internal_operators_publish__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(450);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publish", function() { return _internal_operators_publish__WEBPACK_IMPORTED_MODULE_55__["publish"]; });
-/* harmony import */ var _internal_operators_publishBehavior__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(447);
+/* harmony import */ var _internal_operators_publishBehavior__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(451);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publishBehavior", function() { return _internal_operators_publishBehavior__WEBPACK_IMPORTED_MODULE_56__["publishBehavior"]; });
-/* harmony import */ var _internal_operators_publishLast__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(448);
+/* harmony import */ var _internal_operators_publishLast__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(452);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publishLast", function() { return _internal_operators_publishLast__WEBPACK_IMPORTED_MODULE_57__["publishLast"]; });
-/* harmony import */ var _internal_operators_publishReplay__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(449);
+/* harmony import */ var _internal_operators_publishReplay__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(453);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publishReplay", function() { return _internal_operators_publishReplay__WEBPACK_IMPORTED_MODULE_58__["publishReplay"]; });
-/* harmony import */ var _internal_operators_race__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(450);
+/* harmony import */ var _internal_operators_race__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(454);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "race", function() { return _internal_operators_race__WEBPACK_IMPORTED_MODULE_59__["race"]; });
-/* harmony import */ var _internal_operators_reduce__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(435);
+/* harmony import */ var _internal_operators_reduce__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(439);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return _internal_operators_reduce__WEBPACK_IMPORTED_MODULE_60__["reduce"]; });
-/* harmony import */ var _internal_operators_repeat__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(451);
+/* harmony import */ var _internal_operators_repeat__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(455);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return _internal_operators_repeat__WEBPACK_IMPORTED_MODULE_61__["repeat"]; });
-/* harmony import */ var _internal_operators_repeatWhen__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(452);
+/* harmony import */ var _internal_operators_repeatWhen__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(456);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "repeatWhen", function() { return _internal_operators_repeatWhen__WEBPACK_IMPORTED_MODULE_62__["repeatWhen"]; });
-/* harmony import */ var _internal_operators_retry__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(453);
+/* harmony import */ var _internal_operators_retry__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(457);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "retry", function() { return _internal_operators_retry__WEBPACK_IMPORTED_MODULE_63__["retry"]; });
-/* harmony import */ var _internal_operators_retryWhen__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(454);
+/* harmony import */ var _internal_operators_retryWhen__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(458);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "retryWhen", function() { return _internal_operators_retryWhen__WEBPACK_IMPORTED_MODULE_64__["retryWhen"]; });
/* harmony import */ var _internal_operators_refCount__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(30);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "refCount", function() { return _internal_operators_refCount__WEBPACK_IMPORTED_MODULE_65__["refCount"]; });
-/* harmony import */ var _internal_operators_sample__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(455);
+/* harmony import */ var _internal_operators_sample__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(459);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return _internal_operators_sample__WEBPACK_IMPORTED_MODULE_66__["sample"]; });
-/* harmony import */ var _internal_operators_sampleTime__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(456);
+/* harmony import */ var _internal_operators_sampleTime__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(460);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sampleTime", function() { return _internal_operators_sampleTime__WEBPACK_IMPORTED_MODULE_67__["sampleTime"]; });
-/* harmony import */ var _internal_operators_scan__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(436);
+/* harmony import */ var _internal_operators_scan__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(440);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scan", function() { return _internal_operators_scan__WEBPACK_IMPORTED_MODULE_68__["scan"]; });
-/* harmony import */ var _internal_operators_sequenceEqual__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(457);
+/* harmony import */ var _internal_operators_sequenceEqual__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(461);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sequenceEqual", function() { return _internal_operators_sequenceEqual__WEBPACK_IMPORTED_MODULE_69__["sequenceEqual"]; });
-/* harmony import */ var _internal_operators_share__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(458);
+/* harmony import */ var _internal_operators_share__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(462);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "share", function() { return _internal_operators_share__WEBPACK_IMPORTED_MODULE_70__["share"]; });
-/* harmony import */ var _internal_operators_shareReplay__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(459);
+/* harmony import */ var _internal_operators_shareReplay__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(463);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "shareReplay", function() { return _internal_operators_shareReplay__WEBPACK_IMPORTED_MODULE_71__["shareReplay"]; });
-/* harmony import */ var _internal_operators_single__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(460);
+/* harmony import */ var _internal_operators_single__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(464);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "single", function() { return _internal_operators_single__WEBPACK_IMPORTED_MODULE_72__["single"]; });
-/* harmony import */ var _internal_operators_skip__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(461);
+/* harmony import */ var _internal_operators_skip__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(465);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skip", function() { return _internal_operators_skip__WEBPACK_IMPORTED_MODULE_73__["skip"]; });
-/* harmony import */ var _internal_operators_skipLast__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(462);
+/* harmony import */ var _internal_operators_skipLast__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(466);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skipLast", function() { return _internal_operators_skipLast__WEBPACK_IMPORTED_MODULE_74__["skipLast"]; });
-/* harmony import */ var _internal_operators_skipUntil__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(463);
+/* harmony import */ var _internal_operators_skipUntil__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(467);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skipUntil", function() { return _internal_operators_skipUntil__WEBPACK_IMPORTED_MODULE_75__["skipUntil"]; });
-/* harmony import */ var _internal_operators_skipWhile__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(464);
+/* harmony import */ var _internal_operators_skipWhile__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(468);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skipWhile", function() { return _internal_operators_skipWhile__WEBPACK_IMPORTED_MODULE_76__["skipWhile"]; });
-/* harmony import */ var _internal_operators_startWith__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(465);
+/* harmony import */ var _internal_operators_startWith__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(469);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startWith", function() { return _internal_operators_startWith__WEBPACK_IMPORTED_MODULE_77__["startWith"]; });
-/* harmony import */ var _internal_operators_subscribeOn__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(466);
+/* harmony import */ var _internal_operators_subscribeOn__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(470);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subscribeOn", function() { return _internal_operators_subscribeOn__WEBPACK_IMPORTED_MODULE_78__["subscribeOn"]; });
-/* harmony import */ var _internal_operators_switchAll__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(468);
+/* harmony import */ var _internal_operators_switchAll__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(472);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "switchAll", function() { return _internal_operators_switchAll__WEBPACK_IMPORTED_MODULE_79__["switchAll"]; });
-/* harmony import */ var _internal_operators_switchMap__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(469);
+/* harmony import */ var _internal_operators_switchMap__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(473);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "switchMap", function() { return _internal_operators_switchMap__WEBPACK_IMPORTED_MODULE_80__["switchMap"]; });
-/* harmony import */ var _internal_operators_switchMapTo__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(470);
+/* harmony import */ var _internal_operators_switchMapTo__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(474);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "switchMapTo", function() { return _internal_operators_switchMapTo__WEBPACK_IMPORTED_MODULE_81__["switchMapTo"]; });
-/* harmony import */ var _internal_operators_take__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(418);
+/* harmony import */ var _internal_operators_take__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(422);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "take", function() { return _internal_operators_take__WEBPACK_IMPORTED_MODULE_82__["take"]; });
-/* harmony import */ var _internal_operators_takeLast__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(431);
+/* harmony import */ var _internal_operators_takeLast__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(435);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeLast", function() { return _internal_operators_takeLast__WEBPACK_IMPORTED_MODULE_83__["takeLast"]; });
-/* harmony import */ var _internal_operators_takeUntil__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(471);
+/* harmony import */ var _internal_operators_takeUntil__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(475);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeUntil", function() { return _internal_operators_takeUntil__WEBPACK_IMPORTED_MODULE_84__["takeUntil"]; });
-/* harmony import */ var _internal_operators_takeWhile__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(472);
+/* harmony import */ var _internal_operators_takeWhile__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(476);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return _internal_operators_takeWhile__WEBPACK_IMPORTED_MODULE_85__["takeWhile"]; });
-/* harmony import */ var _internal_operators_tap__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(473);
+/* harmony import */ var _internal_operators_tap__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(477);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return _internal_operators_tap__WEBPACK_IMPORTED_MODULE_86__["tap"]; });
-/* harmony import */ var _internal_operators_throttle__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(474);
+/* harmony import */ var _internal_operators_throttle__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(478);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return _internal_operators_throttle__WEBPACK_IMPORTED_MODULE_87__["throttle"]; });
-/* harmony import */ var _internal_operators_throttleTime__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(475);
+/* harmony import */ var _internal_operators_throttleTime__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(479);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttleTime", function() { return _internal_operators_throttleTime__WEBPACK_IMPORTED_MODULE_88__["throttleTime"]; });
-/* harmony import */ var _internal_operators_throwIfEmpty__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(417);
+/* harmony import */ var _internal_operators_throwIfEmpty__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(421);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throwIfEmpty", function() { return _internal_operators_throwIfEmpty__WEBPACK_IMPORTED_MODULE_89__["throwIfEmpty"]; });
-/* harmony import */ var _internal_operators_timeInterval__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(476);
+/* harmony import */ var _internal_operators_timeInterval__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(480);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return _internal_operators_timeInterval__WEBPACK_IMPORTED_MODULE_90__["timeInterval"]; });
-/* harmony import */ var _internal_operators_timeout__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(477);
+/* harmony import */ var _internal_operators_timeout__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(481);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeout", function() { return _internal_operators_timeout__WEBPACK_IMPORTED_MODULE_91__["timeout"]; });
-/* harmony import */ var _internal_operators_timeoutWith__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(478);
+/* harmony import */ var _internal_operators_timeoutWith__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(482);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeoutWith", function() { return _internal_operators_timeoutWith__WEBPACK_IMPORTED_MODULE_92__["timeoutWith"]; });
-/* harmony import */ var _internal_operators_timestamp__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(479);
+/* harmony import */ var _internal_operators_timestamp__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(483);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timestamp", function() { return _internal_operators_timestamp__WEBPACK_IMPORTED_MODULE_93__["timestamp"]; });
-/* harmony import */ var _internal_operators_toArray__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(480);
+/* harmony import */ var _internal_operators_toArray__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(484);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return _internal_operators_toArray__WEBPACK_IMPORTED_MODULE_94__["toArray"]; });
-/* harmony import */ var _internal_operators_window__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(481);
+/* harmony import */ var _internal_operators_window__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(485);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "window", function() { return _internal_operators_window__WEBPACK_IMPORTED_MODULE_95__["window"]; });
-/* harmony import */ var _internal_operators_windowCount__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(482);
+/* harmony import */ var _internal_operators_windowCount__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(486);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowCount", function() { return _internal_operators_windowCount__WEBPACK_IMPORTED_MODULE_96__["windowCount"]; });
-/* harmony import */ var _internal_operators_windowTime__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(483);
+/* harmony import */ var _internal_operators_windowTime__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(487);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowTime", function() { return _internal_operators_windowTime__WEBPACK_IMPORTED_MODULE_97__["windowTime"]; });
-/* harmony import */ var _internal_operators_windowToggle__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(484);
+/* harmony import */ var _internal_operators_windowToggle__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(488);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowToggle", function() { return _internal_operators_windowToggle__WEBPACK_IMPORTED_MODULE_98__["windowToggle"]; });
-/* harmony import */ var _internal_operators_windowWhen__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(485);
+/* harmony import */ var _internal_operators_windowWhen__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(489);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowWhen", function() { return _internal_operators_windowWhen__WEBPACK_IMPORTED_MODULE_99__["windowWhen"]; });
-/* harmony import */ var _internal_operators_withLatestFrom__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(486);
+/* harmony import */ var _internal_operators_withLatestFrom__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(490);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withLatestFrom", function() { return _internal_operators_withLatestFrom__WEBPACK_IMPORTED_MODULE_100__["withLatestFrom"]; });
-/* harmony import */ var _internal_operators_zip__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(487);
+/* harmony import */ var _internal_operators_zip__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(491);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return _internal_operators_zip__WEBPACK_IMPORTED_MODULE_101__["zip"]; });
-/* harmony import */ var _internal_operators_zipAll__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(488);
+/* harmony import */ var _internal_operators_zipAll__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(492);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipAll", function() { return _internal_operators_zipAll__WEBPACK_IMPORTED_MODULE_102__["zipAll"]; });
/** PURE_IMPORTS_START PURE_IMPORTS_END */
@@ -49295,7 +49521,7 @@ __webpack_require__.r(__webpack_exports__);
/***/ }),
-/* 392 */
+/* 396 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -49376,14 +49602,14 @@ var AuditSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 393 */
+/* 397 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "auditTime", function() { return auditTime; });
/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55);
-/* harmony import */ var _audit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(392);
+/* harmony import */ var _audit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(396);
/* harmony import */ var _observable_timer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(107);
/** PURE_IMPORTS_START _scheduler_async,_audit,_observable_timer PURE_IMPORTS_END */
@@ -49399,7 +49625,7 @@ function auditTime(duration, scheduler) {
/***/ }),
-/* 394 */
+/* 398 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -49448,7 +49674,7 @@ var BufferSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 395 */
+/* 399 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -49549,7 +49775,7 @@ var BufferSkipCountSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 396 */
+/* 400 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -49710,7 +49936,7 @@ function dispatchBufferClose(arg) {
/***/ }),
-/* 397 */
+/* 401 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -49830,7 +50056,7 @@ var BufferToggleSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 398 */
+/* 402 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -49925,7 +50151,7 @@ var BufferWhenSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 399 */
+/* 403 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -49989,7 +50215,7 @@ var CatchSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 400 */
+/* 404 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -50005,7 +50231,7 @@ function combineAll(project) {
/***/ }),
-/* 401 */
+/* 405 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -50037,7 +50263,7 @@ function combineLatest() {
/***/ }),
-/* 402 */
+/* 406 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -50057,7 +50283,7 @@ function concat() {
/***/ }),
-/* 403 */
+/* 407 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -50073,13 +50299,13 @@ function concatMap(project, resultSelector) {
/***/ }),
-/* 404 */
+/* 408 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concatMapTo", function() { return concatMapTo; });
-/* harmony import */ var _concatMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(403);
+/* harmony import */ var _concatMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(407);
/** PURE_IMPORTS_START _concatMap PURE_IMPORTS_END */
function concatMapTo(innerObservable, resultSelector) {
@@ -50089,7 +50315,7 @@ function concatMapTo(innerObservable, resultSelector) {
/***/ }),
-/* 405 */
+/* 409 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -50154,7 +50380,7 @@ var CountSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 406 */
+/* 410 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -50242,7 +50468,7 @@ var DebounceSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 407 */
+/* 411 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -50318,7 +50544,7 @@ function dispatchNext(subscriber) {
/***/ }),
-/* 408 */
+/* 412 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -50368,7 +50594,7 @@ var DefaultIfEmptySubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 409 */
+/* 413 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -50376,7 +50602,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return delay; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55);
-/* harmony import */ var _util_isDate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(410);
+/* harmony import */ var _util_isDate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(414);
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(11);
/* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(42);
/** PURE_IMPORTS_START tslib,_scheduler_async,_util_isDate,_Subscriber,_Notification PURE_IMPORTS_END */
@@ -50475,7 +50701,7 @@ var DelayMessage = /*@__PURE__*/ (function () {
/***/ }),
-/* 410 */
+/* 414 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -50489,7 +50715,7 @@ function isDate(value) {
/***/ }),
-/* 411 */
+/* 415 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -50635,7 +50861,7 @@ var SubscriptionDelaySubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 412 */
+/* 416 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -50673,7 +50899,7 @@ var DeMaterializeSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 413 */
+/* 417 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -50751,7 +50977,7 @@ var DistinctSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 414 */
+/* 418 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -50822,13 +51048,13 @@ var DistinctUntilChangedSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 415 */
+/* 419 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinctUntilKeyChanged", function() { return distinctUntilKeyChanged; });
-/* harmony import */ var _distinctUntilChanged__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(414);
+/* harmony import */ var _distinctUntilChanged__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(418);
/** PURE_IMPORTS_START _distinctUntilChanged PURE_IMPORTS_END */
function distinctUntilKeyChanged(key, compare) {
@@ -50838,7 +51064,7 @@ function distinctUntilKeyChanged(key, compare) {
/***/ }),
-/* 416 */
+/* 420 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -50846,9 +51072,9 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elementAt", function() { return elementAt; });
/* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(62);
/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(104);
-/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(417);
-/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(408);
-/* harmony import */ var _take__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(418);
+/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(421);
+/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(412);
+/* harmony import */ var _take__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(422);
/** PURE_IMPORTS_START _util_ArgumentOutOfRangeError,_filter,_throwIfEmpty,_defaultIfEmpty,_take PURE_IMPORTS_END */
@@ -50870,7 +51096,7 @@ function elementAt(index, defaultValue) {
/***/ }),
-/* 417 */
+/* 421 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -50936,7 +51162,7 @@ function defaultErrorFactory() {
/***/ }),
-/* 418 */
+/* 422 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -50998,7 +51224,7 @@ var TakeSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 419 */
+/* 423 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -51020,7 +51246,7 @@ function endWith() {
/***/ }),
-/* 420 */
+/* 424 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -51082,7 +51308,7 @@ var EverySubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 421 */
+/* 425 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -51139,7 +51365,7 @@ var SwitchFirstSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 422 */
+/* 426 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -51239,7 +51465,7 @@ var ExhaustMapSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 423 */
+/* 427 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -51358,7 +51584,7 @@ var ExpandSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 424 */
+/* 428 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -51396,7 +51622,7 @@ var FinallySubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 425 */
+/* 429 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -51468,13 +51694,13 @@ var FindValueSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 426 */
+/* 430 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return findIndex; });
-/* harmony import */ var _operators_find__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(425);
+/* harmony import */ var _operators_find__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(429);
/** PURE_IMPORTS_START _operators_find PURE_IMPORTS_END */
function findIndex(predicate, thisArg) {
@@ -51484,7 +51710,7 @@ function findIndex(predicate, thisArg) {
/***/ }),
-/* 427 */
+/* 431 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -51492,9 +51718,9 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return first; });
/* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(63);
/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(104);
-/* harmony import */ var _take__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(418);
-/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(408);
-/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(417);
+/* harmony import */ var _take__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(422);
+/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(412);
+/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(421);
/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(25);
/** PURE_IMPORTS_START _util_EmptyError,_filter,_take,_defaultIfEmpty,_throwIfEmpty,_util_identity PURE_IMPORTS_END */
@@ -51511,7 +51737,7 @@ function first(predicate, defaultValue) {
/***/ }),
-/* 428 */
+/* 432 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -51548,7 +51774,7 @@ var IgnoreElementsSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 429 */
+/* 433 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -51592,7 +51818,7 @@ var IsEmptySubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 430 */
+/* 434 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -51600,9 +51826,9 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "last", function() { return last; });
/* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(63);
/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(104);
-/* harmony import */ var _takeLast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(431);
-/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(417);
-/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(408);
+/* harmony import */ var _takeLast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(435);
+/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(421);
+/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(412);
/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(25);
/** PURE_IMPORTS_START _util_EmptyError,_filter,_takeLast,_throwIfEmpty,_defaultIfEmpty,_util_identity PURE_IMPORTS_END */
@@ -51619,7 +51845,7 @@ function last(predicate, defaultValue) {
/***/ }),
-/* 431 */
+/* 435 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -51696,7 +51922,7 @@ var TakeLastSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 432 */
+/* 436 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -51735,7 +51961,7 @@ var MapToSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 433 */
+/* 437 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -51785,13 +52011,13 @@ var MaterializeSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 434 */
+/* 438 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return max; });
-/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(435);
+/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(439);
/** PURE_IMPORTS_START _reduce PURE_IMPORTS_END */
function max(comparer) {
@@ -51804,15 +52030,15 @@ function max(comparer) {
/***/ }),
-/* 435 */
+/* 439 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return reduce; });
-/* harmony import */ var _scan__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(436);
-/* harmony import */ var _takeLast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(431);
-/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(408);
+/* harmony import */ var _scan__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(440);
+/* harmony import */ var _takeLast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(435);
+/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(412);
/* harmony import */ var _util_pipe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(24);
/** PURE_IMPORTS_START _scan,_takeLast,_defaultIfEmpty,_util_pipe PURE_IMPORTS_END */
@@ -51833,7 +52059,7 @@ function reduce(accumulator, seed) {
/***/ }),
-/* 436 */
+/* 440 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -51915,7 +52141,7 @@ var ScanSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 437 */
+/* 441 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -51935,7 +52161,7 @@ function merge() {
/***/ }),
-/* 438 */
+/* 442 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -51960,7 +52186,7 @@ function mergeMapTo(innerObservable, resultSelector, concurrent) {
/***/ }),
-/* 439 */
+/* 443 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -52075,13 +52301,13 @@ var MergeScanSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 440 */
+/* 444 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return min; });
-/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(435);
+/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(439);
/** PURE_IMPORTS_START _reduce PURE_IMPORTS_END */
function min(comparer) {
@@ -52094,7 +52320,7 @@ function min(comparer) {
/***/ }),
-/* 441 */
+/* 445 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -52143,7 +52369,7 @@ var MulticastOperator = /*@__PURE__*/ (function () {
/***/ }),
-/* 442 */
+/* 446 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -52237,7 +52463,7 @@ var OnErrorResumeNextSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 443 */
+/* 447 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -52285,7 +52511,7 @@ var PairwiseSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 444 */
+/* 448 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -52308,7 +52534,7 @@ function partition(predicate, thisArg) {
/***/ }),
-/* 445 */
+/* 449 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -52348,14 +52574,14 @@ function plucker(props, length) {
/***/ }),
-/* 446 */
+/* 450 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publish", function() { return publish; });
/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27);
-/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(441);
+/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(445);
/** PURE_IMPORTS_START _Subject,_multicast PURE_IMPORTS_END */
@@ -52368,14 +52594,14 @@ function publish(selector) {
/***/ }),
-/* 447 */
+/* 451 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publishBehavior", function() { return publishBehavior; });
/* harmony import */ var _BehaviorSubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(32);
-/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(441);
+/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(445);
/** PURE_IMPORTS_START _BehaviorSubject,_multicast PURE_IMPORTS_END */
@@ -52386,14 +52612,14 @@ function publishBehavior(value) {
/***/ }),
-/* 448 */
+/* 452 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publishLast", function() { return publishLast; });
/* harmony import */ var _AsyncSubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50);
-/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(441);
+/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(445);
/** PURE_IMPORTS_START _AsyncSubject,_multicast PURE_IMPORTS_END */
@@ -52404,14 +52630,14 @@ function publishLast() {
/***/ }),
-/* 449 */
+/* 453 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publishReplay", function() { return publishReplay; });
/* harmony import */ var _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33);
-/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(441);
+/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(445);
/** PURE_IMPORTS_START _ReplaySubject,_multicast PURE_IMPORTS_END */
@@ -52427,7 +52653,7 @@ function publishReplay(bufferSize, windowTime, selectorOrScheduler, scheduler) {
/***/ }),
-/* 450 */
+/* 454 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -52454,7 +52680,7 @@ function race() {
/***/ }),
-/* 451 */
+/* 455 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -52519,7 +52745,7 @@ var RepeatSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 452 */
+/* 456 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -52615,7 +52841,7 @@ var RepeatWhenSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 453 */
+/* 457 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -52668,7 +52894,7 @@ var RetrySubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 454 */
+/* 458 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -52756,7 +52982,7 @@ var RetryWhenSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 455 */
+/* 459 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -52813,7 +53039,7 @@ var SampleSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 456 */
+/* 460 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -52873,7 +53099,7 @@ function dispatchNotification(state) {
/***/ }),
-/* 457 */
+/* 461 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -52996,13 +53222,13 @@ var SequenceEqualCompareToSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 458 */
+/* 462 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "share", function() { return share; });
-/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(441);
+/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(445);
/* harmony import */ var _refCount__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(30);
/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(27);
/** PURE_IMPORTS_START _multicast,_refCount,_Subject PURE_IMPORTS_END */
@@ -53019,7 +53245,7 @@ function share() {
/***/ }),
-/* 459 */
+/* 463 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -53084,7 +53310,7 @@ function shareReplayOperator(_a) {
/***/ }),
-/* 460 */
+/* 464 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -53164,7 +53390,7 @@ var SingleSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 461 */
+/* 465 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -53206,7 +53432,7 @@ var SkipSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 462 */
+/* 466 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -53268,7 +53494,7 @@ var SkipLastSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 463 */
+/* 467 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -53329,7 +53555,7 @@ var SkipUntilSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 464 */
+/* 468 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -53385,7 +53611,7 @@ var SkipWhileSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 465 */
+/* 469 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -53414,13 +53640,13 @@ function startWith() {
/***/ }),
-/* 466 */
+/* 470 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeOn", function() { return subscribeOn; });
-/* harmony import */ var _observable_SubscribeOnObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(467);
+/* harmony import */ var _observable_SubscribeOnObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(471);
/** PURE_IMPORTS_START _observable_SubscribeOnObservable PURE_IMPORTS_END */
function subscribeOn(scheduler, delay) {
@@ -53445,7 +53671,7 @@ var SubscribeOnOperator = /*@__PURE__*/ (function () {
/***/ }),
-/* 467 */
+/* 471 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -53509,13 +53735,13 @@ var SubscribeOnObservable = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 468 */
+/* 472 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "switchAll", function() { return switchAll; });
-/* harmony import */ var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(469);
+/* harmony import */ var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(473);
/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25);
/** PURE_IMPORTS_START _switchMap,_util_identity PURE_IMPORTS_END */
@@ -53527,7 +53753,7 @@ function switchAll() {
/***/ }),
-/* 469 */
+/* 473 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -53621,13 +53847,13 @@ var SwitchMapSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 470 */
+/* 474 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "switchMapTo", function() { return switchMapTo; });
-/* harmony import */ var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(469);
+/* harmony import */ var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(473);
/** PURE_IMPORTS_START _switchMap PURE_IMPORTS_END */
function switchMapTo(innerObservable, resultSelector) {
@@ -53637,7 +53863,7 @@ function switchMapTo(innerObservable, resultSelector) {
/***/ }),
-/* 471 */
+/* 475 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -53687,7 +53913,7 @@ var TakeUntilSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 472 */
+/* 476 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -53755,7 +53981,7 @@ var TakeWhileSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 473 */
+/* 477 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -53843,7 +54069,7 @@ var TapSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 474 */
+/* 478 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -53947,7 +54173,7 @@ var ThrottleSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 475 */
+/* 479 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -53956,7 +54182,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11);
/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(55);
-/* harmony import */ var _throttle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(474);
+/* harmony import */ var _throttle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(478);
/** PURE_IMPORTS_START tslib,_Subscriber,_scheduler_async,_throttle PURE_IMPORTS_END */
@@ -54045,7 +54271,7 @@ function dispatchNext(arg) {
/***/ }),
-/* 476 */
+/* 480 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -54053,7 +54279,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return timeInterval; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TimeInterval", function() { return TimeInterval; });
/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55);
-/* harmony import */ var _scan__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(436);
+/* harmony import */ var _scan__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(440);
/* harmony import */ var _observable_defer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(90);
/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(66);
/** PURE_IMPORTS_START _scheduler_async,_scan,_observable_defer,_map PURE_IMPORTS_END */
@@ -54089,7 +54315,7 @@ var TimeInterval = /*@__PURE__*/ (function () {
/***/ }),
-/* 477 */
+/* 481 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -54097,7 +54323,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeout", function() { return timeout; });
/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55);
/* harmony import */ var _util_TimeoutError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(64);
-/* harmony import */ var _timeoutWith__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(478);
+/* harmony import */ var _timeoutWith__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(482);
/* harmony import */ var _observable_throwError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49);
/** PURE_IMPORTS_START _scheduler_async,_util_TimeoutError,_timeoutWith,_observable_throwError PURE_IMPORTS_END */
@@ -54114,7 +54340,7 @@ function timeout(due, scheduler) {
/***/ }),
-/* 478 */
+/* 482 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -54122,7 +54348,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeoutWith", function() { return timeoutWith; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55);
-/* harmony import */ var _util_isDate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(410);
+/* harmony import */ var _util_isDate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(414);
/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(69);
/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(70);
/** PURE_IMPORTS_START tslib,_scheduler_async,_util_isDate,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
@@ -54196,7 +54422,7 @@ var TimeoutWithSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 479 */
+/* 483 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -54226,13 +54452,13 @@ var Timestamp = /*@__PURE__*/ (function () {
/***/ }),
-/* 480 */
+/* 484 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return toArray; });
-/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(435);
+/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(439);
/** PURE_IMPORTS_START _reduce PURE_IMPORTS_END */
function toArrayReducer(arr, item, index) {
@@ -54249,7 +54475,7 @@ function toArray() {
/***/ }),
-/* 481 */
+/* 485 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -54329,7 +54555,7 @@ var WindowSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 482 */
+/* 486 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -54419,7 +54645,7 @@ var WindowCountSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 483 */
+/* 487 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -54589,7 +54815,7 @@ function dispatchWindowClose(state) {
/***/ }),
-/* 484 */
+/* 488 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -54732,7 +54958,7 @@ var WindowToggleSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 485 */
+/* 489 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -54829,7 +55055,7 @@ var WindowSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 486 */
+/* 490 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -54924,7 +55150,7 @@ var WithLatestFromSubscriber = /*@__PURE__*/ (function (_super) {
/***/ }),
-/* 487 */
+/* 491 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -54946,7 +55172,7 @@ function zip() {
/***/ }),
-/* 488 */
+/* 492 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -54962,7 +55188,7 @@ function zipAll(project) {
/***/ }),
-/* 489 */
+/* 493 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -54971,8 +55197,8 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(162);
/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143);
/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(145);
-/* harmony import */ var _utils_projects_tree__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(490);
-/* harmony import */ var _utils_kibana__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(491);
+/* harmony import */ var _utils_projects_tree__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(494);
+/* harmony import */ var _utils_kibana__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(495);
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
@@ -55054,13 +55280,13 @@ function toArray(value) {
}
/***/ }),
-/* 490 */
+/* 494 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderProjectsTree", function() { return renderProjectsTree; });
-/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(227);
+/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(112);
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
@@ -55207,7 +55433,7 @@ function addProjectToTree(tree, pathParts, project) {
}
/***/ }),
-/* 491 */
+/* 495 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -55215,13 +55441,13 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Kibana", function() { return Kibana; });
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var multimatch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(492);
+/* harmony import */ var multimatch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(496);
/* harmony import */ var multimatch__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(multimatch__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var is_path_inside__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(366);
+/* harmony import */ var is_path_inside__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(361);
/* harmony import */ var is_path_inside__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(is_path_inside__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _yarn_lock__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(279);
+/* harmony import */ var _yarn_lock__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(274);
/* harmony import */ var _projects__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(145);
-/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(276);
+/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(271);
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
@@ -55383,15 +55609,15 @@ class Kibana {
}
/***/ }),
-/* 492 */
+/* 496 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const minimatch = __webpack_require__(149);
-const arrayUnion = __webpack_require__(493);
-const arrayDiffer = __webpack_require__(494);
-const arrify = __webpack_require__(495);
+const arrayUnion = __webpack_require__(497);
+const arrayDiffer = __webpack_require__(498);
+const arrify = __webpack_require__(499);
module.exports = (list, patterns, options = {}) => {
list = arrify(list);
@@ -55415,7 +55641,7 @@ module.exports = (list, patterns, options = {}) => {
/***/ }),
-/* 493 */
+/* 497 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -55427,7 +55653,7 @@ module.exports = (...arguments_) => {
/***/ }),
-/* 494 */
+/* 498 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -55442,7 +55668,7 @@ module.exports = arrayDiffer;
/***/ }),
-/* 495 */
+/* 499 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -55472,12 +55698,12 @@ module.exports = arrify;
/***/ }),
-/* 496 */
+/* 500 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _build_production_projects__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(497);
+/* harmony import */ var _build_production_projects__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(501);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buildProductionProjects", function() { return _build_production_projects__WEBPACK_IMPORTED_MODULE_0__["buildProductionProjects"]; });
/*
@@ -55501,19 +55727,19 @@ __webpack_require__.r(__webpack_exports__);
/***/ }),
-/* 497 */
+/* 501 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buildProductionProjects", function() { return buildProductionProjects; });
-/* harmony import */ var cpy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(498);
+/* harmony import */ var cpy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(502);
/* harmony import */ var cpy__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(cpy__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var del__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(285);
+/* harmony import */ var del__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(280);
/* harmony import */ var del__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(del__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4);
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(276);
+/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(271);
/* harmony import */ var _utils_fs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(130);
/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(143);
/* harmony import */ var _utils_package_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(164);
@@ -55649,7 +55875,7 @@ async function copyToBuild(project, kibanaRoot, buildRoot) {
}
/***/ }),
-/* 498 */
+/* 502 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -55657,13 +55883,13 @@ async function copyToBuild(project, kibanaRoot, buildRoot) {
const EventEmitter = __webpack_require__(155);
const path = __webpack_require__(4);
const os = __webpack_require__(120);
-const pAll = __webpack_require__(499);
-const arrify = __webpack_require__(501);
-const globby = __webpack_require__(502);
-const isGlob = __webpack_require__(700);
-const cpFile = __webpack_require__(701);
-const junk = __webpack_require__(713);
-const CpyError = __webpack_require__(714);
+const pAll = __webpack_require__(503);
+const arrify = __webpack_require__(505);
+const globby = __webpack_require__(506);
+const isGlob = __webpack_require__(704);
+const cpFile = __webpack_require__(705);
+const junk = __webpack_require__(717);
+const CpyError = __webpack_require__(718);
const defaultOptions = {
ignoreJunk: true
@@ -55782,12 +56008,12 @@ module.exports = (source, destination, {
/***/ }),
-/* 499 */
+/* 503 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const pMap = __webpack_require__(500);
+const pMap = __webpack_require__(504);
module.exports = (iterable, options) => pMap(iterable, element => element(), options);
// TODO: Remove this for the next major release
@@ -55795,7 +56021,7 @@ module.exports.default = module.exports;
/***/ }),
-/* 500 */
+/* 504 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -55874,7 +56100,7 @@ module.exports.default = pMap;
/***/ }),
-/* 501 */
+/* 505 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -55904,17 +56130,17 @@ module.exports = arrify;
/***/ }),
-/* 502 */
+/* 506 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const fs = __webpack_require__(133);
-const arrayUnion = __webpack_require__(503);
+const arrayUnion = __webpack_require__(507);
const glob = __webpack_require__(146);
-const fastGlob = __webpack_require__(505);
-const dirGlob = __webpack_require__(693);
-const gitignore = __webpack_require__(696);
+const fastGlob = __webpack_require__(509);
+const dirGlob = __webpack_require__(697);
+const gitignore = __webpack_require__(700);
const DEFAULT_FILTER = () => false;
@@ -56059,12 +56285,12 @@ module.exports.gitignore = gitignore;
/***/ }),
-/* 503 */
+/* 507 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var arrayUniq = __webpack_require__(504);
+var arrayUniq = __webpack_require__(508);
module.exports = function () {
return arrayUniq([].concat.apply([], arguments));
@@ -56072,7 +56298,7 @@ module.exports = function () {
/***/ }),
-/* 504 */
+/* 508 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -56141,10 +56367,10 @@ if ('Set' in global) {
/***/ }),
-/* 505 */
+/* 509 */
/***/ (function(module, exports, __webpack_require__) {
-const pkg = __webpack_require__(506);
+const pkg = __webpack_require__(510);
module.exports = pkg.async;
module.exports.default = pkg.async;
@@ -56157,19 +56383,19 @@ module.exports.generateTasks = pkg.generateTasks;
/***/ }),
-/* 506 */
+/* 510 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-var optionsManager = __webpack_require__(507);
-var taskManager = __webpack_require__(508);
-var reader_async_1 = __webpack_require__(664);
-var reader_stream_1 = __webpack_require__(688);
-var reader_sync_1 = __webpack_require__(689);
-var arrayUtils = __webpack_require__(691);
-var streamUtils = __webpack_require__(692);
+var optionsManager = __webpack_require__(511);
+var taskManager = __webpack_require__(512);
+var reader_async_1 = __webpack_require__(668);
+var reader_stream_1 = __webpack_require__(692);
+var reader_sync_1 = __webpack_require__(693);
+var arrayUtils = __webpack_require__(695);
+var streamUtils = __webpack_require__(696);
/**
* Synchronous API.
*/
@@ -56235,7 +56461,7 @@ function isString(source) {
/***/ }),
-/* 507 */
+/* 511 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -56273,13 +56499,13 @@ exports.prepare = prepare;
/***/ }),
-/* 508 */
+/* 512 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-var patternUtils = __webpack_require__(509);
+var patternUtils = __webpack_require__(513);
/**
* Generate tasks based on parent directory of each pattern.
*/
@@ -56370,16 +56596,16 @@ exports.convertPatternGroupToTask = convertPatternGroupToTask;
/***/ }),
-/* 509 */
+/* 513 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var path = __webpack_require__(4);
-var globParent = __webpack_require__(510);
-var isGlob = __webpack_require__(513);
-var micromatch = __webpack_require__(514);
+var globParent = __webpack_require__(514);
+var isGlob = __webpack_require__(517);
+var micromatch = __webpack_require__(518);
var GLOBSTAR = '**';
/**
* Return true for static pattern.
@@ -56525,15 +56751,15 @@ exports.matchAny = matchAny;
/***/ }),
-/* 510 */
+/* 514 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var path = __webpack_require__(4);
-var isglob = __webpack_require__(511);
-var pathDirname = __webpack_require__(512);
+var isglob = __webpack_require__(515);
+var pathDirname = __webpack_require__(516);
var isWin32 = __webpack_require__(120).platform() === 'win32';
module.exports = function globParent(str) {
@@ -56556,7 +56782,7 @@ module.exports = function globParent(str) {
/***/ }),
-/* 511 */
+/* 515 */
/***/ (function(module, exports, __webpack_require__) {
/*!
@@ -56566,7 +56792,7 @@ module.exports = function globParent(str) {
* Licensed under the MIT License.
*/
-var isExtglob = __webpack_require__(299);
+var isExtglob = __webpack_require__(294);
module.exports = function isGlob(str) {
if (typeof str !== 'string' || str === '') {
@@ -56587,7 +56813,7 @@ module.exports = function isGlob(str) {
/***/ }),
-/* 512 */
+/* 516 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -56737,7 +56963,7 @@ module.exports.win32 = win32;
/***/ }),
-/* 513 */
+/* 517 */
/***/ (function(module, exports, __webpack_require__) {
/*!
@@ -56747,7 +56973,7 @@ module.exports.win32 = win32;
* Released under the MIT License.
*/
-var isExtglob = __webpack_require__(299);
+var isExtglob = __webpack_require__(294);
var chars = { '{': '}', '(': ')', '[': ']'};
module.exports = function isGlob(str, options) {
@@ -56789,7 +57015,7 @@ module.exports = function isGlob(str, options) {
/***/ }),
-/* 514 */
+/* 518 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -56800,18 +57026,18 @@ module.exports = function isGlob(str, options) {
*/
var util = __webpack_require__(111);
-var braces = __webpack_require__(515);
-var toRegex = __webpack_require__(617);
-var extend = __webpack_require__(625);
+var braces = __webpack_require__(519);
+var toRegex = __webpack_require__(621);
+var extend = __webpack_require__(629);
/**
* Local dependencies
*/
-var compilers = __webpack_require__(628);
-var parsers = __webpack_require__(660);
-var cache = __webpack_require__(661);
-var utils = __webpack_require__(662);
+var compilers = __webpack_require__(632);
+var parsers = __webpack_require__(664);
+var cache = __webpack_require__(665);
+var utils = __webpack_require__(666);
var MAX_LENGTH = 1024 * 64;
/**
@@ -57673,7 +57899,7 @@ module.exports = micromatch;
/***/ }),
-/* 515 */
+/* 519 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -57683,18 +57909,18 @@ module.exports = micromatch;
* Module dependencies
*/
-var toRegex = __webpack_require__(516);
-var unique = __webpack_require__(528);
-var extend = __webpack_require__(525);
+var toRegex = __webpack_require__(520);
+var unique = __webpack_require__(532);
+var extend = __webpack_require__(529);
/**
* Local dependencies
*/
-var compilers = __webpack_require__(529);
-var parsers = __webpack_require__(544);
-var Braces = __webpack_require__(554);
-var utils = __webpack_require__(530);
+var compilers = __webpack_require__(533);
+var parsers = __webpack_require__(548);
+var Braces = __webpack_require__(558);
+var utils = __webpack_require__(534);
var MAX_LENGTH = 1024 * 64;
var cache = {};
@@ -57998,15 +58224,15 @@ module.exports = braces;
/***/ }),
-/* 516 */
+/* 520 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var define = __webpack_require__(517);
-var extend = __webpack_require__(525);
-var not = __webpack_require__(527);
+var define = __webpack_require__(521);
+var extend = __webpack_require__(529);
+var not = __webpack_require__(531);
var MAX_LENGTH = 1024 * 64;
/**
@@ -58153,7 +58379,7 @@ module.exports.makeRe = makeRe;
/***/ }),
-/* 517 */
+/* 521 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -58166,7 +58392,7 @@ module.exports.makeRe = makeRe;
-var isDescriptor = __webpack_require__(518);
+var isDescriptor = __webpack_require__(522);
module.exports = function defineProperty(obj, prop, val) {
if (typeof obj !== 'object' && typeof obj !== 'function') {
@@ -58191,7 +58417,7 @@ module.exports = function defineProperty(obj, prop, val) {
/***/ }),
-/* 518 */
+/* 522 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -58204,9 +58430,9 @@ module.exports = function defineProperty(obj, prop, val) {
-var typeOf = __webpack_require__(519);
-var isAccessor = __webpack_require__(520);
-var isData = __webpack_require__(523);
+var typeOf = __webpack_require__(523);
+var isAccessor = __webpack_require__(524);
+var isData = __webpack_require__(527);
module.exports = function isDescriptor(obj, key) {
if (typeOf(obj) !== 'object') {
@@ -58220,7 +58446,7 @@ module.exports = function isDescriptor(obj, key) {
/***/ }),
-/* 519 */
+/* 523 */
/***/ (function(module, exports) {
var toString = Object.prototype.toString;
@@ -58373,7 +58599,7 @@ function isBuffer(val) {
/***/ }),
-/* 520 */
+/* 524 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -58386,7 +58612,7 @@ function isBuffer(val) {
-var typeOf = __webpack_require__(521);
+var typeOf = __webpack_require__(525);
// accessor descriptor properties
var accessor = {
@@ -58449,10 +58675,10 @@ module.exports = isAccessorDescriptor;
/***/ }),
-/* 521 */
+/* 525 */
/***/ (function(module, exports, __webpack_require__) {
-var isBuffer = __webpack_require__(522);
+var isBuffer = __webpack_require__(526);
var toString = Object.prototype.toString;
/**
@@ -58571,7 +58797,7 @@ module.exports = function kindOf(val) {
/***/ }),
-/* 522 */
+/* 526 */
/***/ (function(module, exports) {
/*!
@@ -58598,7 +58824,7 @@ function isSlowBuffer (obj) {
/***/ }),
-/* 523 */
+/* 527 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -58611,7 +58837,7 @@ function isSlowBuffer (obj) {
-var typeOf = __webpack_require__(524);
+var typeOf = __webpack_require__(528);
// data descriptor properties
var data = {
@@ -58660,10 +58886,10 @@ module.exports = isDataDescriptor;
/***/ }),
-/* 524 */
+/* 528 */
/***/ (function(module, exports, __webpack_require__) {
-var isBuffer = __webpack_require__(522);
+var isBuffer = __webpack_require__(526);
var toString = Object.prototype.toString;
/**
@@ -58782,13 +59008,13 @@ module.exports = function kindOf(val) {
/***/ }),
-/* 525 */
+/* 529 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var isObject = __webpack_require__(526);
+var isObject = __webpack_require__(530);
module.exports = function extend(o/*, objects*/) {
if (!isObject(o)) { o = {}; }
@@ -58822,7 +59048,7 @@ function hasOwn(obj, key) {
/***/ }),
-/* 526 */
+/* 530 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -58842,13 +59068,13 @@ module.exports = function isExtendable(val) {
/***/ }),
-/* 527 */
+/* 531 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var extend = __webpack_require__(525);
+var extend = __webpack_require__(529);
/**
* The main export is a function that takes a `pattern` string and an `options` object.
@@ -58915,7 +59141,7 @@ module.exports = toRegex;
/***/ }),
-/* 528 */
+/* 532 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -58965,13 +59191,13 @@ module.exports.immutable = function uniqueImmutable(arr) {
/***/ }),
-/* 529 */
+/* 533 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var utils = __webpack_require__(530);
+var utils = __webpack_require__(534);
module.exports = function(braces, options) {
braces.compiler
@@ -59254,25 +59480,25 @@ function hasQueue(node) {
/***/ }),
-/* 530 */
+/* 534 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var splitString = __webpack_require__(531);
+var splitString = __webpack_require__(535);
var utils = module.exports;
/**
* Module dependencies
*/
-utils.extend = __webpack_require__(525);
-utils.flatten = __webpack_require__(537);
-utils.isObject = __webpack_require__(535);
-utils.fillRange = __webpack_require__(538);
-utils.repeat = __webpack_require__(543);
-utils.unique = __webpack_require__(528);
+utils.extend = __webpack_require__(529);
+utils.flatten = __webpack_require__(541);
+utils.isObject = __webpack_require__(539);
+utils.fillRange = __webpack_require__(542);
+utils.repeat = __webpack_require__(547);
+utils.unique = __webpack_require__(532);
utils.define = function(obj, key, val) {
Object.defineProperty(obj, key, {
@@ -59604,7 +59830,7 @@ utils.escapeRegex = function(str) {
/***/ }),
-/* 531 */
+/* 535 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -59617,7 +59843,7 @@ utils.escapeRegex = function(str) {
-var extend = __webpack_require__(532);
+var extend = __webpack_require__(536);
module.exports = function(str, options, fn) {
if (typeof str !== 'string') {
@@ -59782,14 +60008,14 @@ function keepEscaping(opts, str, idx) {
/***/ }),
-/* 532 */
+/* 536 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var isExtendable = __webpack_require__(533);
-var assignSymbols = __webpack_require__(536);
+var isExtendable = __webpack_require__(537);
+var assignSymbols = __webpack_require__(540);
module.exports = Object.assign || function(obj/*, objects*/) {
if (obj === null || typeof obj === 'undefined') {
@@ -59849,7 +60075,7 @@ function isEnum(obj, key) {
/***/ }),
-/* 533 */
+/* 537 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -59862,7 +60088,7 @@ function isEnum(obj, key) {
-var isPlainObject = __webpack_require__(534);
+var isPlainObject = __webpack_require__(538);
module.exports = function isExtendable(val) {
return isPlainObject(val) || typeof val === 'function' || Array.isArray(val);
@@ -59870,7 +60096,7 @@ module.exports = function isExtendable(val) {
/***/ }),
-/* 534 */
+/* 538 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -59883,7 +60109,7 @@ module.exports = function isExtendable(val) {
-var isObject = __webpack_require__(535);
+var isObject = __webpack_require__(539);
function isObjectObject(o) {
return isObject(o) === true
@@ -59914,7 +60140,7 @@ module.exports = function isPlainObject(o) {
/***/ }),
-/* 535 */
+/* 539 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -59933,7 +60159,7 @@ module.exports = function isObject(val) {
/***/ }),
-/* 536 */
+/* 540 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -59980,7 +60206,7 @@ module.exports = function(receiver, objects) {
/***/ }),
-/* 537 */
+/* 541 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -60009,7 +60235,7 @@ function flat(arr, res) {
/***/ }),
-/* 538 */
+/* 542 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -60023,10 +60249,10 @@ function flat(arr, res) {
var util = __webpack_require__(111);
-var isNumber = __webpack_require__(539);
-var extend = __webpack_require__(525);
-var repeat = __webpack_require__(541);
-var toRegex = __webpack_require__(542);
+var isNumber = __webpack_require__(543);
+var extend = __webpack_require__(529);
+var repeat = __webpack_require__(545);
+var toRegex = __webpack_require__(546);
/**
* Return a range of numbers or letters.
@@ -60224,7 +60450,7 @@ module.exports = fillRange;
/***/ }),
-/* 539 */
+/* 543 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -60237,7 +60463,7 @@ module.exports = fillRange;
-var typeOf = __webpack_require__(540);
+var typeOf = __webpack_require__(544);
module.exports = function isNumber(num) {
var type = typeOf(num);
@@ -60253,10 +60479,10 @@ module.exports = function isNumber(num) {
/***/ }),
-/* 540 */
+/* 544 */
/***/ (function(module, exports, __webpack_require__) {
-var isBuffer = __webpack_require__(522);
+var isBuffer = __webpack_require__(526);
var toString = Object.prototype.toString;
/**
@@ -60375,7 +60601,7 @@ module.exports = function kindOf(val) {
/***/ }),
-/* 541 */
+/* 545 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -60452,7 +60678,7 @@ function repeat(str, num) {
/***/ }),
-/* 542 */
+/* 546 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -60465,8 +60691,8 @@ function repeat(str, num) {
-var repeat = __webpack_require__(541);
-var isNumber = __webpack_require__(539);
+var repeat = __webpack_require__(545);
+var isNumber = __webpack_require__(543);
var cache = {};
function toRegexRange(min, max, options) {
@@ -60753,7 +60979,7 @@ module.exports = toRegexRange;
/***/ }),
-/* 543 */
+/* 547 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -60778,14 +61004,14 @@ module.exports = function repeat(ele, num) {
/***/ }),
-/* 544 */
+/* 548 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var Node = __webpack_require__(545);
-var utils = __webpack_require__(530);
+var Node = __webpack_require__(549);
+var utils = __webpack_require__(534);
/**
* Braces parsers
@@ -61145,15 +61371,15 @@ function concatNodes(pos, node, parent, options) {
/***/ }),
-/* 545 */
+/* 549 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var isObject = __webpack_require__(535);
-var define = __webpack_require__(546);
-var utils = __webpack_require__(553);
+var isObject = __webpack_require__(539);
+var define = __webpack_require__(550);
+var utils = __webpack_require__(557);
var ownNames;
/**
@@ -61644,7 +61870,7 @@ exports = module.exports = Node;
/***/ }),
-/* 546 */
+/* 550 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -61657,7 +61883,7 @@ exports = module.exports = Node;
-var isDescriptor = __webpack_require__(547);
+var isDescriptor = __webpack_require__(551);
module.exports = function defineProperty(obj, prop, val) {
if (typeof obj !== 'object' && typeof obj !== 'function') {
@@ -61682,7 +61908,7 @@ module.exports = function defineProperty(obj, prop, val) {
/***/ }),
-/* 547 */
+/* 551 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -61695,9 +61921,9 @@ module.exports = function defineProperty(obj, prop, val) {
-var typeOf = __webpack_require__(548);
-var isAccessor = __webpack_require__(549);
-var isData = __webpack_require__(551);
+var typeOf = __webpack_require__(552);
+var isAccessor = __webpack_require__(553);
+var isData = __webpack_require__(555);
module.exports = function isDescriptor(obj, key) {
if (typeOf(obj) !== 'object') {
@@ -61711,7 +61937,7 @@ module.exports = function isDescriptor(obj, key) {
/***/ }),
-/* 548 */
+/* 552 */
/***/ (function(module, exports) {
var toString = Object.prototype.toString;
@@ -61846,7 +62072,7 @@ function isBuffer(val) {
/***/ }),
-/* 549 */
+/* 553 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -61859,7 +62085,7 @@ function isBuffer(val) {
-var typeOf = __webpack_require__(550);
+var typeOf = __webpack_require__(554);
// accessor descriptor properties
var accessor = {
@@ -61922,7 +62148,7 @@ module.exports = isAccessorDescriptor;
/***/ }),
-/* 550 */
+/* 554 */
/***/ (function(module, exports) {
var toString = Object.prototype.toString;
@@ -62057,7 +62283,7 @@ function isBuffer(val) {
/***/ }),
-/* 551 */
+/* 555 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -62070,7 +62296,7 @@ function isBuffer(val) {
-var typeOf = __webpack_require__(552);
+var typeOf = __webpack_require__(556);
module.exports = function isDataDescriptor(obj, prop) {
// data descriptor properties
@@ -62113,7 +62339,7 @@ module.exports = function isDataDescriptor(obj, prop) {
/***/ }),
-/* 552 */
+/* 556 */
/***/ (function(module, exports) {
var toString = Object.prototype.toString;
@@ -62248,13 +62474,13 @@ function isBuffer(val) {
/***/ }),
-/* 553 */
+/* 557 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var typeOf = __webpack_require__(540);
+var typeOf = __webpack_require__(544);
var utils = module.exports;
/**
@@ -63274,17 +63500,17 @@ function assert(val, message) {
/***/ }),
-/* 554 */
+/* 558 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var extend = __webpack_require__(525);
-var Snapdragon = __webpack_require__(555);
-var compilers = __webpack_require__(529);
-var parsers = __webpack_require__(544);
-var utils = __webpack_require__(530);
+var extend = __webpack_require__(529);
+var Snapdragon = __webpack_require__(559);
+var compilers = __webpack_require__(533);
+var parsers = __webpack_require__(548);
+var utils = __webpack_require__(534);
/**
* Customize Snapdragon parser and renderer
@@ -63385,17 +63611,17 @@ module.exports = Braces;
/***/ }),
-/* 555 */
+/* 559 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var Base = __webpack_require__(556);
-var define = __webpack_require__(517);
-var Compiler = __webpack_require__(585);
-var Parser = __webpack_require__(614);
-var utils = __webpack_require__(594);
+var Base = __webpack_require__(560);
+var define = __webpack_require__(521);
+var Compiler = __webpack_require__(589);
+var Parser = __webpack_require__(618);
+var utils = __webpack_require__(598);
var regexCache = {};
var cache = {};
@@ -63566,20 +63792,20 @@ module.exports.Parser = Parser;
/***/ }),
-/* 556 */
+/* 560 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var util = __webpack_require__(111);
-var define = __webpack_require__(557);
-var CacheBase = __webpack_require__(558);
-var Emitter = __webpack_require__(559);
-var isObject = __webpack_require__(535);
-var merge = __webpack_require__(576);
-var pascal = __webpack_require__(579);
-var cu = __webpack_require__(580);
+var define = __webpack_require__(561);
+var CacheBase = __webpack_require__(562);
+var Emitter = __webpack_require__(563);
+var isObject = __webpack_require__(539);
+var merge = __webpack_require__(580);
+var pascal = __webpack_require__(583);
+var cu = __webpack_require__(584);
/**
* Optionally define a custom `cache` namespace to use.
@@ -64008,7 +64234,7 @@ module.exports.namespace = namespace;
/***/ }),
-/* 557 */
+/* 561 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -64021,7 +64247,7 @@ module.exports.namespace = namespace;
-var isDescriptor = __webpack_require__(547);
+var isDescriptor = __webpack_require__(551);
module.exports = function defineProperty(obj, prop, val) {
if (typeof obj !== 'object' && typeof obj !== 'function') {
@@ -64046,21 +64272,21 @@ module.exports = function defineProperty(obj, prop, val) {
/***/ }),
-/* 558 */
+/* 562 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var isObject = __webpack_require__(535);
-var Emitter = __webpack_require__(559);
-var visit = __webpack_require__(560);
-var toPath = __webpack_require__(563);
-var union = __webpack_require__(564);
-var del = __webpack_require__(568);
-var get = __webpack_require__(566);
-var has = __webpack_require__(573);
-var set = __webpack_require__(567);
+var isObject = __webpack_require__(539);
+var Emitter = __webpack_require__(563);
+var visit = __webpack_require__(564);
+var toPath = __webpack_require__(567);
+var union = __webpack_require__(568);
+var del = __webpack_require__(572);
+var get = __webpack_require__(570);
+var has = __webpack_require__(577);
+var set = __webpack_require__(571);
/**
* Create a `Cache` constructor that when instantiated will
@@ -64314,7 +64540,7 @@ module.exports.namespace = namespace;
/***/ }),
-/* 559 */
+/* 563 */
/***/ (function(module, exports, __webpack_require__) {
@@ -64483,7 +64709,7 @@ Emitter.prototype.hasListeners = function(event){
/***/ }),
-/* 560 */
+/* 564 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -64496,8 +64722,8 @@ Emitter.prototype.hasListeners = function(event){
-var visit = __webpack_require__(561);
-var mapVisit = __webpack_require__(562);
+var visit = __webpack_require__(565);
+var mapVisit = __webpack_require__(566);
module.exports = function(collection, method, val) {
var result;
@@ -64520,7 +64746,7 @@ module.exports = function(collection, method, val) {
/***/ }),
-/* 561 */
+/* 565 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -64533,7 +64759,7 @@ module.exports = function(collection, method, val) {
-var isObject = __webpack_require__(535);
+var isObject = __webpack_require__(539);
module.exports = function visit(thisArg, method, target, val) {
if (!isObject(thisArg) && typeof thisArg !== 'function') {
@@ -64560,14 +64786,14 @@ module.exports = function visit(thisArg, method, target, val) {
/***/ }),
-/* 562 */
+/* 566 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var util = __webpack_require__(111);
-var visit = __webpack_require__(561);
+var visit = __webpack_require__(565);
/**
* Map `visit` over an array of objects.
@@ -64604,7 +64830,7 @@ function isObject(val) {
/***/ }),
-/* 563 */
+/* 567 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -64617,7 +64843,7 @@ function isObject(val) {
-var typeOf = __webpack_require__(540);
+var typeOf = __webpack_require__(544);
module.exports = function toPath(args) {
if (typeOf(args) !== 'arguments') {
@@ -64644,16 +64870,16 @@ function filter(arr) {
/***/ }),
-/* 564 */
+/* 568 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var isObject = __webpack_require__(526);
-var union = __webpack_require__(565);
-var get = __webpack_require__(566);
-var set = __webpack_require__(567);
+var isObject = __webpack_require__(530);
+var union = __webpack_require__(569);
+var get = __webpack_require__(570);
+var set = __webpack_require__(571);
module.exports = function unionValue(obj, prop, value) {
if (!isObject(obj)) {
@@ -64681,7 +64907,7 @@ function arrayify(val) {
/***/ }),
-/* 565 */
+/* 569 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -64717,7 +64943,7 @@ module.exports = function union(init) {
/***/ }),
-/* 566 */
+/* 570 */
/***/ (function(module, exports) {
/*!
@@ -64773,7 +64999,7 @@ function toString(val) {
/***/ }),
-/* 567 */
+/* 571 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -64786,10 +65012,10 @@ function toString(val) {
-var split = __webpack_require__(531);
-var extend = __webpack_require__(525);
-var isPlainObject = __webpack_require__(534);
-var isObject = __webpack_require__(526);
+var split = __webpack_require__(535);
+var extend = __webpack_require__(529);
+var isPlainObject = __webpack_require__(538);
+var isObject = __webpack_require__(530);
module.exports = function(obj, prop, val) {
if (!isObject(obj)) {
@@ -64835,7 +65061,7 @@ function isValidKey(key) {
/***/ }),
-/* 568 */
+/* 572 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -64848,8 +65074,8 @@ function isValidKey(key) {
-var isObject = __webpack_require__(535);
-var has = __webpack_require__(569);
+var isObject = __webpack_require__(539);
+var has = __webpack_require__(573);
module.exports = function unset(obj, prop) {
if (!isObject(obj)) {
@@ -64874,7 +65100,7 @@ module.exports = function unset(obj, prop) {
/***/ }),
-/* 569 */
+/* 573 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -64887,9 +65113,9 @@ module.exports = function unset(obj, prop) {
-var isObject = __webpack_require__(570);
-var hasValues = __webpack_require__(572);
-var get = __webpack_require__(566);
+var isObject = __webpack_require__(574);
+var hasValues = __webpack_require__(576);
+var get = __webpack_require__(570);
module.exports = function(obj, prop, noZero) {
if (isObject(obj)) {
@@ -64900,7 +65126,7 @@ module.exports = function(obj, prop, noZero) {
/***/ }),
-/* 570 */
+/* 574 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -64913,7 +65139,7 @@ module.exports = function(obj, prop, noZero) {
-var isArray = __webpack_require__(571);
+var isArray = __webpack_require__(575);
module.exports = function isObject(val) {
return val != null && typeof val === 'object' && isArray(val) === false;
@@ -64921,7 +65147,7 @@ module.exports = function isObject(val) {
/***/ }),
-/* 571 */
+/* 575 */
/***/ (function(module, exports) {
var toString = {}.toString;
@@ -64932,7 +65158,7 @@ module.exports = Array.isArray || function (arr) {
/***/ }),
-/* 572 */
+/* 576 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -64975,7 +65201,7 @@ module.exports = function hasValue(o, noZero) {
/***/ }),
-/* 573 */
+/* 577 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -64988,9 +65214,9 @@ module.exports = function hasValue(o, noZero) {
-var isObject = __webpack_require__(535);
-var hasValues = __webpack_require__(574);
-var get = __webpack_require__(566);
+var isObject = __webpack_require__(539);
+var hasValues = __webpack_require__(578);
+var get = __webpack_require__(570);
module.exports = function(val, prop) {
return hasValues(isObject(val) && prop ? get(val, prop) : val);
@@ -64998,7 +65224,7 @@ module.exports = function(val, prop) {
/***/ }),
-/* 574 */
+/* 578 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -65011,8 +65237,8 @@ module.exports = function(val, prop) {
-var typeOf = __webpack_require__(575);
-var isNumber = __webpack_require__(539);
+var typeOf = __webpack_require__(579);
+var isNumber = __webpack_require__(543);
module.exports = function hasValue(val) {
// is-number checks for NaN and other edge cases
@@ -65065,10 +65291,10 @@ module.exports = function hasValue(val) {
/***/ }),
-/* 575 */
+/* 579 */
/***/ (function(module, exports, __webpack_require__) {
-var isBuffer = __webpack_require__(522);
+var isBuffer = __webpack_require__(526);
var toString = Object.prototype.toString;
/**
@@ -65190,14 +65416,14 @@ module.exports = function kindOf(val) {
/***/ }),
-/* 576 */
+/* 580 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var isExtendable = __webpack_require__(577);
-var forIn = __webpack_require__(578);
+var isExtendable = __webpack_require__(581);
+var forIn = __webpack_require__(582);
function mixinDeep(target, objects) {
var len = arguments.length, i = 0;
@@ -65261,7 +65487,7 @@ module.exports = mixinDeep;
/***/ }),
-/* 577 */
+/* 581 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -65274,7 +65500,7 @@ module.exports = mixinDeep;
-var isPlainObject = __webpack_require__(534);
+var isPlainObject = __webpack_require__(538);
module.exports = function isExtendable(val) {
return isPlainObject(val) || typeof val === 'function' || Array.isArray(val);
@@ -65282,7 +65508,7 @@ module.exports = function isExtendable(val) {
/***/ }),
-/* 578 */
+/* 582 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -65305,7 +65531,7 @@ module.exports = function forIn(obj, fn, thisArg) {
/***/ }),
-/* 579 */
+/* 583 */
/***/ (function(module, exports) {
/*!
@@ -65332,14 +65558,14 @@ module.exports = pascalcase;
/***/ }),
-/* 580 */
+/* 584 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var util = __webpack_require__(111);
-var utils = __webpack_require__(581);
+var utils = __webpack_require__(585);
/**
* Expose class utils
@@ -65704,7 +65930,7 @@ cu.bubble = function(Parent, events) {
/***/ }),
-/* 581 */
+/* 585 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -65718,10 +65944,10 @@ var utils = {};
* Lazily required module dependencies
*/
-utils.union = __webpack_require__(565);
-utils.define = __webpack_require__(517);
-utils.isObj = __webpack_require__(535);
-utils.staticExtend = __webpack_require__(582);
+utils.union = __webpack_require__(569);
+utils.define = __webpack_require__(521);
+utils.isObj = __webpack_require__(539);
+utils.staticExtend = __webpack_require__(586);
/**
@@ -65732,7 +65958,7 @@ module.exports = utils;
/***/ }),
-/* 582 */
+/* 586 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -65745,8 +65971,8 @@ module.exports = utils;
-var copy = __webpack_require__(583);
-var define = __webpack_require__(517);
+var copy = __webpack_require__(587);
+var define = __webpack_require__(521);
var util = __webpack_require__(111);
/**
@@ -65829,15 +66055,15 @@ module.exports = extend;
/***/ }),
-/* 583 */
+/* 587 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var typeOf = __webpack_require__(540);
-var copyDescriptor = __webpack_require__(584);
-var define = __webpack_require__(517);
+var typeOf = __webpack_require__(544);
+var copyDescriptor = __webpack_require__(588);
+var define = __webpack_require__(521);
/**
* Copy static properties, prototype properties, and descriptors from one object to another.
@@ -66010,7 +66236,7 @@ module.exports.has = has;
/***/ }),
-/* 584 */
+/* 588 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -66098,16 +66324,16 @@ function isObject(val) {
/***/ }),
-/* 585 */
+/* 589 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var use = __webpack_require__(586);
-var define = __webpack_require__(517);
-var debug = __webpack_require__(588)('snapdragon:compiler');
-var utils = __webpack_require__(594);
+var use = __webpack_require__(590);
+var define = __webpack_require__(521);
+var debug = __webpack_require__(592)('snapdragon:compiler');
+var utils = __webpack_require__(598);
/**
* Create a new `Compiler` with the given `options`.
@@ -66261,7 +66487,7 @@ Compiler.prototype = {
// source map support
if (opts.sourcemap) {
- var sourcemaps = __webpack_require__(613);
+ var sourcemaps = __webpack_require__(617);
sourcemaps(this);
this.mapVisit(this.ast.nodes);
this.applySourceMaps();
@@ -66282,7 +66508,7 @@ module.exports = Compiler;
/***/ }),
-/* 586 */
+/* 590 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -66295,7 +66521,7 @@ module.exports = Compiler;
-var utils = __webpack_require__(587);
+var utils = __webpack_require__(591);
module.exports = function base(app, opts) {
if (!utils.isObject(app) && typeof app !== 'function') {
@@ -66410,7 +66636,7 @@ module.exports = function base(app, opts) {
/***/ }),
-/* 587 */
+/* 591 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -66424,8 +66650,8 @@ var utils = {};
* Lazily required module dependencies
*/
-utils.define = __webpack_require__(517);
-utils.isObject = __webpack_require__(535);
+utils.define = __webpack_require__(521);
+utils.isObject = __webpack_require__(539);
utils.isString = function(val) {
@@ -66440,7 +66666,7 @@ module.exports = utils;
/***/ }),
-/* 588 */
+/* 592 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -66449,14 +66675,14 @@ module.exports = utils;
*/
if (typeof process !== 'undefined' && process.type === 'renderer') {
- module.exports = __webpack_require__(589);
+ module.exports = __webpack_require__(593);
} else {
- module.exports = __webpack_require__(592);
+ module.exports = __webpack_require__(596);
}
/***/ }),
-/* 589 */
+/* 593 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -66465,7 +66691,7 @@ if (typeof process !== 'undefined' && process.type === 'renderer') {
* Expose `debug()` as the module.
*/
-exports = module.exports = __webpack_require__(590);
+exports = module.exports = __webpack_require__(594);
exports.log = log;
exports.formatArgs = formatArgs;
exports.save = save;
@@ -66647,7 +66873,7 @@ function localstorage() {
/***/ }),
-/* 590 */
+/* 594 */
/***/ (function(module, exports, __webpack_require__) {
@@ -66663,7 +66889,7 @@ exports.coerce = coerce;
exports.disable = disable;
exports.enable = enable;
exports.enabled = enabled;
-exports.humanize = __webpack_require__(591);
+exports.humanize = __webpack_require__(595);
/**
* The currently active debug mode names, and names to skip.
@@ -66855,7 +67081,7 @@ function coerce(val) {
/***/ }),
-/* 591 */
+/* 595 */
/***/ (function(module, exports) {
/**
@@ -67013,7 +67239,7 @@ function plural(ms, n, name) {
/***/ }),
-/* 592 */
+/* 596 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -67029,7 +67255,7 @@ var util = __webpack_require__(111);
* Expose `debug()` as the module.
*/
-exports = module.exports = __webpack_require__(590);
+exports = module.exports = __webpack_require__(594);
exports.init = init;
exports.log = log;
exports.formatArgs = formatArgs;
@@ -67208,7 +67434,7 @@ function createWritableStdioStream (fd) {
case 'PIPE':
case 'TCP':
- var net = __webpack_require__(593);
+ var net = __webpack_require__(597);
stream = new net.Socket({
fd: fd,
readable: false,
@@ -67267,13 +67493,13 @@ exports.enable(load());
/***/ }),
-/* 593 */
+/* 597 */
/***/ (function(module, exports) {
module.exports = require("net");
/***/ }),
-/* 594 */
+/* 598 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -67283,9 +67509,9 @@ module.exports = require("net");
* Module dependencies
*/
-exports.extend = __webpack_require__(525);
-exports.SourceMap = __webpack_require__(595);
-exports.sourceMapResolve = __webpack_require__(606);
+exports.extend = __webpack_require__(529);
+exports.SourceMap = __webpack_require__(599);
+exports.sourceMapResolve = __webpack_require__(610);
/**
* Convert backslash in the given string to forward slashes
@@ -67328,7 +67554,7 @@ exports.last = function(arr, n) {
/***/ }),
-/* 595 */
+/* 599 */
/***/ (function(module, exports, __webpack_require__) {
/*
@@ -67336,13 +67562,13 @@ exports.last = function(arr, n) {
* Licensed under the New BSD license. See LICENSE.txt or:
* http://opensource.org/licenses/BSD-3-Clause
*/
-exports.SourceMapGenerator = __webpack_require__(596).SourceMapGenerator;
-exports.SourceMapConsumer = __webpack_require__(602).SourceMapConsumer;
-exports.SourceNode = __webpack_require__(605).SourceNode;
+exports.SourceMapGenerator = __webpack_require__(600).SourceMapGenerator;
+exports.SourceMapConsumer = __webpack_require__(606).SourceMapConsumer;
+exports.SourceNode = __webpack_require__(609).SourceNode;
/***/ }),
-/* 596 */
+/* 600 */
/***/ (function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@@ -67352,10 +67578,10 @@ exports.SourceNode = __webpack_require__(605).SourceNode;
* http://opensource.org/licenses/BSD-3-Clause
*/
-var base64VLQ = __webpack_require__(597);
-var util = __webpack_require__(599);
-var ArraySet = __webpack_require__(600).ArraySet;
-var MappingList = __webpack_require__(601).MappingList;
+var base64VLQ = __webpack_require__(601);
+var util = __webpack_require__(603);
+var ArraySet = __webpack_require__(604).ArraySet;
+var MappingList = __webpack_require__(605).MappingList;
/**
* An instance of the SourceMapGenerator represents a source map which is
@@ -67764,7 +67990,7 @@ exports.SourceMapGenerator = SourceMapGenerator;
/***/ }),
-/* 597 */
+/* 601 */
/***/ (function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@@ -67804,7 +68030,7 @@ exports.SourceMapGenerator = SourceMapGenerator;
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-var base64 = __webpack_require__(598);
+var base64 = __webpack_require__(602);
// A single base 64 digit can contain 6 bits of data. For the base 64 variable
// length quantities we use in the source map spec, the first bit is the sign,
@@ -67910,7 +68136,7 @@ exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
/***/ }),
-/* 598 */
+/* 602 */
/***/ (function(module, exports) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@@ -67983,7 +68209,7 @@ exports.decode = function (charCode) {
/***/ }),
-/* 599 */
+/* 603 */
/***/ (function(module, exports) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@@ -68406,7 +68632,7 @@ exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflate
/***/ }),
-/* 600 */
+/* 604 */
/***/ (function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@@ -68416,7 +68642,7 @@ exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflate
* http://opensource.org/licenses/BSD-3-Clause
*/
-var util = __webpack_require__(599);
+var util = __webpack_require__(603);
var has = Object.prototype.hasOwnProperty;
var hasNativeMap = typeof Map !== "undefined";
@@ -68533,7 +68759,7 @@ exports.ArraySet = ArraySet;
/***/ }),
-/* 601 */
+/* 605 */
/***/ (function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@@ -68543,7 +68769,7 @@ exports.ArraySet = ArraySet;
* http://opensource.org/licenses/BSD-3-Clause
*/
-var util = __webpack_require__(599);
+var util = __webpack_require__(603);
/**
* Determine whether mappingB is after mappingA with respect to generated
@@ -68618,7 +68844,7 @@ exports.MappingList = MappingList;
/***/ }),
-/* 602 */
+/* 606 */
/***/ (function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@@ -68628,11 +68854,11 @@ exports.MappingList = MappingList;
* http://opensource.org/licenses/BSD-3-Clause
*/
-var util = __webpack_require__(599);
-var binarySearch = __webpack_require__(603);
-var ArraySet = __webpack_require__(600).ArraySet;
-var base64VLQ = __webpack_require__(597);
-var quickSort = __webpack_require__(604).quickSort;
+var util = __webpack_require__(603);
+var binarySearch = __webpack_require__(607);
+var ArraySet = __webpack_require__(604).ArraySet;
+var base64VLQ = __webpack_require__(601);
+var quickSort = __webpack_require__(608).quickSort;
function SourceMapConsumer(aSourceMap) {
var sourceMap = aSourceMap;
@@ -69706,7 +69932,7 @@ exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
/***/ }),
-/* 603 */
+/* 607 */
/***/ (function(module, exports) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@@ -69823,7 +70049,7 @@ exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
/***/ }),
-/* 604 */
+/* 608 */
/***/ (function(module, exports) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@@ -69943,7 +70169,7 @@ exports.quickSort = function (ary, comparator) {
/***/ }),
-/* 605 */
+/* 609 */
/***/ (function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
@@ -69953,8 +70179,8 @@ exports.quickSort = function (ary, comparator) {
* http://opensource.org/licenses/BSD-3-Clause
*/
-var SourceMapGenerator = __webpack_require__(596).SourceMapGenerator;
-var util = __webpack_require__(599);
+var SourceMapGenerator = __webpack_require__(600).SourceMapGenerator;
+var util = __webpack_require__(603);
// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
// operating systems these days (capturing the result).
@@ -70362,17 +70588,17 @@ exports.SourceNode = SourceNode;
/***/ }),
-/* 606 */
+/* 610 */
/***/ (function(module, exports, __webpack_require__) {
// Copyright 2014, 2015, 2016, 2017 Simon Lydell
// X11 (“MIT”) Licensed. (See LICENSE.)
-var sourceMappingURL = __webpack_require__(607)
-var resolveUrl = __webpack_require__(608)
-var decodeUriComponent = __webpack_require__(609)
-var urix = __webpack_require__(611)
-var atob = __webpack_require__(612)
+var sourceMappingURL = __webpack_require__(611)
+var resolveUrl = __webpack_require__(612)
+var decodeUriComponent = __webpack_require__(613)
+var urix = __webpack_require__(615)
+var atob = __webpack_require__(616)
@@ -70670,7 +70896,7 @@ module.exports = {
/***/ }),
-/* 607 */
+/* 611 */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;// Copyright 2014 Simon Lydell
@@ -70733,7 +70959,7 @@ void (function(root, factory) {
/***/ }),
-/* 608 */
+/* 612 */
/***/ (function(module, exports, __webpack_require__) {
// Copyright 2014 Simon Lydell
@@ -70751,13 +70977,13 @@ module.exports = resolveUrl
/***/ }),
-/* 609 */
+/* 613 */
/***/ (function(module, exports, __webpack_require__) {
// Copyright 2017 Simon Lydell
// X11 (“MIT”) Licensed. (See LICENSE.)
-var decodeUriComponent = __webpack_require__(610)
+var decodeUriComponent = __webpack_require__(614)
function customDecodeUriComponent(string) {
// `decodeUriComponent` turns `+` into ` `, but that's not wanted.
@@ -70768,7 +70994,7 @@ module.exports = customDecodeUriComponent
/***/ }),
-/* 610 */
+/* 614 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -70869,7 +71095,7 @@ module.exports = function (encodedURI) {
/***/ }),
-/* 611 */
+/* 615 */
/***/ (function(module, exports, __webpack_require__) {
// Copyright 2014 Simon Lydell
@@ -70892,7 +71118,7 @@ module.exports = urix
/***/ }),
-/* 612 */
+/* 616 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -70906,7 +71132,7 @@ module.exports = atob.atob = atob;
/***/ }),
-/* 613 */
+/* 617 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -70914,8 +71140,8 @@ module.exports = atob.atob = atob;
var fs = __webpack_require__(133);
var path = __webpack_require__(4);
-var define = __webpack_require__(517);
-var utils = __webpack_require__(594);
+var define = __webpack_require__(521);
+var utils = __webpack_require__(598);
/**
* Expose `mixin()`.
@@ -71058,19 +71284,19 @@ exports.comment = function(node) {
/***/ }),
-/* 614 */
+/* 618 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var use = __webpack_require__(586);
+var use = __webpack_require__(590);
var util = __webpack_require__(111);
-var Cache = __webpack_require__(615);
-var define = __webpack_require__(517);
-var debug = __webpack_require__(588)('snapdragon:parser');
-var Position = __webpack_require__(616);
-var utils = __webpack_require__(594);
+var Cache = __webpack_require__(619);
+var define = __webpack_require__(521);
+var debug = __webpack_require__(592)('snapdragon:parser');
+var Position = __webpack_require__(620);
+var utils = __webpack_require__(598);
/**
* Create a new `Parser` with the given `input` and `options`.
@@ -71598,7 +71824,7 @@ module.exports = Parser;
/***/ }),
-/* 615 */
+/* 619 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -71705,13 +71931,13 @@ MapCache.prototype.del = function mapDelete(key) {
/***/ }),
-/* 616 */
+/* 620 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var define = __webpack_require__(517);
+var define = __webpack_require__(521);
/**
* Store position for a node
@@ -71726,16 +71952,16 @@ module.exports = function Position(start, parser) {
/***/ }),
-/* 617 */
+/* 621 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var safe = __webpack_require__(618);
-var define = __webpack_require__(624);
-var extend = __webpack_require__(625);
-var not = __webpack_require__(627);
+var safe = __webpack_require__(622);
+var define = __webpack_require__(628);
+var extend = __webpack_require__(629);
+var not = __webpack_require__(631);
var MAX_LENGTH = 1024 * 64;
/**
@@ -71888,10 +72114,10 @@ module.exports.makeRe = makeRe;
/***/ }),
-/* 618 */
+/* 622 */
/***/ (function(module, exports, __webpack_require__) {
-var parse = __webpack_require__(619);
+var parse = __webpack_require__(623);
var types = parse.types;
module.exports = function (re, opts) {
@@ -71937,13 +72163,13 @@ function isRegExp (x) {
/***/ }),
-/* 619 */
+/* 623 */
/***/ (function(module, exports, __webpack_require__) {
-var util = __webpack_require__(620);
-var types = __webpack_require__(621);
-var sets = __webpack_require__(622);
-var positions = __webpack_require__(623);
+var util = __webpack_require__(624);
+var types = __webpack_require__(625);
+var sets = __webpack_require__(626);
+var positions = __webpack_require__(627);
module.exports = function(regexpStr) {
@@ -72225,11 +72451,11 @@ module.exports.types = types;
/***/ }),
-/* 620 */
+/* 624 */
/***/ (function(module, exports, __webpack_require__) {
-var types = __webpack_require__(621);
-var sets = __webpack_require__(622);
+var types = __webpack_require__(625);
+var sets = __webpack_require__(626);
// All of these are private and only used by randexp.
@@ -72342,7 +72568,7 @@ exports.error = function(regexp, msg) {
/***/ }),
-/* 621 */
+/* 625 */
/***/ (function(module, exports) {
module.exports = {
@@ -72358,10 +72584,10 @@ module.exports = {
/***/ }),
-/* 622 */
+/* 626 */
/***/ (function(module, exports, __webpack_require__) {
-var types = __webpack_require__(621);
+var types = __webpack_require__(625);
var INTS = function() {
return [{ type: types.RANGE , from: 48, to: 57 }];
@@ -72446,10 +72672,10 @@ exports.anyChar = function() {
/***/ }),
-/* 623 */
+/* 627 */
/***/ (function(module, exports, __webpack_require__) {
-var types = __webpack_require__(621);
+var types = __webpack_require__(625);
exports.wordBoundary = function() {
return { type: types.POSITION, value: 'b' };
@@ -72469,7 +72695,7 @@ exports.end = function() {
/***/ }),
-/* 624 */
+/* 628 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -72482,8 +72708,8 @@ exports.end = function() {
-var isobject = __webpack_require__(535);
-var isDescriptor = __webpack_require__(547);
+var isobject = __webpack_require__(539);
+var isDescriptor = __webpack_require__(551);
var define = (typeof Reflect !== 'undefined' && Reflect.defineProperty)
? Reflect.defineProperty
: Object.defineProperty;
@@ -72514,14 +72740,14 @@ module.exports = function defineProperty(obj, key, val) {
/***/ }),
-/* 625 */
+/* 629 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var isExtendable = __webpack_require__(626);
-var assignSymbols = __webpack_require__(536);
+var isExtendable = __webpack_require__(630);
+var assignSymbols = __webpack_require__(540);
module.exports = Object.assign || function(obj/*, objects*/) {
if (obj === null || typeof obj === 'undefined') {
@@ -72581,7 +72807,7 @@ function isEnum(obj, key) {
/***/ }),
-/* 626 */
+/* 630 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -72594,7 +72820,7 @@ function isEnum(obj, key) {
-var isPlainObject = __webpack_require__(534);
+var isPlainObject = __webpack_require__(538);
module.exports = function isExtendable(val) {
return isPlainObject(val) || typeof val === 'function' || Array.isArray(val);
@@ -72602,14 +72828,14 @@ module.exports = function isExtendable(val) {
/***/ }),
-/* 627 */
+/* 631 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var extend = __webpack_require__(625);
-var safe = __webpack_require__(618);
+var extend = __webpack_require__(629);
+var safe = __webpack_require__(622);
/**
* The main export is a function that takes a `pattern` string and an `options` object.
@@ -72681,14 +72907,14 @@ module.exports = toRegex;
/***/ }),
-/* 628 */
+/* 632 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var nanomatch = __webpack_require__(629);
-var extglob = __webpack_require__(644);
+var nanomatch = __webpack_require__(633);
+var extglob = __webpack_require__(648);
module.exports = function(snapdragon) {
var compilers = snapdragon.compiler.compilers;
@@ -72765,7 +72991,7 @@ function escapeExtglobs(compiler) {
/***/ }),
-/* 629 */
+/* 633 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -72776,17 +73002,17 @@ function escapeExtglobs(compiler) {
*/
var util = __webpack_require__(111);
-var toRegex = __webpack_require__(516);
-var extend = __webpack_require__(630);
+var toRegex = __webpack_require__(520);
+var extend = __webpack_require__(634);
/**
* Local dependencies
*/
-var compilers = __webpack_require__(632);
-var parsers = __webpack_require__(633);
-var cache = __webpack_require__(636);
-var utils = __webpack_require__(638);
+var compilers = __webpack_require__(636);
+var parsers = __webpack_require__(637);
+var cache = __webpack_require__(640);
+var utils = __webpack_require__(642);
var MAX_LENGTH = 1024 * 64;
/**
@@ -73610,14 +73836,14 @@ module.exports = nanomatch;
/***/ }),
-/* 630 */
+/* 634 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var isExtendable = __webpack_require__(631);
-var assignSymbols = __webpack_require__(536);
+var isExtendable = __webpack_require__(635);
+var assignSymbols = __webpack_require__(540);
module.exports = Object.assign || function(obj/*, objects*/) {
if (obj === null || typeof obj === 'undefined') {
@@ -73677,7 +73903,7 @@ function isEnum(obj, key) {
/***/ }),
-/* 631 */
+/* 635 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -73690,7 +73916,7 @@ function isEnum(obj, key) {
-var isPlainObject = __webpack_require__(534);
+var isPlainObject = __webpack_require__(538);
module.exports = function isExtendable(val) {
return isPlainObject(val) || typeof val === 'function' || Array.isArray(val);
@@ -73698,7 +73924,7 @@ module.exports = function isExtendable(val) {
/***/ }),
-/* 632 */
+/* 636 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -74044,15 +74270,15 @@ module.exports = function(nanomatch, options) {
/***/ }),
-/* 633 */
+/* 637 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var regexNot = __webpack_require__(527);
-var toRegex = __webpack_require__(516);
-var isOdd = __webpack_require__(634);
+var regexNot = __webpack_require__(531);
+var toRegex = __webpack_require__(520);
+var isOdd = __webpack_require__(638);
/**
* Characters to use in negation regex (we want to "not" match
@@ -74438,7 +74664,7 @@ module.exports.not = NOT_REGEX;
/***/ }),
-/* 634 */
+/* 638 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -74451,7 +74677,7 @@ module.exports.not = NOT_REGEX;
-var isNumber = __webpack_require__(635);
+var isNumber = __webpack_require__(639);
module.exports = function isOdd(i) {
if (!isNumber(i)) {
@@ -74465,7 +74691,7 @@ module.exports = function isOdd(i) {
/***/ }),
-/* 635 */
+/* 639 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -74493,14 +74719,14 @@ module.exports = function isNumber(num) {
/***/ }),
-/* 636 */
+/* 640 */
/***/ (function(module, exports, __webpack_require__) {
-module.exports = new (__webpack_require__(637))();
+module.exports = new (__webpack_require__(641))();
/***/ }),
-/* 637 */
+/* 641 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -74513,7 +74739,7 @@ module.exports = new (__webpack_require__(637))();
-var MapCache = __webpack_require__(615);
+var MapCache = __webpack_require__(619);
/**
* Create a new `FragmentCache` with an optional object to use for `caches`.
@@ -74635,7 +74861,7 @@ exports = module.exports = FragmentCache;
/***/ }),
-/* 638 */
+/* 642 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -74648,14 +74874,14 @@ var path = __webpack_require__(4);
* Module dependencies
*/
-var isWindows = __webpack_require__(639)();
-var Snapdragon = __webpack_require__(555);
-utils.define = __webpack_require__(640);
-utils.diff = __webpack_require__(641);
-utils.extend = __webpack_require__(630);
-utils.pick = __webpack_require__(642);
-utils.typeOf = __webpack_require__(643);
-utils.unique = __webpack_require__(528);
+var isWindows = __webpack_require__(643)();
+var Snapdragon = __webpack_require__(559);
+utils.define = __webpack_require__(644);
+utils.diff = __webpack_require__(645);
+utils.extend = __webpack_require__(634);
+utils.pick = __webpack_require__(646);
+utils.typeOf = __webpack_require__(647);
+utils.unique = __webpack_require__(532);
/**
* Returns true if the given value is effectively an empty string
@@ -75021,7 +75247,7 @@ utils.unixify = function(options) {
/***/ }),
-/* 639 */
+/* 643 */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
@@ -75049,7 +75275,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
/***/ }),
-/* 640 */
+/* 644 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -75062,8 +75288,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
-var isobject = __webpack_require__(535);
-var isDescriptor = __webpack_require__(547);
+var isobject = __webpack_require__(539);
+var isDescriptor = __webpack_require__(551);
var define = (typeof Reflect !== 'undefined' && Reflect.defineProperty)
? Reflect.defineProperty
: Object.defineProperty;
@@ -75094,7 +75320,7 @@ module.exports = function defineProperty(obj, key, val) {
/***/ }),
-/* 641 */
+/* 645 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -75148,7 +75374,7 @@ function diffArray(one, two) {
/***/ }),
-/* 642 */
+/* 646 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -75161,7 +75387,7 @@ function diffArray(one, two) {
-var isObject = __webpack_require__(535);
+var isObject = __webpack_require__(539);
module.exports = function pick(obj, keys) {
if (!isObject(obj) && typeof obj !== 'function') {
@@ -75190,7 +75416,7 @@ module.exports = function pick(obj, keys) {
/***/ }),
-/* 643 */
+/* 647 */
/***/ (function(module, exports) {
var toString = Object.prototype.toString;
@@ -75325,7 +75551,7 @@ function isBuffer(val) {
/***/ }),
-/* 644 */
+/* 648 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -75335,18 +75561,18 @@ function isBuffer(val) {
* Module dependencies
*/
-var extend = __webpack_require__(525);
-var unique = __webpack_require__(528);
-var toRegex = __webpack_require__(516);
+var extend = __webpack_require__(529);
+var unique = __webpack_require__(532);
+var toRegex = __webpack_require__(520);
/**
* Local dependencies
*/
-var compilers = __webpack_require__(645);
-var parsers = __webpack_require__(656);
-var Extglob = __webpack_require__(659);
-var utils = __webpack_require__(658);
+var compilers = __webpack_require__(649);
+var parsers = __webpack_require__(660);
+var Extglob = __webpack_require__(663);
+var utils = __webpack_require__(662);
var MAX_LENGTH = 1024 * 64;
/**
@@ -75663,13 +75889,13 @@ module.exports = extglob;
/***/ }),
-/* 645 */
+/* 649 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var brackets = __webpack_require__(646);
+var brackets = __webpack_require__(650);
/**
* Extglob compilers
@@ -75839,7 +76065,7 @@ module.exports = function(extglob) {
/***/ }),
-/* 646 */
+/* 650 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -75849,17 +76075,17 @@ module.exports = function(extglob) {
* Local dependencies
*/
-var compilers = __webpack_require__(647);
-var parsers = __webpack_require__(649);
+var compilers = __webpack_require__(651);
+var parsers = __webpack_require__(653);
/**
* Module dependencies
*/
-var debug = __webpack_require__(651)('expand-brackets');
-var extend = __webpack_require__(525);
-var Snapdragon = __webpack_require__(555);
-var toRegex = __webpack_require__(516);
+var debug = __webpack_require__(655)('expand-brackets');
+var extend = __webpack_require__(529);
+var Snapdragon = __webpack_require__(559);
+var toRegex = __webpack_require__(520);
/**
* Parses the given POSIX character class `pattern` and returns a
@@ -76057,13 +76283,13 @@ module.exports = brackets;
/***/ }),
-/* 647 */
+/* 651 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var posix = __webpack_require__(648);
+var posix = __webpack_require__(652);
module.exports = function(brackets) {
brackets.compiler
@@ -76151,7 +76377,7 @@ module.exports = function(brackets) {
/***/ }),
-/* 648 */
+/* 652 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -76180,14 +76406,14 @@ module.exports = {
/***/ }),
-/* 649 */
+/* 653 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var utils = __webpack_require__(650);
-var define = __webpack_require__(517);
+var utils = __webpack_require__(654);
+var define = __webpack_require__(521);
/**
* Text regex
@@ -76406,14 +76632,14 @@ module.exports.TEXT_REGEX = TEXT_REGEX;
/***/ }),
-/* 650 */
+/* 654 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var toRegex = __webpack_require__(516);
-var regexNot = __webpack_require__(527);
+var toRegex = __webpack_require__(520);
+var regexNot = __webpack_require__(531);
var cached;
/**
@@ -76447,7 +76673,7 @@ exports.createRegex = function(pattern, include) {
/***/ }),
-/* 651 */
+/* 655 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -76456,14 +76682,14 @@ exports.createRegex = function(pattern, include) {
*/
if (typeof process !== 'undefined' && process.type === 'renderer') {
- module.exports = __webpack_require__(652);
+ module.exports = __webpack_require__(656);
} else {
- module.exports = __webpack_require__(655);
+ module.exports = __webpack_require__(659);
}
/***/ }),
-/* 652 */
+/* 656 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -76472,7 +76698,7 @@ if (typeof process !== 'undefined' && process.type === 'renderer') {
* Expose `debug()` as the module.
*/
-exports = module.exports = __webpack_require__(653);
+exports = module.exports = __webpack_require__(657);
exports.log = log;
exports.formatArgs = formatArgs;
exports.save = save;
@@ -76654,7 +76880,7 @@ function localstorage() {
/***/ }),
-/* 653 */
+/* 657 */
/***/ (function(module, exports, __webpack_require__) {
@@ -76670,7 +76896,7 @@ exports.coerce = coerce;
exports.disable = disable;
exports.enable = enable;
exports.enabled = enabled;
-exports.humanize = __webpack_require__(654);
+exports.humanize = __webpack_require__(658);
/**
* The currently active debug mode names, and names to skip.
@@ -76862,7 +77088,7 @@ function coerce(val) {
/***/ }),
-/* 654 */
+/* 658 */
/***/ (function(module, exports) {
/**
@@ -77020,7 +77246,7 @@ function plural(ms, n, name) {
/***/ }),
-/* 655 */
+/* 659 */
/***/ (function(module, exports, __webpack_require__) {
/**
@@ -77036,7 +77262,7 @@ var util = __webpack_require__(111);
* Expose `debug()` as the module.
*/
-exports = module.exports = __webpack_require__(653);
+exports = module.exports = __webpack_require__(657);
exports.init = init;
exports.log = log;
exports.formatArgs = formatArgs;
@@ -77215,7 +77441,7 @@ function createWritableStdioStream (fd) {
case 'PIPE':
case 'TCP':
- var net = __webpack_require__(593);
+ var net = __webpack_require__(597);
stream = new net.Socket({
fd: fd,
readable: false,
@@ -77274,15 +77500,15 @@ exports.enable(load());
/***/ }),
-/* 656 */
+/* 660 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var brackets = __webpack_require__(646);
-var define = __webpack_require__(657);
-var utils = __webpack_require__(658);
+var brackets = __webpack_require__(650);
+var define = __webpack_require__(661);
+var utils = __webpack_require__(662);
/**
* Characters to use in text regex (we want to "not" match
@@ -77437,7 +77663,7 @@ module.exports = parsers;
/***/ }),
-/* 657 */
+/* 661 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -77450,7 +77676,7 @@ module.exports = parsers;
-var isDescriptor = __webpack_require__(547);
+var isDescriptor = __webpack_require__(551);
module.exports = function defineProperty(obj, prop, val) {
if (typeof obj !== 'object' && typeof obj !== 'function') {
@@ -77475,14 +77701,14 @@ module.exports = function defineProperty(obj, prop, val) {
/***/ }),
-/* 658 */
+/* 662 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var regex = __webpack_require__(527);
-var Cache = __webpack_require__(637);
+var regex = __webpack_require__(531);
+var Cache = __webpack_require__(641);
/**
* Utils
@@ -77551,7 +77777,7 @@ utils.createRegex = function(str) {
/***/ }),
-/* 659 */
+/* 663 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -77561,16 +77787,16 @@ utils.createRegex = function(str) {
* Module dependencies
*/
-var Snapdragon = __webpack_require__(555);
-var define = __webpack_require__(657);
-var extend = __webpack_require__(525);
+var Snapdragon = __webpack_require__(559);
+var define = __webpack_require__(661);
+var extend = __webpack_require__(529);
/**
* Local dependencies
*/
-var compilers = __webpack_require__(645);
-var parsers = __webpack_require__(656);
+var compilers = __webpack_require__(649);
+var parsers = __webpack_require__(660);
/**
* Customize Snapdragon parser and renderer
@@ -77636,16 +77862,16 @@ module.exports = Extglob;
/***/ }),
-/* 660 */
+/* 664 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var extglob = __webpack_require__(644);
-var nanomatch = __webpack_require__(629);
-var regexNot = __webpack_require__(527);
-var toRegex = __webpack_require__(617);
+var extglob = __webpack_require__(648);
+var nanomatch = __webpack_require__(633);
+var regexNot = __webpack_require__(531);
+var toRegex = __webpack_require__(621);
var not;
/**
@@ -77726,14 +77952,14 @@ function textRegex(pattern) {
/***/ }),
-/* 661 */
+/* 665 */
/***/ (function(module, exports, __webpack_require__) {
-module.exports = new (__webpack_require__(637))();
+module.exports = new (__webpack_require__(641))();
/***/ }),
-/* 662 */
+/* 666 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -77746,13 +77972,13 @@ var path = __webpack_require__(4);
* Module dependencies
*/
-var Snapdragon = __webpack_require__(555);
-utils.define = __webpack_require__(624);
-utils.diff = __webpack_require__(641);
-utils.extend = __webpack_require__(625);
-utils.pick = __webpack_require__(642);
-utils.typeOf = __webpack_require__(663);
-utils.unique = __webpack_require__(528);
+var Snapdragon = __webpack_require__(559);
+utils.define = __webpack_require__(628);
+utils.diff = __webpack_require__(645);
+utils.extend = __webpack_require__(629);
+utils.pick = __webpack_require__(646);
+utils.typeOf = __webpack_require__(667);
+utils.unique = __webpack_require__(532);
/**
* Returns true if the platform is windows, or `path.sep` is `\\`.
@@ -78049,7 +78275,7 @@ utils.unixify = function(options) {
/***/ }),
-/* 663 */
+/* 667 */
/***/ (function(module, exports) {
var toString = Object.prototype.toString;
@@ -78184,7 +78410,7 @@ function isBuffer(val) {
/***/ }),
-/* 664 */
+/* 668 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -78203,9 +78429,9 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
-var readdir = __webpack_require__(665);
-var reader_1 = __webpack_require__(678);
-var fs_stream_1 = __webpack_require__(682);
+var readdir = __webpack_require__(669);
+var reader_1 = __webpack_require__(682);
+var fs_stream_1 = __webpack_require__(686);
var ReaderAsync = /** @class */ (function (_super) {
__extends(ReaderAsync, _super);
function ReaderAsync() {
@@ -78266,15 +78492,15 @@ exports.default = ReaderAsync;
/***/ }),
-/* 665 */
+/* 669 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const readdirSync = __webpack_require__(666);
-const readdirAsync = __webpack_require__(674);
-const readdirStream = __webpack_require__(677);
+const readdirSync = __webpack_require__(670);
+const readdirAsync = __webpack_require__(678);
+const readdirStream = __webpack_require__(681);
module.exports = exports = readdirAsyncPath;
exports.readdir = exports.readdirAsync = exports.async = readdirAsyncPath;
@@ -78358,7 +78584,7 @@ function readdirStreamStat (dir, options) {
/***/ }),
-/* 666 */
+/* 670 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -78366,11 +78592,11 @@ function readdirStreamStat (dir, options) {
module.exports = readdirSync;
-const DirectoryReader = __webpack_require__(667);
+const DirectoryReader = __webpack_require__(671);
let syncFacade = {
- fs: __webpack_require__(672),
- forEach: __webpack_require__(673),
+ fs: __webpack_require__(676),
+ forEach: __webpack_require__(677),
sync: true
};
@@ -78399,7 +78625,7 @@ function readdirSync (dir, options, internalOptions) {
/***/ }),
-/* 667 */
+/* 671 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -78408,9 +78634,9 @@ function readdirSync (dir, options, internalOptions) {
const Readable = __webpack_require__(137).Readable;
const EventEmitter = __webpack_require__(155).EventEmitter;
const path = __webpack_require__(4);
-const normalizeOptions = __webpack_require__(668);
-const stat = __webpack_require__(670);
-const call = __webpack_require__(671);
+const normalizeOptions = __webpack_require__(672);
+const stat = __webpack_require__(674);
+const call = __webpack_require__(675);
/**
* Asynchronously reads the contents of a directory and streams the results
@@ -78786,14 +79012,14 @@ module.exports = DirectoryReader;
/***/ }),
-/* 668 */
+/* 672 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const path = __webpack_require__(4);
-const globToRegExp = __webpack_require__(669);
+const globToRegExp = __webpack_require__(673);
module.exports = normalizeOptions;
@@ -78970,7 +79196,7 @@ function normalizeOptions (options, internalOptions) {
/***/ }),
-/* 669 */
+/* 673 */
/***/ (function(module, exports) {
module.exports = function (glob, opts) {
@@ -79107,13 +79333,13 @@ module.exports = function (glob, opts) {
/***/ }),
-/* 670 */
+/* 674 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const call = __webpack_require__(671);
+const call = __webpack_require__(675);
module.exports = stat;
@@ -79188,7 +79414,7 @@ function symlinkStat (fs, path, lstats, callback) {
/***/ }),
-/* 671 */
+/* 675 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -79249,14 +79475,14 @@ function callOnce (fn) {
/***/ }),
-/* 672 */
+/* 676 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const fs = __webpack_require__(133);
-const call = __webpack_require__(671);
+const call = __webpack_require__(675);
/**
* A facade around {@link fs.readdirSync} that allows it to be called
@@ -79320,7 +79546,7 @@ exports.lstat = function (path, callback) {
/***/ }),
-/* 673 */
+/* 677 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -79349,7 +79575,7 @@ function syncForEach (array, iterator, done) {
/***/ }),
-/* 674 */
+/* 678 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -79357,12 +79583,12 @@ function syncForEach (array, iterator, done) {
module.exports = readdirAsync;
-const maybe = __webpack_require__(675);
-const DirectoryReader = __webpack_require__(667);
+const maybe = __webpack_require__(679);
+const DirectoryReader = __webpack_require__(671);
let asyncFacade = {
fs: __webpack_require__(133),
- forEach: __webpack_require__(676),
+ forEach: __webpack_require__(680),
async: true
};
@@ -79404,7 +79630,7 @@ function readdirAsync (dir, options, callback, internalOptions) {
/***/ }),
-/* 675 */
+/* 679 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -79431,7 +79657,7 @@ module.exports = function maybe (cb, promise) {
/***/ }),
-/* 676 */
+/* 680 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -79467,7 +79693,7 @@ function asyncForEach (array, iterator, done) {
/***/ }),
-/* 677 */
+/* 681 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -79475,11 +79701,11 @@ function asyncForEach (array, iterator, done) {
module.exports = readdirStream;
-const DirectoryReader = __webpack_require__(667);
+const DirectoryReader = __webpack_require__(671);
let streamFacade = {
fs: __webpack_require__(133),
- forEach: __webpack_require__(676),
+ forEach: __webpack_require__(680),
async: true
};
@@ -79499,16 +79725,16 @@ function readdirStream (dir, options, internalOptions) {
/***/ }),
-/* 678 */
+/* 682 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var path = __webpack_require__(4);
-var deep_1 = __webpack_require__(679);
-var entry_1 = __webpack_require__(681);
-var pathUtil = __webpack_require__(680);
+var deep_1 = __webpack_require__(683);
+var entry_1 = __webpack_require__(685);
+var pathUtil = __webpack_require__(684);
var Reader = /** @class */ (function () {
function Reader(options) {
this.options = options;
@@ -79574,14 +79800,14 @@ exports.default = Reader;
/***/ }),
-/* 679 */
+/* 683 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-var pathUtils = __webpack_require__(680);
-var patternUtils = __webpack_require__(509);
+var pathUtils = __webpack_require__(684);
+var patternUtils = __webpack_require__(513);
var DeepFilter = /** @class */ (function () {
function DeepFilter(options, micromatchOptions) {
this.options = options;
@@ -79664,7 +79890,7 @@ exports.default = DeepFilter;
/***/ }),
-/* 680 */
+/* 684 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -79695,14 +79921,14 @@ exports.makeAbsolute = makeAbsolute;
/***/ }),
-/* 681 */
+/* 685 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-var pathUtils = __webpack_require__(680);
-var patternUtils = __webpack_require__(509);
+var pathUtils = __webpack_require__(684);
+var patternUtils = __webpack_require__(513);
var EntryFilter = /** @class */ (function () {
function EntryFilter(options, micromatchOptions) {
this.options = options;
@@ -79787,7 +80013,7 @@ exports.default = EntryFilter;
/***/ }),
-/* 682 */
+/* 686 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -79807,8 +80033,8 @@ var __extends = (this && this.__extends) || (function () {
})();
Object.defineProperty(exports, "__esModule", { value: true });
var stream = __webpack_require__(137);
-var fsStat = __webpack_require__(683);
-var fs_1 = __webpack_require__(687);
+var fsStat = __webpack_require__(687);
+var fs_1 = __webpack_require__(691);
var FileSystemStream = /** @class */ (function (_super) {
__extends(FileSystemStream, _super);
function FileSystemStream() {
@@ -79858,14 +80084,14 @@ exports.default = FileSystemStream;
/***/ }),
-/* 683 */
+/* 687 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const optionsManager = __webpack_require__(684);
-const statProvider = __webpack_require__(686);
+const optionsManager = __webpack_require__(688);
+const statProvider = __webpack_require__(690);
/**
* Asynchronous API.
*/
@@ -79896,13 +80122,13 @@ exports.statSync = statSync;
/***/ }),
-/* 684 */
+/* 688 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const fsAdapter = __webpack_require__(685);
+const fsAdapter = __webpack_require__(689);
function prepare(opts) {
const options = Object.assign({
fs: fsAdapter.getFileSystemAdapter(opts ? opts.fs : undefined),
@@ -79915,7 +80141,7 @@ exports.prepare = prepare;
/***/ }),
-/* 685 */
+/* 689 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -79938,7 +80164,7 @@ exports.getFileSystemAdapter = getFileSystemAdapter;
/***/ }),
-/* 686 */
+/* 690 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -79990,7 +80216,7 @@ exports.isFollowedSymlink = isFollowedSymlink;
/***/ }),
-/* 687 */
+/* 691 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -80021,7 +80247,7 @@ exports.default = FileSystem;
/***/ }),
-/* 688 */
+/* 692 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -80041,9 +80267,9 @@ var __extends = (this && this.__extends) || (function () {
})();
Object.defineProperty(exports, "__esModule", { value: true });
var stream = __webpack_require__(137);
-var readdir = __webpack_require__(665);
-var reader_1 = __webpack_require__(678);
-var fs_stream_1 = __webpack_require__(682);
+var readdir = __webpack_require__(669);
+var reader_1 = __webpack_require__(682);
+var fs_stream_1 = __webpack_require__(686);
var TransformStream = /** @class */ (function (_super) {
__extends(TransformStream, _super);
function TransformStream(reader) {
@@ -80111,7 +80337,7 @@ exports.default = ReaderStream;
/***/ }),
-/* 689 */
+/* 693 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -80130,9 +80356,9 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
-var readdir = __webpack_require__(665);
-var reader_1 = __webpack_require__(678);
-var fs_sync_1 = __webpack_require__(690);
+var readdir = __webpack_require__(669);
+var reader_1 = __webpack_require__(682);
+var fs_sync_1 = __webpack_require__(694);
var ReaderSync = /** @class */ (function (_super) {
__extends(ReaderSync, _super);
function ReaderSync() {
@@ -80192,7 +80418,7 @@ exports.default = ReaderSync;
/***/ }),
-/* 690 */
+/* 694 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -80211,8 +80437,8 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
-var fsStat = __webpack_require__(683);
-var fs_1 = __webpack_require__(687);
+var fsStat = __webpack_require__(687);
+var fs_1 = __webpack_require__(691);
var FileSystemSync = /** @class */ (function (_super) {
__extends(FileSystemSync, _super);
function FileSystemSync() {
@@ -80258,7 +80484,7 @@ exports.default = FileSystemSync;
/***/ }),
-/* 691 */
+/* 695 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -80274,13 +80500,13 @@ exports.flatten = flatten;
/***/ }),
-/* 692 */
+/* 696 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-var merge2 = __webpack_require__(288);
+var merge2 = __webpack_require__(283);
/**
* Merge multiple streams and propagate their errors into one stream in parallel.
*/
@@ -80295,13 +80521,13 @@ exports.merge = merge;
/***/ }),
-/* 693 */
+/* 697 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const path = __webpack_require__(4);
-const pathType = __webpack_require__(694);
+const pathType = __webpack_require__(698);
const getExtensions = extensions => extensions.length > 1 ? `{${extensions.join(',')}}` : extensions[0];
@@ -80367,13 +80593,13 @@ module.exports.sync = (input, opts) => {
/***/ }),
-/* 694 */
+/* 698 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const fs = __webpack_require__(133);
-const pify = __webpack_require__(695);
+const pify = __webpack_require__(699);
function type(fn, fn2, fp) {
if (typeof fp !== 'string') {
@@ -80416,7 +80642,7 @@ exports.symlinkSync = typeSync.bind(null, 'lstatSync', 'isSymbolicLink');
/***/ }),
-/* 695 */
+/* 699 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -80507,17 +80733,17 @@ module.exports = (obj, opts) => {
/***/ }),
-/* 696 */
+/* 700 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const fs = __webpack_require__(133);
const path = __webpack_require__(4);
-const fastGlob = __webpack_require__(505);
-const gitIgnore = __webpack_require__(697);
-const pify = __webpack_require__(698);
-const slash = __webpack_require__(699);
+const fastGlob = __webpack_require__(509);
+const gitIgnore = __webpack_require__(701);
+const pify = __webpack_require__(702);
+const slash = __webpack_require__(703);
const DEFAULT_IGNORE = [
'**/node_modules/**',
@@ -80615,7 +80841,7 @@ module.exports.sync = options => {
/***/ }),
-/* 697 */
+/* 701 */
/***/ (function(module, exports) {
// A simple implementation of make-array
@@ -81084,7 +81310,7 @@ module.exports = options => new IgnoreBase(options)
/***/ }),
-/* 698 */
+/* 702 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -81159,7 +81385,7 @@ module.exports = (input, options) => {
/***/ }),
-/* 699 */
+/* 703 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -81177,7 +81403,7 @@ module.exports = input => {
/***/ }),
-/* 700 */
+/* 704 */
/***/ (function(module, exports, __webpack_require__) {
/*!
@@ -81187,7 +81413,7 @@ module.exports = input => {
* Released under the MIT License.
*/
-var isExtglob = __webpack_require__(299);
+var isExtglob = __webpack_require__(294);
var chars = { '{': '}', '(': ')', '[': ']'};
var strictRegex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
var relaxedRegex = /\\(.)|(^!|[*?{}()[\]]|\(\?)/;
@@ -81231,17 +81457,17 @@ module.exports = function isGlob(str, options) {
/***/ }),
-/* 701 */
+/* 705 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const path = __webpack_require__(4);
const {constants: fsConstants} = __webpack_require__(133);
-const pEvent = __webpack_require__(702);
-const CpFileError = __webpack_require__(705);
-const fs = __webpack_require__(709);
-const ProgressEmitter = __webpack_require__(712);
+const pEvent = __webpack_require__(706);
+const CpFileError = __webpack_require__(709);
+const fs = __webpack_require__(713);
+const ProgressEmitter = __webpack_require__(716);
const cpFileAsync = async (source, destination, options, progressEmitter) => {
let readError;
@@ -81355,12 +81581,12 @@ module.exports.sync = (source, destination, options) => {
/***/ }),
-/* 702 */
+/* 706 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const pTimeout = __webpack_require__(703);
+const pTimeout = __webpack_require__(707);
const symbolAsyncIterator = Symbol.asyncIterator || '@@asyncIterator';
@@ -81651,12 +81877,12 @@ module.exports.iterator = (emitter, event, options) => {
/***/ }),
-/* 703 */
+/* 707 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const pFinally = __webpack_require__(704);
+const pFinally = __webpack_require__(708);
class TimeoutError extends Error {
constructor(message) {
@@ -81702,7 +81928,7 @@ module.exports.TimeoutError = TimeoutError;
/***/ }),
-/* 704 */
+/* 708 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -81724,12 +81950,12 @@ module.exports = (promise, onFinally) => {
/***/ }),
-/* 705 */
+/* 709 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const NestedError = __webpack_require__(706);
+const NestedError = __webpack_require__(710);
class CpFileError extends NestedError {
constructor(message, nested) {
@@ -81743,10 +81969,10 @@ module.exports = CpFileError;
/***/ }),
-/* 706 */
+/* 710 */
/***/ (function(module, exports, __webpack_require__) {
-var inherits = __webpack_require__(707);
+var inherits = __webpack_require__(711);
var NestedError = function (message, nested) {
this.nested = nested;
@@ -81797,7 +82023,7 @@ module.exports = NestedError;
/***/ }),
-/* 707 */
+/* 711 */
/***/ (function(module, exports, __webpack_require__) {
try {
@@ -81805,12 +82031,12 @@ try {
if (typeof util.inherits !== 'function') throw '';
module.exports = util.inherits;
} catch (e) {
- module.exports = __webpack_require__(708);
+ module.exports = __webpack_require__(712);
}
/***/ }),
-/* 708 */
+/* 712 */
/***/ (function(module, exports) {
if (typeof Object.create === 'function') {
@@ -81839,16 +82065,16 @@ if (typeof Object.create === 'function') {
/***/ }),
-/* 709 */
+/* 713 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const {promisify} = __webpack_require__(111);
const fs = __webpack_require__(132);
-const makeDir = __webpack_require__(710);
-const pEvent = __webpack_require__(702);
-const CpFileError = __webpack_require__(705);
+const makeDir = __webpack_require__(714);
+const pEvent = __webpack_require__(706);
+const CpFileError = __webpack_require__(709);
const stat = promisify(fs.stat);
const lstat = promisify(fs.lstat);
@@ -81945,7 +82171,7 @@ exports.copyFileSync = (source, destination, flags) => {
/***/ }),
-/* 710 */
+/* 714 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -81953,7 +82179,7 @@ exports.copyFileSync = (source, destination, flags) => {
const fs = __webpack_require__(133);
const path = __webpack_require__(4);
const {promisify} = __webpack_require__(111);
-const semver = __webpack_require__(711);
+const semver = __webpack_require__(715);
const useNativeRecursiveOption = semver.satisfies(process.version, '>=10.12.0');
@@ -82108,7 +82334,7 @@ module.exports.sync = (input, options) => {
/***/ }),
-/* 711 */
+/* 715 */
/***/ (function(module, exports) {
exports = module.exports = SemVer
@@ -83710,7 +83936,7 @@ function coerce (version, options) {
/***/ }),
-/* 712 */
+/* 716 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -83751,7 +83977,7 @@ module.exports = ProgressEmitter;
/***/ }),
-/* 713 */
+/* 717 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -83797,12 +84023,12 @@ exports.default = module.exports;
/***/ }),
-/* 714 */
+/* 718 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-const NestedError = __webpack_require__(715);
+const NestedError = __webpack_require__(719);
class CpyError extends NestedError {
constructor(message, nested) {
@@ -83816,7 +84042,7 @@ module.exports = CpyError;
/***/ }),
-/* 715 */
+/* 719 */
/***/ (function(module, exports, __webpack_require__) {
var inherits = __webpack_require__(111).inherits;
diff --git a/packages/kbn-pm/package.json b/packages/kbn-pm/package.json
index c2f9236d9e798..f4e9ee8249900 100644
--- a/packages/kbn-pm/package.json
+++ b/packages/kbn-pm/package.json
@@ -28,7 +28,7 @@
"@types/node": ">=10.17.17 <10.20.0",
"@types/ora": "^1.3.5",
"@types/read-pkg": "^4.0.0",
- "@types/strip-ansi": "^3.0.0",
+ "@types/strip-ansi": "^5.2.1",
"@types/strong-log-transformer": "^1.0.0",
"@types/tempy": "^0.2.0",
"@types/write-pkg": "^3.1.0",
@@ -50,13 +50,13 @@
"log-symbols": "^2.2.0",
"multimatch": "^4.0.0",
"ncp": "^2.0.0",
- "ora": "^1.4.0",
+ "ora": "^4.0.4",
"prettier": "^2.1.1",
"read-pkg": "^5.2.0",
"rxjs": "^6.5.5",
"spawn-sync": "^1.0.15",
"string-replace-loader": "^2.2.0",
- "strip-ansi": "^4.0.0",
+ "strip-ansi": "^6.0.0",
"strong-log-transformer": "^2.1.0",
"tempy": "^0.3.0",
"typescript": "4.0.2",
diff --git a/packages/kbn-pm/src/utils/validate_yarn_lock.ts b/packages/kbn-pm/src/utils/validate_yarn_lock.ts
index e110dc4d921cf..ec853a3a958fb 100644
--- a/packages/kbn-pm/src/utils/validate_yarn_lock.ts
+++ b/packages/kbn-pm/src/utils/validate_yarn_lock.ts
@@ -25,6 +25,7 @@ import { writeFile } from './fs';
import { Kibana } from './kibana';
import { YarnLock } from './yarn_lock';
import { log } from './log';
+import { Project } from './project';
export async function validateYarnLock(kbn: Kibana, yarnLock: YarnLock) {
// look through all of the packages in the yarn.lock file to see if
@@ -95,5 +96,66 @@ export async function validateYarnLock(kbn: Kibana, yarnLock: YarnLock) {
process.exit(1);
}
+ // TODO: remove this once we move into a single package.json
+ // look through all the package.json files to find packages which have mismatched version ranges
+ const depRanges = new Map>();
+ for (const project of kbn.getAllProjects().values()) {
+ for (const [dep, range] of Object.entries(project.allDependencies)) {
+ const existingDep = depRanges.get(dep);
+ if (!existingDep) {
+ depRanges.set(dep, [
+ {
+ range,
+ projects: [project],
+ },
+ ]);
+ continue;
+ }
+
+ const existingRange = existingDep.find((existing) => existing.range === range);
+ if (!existingRange) {
+ existingDep.push({
+ range,
+ projects: [project],
+ });
+ continue;
+ }
+
+ existingRange.projects.push(project);
+ }
+ }
+
+ const duplicateRanges = Array.from(depRanges.entries())
+ .filter(([, ranges]) => ranges.length > 1)
+ .reduce(
+ (acc: string[], [dep, ranges]) => [
+ ...acc,
+ dep,
+ ...ranges.map(
+ ({ range, projects }) => ` ${range} => ${projects.map((p) => p.name).join(', ')}`
+ ),
+ ],
+ []
+ )
+ .join('\n ');
+
+ if (duplicateRanges) {
+ log.error(dedent`
+
+ [single_version_dependencies] Multiple version ranges for the same dependency
+ were found declared across different package.json files. Please consolidate
+ those to match across all package.json files. Different versions for the
+ same dependency is not supported.
+
+ If you have questions about this please reach out to the operations team.
+
+ The conflicting dependencies are:
+
+ ${duplicateRanges}
+ `);
+
+ process.exit(1);
+ }
+
log.success('yarn.lock analysis completed without any issues');
}
diff --git a/packages/kbn-release-notes/package.json b/packages/kbn-release-notes/package.json
index f8971fa02aa87..268530c22399a 100644
--- a/packages/kbn-release-notes/package.json
+++ b/packages/kbn-release-notes/package.json
@@ -13,7 +13,7 @@
"axios": "^0.19.2",
"cheerio": "0.22.0",
"dedent": "^0.7.0",
- "graphql": "^14.0.0",
+ "graphql": "^0.13.2",
"graphql-tag": "^2.10.3",
"terminal-link": "^2.1.1"
},
diff --git a/packages/kbn-storybook/package.json b/packages/kbn-storybook/package.json
index 05fdb8489a1c3..58359159e950d 100644
--- a/packages/kbn-storybook/package.json
+++ b/packages/kbn-storybook/package.json
@@ -13,8 +13,8 @@
"@storybook/core": "^6.0.16",
"@storybook/react": "^6.0.16",
"@storybook/theming": "^6.0.16",
- "@types/loader-utils": "^2.0.1",
- "@types/webpack": "^4.41.5",
+ "@types/loader-utils": "^1.1.3",
+ "@types/webpack": "^4.41.3",
"@types/webpack-env": "^1.15.2",
"@types/webpack-merge": "^4.1.5",
"@kbn/utils": "1.0.0",
diff --git a/packages/kbn-storybook/webpack.config.ts b/packages/kbn-storybook/webpack.config.ts
index 98fca597ffd78..84f8cfaefd669 100644
--- a/packages/kbn-storybook/webpack.config.ts
+++ b/packages/kbn-storybook/webpack.config.ts
@@ -100,9 +100,5 @@ export default function ({ config: storybookConfig }: { config: Configuration })
if (htmlWebpackPlugin) {
htmlWebpackPlugin.options.template = require.resolve('../lib/templates/index.ejs');
}
-
- // @ts-expect-error There's a long error here about the types of the
- // incompatibility of Configuration, but it looks like it just may be Webpack
- // type definition related.
return webpackMerge(storybookConfig, config);
}
diff --git a/packages/kbn-telemetry-tools/src/tools/serializer.test.ts b/packages/kbn-telemetry-tools/src/tools/serializer.test.ts
index 652b26c8edb23..85fb84c714e20 100644
--- a/packages/kbn-telemetry-tools/src/tools/serializer.test.ts
+++ b/packages/kbn-telemetry-tools/src/tools/serializer.test.ts
@@ -138,4 +138,22 @@ describe('getDescriptor', () => {
},
});
});
+
+ it('serializes RecordWithKnownProps', () => {
+ const usageInterface = usageInterfaces.get('RecordWithKnownProps')!;
+ const descriptor = getDescriptor(usageInterface, tsProgram);
+ expect(descriptor).toEqual({
+ prop1: { kind: ts.SyntaxKind.NumberKeyword, type: 'NumberKeyword' },
+ prop2: { kind: ts.SyntaxKind.NumberKeyword, type: 'NumberKeyword' },
+ });
+ });
+
+ it('serializes IndexedAccessType', () => {
+ const usageInterface = usageInterfaces.get('IndexedAccessType')!;
+ const descriptor = getDescriptor(usageInterface, tsProgram);
+ expect(descriptor).toEqual({
+ prop1: { kind: ts.SyntaxKind.StringKeyword, type: 'StringKeyword' },
+ prop2: { kind: ts.SyntaxKind.StringKeyword, type: 'StringKeyword' },
+ });
+ });
});
diff --git a/packages/kbn-telemetry-tools/src/tools/serializer.ts b/packages/kbn-telemetry-tools/src/tools/serializer.ts
index cd845a680ad06..ea5f184008026 100644
--- a/packages/kbn-telemetry-tools/src/tools/serializer.ts
+++ b/packages/kbn-telemetry-tools/src/tools/serializer.ts
@@ -18,7 +18,7 @@
*/
import * as ts from 'typescript';
-import { uniqBy } from 'lodash';
+import { uniqBy, pick } from 'lodash';
import {
getResolvedModuleSourceFile,
getIdentifierDeclarationFromSource,
@@ -95,7 +95,16 @@ export function getConstraints(node: ts.Node, program: ts.Program): any {
return node.literal.text;
}
- throw Error(`Unsupported constraint`);
+ if (ts.isImportSpecifier(node)) {
+ const source = node.getSourceFile();
+ const importedModuleName = getModuleSpecifier(node);
+
+ const declarationSource = getResolvedModuleSourceFile(source, program, importedModuleName);
+ const declarationNode = getIdentifierDeclarationFromSource(node.name, declarationSource);
+ return getConstraints(declarationNode, program);
+ }
+
+ throw Error(`Unsupported constraint of kind ${node.kind} [${ts.SyntaxKind[node.kind]}]`);
}
export function getDescriptor(node: ts.Node, program: ts.Program): Descriptor | DescriptorValue {
@@ -157,9 +166,25 @@ export function getDescriptor(node: ts.Node, program: ts.Program): Descriptor |
return { kind: TelemetryKinds.Date, type: 'Date' };
}
// Support `Record`
- if (symbolName === 'Record' && node.typeArguments![0].kind === ts.SyntaxKind.StringKeyword) {
- return { '@@INDEX@@': getDescriptor(node.typeArguments![1], program) };
+ if (symbolName === 'Record') {
+ const descriptor = getDescriptor(node.typeArguments![1], program);
+ if (node.typeArguments![0].kind === ts.SyntaxKind.StringKeyword) {
+ return { '@@INDEX@@': descriptor };
+ }
+ const constraints = getConstraints(node.typeArguments![0], program);
+ const constraintsArray = Array.isArray(constraints) ? constraints : [constraints];
+ if (typeof constraintsArray[0] === 'string') {
+ return constraintsArray.reduce((acc, c) => ({ ...acc, [c]: descriptor }), {});
+ }
+ }
+
+ // Support `Pick`
+ if (symbolName === 'Pick') {
+ const parentDescriptor = getDescriptor(node.typeArguments![0], program);
+ const pickPropNames = getConstraints(node.typeArguments![1], program);
+ return pick(parentDescriptor, pickPropNames);
}
+
const declaration = (symbol?.getDeclarations() || [])[0];
if (declaration) {
return getDescriptor(declaration, program);
diff --git a/packages/kbn-telemetry-tools/src/tools/utils.ts b/packages/kbn-telemetry-tools/src/tools/utils.ts
index 947a4f66908f6..90ba7f4d9168f 100644
--- a/packages/kbn-telemetry-tools/src/tools/utils.ts
+++ b/packages/kbn-telemetry-tools/src/tools/utils.ts
@@ -78,14 +78,14 @@ export function getIdentifierDeclarationFromSource(node: ts.Node, source: ts.Sou
const identifierName = node.getText();
const identifierDefinition: ts.Node = (source as any).locals.get(identifierName);
if (!identifierDefinition) {
- throw new Error(`Unable to fine identifier in source ${identifierName}`);
+ throw new Error(`Unable to find identifier in source ${identifierName}`);
}
const declarations = (identifierDefinition as any).declarations as ts.Node[];
const latestDeclaration: ts.Node | false | undefined =
Array.isArray(declarations) && declarations[declarations.length - 1];
if (!latestDeclaration) {
- throw new Error(`Unable to fine declaration for identifier ${identifierName}`);
+ throw new Error(`Unable to find declaration for identifier ${identifierName}`);
}
return latestDeclaration;
diff --git a/packages/kbn-test/package.json b/packages/kbn-test/package.json
index c616c836d5ff4..4e86ec4bd72e0 100644
--- a/packages/kbn-test/package.json
+++ b/packages/kbn-test/package.json
@@ -32,7 +32,7 @@
"lodash": "^4.17.20",
"parse-link-header": "^1.0.1",
"rxjs": "^6.5.5",
- "strip-ansi": "^5.2.0",
+ "strip-ansi": "^6.0.0",
"tar-fs": "^2.1.0",
"xml2js": "^0.4.22",
"zlib": "^1.0.5"
diff --git a/packages/kbn-ui-framework/package.json b/packages/kbn-ui-framework/package.json
index be18b7cfc0d01..676985fa24740 100644
--- a/packages/kbn-ui-framework/package.json
+++ b/packages/kbn-ui-framework/package.json
@@ -58,10 +58,10 @@
"postcss-loader": "^3.0.0",
"raw-loader": "^3.1.0",
"react-dom": "^16.12.0",
- "react-redux": "^5.1.2",
- "react-router": "^3.2.0",
+ "react-redux": "^7.2.0",
+ "react-router": "^5.2.0",
"react-router-redux": "^4.0.8",
- "redux": "3.7.2",
+ "redux": "^4.0.5",
"redux-thunk": "^2.3.0",
"regenerator-runtime": "^0.13.3",
"sass-loader": "^8.0.2",
diff --git a/packages/kbn-ui-shared-deps/package.json b/packages/kbn-ui-shared-deps/package.json
index 278e8efd2d29e..e5f1a06e5bffa 100644
--- a/packages/kbn-ui-shared-deps/package.json
+++ b/packages/kbn-ui-shared-deps/package.json
@@ -9,7 +9,7 @@
"kbn:watch": "node scripts/build --dev --watch"
},
"dependencies": {
- "@elastic/charts": "21.1.2",
+ "@elastic/charts": "23.0.0",
"@elastic/eui": "29.0.0",
"@elastic/numeral": "^2.5.0",
"@kbn/i18n": "1.0.0",
diff --git a/src/core/public/doc_links/doc_links_service.ts b/src/core/public/doc_links/doc_links_service.ts
index 47f58a3a9fcbf..629bf97c24887 100644
--- a/src/core/public/doc_links/doc_links_service.ts
+++ b/src/core/public/doc_links/doc_links_service.ts
@@ -119,6 +119,7 @@ export class DocLinksService {
gettingStarted: `${ELASTIC_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/index.html`,
},
query: {
+ eql: `${ELASTICSEARCH_DOCS}eql.html`,
luceneQuerySyntax: `${ELASTICSEARCH_DOCS}query-dsl-query-string-query.html#query-string-syntax`,
queryDsl: `${ELASTICSEARCH_DOCS}query-dsl.html`,
kueryQuerySyntax: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kuery-query.html`,
@@ -227,6 +228,7 @@ export interface DocLinksStart {
readonly gettingStarted: string;
};
readonly query: {
+ readonly eql: string;
readonly luceneQuerySyntax: string;
readonly queryDsl: string;
readonly kueryQuerySyntax: string;
diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md
index 5970c9a8571c4..08491dc76cd27 100644
--- a/src/core/public/public.api.md
+++ b/src/core/public/public.api.md
@@ -539,6 +539,7 @@ export interface DocLinksStart {
readonly gettingStarted: string;
};
readonly query: {
+ readonly eql: string;
readonly luceneQuerySyntax: string;
readonly queryDsl: string;
readonly kueryQuerySyntax: string;
diff --git a/src/dev/build/tasks/os_packages/docker_generator/resources/bin/kibana-docker b/src/dev/build/tasks/os_packages/docker_generator/resources/bin/kibana-docker
index 2770f288b6af8..959e1f8dc3e72 100755
--- a/src/dev/build/tasks/os_packages/docker_generator/resources/bin/kibana-docker
+++ b/src/dev/build/tasks/os_packages/docker_generator/resources/bin/kibana-docker
@@ -159,6 +159,7 @@ kibana_vars=(
xpack.code.security.gitHostWhitelist
xpack.code.security.gitProtocolWhitelist
xpack.encryptedSavedObjects.encryptionKey
+ xpack.encryptedSavedObjects.keyRotation.decryptionOnlyKeys
xpack.graph.enabled
xpack.graph.canEditDrillDownUrls
xpack.graph.savePolicy
diff --git a/src/fixtures/telemetry_collectors/constants.ts b/src/fixtures/telemetry_collectors/constants.ts
index 60df05bac2aeb..8896c294676c4 100644
--- a/src/fixtures/telemetry_collectors/constants.ts
+++ b/src/fixtures/telemetry_collectors/constants.ts
@@ -66,3 +66,7 @@ export interface MappedTypes {
[key in 'prop3']: number;
};
}
+
+export type RecordWithKnownProps = Record;
+
+export type IndexedAccessType = Pick;
diff --git a/src/plugins/dashboard/public/application/top_nav/get_top_nav_config.ts b/src/plugins/dashboard/public/application/top_nav/get_top_nav_config.ts
index dbdadeb4e4e7c..77c4a2235d471 100644
--- a/src/plugins/dashboard/public/application/top_nav/get_top_nav_config.ts
+++ b/src/plugins/dashboard/public/application/top_nav/get_top_nav_config.ts
@@ -48,12 +48,12 @@ export function getTopNavConfig(
];
case ViewMode.EDIT:
return [
- getCreateNewConfig(actions[TopNavIds.VISUALIZE]),
- getSaveConfig(actions[TopNavIds.SAVE]),
- getViewConfig(actions[TopNavIds.EXIT_EDIT_MODE]),
- getAddConfig(actions[TopNavIds.ADD_EXISTING]),
getOptionsConfig(actions[TopNavIds.OPTIONS]),
getShareConfig(actions[TopNavIds.SHARE]),
+ getAddConfig(actions[TopNavIds.ADD_EXISTING]),
+ getViewConfig(actions[TopNavIds.EXIT_EDIT_MODE]),
+ getSaveConfig(actions[TopNavIds.SAVE]),
+ getCreateNewConfig(actions[TopNavIds.VISUALIZE]),
];
default:
return [];
@@ -79,7 +79,9 @@ function getFullScreenConfig(action: NavAction) {
*/
function getEditConfig(action: NavAction) {
return {
+ emphasize: true,
id: 'edit',
+ iconType: 'pencil',
label: i18n.translate('dashboard.topNave.editButtonAriaLabel', {
defaultMessage: 'edit',
}),
@@ -168,7 +170,7 @@ function getAddConfig(action: NavAction) {
function getCreateNewConfig(action: NavAction) {
return {
emphasize: true,
- iconType: 'plusInCircle',
+ iconType: 'plusInCircleFilled',
id: 'addNew',
label: i18n.translate('dashboard.topNave.addNewButtonAriaLabel', {
defaultMessage: 'Create new',
diff --git a/src/plugins/discover/public/application/angular/context/api/_stubs.js b/src/plugins/discover/public/application/angular/context/api/_stubs.js
index 35ddf396c2dba..d82189db60935 100644
--- a/src/plugins/discover/public/application/angular/context/api/_stubs.js
+++ b/src/plugins/discover/public/application/angular/context/api/_stubs.js
@@ -74,7 +74,7 @@ export function createContextSearchSourceStub(hits, timeField = '@timestamp') {
searchSourceStub.fetch = sinon.spy(() => {
const timeField = searchSourceStub._stubTimeField;
const lastQuery = searchSourceStub.setField.withArgs('query').lastCall.args[1];
- const timeRange = lastQuery.query.constant_score.filter.range[timeField];
+ const timeRange = lastQuery.query.bool.must.constant_score.filter.range[timeField];
const lastSort = searchSourceStub.setField.withArgs('sort').lastCall.args[1];
const sortDirection = lastSort[0][timeField];
const sortFunction =
diff --git a/src/plugins/discover/public/application/angular/context/api/context.predecessors.test.js b/src/plugins/discover/public/application/angular/context/api/context.predecessors.test.js
index 4987c77f4bf25..4c0515906a494 100644
--- a/src/plugins/discover/public/application/angular/context/api/context.predecessors.test.js
+++ b/src/plugins/discover/public/application/angular/context/api/context.predecessors.test.js
@@ -124,7 +124,9 @@ describe('context app', function () {
).then((hits) => {
const intervals = mockSearchSource.setField.args
.filter(([property]) => property === 'query')
- .map(([, { query }]) => get(query, ['constant_score', 'filter', 'range', '@timestamp']));
+ .map(([, { query }]) =>
+ get(query, ['bool', 'must', 'constant_score', 'filter', 'range', '@timestamp'])
+ );
expect(
intervals.every(({ gte, lte }) => (gte && lte ? moment(gte).isBefore(lte) : true))
@@ -160,7 +162,9 @@ describe('context app', function () {
).then((hits) => {
const intervals = mockSearchSource.setField.args
.filter(([property]) => property === 'query')
- .map(([, { query }]) => get(query, ['constant_score', 'filter', 'range', '@timestamp']));
+ .map(([, { query }]) =>
+ get(query, ['bool', 'must', 'constant_score', 'filter', 'range', '@timestamp'])
+ );
// should have started at the given time
expect(intervals[0].gte).toEqual(moment(MS_PER_DAY * 1000).toISOString());
diff --git a/src/plugins/discover/public/application/angular/context/api/context.successors.test.js b/src/plugins/discover/public/application/angular/context/api/context.successors.test.js
index ebf6e78585962..285d39cd4d8a4 100644
--- a/src/plugins/discover/public/application/angular/context/api/context.successors.test.js
+++ b/src/plugins/discover/public/application/angular/context/api/context.successors.test.js
@@ -125,7 +125,9 @@ describe('context app', function () {
).then((hits) => {
const intervals = mockSearchSource.setField.args
.filter(([property]) => property === 'query')
- .map(([, { query }]) => get(query, ['constant_score', 'filter', 'range', '@timestamp']));
+ .map(([, { query }]) =>
+ get(query, ['bool', 'must', 'constant_score', 'filter', 'range', '@timestamp'])
+ );
expect(
intervals.every(({ gte, lte }) => (gte && lte ? moment(gte).isBefore(lte) : true))
@@ -163,7 +165,9 @@ describe('context app', function () {
).then((hits) => {
const intervals = mockSearchSource.setField.args
.filter(([property]) => property === 'query')
- .map(([, { query }]) => get(query, ['constant_score', 'filter', 'range', '@timestamp']));
+ .map(([, { query }]) =>
+ get(query, ['bool', 'must', 'constant_score', 'filter', 'range', '@timestamp'])
+ );
// should have started at the given time
expect(intervals[0].lte).toEqual(moment(MS_PER_DAY * 3000).toISOString());
diff --git a/src/plugins/discover/public/application/angular/context/api/context.ts b/src/plugins/discover/public/application/angular/context/api/context.ts
index e244176914a9b..ba8cffd1d7558 100644
--- a/src/plugins/discover/public/application/angular/context/api/context.ts
+++ b/src/plugins/discover/public/application/angular/context/api/context.ts
@@ -31,6 +31,7 @@ export interface EsHitRecord {
fields: Record;
sort: number[];
_source: Record;
+ _id: string;
}
export type EsHitRecordList = EsHitRecord[];
@@ -100,7 +101,8 @@ function fetchContextProvider(indexPatterns: IndexPatternsContract) {
interval,
searchAfter,
remainingSize,
- nanos
+ nanos,
+ anchor._id
);
documents =
diff --git a/src/plugins/discover/public/application/angular/context/api/utils/fetch_hits_in_interval.ts b/src/plugins/discover/public/application/angular/context/api/utils/fetch_hits_in_interval.ts
index 9a199ea4a62fc..5ac4164191633 100644
--- a/src/plugins/discover/public/application/angular/context/api/utils/fetch_hits_in_interval.ts
+++ b/src/plugins/discover/public/application/angular/context/api/utils/fetch_hits_in_interval.ts
@@ -43,7 +43,8 @@ export async function fetchHitsInInterval(
interval: IntervalValue[],
searchAfter: EsQuerySearchAfter,
maxCount: number,
- nanosValue: string
+ nanosValue: string,
+ anchorId: string
): Promise {
const range: RangeQuery = {
format: 'strict_date_optional_time',
@@ -61,10 +62,19 @@ export async function fetchHitsInInterval(
.setField('size', maxCount)
.setField('query', {
query: {
- constant_score: {
- filter: {
- range: {
- [timeField]: range,
+ bool: {
+ must: {
+ constant_score: {
+ filter: {
+ range: {
+ [timeField]: range,
+ },
+ },
+ },
+ },
+ must_not: {
+ ids: {
+ values: [anchorId],
},
},
},
diff --git a/src/plugins/embeddable/public/lib/panel/_embeddable_panel.scss b/src/plugins/embeddable/public/lib/panel/_embeddable_panel.scss
index 36a7fee14cce1..cdc0f9f0e0451 100644
--- a/src/plugins/embeddable/public/lib/panel/_embeddable_panel.scss
+++ b/src/plugins/embeddable/public/lib/panel/_embeddable_panel.scss
@@ -54,9 +54,14 @@
.embPanel__titleInner {
overflow: hidden;
display: flex;
+ align-items: center;
padding-right: $euiSizeS;
}
+ .embPanel__titleTooltipAnchor {
+ max-width: 100%;
+ }
+
.embPanel__titleText {
@include euiTextTruncate;
}
diff --git a/src/plugins/embeddable/public/lib/panel/panel_header/panel_header.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_header.tsx
index c538b98949a43..ea6a6a78c2b67 100644
--- a/src/plugins/embeddable/public/lib/panel/panel_header/panel_header.tsx
+++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_header.tsx
@@ -99,16 +99,6 @@ function renderNotifications(
});
}
-function renderTooltip(description: string) {
- return (
- description !== '' && (
-
-
-
- )
- );
-}
-
type EmbeddableWithDescription = IEmbeddable & { getDescription: () => string };
function getViewDescription(embeddable: IEmbeddable | EmbeddableWithDescription) {
@@ -134,9 +124,10 @@ export function PanelHeader({
embeddable,
headerId,
}: PanelHeaderProps) {
- const viewDescription = getViewDescription(embeddable);
- const showTitle = !hidePanelTitle && (!isViewMode || title || viewDescription !== '');
- const showPanelBar = !isViewMode || badges.length > 0 || notifications.length > 0 || showTitle;
+ const description = getViewDescription(embeddable);
+ const showTitle = !hidePanelTitle && (!isViewMode || title);
+ const showPanelBar =
+ !isViewMode || badges.length > 0 || notifications.length > 0 || showTitle || description;
const classes = classNames('embPanel__header', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'embPanel__header--floater': !showPanelBar,
@@ -174,26 +165,36 @@ export function PanelHeader({
);
}
+ const renderTitle = () => {
+ const titleComponent = showTitle ? (
+
+ {title || placeholderTitle}
+
+ ) : undefined;
+ return description ? (
+
+
+ {titleComponent}
+
+
+ ) : (
+ titleComponent
+ );
+ };
+
return (
- {showTitle ? (
-
-
- {title || placeholderTitle}
-
- {getAriaLabel()}
- {renderTooltip(viewDescription)}
-
- ) : (
- {getAriaLabel()}
- )}
+ {getAriaLabel()}
+ {renderTitle()}
{renderBadges(badges, embeddable)}
{renderNotifications(notifications, embeddable)}
diff --git a/src/plugins/home/public/application/components/app_navigation_handler.ts b/src/plugins/home/public/application/components/app_navigation_handler.ts
index 91407ffcaf226..b6230bc9f1e38 100644
--- a/src/plugins/home/public/application/components/app_navigation_handler.ts
+++ b/src/plugins/home/public/application/components/app_navigation_handler.ts
@@ -24,6 +24,7 @@ export const createAppNavigationHandler = (targetUrl: string) => (event: MouseEv
if (event.altKey || event.metaKey || event.ctrlKey) {
return;
}
+ const { application, addBasePath } = getServices();
event.preventDefault();
- getServices().application.navigateToUrl(targetUrl);
+ application.navigateToUrl(addBasePath(targetUrl));
};
diff --git a/src/plugins/navigation/public/top_nav_menu/__snapshots__/top_nav_menu_item.test.tsx.snap b/src/plugins/navigation/public/top_nav_menu/__snapshots__/top_nav_menu_item.test.tsx.snap
index 570699aa0c0e2..155377e5ea335 100644
--- a/src/plugins/navigation/public/top_nav_menu/__snapshots__/top_nav_menu_item.test.tsx.snap
+++ b/src/plugins/navigation/public/top_nav_menu/__snapshots__/top_nav_menu_item.test.tsx.snap
@@ -2,7 +2,6 @@
exports[`TopNavMenu Should render emphasized item which should be clickable 1`] = `
* > * {
// TEMP fix to adjust spacing between EuiHeaderList__list items
margin: 0 $euiSizeXS;
diff --git a/src/plugins/navigation/public/top_nav_menu/top_nav_menu_item.tsx b/src/plugins/navigation/public/top_nav_menu/top_nav_menu_item.tsx
index 96a205b737273..e503ebb839f48 100644
--- a/src/plugins/navigation/public/top_nav_menu/top_nav_menu_item.tsx
+++ b/src/plugins/navigation/public/top_nav_menu/top_nav_menu_item.tsx
@@ -48,7 +48,7 @@ export function TopNavMenuItem(props: TopNavMenuData) {
};
const btn = props.emphasize ? (
-
+
{upperFirst(props.label || props.id!)}
) : (
diff --git a/src/plugins/telemetry_management_section/README.md b/src/plugins/telemetry_management_section/README.md
index 0f795786720c9..c23a8591f6794 100644
--- a/src/plugins/telemetry_management_section/README.md
+++ b/src/plugins/telemetry_management_section/README.md
@@ -1,5 +1,5 @@
# Telemetry Management Section
-This plugin adds the Advanced Settings section for the Usage Data collection (aka Telemetry).
+This plugin adds the Advanced Settings section for the Usage and Security Data collection (aka Telemetry).
The reason for having it separated from the `telemetry` plugin is to avoid circular dependencies. The plugin `advancedSettings` depends on the `home` app that depends on the `telemetry` plugin because of the telemetry banner in the welcome screen.
diff --git a/src/plugins/telemetry_management_section/public/components/__snapshots__/opt_in_security_example_flyout.test.tsx.snap b/src/plugins/telemetry_management_section/public/components/__snapshots__/opt_in_security_example_flyout.test.tsx.snap
new file mode 100644
index 0000000000000..0b9d426008ca4
--- /dev/null
+++ b/src/plugins/telemetry_management_section/public/components/__snapshots__/opt_in_security_example_flyout.test.tsx.snap
@@ -0,0 +1,134 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`security flyout renders as expected renders as expected 1`] = `
+
+
+
+
+
+ Endpoint security data
+
+
+
+
+ This is a representative sample of the endpoint security alert event that we collect. Endpoint security data is collected only when the Elastic Endpoint is enabled. It includes information about the endpoint configuration and detection events.
+
+
+
+
+
+ {
+ "@timestamp": "2020-09-22T14:34:56.82202300Z",
+ "agent": {
+ "build": {
+ "original": "version: 7.9.1, compiled: Thu Aug 27 14:50:21 2020, branch: 7.9, commit: b594beb958817dee9b9d908191ed766d483df3ea"
+ },
+ "id": "22dd8544-bcac-46cb-b970-5e681bb99e0b",
+ "type": "endpoint",
+ "version": "7.9.1"
+ },
+ "Endpoint": {
+ "policy": {
+ "applied": {
+ "artifacts": {
+ "global": {
+ "identifiers": [
+ {
+ "sha256": "6a546aade5563d3e8dffc1fe2d93d33edda8f9ca3e17ac3cc9ac707620cb9ecd",
+ "name": "endpointpe-v4-blocklist"
+ },
+ {
+ "sha256": "04f9f87accc5d5aea433427bd1bd4ec6908f8528c78ceed26f70df7875a99385",
+ "name": "endpointpe-v4-exceptionlist"
+ },
+ {
+ "sha256": "1471838597fcd79a54ea4a3ec9a9beee1a86feaedab6c98e61102559ced822a8",
+ "name": "endpointpe-v4-model"
+ },
+ {
+ "sha256": "824859b0c6749cc31951d92a73bbdddfcfe9f38abfe432087934d4dab9766ce8",
+ "name": "global-exceptionlist-windows"
+ }
+ ],
+ "version": "1.0.0"
+ },
+ "user": {
+ "identifiers": [
+ {
+ "sha256": "d801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658",
+ "name": "endpoint-exceptionlist-windows-v1"
+ }
+ ],
+ "version": "1.0.0"
+ }
+ }
+ }
+ }
+ },
+ "ecs": {
+ "version": "1.5.0"
+ },
+ "elastic": {
+ "agent": {
+ "id": "b2e88aea-2671-402a-828a-957526bac315"
+ }
+ },
+ "file": {
+ "path": "C:\\\\Windows\\\\Temp\\\\mimikatz.exe",
+ "size": 1263880,
+ "created": "2020-05-19T07:50:06.0Z",
+ "accessed": "2020-09-22T14:29:19.93531400Z",
+ "mtime": "2020-09-22T14:29:03.6040000Z",
+ "directory": "C:\\\\Windows\\\\Temp",
+ "hash": {
+ "sha1": "c9fb7f8a4c6b7b12b493a99a8dc6901d17867388",
+ "sha256": "cb1553a3c88817e4cc774a5a93f9158f6785bd3815447d04b6c3f4c2c4b21ed7",
+ "md5": "465d5d850f54d9cde767bda90743df30"
+ },
+ "Ext": {
+ "code_signature": {
+ "trusted": true,
+ "subject_name": "Open Source Developer, Benjamin Delpy",
+ "exists": true,
+ "status": "trusted"
+ },
+ "malware_classification": {
+ "identifier": "endpointpe-v4-model",
+ "score": 0.99956864118576,
+ "threshold": 0.71,
+ "version": "0.0.0"
+ }
+ }
+ },
+ "host": {
+ "os": {
+ "Ext": {
+ "variant": "Windows 10 Enterprise Evaluation"
+ },
+ "kernel": "2004 (10.0.19041.388)",
+ "name": "Windows",
+ "family": "windows",
+ "version": "2004 (10.0.19041.388)",
+ "platform": "windows",
+ "full": "Windows 10 Enterprise Evaluation 2004 (10.0.19041.388)"
+ }
+ },
+ "event": {
+ "kind": "alert"
+ },
+ "cluster_uuid": "kLbKvSMcRiiFAR0t8LebDA",
+ "cluster_name": "elasticsearch"
+}
+
+
+
+
+`;
diff --git a/src/plugins/telemetry_management_section/public/components/__snapshots__/telemetry_management_section.test.tsx.snap b/src/plugins/telemetry_management_section/public/components/__snapshots__/telemetry_management_section.test.tsx.snap
index bed1bbeabb044..7357598c8495f 100644
--- a/src/plugins/telemetry_management_section/public/components/__snapshots__/telemetry_management_section.test.tsx.snap
+++ b/src/plugins/telemetry_management_section/public/components/__snapshots__/telemetry_management_section.test.tsx.snap
@@ -80,15 +80,32 @@ exports[`TelemetryManagementSectionComponent renders as expected 1`] = `
/>
-
-
-
+
+
+ ,
+ "endpointSecurityData":
+
+ ,
+ }
+ }
+ />
,
"displayName": "Provide usage statistics",
diff --git a/src/plugins/telemetry_management_section/public/components/opt_in_security_example_flyout.test.tsx b/src/plugins/telemetry_management_section/public/components/opt_in_security_example_flyout.test.tsx
new file mode 100644
index 0000000000000..c80d0daf5a695
--- /dev/null
+++ b/src/plugins/telemetry_management_section/public/components/opt_in_security_example_flyout.test.tsx
@@ -0,0 +1,27 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import React from 'react';
+import { shallowWithIntl } from 'test_utils/enzyme_helpers';
+import { OptInSecurityExampleFlyout } from './opt_in_security_example_flyout';
+
+describe('security flyout renders as expected', () => {
+ it('renders as expected', () => {
+ expect(shallowWithIntl( )).toMatchSnapshot();
+ });
+});
diff --git a/src/plugins/telemetry_management_section/public/components/opt_in_security_example_flyout.tsx b/src/plugins/telemetry_management_section/public/components/opt_in_security_example_flyout.tsx
new file mode 100644
index 0000000000000..af0de5b268ddc
--- /dev/null
+++ b/src/plugins/telemetry_management_section/public/components/opt_in_security_example_flyout.tsx
@@ -0,0 +1,235 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import * as React from 'react';
+
+import {
+ EuiCallOut,
+ EuiCodeBlock,
+ EuiFlexGroup,
+ EuiFlexItem,
+ EuiFlyout,
+ EuiFlyoutHeader,
+ EuiFlyoutBody,
+ EuiLoadingSpinner,
+ EuiPortal, // EuiPortal is a temporary requirement to use EuiFlyout with "ownFocus"
+ EuiText,
+ EuiTextColor,
+ EuiTitle,
+} from '@elastic/eui';
+
+import { FormattedMessage } from '@kbn/i18n/react';
+
+interface Props {
+ onClose: () => void;
+}
+
+interface State {
+ isLoading: boolean;
+ hasPrivilegeToRead: boolean;
+}
+
+/**
+ * React component for displaying the example data associated with the Telemetry opt-in banner.
+ */
+export class OptInSecurityExampleFlyout extends React.PureComponent {
+ public readonly state: State = {
+ isLoading: true,
+ hasPrivilegeToRead: false,
+ };
+
+ async componentDidMount() {
+ try {
+ this.setState({
+ isLoading: false,
+ hasPrivilegeToRead: true,
+ });
+ } catch (err) {
+ this.setState({
+ isLoading: false,
+ hasPrivilegeToRead: err.status !== 403,
+ });
+ }
+ }
+
+ renderBody({ isLoading, hasPrivilegeToRead }: State) {
+ if (isLoading) {
+ return (
+
+
+
+
+
+ );
+ }
+
+ if (!hasPrivilegeToRead) {
+ return (
+
+ }
+ color="danger"
+ iconType="cross"
+ >
+
+
+ );
+ }
+
+ return (
+
+ {JSON.stringify(this.exampleSecurityPayload, null, 2)}
+
+ );
+ }
+
+ render() {
+ return (
+
+
+
+
+ Endpoint security data
+
+
+
+ This is a representative sample of the endpoint security alert event that we
+ collect. Endpoint security data is collected only when the Elastic Endpoint is
+ enabled. It includes information about the endpoint configuration and detection
+ events.
+
+
+
+ {this.renderBody(this.state)}
+
+
+ );
+ }
+
+ exampleSecurityPayload = {
+ '@timestamp': '2020-09-22T14:34:56.82202300Z',
+ agent: {
+ build: {
+ original:
+ 'version: 7.9.1, compiled: Thu Aug 27 14:50:21 2020, branch: 7.9, commit: b594beb958817dee9b9d908191ed766d483df3ea',
+ },
+ id: '22dd8544-bcac-46cb-b970-5e681bb99e0b',
+ type: 'endpoint',
+ version: '7.9.1',
+ },
+ Endpoint: {
+ policy: {
+ applied: {
+ artifacts: {
+ global: {
+ identifiers: [
+ {
+ sha256: '6a546aade5563d3e8dffc1fe2d93d33edda8f9ca3e17ac3cc9ac707620cb9ecd',
+ name: 'endpointpe-v4-blocklist',
+ },
+ {
+ sha256: '04f9f87accc5d5aea433427bd1bd4ec6908f8528c78ceed26f70df7875a99385',
+ name: 'endpointpe-v4-exceptionlist',
+ },
+ {
+ sha256: '1471838597fcd79a54ea4a3ec9a9beee1a86feaedab6c98e61102559ced822a8',
+ name: 'endpointpe-v4-model',
+ },
+ {
+ sha256: '824859b0c6749cc31951d92a73bbdddfcfe9f38abfe432087934d4dab9766ce8',
+ name: 'global-exceptionlist-windows',
+ },
+ ],
+ version: '1.0.0',
+ },
+ user: {
+ identifiers: [
+ {
+ sha256: 'd801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658',
+ name: 'endpoint-exceptionlist-windows-v1',
+ },
+ ],
+ version: '1.0.0',
+ },
+ },
+ },
+ },
+ },
+ ecs: {
+ version: '1.5.0',
+ },
+ elastic: {
+ agent: {
+ id: 'b2e88aea-2671-402a-828a-957526bac315',
+ },
+ },
+ file: {
+ path: 'C:\\Windows\\Temp\\mimikatz.exe',
+ size: 1263880,
+ created: '2020-05-19T07:50:06.0Z',
+ accessed: '2020-09-22T14:29:19.93531400Z',
+ mtime: '2020-09-22T14:29:03.6040000Z',
+ directory: 'C:\\Windows\\Temp',
+ hash: {
+ sha1: 'c9fb7f8a4c6b7b12b493a99a8dc6901d17867388',
+ sha256: 'cb1553a3c88817e4cc774a5a93f9158f6785bd3815447d04b6c3f4c2c4b21ed7',
+ md5: '465d5d850f54d9cde767bda90743df30',
+ },
+ Ext: {
+ code_signature: {
+ trusted: true,
+ subject_name: 'Open Source Developer, Benjamin Delpy',
+ exists: true,
+ status: 'trusted',
+ },
+ malware_classification: {
+ identifier: 'endpointpe-v4-model',
+ score: 0.99956864118576,
+ threshold: 0.71,
+ version: '0.0.0',
+ },
+ },
+ },
+ host: {
+ os: {
+ Ext: {
+ variant: 'Windows 10 Enterprise Evaluation',
+ },
+ kernel: '2004 (10.0.19041.388)',
+ name: 'Windows',
+ family: 'windows',
+ version: '2004 (10.0.19041.388)',
+ platform: 'windows',
+ full: 'Windows 10 Enterprise Evaluation 2004 (10.0.19041.388)',
+ },
+ },
+ event: {
+ kind: 'alert',
+ },
+ cluster_uuid: 'kLbKvSMcRiiFAR0t8LebDA',
+ cluster_name: 'elasticsearch',
+ };
+}
diff --git a/src/plugins/telemetry_management_section/public/components/telemetry_management_section.test.tsx b/src/plugins/telemetry_management_section/public/components/telemetry_management_section.test.tsx
index 0e2855f055540..993295746ea5b 100644
--- a/src/plugins/telemetry_management_section/public/components/telemetry_management_section.test.tsx
+++ b/src/plugins/telemetry_management_section/public/components/telemetry_management_section.test.tsx
@@ -212,7 +212,7 @@ describe('TelemetryManagementSectionComponent', () => {
/>
);
try {
- const toggleExampleComponent = component.find('p > EuiLink[onClick]');
+ const toggleExampleComponent = component.find('FormattedMessage > EuiLink[onClick]').at(0);
const updatedView = toggleExampleComponent.simulate('click');
updatedView.find('OptInExampleFlyout');
updatedView.simulate('close');
@@ -221,6 +221,42 @@ describe('TelemetryManagementSectionComponent', () => {
}
});
+ it('shows the OptInSecurityExampleFlyout', () => {
+ const onQueryMatchChange = jest.fn();
+ const telemetryService = new TelemetryService({
+ config: {
+ enabled: true,
+ url: '',
+ banner: true,
+ allowChangingOptInStatus: true,
+ optIn: false,
+ optInStatusUrl: '',
+ sendUsageFrom: 'browser',
+ },
+ reportOptInStatusChange: false,
+ notifications: coreStart.notifications,
+ http: coreSetup.http,
+ });
+
+ const component = mountWithIntl(
+
+ );
+ try {
+ const toggleExampleComponent = component.find('FormattedMessage > EuiLink[onClick]').at(1);
+ const updatedView = toggleExampleComponent.simulate('click');
+ updatedView.find('OptInSecurityExampleFlyout');
+ updatedView.simulate('close');
+ } finally {
+ component.unmount();
+ }
+ });
+
it('toggles the OptIn button', async () => {
const onQueryMatchChange = jest.fn();
const telemetryService = new TelemetryService({
diff --git a/src/plugins/telemetry_management_section/public/components/telemetry_management_section.tsx b/src/plugins/telemetry_management_section/public/components/telemetry_management_section.tsx
index 9ae0a3d12fbb5..822d8b49661c1 100644
--- a/src/plugins/telemetry_management_section/public/components/telemetry_management_section.tsx
+++ b/src/plugins/telemetry_management_section/public/components/telemetry_management_section.tsx
@@ -34,6 +34,7 @@ import { i18n } from '@kbn/i18n';
import { TelemetryPluginSetup } from 'src/plugins/telemetry/public';
import { PRIVACY_STATEMENT_URL } from '../../../telemetry/common/constants';
import { OptInExampleFlyout } from './opt_in_example_flyout';
+import { OptInSecurityExampleFlyout } from './opt_in_security_example_flyout';
import { LazyField } from '../../../advanced_settings/public';
import { ToastsStart } from '../../../../core/public';
@@ -53,6 +54,7 @@ interface Props {
interface State {
processing: boolean;
showExample: boolean;
+ showSecurityExample: boolean;
queryMatches: boolean | null;
enabled: boolean;
}
@@ -61,6 +63,7 @@ export class TelemetryManagementSection extends Component {
state: State = {
processing: false,
showExample: false,
+ showSecurityExample: false,
queryMatches: null,
enabled: this.props.telemetryService.getIsOptedIn() || false,
};
@@ -87,7 +90,7 @@ export class TelemetryManagementSection extends Component {
render() {
const { telemetryService } = this.props;
- const { showExample, queryMatches, enabled, processing } = this.state;
+ const { showExample, showSecurityExample, queryMatches, enabled, processing } = this.state;
if (!telemetryService.getCanChangeOptInStatus()) {
return null;
@@ -105,6 +108,7 @@ export class TelemetryManagementSection extends Component {
onClose={this.toggleExample}
/>
)}
+ {showSecurityExample && }
@@ -197,12 +201,25 @@ export class TelemetryManagementSection extends Component {
/>
-
-
-
+
+
+
+ ),
+ endpointSecurityData: (
+
+
+
+ ),
+ }}
+ />
);
@@ -245,6 +262,12 @@ export class TelemetryManagementSection extends Component {
showExample: !this.state.showExample,
});
};
+
+ toggleSecurityExample = () => {
+ this.setState({
+ showSecurityExample: !this.state.showSecurityExample,
+ });
+ };
}
// required for lazy loading
diff --git a/src/plugins/visualize/public/application/utils/get_top_nav_config.tsx b/src/plugins/visualize/public/application/utils/get_top_nav_config.tsx
index 12720f3f22e7c..cb68a647cb81d 100644
--- a/src/plugins/visualize/public/application/utils/get_top_nav_config.tsx
+++ b/src/plugins/visualize/public/application/utils/get_top_nav_config.tsx
@@ -175,54 +175,61 @@ export const getTopNavConfig = (
};
const topNavMenu: TopNavMenuData[] = [
- ...(originatingApp && ((savedVis && savedVis.id) || embeddableId)
- ? [
- {
- id: 'saveAndReturn',
- label: i18n.translate('visualize.topNavMenu.saveAndReturnVisualizationButtonLabel', {
- defaultMessage: 'Save and return',
- }),
- emphasize: true,
- iconType: 'check',
- description: i18n.translate(
- 'visualize.topNavMenu.saveAndReturnVisualizationButtonAriaLabel',
- {
- defaultMessage: 'Finish editing visualization and return to the last app',
- }
- ),
- testId: 'visualizesaveAndReturnButton',
- disableButton: hasUnappliedChanges,
- tooltip() {
- if (hasUnappliedChanges) {
- return i18n.translate(
- 'visualize.topNavMenu.saveAndReturnVisualizationDisabledButtonTooltip',
- {
- defaultMessage: 'Apply or Discard your changes before finishing',
- }
- );
- }
- },
- run: async () => {
- const saveOptions = {
- confirmOverwrite: false,
- returnToOrigin: true,
- };
- if (
- originatingApp === 'dashboards' &&
- dashboard.dashboardFeatureFlagConfig.allowByValueEmbeddables &&
- !savedVis
- ) {
- return createVisReference();
- }
- return doSave(saveOptions);
+ {
+ id: 'inspector',
+ label: i18n.translate('visualize.topNavMenu.openInspectorButtonLabel', {
+ defaultMessage: 'inspect',
+ }),
+ description: i18n.translate('visualize.topNavMenu.openInspectorButtonAriaLabel', {
+ defaultMessage: 'Open Inspector for visualization',
+ }),
+ testId: 'openInspectorButton',
+ disableButton() {
+ return !embeddableHandler.hasInspector || !embeddableHandler.hasInspector();
+ },
+ run: openInspector,
+ tooltip() {
+ if (!embeddableHandler.hasInspector || !embeddableHandler.hasInspector()) {
+ return i18n.translate('visualize.topNavMenu.openInspectorDisabledButtonTooltip', {
+ defaultMessage: `This visualization doesn't support any inspectors.`,
+ });
+ }
+ },
+ },
+ {
+ id: 'share',
+ label: i18n.translate('visualize.topNavMenu.shareVisualizationButtonLabel', {
+ defaultMessage: 'share',
+ }),
+ description: i18n.translate('visualize.topNavMenu.shareVisualizationButtonAriaLabel', {
+ defaultMessage: 'Share Visualization',
+ }),
+ testId: 'shareTopNavButton',
+ run: (anchorElement) => {
+ if (share && !embeddableId) {
+ // TODO: support sharing in by-value mode
+ share.toggleShareContextMenu({
+ anchorElement,
+ allowEmbed: true,
+ allowShortUrl: visualizeCapabilities.createShortUrl,
+ shareableUrl: unhashUrl(window.location.href),
+ objectId: savedVis?.id,
+ objectType: 'visualization',
+ sharingData: {
+ title: savedVis?.title,
},
- },
- ]
- : []),
+ isDirty: hasUnappliedChanges || hasUnsavedChanges,
+ });
+ }
+ },
+ // disable the Share button if no action specified
+ disableButton: !share || !!embeddableId,
+ },
...(visualizeCapabilities.save && !embeddableId
? [
{
id: 'save',
+ iconType: savedVis?.id && originatingApp ? undefined : 'save',
label:
savedVis?.id && originatingApp
? i18n.translate('visualize.topNavMenu.saveVisualizationAsButtonLabel', {
@@ -303,56 +310,50 @@ export const getTopNavConfig = (
},
]
: []),
- {
- id: 'share',
- label: i18n.translate('visualize.topNavMenu.shareVisualizationButtonLabel', {
- defaultMessage: 'share',
- }),
- description: i18n.translate('visualize.topNavMenu.shareVisualizationButtonAriaLabel', {
- defaultMessage: 'Share Visualization',
- }),
- testId: 'shareTopNavButton',
- run: (anchorElement) => {
- if (share && !embeddableId) {
- // TODO: support sharing in by-value mode
- share.toggleShareContextMenu({
- anchorElement,
- allowEmbed: true,
- allowShortUrl: visualizeCapabilities.createShortUrl,
- shareableUrl: unhashUrl(window.location.href),
- objectId: savedVis?.id,
- objectType: 'visualization',
- sharingData: {
- title: savedVis?.title,
+ ...(originatingApp && ((savedVis && savedVis.id) || embeddableId)
+ ? [
+ {
+ id: 'saveAndReturn',
+ label: i18n.translate('visualize.topNavMenu.saveAndReturnVisualizationButtonLabel', {
+ defaultMessage: 'Save and return',
+ }),
+ emphasize: true,
+ iconType: 'checkInCircleFilled',
+ description: i18n.translate(
+ 'visualize.topNavMenu.saveAndReturnVisualizationButtonAriaLabel',
+ {
+ defaultMessage: 'Finish editing visualization and return to the last app',
+ }
+ ),
+ testId: 'visualizesaveAndReturnButton',
+ disableButton: hasUnappliedChanges,
+ tooltip() {
+ if (hasUnappliedChanges) {
+ return i18n.translate(
+ 'visualize.topNavMenu.saveAndReturnVisualizationDisabledButtonTooltip',
+ {
+ defaultMessage: 'Apply or Discard your changes before finishing',
+ }
+ );
+ }
},
- isDirty: hasUnappliedChanges || hasUnsavedChanges,
- });
- }
- },
- // disable the Share button if no action specified
- disableButton: !share || !!embeddableId,
- },
- {
- id: 'inspector',
- label: i18n.translate('visualize.topNavMenu.openInspectorButtonLabel', {
- defaultMessage: 'inspect',
- }),
- description: i18n.translate('visualize.topNavMenu.openInspectorButtonAriaLabel', {
- defaultMessage: 'Open Inspector for visualization',
- }),
- testId: 'openInspectorButton',
- disableButton() {
- return !embeddableHandler.hasInspector || !embeddableHandler.hasInspector();
- },
- run: openInspector,
- tooltip() {
- if (!embeddableHandler.hasInspector || !embeddableHandler.hasInspector()) {
- return i18n.translate('visualize.topNavMenu.openInspectorDisabledButtonTooltip', {
- defaultMessage: `This visualization doesn't support any inspectors.`,
- });
- }
- },
- },
+ run: async () => {
+ const saveOptions = {
+ confirmOverwrite: false,
+ returnToOrigin: true,
+ };
+ if (
+ originatingApp === 'dashboards' &&
+ dashboard.dashboardFeatureFlagConfig.allowByValueEmbeddables &&
+ !savedVis
+ ) {
+ return createVisReference();
+ }
+ return doSave(saveOptions);
+ },
+ },
+ ]
+ : []),
];
return topNavMenu;
diff --git a/tasks/config/run.js b/tasks/config/run.js
index 148be6ea8afaa..eddcb0bdd59d0 100644
--- a/tasks/config/run.js
+++ b/tasks/config/run.js
@@ -240,10 +240,6 @@ module.exports = function () {
args: ['scripts/check_licenses', '--dev'],
}),
- verifyDependencyVersions: gruntTaskWithGithubChecks(
- 'Verify dependency versions',
- 'verifyDependencyVersions'
- ),
test_jest: gruntTaskWithGithubChecks('Jest tests', 'test:jest'),
test_jest_integration: gruntTaskWithGithubChecks(
'Jest integration tests',
diff --git a/tasks/jenkins.js b/tasks/jenkins.js
index 90efadf41c435..4e3358ce81bbd 100644
--- a/tasks/jenkins.js
+++ b/tasks/jenkins.js
@@ -31,7 +31,6 @@ module.exports = function (grunt) {
'run:checkFileCasing',
'run:checkLockfileSymlinks',
'run:licenses',
- 'run:verifyDependencyVersions',
'run:verifyNotice',
'run:mocha',
'run:test_jest',
diff --git a/tasks/verify_dependency_versions.js b/tasks/verify_dependency_versions.js
deleted file mode 100644
index 14ecbb9ba8603..0000000000000
--- a/tasks/verify_dependency_versions.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { size } from 'lodash';
-import kibana from '../package.json';
-import xpack from '../x-pack/package.json';
-
-function getMismatches(depType) {
- return Object.keys(kibana[depType])
- .map((key) => {
- const xpackValue = xpack[depType][key];
- const kibanaValue = kibana[depType][key];
- if (xpackValue && kibanaValue && xpackValue !== kibanaValue && !key.includes('@kbn/')) {
- return {
- key,
- xpack: xpackValue,
- kibana: kibanaValue,
- };
- }
- })
- .filter((key) => !!key);
-}
-
-export default function verifyDependencyVersions(grunt) {
- grunt.registerTask('verifyDependencyVersions', 'Checks dependency versions', () => {
- const devDependenciesMismatches = getMismatches('devDependencies');
- if (size(devDependenciesMismatches) > 0) {
- grunt.log.error(
- 'The following devDependencies do not match:',
- JSON.stringify(devDependenciesMismatches, null, 4)
- );
- return false;
- } else {
- grunt.log.writeln('devDependencies match!');
- }
- });
-}
diff --git a/test/common/services/kibana_server/extend_es_archiver.js b/test/common/services/kibana_server/extend_es_archiver.js
index 4efdfc4dddf77..f6e14061aed2a 100644
--- a/test/common/services/kibana_server/extend_es_archiver.js
+++ b/test/common/services/kibana_server/extend_es_archiver.js
@@ -33,9 +33,15 @@ export function extendEsArchiver({ esArchiver, kibanaServer, retry, defaults })
// esArchiver methods return a stats object, with information about the indexes created
const stats = await originalMethod.apply(esArchiver, args);
+ const statsKeys = Object.keys(stats);
+ const kibanaKeys = statsKeys.filter(
+ // this also matches stats keys like '.kibana_1' and '.kibana_2,.kibana_1'
+ (key) => key.includes(KIBANA_INDEX) && (stats[key].created || stats[key].deleted)
+ );
+
// if the kibana index was created by the esArchiver then update the uiSettings
// with the defaults to make sure that they are always in place initially
- if (stats[KIBANA_INDEX] && (stats[KIBANA_INDEX].created || stats[KIBANA_INDEX].deleted)) {
+ if (kibanaKeys.length > 0) {
await retry.try(async () => {
await kibanaServer.uiSettings.update(defaults);
});
diff --git a/test/functional/apps/visualize/_tsvb_time_series.ts b/test/functional/apps/visualize/_tsvb_time_series.ts
index 0b2a52b367a20..d4a079a38c814 100644
--- a/test/functional/apps/visualize/_tsvb_time_series.ts
+++ b/test/functional/apps/visualize/_tsvb_time_series.ts
@@ -84,8 +84,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
await visualBuilder.clickSeriesOption();
await visualBuilder.enterSeriesTemplate('$ {{value}}');
- const actualCount = await visualBuilder.getRhythmChartLegendValue();
- expect(actualCount).to.be(expectedLegendValue);
+ await retry.try(async () => {
+ const actualCount = await visualBuilder.getRhythmChartLegendValue();
+ expect(actualCount).to.be(expectedLegendValue);
+ });
});
it('should show the correct count in the legend with percent formatter', async () => {
diff --git a/test/scripts/checks/verify_dependency_versions.sh b/test/scripts/checks/verify_dependency_versions.sh
deleted file mode 100755
index b73a71e7ff7fd..0000000000000
--- a/test/scripts/checks/verify_dependency_versions.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-
-source src/dev/ci_setup/setup_env.sh
-
-yarn run grunt run:verifyDependencyVersions
diff --git a/vars/tasks.groovy b/vars/tasks.groovy
index edd2c0aa47401..09ff1b0a7d95b 100644
--- a/vars/tasks.groovy
+++ b/vars/tasks.groovy
@@ -12,7 +12,6 @@ def check() {
kibanaPipeline.scriptTask('Check File Casing', 'test/scripts/checks/file_casing.sh'),
kibanaPipeline.scriptTask('Check Lockfile Symlinks', 'test/scripts/checks/lock_file_symlinks.sh'),
kibanaPipeline.scriptTask('Check Licenses', 'test/scripts/checks/licenses.sh'),
- kibanaPipeline.scriptTask('Verify Dependency Versions', 'test/scripts/checks/verify_dependency_versions.sh'),
kibanaPipeline.scriptTask('Verify NOTICE', 'test/scripts/checks/verify_notice.sh'),
kibanaPipeline.scriptTask('Test Projects', 'test/scripts/checks/test_projects.sh'),
kibanaPipeline.scriptTask('Test Hardening', 'test/scripts/checks/test_hardening.sh'),
diff --git a/x-pack/.telemetryrc.json b/x-pack/.telemetryrc.json
index c7430666c538f..ae85efcda32d5 100644
--- a/x-pack/.telemetryrc.json
+++ b/x-pack/.telemetryrc.json
@@ -1,9 +1,5 @@
{
"output": "plugins/telemetry_collection_xpack/schema/xpack_plugins.json",
"root": "plugins/",
- "exclude": [
- "plugins/actions/server/usage/actions_usage_collector.ts",
- "plugins/alerts/server/usage/alerts_usage_collector.ts",
- "plugins/apm/server/lib/apm_telemetry/index.ts"
- ]
+ "exclude": []
}
diff --git a/x-pack/package.json b/x-pack/package.json
index f9b193bb4da06..5742200b55d9f 100644
--- a/x-pack/package.json
+++ b/x-pack/package.json
@@ -29,7 +29,7 @@
"**/@types/node": ">=10.17.17 <10.20.0"
},
"devDependencies": {
- "@cypress/webpack-preprocessor": "^4.1.0",
+ "@cypress/webpack-preprocessor": "^5.4.1",
"@elastic/apm-rum-react": "^1.2.5",
"@elastic/maki": "6.3.0",
"@kbn/dev-utils": "1.0.0",
@@ -159,7 +159,7 @@
"copy-to-clipboard": "^3.0.8",
"copy-webpack-plugin": "^6.0.2",
"cronstrue": "^1.51.0",
- "cypress": "5.0.0",
+ "cypress": "^5.0.0",
"cypress-multi-reporters": "^1.2.3",
"cypress-promise": "^1.1.0",
"d3": "3.5.17",
@@ -257,7 +257,7 @@
"tinycolor2": "1.4.1",
"topojson-client": "3.0.0",
"tree-kill": "^1.2.2",
- "ts-loader": "^6.0.4",
+ "ts-loader": "^7.0.5",
"typescript": "4.0.2",
"typescript-fsa": "^3.0.0",
"typescript-fsa-reducers": "^1.2.1",
@@ -309,7 +309,7 @@
"dedent": "^0.7.0",
"del": "^5.1.0",
"elasticsearch": "^16.7.0",
- "extract-zip": "^1.7.0",
+ "extract-zip": "^2.0.1",
"file-type": "^10.9.0",
"font-awesome": "4.7.0",
"fp-ts": "^2.3.1",
@@ -321,7 +321,7 @@
"glob": "^7.1.2",
"graphql": "^0.13.2",
"graphql-fields": "^1.0.2",
- "graphql-tag": "^2.9.2",
+ "graphql-tag": "^2.10.3",
"graphql-tools": "^3.0.2",
"h2o2": "^8.1.2",
"handlebars": "4.7.6",
@@ -372,7 +372,7 @@
"redux-observable": "^1.2.0",
"redux-thunk": "^2.3.0",
"request": "^2.88.0",
- "rison-node": "0.3.1",
+ "rison-node": "1.0.2",
"rxjs": "^6.5.5",
"semver": "^5.7.0",
"set-value": "^3.0.2",
diff --git a/x-pack/plugins/actions/server/usage/actions_usage_collector.ts b/x-pack/plugins/actions/server/usage/actions_usage_collector.ts
index aa546e08ea1ba..fac57b6282c44 100644
--- a/x-pack/plugins/actions/server/usage/actions_usage_collector.ts
+++ b/x-pack/plugins/actions/server/usage/actions_usage_collector.ts
@@ -4,11 +4,26 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { UsageCollectionSetup } from 'src/plugins/usage_collection/server';
+import { MakeSchemaFrom, UsageCollectionSetup } from 'src/plugins/usage_collection/server';
import { get } from 'lodash';
import { TaskManagerStartContract } from '../../../task_manager/server';
import { ActionsUsage } from './types';
+const byTypeSchema: MakeSchemaFrom['count_by_type'] = {
+ // TODO: Find out an automated way to populate the keys or reformat these into an array (and change the Remote Telemetry indexer accordingly)
+ DYNAMIC_KEY: { type: 'long' },
+ // Known actions:
+ __email: { type: 'long' },
+ __index: { type: 'long' },
+ __pagerduty: { type: 'long' },
+ '__server-log': { type: 'long' },
+ __slack: { type: 'long' },
+ __webhook: { type: 'long' },
+ __servicenow: { type: 'long' },
+ __jira: { type: 'long' },
+ __resilient: { type: 'long' },
+};
+
export function createActionsUsageCollector(
usageCollection: UsageCollectionSetup,
taskManager: TaskManagerStartContract
@@ -16,6 +31,12 @@ export function createActionsUsageCollector(
return usageCollection.makeUsageCollector({
type: 'actions',
isReady: () => true,
+ schema: {
+ count_total: { type: 'long' },
+ count_active_total: { type: 'long' },
+ count_by_type: byTypeSchema,
+ count_active_by_type: byTypeSchema,
+ },
fetch: async () => {
try {
const doc = await getLatestTaskState(await taskManager);
diff --git a/x-pack/plugins/alerts/server/usage/alerts_usage_collector.ts b/x-pack/plugins/alerts/server/usage/alerts_usage_collector.ts
index 64d3ad54a2318..de82dd31877af 100644
--- a/x-pack/plugins/alerts/server/usage/alerts_usage_collector.ts
+++ b/x-pack/plugins/alerts/server/usage/alerts_usage_collector.ts
@@ -4,11 +4,44 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { UsageCollectionSetup } from 'src/plugins/usage_collection/server';
+import { MakeSchemaFrom, UsageCollectionSetup } from 'src/plugins/usage_collection/server';
import { get } from 'lodash';
import { TaskManagerStartContract } from '../../../task_manager/server';
import { AlertsUsage } from './types';
+const byTypeSchema: MakeSchemaFrom['count_by_type'] = {
+ // TODO: Find out an automated way to populate the keys or reformat these into an array (and change the Remote Telemetry indexer accordingly)
+ DYNAMIC_KEY: { type: 'long' },
+ // Known alerts (searching the use of the alerts API `registerType`:
+ // Built-in
+ '__index-threshold': { type: 'long' },
+ // APM
+ apm__error_rate: { type: 'long' }, // eslint-disable-line @typescript-eslint/naming-convention
+ apm__transaction_error_rate: { type: 'long' }, // eslint-disable-line @typescript-eslint/naming-convention
+ apm__transaction_duration: { type: 'long' }, // eslint-disable-line @typescript-eslint/naming-convention
+ apm__transaction_duration_anomaly: { type: 'long' }, // eslint-disable-line @typescript-eslint/naming-convention
+ // Infra
+ metrics__alert__threshold: { type: 'long' }, // eslint-disable-line @typescript-eslint/naming-convention
+ metrics__alert__inventory__threshold: { type: 'long' }, // eslint-disable-line @typescript-eslint/naming-convention
+ logs__alert__document__count: { type: 'long' }, // eslint-disable-line @typescript-eslint/naming-convention
+ // Monitoring
+ monitoring_alert_cluster_health: { type: 'long' },
+ monitoring_alert_cpu_usage: { type: 'long' },
+ monitoring_alert_disk_usage: { type: 'long' },
+ monitoring_alert_elasticsearch_version_mismatch: { type: 'long' },
+ monitoring_alert_kibana_version_mismatch: { type: 'long' },
+ monitoring_alert_license_expiration: { type: 'long' },
+ monitoring_alert_logstash_version_mismatch: { type: 'long' },
+ monitoring_alert_nodes_changed: { type: 'long' },
+ // Security Solution
+ siem__signals: { type: 'long' }, // eslint-disable-line @typescript-eslint/naming-convention
+ siem__notifications: { type: 'long' }, // eslint-disable-line @typescript-eslint/naming-convention
+ // Uptime
+ xpack__uptime__alerts__monitorStatus: { type: 'long' }, // eslint-disable-line @typescript-eslint/naming-convention
+ xpack__uptime__alerts__tls: { type: 'long' }, // eslint-disable-line @typescript-eslint/naming-convention
+ xpack__uptime__alerts__durationAnomaly: { type: 'long' }, // eslint-disable-line @typescript-eslint/naming-convention
+};
+
export function createAlertsUsageCollector(
usageCollection: UsageCollectionSetup,
taskManager: TaskManagerStartContract
@@ -50,6 +83,28 @@ export function createAlertsUsageCollector(
};
}
},
+ schema: {
+ count_total: { type: 'long' },
+ count_active_total: { type: 'long' },
+ count_disabled_total: { type: 'long' },
+ throttle_time: {
+ min: { type: 'long' },
+ avg: { type: 'float' },
+ max: { type: 'long' },
+ },
+ schedule_time: {
+ min: { type: 'long' },
+ avg: { type: 'float' },
+ max: { type: 'long' },
+ },
+ connectors_per_alert: {
+ min: { type: 'long' },
+ avg: { type: 'float' },
+ max: { type: 'long' },
+ },
+ count_active_by_type: byTypeSchema,
+ count_by_type: byTypeSchema,
+ },
});
}
diff --git a/x-pack/plugins/apm/common/__snapshots__/apm_telemetry.test.ts.snap b/x-pack/plugins/apm/common/__snapshots__/apm_telemetry.test.ts.snap
index 663411dff76ff..9f7a911bf21c7 100644
--- a/x-pack/plugins/apm/common/__snapshots__/apm_telemetry.test.ts.snap
+++ b/x-pack/plugins/apm/common/__snapshots__/apm_telemetry.test.ts.snap
@@ -11,6 +11,67 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"properties": {
"apm": {
"properties": {
+ "services_per_agent": {
+ "properties": {
+ "dotnet": {
+ "type": "long"
+ },
+ "go": {
+ "type": "long"
+ },
+ "java": {
+ "type": "long"
+ },
+ "js-base": {
+ "type": "long"
+ },
+ "nodejs": {
+ "type": "long"
+ },
+ "python": {
+ "type": "long"
+ },
+ "ruby": {
+ "type": "long"
+ },
+ "rum-js": {
+ "type": "long"
+ },
+ "otlp": {
+ "type": "long"
+ },
+ "opentelemetry/cpp": {
+ "type": "long"
+ },
+ "opentelemetry/dotnet": {
+ "type": "long"
+ },
+ "opentelemetry/erlang": {
+ "type": "long"
+ },
+ "opentelemetry/go": {
+ "type": "long"
+ },
+ "opentelemetry/java": {
+ "type": "long"
+ },
+ "opentelemetry/nodejs": {
+ "type": "long"
+ },
+ "opentelemetry/php": {
+ "type": "long"
+ },
+ "opentelemetry/python": {
+ "type": "long"
+ },
+ "opentelemetry/ruby": {
+ "type": "long"
+ },
+ "opentelemetry/webjs": {
+ "type": "long"
+ }
+ }
+ },
"agents": {
"properties": {
"dotnet": {
@@ -18,8 +79,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"agent": {
"properties": {
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
}
}
},
@@ -27,49 +87,40 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"properties": {
"framework": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"language": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"runtime": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
}
@@ -82,8 +133,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"agent": {
"properties": {
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
}
}
},
@@ -91,49 +141,40 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"properties": {
"framework": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"language": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"runtime": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
}
@@ -146,8 +187,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"agent": {
"properties": {
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
}
}
},
@@ -155,49 +195,40 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"properties": {
"framework": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"language": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"runtime": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
}
@@ -210,8 +241,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"agent": {
"properties": {
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
}
}
},
@@ -219,49 +249,40 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"properties": {
"framework": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"language": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"runtime": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
}
@@ -274,8 +295,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"agent": {
"properties": {
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
}
}
},
@@ -283,49 +303,40 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"properties": {
"framework": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"language": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"runtime": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
}
@@ -338,8 +349,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"agent": {
"properties": {
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
}
}
},
@@ -347,49 +357,40 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"properties": {
"framework": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"language": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"runtime": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
}
@@ -402,8 +403,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"agent": {
"properties": {
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
}
}
},
@@ -411,49 +411,40 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"properties": {
"framework": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"language": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"runtime": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
}
@@ -466,8 +457,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"agent": {
"properties": {
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
}
}
},
@@ -475,49 +465,40 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"properties": {
"framework": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"language": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"runtime": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
}
@@ -530,8 +511,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"agent": {
"properties": {
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
}
}
},
@@ -539,49 +519,40 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"properties": {
"framework": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"language": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"runtime": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
}
@@ -594,8 +565,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"agent": {
"properties": {
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
}
}
},
@@ -603,49 +573,40 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"properties": {
"framework": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"language": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"runtime": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
}
@@ -658,8 +619,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"agent": {
"properties": {
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
}
}
},
@@ -667,49 +627,40 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"properties": {
"framework": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"language": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"runtime": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
}
@@ -722,8 +673,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"agent": {
"properties": {
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
}
}
},
@@ -731,49 +681,40 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"properties": {
"framework": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"language": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"runtime": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
}
@@ -786,8 +727,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"agent": {
"properties": {
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
}
}
},
@@ -795,49 +735,40 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"properties": {
"framework": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"language": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"runtime": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
}
@@ -850,8 +781,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"agent": {
"properties": {
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
}
}
},
@@ -859,49 +789,40 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"properties": {
"framework": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"language": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"runtime": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
}
@@ -914,8 +835,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"agent": {
"properties": {
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
}
}
},
@@ -923,49 +843,40 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"properties": {
"framework": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"language": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"runtime": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
}
@@ -978,8 +889,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"agent": {
"properties": {
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
}
}
},
@@ -987,49 +897,40 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"properties": {
"framework": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"language": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"runtime": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
}
@@ -1042,8 +943,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"agent": {
"properties": {
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
}
}
},
@@ -1051,49 +951,40 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"properties": {
"framework": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
- }
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
+ }
}
},
"language": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"runtime": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
}
@@ -1106,8 +997,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"agent": {
"properties": {
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
}
}
},
@@ -1115,49 +1005,40 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"properties": {
"framework": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"language": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"runtime": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
}
@@ -1170,8 +1051,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"agent": {
"properties": {
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
}
}
},
@@ -1179,49 +1059,40 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"properties": {
"framework": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"language": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
},
"runtime": {
"properties": {
- "composite": {
- "type": "keyword",
- "ignore_above": 1024
- },
"name": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"version": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
+ },
+ "composite": {
+ "type": "keyword"
}
}
}
@@ -1231,6 +1102,39 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
}
}
},
+ "has_any_services": {
+ "type": "boolean"
+ },
+ "version": {
+ "properties": {
+ "apm_server": {
+ "properties": {
+ "major": {
+ "type": "long"
+ },
+ "minor": {
+ "type": "long"
+ },
+ "patch": {
+ "type": "long"
+ }
+ }
+ }
+ }
+ },
+ "environments": {
+ "properties": {
+ "services_without_environments": {
+ "type": "long"
+ },
+ "services_with_multiple_environments": {
+ "type": "long"
+ },
+ "top_environments": {
+ "type": "keyword"
+ }
+ }
+ },
"aggregated_transactions": {
"properties": {
"current_implementation": {
@@ -1240,9 +1144,6 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
},
"transaction_count": {
"type": "long"
- },
- "ratio": {
- "type": "float"
}
}
},
@@ -1253,67 +1154,77 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
},
"transaction_count": {
"type": "long"
- },
- "ratio": {
- "type": "float"
}
}
},
- "with_country": {
+ "no_rum": {
"properties": {
"expected_metric_document_count": {
"type": "long"
},
"transaction_count": {
"type": "long"
+ }
+ }
+ },
+ "no_rum_no_observer_name": {
+ "properties": {
+ "expected_metric_document_count": {
+ "type": "long"
},
- "ratio": {
- "type": "float"
+ "transaction_count": {
+ "type": "long"
}
}
- }
- }
- },
- "environments": {
- "properties": {
- "services_without_environment": {
- "type": "long"
},
- "services_with_multiple_environments": {
- "type": "long"
+ "only_rum": {
+ "properties": {
+ "expected_metric_document_count": {
+ "type": "long"
+ },
+ "transaction_count": {
+ "type": "long"
+ }
+ }
},
- "top_enviroments": {
- "type": "keyword",
- "ignore_above": 1024
+ "only_rum_no_observer_name": {
+ "properties": {
+ "expected_metric_document_count": {
+ "type": "long"
+ },
+ "transaction_count": {
+ "type": "long"
+ }
+ }
}
}
},
"cloud": {
"properties": {
"availability_zone": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"provider": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
},
"region": {
- "type": "keyword",
- "ignore_above": 1024
+ "type": "keyword"
}
}
},
"counts": {
"properties": {
- "agent_configuration": {
+ "transaction": {
"properties": {
+ "1d": {
+ "type": "long"
+ },
"all": {
"type": "long"
}
}
},
- "error": {
+ "span": {
"properties": {
"1d": {
"type": "long"
@@ -1323,21 +1234,27 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
}
}
},
- "max_error_groups_per_service": {
+ "error": {
"properties": {
"1d": {
"type": "long"
+ },
+ "all": {
+ "type": "long"
}
}
},
- "max_transaction_groups_per_service": {
+ "metric": {
"properties": {
"1d": {
"type": "long"
+ },
+ "all": {
+ "type": "long"
}
}
},
- "metric": {
+ "sourcemap": {
"properties": {
"1d": {
"type": "long"
@@ -1357,14 +1274,14 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
}
}
},
- "services": {
+ "agent_configuration": {
"properties": {
- "1d": {
+ "all": {
"type": "long"
}
}
},
- "sourcemap": {
+ "max_transaction_groups_per_service": {
"properties": {
"1d": {
"type": "long"
@@ -1374,7 +1291,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
}
}
},
- "span": {
+ "max_error_groups_per_service": {
"properties": {
"1d": {
"type": "long"
@@ -1388,10 +1305,13 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
"properties": {
"1d": {
"type": "long"
+ },
+ "all": {
+ "type": "long"
}
}
},
- "transaction": {
+ "services": {
"properties": {
"1d": {
"type": "long"
@@ -1470,55 +1390,22 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
}
}
},
- "has_any_services": {
- "type": "boolean"
- },
- "indices": {
+ "retainment": {
"properties": {
- "all": {
- "properties": {
- "total": {
- "properties": {
- "docs": {
- "properties": {
- "count": {
- "type": "long"
- }
- }
- },
- "store": {
- "properties": {
- "size_in_bytes": {
- "type": "long"
- }
- }
- }
- }
- }
- }
- },
- "shards": {
+ "span": {
"properties": {
- "total": {
+ "ms": {
"type": "long"
}
}
- }
- }
- },
- "integrations": {
- "properties": {
- "ml": {
+ },
+ "transaction": {
"properties": {
- "all_jobs_count": {
+ "ms": {
"type": "long"
}
}
- }
- }
- },
- "retainment": {
- "properties": {
+ },
"error": {
"properties": {
"ms": {
@@ -1533,106 +1420,63 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
}
}
},
- "onboarding": {
+ "sourcemap": {
"properties": {
"ms": {
"type": "long"
}
}
},
- "span": {
+ "onboarding": {
"properties": {
"ms": {
"type": "long"
}
}
- },
- "transaction": {
+ }
+ }
+ },
+ "integrations": {
+ "properties": {
+ "ml": {
"properties": {
- "ms": {
+ "all_jobs_count": {
"type": "long"
}
}
}
}
},
- "services_per_agent": {
+ "indices": {
"properties": {
- "dotnet": {
- "type": "long",
- "null_value": 0
- },
- "go": {
- "type": "long",
- "null_value": 0
- },
- "java": {
- "type": "long",
- "null_value": 0
- },
- "js-base": {
- "type": "long",
- "null_value": 0
- },
- "nodejs": {
- "type": "long",
- "null_value": 0
- },
- "python": {
- "type": "long",
- "null_value": 0
- },
- "ruby": {
- "type": "long",
- "null_value": 0
- },
- "rum-js": {
- "type": "long",
- "null_value": 0
- },
- "otlp": {
- "type": "long",
- "null_value": 0
- },
- "opentelemetry/cpp": {
- "type": "long",
- "null_value": 0
- },
- "opentelemetry/dotnet": {
- "type": "long",
- "null_value": 0
- },
- "opentelemetry/erlang": {
- "type": "long",
- "null_value": 0
- },
- "opentelemetry/go": {
- "type": "long",
- "null_value": 0
- },
- "opentelemetry/java": {
- "type": "long",
- "null_value": 0
- },
- "opentelemetry/nodejs": {
- "type": "long",
- "null_value": 0
- },
- "opentelemetry/php": {
- "type": "long",
- "null_value": 0
- },
- "opentelemetry/python": {
- "type": "long",
- "null_value": 0
- },
- "opentelemetry/ruby": {
- "type": "long",
- "null_value": 0
+ "shards": {
+ "properties": {
+ "total": {
+ "type": "long"
+ }
+ }
},
- "opentelemetry/webjs": {
- "type": "long",
- "null_value": 0
+ "all": {
+ "properties": {
+ "total": {
+ "properties": {
+ "docs": {
+ "properties": {
+ "count": {
+ "type": "long"
+ }
+ }
+ },
+ "store": {
+ "properties": {
+ "size_in_bytes": {
+ "type": "long"
+ }
+ }
+ }
+ }
+ }
+ }
}
}
},
@@ -1649,7 +1493,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
}
}
},
- "agent_configuration": {
+ "cloud": {
"properties": {
"took": {
"properties": {
@@ -1660,7 +1504,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
}
}
},
- "agents": {
+ "processor_events": {
"properties": {
"took": {
"properties": {
@@ -1671,7 +1515,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
}
}
},
- "cardinality": {
+ "agent_configuration": {
"properties": {
"took": {
"properties": {
@@ -1682,7 +1526,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
}
}
},
- "cloud": {
+ "services": {
"properties": {
"took": {
"properties": {
@@ -1693,7 +1537,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
}
}
},
- "environments": {
+ "versions": {
"properties": {
"took": {
"properties": {
@@ -1715,17 +1559,6 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
}
}
},
- "indices_stats": {
- "properties": {
- "took": {
- "properties": {
- "ms": {
- "type": "long"
- }
- }
- }
- }
- },
"integrations": {
"properties": {
"took": {
@@ -1737,7 +1570,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
}
}
},
- "processor_events": {
+ "agents": {
"properties": {
"took": {
"properties": {
@@ -1748,7 +1581,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
}
}
},
- "services": {
+ "indices_stats": {
"properties": {
"took": {
"properties": {
@@ -1759,7 +1592,7 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
}
}
},
- "versions": {
+ "cardinality": {
"properties": {
"took": {
"properties": {
@@ -1771,23 +1604,6 @@ exports[`APM telemetry helpers getApmTelemetry generates a JSON object with the
}
}
}
- },
- "version": {
- "properties": {
- "apm_server": {
- "properties": {
- "major": {
- "type": "long"
- },
- "minor": {
- "type": "long"
- },
- "patch": {
- "type": "long"
- }
- }
- }
- }
}
}
}
diff --git a/x-pack/plugins/apm/common/apm_telemetry.ts b/x-pack/plugins/apm/common/apm_telemetry.ts
index 874cee05553d4..faf5b21d69c7b 100644
--- a/x-pack/plugins/apm/common/apm_telemetry.ts
+++ b/x-pack/plugins/apm/common/apm_telemetry.ts
@@ -4,260 +4,39 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { produce } from 'immer';
-import { AGENT_NAMES } from './agent_name';
+// eslint-disable-next-line @kbn/eslint/no-restricted-paths
+import { apmSchema } from '../server/lib/apm_telemetry/schema';
+
+function schemaToMapping(schemaLeaf: any): any {
+ // convert "array" definition to mapping
+ if (schemaLeaf.type === 'array') {
+ return schemaToMapping(schemaLeaf.items);
+ }
+
+ if (typeof schemaLeaf.type === 'string') {
+ return schemaLeaf;
+ }
+
+ return Object.entries(schemaLeaf).reduce((acc, [key, value]) => {
+ const propMapping = schemaToMapping(value);
+
+ return {
+ ...acc,
+ [key]:
+ typeof propMapping.type === 'string'
+ ? propMapping
+ : { properties: propMapping },
+ };
+ }, {});
+}
/**
- * Generate an object containing the mapping used for APM telemetry. Can be used
- * with the `upload-telemetry-data` script or to update the mapping in the
- * telemetry repository.
- *
- * This function breaks things up to make the mapping easier to understand.
+ * Generate an object containing the mapping used for APM telemetry based on the schema specified
+ * in the usage collector. Can be used with the `upload-telemetry-data` script or to update the
+ * mapping in the telemetry repository.
*/
export function getApmTelemetryMapping() {
- const keyword = {
- type: 'keyword',
- ignore_above: 1024,
- };
-
- const float = {
- type: 'float',
- };
-
- const long = {
- type: 'long',
- };
-
- const allProperties = {
- properties: {
- all: long,
- },
- };
-
- const oneDayProperties = {
- properties: {
- '1d': long,
- },
- };
-
- const oneDayAllProperties = {
- properties: {
- '1d': long,
- all: long,
- },
- };
-
- const msProperties = {
- properties: {
- ms: long,
- },
- };
-
- const tookProperties = {
- properties: {
- took: msProperties,
- },
- };
-
- const compositeNameVersionProperties = {
- properties: {
- composite: keyword,
- name: keyword,
- version: keyword,
- },
- };
-
- const agentProperties = {
- properties: { version: keyword },
- };
-
- const serviceProperties = {
- properties: {
- framework: compositeNameVersionProperties,
- language: compositeNameVersionProperties,
- runtime: compositeNameVersionProperties,
- },
- };
-
- const aggregatedTransactionsProperties = {
- properties: {
- expected_metric_document_count: long,
- transaction_count: long,
- ratio: float,
- },
- };
-
- return {
- properties: {
- agents: {
- properties: AGENT_NAMES.reduce>(
- (previousValue, currentValue) => {
- previousValue[currentValue] = {
- properties: {
- agent: agentProperties,
- service: serviceProperties,
- },
- };
-
- return previousValue;
- },
- {}
- ),
- },
- aggregated_transactions: {
- properties: {
- current_implementation: aggregatedTransactionsProperties,
- no_observer_name: aggregatedTransactionsProperties,
- with_country: aggregatedTransactionsProperties,
- },
- },
- environments: {
- properties: {
- services_without_environment: long,
- services_with_multiple_environments: long,
- top_enviroments: keyword,
- },
- },
- cloud: {
- properties: {
- availability_zone: keyword,
- provider: keyword,
- region: keyword,
- },
- },
- counts: {
- properties: {
- agent_configuration: allProperties,
- error: oneDayAllProperties,
- max_error_groups_per_service: oneDayProperties,
- max_transaction_groups_per_service: oneDayProperties,
- metric: oneDayAllProperties,
- onboarding: oneDayAllProperties,
- services: oneDayProperties,
- sourcemap: oneDayAllProperties,
- span: oneDayAllProperties,
- traces: oneDayProperties,
- transaction: oneDayAllProperties,
- },
- },
- cardinality: {
- properties: {
- client: {
- properties: {
- geo: {
- properties: {
- country_iso_code: { properties: { rum: oneDayProperties } },
- },
- },
- },
- },
- user_agent: {
- properties: {
- original: {
- properties: {
- all_agents: oneDayProperties,
- rum: oneDayProperties,
- },
- },
- },
- },
- transaction: {
- properties: {
- name: {
- properties: {
- all_agents: oneDayProperties,
- rum: oneDayProperties,
- },
- },
- },
- },
- },
- },
- has_any_services: {
- type: 'boolean',
- },
- indices: {
- properties: {
- all: {
- properties: {
- total: {
- properties: {
- docs: {
- properties: {
- count: long,
- },
- },
- store: {
- properties: {
- size_in_bytes: long,
- },
- },
- },
- },
- },
- },
- shards: {
- properties: {
- total: long,
- },
- },
- },
- },
- integrations: {
- properties: {
- ml: {
- properties: {
- all_jobs_count: long,
- },
- },
- },
- },
- retainment: {
- properties: {
- error: msProperties,
- metric: msProperties,
- onboarding: msProperties,
- span: msProperties,
- transaction: msProperties,
- },
- },
- services_per_agent: {
- properties: AGENT_NAMES.reduce>(
- (previousValue, currentValue) => {
- previousValue[currentValue] = { ...long, null_value: 0 };
- return previousValue;
- },
- {}
- ),
- },
- tasks: {
- properties: {
- aggregated_transactions: tookProperties,
- agent_configuration: tookProperties,
- agents: tookProperties,
- cardinality: tookProperties,
- cloud: tookProperties,
- environments: tookProperties,
- groupings: tookProperties,
- indices_stats: tookProperties,
- integrations: tookProperties,
- processor_events: tookProperties,
- services: tookProperties,
- versions: tookProperties,
- },
- },
- version: {
- properties: {
- apm_server: {
- properties: {
- major: long,
- minor: long,
- patch: long,
- },
- },
- },
- },
- },
- };
+ return { properties: schemaToMapping(apmSchema) };
}
/**
diff --git a/x-pack/plugins/apm/common/service_health_status.ts b/x-pack/plugins/apm/common/service_health_status.ts
index 1d4bcfb3b0e07..f66e03a9733a3 100644
--- a/x-pack/plugins/apm/common/service_health_status.ts
+++ b/x-pack/plugins/apm/common/service_health_status.ts
@@ -54,6 +54,22 @@ export function getServiceHealthStatusColor(
}
}
+export function getServiceHealthStatusBadgeColor(
+ theme: EuiTheme,
+ status: ServiceHealthStatus
+) {
+ switch (status) {
+ case ServiceHealthStatus.healthy:
+ return theme.eui.euiColorVis0_behindText;
+ case ServiceHealthStatus.warning:
+ return theme.eui.euiColorVis5_behindText;
+ case ServiceHealthStatus.critical:
+ return theme.eui.euiColorVis9_behindText;
+ case ServiceHealthStatus.unknown:
+ return theme.eui.euiColorMediumShade;
+ }
+}
+
export function getServiceHealthStatusLabel(status: ServiceHealthStatus) {
switch (status) {
case ServiceHealthStatus.critical:
diff --git a/x-pack/plugins/apm/e2e/package.json b/x-pack/plugins/apm/e2e/package.json
index 649198b7eae11..041f9ea7f21c0 100644
--- a/x-pack/plugins/apm/e2e/package.json
+++ b/x-pack/plugins/apm/e2e/package.json
@@ -14,7 +14,7 @@
"@types/node": ">=10.17.17 <10.20.0",
"axios": "^0.19.2",
"cypress-cucumber-preprocessor": "^2.5.2",
- "cypress": "^4.9.0",
+ "cypress": "^5.0.0",
"ora": "^4.0.4",
"p-limit": "^3.0.1",
"p-retry": "^4.2.0",
diff --git a/x-pack/plugins/apm/public/components/app/ServiceMap/__stories__/example_response_opbeans_beats.json b/x-pack/plugins/apm/public/components/app/ServiceMap/__stories__/example_response_opbeans_beats.json
index 153fa57bb05e7..cfd905f145fe2 100644
--- a/x-pack/plugins/apm/public/components/app/ServiceMap/__stories__/example_response_opbeans_beats.json
+++ b/x-pack/plugins/apm/public/components/app/ServiceMap/__stories__/example_response_opbeans_beats.json
@@ -83,7 +83,7 @@
"id": "opbeans-go~>postgresql",
"sourceData": {
"id": "opbeans-go",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-go",
"agent.name": "go"
},
@@ -103,7 +103,7 @@
"id": "opbeans-go~opbeans-java",
"sourceData": {
"id": "opbeans-go",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-go",
"agent.name": "go"
},
@@ -123,13 +123,13 @@
"id": "opbeans-go~opbeans-node",
"sourceData": {
"id": "opbeans-go",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-go",
"agent.name": "go"
},
"targetData": {
"id": "opbeans-node",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-node",
"agent.name": "nodejs"
},
@@ -143,7 +143,7 @@
"id": "opbeans-go~opbeans-ruby",
"sourceData": {
"id": "opbeans-go",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-go",
"agent.name": "go"
},
@@ -189,7 +189,7 @@
},
"targetData": {
"id": "opbeans-go",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-go",
"agent.name": "go"
},
@@ -209,7 +209,7 @@
},
"targetData": {
"id": "opbeans-node",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-node",
"agent.name": "nodejs"
}
@@ -242,7 +242,7 @@
"id": "opbeans-node~>postgresql",
"sourceData": {
"id": "opbeans-node",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-node",
"agent.name": "nodejs"
},
@@ -262,7 +262,7 @@
"id": "opbeans-node~>redis",
"sourceData": {
"id": "opbeans-node",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-node",
"agent.name": "nodejs"
},
@@ -282,13 +282,13 @@
"id": "opbeans-node~opbeans-go",
"sourceData": {
"id": "opbeans-node",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-node",
"agent.name": "nodejs"
},
"targetData": {
"id": "opbeans-go",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-go",
"agent.name": "go"
},
@@ -302,7 +302,7 @@
"id": "opbeans-node~opbeans-python",
"sourceData": {
"id": "opbeans-node",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-node",
"agent.name": "nodejs"
},
@@ -322,7 +322,7 @@
"id": "opbeans-node~opbeans-ruby",
"sourceData": {
"id": "opbeans-node",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-node",
"agent.name": "nodejs"
},
@@ -408,7 +408,7 @@
},
"targetData": {
"id": "opbeans-go",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-go",
"agent.name": "go"
}
@@ -427,7 +427,7 @@
},
"targetData": {
"id": "opbeans-node",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-node",
"agent.name": "nodejs"
},
@@ -487,7 +487,7 @@
},
"targetData": {
"id": "opbeans-go",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-go",
"agent.name": "go"
},
@@ -527,7 +527,7 @@
},
"targetData": {
"id": "opbeans-node",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-node",
"agent.name": "nodejs"
},
@@ -566,7 +566,7 @@
},
"targetData": {
"id": "opbeans-go",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-go",
"agent.name": "go"
}
@@ -602,7 +602,7 @@
},
"targetData": {
"id": "opbeans-node",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-node",
"agent.name": "nodejs"
}
@@ -673,7 +673,7 @@
{
"data": {
"id": "opbeans-node",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-node",
"agent.name": "nodejs",
"anomaly_score": 41.31593099784474,
@@ -733,7 +733,7 @@
{
"data": {
"id": "opbeans-go",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-go",
"agent.name": "go",
"anomaly_score": 0.2633884161762746,
diff --git a/x-pack/plugins/apm/public/components/app/ServiceOverview/ServiceList/HealthBadge.tsx b/x-pack/plugins/apm/public/components/app/ServiceOverview/ServiceList/HealthBadge.tsx
index c6be0a352ef66..e8ad3e65b1a47 100644
--- a/x-pack/plugins/apm/public/components/app/ServiceOverview/ServiceList/HealthBadge.tsx
+++ b/x-pack/plugins/apm/public/components/app/ServiceOverview/ServiceList/HealthBadge.tsx
@@ -6,7 +6,7 @@
import React from 'react';
import { EuiBadge } from '@elastic/eui';
import {
- getServiceHealthStatusColor,
+ getServiceHealthStatusBadgeColor,
getServiceHealthStatusLabel,
ServiceHealthStatus,
} from '../../../../../common/service_health_status';
@@ -20,7 +20,7 @@ export function HealthBadge({
const theme = useTheme();
return (
-
+
{getServiceHealthStatusLabel(healthStatus)}
);
diff --git a/x-pack/plugins/apm/public/components/app/ServiceOverview/__test__/__snapshots__/ServiceOverview.test.tsx.snap b/x-pack/plugins/apm/public/components/app/ServiceOverview/__test__/__snapshots__/ServiceOverview.test.tsx.snap
index 40a2b6a5fa81b..ee3a4fce0dbaa 100644
--- a/x-pack/plugins/apm/public/components/app/ServiceOverview/__test__/__snapshots__/ServiceOverview.test.tsx.snap
+++ b/x-pack/plugins/apm/public/components/app/ServiceOverview/__test__/__snapshots__/ServiceOverview.test.tsx.snap
@@ -153,7 +153,7 @@ NodeList [
>
(val ? val.split(',') : [])
) as Partial>;
- return useDeepObjectIdentity({ kuery, environment, ...localUiFilters });
+ return useDeepObjectIdentity({
+ kuery,
+ environment: environment || ENVIRONMENT_ALL.value,
+ ...localUiFilters,
+ });
}
const defaultRefresh = (_time: TimeRange) => {};
diff --git a/x-pack/plugins/apm/public/hooks/useTransactionDistribution.ts b/x-pack/plugins/apm/public/hooks/useTransactionDistribution.ts
index cd3e02d155602..a5096a314388c 100644
--- a/x-pack/plugins/apm/public/hooks/useTransactionDistribution.ts
+++ b/x-pack/plugins/apm/public/hooks/useTransactionDistribution.ts
@@ -75,7 +75,7 @@ export function useTransactionDistribution(urlParams: IUrlParams) {
const preferredSample = maybe(bucketsSortedByCount[0]?.samples[0]);
- history.push({
+ history.replace({
...history.location,
search: fromQuery({
...omit(toQuery(history.location.search), [
diff --git a/x-pack/plugins/apm/public/utils/testHelpers.tsx b/x-pack/plugins/apm/public/utils/testHelpers.tsx
index 971455fde3946..7826e9672a3bb 100644
--- a/x-pack/plugins/apm/public/utils/testHelpers.tsx
+++ b/x-pack/plugins/apm/public/utils/testHelpers.tsx
@@ -25,6 +25,7 @@ import {
} from '../../typings/elasticsearch';
import { MockApmPluginContextWrapper } from '../context/ApmPluginContext/MockApmPluginContext';
import { UrlParamsProvider } from '../context/UrlParamsContext';
+import { UIFilters } from '../../typings/ui_filters';
const originalConsoleWarn = console.warn; // eslint-disable-line no-console
/**
@@ -118,7 +119,8 @@ interface MockSetup {
apmEventClient: any;
internalClient: any;
config: APMConfig;
- uiFiltersES: ESFilter[];
+ uiFilters: UIFilters;
+ esFilter: ESFilter[];
indices: {
/* eslint-disable @typescript-eslint/naming-convention */
'apm_oss.sourcemapIndices': string;
@@ -179,7 +181,8 @@ export async function inspectSearchParams(
},
}
) as APMConfig,
- uiFiltersES: [{ term: { 'my.custom.ui.filter': 'foo-bar' } }],
+ uiFilters: { environment: 'test' },
+ esFilter: [{ term: { 'service.environment': 'test' } }],
indices: {
/* eslint-disable @typescript-eslint/naming-convention */
'apm_oss.sourcemapIndices': 'myIndex',
diff --git a/x-pack/plugins/apm/scripts/package.json b/x-pack/plugins/apm/scripts/package.json
index d3e2d42f972a9..c68dc49cd9370 100644
--- a/x-pack/plugins/apm/scripts/package.json
+++ b/x-pack/plugins/apm/scripts/package.json
@@ -4,7 +4,7 @@
"main": "index.js",
"license": "MIT",
"dependencies": {
- "@elastic/elasticsearch": "7.9.0-rc.1",
+ "@elastic/elasticsearch": "7.9.1",
"@octokit/rest": "^16.35.0",
"console-stamp": "^0.2.9",
"hdr-histogram-js": "^1.2.0"
diff --git a/x-pack/plugins/apm/server/lib/apm_telemetry/index.ts b/x-pack/plugins/apm/server/lib/apm_telemetry/index.ts
index f78280aa7428e..c93fdfc15fe3c 100644
--- a/x-pack/plugins/apm/server/lib/apm_telemetry/index.ts
+++ b/x-pack/plugins/apm/server/lib/apm_telemetry/index.ts
@@ -6,7 +6,6 @@
import { Observable } from 'rxjs';
import { take } from 'rxjs/operators';
import { UsageCollectionSetup } from 'src/plugins/usage_collection/server';
-import { DeepRequired } from 'utility-types';
import {
CoreSetup,
Logger,
@@ -21,14 +20,14 @@ import {
APM_TELEMETRY_SAVED_OBJECT_ID,
APM_TELEMETRY_SAVED_OBJECT_TYPE,
} from '../../../common/apm_saved_object_constants';
-import { getApmTelemetryMapping } from '../../../common/apm_telemetry';
import { getInternalSavedObjectsClient } from '../helpers/get_internal_saved_objects_client';
import { getApmIndices } from '../settings/apm_indices/get_apm_indices';
import {
collectDataTelemetry,
CollectTelemetryParams,
} from './collect_data_telemetry';
-import { APMDataTelemetry } from './types';
+import { APMUsage } from './types';
+import { apmSchema } from './schema';
const APM_TELEMETRY_TASK_NAME = 'apm-telemetry-task';
@@ -107,9 +106,9 @@ export async function createApmTelemetry({
);
};
- const collector = usageCollector.makeUsageCollector({
+ const collector = usageCollector.makeUsageCollector({
type: 'apm',
- schema: getApmTelemetryMapping(),
+ schema: apmSchema,
fetch: async () => {
try {
const { kibanaVersion: storedKibanaVersion, ...data } = (
@@ -117,9 +116,7 @@ export async function createApmTelemetry({
APM_TELEMETRY_SAVED_OBJECT_TYPE,
APM_TELEMETRY_SAVED_OBJECT_ID
)
- ).attributes as { kibanaVersion: string } & DeepRequired<
- APMDataTelemetry
- >;
+ ).attributes as { kibanaVersion: string } & APMUsage;
return data;
} catch (err) {
diff --git a/x-pack/plugins/apm/server/lib/apm_telemetry/schema.ts b/x-pack/plugins/apm/server/lib/apm_telemetry/schema.ts
new file mode 100644
index 0000000000000..4bbda9add0fdb
--- /dev/null
+++ b/x-pack/plugins/apm/server/lib/apm_telemetry/schema.ts
@@ -0,0 +1,206 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { MakeSchemaFrom } from 'src/plugins/usage_collection/server';
+import {
+ AggregatedTransactionsCounts,
+ APMUsage,
+ TimeframeMap,
+ TimeframeMap1d,
+ TimeframeMapAll,
+} from './types';
+import { AgentName } from '../../../typings/es_schemas/ui/fields/agent';
+
+const long: { type: 'long' } = { type: 'long' };
+
+const aggregatedTransactionCountSchema: MakeSchemaFrom = {
+ expected_metric_document_count: long,
+ transaction_count: long,
+};
+
+const timeframeMap1dSchema: MakeSchemaFrom = {
+ '1d': long,
+};
+
+const timeframeMapAllSchema: MakeSchemaFrom = {
+ all: long,
+};
+
+const timeframeMapSchema: MakeSchemaFrom = {
+ ...timeframeMap1dSchema,
+ ...timeframeMapAllSchema,
+};
+
+const agentSchema: MakeSchemaFrom['agents'][AgentName] = {
+ agent: {
+ version: { type: 'array', items: { type: 'keyword' } },
+ },
+ service: {
+ framework: {
+ name: { type: 'array', items: { type: 'keyword' } },
+ version: { type: 'array', items: { type: 'keyword' } },
+ composite: { type: 'array', items: { type: 'keyword' } },
+ },
+ language: {
+ name: { type: 'array', items: { type: 'keyword' } },
+ version: { type: 'array', items: { type: 'keyword' } },
+ composite: { type: 'array', items: { type: 'keyword' } },
+ },
+ runtime: {
+ name: { type: 'array', items: { type: 'keyword' } },
+ version: { type: 'array', items: { type: 'keyword' } },
+ composite: { type: 'array', items: { type: 'keyword' } },
+ },
+ },
+};
+
+const apmPerAgentSchema: Pick<
+ MakeSchemaFrom,
+ 'services_per_agent' | 'agents'
+> = {
+ // services_per_agent: AGENT_NAMES.reduce(
+ // (acc, name) => ({ ...acc, [name]: long }),
+ // {} as Record
+ // ),
+ // agents: AGENT_NAMES.reduce(
+ // (acc, name) => ({ ...acc, [name]: agentSchema }),
+ // {} as Record
+ // ),
+ // TODO: Find a way for `@kbn/telemetry-tools` to understand and evaluate expressions.
+ // In the meanwhile, we'll have to maintain these lists up to date (TS will remind us to update)
+ services_per_agent: {
+ dotnet: long,
+ go: long,
+ java: long,
+ 'js-base': long,
+ nodejs: long,
+ python: long,
+ ruby: long,
+ 'rum-js': long,
+ otlp: long,
+ 'opentelemetry/cpp': long,
+ 'opentelemetry/dotnet': long,
+ 'opentelemetry/erlang': long,
+ 'opentelemetry/go': long,
+ 'opentelemetry/java': long,
+ 'opentelemetry/nodejs': long,
+ 'opentelemetry/php': long,
+ 'opentelemetry/python': long,
+ 'opentelemetry/ruby': long,
+ 'opentelemetry/webjs': long,
+ },
+ agents: {
+ dotnet: agentSchema,
+ go: agentSchema,
+ java: agentSchema,
+ 'js-base': agentSchema,
+ nodejs: agentSchema,
+ python: agentSchema,
+ ruby: agentSchema,
+ 'rum-js': agentSchema,
+ otlp: agentSchema,
+ 'opentelemetry/cpp': agentSchema,
+ 'opentelemetry/dotnet': agentSchema,
+ 'opentelemetry/erlang': agentSchema,
+ 'opentelemetry/go': agentSchema,
+ 'opentelemetry/java': agentSchema,
+ 'opentelemetry/nodejs': agentSchema,
+ 'opentelemetry/php': agentSchema,
+ 'opentelemetry/python': agentSchema,
+ 'opentelemetry/ruby': agentSchema,
+ 'opentelemetry/webjs': agentSchema,
+ },
+};
+
+export const apmSchema: MakeSchemaFrom = {
+ ...apmPerAgentSchema,
+ has_any_services: { type: 'boolean' },
+ version: {
+ apm_server: {
+ major: long,
+ minor: long,
+ patch: long,
+ },
+ },
+ environments: {
+ services_without_environments: long,
+ services_with_multiple_environments: long,
+ top_environments: { type: 'array', items: { type: 'keyword' } },
+ },
+ aggregated_transactions: {
+ current_implementation: aggregatedTransactionCountSchema,
+ no_observer_name: aggregatedTransactionCountSchema,
+ no_rum: aggregatedTransactionCountSchema,
+ no_rum_no_observer_name: aggregatedTransactionCountSchema,
+ only_rum: aggregatedTransactionCountSchema,
+ only_rum_no_observer_name: aggregatedTransactionCountSchema,
+ },
+ cloud: {
+ availability_zone: { type: 'array', items: { type: 'keyword' } },
+ provider: { type: 'array', items: { type: 'keyword' } },
+ region: { type: 'array', items: { type: 'keyword' } },
+ },
+ counts: {
+ transaction: timeframeMapSchema,
+ span: timeframeMapSchema,
+ error: timeframeMapSchema,
+ metric: timeframeMapSchema,
+ sourcemap: timeframeMapSchema,
+ onboarding: timeframeMapSchema,
+ agent_configuration: timeframeMapAllSchema,
+ max_transaction_groups_per_service: timeframeMapSchema,
+ max_error_groups_per_service: timeframeMapSchema,
+ traces: timeframeMapSchema,
+ services: timeframeMapSchema,
+ },
+ cardinality: {
+ client: { geo: { country_iso_code: { rum: timeframeMap1dSchema } } },
+ user_agent: {
+ original: {
+ all_agents: timeframeMap1dSchema,
+ rum: timeframeMap1dSchema,
+ },
+ },
+ transaction: {
+ name: {
+ all_agents: timeframeMap1dSchema,
+ rum: timeframeMap1dSchema,
+ },
+ },
+ },
+ retainment: {
+ span: { ms: long },
+ transaction: { ms: long },
+ error: { ms: long },
+ metric: { ms: long },
+ sourcemap: { ms: long },
+ onboarding: { ms: long },
+ },
+ integrations: { ml: { all_jobs_count: long } },
+
+ indices: {
+ shards: { total: long },
+ all: {
+ total: {
+ docs: { count: long },
+ store: { size_in_bytes: long },
+ },
+ },
+ },
+ tasks: {
+ aggregated_transactions: { took: { ms: long } },
+ cloud: { took: { ms: long } },
+ processor_events: { took: { ms: long } },
+ agent_configuration: { took: { ms: long } },
+ services: { took: { ms: long } },
+ versions: { took: { ms: long } },
+ groupings: { took: { ms: long } },
+ integrations: { took: { ms: long } },
+ agents: { took: { ms: long } },
+ indices_stats: { took: { ms: long } },
+ cardinality: { took: { ms: long } },
+ },
+};
diff --git a/x-pack/plugins/apm/server/lib/apm_telemetry/types.ts b/x-pack/plugins/apm/server/lib/apm_telemetry/types.ts
index c7af292e817c7..7ed79752b43c4 100644
--- a/x-pack/plugins/apm/server/lib/apm_telemetry/types.ts
+++ b/x-pack/plugins/apm/server/lib/apm_telemetry/types.ts
@@ -20,7 +20,7 @@ export interface AggregatedTransactionsCounts {
transaction_count: number;
}
-export type APMDataTelemetry = DeepPartial<{
+export interface APMUsage {
has_any_services: boolean;
services_per_agent: Record;
version: {
@@ -139,6 +139,8 @@ export type APMDataTelemetry = DeepPartial<{
| 'cardinality',
{ took: { ms: number } }
>;
-}>;
+}
+
+export type APMDataTelemetry = DeepPartial;
export type APMTelemetry = APMDataTelemetry;
diff --git a/x-pack/plugins/apm/server/lib/errors/__snapshots__/queries.test.ts.snap b/x-pack/plugins/apm/server/lib/errors/__snapshots__/queries.test.ts.snap
index 63b6c9cde4d0d..632232ffb075d 100644
--- a/x-pack/plugins/apm/server/lib/errors/__snapshots__/queries.test.ts.snap
+++ b/x-pack/plugins/apm/server/lib/errors/__snapshots__/queries.test.ts.snap
@@ -32,7 +32,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -119,7 +119,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -194,7 +194,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
diff --git a/x-pack/plugins/apm/server/lib/errors/distribution/__snapshots__/queries.test.ts.snap b/x-pack/plugins/apm/server/lib/errors/distribution/__snapshots__/queries.test.ts.snap
index ea142ca2acc00..b329499c8b045 100644
--- a/x-pack/plugins/apm/server/lib/errors/distribution/__snapshots__/queries.test.ts.snap
+++ b/x-pack/plugins/apm/server/lib/errors/distribution/__snapshots__/queries.test.ts.snap
@@ -40,7 +40,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -91,7 +91,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
Object {
diff --git a/x-pack/plugins/apm/server/lib/errors/distribution/__tests__/get_buckets.test.ts b/x-pack/plugins/apm/server/lib/errors/distribution/__tests__/get_buckets.test.ts
index 1a83113de35f2..50da1f9c20d16 100644
--- a/x-pack/plugins/apm/server/lib/errors/distribution/__tests__/get_buckets.test.ts
+++ b/x-pack/plugins/apm/server/lib/errors/distribution/__tests__/get_buckets.test.ts
@@ -41,7 +41,10 @@ describe('timeseriesFetcher', () => {
get: () => 'myIndex',
}
) as APMConfig,
- uiFiltersES: [
+ uiFilters: {
+ environment: 'prod',
+ },
+ esFilter: [
{
term: { 'service.environment': 'prod' },
},
diff --git a/x-pack/plugins/apm/server/lib/errors/distribution/get_buckets.ts b/x-pack/plugins/apm/server/lib/errors/distribution/get_buckets.ts
index de6df15354e79..a42710947a792 100644
--- a/x-pack/plugins/apm/server/lib/errors/distribution/get_buckets.ts
+++ b/x-pack/plugins/apm/server/lib/errors/distribution/get_buckets.ts
@@ -11,11 +11,7 @@ import {
SERVICE_NAME,
} from '../../../../common/elasticsearch_fieldnames';
import { rangeFilter } from '../../../../common/utils/range_filter';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../helpers/setup_request';
export async function getBuckets({
serviceName,
@@ -26,13 +22,13 @@ export async function getBuckets({
serviceName: string;
groupId?: string;
bucketSize: number;
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
}) {
- const { start, end, uiFiltersES, apmEventClient } = setup;
+ const { start, end, esFilter, apmEventClient } = setup;
const filter: ESFilter[] = [
{ term: { [SERVICE_NAME]: serviceName } },
{ range: rangeFilter(start, end) },
- ...uiFiltersES,
+ ...esFilter,
];
if (groupId) {
diff --git a/x-pack/plugins/apm/server/lib/errors/distribution/get_distribution.ts b/x-pack/plugins/apm/server/lib/errors/distribution/get_distribution.ts
index 3b48b6c5be594..dea518cad8e40 100644
--- a/x-pack/plugins/apm/server/lib/errors/distribution/get_distribution.ts
+++ b/x-pack/plugins/apm/server/lib/errors/distribution/get_distribution.ts
@@ -5,11 +5,7 @@
*/
import { PromiseReturnType } from '../../../../typings/common';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../helpers/setup_request';
import { getBuckets } from './get_buckets';
import { BUCKET_TARGET_COUNT } from '../../transactions/constants';
@@ -28,7 +24,7 @@ export async function getErrorDistribution({
}: {
serviceName: string;
groupId?: string;
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
}) {
const bucketSize = getBucketSize({ start: setup.start, end: setup.end });
const { buckets, noHits } = await getBuckets({
diff --git a/x-pack/plugins/apm/server/lib/errors/get_error_group.ts b/x-pack/plugins/apm/server/lib/errors/get_error_group.ts
index b23c955b57183..0fbc7720f7111 100644
--- a/x-pack/plugins/apm/server/lib/errors/get_error_group.ts
+++ b/x-pack/plugins/apm/server/lib/errors/get_error_group.ts
@@ -12,11 +12,7 @@ import {
} from '../../../common/elasticsearch_fieldnames';
import { PromiseReturnType } from '../../../typings/common';
import { rangeFilter } from '../../../common/utils/range_filter';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../helpers/setup_request';
import { getTransaction } from '../transactions/get_transaction';
export type ErrorGroupAPIResponse = PromiseReturnType;
@@ -29,9 +25,9 @@ export async function getErrorGroup({
}: {
serviceName: string;
groupId: string;
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
}) {
- const { start, end, uiFiltersES, apmEventClient } = setup;
+ const { start, end, esFilter, apmEventClient } = setup;
const params = {
apm: {
@@ -45,7 +41,7 @@ export async function getErrorGroup({
{ term: { [SERVICE_NAME]: serviceName } },
{ term: { [ERROR_GROUP_ID]: groupId } },
{ range: rangeFilter(start, end) },
- ...uiFiltersES,
+ ...esFilter,
],
should: [{ term: { [TRANSACTION_SAMPLED]: true } }],
},
diff --git a/x-pack/plugins/apm/server/lib/errors/get_error_groups.ts b/x-pack/plugins/apm/server/lib/errors/get_error_groups.ts
index ab1c2149be343..006d2fae3d4fb 100644
--- a/x-pack/plugins/apm/server/lib/errors/get_error_groups.ts
+++ b/x-pack/plugins/apm/server/lib/errors/get_error_groups.ts
@@ -13,11 +13,7 @@ import {
ERROR_LOG_MESSAGE,
} from '../../../common/elasticsearch_fieldnames';
import { PromiseReturnType } from '../../../typings/common';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../helpers/setup_request';
import { getErrorGroupsProjection } from '../../projections/errors';
import { mergeProjection } from '../../projections/util/merge_projection';
import { SortOptions } from '../../../typings/elasticsearch/aggregations';
@@ -35,7 +31,7 @@ export async function getErrorGroups({
serviceName: string;
sortField?: string;
sortDirection?: 'asc' | 'desc';
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
}) {
const { apmEventClient } = setup;
diff --git a/x-pack/plugins/apm/server/lib/helpers/convert_ui_filters/get_ui_filters_es.ts b/x-pack/plugins/apm/server/lib/helpers/convert_ui_filters/get_es_filter.ts
similarity index 96%
rename from x-pack/plugins/apm/server/lib/helpers/convert_ui_filters/get_ui_filters_es.ts
rename to x-pack/plugins/apm/server/lib/helpers/convert_ui_filters/get_es_filter.ts
index c1405b44f2a8a..1b8f32d4de8b9 100644
--- a/x-pack/plugins/apm/server/lib/helpers/convert_ui_filters/get_ui_filters_es.ts
+++ b/x-pack/plugins/apm/server/lib/helpers/convert_ui_filters/get_es_filter.ts
@@ -13,7 +13,7 @@ import {
} from '../../ui_filters/local_ui_filters/config';
import { esKuery } from '../../../../../../../src/plugins/data/server';
-export function getUiFiltersES(uiFilters: UIFilters) {
+export function getEsFilter(uiFilters: UIFilters) {
const { kuery, environment, ...localFilterValues } = uiFilters;
const mappedFilters = localUIFilterNames
.filter((name) => name in localFilterValues)
diff --git a/x-pack/plugins/apm/server/lib/helpers/convert_ui_filters/get_parsed_ui_filters.ts b/x-pack/plugins/apm/server/lib/helpers/convert_ui_filters/get_parsed_ui_filters.ts
deleted file mode 100644
index 324da199807c7..0000000000000
--- a/x-pack/plugins/apm/server/lib/helpers/convert_ui_filters/get_parsed_ui_filters.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License;
- * you may not use this file except in compliance with the Elastic License.
- */
-
-import { Logger } from 'src/core/server';
-import { UIFilters } from '../../../../typings/ui_filters';
-
-export function getParsedUiFilters({
- uiFilters,
- logger,
-}: {
- uiFilters: string;
- logger: Logger;
-}): UIFilters {
- try {
- return JSON.parse(uiFilters);
- } catch (error) {
- logger.error(error);
- }
- return {};
-}
diff --git a/x-pack/plugins/apm/server/lib/helpers/setup_request.ts b/x-pack/plugins/apm/server/lib/helpers/setup_request.ts
index eba75433a5148..26896a050dd88 100644
--- a/x-pack/plugins/apm/server/lib/helpers/setup_request.ts
+++ b/x-pack/plugins/apm/server/lib/helpers/setup_request.ts
@@ -5,6 +5,7 @@
*/
import moment from 'moment';
+import { Logger } from 'kibana/server';
import { isActivePlatinumLicense } from '../../../common/service_map';
import { UI_SETTINGS } from '../../../../../../src/plugins/data/common';
import { KibanaRequest } from '../../../../../../src/core/server';
@@ -14,7 +15,7 @@ import {
ApmIndicesConfig,
} from '../settings/apm_indices/get_apm_indices';
import { ESFilter } from '../../../typings/elasticsearch';
-import { getUiFiltersES } from './convert_ui_filters/get_ui_filters_es';
+import { getEsFilter } from './convert_ui_filters/get_es_filter';
import { APMRequestHandlerContext } from '../../routes/typings';
import { ProcessorEvent } from '../../../common/processor_event';
import {
@@ -25,14 +26,8 @@ import {
APMInternalClient,
createInternalESClient,
} from './create_es_client/create_internal_es_client';
+import { UIFilters } from '../../../typings/ui_filters';
-function decodeUiFilters(uiFiltersEncoded?: string) {
- if (!uiFiltersEncoded) {
- return [];
- }
- const uiFilters = JSON.parse(uiFiltersEncoded);
- return getUiFiltersES(uiFilters);
-}
// Explicitly type Setup to prevent TS initialization errors
// https://github.com/microsoft/TypeScript/issues/34933
@@ -42,6 +37,8 @@ export interface Setup {
ml?: ReturnType;
config: APMConfig;
indices: ApmIndicesConfig;
+ uiFilters: UIFilters;
+ esFilter: ESFilter[];
}
export interface SetupTimeRange {
@@ -49,10 +46,6 @@ export interface SetupTimeRange {
end: number;
}
-export interface SetupUIFilters {
- uiFiltersES: ESFilter[];
-}
-
interface SetupRequestParams {
query?: {
_debug?: boolean;
@@ -65,16 +58,13 @@ interface SetupRequestParams {
type InferSetup = Setup &
(TParams extends { query: { start: string } } ? { start: number } : {}) &
- (TParams extends { query: { end: string } } ? { end: number } : {}) &
- (TParams extends { query: { uiFilters: string } }
- ? { uiFiltersES: ESFilter[] }
- : {});
+ (TParams extends { query: { end: string } } ? { end: number } : {});
export async function setupRequest(
context: APMRequestHandlerContext,
request: KibanaRequest
): Promise> {
- const { config } = context;
+ const { config, logger } = context;
const { query } = context.params;
const [indices, includeFrozen] = await Promise.all([
@@ -85,7 +75,7 @@ export async function setupRequest(
context.core.uiSettings.client.get(UI_SETTINGS.SEARCH_INCLUDE_FROZEN),
]);
- const uiFiltersES = decodeUiFilters(query.uiFilters);
+ const uiFilters = decodeUiFilters(logger, query.uiFilters);
const coreSetupRequest = {
indices,
@@ -108,12 +98,13 @@ export async function setupRequest(
)
: undefined,
config,
+ uiFilters,
+ esFilter: getEsFilter(uiFilters),
};
return {
...('start' in query ? { start: moment.utc(query.start).valueOf() } : {}),
...('end' in query ? { end: moment.utc(query.end).valueOf() } : {}),
- ...('uiFilters' in query ? { uiFiltersES } : {}),
...coreSetupRequest,
} as InferSetup;
}
@@ -129,3 +120,15 @@ function getMlSetup(
modules: ml.modulesProvider(request, savedObjectsClient),
};
}
+
+function decodeUiFilters(logger: Logger, uiFiltersEncoded?: string): UIFilters {
+ if (!uiFiltersEncoded) {
+ return {};
+ }
+ try {
+ return JSON.parse(uiFiltersEncoded);
+ } catch (error) {
+ logger.error(error);
+ return {};
+ }
+}
diff --git a/x-pack/plugins/apm/server/lib/metrics/__snapshots__/queries.test.ts.snap b/x-pack/plugins/apm/server/lib/metrics/__snapshots__/queries.test.ts.snap
index 2868dcfda97b6..961a1eee61d1d 100644
--- a/x-pack/plugins/apm/server/lib/metrics/__snapshots__/queries.test.ts.snap
+++ b/x-pack/plugins/apm/server/lib/metrics/__snapshots__/queries.test.ts.snap
@@ -87,7 +87,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -175,7 +175,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
Object {
@@ -206,7 +206,7 @@ Object {
"lang": "painless",
"source": "
/*
- When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
+ When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
This number represents the max possible value for the limit field.
*/
double CGROUP_LIMIT_MAX_VALUE = 9223372036854771712L;
@@ -231,7 +231,7 @@ Object {
"lang": "painless",
"source": "
/*
- When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
+ When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
This number represents the max possible value for the limit field.
*/
double CGROUP_LIMIT_MAX_VALUE = 9223372036854771712L;
@@ -258,7 +258,7 @@ Object {
"lang": "painless",
"source": "
/*
- When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
+ When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
This number represents the max possible value for the limit field.
*/
double CGROUP_LIMIT_MAX_VALUE = 9223372036854771712L;
@@ -283,7 +283,7 @@ Object {
"lang": "painless",
"source": "
/*
- When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
+ When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
This number represents the max possible value for the limit field.
*/
double CGROUP_LIMIT_MAX_VALUE = 9223372036854771712L;
@@ -338,7 +338,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
Object {
@@ -431,7 +431,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
Object {
@@ -514,7 +514,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
Object {
@@ -623,7 +623,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -717,7 +717,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
Object {
@@ -748,7 +748,7 @@ Object {
"lang": "painless",
"source": "
/*
- When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
+ When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
This number represents the max possible value for the limit field.
*/
double CGROUP_LIMIT_MAX_VALUE = 9223372036854771712L;
@@ -773,7 +773,7 @@ Object {
"lang": "painless",
"source": "
/*
- When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
+ When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
This number represents the max possible value for the limit field.
*/
double CGROUP_LIMIT_MAX_VALUE = 9223372036854771712L;
@@ -800,7 +800,7 @@ Object {
"lang": "painless",
"source": "
/*
- When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
+ When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
This number represents the max possible value for the limit field.
*/
double CGROUP_LIMIT_MAX_VALUE = 9223372036854771712L;
@@ -825,7 +825,7 @@ Object {
"lang": "painless",
"source": "
/*
- When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
+ When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
This number represents the max possible value for the limit field.
*/
double CGROUP_LIMIT_MAX_VALUE = 9223372036854771712L;
@@ -886,7 +886,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
Object {
@@ -985,7 +985,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
Object {
@@ -1074,7 +1074,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
Object {
@@ -1172,7 +1172,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -1255,7 +1255,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
Object {
@@ -1286,7 +1286,7 @@ Object {
"lang": "painless",
"source": "
/*
- When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
+ When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
This number represents the max possible value for the limit field.
*/
double CGROUP_LIMIT_MAX_VALUE = 9223372036854771712L;
@@ -1311,7 +1311,7 @@ Object {
"lang": "painless",
"source": "
/*
- When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
+ When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
This number represents the max possible value for the limit field.
*/
double CGROUP_LIMIT_MAX_VALUE = 9223372036854771712L;
@@ -1338,7 +1338,7 @@ Object {
"lang": "painless",
"source": "
/*
- When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
+ When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
This number represents the max possible value for the limit field.
*/
double CGROUP_LIMIT_MAX_VALUE = 9223372036854771712L;
@@ -1363,7 +1363,7 @@ Object {
"lang": "painless",
"source": "
/*
- When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
+ When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
This number represents the max possible value for the limit field.
*/
double CGROUP_LIMIT_MAX_VALUE = 9223372036854771712L;
@@ -1413,7 +1413,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
Object {
@@ -1501,7 +1501,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
Object {
@@ -1579,7 +1579,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
Object {
diff --git a/x-pack/plugins/apm/server/lib/metrics/by_agent/default.ts b/x-pack/plugins/apm/server/lib/metrics/by_agent/default.ts
index 6ee507d7b9bb1..fbcbc9f12791f 100644
--- a/x-pack/plugins/apm/server/lib/metrics/by_agent/default.ts
+++ b/x-pack/plugins/apm/server/lib/metrics/by_agent/default.ts
@@ -4,16 +4,12 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../helpers/setup_request';
import { getCPUChartData } from './shared/cpu';
import { getMemoryChartData } from './shared/memory';
export async function getDefaultMetricsCharts(
- setup: Setup & SetupTimeRange & SetupUIFilters,
+ setup: Setup & SetupTimeRange,
serviceName: string
) {
const charts = await Promise.all([
diff --git a/x-pack/plugins/apm/server/lib/metrics/by_agent/java/gc/fetch_and_transform_gc_metrics.ts b/x-pack/plugins/apm/server/lib/metrics/by_agent/java/gc/fetch_and_transform_gc_metrics.ts
index d7e64bdcacd12..2ed11480a7585 100644
--- a/x-pack/plugins/apm/server/lib/metrics/by_agent/java/gc/fetch_and_transform_gc_metrics.ts
+++ b/x-pack/plugins/apm/server/lib/metrics/by_agent/java/gc/fetch_and_transform_gc_metrics.ts
@@ -11,11 +11,7 @@
import { sum, round } from 'lodash';
import theme from '@elastic/eui/dist/eui_theme_light.json';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../../../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../../../helpers/setup_request';
import { getMetricsDateHistogramParams } from '../../../../helpers/metrics';
import { ChartBase } from '../../../types';
import { getMetricsProjection } from '../../../../../projections/metrics';
@@ -36,7 +32,7 @@ export async function fetchAndTransformGcMetrics({
chartBase,
fieldName,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
serviceName: string;
serviceNodeName?: string;
chartBase: ChartBase;
diff --git a/x-pack/plugins/apm/server/lib/metrics/by_agent/java/gc/get_gc_rate_chart.ts b/x-pack/plugins/apm/server/lib/metrics/by_agent/java/gc/get_gc_rate_chart.ts
index 6e562b9a8ee87..7cedeb828e3b7 100644
--- a/x-pack/plugins/apm/server/lib/metrics/by_agent/java/gc/get_gc_rate_chart.ts
+++ b/x-pack/plugins/apm/server/lib/metrics/by_agent/java/gc/get_gc_rate_chart.ts
@@ -7,11 +7,7 @@
import theme from '@elastic/eui/dist/eui_theme_light.json';
import { i18n } from '@kbn/i18n';
import { METRIC_JAVA_GC_COUNT } from '../../../../../../common/elasticsearch_fieldnames';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../../../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../../../helpers/setup_request';
import { fetchAndTransformGcMetrics } from './fetch_and_transform_gc_metrics';
import { ChartBase } from '../../../types';
@@ -35,7 +31,7 @@ const chartBase: ChartBase = {
};
const getGcRateChart = (
- setup: Setup & SetupTimeRange & SetupUIFilters,
+ setup: Setup & SetupTimeRange,
serviceName: string,
serviceNodeName?: string
) => {
diff --git a/x-pack/plugins/apm/server/lib/metrics/by_agent/java/gc/get_gc_time_chart.ts b/x-pack/plugins/apm/server/lib/metrics/by_agent/java/gc/get_gc_time_chart.ts
index 0b9d6240fc1c9..f21d3d8e7c056 100644
--- a/x-pack/plugins/apm/server/lib/metrics/by_agent/java/gc/get_gc_time_chart.ts
+++ b/x-pack/plugins/apm/server/lib/metrics/by_agent/java/gc/get_gc_time_chart.ts
@@ -7,11 +7,7 @@
import theme from '@elastic/eui/dist/eui_theme_light.json';
import { i18n } from '@kbn/i18n';
import { METRIC_JAVA_GC_TIME } from '../../../../../../common/elasticsearch_fieldnames';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../../../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../../../helpers/setup_request';
import { fetchAndTransformGcMetrics } from './fetch_and_transform_gc_metrics';
import { ChartBase } from '../../../types';
@@ -35,7 +31,7 @@ const chartBase: ChartBase = {
};
const getGcTimeChart = (
- setup: Setup & SetupTimeRange & SetupUIFilters,
+ setup: Setup & SetupTimeRange,
serviceName: string,
serviceNodeName?: string
) => {
diff --git a/x-pack/plugins/apm/server/lib/metrics/by_agent/java/heap_memory/index.ts b/x-pack/plugins/apm/server/lib/metrics/by_agent/java/heap_memory/index.ts
index ba3183c0fa7d7..eb79897f9f055 100644
--- a/x-pack/plugins/apm/server/lib/metrics/by_agent/java/heap_memory/index.ts
+++ b/x-pack/plugins/apm/server/lib/metrics/by_agent/java/heap_memory/index.ts
@@ -12,11 +12,7 @@ import {
METRIC_JAVA_HEAP_MEMORY_USED,
AGENT_NAME,
} from '../../../../../../common/elasticsearch_fieldnames';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../../../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../../../helpers/setup_request';
import { fetchAndTransformMetrics } from '../../../fetch_and_transform_metrics';
import { ChartBase } from '../../../types';
@@ -55,7 +51,7 @@ const chartBase: ChartBase = {
};
export async function getHeapMemoryChart(
- setup: Setup & SetupTimeRange & SetupUIFilters,
+ setup: Setup & SetupTimeRange,
serviceName: string,
serviceNodeName?: string
) {
diff --git a/x-pack/plugins/apm/server/lib/metrics/by_agent/java/index.ts b/x-pack/plugins/apm/server/lib/metrics/by_agent/java/index.ts
index 21caab6590fc4..d4084701f0f49 100644
--- a/x-pack/plugins/apm/server/lib/metrics/by_agent/java/index.ts
+++ b/x-pack/plugins/apm/server/lib/metrics/by_agent/java/index.ts
@@ -5,11 +5,7 @@
*/
import { getHeapMemoryChart } from './heap_memory';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../../helpers/setup_request';
import { getNonHeapMemoryChart } from './non_heap_memory';
import { getThreadCountChart } from './thread_count';
import { getCPUChartData } from '../shared/cpu';
@@ -18,7 +14,7 @@ import { getGcRateChart } from './gc/get_gc_rate_chart';
import { getGcTimeChart } from './gc/get_gc_time_chart';
export async function getJavaMetricsCharts(
- setup: Setup & SetupTimeRange & SetupUIFilters,
+ setup: Setup & SetupTimeRange,
serviceName: string,
serviceNodeName?: string
) {
diff --git a/x-pack/plugins/apm/server/lib/metrics/by_agent/java/non_heap_memory/index.ts b/x-pack/plugins/apm/server/lib/metrics/by_agent/java/non_heap_memory/index.ts
index 1a2d5bd0b0e68..50cc449da3c15 100644
--- a/x-pack/plugins/apm/server/lib/metrics/by_agent/java/non_heap_memory/index.ts
+++ b/x-pack/plugins/apm/server/lib/metrics/by_agent/java/non_heap_memory/index.ts
@@ -12,11 +12,7 @@ import {
METRIC_JAVA_NON_HEAP_MEMORY_USED,
AGENT_NAME,
} from '../../../../../../common/elasticsearch_fieldnames';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../../../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../../../helpers/setup_request';
import { ChartBase } from '../../../types';
import { fetchAndTransformMetrics } from '../../../fetch_and_transform_metrics';
@@ -52,7 +48,7 @@ const chartBase: ChartBase = {
};
export async function getNonHeapMemoryChart(
- setup: Setup & SetupUIFilters & SetupTimeRange,
+ setup: Setup & SetupTimeRange,
serviceName: string,
serviceNodeName?: string
) {
diff --git a/x-pack/plugins/apm/server/lib/metrics/by_agent/java/thread_count/index.ts b/x-pack/plugins/apm/server/lib/metrics/by_agent/java/thread_count/index.ts
index 01cc6d8495244..0062f0a423970 100644
--- a/x-pack/plugins/apm/server/lib/metrics/by_agent/java/thread_count/index.ts
+++ b/x-pack/plugins/apm/server/lib/metrics/by_agent/java/thread_count/index.ts
@@ -10,11 +10,7 @@ import {
METRIC_JAVA_THREAD_COUNT,
AGENT_NAME,
} from '../../../../../../common/elasticsearch_fieldnames';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../../../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../../../helpers/setup_request';
import { ChartBase } from '../../../types';
import { fetchAndTransformMetrics } from '../../../fetch_and_transform_metrics';
@@ -44,7 +40,7 @@ const chartBase: ChartBase = {
};
export async function getThreadCountChart(
- setup: Setup & SetupTimeRange & SetupUIFilters,
+ setup: Setup & SetupTimeRange,
serviceName: string,
serviceNodeName?: string
) {
diff --git a/x-pack/plugins/apm/server/lib/metrics/by_agent/shared/cpu/index.ts b/x-pack/plugins/apm/server/lib/metrics/by_agent/shared/cpu/index.ts
index 066ef40b4ab6c..ca642aa12fff1 100644
--- a/x-pack/plugins/apm/server/lib/metrics/by_agent/shared/cpu/index.ts
+++ b/x-pack/plugins/apm/server/lib/metrics/by_agent/shared/cpu/index.ts
@@ -10,11 +10,7 @@ import {
METRIC_SYSTEM_CPU_PERCENT,
METRIC_PROCESS_CPU_PERCENT,
} from '../../../../../../common/elasticsearch_fieldnames';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../../../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../../../helpers/setup_request';
import { ChartBase } from '../../../types';
import { fetchAndTransformMetrics } from '../../../fetch_and_transform_metrics';
@@ -56,7 +52,7 @@ const chartBase: ChartBase = {
};
export async function getCPUChartData(
- setup: Setup & SetupTimeRange & SetupUIFilters,
+ setup: Setup & SetupTimeRange,
serviceName: string,
serviceNodeName?: string
) {
diff --git a/x-pack/plugins/apm/server/lib/metrics/by_agent/shared/memory/index.ts b/x-pack/plugins/apm/server/lib/metrics/by_agent/shared/memory/index.ts
index a60576ca0c175..e6ee47cc815ef 100644
--- a/x-pack/plugins/apm/server/lib/metrics/by_agent/shared/memory/index.ts
+++ b/x-pack/plugins/apm/server/lib/metrics/by_agent/shared/memory/index.ts
@@ -11,11 +11,7 @@ import {
METRIC_SYSTEM_FREE_MEMORY,
METRIC_SYSTEM_TOTAL_MEMORY,
} from '../../../../../../common/elasticsearch_fieldnames';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../../../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../../../helpers/setup_request';
import { fetchAndTransformMetrics } from '../../../fetch_and_transform_metrics';
import { ChartBase } from '../../../types';
@@ -54,7 +50,7 @@ export const percentCgroupMemoryUsedScript = {
lang: 'painless',
source: `
/*
- When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
+ When no limit is specified in the container, docker allows the app as much memory / swap memory as it wants.
This number represents the max possible value for the limit field.
*/
double CGROUP_LIMIT_MAX_VALUE = 9223372036854771712L;
@@ -73,7 +69,7 @@ export const percentCgroupMemoryUsedScript = {
};
export async function getMemoryChartData(
- setup: Setup & SetupTimeRange & SetupUIFilters,
+ setup: Setup & SetupTimeRange,
serviceName: string,
serviceNodeName?: string
) {
diff --git a/x-pack/plugins/apm/server/lib/metrics/fetch_and_transform_metrics.ts b/x-pack/plugins/apm/server/lib/metrics/fetch_and_transform_metrics.ts
index a42a10d6518a0..3ccba8c7586dc 100644
--- a/x-pack/plugins/apm/server/lib/metrics/fetch_and_transform_metrics.ts
+++ b/x-pack/plugins/apm/server/lib/metrics/fetch_and_transform_metrics.ts
@@ -5,11 +5,7 @@
*/
import { Unionize, Overwrite } from 'utility-types';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../helpers/setup_request';
import { getMetricsDateHistogramParams } from '../helpers/metrics';
import { ChartBase } from './types';
import { transformDataToMetricsChart } from './transform_metrics_chart';
@@ -58,7 +54,7 @@ export async function fetchAndTransformMetrics({
aggs,
additionalFilters = [],
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
serviceName: string;
serviceNodeName?: string;
chartBase: ChartBase;
diff --git a/x-pack/plugins/apm/server/lib/metrics/get_metrics_chart_data_by_agent.ts b/x-pack/plugins/apm/server/lib/metrics/get_metrics_chart_data_by_agent.ts
index 059e1ce48c83d..72cd65deebff6 100644
--- a/x-pack/plugins/apm/server/lib/metrics/get_metrics_chart_data_by_agent.ts
+++ b/x-pack/plugins/apm/server/lib/metrics/get_metrics_chart_data_by_agent.ts
@@ -3,11 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../helpers/setup_request';
import { getJavaMetricsCharts } from './by_agent/java';
import { getDefaultMetricsCharts } from './by_agent/default';
import { GenericMetricsChart } from './transform_metrics_chart';
@@ -22,7 +18,7 @@ export async function getMetricsChartDataByAgent({
serviceNodeName,
agentName,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
serviceName: string;
serviceNodeName?: string;
agentName: string;
diff --git a/x-pack/plugins/apm/server/lib/rum_client/__snapshots__/queries.test.ts.snap b/x-pack/plugins/apm/server/lib/rum_client/__snapshots__/queries.test.ts.snap
index dcafe09221164..1fafa08082443 100644
--- a/x-pack/plugins/apm/server/lib/rum_client/__snapshots__/queries.test.ts.snap
+++ b/x-pack/plugins/apm/server/lib/rum_client/__snapshots__/queries.test.ts.snap
@@ -61,7 +61,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -151,7 +151,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -230,7 +230,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -500,7 +500,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -552,7 +552,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -667,7 +667,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
Object {
@@ -723,7 +723,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
diff --git a/x-pack/plugins/apm/server/lib/rum_client/get_client_metrics.ts b/x-pack/plugins/apm/server/lib/rum_client/get_client_metrics.ts
index 6566ea4f5e29b..6d596246d6af9 100644
--- a/x-pack/plugins/apm/server/lib/rum_client/get_client_metrics.ts
+++ b/x-pack/plugins/apm/server/lib/rum_client/get_client_metrics.ts
@@ -7,11 +7,7 @@
import { TRANSACTION_DURATION } from '../../../common/elasticsearch_fieldnames';
import { getRumPageLoadTransactionsProjection } from '../../projections/rum_page_load_transactions';
import { mergeProjection } from '../../projections/util/merge_projection';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../helpers/setup_request';
import {
TRANSACTION_DOM_INTERACTIVE,
TRANSACTION_TIME_TO_FIRST_BYTE,
@@ -22,7 +18,7 @@ export async function getClientMetrics({
urlQuery,
percentile = 50,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
urlQuery?: string;
percentile?: number;
}) {
diff --git a/x-pack/plugins/apm/server/lib/rum_client/get_js_errors.ts b/x-pack/plugins/apm/server/lib/rum_client/get_js_errors.ts
index 0540ea4bf09dd..a8a4e2714c86e 100644
--- a/x-pack/plugins/apm/server/lib/rum_client/get_js_errors.ts
+++ b/x-pack/plugins/apm/server/lib/rum_client/get_js_errors.ts
@@ -5,11 +5,7 @@
*/
import { mergeProjection } from '../../projections/util/merge_projection';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../helpers/setup_request';
import { getRumErrorsProjection } from '../../projections/rum_page_load_transactions';
import {
ERROR_EXC_MESSAGE,
@@ -23,7 +19,7 @@ export async function getJSErrors({
pageSize,
pageIndex,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
pageSize: number;
pageIndex: number;
}) {
diff --git a/x-pack/plugins/apm/server/lib/rum_client/get_long_task_metrics.ts b/x-pack/plugins/apm/server/lib/rum_client/get_long_task_metrics.ts
index c2c86ae05d57c..dfb31de8f10f7 100644
--- a/x-pack/plugins/apm/server/lib/rum_client/get_long_task_metrics.ts
+++ b/x-pack/plugins/apm/server/lib/rum_client/get_long_task_metrics.ts
@@ -6,11 +6,7 @@
import { getRumPageLoadTransactionsProjection } from '../../projections/rum_page_load_transactions';
import { mergeProjection } from '../../projections/util/merge_projection';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../helpers/setup_request';
const LONG_TASK_SUM_FIELD = 'transaction.experience.longtask.sum';
const LONG_TASK_COUNT_FIELD = 'transaction.experience.longtask.count';
@@ -21,7 +17,7 @@ export async function getLongTaskMetrics({
urlQuery,
percentile = 50,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
urlQuery?: string;
percentile?: number;
}) {
diff --git a/x-pack/plugins/apm/server/lib/rum_client/get_page_load_distribution.ts b/x-pack/plugins/apm/server/lib/rum_client/get_page_load_distribution.ts
index 5f666feb8a18f..225afff2818ab 100644
--- a/x-pack/plugins/apm/server/lib/rum_client/get_page_load_distribution.ts
+++ b/x-pack/plugins/apm/server/lib/rum_client/get_page_load_distribution.ts
@@ -7,11 +7,7 @@
import { TRANSACTION_DURATION } from '../../../common/elasticsearch_fieldnames';
import { getRumPageLoadTransactionsProjection } from '../../projections/rum_page_load_transactions';
import { mergeProjection } from '../../projections/util/merge_projection';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../helpers/setup_request';
export const MICRO_TO_SEC = 1000000;
@@ -56,7 +52,7 @@ export async function getPageLoadDistribution({
maxPercentile,
urlQuery,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
minPercentile?: string;
maxPercentile?: string;
urlQuery?: string;
@@ -168,7 +164,7 @@ const getPercentilesDistribution = async ({
minDuration,
maxDuration,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
minDuration: number;
maxDuration: number;
}) => {
diff --git a/x-pack/plugins/apm/server/lib/rum_client/get_page_view_trends.ts b/x-pack/plugins/apm/server/lib/rum_client/get_page_view_trends.ts
index 40f8a8bc58a54..c1a602c33feae 100644
--- a/x-pack/plugins/apm/server/lib/rum_client/get_page_view_trends.ts
+++ b/x-pack/plugins/apm/server/lib/rum_client/get_page_view_trends.ts
@@ -5,11 +5,7 @@
*/
import { getRumPageLoadTransactionsProjection } from '../../projections/rum_page_load_transactions';
import { mergeProjection } from '../../projections/util/merge_projection';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../helpers/setup_request';
import { BreakdownItem } from '../../../typings/ui_filters';
export async function getPageViewTrends({
@@ -17,7 +13,7 @@ export async function getPageViewTrends({
breakdowns,
urlQuery,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
breakdowns?: string;
urlQuery?: string;
}) {
diff --git a/x-pack/plugins/apm/server/lib/rum_client/get_pl_dist_breakdown.ts b/x-pack/plugins/apm/server/lib/rum_client/get_pl_dist_breakdown.ts
index bebf9c0bc99c9..e2ec59d232b21 100644
--- a/x-pack/plugins/apm/server/lib/rum_client/get_pl_dist_breakdown.ts
+++ b/x-pack/plugins/apm/server/lib/rum_client/get_pl_dist_breakdown.ts
@@ -7,11 +7,7 @@
import { getRumPageLoadTransactionsProjection } from '../../projections/rum_page_load_transactions';
import { ProcessorEvent } from '../../../common/processor_event';
import { mergeProjection } from '../../projections/util/merge_projection';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../helpers/setup_request';
import {
CLIENT_GEO_COUNTRY_ISO_CODE,
USER_AGENT_DEVICE,
@@ -46,7 +42,7 @@ export const getPageLoadDistBreakdown = async ({
breakdown,
urlQuery,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
minPercentile: number;
maxPercentile: number;
breakdown: string;
diff --git a/x-pack/plugins/apm/server/lib/rum_client/get_rum_services.ts b/x-pack/plugins/apm/server/lib/rum_client/get_rum_services.ts
index 3adad0868ed4b..e9bd203e354cb 100644
--- a/x-pack/plugins/apm/server/lib/rum_client/get_rum_services.ts
+++ b/x-pack/plugins/apm/server/lib/rum_client/get_rum_services.ts
@@ -5,18 +5,14 @@
*/
import { SERVICE_NAME } from '../../../common/elasticsearch_fieldnames';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../helpers/setup_request';
import { getRumPageLoadTransactionsProjection } from '../../projections/rum_page_load_transactions';
import { mergeProjection } from '../../projections/util/merge_projection';
export async function getRumServices({
setup,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
}) {
const projection = getRumPageLoadTransactionsProjection({
setup,
diff --git a/x-pack/plugins/apm/server/lib/rum_client/get_url_search.ts b/x-pack/plugins/apm/server/lib/rum_client/get_url_search.ts
index 6aa39c7ef961f..febfd66897e18 100644
--- a/x-pack/plugins/apm/server/lib/rum_client/get_url_search.ts
+++ b/x-pack/plugins/apm/server/lib/rum_client/get_url_search.ts
@@ -5,11 +5,7 @@
*/
import { mergeProjection } from '../../projections/util/merge_projection';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../helpers/setup_request';
import { getRumPageLoadTransactionsProjection } from '../../projections/rum_page_load_transactions';
import {
TRANSACTION_DURATION,
@@ -21,7 +17,7 @@ export async function getUrlSearch({
urlQuery,
percentile,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
urlQuery?: string;
percentile: number;
}) {
diff --git a/x-pack/plugins/apm/server/lib/rum_client/get_visitor_breakdown.ts b/x-pack/plugins/apm/server/lib/rum_client/get_visitor_breakdown.ts
index 52d089e4e29c9..6350bc2c07016 100644
--- a/x-pack/plugins/apm/server/lib/rum_client/get_visitor_breakdown.ts
+++ b/x-pack/plugins/apm/server/lib/rum_client/get_visitor_breakdown.ts
@@ -6,11 +6,7 @@
import { getRumPageLoadTransactionsProjection } from '../../projections/rum_page_load_transactions';
import { mergeProjection } from '../../projections/util/merge_projection';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../helpers/setup_request';
import {
USER_AGENT_NAME,
USER_AGENT_OS,
@@ -20,7 +16,7 @@ export async function getVisitorBreakdown({
setup,
urlQuery,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
urlQuery?: string;
}) {
const projection = getRumPageLoadTransactionsProjection({
diff --git a/x-pack/plugins/apm/server/lib/rum_client/get_web_core_vitals.ts b/x-pack/plugins/apm/server/lib/rum_client/get_web_core_vitals.ts
index 676b3506397a7..c5baf0b529eb4 100644
--- a/x-pack/plugins/apm/server/lib/rum_client/get_web_core_vitals.ts
+++ b/x-pack/plugins/apm/server/lib/rum_client/get_web_core_vitals.ts
@@ -6,11 +6,7 @@
import { getRumPageLoadTransactionsProjection } from '../../projections/rum_page_load_transactions';
import { mergeProjection } from '../../projections/util/merge_projection';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../helpers/setup_request';
import {
CLS_FIELD,
FCP_FIELD,
@@ -25,7 +21,7 @@ export async function getWebCoreVitals({
urlQuery,
percentile = 50,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
urlQuery?: string;
percentile?: number;
}) {
diff --git a/x-pack/plugins/apm/server/lib/service_map/get_service_map.ts b/x-pack/plugins/apm/server/lib/service_map/get_service_map.ts
index 75acebe7ed56c..330bb936c9e88 100644
--- a/x-pack/plugins/apm/server/lib/service_map/get_service_map.ts
+++ b/x-pack/plugins/apm/server/lib/service_map/get_service_map.ts
@@ -82,7 +82,7 @@ async function getServicesData(options: IEnvOptions) {
const { setup, searchAggregatedTransactions } = options;
const projection = getServicesProjection({
- setup: { ...setup, uiFiltersES: [] },
+ setup: { ...setup, esFilter: [] },
searchAggregatedTransactions,
});
diff --git a/x-pack/plugins/apm/server/lib/service_map/get_service_map_service_node_info.test.ts b/x-pack/plugins/apm/server/lib/service_map/get_service_map_service_node_info.test.ts
index 7af1607697ef3..eb2ddbf38b274 100644
--- a/x-pack/plugins/apm/server/lib/service_map/get_service_map_service_node_info.test.ts
+++ b/x-pack/plugins/apm/server/lib/service_map/get_service_map_service_node_info.test.ts
@@ -19,11 +19,10 @@ describe('getServiceMapServiceNodeInfo', () => {
}),
},
indices: {},
+ uiFilters: { environment: 'test environment' },
} as unknown) as Setup & SetupTimeRange;
- const environment = 'test environment';
const serviceName = 'test service name';
const result = await getServiceMapServiceNodeInfo({
- uiFilters: { environment },
setup,
serviceName,
searchAggregatedTransactions: false,
@@ -67,11 +66,10 @@ describe('getServiceMapServiceNodeInfo', () => {
config: {
'xpack.apm.metricsInterval': 30,
},
+ uiFilters: { environment: 'test environment' },
} as unknown) as Setup & SetupTimeRange;
- const environment = 'test environment';
const serviceName = 'test service name';
const result = await getServiceMapServiceNodeInfo({
- uiFilters: { environment },
setup,
serviceName,
searchAggregatedTransactions: false,
diff --git a/x-pack/plugins/apm/server/lib/service_map/get_service_map_service_node_info.ts b/x-pack/plugins/apm/server/lib/service_map/get_service_map_service_node_info.ts
index 7c2137ce65d83..37b34641435fb 100644
--- a/x-pack/plugins/apm/server/lib/service_map/get_service_map_service_node_info.ts
+++ b/x-pack/plugins/apm/server/lib/service_map/get_service_map_service_node_info.ts
@@ -8,7 +8,6 @@ import {
TRANSACTION_REQUEST,
TRANSACTION_PAGE_LOAD,
} from '../../../common/transaction_types';
-import { UIFilters } from '../../../typings/ui_filters';
import {
SERVICE_NAME,
METRIC_SYSTEM_CPU_PERCENT,
@@ -53,9 +52,8 @@ export async function getServiceMapServiceNodeInfo({
serviceName,
setup,
searchAggregatedTransactions,
- uiFilters,
-}: Options & { serviceName: string; uiFilters: UIFilters }) {
- const { start, end } = setup;
+}: Options & { serviceName: string }) {
+ const { start, end, uiFilters } = setup;
const filter: ESFilter[] = [
{ range: rangeFilter(start, end) },
@@ -105,7 +103,8 @@ async function getErrorStats({
}) {
const setupWithBlankUiFilters = {
...setup,
- uiFiltersES: getEnvironmentUiFilterES(environment),
+ uiFilters: { environment },
+ esFilter: getEnvironmentUiFilterES(environment),
};
const { noHits, average } = await getErrorRate({
setup: setupWithBlankUiFilters,
diff --git a/x-pack/plugins/apm/server/lib/service_map/mock_responses/group_resource_nodes_grouped.json b/x-pack/plugins/apm/server/lib/service_map/mock_responses/group_resource_nodes_grouped.json
index e7bba585de180..94c508fe90230 100644
--- a/x-pack/plugins/apm/server/lib/service_map/mock_responses/group_resource_nodes_grouped.json
+++ b/x-pack/plugins/apm/server/lib/service_map/mock_responses/group_resource_nodes_grouped.json
@@ -3,7 +3,7 @@
{
"data": {
"id": "opbeans-rum",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-rum",
"agent.name": "rum-js"
}
@@ -18,7 +18,7 @@
{
"data": {
"id": "opbeans-node",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-node",
"agent.name": "nodejs"
}
diff --git a/x-pack/plugins/apm/server/lib/service_map/mock_responses/group_resource_nodes_pregrouped.json b/x-pack/plugins/apm/server/lib/service_map/mock_responses/group_resource_nodes_pregrouped.json
index 22c5c50de7472..58469f607ac13 100644
--- a/x-pack/plugins/apm/server/lib/service_map/mock_responses/group_resource_nodes_pregrouped.json
+++ b/x-pack/plugins/apm/server/lib/service_map/mock_responses/group_resource_nodes_pregrouped.json
@@ -3,7 +3,7 @@
{
"data": {
"id": "opbeans-rum",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-rum",
"agent.name": "rum-js"
}
@@ -18,7 +18,7 @@
{
"data": {
"id": "opbeans-node",
- "service.environment": "testing",
+ "service.environment": "test",
"service.name": "opbeans-node",
"agent.name": "nodejs"
}
diff --git a/x-pack/plugins/apm/server/lib/service_nodes/__snapshots__/queries.test.ts.snap b/x-pack/plugins/apm/server/lib/service_nodes/__snapshots__/queries.test.ts.snap
index 87aca0d056909..d83e558775be4 100644
--- a/x-pack/plugins/apm/server/lib/service_nodes/__snapshots__/queries.test.ts.snap
+++ b/x-pack/plugins/apm/server/lib/service_nodes/__snapshots__/queries.test.ts.snap
@@ -51,7 +51,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -119,7 +119,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -188,7 +188,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
diff --git a/x-pack/plugins/apm/server/lib/service_nodes/index.ts b/x-pack/plugins/apm/server/lib/service_nodes/index.ts
index a83aba192dba9..d5e29532e3d7b 100644
--- a/x-pack/plugins/apm/server/lib/service_nodes/index.ts
+++ b/x-pack/plugins/apm/server/lib/service_nodes/index.ts
@@ -4,11 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../helpers/setup_request';
import { getServiceNodesProjection } from '../../projections/service_nodes';
import { mergeProjection } from '../../projections/util/merge_projection';
import { SERVICE_NODE_NAME_MISSING } from '../../../common/service_nodes';
@@ -23,7 +19,7 @@ const getServiceNodes = async ({
setup,
serviceName,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
serviceName: string;
}) => {
const { apmEventClient } = setup;
diff --git a/x-pack/plugins/apm/server/lib/services/__snapshots__/queries.test.ts.snap b/x-pack/plugins/apm/server/lib/services/__snapshots__/queries.test.ts.snap
index 431f11066aaff..3a38f80c87b35 100644
--- a/x-pack/plugins/apm/server/lib/services/__snapshots__/queries.test.ts.snap
+++ b/x-pack/plugins/apm/server/lib/services/__snapshots__/queries.test.ts.snap
@@ -144,7 +144,7 @@ Array [
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -194,7 +194,7 @@ Array [
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -257,7 +257,7 @@ Array [
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -334,7 +334,7 @@ Array [
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
Object {
@@ -389,7 +389,7 @@ Array [
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
diff --git a/x-pack/plugins/apm/server/lib/services/get_service_node_metadata.ts b/x-pack/plugins/apm/server/lib/services/get_service_node_metadata.ts
index fca472b0ce8c2..d6ba9f5447ba5 100644
--- a/x-pack/plugins/apm/server/lib/services/get_service_node_metadata.ts
+++ b/x-pack/plugins/apm/server/lib/services/get_service_node_metadata.ts
@@ -4,11 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../helpers/setup_request';
import {
HOST_NAME,
CONTAINER_ID,
@@ -24,7 +20,7 @@ export async function getServiceNodeMetadata({
}: {
serviceName: string;
serviceNodeName: string;
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
}) {
const { apmEventClient } = setup;
diff --git a/x-pack/plugins/apm/server/lib/services/get_services/get_services_items.ts b/x-pack/plugins/apm/server/lib/services/get_services/get_services_items.ts
index c09be7aacc784..092485c46fb08 100644
--- a/x-pack/plugins/apm/server/lib/services/get_services/get_services_items.ts
+++ b/x-pack/plugins/apm/server/lib/services/get_services/get_services_items.ts
@@ -5,11 +5,7 @@
*/
import { joinByKey } from '../../../../common/utils/join_by_key';
import { PromiseReturnType } from '../../../../typings/common';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../helpers/setup_request';
import { getServicesProjection } from '../../../projections/services';
import {
getTransactionDurationAverages,
@@ -21,17 +17,15 @@ import {
} from './get_services_items_stats';
export type ServiceListAPIResponse = PromiseReturnType;
-export type ServicesItemsSetup = Setup & SetupTimeRange & SetupUIFilters;
+export type ServicesItemsSetup = Setup & SetupTimeRange;
export type ServicesItemsProjection = ReturnType;
export async function getServicesItems({
setup,
searchAggregatedTransactions,
- mlAnomaliesEnvironment,
}: {
setup: ServicesItemsSetup;
searchAggregatedTransactions: boolean;
- mlAnomaliesEnvironment?: string;
}) {
const params = {
projection: getServicesProjection({
@@ -55,7 +49,7 @@ export async function getServicesItems({
getTransactionRates(params),
getTransactionErrorRates(params),
getEnvironments(params),
- getHealthStatuses(params, mlAnomaliesEnvironment),
+ getHealthStatuses(params, setup.uiFilters.environment),
]);
const allMetrics = [
diff --git a/x-pack/plugins/apm/server/lib/services/get_services/index.ts b/x-pack/plugins/apm/server/lib/services/get_services/index.ts
index 351457b2a815e..04744a9c791bb 100644
--- a/x-pack/plugins/apm/server/lib/services/get_services/index.ts
+++ b/x-pack/plugins/apm/server/lib/services/get_services/index.ts
@@ -6,11 +6,7 @@
import { isEmpty } from 'lodash';
import { PromiseReturnType } from '../../../../typings/common';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../helpers/setup_request';
import { hasHistoricalAgentData } from './has_historical_agent_data';
import { getLegacyDataStatus } from './get_legacy_data_status';
import { getServicesItems } from './get_services_items';
@@ -20,17 +16,14 @@ export type ServiceListAPIResponse = PromiseReturnType;
export async function getServices({
setup,
searchAggregatedTransactions,
- mlAnomaliesEnvironment,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
searchAggregatedTransactions: boolean;
- mlAnomaliesEnvironment?: string;
}) {
const [items, hasLegacyData] = await Promise.all([
getServicesItems({
setup,
searchAggregatedTransactions,
- mlAnomaliesEnvironment,
}),
getLegacyDataStatus(setup),
]);
diff --git a/x-pack/plugins/apm/server/lib/transaction_groups/__snapshots__/queries.test.ts.snap b/x-pack/plugins/apm/server/lib/transaction_groups/__snapshots__/queries.test.ts.snap
index bd6cefa793467..c678e7db711b6 100644
--- a/x-pack/plugins/apm/server/lib/transaction_groups/__snapshots__/queries.test.ts.snap
+++ b/x-pack/plugins/apm/server/lib/transaction_groups/__snapshots__/queries.test.ts.snap
@@ -61,7 +61,7 @@ Array [
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -128,7 +128,7 @@ Array [
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -195,7 +195,7 @@ Array [
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -270,7 +270,7 @@ Array [
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -325,7 +325,7 @@ Array [
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -380,7 +380,7 @@ Array [
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -441,7 +441,7 @@ Array [
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
diff --git a/x-pack/plugins/apm/server/lib/transaction_groups/fetcher.ts b/x-pack/plugins/apm/server/lib/transaction_groups/fetcher.ts
index 5d581149db667..0a4d9748f2597 100644
--- a/x-pack/plugins/apm/server/lib/transaction_groups/fetcher.ts
+++ b/x-pack/plugins/apm/server/lib/transaction_groups/fetcher.ts
@@ -15,11 +15,7 @@ import { getTransactionGroupsProjection } from '../../projections/transaction_gr
import { mergeProjection } from '../../projections/util/merge_projection';
import { PromiseReturnType } from '../../../../observability/typings/common';
import { AggregationOptionsByType } from '../../../typings/elasticsearch/aggregations';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../helpers/setup_request';
import {
getAverages,
getSums,
@@ -57,7 +53,7 @@ export type TransactionGroupRequestBase = ReturnType<
};
};
-export type TransactionGroupSetup = Setup & SetupTimeRange & SetupUIFilters;
+export type TransactionGroupSetup = Setup & SetupTimeRange;
function getItemsWithRelativeImpact(
setup: TransactionGroupSetup,
diff --git a/x-pack/plugins/apm/server/lib/transaction_groups/get_error_rate.ts b/x-pack/plugins/apm/server/lib/transaction_groups/get_error_rate.ts
index 3dc126c45d328..d5289430b2698 100644
--- a/x-pack/plugins/apm/server/lib/transaction_groups/get_error_rate.ts
+++ b/x-pack/plugins/apm/server/lib/transaction_groups/get_error_rate.ts
@@ -12,11 +12,7 @@ import {
EVENT_OUTCOME,
} from '../../../common/elasticsearch_fieldnames';
import { rangeFilter } from '../../../common/utils/range_filter';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../helpers/setup_request';
import { getBucketSize } from '../helpers/get_bucket_size';
import {
getProcessorEventForAggregatedTransactions,
@@ -33,10 +29,10 @@ export async function getErrorRate({
serviceName: string;
transactionType?: string;
transactionName?: string;
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
searchAggregatedTransactions: boolean;
}) {
- const { start, end, uiFiltersES, apmEventClient } = setup;
+ const { start, end, esFilter, apmEventClient } = setup;
const transactionNamefilter = transactionName
? [{ term: { [TRANSACTION_NAME]: transactionName } }]
@@ -53,7 +49,7 @@ export async function getErrorRate({
},
...transactionNamefilter,
...transactionTypefilter,
- ...uiFiltersES,
+ ...esFilter,
];
const params = {
diff --git a/x-pack/plugins/apm/server/lib/transaction_groups/get_transaction_sample_for_group.ts b/x-pack/plugins/apm/server/lib/transaction_groups/get_transaction_sample_for_group.ts
index 6c9b23b3dc079..7e1aad075fb16 100644
--- a/x-pack/plugins/apm/server/lib/transaction_groups/get_transaction_sample_for_group.ts
+++ b/x-pack/plugins/apm/server/lib/transaction_groups/get_transaction_sample_for_group.ts
@@ -12,11 +12,7 @@ import {
} from '../../../common/elasticsearch_fieldnames';
import { ProcessorEvent } from '../../../common/processor_event';
import { rangeFilter } from '../../../common/utils/range_filter';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../helpers/setup_request';
export async function getTransactionSampleForGroup({
serviceName,
@@ -25,9 +21,9 @@ export async function getTransactionSampleForGroup({
}: {
serviceName: string;
transactionName: string;
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
}) {
- const { apmEventClient, start, end, uiFiltersES } = setup;
+ const { apmEventClient, start, end, esFilter } = setup;
const filter = [
{
@@ -43,7 +39,7 @@ export async function getTransactionSampleForGroup({
[TRANSACTION_NAME]: transactionName,
},
},
- ...uiFiltersES,
+ ...esFilter,
];
const getSampledTransaction = async () => {
diff --git a/x-pack/plugins/apm/server/lib/transaction_groups/index.ts b/x-pack/plugins/apm/server/lib/transaction_groups/index.ts
index 6e0d619268d44..3796511029243 100644
--- a/x-pack/plugins/apm/server/lib/transaction_groups/index.ts
+++ b/x-pack/plugins/apm/server/lib/transaction_groups/index.ts
@@ -4,16 +4,12 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../helpers/setup_request';
import { transactionGroupsFetcher, Options } from './fetcher';
export async function getTransactionGroupList(
options: Options,
- setup: Setup & SetupTimeRange & SetupUIFilters
+ setup: Setup & SetupTimeRange
) {
const bucketSize = setup.config['xpack.apm.ui.transactionGroupBucketSize'];
return await transactionGroupsFetcher(options, setup, bucketSize);
diff --git a/x-pack/plugins/apm/server/lib/transactions/__snapshots__/queries.test.ts.snap b/x-pack/plugins/apm/server/lib/transactions/__snapshots__/queries.test.ts.snap
index c63dfcc0c0ec7..3e0a7317afd70 100644
--- a/x-pack/plugins/apm/server/lib/transactions/__snapshots__/queries.test.ts.snap
+++ b/x-pack/plugins/apm/server/lib/transactions/__snapshots__/queries.test.ts.snap
@@ -161,7 +161,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -295,7 +295,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
Object {
@@ -401,7 +401,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
@@ -502,7 +502,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
Object {
@@ -608,7 +608,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
Object {
@@ -673,7 +673,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
diff --git a/x-pack/plugins/apm/server/lib/transactions/breakdown/index.test.ts b/x-pack/plugins/apm/server/lib/transactions/breakdown/index.test.ts
index 34863c64f9804..8bbcaebe06513 100644
--- a/x-pack/plugins/apm/server/lib/transactions/breakdown/index.test.ts
+++ b/x-pack/plugins/apm/server/lib/transactions/breakdown/index.test.ts
@@ -36,7 +36,8 @@ function getMockSetup(esResponse: any) {
get: () => 'myIndex',
}
) as APMConfig,
- uiFiltersES: [],
+ uiFilters: {},
+ esFilter: [],
indices: mockIndices,
dynamicIndexPattern: null as any,
};
diff --git a/x-pack/plugins/apm/server/lib/transactions/breakdown/index.ts b/x-pack/plugins/apm/server/lib/transactions/breakdown/index.ts
index 9730ddbbf38d7..8febdc898ab97 100644
--- a/x-pack/plugins/apm/server/lib/transactions/breakdown/index.ts
+++ b/x-pack/plugins/apm/server/lib/transactions/breakdown/index.ts
@@ -16,11 +16,7 @@ import {
TRANSACTION_NAME,
TRANSACTION_BREAKDOWN_COUNT,
} from '../../../../common/elasticsearch_fieldnames';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../helpers/setup_request';
import { rangeFilter } from '../../../../common/utils/range_filter';
import { getMetricsDateHistogramParams } from '../../helpers/metrics';
import { MAX_KPIS } from './constants';
@@ -32,12 +28,12 @@ export async function getTransactionBreakdown({
transactionName,
transactionType,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
serviceName: string;
transactionName?: string;
transactionType: string;
}) {
- const { uiFiltersES, apmEventClient, start, end, config } = setup;
+ const { esFilter, apmEventClient, start, end, config } = setup;
const subAggs = {
sum_all_self_times: {
@@ -84,7 +80,7 @@ export async function getTransactionBreakdown({
{ term: { [SERVICE_NAME]: serviceName } },
{ term: { [TRANSACTION_TYPE]: transactionType } },
{ range: rangeFilter(start, end) },
- ...uiFiltersES,
+ ...esFilter,
];
if (transactionName) {
diff --git a/x-pack/plugins/apm/server/lib/transactions/charts/get_anomaly_data/fetcher.ts b/x-pack/plugins/apm/server/lib/transactions/charts/get_anomaly_data/fetcher.ts
index 3cf9a54e3fe9b..287c7bc2c47f9 100644
--- a/x-pack/plugins/apm/server/lib/transactions/charts/get_anomaly_data/fetcher.ts
+++ b/x-pack/plugins/apm/server/lib/transactions/charts/get_anomaly_data/fetcher.ts
@@ -5,6 +5,7 @@
*/
import { Logger } from 'kibana/server';
+import { ESSearchResponse } from '../../../../../typings/elasticsearch';
import { PromiseReturnType } from '../../../../../../observability/typings/common';
import { Setup, SetupTimeRange } from '../../../helpers/setup_request';
@@ -47,7 +48,7 @@ export async function anomalySeriesFetcher({
filter: [
{ term: { job_id: jobId } },
{ exists: { field: 'bucket_span' } },
- { term: { result_type: 'model_plot' } },
+ { terms: { result_type: ['model_plot', 'record'] } },
{ term: { partition_field_value: serviceName } },
{ term: { by_field_value: transactionType } },
{
@@ -67,7 +68,7 @@ export async function anomalySeriesFetcher({
extended_bounds: { min: newStart, max: end },
},
aggs: {
- anomaly_score: { max: { field: 'anomaly_score' } },
+ anomaly_score: { max: { field: 'record_score' } },
lower: { min: { field: 'model_lower' } },
upper: { max: { field: 'model_upper' } },
},
@@ -77,7 +78,11 @@ export async function anomalySeriesFetcher({
};
try {
- const response = await ml.mlSystem.mlAnomalySearch(params);
+ const response: ESSearchResponse<
+ unknown,
+ typeof params
+ > = (await ml.mlSystem.mlAnomalySearch(params)) as any;
+
return response;
} catch (err) {
const isHttpError = 'statusCode' in err;
diff --git a/x-pack/plugins/apm/server/lib/transactions/charts/get_anomaly_data/index.ts b/x-pack/plugins/apm/server/lib/transactions/charts/get_anomaly_data/index.ts
index d8865f0049d35..f11623eaa2dae 100644
--- a/x-pack/plugins/apm/server/lib/transactions/charts/get_anomaly_data/index.ts
+++ b/x-pack/plugins/apm/server/lib/transactions/charts/get_anomaly_data/index.ts
@@ -5,17 +5,13 @@
*/
import { Logger } from 'kibana/server';
import { isNumber } from 'lodash';
+import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values';
import { getBucketSize } from '../../../helpers/get_bucket_size';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../../helpers/setup_request';
import { anomalySeriesFetcher } from './fetcher';
import { getMlBucketSize } from './get_ml_bucket_size';
import { anomalySeriesTransform } from './transform';
import { getMLJobIds } from '../../../service_map/get_service_anomalies';
-import { UIFilters } from '../../../../../typings/ui_filters';
export async function getAnomalySeries({
serviceName,
@@ -24,15 +20,13 @@ export async function getAnomalySeries({
timeSeriesDates,
setup,
logger,
- uiFilters,
}: {
serviceName: string;
transactionType: string | undefined;
transactionName: string | undefined;
timeSeriesDates: number[];
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
logger: Logger;
- uiFilters: UIFilters;
}) {
// don't fetch anomalies for transaction details page
if (transactionName) {
@@ -44,12 +38,22 @@ export async function getAnomalySeries({
return;
}
+ const { uiFilters, start, end } = setup;
+ const { environment } = uiFilters;
+
+ // don't fetch anomalies when no specific environment is selected
+ if (environment === ENVIRONMENT_ALL.value) {
+ return;
+ }
+
// don't fetch anomalies if unknown uiFilters are applied
const knownFilters = ['environment', 'serviceName'];
- const uiFilterNames = Object.keys(uiFilters);
- if (
- uiFilterNames.some((uiFilterName) => !knownFilters.includes(uiFilterName))
- ) {
+ const hasUnknownFiltersApplied = Object.entries(setup.uiFilters)
+ .filter(([key, value]) => !!value)
+ .map(([key]) => key)
+ .some((uiFilterName) => !knownFilters.includes(uiFilterName));
+
+ if (hasUnknownFiltersApplied) {
return;
}
@@ -64,15 +68,8 @@ export async function getAnomalySeries({
return;
}
- const mlJobIds = await getMLJobIds(
- setup.ml.anomalyDetectors,
- uiFilters.environment
- );
+ const mlJobIds = await getMLJobIds(setup.ml.anomalyDetectors, environment);
- // don't fetch anomalies if there are isn't exaclty 1 ML job match for the given environment
- if (mlJobIds.length !== 1) {
- return;
- }
const jobId = mlJobIds[0];
const mlBucketSize = await getMlBucketSize({ setup, jobId, logger });
@@ -80,7 +77,6 @@ export async function getAnomalySeries({
return;
}
- const { start, end } = setup;
const { intervalString, bucketSize } = getBucketSize(start, end);
const esResponse = await anomalySeriesFetcher({
diff --git a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/fetcher.test.ts b/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/fetcher.test.ts
index fdbd99bf274d6..75dfae3e7375f 100644
--- a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/fetcher.test.ts
+++ b/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/fetcher.test.ts
@@ -29,7 +29,10 @@ describe('timeseriesFetcher', () => {
get: () => 'myIndex',
}
) as APMConfig,
- uiFiltersES: [
+ uiFilters: {
+ environment: 'test',
+ },
+ esFilter: [
{
term: { 'service.environment': 'test' },
},
diff --git a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/fetcher.ts b/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/fetcher.ts
index 5a3948f577430..e2edbbec63d47 100644
--- a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/fetcher.ts
+++ b/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/fetcher.ts
@@ -14,11 +14,7 @@ import {
import { PromiseReturnType } from '../../../../../../observability/typings/common';
import { getBucketSize } from '../../../helpers/get_bucket_size';
import { rangeFilter } from '../../../../../common/utils/range_filter';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../../helpers/setup_request';
import {
getProcessorEventForAggregatedTransactions,
getTransactionDurationFieldForAggregatedTransactions,
@@ -36,10 +32,10 @@ export function timeseriesFetcher({
serviceName: string;
transactionType: string | undefined;
transactionName: string | undefined;
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
searchAggregatedTransactions: boolean;
}) {
- const { start, end, uiFiltersES, apmEventClient } = setup;
+ const { start, end, apmEventClient } = setup;
const { intervalString } = getBucketSize(start, end);
const filter: ESFilter[] = [
@@ -48,7 +44,7 @@ export function timeseriesFetcher({
...getDocumentTypeFilterForAggregatedTransactions(
searchAggregatedTransactions
),
- ...uiFiltersES,
+ ...setup.esFilter,
];
if (transactionName) {
diff --git a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/index.ts b/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/index.ts
index 81dca447f16ca..c0421005dd06e 100644
--- a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/index.ts
+++ b/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/index.ts
@@ -5,11 +5,7 @@
*/
import { getBucketSize } from '../../../helpers/get_bucket_size';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../../helpers/setup_request';
import { timeseriesFetcher } from './fetcher';
import { timeseriesTransformer } from './transform';
@@ -17,7 +13,7 @@ export async function getApmTimeseriesData(options: {
serviceName: string;
transactionType: string | undefined;
transactionName: string | undefined;
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
searchAggregatedTransactions: boolean;
}) {
const { start, end } = options.setup;
diff --git a/x-pack/plugins/apm/server/lib/transactions/charts/index.ts b/x-pack/plugins/apm/server/lib/transactions/charts/index.ts
index 43abf0b1a1d33..d8593612c0582 100644
--- a/x-pack/plugins/apm/server/lib/transactions/charts/index.ts
+++ b/x-pack/plugins/apm/server/lib/transactions/charts/index.ts
@@ -6,15 +6,10 @@
import { Logger } from 'kibana/server';
import { PromiseReturnType } from '../../../../../observability/typings/common';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../helpers/setup_request';
import { getAnomalySeries } from './get_anomaly_data';
import { getApmTimeseriesData } from './get_timeseries_data';
import { ApmTimeSeriesResponse } from './get_timeseries_data/transform';
-import { UIFilters } from '../../../../typings/ui_filters';
function getDates(apmTimeseries: ApmTimeSeriesResponse) {
return apmTimeseries.responseTimes.avg.map((p) => p.x);
@@ -27,10 +22,9 @@ export async function getTransactionCharts(options: {
serviceName: string;
transactionType: string | undefined;
transactionName: string | undefined;
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
searchAggregatedTransactions: boolean;
logger: Logger;
- uiFilters: UIFilters;
}) {
const apmTimeseries = await getApmTimeseriesData(options);
const anomalyTimeseries = await getAnomalySeries({
diff --git a/x-pack/plugins/apm/server/lib/transactions/distribution/get_buckets/index.ts b/x-pack/plugins/apm/server/lib/transactions/distribution/get_buckets/index.ts
index 6e2fe34a5f5ef..34d01627a2869 100644
--- a/x-pack/plugins/apm/server/lib/transactions/distribution/get_buckets/index.ts
+++ b/x-pack/plugins/apm/server/lib/transactions/distribution/get_buckets/index.ts
@@ -17,11 +17,7 @@ import {
TRANSACTION_TYPE,
} from '../../../../../common/elasticsearch_fieldnames';
import { rangeFilter } from '../../../../../common/utils/range_filter';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../../helpers/setup_request';
import {
getDocumentTypeFilterForAggregatedTransactions,
getProcessorEventForAggregatedTransactions,
@@ -66,17 +62,17 @@ export async function getBuckets({
traceId: string;
distributionMax: number;
bucketSize: number;
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
searchAggregatedTransactions: boolean;
}) {
- const { start, end, uiFiltersES, apmEventClient } = setup;
+ const { start, end, esFilter, apmEventClient } = setup;
const commonFilters = [
{ term: { [SERVICE_NAME]: serviceName } },
{ term: { [TRANSACTION_TYPE]: transactionType } },
{ term: { [TRANSACTION_NAME]: transactionName } },
{ range: rangeFilter(start, end) },
- ...uiFiltersES,
+ ...esFilter,
];
async function getSamplesForDistributionBuckets() {
diff --git a/x-pack/plugins/apm/server/lib/transactions/distribution/get_distribution_max.ts b/x-pack/plugins/apm/server/lib/transactions/distribution/get_distribution_max.ts
index 24ca2a4a07b68..249b1c4fbb20a 100644
--- a/x-pack/plugins/apm/server/lib/transactions/distribution/get_distribution_max.ts
+++ b/x-pack/plugins/apm/server/lib/transactions/distribution/get_distribution_max.ts
@@ -9,11 +9,7 @@ import {
TRANSACTION_NAME,
TRANSACTION_TYPE,
} from '../../../../common/elasticsearch_fieldnames';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../helpers/setup_request';
import {
getProcessorEventForAggregatedTransactions,
getTransactionDurationFieldForAggregatedTransactions,
@@ -29,10 +25,10 @@ export async function getDistributionMax({
serviceName: string;
transactionName: string;
transactionType: string;
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
searchAggregatedTransactions: boolean;
}) {
- const { start, end, uiFiltersES, apmEventClient } = setup;
+ const { start, end, esFilter, apmEventClient } = setup;
const params = {
apm: {
@@ -59,7 +55,7 @@ export async function getDistributionMax({
},
},
},
- ...uiFiltersES,
+ ...esFilter,
],
},
},
diff --git a/x-pack/plugins/apm/server/lib/transactions/distribution/index.ts b/x-pack/plugins/apm/server/lib/transactions/distribution/index.ts
index b9ab36fb08d42..deafc37ee42e2 100644
--- a/x-pack/plugins/apm/server/lib/transactions/distribution/index.ts
+++ b/x-pack/plugins/apm/server/lib/transactions/distribution/index.ts
@@ -5,11 +5,7 @@
*/
import { PromiseReturnType } from '../../../../../observability/typings/common';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../helpers/setup_request';
import { getBuckets } from './get_buckets';
import { getDistributionMax } from './get_distribution_max';
import { roundToNearestFiveOrTen } from '../../helpers/round_to_nearest_five_or_ten';
@@ -39,7 +35,7 @@ export async function getTransactionDistribution({
transactionType: string;
transactionId: string;
traceId: string;
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
searchAggregatedTransactions: boolean;
}) {
const distributionMax = await getDistributionMax({
diff --git a/x-pack/plugins/apm/server/lib/transactions/get_transaction/index.ts b/x-pack/plugins/apm/server/lib/transactions/get_transaction/index.ts
index 9aa1a8f4de87f..8958be0819613 100644
--- a/x-pack/plugins/apm/server/lib/transactions/get_transaction/index.ts
+++ b/x-pack/plugins/apm/server/lib/transactions/get_transaction/index.ts
@@ -9,11 +9,7 @@ import {
TRANSACTION_ID,
} from '../../../../common/elasticsearch_fieldnames';
import { rangeFilter } from '../../../../common/utils/range_filter';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../helpers/setup_request';
import { ProcessorEvent } from '../../../../common/processor_event';
export async function getTransaction({
@@ -23,7 +19,7 @@ export async function getTransaction({
}: {
transactionId: string;
traceId: string;
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
}) {
const { start, end, apmEventClient } = setup;
diff --git a/x-pack/plugins/apm/server/lib/transactions/queries.test.ts b/x-pack/plugins/apm/server/lib/transactions/queries.test.ts
index 87b8bc7c4ae90..eff9451c9e1cd 100644
--- a/x-pack/plugins/apm/server/lib/transactions/queries.test.ts
+++ b/x-pack/plugins/apm/server/lib/transactions/queries.test.ts
@@ -56,7 +56,6 @@ describe('transaction queries', () => {
setup,
searchAggregatedTransactions: false,
logger: loggerMock.create(),
- uiFilters: {},
})
);
expect(mock.params).toMatchSnapshot();
@@ -71,7 +70,6 @@ describe('transaction queries', () => {
setup,
searchAggregatedTransactions: false,
logger: loggerMock.create(),
- uiFilters: {},
})
);
expect(mock.params).toMatchSnapshot();
@@ -86,7 +84,6 @@ describe('transaction queries', () => {
setup,
searchAggregatedTransactions: false,
logger: loggerMock.create(),
- uiFilters: {},
})
);
diff --git a/x-pack/plugins/apm/server/lib/ui_filters/local_ui_filters/__snapshots__/queries.test.ts.snap b/x-pack/plugins/apm/server/lib/ui_filters/local_ui_filters/__snapshots__/queries.test.ts.snap
index 5f38432719280..e7ca65eb740b6 100644
--- a/x-pack/plugins/apm/server/lib/ui_filters/local_ui_filters/__snapshots__/queries.test.ts.snap
+++ b/x-pack/plugins/apm/server/lib/ui_filters/local_ui_filters/__snapshots__/queries.test.ts.snap
@@ -46,7 +46,7 @@ Object {
},
Object {
"term": Object {
- "my.custom.ui.filter": "foo-bar",
+ "service.environment": "test",
},
},
],
diff --git a/x-pack/plugins/apm/server/lib/ui_filters/local_ui_filters/get_local_filter_query.ts b/x-pack/plugins/apm/server/lib/ui_filters/local_ui_filters/get_local_filter_query.ts
index 10f6e93c1cfc1..9fbdba679b667 100644
--- a/x-pack/plugins/apm/server/lib/ui_filters/local_ui_filters/get_local_filter_query.ts
+++ b/x-pack/plugins/apm/server/lib/ui_filters/local_ui_filters/get_local_filter_query.ts
@@ -8,7 +8,7 @@ import { omit } from 'lodash';
import { mergeProjection } from '../../../projections/util/merge_projection';
import { Projection } from '../../../projections/typings';
import { UIFilters } from '../../../../typings/ui_filters';
-import { getUiFiltersES } from '../../helpers/convert_ui_filters/get_ui_filters_es';
+import { getEsFilter } from '../../helpers/convert_ui_filters/get_es_filter';
import { localUIFilters } from './config';
import { LocalUIFilterName } from '../../../../common/ui_filter';
@@ -22,7 +22,7 @@ export const getLocalFilterQuery = ({
localUIFilterName: LocalUIFilterName;
}) => {
const field = localUIFilters[localUIFilterName];
- const filter = getUiFiltersES(omit(uiFilters, field.name));
+ const filter = getEsFilter(omit(uiFilters, field.name));
const bucketCountAggregation = projection.body.aggs
? {
diff --git a/x-pack/plugins/apm/server/lib/ui_filters/local_ui_filters/queries.test.ts b/x-pack/plugins/apm/server/lib/ui_filters/local_ui_filters/queries.test.ts
index 22fa20e255f6e..f4e8aafc1bcf5 100644
--- a/x-pack/plugins/apm/server/lib/ui_filters/local_ui_filters/queries.test.ts
+++ b/x-pack/plugins/apm/server/lib/ui_filters/local_ui_filters/queries.test.ts
@@ -15,7 +15,7 @@ describe('local ui filter queries', () => {
let mock: SearchParamsMock;
beforeEach(() => {
- jest.mock('../../helpers/convert_ui_filters/get_ui_filters_es', () => {
+ jest.mock('../../helpers/convert_ui_filters/get_es_filter', () => {
return [];
});
});
diff --git a/x-pack/plugins/apm/server/projections/errors.ts b/x-pack/plugins/apm/server/projections/errors.ts
index 49a0e9f479d26..173dc94a0840c 100644
--- a/x-pack/plugins/apm/server/projections/errors.ts
+++ b/x-pack/plugins/apm/server/projections/errors.ts
@@ -4,11 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../server/lib/helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../server/lib/helpers/setup_request';
import {
SERVICE_NAME,
ERROR_GROUP_ID,
@@ -20,10 +16,10 @@ export function getErrorGroupsProjection({
setup,
serviceName,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
serviceName: string;
}) {
- const { start, end, uiFiltersES } = setup;
+ const { start, end, esFilter } = setup;
return {
apm: {
@@ -35,7 +31,7 @@ export function getErrorGroupsProjection({
filter: [
{ term: { [SERVICE_NAME]: serviceName } },
{ range: rangeFilter(start, end) },
- ...uiFiltersES,
+ ...esFilter,
],
},
},
diff --git a/x-pack/plugins/apm/server/projections/metrics.ts b/x-pack/plugins/apm/server/projections/metrics.ts
index eb80a6bc73248..c3b5db5be6af8 100644
--- a/x-pack/plugins/apm/server/projections/metrics.ts
+++ b/x-pack/plugins/apm/server/projections/metrics.ts
@@ -4,11 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../server/lib/helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../server/lib/helpers/setup_request';
import {
SERVICE_NAME,
SERVICE_NODE_NAME,
@@ -34,17 +30,17 @@ export function getMetricsProjection({
serviceName,
serviceNodeName,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
serviceName: string;
serviceNodeName?: string;
}) {
- const { start, end, uiFiltersES } = setup;
+ const { start, end, esFilter } = setup;
const filter = [
{ term: { [SERVICE_NAME]: serviceName } },
{ range: rangeFilter(start, end) },
...getServiceNodeNameFilters(serviceNodeName),
- ...uiFiltersES,
+ ...esFilter,
];
return {
diff --git a/x-pack/plugins/apm/server/projections/rum_page_load_transactions.ts b/x-pack/plugins/apm/server/projections/rum_page_load_transactions.ts
index c27314923f6bd..96ee26c6e65f5 100644
--- a/x-pack/plugins/apm/server/projections/rum_page_load_transactions.ts
+++ b/x-pack/plugins/apm/server/projections/rum_page_load_transactions.ts
@@ -4,11 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../server/lib/helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../server/lib/helpers/setup_request';
import {
AGENT_NAME,
TRANSACTION_TYPE,
@@ -22,10 +18,10 @@ export function getRumPageLoadTransactionsProjection({
setup,
urlQuery,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
urlQuery?: string;
}) {
- const { start, end, uiFiltersES } = setup;
+ const { start, end, esFilter } = setup;
const bool = {
filter: [
@@ -49,7 +45,7 @@ export function getRumPageLoadTransactionsProjection({
},
]
: []),
- ...uiFiltersES,
+ ...esFilter,
],
};
@@ -68,9 +64,9 @@ export function getRumPageLoadTransactionsProjection({
export function getRumErrorsProjection({
setup,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
}) {
- const { start, end, uiFiltersES } = setup;
+ const { start, end, esFilter: esFilter } = setup;
const bool = {
filter: [
@@ -82,7 +78,7 @@ export function getRumErrorsProjection({
[SERVICE_LANGUAGE_NAME]: 'javascript',
},
},
- ...uiFiltersES,
+ ...esFilter,
],
};
diff --git a/x-pack/plugins/apm/server/projections/service_nodes.ts b/x-pack/plugins/apm/server/projections/service_nodes.ts
index 87fe815a12d0d..ed8d4c7409eda 100644
--- a/x-pack/plugins/apm/server/projections/service_nodes.ts
+++ b/x-pack/plugins/apm/server/projections/service_nodes.ts
@@ -4,11 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../server/lib/helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../server/lib/helpers/setup_request';
import { SERVICE_NODE_NAME } from '../../common/elasticsearch_fieldnames';
import { mergeProjection } from './util/merge_projection';
import { getMetricsProjection } from './metrics';
@@ -18,7 +14,7 @@ export function getServiceNodesProjection({
serviceName,
serviceNodeName,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
serviceName: string;
serviceNodeName?: string;
}) {
diff --git a/x-pack/plugins/apm/server/projections/services.ts b/x-pack/plugins/apm/server/projections/services.ts
index ba61f72519a23..d912a95546515 100644
--- a/x-pack/plugins/apm/server/projections/services.ts
+++ b/x-pack/plugins/apm/server/projections/services.ts
@@ -4,11 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import {
- Setup,
- SetupUIFilters,
- SetupTimeRange,
-} from '../../server/lib/helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../server/lib/helpers/setup_request';
import { SERVICE_NAME } from '../../common/elasticsearch_fieldnames';
import { rangeFilter } from '../../common/utils/range_filter';
import { ProcessorEvent } from '../../common/processor_event';
@@ -18,10 +14,10 @@ export function getServicesProjection({
setup,
searchAggregatedTransactions,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
searchAggregatedTransactions: boolean;
}) {
- const { start, end, uiFiltersES } = setup;
+ const { start, end, esFilter } = setup;
return {
apm: {
@@ -37,7 +33,7 @@ export function getServicesProjection({
size: 0,
query: {
bool: {
- filter: [{ range: rangeFilter(start, end) }, ...uiFiltersES],
+ filter: [{ range: rangeFilter(start, end) }, ...esFilter],
},
},
aggs: {
diff --git a/x-pack/plugins/apm/server/projections/transaction_groups.ts b/x-pack/plugins/apm/server/projections/transaction_groups.ts
index 0cc3a7a35d214..2ce720eb12167 100644
--- a/x-pack/plugins/apm/server/projections/transaction_groups.ts
+++ b/x-pack/plugins/apm/server/projections/transaction_groups.ts
@@ -4,11 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { omit } from 'lodash';
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../server/lib/helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../server/lib/helpers/setup_request';
import {
TRANSACTION_NAME,
PARENT_ID,
@@ -22,7 +18,7 @@ export function getTransactionGroupsProjection({
setup,
options,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
options: Options;
}) {
const transactionsProjection = getTransactionsProjection({
diff --git a/x-pack/plugins/apm/server/projections/transactions.ts b/x-pack/plugins/apm/server/projections/transactions.ts
index 8e9bb3bf321f6..548e77b5d2cd9 100644
--- a/x-pack/plugins/apm/server/projections/transactions.ts
+++ b/x-pack/plugins/apm/server/projections/transactions.ts
@@ -4,11 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import {
- Setup,
- SetupTimeRange,
- SetupUIFilters,
-} from '../../server/lib/helpers/setup_request';
+import { Setup, SetupTimeRange } from '../../server/lib/helpers/setup_request';
import {
SERVICE_NAME,
TRANSACTION_TYPE,
@@ -27,13 +23,13 @@ export function getTransactionsProjection({
transactionType,
searchAggregatedTransactions,
}: {
- setup: Setup & SetupTimeRange & SetupUIFilters;
+ setup: Setup & SetupTimeRange;
serviceName?: string;
transactionName?: string;
transactionType?: string;
searchAggregatedTransactions: boolean;
}) {
- const { start, end, uiFiltersES } = setup;
+ const { start, end, esFilter } = setup;
const transactionNameFilter = transactionName
? [{ term: { [TRANSACTION_NAME]: transactionName } }]
@@ -51,7 +47,7 @@ export function getTransactionsProjection({
...transactionNameFilter,
...transactionTypeFilter,
...serviceNameFilter,
- ...uiFiltersES,
+ ...esFilter,
...getDocumentTypeFilterForAggregatedTransactions(
searchAggregatedTransactions
),
diff --git a/x-pack/plugins/apm/server/routes/service_map.ts b/x-pack/plugins/apm/server/routes/service_map.ts
index 1996d4d4a262d..6e86ececd1bfe 100644
--- a/x-pack/plugins/apm/server/routes/service_map.ts
+++ b/x-pack/plugins/apm/server/routes/service_map.ts
@@ -17,7 +17,6 @@ import { createRoute } from './create_route';
import { rangeRt, uiFiltersRt } from './default_api_types';
import { notifyFeatureUsage } from '../feature';
import { getSearchAggregatedTransactions } from '../lib/helpers/aggregated_transactions';
-import { getParsedUiFilters } from '../lib/helpers/convert_ui_filters/get_parsed_ui_filters';
export const serviceMapRoute = createRoute(() => ({
path: '/api/apm/service-map',
@@ -77,24 +76,20 @@ export const serviceMapServiceNodeRoute = createRoute(() => ({
if (!isActivePlatinumLicense(context.licensing.license)) {
throw Boom.forbidden(invalidLicenseMessage);
}
- const logger = context.logger;
const setup = await setupRequest(context, request);
const {
- query: { uiFilters: uiFiltersJson },
path: { serviceName },
} = context.params;
const searchAggregatedTransactions = await getSearchAggregatedTransactions(
setup
);
- const uiFilters = getParsedUiFilters({ uiFilters: uiFiltersJson, logger });
return getServiceMapServiceNodeInfo({
setup,
serviceName,
searchAggregatedTransactions,
- uiFilters,
});
},
}));
diff --git a/x-pack/plugins/apm/server/routes/services.ts b/x-pack/plugins/apm/server/routes/services.ts
index 4bb10f31ba6a1..538ba3926c792 100644
--- a/x-pack/plugins/apm/server/routes/services.ts
+++ b/x-pack/plugins/apm/server/routes/services.ts
@@ -17,7 +17,6 @@ import { uiFiltersRt, rangeRt } from './default_api_types';
import { getServiceAnnotations } from '../lib/services/annotations';
import { dateAsStringRt } from '../../common/runtime_types/date_as_string_rt';
import { getSearchAggregatedTransactions } from '../lib/helpers/aggregated_transactions';
-import { getParsedUiFilters } from '../lib/helpers/convert_ui_filters/get_parsed_ui_filters';
export const servicesRoute = createRoute(() => ({
path: '/api/apm/services',
@@ -25,22 +24,13 @@ export const servicesRoute = createRoute(() => ({
query: t.intersection([uiFiltersRt, rangeRt]),
},
handler: async ({ context, request }) => {
- const { environment } = getParsedUiFilters({
- uiFilters: context.params.query.uiFilters,
- logger: context.logger,
- });
-
const setup = await setupRequest(context, request);
const searchAggregatedTransactions = await getSearchAggregatedTransactions(
setup
);
- const services = await getServices({
- setup,
- searchAggregatedTransactions,
- mlAnomaliesEnvironment: environment,
- });
+ const services = await getServices({ setup, searchAggregatedTransactions });
return services;
},
diff --git a/x-pack/plugins/apm/server/routes/transaction_groups.ts b/x-pack/plugins/apm/server/routes/transaction_groups.ts
index dd1335fb2c2a1..18fc73b468cd4 100644
--- a/x-pack/plugins/apm/server/routes/transaction_groups.ts
+++ b/x-pack/plugins/apm/server/routes/transaction_groups.ts
@@ -5,6 +5,7 @@
*/
import * as t from 'io-ts';
+import Boom from 'boom';
import { setupRequest } from '../lib/helpers/setup_request';
import { getTransactionCharts } from '../lib/transactions/charts';
import { getTransactionDistribution } from '../lib/transactions/distribution';
@@ -15,7 +16,6 @@ import { uiFiltersRt, rangeRt } from './default_api_types';
import { getTransactionSampleForGroup } from '../lib/transaction_groups/get_transaction_sample_for_group';
import { getSearchAggregatedTransactions } from '../lib/helpers/aggregated_transactions';
import { getErrorRate } from '../lib/transaction_groups/get_error_rate';
-import { getParsedUiFilters } from '../lib/helpers/convert_ui_filters/get_parsed_ui_filters';
export const transactionGroupsRoute = createRoute(() => ({
path: '/api/apm/services/{serviceName}/transaction_groups',
@@ -71,27 +71,28 @@ export const transactionGroupsChartsRoute = createRoute(() => ({
const setup = await setupRequest(context, request);
const logger = context.logger;
const { serviceName } = context.params.path;
- const {
- transactionType,
- transactionName,
- uiFilters: uiFiltersJson,
- } = context.params.query;
+ const { transactionType, transactionName } = context.params.query;
- const uiFilters = getParsedUiFilters({ uiFilters: uiFiltersJson, logger });
+ if (!setup.uiFilters.environment) {
+ throw Boom.badRequest(
+ `environment is a required property of the ?uiFilters JSON for transaction_groups/charts.`
+ );
+ }
const searchAggregatedTransactions = await getSearchAggregatedTransactions(
setup
);
- return getTransactionCharts({
+ const options = {
serviceName,
transactionType,
transactionName,
setup,
searchAggregatedTransactions,
logger,
- uiFilters,
- });
+ };
+
+ return getTransactionCharts(options);
},
}));
diff --git a/x-pack/plugins/apm/server/routes/ui_filters.ts b/x-pack/plugins/apm/server/routes/ui_filters.ts
index 936d460102dce..26fe0118c02ed 100644
--- a/x-pack/plugins/apm/server/routes/ui_filters.ts
+++ b/x-pack/plugins/apm/server/routes/ui_filters.ts
@@ -9,13 +9,12 @@ import { omit } from 'lodash';
import {
setupRequest,
Setup,
- SetupUIFilters,
SetupTimeRange,
} from '../lib/helpers/setup_request';
import { getEnvironments } from '../lib/ui_filters/get_environments';
import { Projection } from '../projections/typings';
import { localUIFilterNames } from '../lib/ui_filters/local_ui_filters/config';
-import { getUiFiltersES } from '../lib/helpers/convert_ui_filters/get_ui_filters_es';
+import { getEsFilter } from '../lib/helpers/convert_ui_filters/get_es_filter';
import { getLocalUIFilters } from '../lib/ui_filters/local_ui_filters';
import { getServicesProjection } from '../projections/services';
import { getTransactionGroupsProjection } from '../projections/transaction_groups';
@@ -97,23 +96,23 @@ function createLocalFiltersRoute<
},
handler: async ({ context, request }) => {
const setup = await setupRequest(context, request);
+ const { uiFilters } = setup;
const { query } = context.params;
- const { uiFilters, filterNames } = query;
- const parsedUiFilters = JSON.parse(uiFilters);
+ const { filterNames } = query;
const projection = await getProjection({
query,
context,
setup: {
...setup,
- uiFiltersES: getUiFiltersES(omit(parsedUiFilters, filterNames)),
+ esFilter: getEsFilter(omit(uiFilters, filterNames)),
},
});
return getLocalUIFilters({
projection,
setup,
- uiFilters: parsedUiFilters,
+ uiFilters,
localFilterNames: filterNames,
});
},
@@ -271,6 +270,6 @@ type GetProjection<
context,
}: {
query: t.TypeOf;
- setup: Setup & SetupUIFilters & SetupTimeRange;
+ setup: Setup & SetupTimeRange;
context: APMRequestHandlerContext;
}) => Promise | TProjection;
diff --git a/x-pack/plugins/apm/server/utils/test_helpers.tsx b/x-pack/plugins/apm/server/utils/test_helpers.tsx
index 98c1436b2b9b8..18b990b35b5a5 100644
--- a/x-pack/plugins/apm/server/utils/test_helpers.tsx
+++ b/x-pack/plugins/apm/server/utils/test_helpers.tsx
@@ -9,6 +9,7 @@ import {
ESSearchRequest,
} from '../../typings/elasticsearch';
import { PromiseReturnType } from '../../typings/common';
+import { UIFilters } from '../../typings/ui_filters';
import { APMConfig } from '..';
interface Options {
@@ -23,7 +24,8 @@ interface MockSetup {
apmEventClient: any;
internalClient: any;
config: APMConfig;
- uiFiltersES: ESFilter[];
+ uiFilters: UIFilters;
+ esFilter: ESFilter[];
indices: {
/* eslint-disable @typescript-eslint/naming-convention */
'apm_oss.sourcemapIndices': string;
@@ -78,7 +80,8 @@ export async function inspectSearchParams(
},
}
) as APMConfig,
- uiFiltersES: [{ term: { 'my.custom.ui.filter': 'foo-bar' } }],
+ uiFilters: { environment: 'test' },
+ esFilter: [{ term: { 'service.environment': 'test' } }],
indices: {
/* eslint-disable @typescript-eslint/naming-convention */
'apm_oss.sourcemapIndices': 'myIndex',
diff --git a/x-pack/plugins/encrypted_saved_objects/server/config.test.ts b/x-pack/plugins/encrypted_saved_objects/server/config.test.ts
index 3f8074eb15c0c..cbe987830717f 100644
--- a/x-pack/plugins/encrypted_saved_objects/server/config.test.ts
+++ b/x-pack/plugins/encrypted_saved_objects/server/config.test.ts
@@ -6,9 +6,8 @@
jest.mock('crypto', () => ({ randomBytes: jest.fn() }));
-import { first } from 'rxjs/operators';
-import { loggingSystemMock, coreMock } from 'src/core/server/mocks';
-import { createConfig$, ConfigSchema } from './config';
+import { loggingSystemMock } from 'src/core/server/mocks';
+import { createConfig, ConfigSchema } from './config';
describe('config schema', () => {
it('generates proper defaults', () => {
@@ -16,6 +15,9 @@ describe('config schema', () => {
Object {
"enabled": true,
"encryptionKey": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "keyRotation": Object {
+ "decryptionOnlyKeys": Array [],
+ },
}
`);
@@ -23,12 +25,41 @@ describe('config schema', () => {
Object {
"enabled": true,
"encryptionKey": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "keyRotation": Object {
+ "decryptionOnlyKeys": Array [],
+ },
}
`);
expect(ConfigSchema.validate({}, { dist: true })).toMatchInlineSnapshot(`
Object {
"enabled": true,
+ "keyRotation": Object {
+ "decryptionOnlyKeys": Array [],
+ },
+ }
+ `);
+ });
+
+ it('properly validates config', () => {
+ expect(
+ ConfigSchema.validate(
+ {
+ encryptionKey: 'a'.repeat(32),
+ keyRotation: { decryptionOnlyKeys: ['b'.repeat(32), 'c'.repeat(32)] },
+ },
+ { dist: true }
+ )
+ ).toMatchInlineSnapshot(`
+ Object {
+ "enabled": true,
+ "encryptionKey": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "keyRotation": Object {
+ "decryptionOnlyKeys": Array [
+ "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+ "cccccccccccccccccccccccccccccccc",
+ ],
+ },
}
`);
});
@@ -46,21 +77,65 @@ describe('config schema', () => {
`"[encryptionKey]: value has length [3] but it must have a minimum length of [32]."`
);
});
+
+ it('should throw error if any of the xpack.encryptedSavedObjects.keyRotation.decryptionOnlyKeys is less than 32 characters', () => {
+ expect(() =>
+ ConfigSchema.validate({
+ keyRotation: { decryptionOnlyKeys: ['a'.repeat(32), 'b'.repeat(31)] },
+ })
+ ).toThrowErrorMatchingInlineSnapshot(
+ `"[keyRotation.decryptionOnlyKeys.1]: value has length [31] but it must have a minimum length of [32]."`
+ );
+
+ expect(() =>
+ ConfigSchema.validate(
+ { keyRotation: { decryptionOnlyKeys: ['a'.repeat(32), 'b'.repeat(31)] } },
+ { dist: true }
+ )
+ ).toThrowErrorMatchingInlineSnapshot(
+ `"[keyRotation.decryptionOnlyKeys.1]: value has length [31] but it must have a minimum length of [32]."`
+ );
+ });
+
+ it('should throw error if any of the xpack.encryptedSavedObjects.keyRotation.decryptionOnlyKeys is equal to xpack.encryptedSavedObjects.encryptionKey', () => {
+ expect(() =>
+ ConfigSchema.validate({
+ encryptionKey: 'a'.repeat(32),
+ keyRotation: { decryptionOnlyKeys: ['a'.repeat(32)] },
+ })
+ ).toThrowErrorMatchingInlineSnapshot(
+ `"\`keyRotation.decryptionOnlyKeys\` cannot contain primary encryption key specified in \`encryptionKey\`."`
+ );
+
+ expect(() =>
+ ConfigSchema.validate(
+ {
+ encryptionKey: 'a'.repeat(32),
+ keyRotation: { decryptionOnlyKeys: ['a'.repeat(32)] },
+ },
+ { dist: true }
+ )
+ ).toThrowErrorMatchingInlineSnapshot(
+ `"\`keyRotation.decryptionOnlyKeys\` cannot contain primary encryption key specified in \`encryptionKey\`."`
+ );
+ });
});
-describe('createConfig$()', () => {
- it('should log a warning, set xpack.encryptedSavedObjects.encryptionKey and usingEphemeralEncryptionKey=true when encryptionKey is not set', async () => {
+describe('createConfig()', () => {
+ it('should log a warning, set xpack.encryptedSavedObjects.encryptionKey and usingEphemeralEncryptionKey=true when encryptionKey is not set', () => {
const mockRandomBytes = jest.requireMock('crypto').randomBytes;
mockRandomBytes.mockReturnValue('ab'.repeat(16));
- const contextMock = coreMock.createPluginInitializerContext({});
- const config = await createConfig$(contextMock).pipe(first()).toPromise();
+ const logger = loggingSystemMock.create().get();
+ const config = createConfig(ConfigSchema.validate({}, { dist: true }), logger);
expect(config).toEqual({
- config: { encryptionKey: 'ab'.repeat(16) },
+ enabled: true,
+ encryptionKey: 'ab'.repeat(16),
+ keyRotation: { decryptionOnlyKeys: [] },
usingEphemeralEncryptionKey: true,
});
- expect(loggingSystemMock.collect(contextMock.logger).warn).toMatchInlineSnapshot(`
+ expect(loggingSystemMock.collect(logger).warn).toMatchInlineSnapshot(`
Array [
Array [
"Generating a random key for xpack.encryptedSavedObjects.encryptionKey. To be able to decrypt encrypted saved objects attributes after restart, please set xpack.encryptedSavedObjects.encryptionKey in kibana.yml",
@@ -70,15 +145,18 @@ describe('createConfig$()', () => {
});
it('should not log a warning and set usingEphemeralEncryptionKey=false when encryptionKey is set', async () => {
- const contextMock = coreMock.createPluginInitializerContext({
- encryptionKey: 'supersecret',
- });
- const config = await createConfig$(contextMock).pipe(first()).toPromise();
+ const logger = loggingSystemMock.create().get();
+ const config = createConfig(
+ ConfigSchema.validate({ encryptionKey: 'supersecret'.repeat(3) }, { dist: true }),
+ logger
+ );
expect(config).toEqual({
- config: { encryptionKey: 'supersecret' },
+ enabled: true,
+ encryptionKey: 'supersecret'.repeat(3),
+ keyRotation: { decryptionOnlyKeys: [] },
usingEphemeralEncryptionKey: false,
});
- expect(loggingSystemMock.collect(contextMock.logger).warn).toEqual([]);
+ expect(loggingSystemMock.collect(logger).warn).toEqual([]);
});
});
diff --git a/x-pack/plugins/encrypted_saved_objects/server/config.ts b/x-pack/plugins/encrypted_saved_objects/server/config.ts
index 9c751a9c67f52..f06c6fa1823ba 100644
--- a/x-pack/plugins/encrypted_saved_objects/server/config.ts
+++ b/x-pack/plugins/encrypted_saved_objects/server/config.ts
@@ -5,41 +5,50 @@
*/
import crypto from 'crypto';
-import { map } from 'rxjs/operators';
import { schema, TypeOf } from '@kbn/config-schema';
-import { PluginInitializerContext } from 'src/core/server';
+import { Logger } from 'src/core/server';
-export const ConfigSchema = schema.object({
- enabled: schema.boolean({ defaultValue: true }),
- encryptionKey: schema.conditional(
- schema.contextRef('dist'),
- true,
- schema.maybe(schema.string({ minLength: 32 })),
- schema.string({ minLength: 32, defaultValue: 'a'.repeat(32) })
- ),
-});
+export type ConfigType = ReturnType;
-export function createConfig$(context: PluginInitializerContext) {
- return context.config.create>().pipe(
- map((config) => {
- const logger = context.logger.get('config');
+export const ConfigSchema = schema.object(
+ {
+ enabled: schema.boolean({ defaultValue: true }),
+ encryptionKey: schema.conditional(
+ schema.contextRef('dist'),
+ true,
+ schema.maybe(schema.string({ minLength: 32 })),
+ schema.string({ minLength: 32, defaultValue: 'a'.repeat(32) })
+ ),
+ keyRotation: schema.object({
+ decryptionOnlyKeys: schema.arrayOf(schema.string({ minLength: 32 }), { defaultValue: [] }),
+ }),
+ },
+ {
+ validate(value) {
+ const decryptionOnlyKeys = value.keyRotation?.decryptionOnlyKeys ?? [];
+ if (value.encryptionKey && decryptionOnlyKeys.includes(value.encryptionKey)) {
+ return '`keyRotation.decryptionOnlyKeys` cannot contain primary encryption key specified in `encryptionKey`.';
+ }
+ },
+ }
+);
- let encryptionKey = config.encryptionKey;
- const usingEphemeralEncryptionKey = encryptionKey === undefined;
- if (encryptionKey === undefined) {
- logger.warn(
- 'Generating a random key for xpack.encryptedSavedObjects.encryptionKey. ' +
- 'To be able to decrypt encrypted saved objects attributes after restart, ' +
- 'please set xpack.encryptedSavedObjects.encryptionKey in kibana.yml'
- );
+export function createConfig(config: TypeOf, logger: Logger) {
+ let encryptionKey = config.encryptionKey;
+ const usingEphemeralEncryptionKey = encryptionKey === undefined;
+ if (encryptionKey === undefined) {
+ logger.warn(
+ 'Generating a random key for xpack.encryptedSavedObjects.encryptionKey. ' +
+ 'To be able to decrypt encrypted saved objects attributes after restart, ' +
+ 'please set xpack.encryptedSavedObjects.encryptionKey in kibana.yml'
+ );
- encryptionKey = crypto.randomBytes(16).toString('hex');
- }
+ encryptionKey = crypto.randomBytes(16).toString('hex');
+ }
- return {
- config: { ...config, encryptionKey },
- usingEphemeralEncryptionKey,
- };
- })
- );
+ return {
+ ...config,
+ encryptionKey,
+ usingEphemeralEncryptionKey,
+ };
}
diff --git a/x-pack/plugins/encrypted_saved_objects/server/crypto/encrypted_saved_objects_service.test.ts b/x-pack/plugins/encrypted_saved_objects/server/crypto/encrypted_saved_objects_service.test.ts
index 42d2e2ffd1516..88d57072697fe 100644
--- a/x-pack/plugins/encrypted_saved_objects/server/crypto/encrypted_saved_objects_service.test.ts
+++ b/x-pack/plugins/encrypted_saved_objects/server/crypto/encrypted_saved_objects_service.test.ts
@@ -14,40 +14,44 @@ import { EncryptionError } from './encryption_error';
import { loggingSystemMock } from 'src/core/server/mocks';
import { encryptedSavedObjectsAuditLoggerMock } from '../audit/index.mock';
-const crypto = nodeCrypto({ encryptionKey: 'encryption-key-abc' });
+function createNodeCryptMock(encryptionKey: string) {
+ const crypto = nodeCrypto({ encryptionKey });
+ const nodeCryptoMock: jest.Mocked = {
+ encrypt: jest.fn(),
+ decrypt: jest.fn(),
+ encryptSync: jest.fn(),
+ decryptSync: jest.fn(),
+ };
-const mockNodeCrypto: jest.Mocked = {
- encrypt: jest.fn(),
- decrypt: jest.fn(),
- encryptSync: jest.fn(),
- decryptSync: jest.fn(),
-};
-
-let service: EncryptedSavedObjectsService;
-let mockAuditLogger: jest.Mocked;
-
-beforeEach(() => {
// Call actual `@elastic/node-crypto` by default, but allow to override implementation in tests.
- mockNodeCrypto.encrypt.mockImplementation(async (input: any, aad?: string) =>
+ nodeCryptoMock.encrypt.mockImplementation(async (input: any, aad?: string) =>
crypto.encrypt(input, aad)
);
- mockNodeCrypto.decrypt.mockImplementation(
+ nodeCryptoMock.decrypt.mockImplementation(
async (encryptedOutput: string | Buffer, aad?: string) => crypto.decrypt(encryptedOutput, aad)
);
- mockNodeCrypto.encryptSync.mockImplementation((input: any, aad?: string) =>
+ nodeCryptoMock.encryptSync.mockImplementation((input: any, aad?: string) =>
crypto.encryptSync(input, aad)
);
- mockNodeCrypto.decryptSync.mockImplementation((encryptedOutput: string | Buffer, aad?: string) =>
+ nodeCryptoMock.decryptSync.mockImplementation((encryptedOutput: string | Buffer, aad?: string) =>
crypto.decryptSync(encryptedOutput, aad)
);
+ return nodeCryptoMock;
+}
+
+let mockNodeCrypto: jest.Mocked;
+let service: EncryptedSavedObjectsService;
+let mockAuditLogger: jest.Mocked;
+beforeEach(() => {
+ mockNodeCrypto = createNodeCryptMock('encryption-key-abc');
mockAuditLogger = encryptedSavedObjectsAuditLoggerMock.create();
- service = new EncryptedSavedObjectsService(
- mockNodeCrypto,
- loggingSystemMock.create().get(),
- mockAuditLogger
- );
+ service = new EncryptedSavedObjectsService({
+ primaryCrypto: mockNodeCrypto,
+ logger: loggingSystemMock.create().get(),
+ audit: mockAuditLogger,
+ });
});
afterEach(() => jest.resetAllMocks());
@@ -229,11 +233,11 @@ describe('#encryptAttributes', () => {
async (valueToEncrypt, aad) => `|${valueToEncrypt}|${aad}|`
);
- service = new EncryptedSavedObjectsService(
- mockNodeCrypto,
- loggingSystemMock.create().get(),
- mockAuditLogger
- );
+ service = new EncryptedSavedObjectsService({
+ primaryCrypto: mockNodeCrypto,
+ logger: loggingSystemMock.create().get(),
+ audit: mockAuditLogger,
+ });
});
it('does not encrypt attributes for unknown types', async () => {
@@ -304,6 +308,34 @@ describe('#encryptAttributes', () => {
);
});
+ it('encrypts only using primary crypto', async () => {
+ const attributes = { attrOne: 'one', attrTwo: 'two', attrThree: 'three', attrFour: null };
+
+ const decryptionOnlyCrypto = createNodeCryptMock('some-key');
+ service = new EncryptedSavedObjectsService({
+ primaryCrypto: mockNodeCrypto,
+ decryptionOnlyCryptos: [decryptionOnlyCrypto],
+ logger: loggingSystemMock.create().get(),
+ audit: mockAuditLogger,
+ });
+ service.registerType({
+ type: 'known-type-1',
+ attributesToEncrypt: new Set(['attrOne', 'attrThree', 'attrFour']),
+ });
+
+ await expect(
+ service.encryptAttributes({ type: 'known-type-1', id: 'object-id' }, attributes)
+ ).resolves.toEqual({
+ attrOne: '|one|["known-type-1","object-id",{"attrTwo":"two"}]|',
+ attrTwo: 'two',
+ attrThree: '|three|["known-type-1","object-id",{"attrTwo":"two"}]|',
+ attrFour: null,
+ });
+
+ expect(decryptionOnlyCrypto.encrypt).not.toHaveBeenCalled();
+ expect(decryptionOnlyCrypto.encryptSync).not.toHaveBeenCalled();
+ });
+
it('encrypts only attributes that are supposed to be encrypted even if not all provided', async () => {
const attributes = { attrTwo: 'two', attrThree: 'three' };
@@ -923,11 +955,11 @@ describe('#decryptAttributes', () => {
});
it('fails if encrypted with another encryption key', async () => {
- service = new EncryptedSavedObjectsService(
- nodeCrypto({ encryptionKey: 'encryption-key-abc*' }),
- loggingSystemMock.create().get(),
- mockAuditLogger
- );
+ service = new EncryptedSavedObjectsService({
+ primaryCrypto: nodeCrypto({ encryptionKey: 'encryption-key-abc*' }),
+ logger: loggingSystemMock.create().get(),
+ audit: mockAuditLogger,
+ });
service.registerType({
type: 'known-type-1',
@@ -949,6 +981,123 @@ describe('#decryptAttributes', () => {
);
});
});
+
+ describe('with decryption only keys', () => {
+ function getService(primaryCrypto: Crypto, decryptionOnlyCryptos?: Readonly) {
+ const esoService = new EncryptedSavedObjectsService({
+ primaryCrypto,
+ decryptionOnlyCryptos,
+ logger: loggingSystemMock.create().get(),
+ audit: mockAuditLogger,
+ });
+
+ esoService.registerType({
+ type: 'known-type-1',
+ attributesToEncrypt: new Set(['attrOne', 'attrThree', 'attrFour']),
+ });
+
+ return esoService;
+ }
+
+ const attributes = { attrOne: 'one', attrTwo: 'two', attrThree: 'three', attrFour: null };
+
+ let decryptionOnlyCryptoOne: jest.Mocked;
+ let decryptionOnlyCryptoTwo: jest.Mocked;
+ beforeEach(() => {
+ decryptionOnlyCryptoOne = createNodeCryptMock('old-key-one');
+ decryptionOnlyCryptoTwo = createNodeCryptMock('old-key-two');
+
+ service = getService(mockNodeCrypto, [decryptionOnlyCryptoOne, decryptionOnlyCryptoTwo]);
+ });
+
+ it('does not use decryption only keys if we can decrypt using primary key', async () => {
+ const encryptedAttributes = await service.encryptAttributes(
+ { type: 'known-type-1', id: 'object-id' },
+ attributes
+ );
+
+ await expect(
+ service.decryptAttributes({ type: 'known-type-1', id: 'object-id' }, encryptedAttributes)
+ ).resolves.toEqual({ attrOne: 'one', attrTwo: 'two', attrThree: 'three', attrFour: null });
+ expect(mockAuditLogger.decryptAttributesSuccess).toHaveBeenCalledTimes(1);
+ expect(mockAuditLogger.decryptAttributesSuccess).toHaveBeenCalledWith(
+ ['attrOne', 'attrThree'],
+ { type: 'known-type-1', id: 'object-id' },
+ undefined
+ );
+
+ expect(decryptionOnlyCryptoOne.decrypt).not.toHaveBeenCalled();
+ expect(decryptionOnlyCryptoTwo.decrypt).not.toHaveBeenCalled();
+ });
+
+ it('uses decryption only keys if cannot decrypt using primary key', async () => {
+ const encryptedAttributes = await getService(decryptionOnlyCryptoOne).encryptAttributes(
+ { type: 'known-type-1', id: 'object-id' },
+ attributes
+ );
+
+ await expect(
+ service.decryptAttributes({ type: 'known-type-1', id: 'object-id' }, encryptedAttributes)
+ ).resolves.toEqual({ attrOne: 'one', attrTwo: 'two', attrThree: 'three', attrFour: null });
+ expect(mockAuditLogger.decryptAttributesSuccess).toHaveBeenCalledTimes(1);
+ expect(mockAuditLogger.decryptAttributesSuccess).toHaveBeenCalledWith(
+ ['attrOne', 'attrThree'],
+ { type: 'known-type-1', id: 'object-id' },
+ undefined
+ );
+
+ // One call per attributes, we have 2 of them.
+ expect(mockNodeCrypto.decrypt).toHaveBeenCalledTimes(2);
+ expect(decryptionOnlyCryptoOne.decrypt).toHaveBeenCalledTimes(2);
+ expect(decryptionOnlyCryptoTwo.decrypt).not.toHaveBeenCalled();
+ });
+
+ it('uses all available decryption only keys if needed', async () => {
+ const encryptedAttributes = await getService(decryptionOnlyCryptoTwo).encryptAttributes(
+ { type: 'known-type-1', id: 'object-id' },
+ attributes
+ );
+
+ await expect(
+ service.decryptAttributes({ type: 'known-type-1', id: 'object-id' }, encryptedAttributes)
+ ).resolves.toEqual({ attrOne: 'one', attrTwo: 'two', attrThree: 'three', attrFour: null });
+ expect(mockAuditLogger.decryptAttributesSuccess).toHaveBeenCalledTimes(1);
+ expect(mockAuditLogger.decryptAttributesSuccess).toHaveBeenCalledWith(
+ ['attrOne', 'attrThree'],
+ { type: 'known-type-1', id: 'object-id' },
+ undefined
+ );
+
+ // One call per attributes, we have 2 of them.
+ expect(mockNodeCrypto.decrypt).toHaveBeenCalledTimes(2);
+ expect(decryptionOnlyCryptoOne.decrypt).toHaveBeenCalledTimes(2);
+ expect(decryptionOnlyCryptoTwo.decrypt).toHaveBeenCalledTimes(2);
+ });
+
+ it('does not use primary encryption key if `omitPrimaryEncryptionKey` is specified', async () => {
+ const encryptedAttributes = await getService(decryptionOnlyCryptoOne).encryptAttributes(
+ { type: 'known-type-1', id: 'object-id' },
+ attributes
+ );
+
+ await expect(
+ service.decryptAttributes({ type: 'known-type-1', id: 'object-id' }, encryptedAttributes, {
+ omitPrimaryEncryptionKey: true,
+ })
+ ).resolves.toEqual({ attrOne: 'one', attrTwo: 'two', attrThree: 'three', attrFour: null });
+ expect(mockAuditLogger.decryptAttributesSuccess).toHaveBeenCalledTimes(1);
+ expect(mockAuditLogger.decryptAttributesSuccess).toHaveBeenCalledWith(
+ ['attrOne', 'attrThree'],
+ { type: 'known-type-1', id: 'object-id' },
+ undefined
+ );
+
+ // One call per attributes, we have 2 of them.
+ expect(mockNodeCrypto.decrypt).not.toHaveBeenCalled();
+ expect(decryptionOnlyCryptoOne.decrypt).toHaveBeenCalledTimes(2);
+ expect(decryptionOnlyCryptoTwo.decrypt).not.toHaveBeenCalled();
+ });
+ });
});
describe('#encryptAttributesSync', () => {
@@ -957,11 +1106,11 @@ describe('#encryptAttributesSync', () => {
(valueToEncrypt, aad) => `|${valueToEncrypt}|${aad}|`
);
- service = new EncryptedSavedObjectsService(
- mockNodeCrypto,
- loggingSystemMock.create().get(),
- mockAuditLogger
- );
+ service = new EncryptedSavedObjectsService({
+ primaryCrypto: mockNodeCrypto,
+ logger: loggingSystemMock.create().get(),
+ audit: mockAuditLogger,
+ });
});
it('does not encrypt attributes that are not supposed to be encrypted', () => {
@@ -996,6 +1145,34 @@ describe('#encryptAttributesSync', () => {
});
});
+ it('encrypts only using primary crypto', async () => {
+ const attributes = { attrOne: 'one', attrTwo: 'two', attrThree: 'three', attrFour: null };
+
+ const decryptionOnlyCrypto = createNodeCryptMock('some-key');
+ service = new EncryptedSavedObjectsService({
+ primaryCrypto: mockNodeCrypto,
+ decryptionOnlyCryptos: [decryptionOnlyCrypto],
+ logger: loggingSystemMock.create().get(),
+ audit: mockAuditLogger,
+ });
+ service.registerType({
+ type: 'known-type-1',
+ attributesToEncrypt: new Set(['attrOne', 'attrThree', 'attrFour']),
+ });
+
+ expect(
+ service.encryptAttributesSync({ type: 'known-type-1', id: 'object-id' }, attributes)
+ ).toEqual({
+ attrOne: '|one|["known-type-1","object-id",{"attrTwo":"two"}]|',
+ attrTwo: 'two',
+ attrThree: '|three|["known-type-1","object-id",{"attrTwo":"two"}]|',
+ attrFour: null,
+ });
+
+ expect(decryptionOnlyCrypto.encrypt).not.toHaveBeenCalled();
+ expect(decryptionOnlyCrypto.encryptSync).not.toHaveBeenCalled();
+ });
+
it('encrypts only attributes that are supposed to be encrypted even if not all provided', () => {
const attributes = { attrTwo: 'two', attrThree: 'three' };
@@ -1459,11 +1636,11 @@ describe('#decryptAttributesSync', () => {
});
it('fails if encrypted with another encryption key', () => {
- service = new EncryptedSavedObjectsService(
- nodeCrypto({ encryptionKey: 'encryption-key-abc*' }),
- loggingSystemMock.create().get(),
- mockAuditLogger
- );
+ service = new EncryptedSavedObjectsService({
+ primaryCrypto: nodeCrypto({ encryptionKey: 'encryption-key-abc*' }),
+ logger: loggingSystemMock.create().get(),
+ audit: mockAuditLogger,
+ });
service.registerType({
type: 'known-type-1',
@@ -1478,4 +1655,132 @@ describe('#decryptAttributesSync', () => {
).toThrowError(EncryptionError);
});
});
+
+ describe('with decryption only keys', () => {
+ function getService(primaryCrypto: Crypto, decryptionOnlyCryptos?: Readonly) {
+ const esoService = new EncryptedSavedObjectsService({
+ primaryCrypto,
+ decryptionOnlyCryptos,
+ logger: loggingSystemMock.create().get(),
+ audit: mockAuditLogger,
+ });
+
+ esoService.registerType({
+ type: 'known-type-1',
+ attributesToEncrypt: new Set(['attrOne', 'attrThree', 'attrFour']),
+ });
+
+ return esoService;
+ }
+
+ const attributes = { attrOne: 'one', attrTwo: 'two', attrThree: 'three', attrFour: null };
+
+ let decryptionOnlyCryptoOne: jest.Mocked;
+ let decryptionOnlyCryptoTwo: jest.Mocked;
+ beforeEach(() => {
+ decryptionOnlyCryptoOne = createNodeCryptMock('old-key-one');
+ decryptionOnlyCryptoTwo = createNodeCryptMock('old-key-two');
+
+ service = getService(mockNodeCrypto, [decryptionOnlyCryptoOne, decryptionOnlyCryptoTwo]);
+ });
+
+ it('does not use decryption only keys if we can decrypt using primary key', () => {
+ const encryptedAttributes = service.encryptAttributesSync(
+ { type: 'known-type-1', id: 'object-id' },
+ attributes
+ );
+
+ expect(
+ service.decryptAttributesSync(
+ { type: 'known-type-1', id: 'object-id' },
+ encryptedAttributes
+ )
+ ).toEqual({ attrOne: 'one', attrTwo: 'two', attrThree: 'three', attrFour: null });
+ expect(mockAuditLogger.decryptAttributesSuccess).toHaveBeenCalledTimes(1);
+ expect(mockAuditLogger.decryptAttributesSuccess).toHaveBeenCalledWith(
+ ['attrOne', 'attrThree'],
+ { type: 'known-type-1', id: 'object-id' },
+ undefined
+ );
+
+ expect(decryptionOnlyCryptoOne.decryptSync).not.toHaveBeenCalled();
+ expect(decryptionOnlyCryptoTwo.decryptSync).not.toHaveBeenCalled();
+ });
+
+ it('uses decryption only keys if cannot decrypt using primary key', () => {
+ const encryptedAttributes = getService(decryptionOnlyCryptoOne).encryptAttributesSync(
+ { type: 'known-type-1', id: 'object-id' },
+ attributes
+ );
+
+ expect(
+ service.decryptAttributesSync(
+ { type: 'known-type-1', id: 'object-id' },
+ encryptedAttributes
+ )
+ ).toEqual({ attrOne: 'one', attrTwo: 'two', attrThree: 'three', attrFour: null });
+ expect(mockAuditLogger.decryptAttributesSuccess).toHaveBeenCalledTimes(1);
+ expect(mockAuditLogger.decryptAttributesSuccess).toHaveBeenCalledWith(
+ ['attrOne', 'attrThree'],
+ { type: 'known-type-1', id: 'object-id' },
+ undefined
+ );
+
+ // One call per attributes, we have 2 of them.
+ expect(mockNodeCrypto.decryptSync).toHaveBeenCalledTimes(2);
+ expect(decryptionOnlyCryptoOne.decryptSync).toHaveBeenCalledTimes(2);
+ expect(decryptionOnlyCryptoTwo.decryptSync).not.toHaveBeenCalled();
+ });
+
+ it('uses all available decryption only keys if needed', () => {
+ const encryptedAttributes = getService(decryptionOnlyCryptoTwo).encryptAttributesSync(
+ { type: 'known-type-1', id: 'object-id' },
+ attributes
+ );
+
+ expect(
+ service.decryptAttributesSync(
+ { type: 'known-type-1', id: 'object-id' },
+ encryptedAttributes
+ )
+ ).toEqual({ attrOne: 'one', attrTwo: 'two', attrThree: 'three', attrFour: null });
+ expect(mockAuditLogger.decryptAttributesSuccess).toHaveBeenCalledTimes(1);
+ expect(mockAuditLogger.decryptAttributesSuccess).toHaveBeenCalledWith(
+ ['attrOne', 'attrThree'],
+ { type: 'known-type-1', id: 'object-id' },
+ undefined
+ );
+
+ // One call per attributes, we have 2 of them.
+ expect(mockNodeCrypto.decryptSync).toHaveBeenCalledTimes(2);
+ expect(decryptionOnlyCryptoOne.decryptSync).toHaveBeenCalledTimes(2);
+ expect(decryptionOnlyCryptoTwo.decryptSync).toHaveBeenCalledTimes(2);
+ });
+
+ it('does not use primary encryption key if `omitPrimaryEncryptionKey` is specified', () => {
+ const encryptedAttributes = getService(decryptionOnlyCryptoOne).encryptAttributesSync(
+ { type: 'known-type-1', id: 'object-id' },
+ attributes
+ );
+
+ expect(
+ service.decryptAttributesSync(
+ { type: 'known-type-1', id: 'object-id' },
+ encryptedAttributes,
+ { omitPrimaryEncryptionKey: true }
+ )
+ ).toEqual({ attrOne: 'one', attrTwo: 'two', attrThree: 'three', attrFour: null });
+ expect(mockAuditLogger.decryptAttributesSuccess).toHaveBeenCalledTimes(1);
+ expect(mockAuditLogger.decryptAttributesSuccess).toHaveBeenCalledWith(
+ ['attrOne', 'attrThree'],
+ { type: 'known-type-1', id: 'object-id' },
+ undefined
+ );
+
+ // One call per attributes, we have 2 of them.
+ expect(mockNodeCrypto.decryptSync).not.toHaveBeenCalled();
+ expect(decryptionOnlyCryptoOne.decryptSync).toHaveBeenCalledTimes(2);
+ expect(decryptionOnlyCryptoTwo.decryptSync).not.toHaveBeenCalled();
+ });
+ });
});
diff --git a/x-pack/plugins/encrypted_saved_objects/server/crypto/encrypted_saved_objects_service.ts b/x-pack/plugins/encrypted_saved_objects/server/crypto/encrypted_saved_objects_service.ts
index 82d6bb9be15f6..1f1093a179538 100644
--- a/x-pack/plugins/encrypted_saved_objects/server/crypto/encrypted_saved_objects_service.ts
+++ b/x-pack/plugins/encrypted_saved_objects/server/crypto/encrypted_saved_objects_service.ts
@@ -52,6 +52,38 @@ interface CommonParameters {
user?: AuthenticatedUser;
}
+/**
+ * Describes parameters for the decrypt methods.
+ */
+interface DecryptParameters extends CommonParameters {
+ /**
+ * Indicates whether decryption should only be performed using secondary decryption-only keys.
+ */
+ omitPrimaryEncryptionKey?: boolean;
+}
+
+interface EncryptedSavedObjectsServiceOptions {
+ /**
+ * Service logger instance.
+ */
+ logger: Logger;
+
+ /**
+ * Audit logger instance.
+ */
+ audit: EncryptedSavedObjectsAuditLogger;
+
+ /**
+ * NodeCrypto instance used for both encryption and decryption.
+ */
+ primaryCrypto: Crypto;
+
+ /**
+ * NodeCrypto instances used ONLY for decryption (i.e. rotated encryption keys).
+ */
+ decryptionOnlyCryptos?: Readonly;
+}
+
/**
* Utility function that gives array representation of the saved object descriptor respecting
* optional `namespace` property.
@@ -79,16 +111,7 @@ export class EncryptedSavedObjectsService {
EncryptedSavedObjectAttributesDefinition
> = new Map();
- /**
- * @param crypto nodeCrypto instance.
- * @param logger Ordinary logger instance.
- * @param audit Audit logger instance.
- */
- constructor(
- private readonly crypto: Readonly,
- private readonly logger: Logger,
- private readonly audit: EncryptedSavedObjectsAuditLogger
- ) {}
+ constructor(private readonly options: EncryptedSavedObjectsServiceOptions) {}
/**
* Registers saved object type as the one that contains attributes that should be encrypted.
@@ -136,7 +159,7 @@ export class EncryptedSavedObjectsService {
descriptor: SavedObjectDescriptor,
attributes: T,
originalAttributes?: T,
- params?: CommonParameters
+ params?: DecryptParameters
) {
const typeDefinition = this.typeDefinitions.get(descriptor.type);
if (typeDefinition === undefined) {
@@ -174,7 +197,7 @@ export class EncryptedSavedObjectsService {
Object.fromEntries(
Object.entries(attributes).filter(([key]) => !typeDefinition.shouldBeStripped(key))
) as T,
- { user: params?.user }
+ params
);
} catch (err) {
decryptionError = err;
@@ -210,10 +233,10 @@ export class EncryptedSavedObjectsService {
try {
encryptedAttributes[attributeName] = (yield [attributeValue, encryptionAAD])!;
} catch (err) {
- this.logger.error(
+ this.options.logger.error(
`Failed to encrypt "${attributeName}" attribute: ${err.message || err}`
);
- this.audit.encryptAttributeFailure(attributeName, descriptor, params?.user);
+ this.options.audit.encryptAttributeFailure(attributeName, descriptor, params?.user);
throw new EncryptionError(
`Unable to encrypt attribute "${attributeName}"`,
@@ -229,7 +252,7 @@ export class EncryptedSavedObjectsService {
// not the case we should collect and log them to make troubleshooting easier.
const encryptedAttributesKeys = Object.keys(encryptedAttributes);
if (encryptedAttributesKeys.length !== typeDefinition.attributesToEncrypt.size) {
- this.logger.debug(
+ this.options.logger.debug(
`The following attributes of saved object "${descriptorToArray(
descriptor
)}" should have been encrypted: ${Array.from(
@@ -242,7 +265,7 @@ export class EncryptedSavedObjectsService {
return attributes;
}
- this.audit.encryptAttributesSuccess(encryptedAttributesKeys, descriptor, params?.user);
+ this.options.audit.encryptAttributesSuccess(encryptedAttributesKeys, descriptor, params?.user);
return {
...attributes,
@@ -270,7 +293,9 @@ export class EncryptedSavedObjectsService {
while (!iteratorResult.done) {
const [attributeValue, encryptionAAD] = iteratorResult.value;
try {
- iteratorResult = iterator.next(await this.crypto.encrypt(attributeValue, encryptionAAD));
+ iteratorResult = iterator.next(
+ await this.options.primaryCrypto.encrypt(attributeValue, encryptionAAD)
+ );
} catch (err) {
iterator.throw!(err);
}
@@ -299,7 +324,9 @@ export class EncryptedSavedObjectsService {
while (!iteratorResult.done) {
const [attributeValue, encryptionAAD] = iteratorResult.value;
try {
- iteratorResult = iterator.next(this.crypto.encryptSync(attributeValue, encryptionAAD));
+ iteratorResult = iterator.next(
+ this.options.primaryCrypto.encryptSync(attributeValue, encryptionAAD)
+ );
} catch (err) {
iterator.throw!(err);
}
@@ -321,19 +348,31 @@ export class EncryptedSavedObjectsService {
public async decryptAttributes>(
descriptor: SavedObjectDescriptor,
attributes: T,
- params?: CommonParameters
+ params?: DecryptParameters
): Promise {
+ const decrypters = this.getDecrypters(params?.omitPrimaryEncryptionKey);
const iterator = this.attributesToDecryptIterator(descriptor, attributes, params);
let iteratorResult = iterator.next();
while (!iteratorResult.done) {
const [attributeValue, encryptionAAD] = iteratorResult.value;
- try {
- iteratorResult = iterator.next(
- (await this.crypto.decrypt(attributeValue, encryptionAAD)) as string
- );
- } catch (err) {
- iterator.throw!(err);
+
+ let decryptionError;
+ for (const decrypter of decrypters) {
+ try {
+ iteratorResult = iterator.next(await decrypter.decrypt(attributeValue, encryptionAAD));
+ decryptionError = undefined;
+ break;
+ } catch (err) {
+ // Remember the error thrown when we tried to decrypt with the primary key.
+ if (!decryptionError) {
+ decryptionError = err;
+ }
+ }
+ }
+
+ if (decryptionError) {
+ iterator.throw!(decryptionError);
}
}
@@ -353,17 +392,31 @@ export class EncryptedSavedObjectsService {
public decryptAttributesSync>(
descriptor: SavedObjectDescriptor,
attributes: T,
- params?: CommonParameters
+ params?: DecryptParameters
): T {
+ const decrypters = this.getDecrypters(params?.omitPrimaryEncryptionKey);
const iterator = this.attributesToDecryptIterator(descriptor, attributes, params);
let iteratorResult = iterator.next();
while (!iteratorResult.done) {
const [attributeValue, encryptionAAD] = iteratorResult.value;
- try {
- iteratorResult = iterator.next(this.crypto.decryptSync(attributeValue, encryptionAAD));
- } catch (err) {
- iterator.throw!(err);
+
+ let decryptionError;
+ for (const decrypter of decrypters) {
+ try {
+ iteratorResult = iterator.next(decrypter.decryptSync(attributeValue, encryptionAAD));
+ decryptionError = undefined;
+ break;
+ } catch (err) {
+ // Remember the error thrown when we tried to decrypt with the primary key.
+ if (!decryptionError) {
+ decryptionError = err;
+ }
+ }
+ }
+
+ if (decryptionError) {
+ iterator.throw!(decryptionError);
}
}
@@ -388,7 +441,7 @@ export class EncryptedSavedObjectsService {
}
if (typeof attributeValue !== 'string') {
- this.audit.decryptAttributeFailure(attributeName, descriptor, params?.user);
+ this.options.audit.decryptAttributeFailure(attributeName, descriptor, params?.user);
throw new Error(
`Encrypted "${attributeName}" attribute should be a string, but found ${typeDetect(
attributeValue
@@ -401,8 +454,10 @@ export class EncryptedSavedObjectsService {
try {
decryptedAttributes[attributeName] = (yield [attributeValue, encryptionAAD])!;
} catch (err) {
- this.logger.error(`Failed to decrypt "${attributeName}" attribute: ${err.message || err}`);
- this.audit.decryptAttributeFailure(attributeName, descriptor, params?.user);
+ this.options.logger.error(
+ `Failed to decrypt "${attributeName}" attribute: ${err.message || err}`
+ );
+ this.options.audit.decryptAttributeFailure(attributeName, descriptor, params?.user);
throw new EncryptionError(
`Unable to decrypt attribute "${attributeName}"`,
@@ -417,7 +472,7 @@ export class EncryptedSavedObjectsService {
// not the case we should collect and log them to make troubleshooting easier.
const decryptedAttributesKeys = Object.keys(decryptedAttributes);
if (decryptedAttributesKeys.length !== typeDefinition.attributesToEncrypt.size) {
- this.logger.debug(
+ this.options.logger.debug(
`The following attributes of saved object "${descriptorToArray(
descriptor
)}" should have been decrypted: ${Array.from(
@@ -430,7 +485,7 @@ export class EncryptedSavedObjectsService {
return attributes;
}
- this.audit.decryptAttributesSuccess(decryptedAttributesKeys, descriptor, params?.user);
+ this.options.audit.decryptAttributesSuccess(decryptedAttributesKeys, descriptor, params?.user);
return {
...attributes,
@@ -459,7 +514,7 @@ export class EncryptedSavedObjectsService {
}
if (Object.keys(attributesAAD).length === 0) {
- this.logger.debug(
+ this.options.logger.debug(
`The AAD for saved object "${descriptorToArray(
descriptor
)}" does not include any attributes.`
@@ -468,4 +523,23 @@ export class EncryptedSavedObjectsService {
return stringify([...descriptorToArray(descriptor), attributesAAD]);
}
+
+ /**
+ * Returns list of NodeCrypto instances used for decryption.
+ * @param omitPrimaryEncryptionKey Specifies whether returned decrypters shouldn't include primary
+ * encryption/decryption crypto.
+ */
+ private getDecrypters(omitPrimaryEncryptionKey?: boolean) {
+ if (omitPrimaryEncryptionKey) {
+ if (!this.options.decryptionOnlyCryptos || this.options.decryptionOnlyCryptos.length === 0) {
+ throw new Error(
+ `"omitPrimaryEncryptionKey" cannot be set when secondary keys aren't configured.`
+ );
+ }
+
+ return this.options.decryptionOnlyCryptos;
+ }
+
+ return [this.options.primaryCrypto, ...(this.options.decryptionOnlyCryptos ?? [])];
+ }
}
diff --git a/x-pack/plugins/encrypted_saved_objects/server/crypto/encryption_key_rotation_service.mocks.ts b/x-pack/plugins/encrypted_saved_objects/server/crypto/encryption_key_rotation_service.mocks.ts
new file mode 100644
index 0000000000000..2d14577f91567
--- /dev/null
+++ b/x-pack/plugins/encrypted_saved_objects/server/crypto/encryption_key_rotation_service.mocks.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;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { EncryptionKeyRotationService } from './encryption_key_rotation_service';
+
+function createEncryptionKeyRotationServiceMock() {
+ return ({ rotate: jest.fn() } as unknown) as jest.Mocked;
+}
+
+export const encryptionKeyRotationServiceMock = {
+ create: createEncryptionKeyRotationServiceMock,
+};
diff --git a/x-pack/plugins/encrypted_saved_objects/server/crypto/encryption_key_rotation_service.test.ts b/x-pack/plugins/encrypted_saved_objects/server/crypto/encryption_key_rotation_service.test.ts
new file mode 100644
index 0000000000000..8607b81e7205e
--- /dev/null
+++ b/x-pack/plugins/encrypted_saved_objects/server/crypto/encryption_key_rotation_service.test.ts
@@ -0,0 +1,502 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import {
+ SavedObject,
+ SavedObjectsClientContract,
+ SavedObjectsServiceStart,
+} from '../../../../../src/core/server';
+import { EncryptionError, EncryptionErrorOperation } from './encryption_error';
+import { EncryptionKeyRotationService } from './encryption_key_rotation_service';
+import { EncryptedSavedObjectsService } from './encrypted_saved_objects_service';
+
+import {
+ coreMock,
+ httpServerMock,
+ loggingSystemMock,
+ savedObjectsClientMock,
+ savedObjectsTypeRegistryMock,
+} from '../../../../../src/core/server/mocks';
+import { encryptedSavedObjectsServiceMock } from './index.mock';
+
+function getMockSavedObject(savedObject?: Partial>) {
+ const id = savedObject?.id ?? `id-1`;
+ return {
+ id,
+ type: `type-${id}`,
+ references: [],
+ attributes: { attr: `attr-${id}` },
+ score: 0,
+ ...savedObject,
+ };
+}
+
+let mockEncryptionService: jest.Mocked;
+let mockRetrieveClient: jest.Mocked;
+let mockUpdateClient: jest.Mocked;
+let mockSavedObjects: jest.Mocked;
+let service: EncryptionKeyRotationService;
+beforeEach(() => {
+ mockEncryptionService = encryptedSavedObjectsServiceMock.create();
+ mockEncryptionService.isRegistered.mockImplementation(
+ (type) => type !== 'type-id-3' && type !== 'type-id-6'
+ );
+ mockEncryptionService.decryptAttributes.mockImplementation(async (descriptor, { attr }) => ({
+ attr: `decrypted-${attr}`,
+ }));
+
+ const coreSetupMock = coreMock.createSetup();
+ const coreStartMock = coreMock.createStart();
+ coreSetupMock.getStartServices.mockResolvedValue([coreStartMock, {}, {}]);
+
+ mockSavedObjects = coreStartMock.savedObjects;
+ const typeRegistryMock = savedObjectsTypeRegistryMock.create();
+ typeRegistryMock.getAllTypes.mockReturnValue([
+ { name: 'type-id-1', namespaceType: 'single', mappings: { properties: {} }, hidden: false },
+ { name: 'type-id-2', namespaceType: 'single', mappings: { properties: {} }, hidden: true },
+ { name: 'type-id-3', namespaceType: 'single', mappings: { properties: {} }, hidden: false },
+ { name: 'type-id-4', namespaceType: 'multiple', mappings: { properties: {} }, hidden: true },
+ { name: 'type-id-5', namespaceType: 'single', mappings: { properties: {} }, hidden: false },
+ { name: 'type-id-6', namespaceType: 'single', mappings: { properties: {} }, hidden: true },
+ ]);
+ typeRegistryMock.isSingleNamespace.mockImplementation((type) => type !== 'type-id-4');
+ mockSavedObjects.getTypeRegistry.mockReturnValue(typeRegistryMock);
+
+ mockRetrieveClient = savedObjectsClientMock.create();
+ mockRetrieveClient.find.mockResolvedValue({ total: 0, saved_objects: [], per_page: 0, page: 0 });
+ mockUpdateClient = savedObjectsClientMock.create();
+ mockSavedObjects.getScopedClient.mockImplementation((request, params) =>
+ params?.excludedWrappers?.[0] === 'encryptedSavedObjects'
+ ? mockRetrieveClient
+ : mockUpdateClient
+ );
+
+ service = new EncryptionKeyRotationService({
+ logger: loggingSystemMock.create().get(),
+ service: mockEncryptionService,
+ getStartServices: coreSetupMock.getStartServices,
+ });
+});
+
+it('correctly setups Saved Objects clients', async () => {
+ const mockRequest = httpServerMock.createKibanaRequest();
+ await service.rotate(mockRequest, { batchSize: 10000 });
+
+ expect(mockSavedObjects.getScopedClient).toHaveBeenCalledTimes(2);
+ expect(mockSavedObjects.getScopedClient).toHaveBeenCalledWith(mockRequest, {
+ includedHiddenTypes: ['type-id-2', 'type-id-4'],
+ excludedWrappers: ['encryptedSavedObjects'],
+ });
+ expect(mockSavedObjects.getScopedClient).toHaveBeenCalledWith(mockRequest, {
+ includedHiddenTypes: ['type-id-2', 'type-id-4'],
+ });
+});
+
+it('bails out if specified type is not registered', async () => {
+ mockEncryptionService.isRegistered.mockImplementation((type) => type !== 'type-unknown');
+
+ await expect(
+ service.rotate(httpServerMock.createKibanaRequest(), {
+ batchSize: 10000,
+ type: 'type-unknown',
+ })
+ ).resolves.toEqual({
+ total: 0,
+ successful: 0,
+ failed: 0,
+ });
+
+ expect(mockSavedObjects.getScopedClient).not.toHaveBeenCalled();
+});
+
+it('does not perform rotation if there are no Saved Objects to process', async () => {
+ await expect(
+ service.rotate(httpServerMock.createKibanaRequest(), { batchSize: 12345 })
+ ).resolves.toEqual({
+ total: 0,
+ successful: 0,
+ failed: 0,
+ });
+
+ expect(mockRetrieveClient.find).toHaveBeenCalledTimes(1);
+ expect(mockRetrieveClient.find).toHaveBeenCalledWith({
+ type: ['type-id-1', 'type-id-2', 'type-id-4', 'type-id-5'],
+ perPage: 12345,
+ namespaces: ['*'],
+ sortField: 'updated_at',
+ sortOrder: 'asc',
+ });
+
+ await expect(
+ service.rotate(httpServerMock.createKibanaRequest(), { batchSize: 54321, type: 'type-id-2' })
+ ).resolves.toEqual({
+ total: 0,
+ successful: 0,
+ failed: 0,
+ });
+
+ expect(mockRetrieveClient.find).toHaveBeenCalledTimes(2);
+ expect(mockRetrieveClient.find).toHaveBeenCalledWith({
+ type: ['type-id-2'],
+ perPage: 54321,
+ namespaces: ['*'],
+ sortField: 'updated_at',
+ sortOrder: 'asc',
+ });
+
+ expect(mockEncryptionService.decryptAttributes).not.toHaveBeenCalled();
+ expect(mockUpdateClient.bulkUpdate).not.toHaveBeenCalled();
+});
+
+it('throws if Saved Object attributes cannot be decrypted because of unknown reason', async () => {
+ mockRetrieveClient.find.mockResolvedValue({
+ total: 2,
+ saved_objects: [getMockSavedObject({ id: 'id-1' }), getMockSavedObject({ id: 'id-2' })],
+ per_page: 2,
+ page: 0,
+ });
+
+ const decryptionFailure = new Error('Oh no!');
+ mockEncryptionService.decryptAttributes.mockRejectedValue(decryptionFailure);
+
+ await expect(
+ service.rotate(httpServerMock.createKibanaRequest(), { batchSize: 12345 })
+ ).rejects.toBe(decryptionFailure);
+
+ expect(mockUpdateClient.bulkUpdate).not.toHaveBeenCalled();
+});
+
+it('does not perform rotation if Saved Object attributes cannot be decrypted', async () => {
+ mockRetrieveClient.find.mockResolvedValue({
+ total: 2,
+ saved_objects: [getMockSavedObject({ id: 'id-1' }), getMockSavedObject({ id: 'id-2' })],
+ per_page: 2,
+ page: 0,
+ });
+
+ mockEncryptionService.decryptAttributes.mockRejectedValue(
+ new EncryptionError('some-message', 'attr', EncryptionErrorOperation.Decryption)
+ );
+
+ await expect(
+ service.rotate(httpServerMock.createKibanaRequest(), { batchSize: 12345 })
+ ).resolves.toEqual({
+ total: 2,
+ successful: 0,
+ failed: 0,
+ });
+
+ expect(mockEncryptionService.decryptAttributes).toHaveBeenCalledTimes(2);
+ expect(mockUpdateClient.bulkUpdate).not.toHaveBeenCalled();
+});
+
+it('properly rotates encryption key', async () => {
+ const savedObjects = [
+ getMockSavedObject({ id: 'id-1' }),
+ getMockSavedObject({ id: 'id-2', namespaces: ['ns-1'] }),
+ getMockSavedObject({ id: 'id-4', namespaces: ['ns-2', 'ns-3'] }),
+ ];
+ mockRetrieveClient.find.mockResolvedValue({
+ total: 3,
+ saved_objects: savedObjects,
+ per_page: 3,
+ page: 0,
+ });
+ mockUpdateClient.bulkUpdate.mockResolvedValue({
+ saved_objects: savedObjects.map((object) => ({ ...object, attributes: {} })),
+ });
+
+ await expect(
+ service.rotate(httpServerMock.createKibanaRequest(), { batchSize: 12345 })
+ ).resolves.toEqual({
+ total: 3,
+ successful: 3,
+ failed: 0,
+ });
+
+ expect(mockEncryptionService.decryptAttributes).toHaveBeenCalledTimes(3);
+ expect(mockEncryptionService.decryptAttributes).toHaveBeenCalledWith(
+ { type: 'type-id-1', id: 'id-1' },
+ { attr: 'attr-id-1' },
+ { omitPrimaryEncryptionKey: true }
+ );
+ expect(mockEncryptionService.decryptAttributes).toHaveBeenCalledWith(
+ { type: 'type-id-2', id: 'id-2', namespace: 'ns-1' },
+ { attr: 'attr-id-2' },
+ { omitPrimaryEncryptionKey: true }
+ );
+ expect(mockEncryptionService.decryptAttributes).toHaveBeenCalledWith(
+ { type: 'type-id-4', id: 'id-4' },
+ { attr: 'attr-id-4' },
+ { omitPrimaryEncryptionKey: true }
+ );
+
+ expect(mockUpdateClient.bulkUpdate).toHaveBeenCalledTimes(1);
+ expect(mockUpdateClient.bulkUpdate).toHaveBeenCalledWith([
+ { ...savedObjects[0], attributes: { attr: 'decrypted-attr-id-1' } },
+ { ...savedObjects[1], namespace: 'ns-1', attributes: { attr: 'decrypted-attr-id-2' } },
+ { ...savedObjects[2], namespace: 'ns-2', attributes: { attr: 'decrypted-attr-id-4' } },
+ ]);
+});
+
+it('skips objects that cannot be decrypted', async () => {
+ const savedObjects = [
+ getMockSavedObject({ id: 'id-1' }),
+ getMockSavedObject({ id: 'id-2', namespaces: ['ns-1'] }),
+ getMockSavedObject({ id: 'id-4', namespaces: ['ns-2', 'ns-3'] }),
+ ];
+ mockRetrieveClient.find.mockResolvedValue({
+ total: 3,
+ saved_objects: savedObjects,
+ per_page: 3,
+ page: 0,
+ });
+ mockUpdateClient.bulkUpdate.mockResolvedValue({
+ saved_objects: [
+ { ...savedObjects[0], attributes: {} },
+ { ...savedObjects[2], attributes: {} },
+ ],
+ });
+
+ mockEncryptionService.decryptAttributes.mockImplementation(async ({ type }, { attr }) => {
+ if (type === 'type-id-2') {
+ throw new EncryptionError('some-message', 'attr', EncryptionErrorOperation.Decryption);
+ }
+
+ return { attr: `decrypted-${attr}` };
+ });
+
+ await expect(
+ service.rotate(httpServerMock.createKibanaRequest(), { batchSize: 12345 })
+ ).resolves.toEqual({
+ total: 3,
+ successful: 2,
+ failed: 0,
+ });
+
+ expect(mockEncryptionService.decryptAttributes).toHaveBeenCalledTimes(3);
+ expect(mockUpdateClient.bulkUpdate).toHaveBeenCalledTimes(1);
+ expect(mockUpdateClient.bulkUpdate).toHaveBeenCalledWith([
+ { ...savedObjects[0], attributes: { attr: 'decrypted-attr-id-1' } },
+ { ...savedObjects[2], namespace: 'ns-2', attributes: { attr: 'decrypted-attr-id-4' } },
+ ]);
+});
+
+it('marks object that we could not update as failed', async () => {
+ const savedObjects = [
+ getMockSavedObject({ id: 'id-1' }),
+ getMockSavedObject({ id: 'id-2', namespaces: ['ns-1'] }),
+ getMockSavedObject({ id: 'id-4', namespaces: ['ns-2', 'ns-3'] }),
+ ];
+ mockRetrieveClient.find.mockResolvedValue({
+ total: 3,
+ saved_objects: savedObjects,
+ per_page: 3,
+ page: 0,
+ });
+ mockUpdateClient.bulkUpdate.mockResolvedValue({
+ saved_objects: [{ ...savedObjects[0], attributes: {} }, { error: new Error('Oh no!') } as any],
+ });
+
+ mockEncryptionService.decryptAttributes.mockImplementation(async ({ type }, { attr }) => {
+ if (type === 'type-id-2') {
+ throw new EncryptionError('some-message', 'attr', EncryptionErrorOperation.Decryption);
+ }
+
+ return { attr: `decrypted-${attr}` };
+ });
+
+ await expect(
+ service.rotate(httpServerMock.createKibanaRequest(), { batchSize: 12345 })
+ ).resolves.toEqual({
+ total: 3,
+ successful: 1,
+ failed: 1,
+ });
+
+ expect(mockEncryptionService.decryptAttributes).toHaveBeenCalledTimes(3);
+ expect(mockUpdateClient.bulkUpdate).toHaveBeenCalledTimes(1);
+ expect(mockUpdateClient.bulkUpdate).toHaveBeenCalledWith([
+ { ...savedObjects[0], attributes: { attr: 'decrypted-attr-id-1' } },
+ { ...savedObjects[2], namespace: 'ns-2', attributes: { attr: 'decrypted-attr-id-4' } },
+ ]);
+});
+
+it('iterates until number of returned results less than batch size', async () => {
+ const savedObjectsBatch0 = [
+ getMockSavedObject({ id: 'id-1', type: 'type-id-1' }),
+ getMockSavedObject({ id: 'id-2', type: 'type-id-1' }),
+ getMockSavedObject({ id: 'id-3', type: 'type-id-1' }),
+ ];
+
+ const savedObjectsBatch1 = [
+ getMockSavedObject({ id: 'id-4', type: 'type-id-1' }),
+ getMockSavedObject({ id: 'id-5', type: 'type-id-1' }),
+ ];
+
+ // During first request we had 100 objects in total.
+ mockRetrieveClient.find.mockResolvedValueOnce({
+ total: 100,
+ saved_objects: savedObjectsBatch0,
+ per_page: 3,
+ page: 0,
+ });
+ mockUpdateClient.bulkUpdate.mockResolvedValueOnce({
+ saved_objects: [
+ { ...savedObjectsBatch0[0], attributes: {} },
+ { ...savedObjectsBatch0[1], attributes: {} },
+ { ...savedObjectsBatch0[2], attributes: {} },
+ ],
+ });
+
+ // But when we fetch data for the second time we have just two objects left (e.g. they were removed).
+ mockRetrieveClient.find.mockResolvedValueOnce({
+ total: 2,
+ saved_objects: savedObjectsBatch1,
+ per_page: 2,
+ page: 0,
+ });
+ mockUpdateClient.bulkUpdate.mockResolvedValueOnce({
+ saved_objects: [
+ { ...savedObjectsBatch1[0], attributes: {} },
+ { ...savedObjectsBatch1[1], attributes: {} },
+ ],
+ });
+
+ await expect(
+ service.rotate(httpServerMock.createKibanaRequest(), { batchSize: 3 })
+ ).resolves.toEqual({
+ total: 100,
+ successful: 5,
+ failed: 0,
+ });
+
+ expect(mockRetrieveClient.find).toHaveBeenCalledTimes(2);
+ expect(mockEncryptionService.decryptAttributes).toHaveBeenCalledTimes(5);
+ expect(mockUpdateClient.bulkUpdate).toHaveBeenCalledTimes(2);
+ expect(mockUpdateClient.bulkUpdate).toHaveBeenCalledWith([
+ { ...savedObjectsBatch0[0], attributes: { attr: 'decrypted-attr-id-1' } },
+ { ...savedObjectsBatch0[1], attributes: { attr: 'decrypted-attr-id-2' } },
+ { ...savedObjectsBatch0[2], attributes: { attr: 'decrypted-attr-id-3' } },
+ ]);
+ expect(mockUpdateClient.bulkUpdate).toHaveBeenCalledWith([
+ { ...savedObjectsBatch1[0], attributes: { attr: 'decrypted-attr-id-4' } },
+ { ...savedObjectsBatch1[1], attributes: { attr: 'decrypted-attr-id-5' } },
+ ]);
+});
+
+it('iterates until no new objects are returned', async () => {
+ const savedObjectBatches = [
+ [
+ getMockSavedObject({ id: 'id-1', type: 'type-id-1' }),
+ getMockSavedObject({ id: 'id-2', type: 'type-id-1' }),
+ getMockSavedObject({ id: 'id-3', type: 'type-id-1' }),
+ ],
+ [
+ getMockSavedObject({ id: 'id-4', type: 'type-id-1' }),
+ getMockSavedObject({ id: 'id-5', type: 'type-id-1' }),
+ getMockSavedObject({ id: 'id-6', type: 'type-id-1' }),
+ ],
+ [
+ getMockSavedObject({ id: 'id-7', type: 'type-id-1' }),
+ getMockSavedObject({ id: 'id-8', type: 'type-id-1' }),
+ getMockSavedObject({ id: 'id-9', type: 'type-id-1' }),
+ ],
+ [
+ getMockSavedObject({ id: 'id-1', type: 'type-id-1' }),
+ getMockSavedObject({ id: 'id-2', type: 'type-id-1' }),
+ getMockSavedObject({ id: 'id-3', type: 'type-id-1' }),
+ ],
+ ];
+
+ for (const batch of savedObjectBatches) {
+ mockRetrieveClient.find.mockResolvedValueOnce({
+ total: 100,
+ saved_objects: batch,
+ per_page: 3,
+ page: 0,
+ });
+ mockUpdateClient.bulkUpdate.mockResolvedValueOnce({
+ saved_objects: batch.map((object) => ({ ...object, attributes: {} })),
+ });
+ }
+
+ await expect(
+ service.rotate(httpServerMock.createKibanaRequest(), { batchSize: 3 })
+ ).resolves.toEqual({
+ total: 100,
+ successful: 9,
+ failed: 0,
+ });
+
+ expect(mockRetrieveClient.find).toHaveBeenCalledTimes(4);
+ // We don't decrypt\update same object twice, so neither object from the last batch is decrypted or updated.
+ expect(mockEncryptionService.decryptAttributes).toHaveBeenCalledTimes(9);
+ expect(mockUpdateClient.bulkUpdate).toHaveBeenCalledTimes(3);
+ for (const batch of savedObjectBatches.slice(0, 3)) {
+ expect(mockUpdateClient.bulkUpdate).toHaveBeenCalledWith(
+ batch.map((object) => ({
+ ...object,
+ attributes: { attr: `decrypted-${object.attributes.attr}` },
+ }))
+ );
+ }
+});
+
+it('iterates until max number of batches is reached', async () => {
+ // Simulate the scenario when we're getting more records then was indicated by the `total` field
+ // returned with the first batch, and every such batch includes documents we haven't processed yet.
+ const savedObjectBatches = [
+ [
+ getMockSavedObject({ id: 'id-1', type: 'type-id-1' }),
+ getMockSavedObject({ id: 'id-2', type: 'type-id-1' }),
+ ],
+ [
+ getMockSavedObject({ id: 'id-3', type: 'type-id-1' }),
+ getMockSavedObject({ id: 'id-4', type: 'type-id-1' }),
+ ],
+ [
+ getMockSavedObject({ id: 'id-5', type: 'type-id-1' }),
+ getMockSavedObject({ id: 'id-6', type: 'type-id-1' }),
+ ],
+ [
+ getMockSavedObject({ id: 'id-7', type: 'type-id-1' }),
+ getMockSavedObject({ id: 'id-8', type: 'type-id-1' }),
+ ],
+ ];
+
+ for (const batch of savedObjectBatches) {
+ mockRetrieveClient.find.mockResolvedValueOnce({
+ total: 3,
+ saved_objects: batch,
+ per_page: 2,
+ page: 0,
+ });
+ mockUpdateClient.bulkUpdate.mockResolvedValueOnce({
+ saved_objects: batch.map((object) => ({ ...object, attributes: {} })),
+ });
+ }
+
+ await expect(
+ service.rotate(httpServerMock.createKibanaRequest(), { batchSize: 2 })
+ ).resolves.toEqual({
+ total: 3,
+ successful: 6,
+ failed: 0,
+ });
+
+ expect(mockRetrieveClient.find).toHaveBeenCalledTimes(3);
+ expect(mockEncryptionService.decryptAttributes).toHaveBeenCalledTimes(6);
+ expect(mockUpdateClient.bulkUpdate).toHaveBeenCalledTimes(3);
+ for (const batch of savedObjectBatches.slice(0, 3)) {
+ expect(mockUpdateClient.bulkUpdate).toHaveBeenCalledWith(
+ batch.map((object) => ({
+ ...object,
+ attributes: { attr: `decrypted-${object.attributes.attr}` },
+ }))
+ );
+ }
+});
diff --git a/x-pack/plugins/encrypted_saved_objects/server/crypto/encryption_key_rotation_service.ts b/x-pack/plugins/encrypted_saved_objects/server/crypto/encryption_key_rotation_service.ts
new file mode 100644
index 0000000000000..fb1b6db45e762
--- /dev/null
+++ b/x-pack/plugins/encrypted_saved_objects/server/crypto/encryption_key_rotation_service.ts
@@ -0,0 +1,268 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import {
+ ISavedObjectTypeRegistry,
+ KibanaRequest,
+ Logger,
+ SavedObject,
+ SavedObjectsBulkUpdateObject,
+ StartServicesAccessor,
+} from 'src/core/server';
+import { AuthenticatedUser, SecurityPluginSetup } from '../../../security/server';
+import { getDescriptorNamespace } from '../saved_objects/get_descriptor_namespace';
+import { EncryptedSavedObjectsService } from './encrypted_saved_objects_service';
+import { EncryptionError } from './encryption_error';
+
+interface EncryptionKeyRotationServiceOptions {
+ logger: Logger;
+ service: PublicMethodsOf;
+ getStartServices: StartServicesAccessor;
+ security?: SecurityPluginSetup;
+}
+
+interface EncryptionKeyRotationParams {
+ /**
+ * The maximum number of the objects we fetch and process in one iteration.
+ */
+ batchSize: number;
+
+ /**
+ * Optionally allows to limit key rotation to only specified Saved Object type.
+ */
+ type?: string;
+}
+
+interface EncryptionKeyRotationResult {
+ /**
+ * The total number of the Saved Objects encrypted by the Encrypted Saved Objects plugin.
+ */
+ total: number;
+
+ /**
+ * The number of the Saved Objects that were still encrypted with one of the secondary encryption
+ * keys and were successfully re-encrypted with the primary key.
+ */
+ successful: number;
+
+ /**
+ * The number of the Saved Objects that were still encrypted with one of the secondary encryption
+ * keys that we failed to re-encrypt with the primary key.
+ */
+ failed: number;
+}
+
+/**
+ * Service that deals with encryption key rotation matters.
+ */
+export class EncryptionKeyRotationService {
+ constructor(private readonly options: EncryptionKeyRotationServiceOptions) {}
+
+ public async rotate(
+ request: KibanaRequest,
+ { batchSize, type }: EncryptionKeyRotationParams
+ ): Promise {
+ const [{ savedObjects }] = await this.options.getStartServices();
+ const typeRegistry = savedObjects.getTypeRegistry();
+
+ // We need to retrieve all SavedObject types which have encrypted attributes, specifically
+ // collecting those that are hidden as they are ignored by the Saved Objects client by default.
+ this.options.logger.debug('Retrieving Saved Object types that require encryption.');
+ const registeredSavedObjectTypes = [];
+ const registeredHiddenSavedObjectTypes = [];
+ for (const knownType of typeRegistry.getAllTypes()) {
+ if (this.options.service.isRegistered(knownType.name) && (!type || knownType.name === type)) {
+ registeredSavedObjectTypes.push(knownType.name);
+
+ if (knownType.hidden) {
+ registeredHiddenSavedObjectTypes.push(knownType.name);
+ }
+ }
+ }
+
+ const result = { total: 0, successful: 0, failed: 0 };
+ if (registeredSavedObjectTypes.length === 0) {
+ this.options.logger.info(
+ type
+ ? `Saved Object type "${type}" is not registered, encryption key rotation is not needed.`
+ : 'There are no registered Saved Object types that can have encrypted attributes, encryption key rotation is not needed.'
+ );
+ return result;
+ }
+
+ this.options.logger.info(
+ `Saved Objects with the following types [${registeredSavedObjectTypes}] will be processed.`
+ );
+
+ // We need two separate Saved Objects clients for the retrieval and update. For retrieval we
+ // don't want to have Encrypted Saved Objects wrapper so that it doesn't strip encrypted
+ // attributes. But for the update we want to have it so that it automatically re-encrypts
+ // attributes with the new primary encryption key.
+ const user = this.options.security?.authc.getCurrentUser(request) ?? undefined;
+ const retrieveClient = savedObjects.getScopedClient(request, {
+ includedHiddenTypes: registeredHiddenSavedObjectTypes,
+ excludedWrappers: ['encryptedSavedObjects'],
+ });
+ const updateClient = savedObjects.getScopedClient(request, {
+ includedHiddenTypes: registeredHiddenSavedObjectTypes,
+ });
+
+ // Keeps track of object IDs that have been processed already.
+ const processedObjectIDs = new Set();
+
+ // Until we get scroll/search_after support in Saved Objects client we have to retrieve as much objects as allowed
+ // by the `batchSize` parameter. Instead of using paging functionality (size/from or page/perPage parameters) that
+ // has certain performance issues and is also limited by the maximum result window setting on .kibana index
+ // (10,000 by default) we always fetch the first page of the results sorted by the `updated_at` field. This way we
+ // can prioritize "old" objects that have a higher chance to have been encrypted with the old encryption keys, since
+ // all newly created or updated objects are always encrypted with the current primary key. Re-encryption of the
+ // "old" objects with the primary key implicitly bumps up their `updated_at` field so that these objects won't be
+ // included into the first page of the results during next iteration. Additionally we track IDs of all processed
+ // objects so that eventually we can detect that first page consists of only objects encrypted with the current
+ // primary key and stop iterating.
+ //
+ // LIMITATION: if we have a lot of "old" objects encrypted with the _unknown_ encryption key it may either
+ // significantly slow down rotation or prevent it from happening completely since such objects will be included into
+ // every batch we fetch and if their number is equal to or greater than `batchSize` we won't be able to process any
+ // object. Another and more complex case when we can be hit by this limitation is when users have multiple Kibana
+ // instances configured with different primary encryption keys, these time even "new" objects may require rotation,
+ // but they may be included into 2+ page of the results. We can potentially detect such cases and issue a warning,
+ // but it's not an easy task: if we detect a case when none of the objects from the very first batch cannot be
+ // decrypted with the decryption only keys we'll need to check how many of them can be decrypted at all using all
+ // available keys including the current primary one.
+ //
+ // Also theoretically if `batchSize` is less than `index.max_result_window` we could try to rely on the paging
+ // functionality and switch to the second page, but the issue here is that objects can be deleted in the meantime
+ // so that unprocessed objects may get into the first page and we'll miss them. We can of course oscillate between
+ // the first and the second pages or do multiple rotation passes, but it'd complicate code significantly.
+ let batch = 0;
+ let maxBatches = 0;
+ while (true) {
+ this.options.logger.debug(`Fetching ${batchSize} objects (batch #${batch}).`);
+ const savedObjectsToDecrypt = await retrieveClient.find({
+ type: registeredSavedObjectTypes,
+ perPage: batchSize,
+ namespaces: ['*'],
+ sortField: 'updated_at',
+ sortOrder: 'asc',
+ });
+
+ // We use `total` only from the first batch just as an approximate indicator for the consumer since total number
+ // can change from batch to batch, but it won't affect the actual processing logic.
+ if (batch === 0) {
+ this.options.logger.debug(`Found ${savedObjectsToDecrypt.total} objects.`);
+ result.total = savedObjectsToDecrypt.total;
+ // Since we process live data there is a theoretical chance that we may be getting new
+ // objects in every batch effectively making this loop infinite. To prevent this we want to
+ // limit a number of batches we process during single rotation request giving enough room
+ // for the Saved Objects occasionally created during rotation.
+ maxBatches = Math.ceil((savedObjectsToDecrypt.total * 2) / batchSize);
+ }
+
+ this.options.logger.debug(
+ `Decrypting ${savedObjectsToDecrypt.saved_objects.length} objects (batch #${batch}).`
+ );
+ const savedObjectsToEncrypt = await this.getSavedObjectsToReEncrypt(
+ savedObjectsToDecrypt.saved_objects,
+ processedObjectIDs,
+ typeRegistry,
+ user
+ );
+ if (savedObjectsToEncrypt.length === 0) {
+ break;
+ }
+
+ this.options.logger.debug(
+ `Re-encrypting ${savedObjectsToEncrypt.length} objects (batch #${batch}).`
+ );
+ try {
+ const succeeded = (
+ await updateClient.bulkUpdate(savedObjectsToEncrypt)
+ ).saved_objects.filter((savedObject) => !savedObject.error).length;
+
+ this.options.logger.debug(
+ `Successfully re-encrypted ${succeeded} out of ${savedObjectsToEncrypt.length} objects (batch #${batch}).`
+ );
+
+ result.successful += succeeded;
+ result.failed += savedObjectsToEncrypt.length - succeeded;
+ } catch (err) {
+ this.options.logger.error(
+ `Failed to re-encrypt saved objects (batch #${batch}): ${err.message}`
+ );
+ result.failed += savedObjectsToEncrypt.length;
+ }
+
+ if (savedObjectsToDecrypt.total <= batchSize || ++batch >= maxBatches) {
+ break;
+ }
+ }
+
+ this.options.logger.info(
+ `Encryption key rotation is completed. ${result.successful} objects out ouf ${result.total} were successfully re-encrypted with the primary encryption key and ${result.failed} objects failed.`
+ );
+
+ return result;
+ }
+
+ /**
+ * Takes a list of Saved Objects and tries to decrypt their attributes with the secondary encryption
+ * keys, silently skipping those that cannot be decrypted. The objects that were decrypted with the
+ * decryption-only keys will be returned and grouped by the namespace.
+ * @param savedObjects Saved Objects to decrypt attributes for.
+ * @param processedObjectIDs Set of Saved Object IDs that were already processed.
+ * @param typeRegistry Saved Objects type registry.
+ * @param user The user that initiated decryption.
+ */
+ private async getSavedObjectsToReEncrypt(
+ savedObjects: SavedObject[],
+ processedObjectIDs: Set,
+ typeRegistry: ISavedObjectTypeRegistry,
+ user?: AuthenticatedUser
+ ) {
+ const decryptedSavedObjects: SavedObjectsBulkUpdateObject[] = [];
+ for (const savedObject of savedObjects) {
+ // We shouldn't process objects that we already processed during previous iterations.
+ if (processedObjectIDs.has(savedObject.id)) {
+ continue;
+ } else {
+ processedObjectIDs.add(savedObject.id);
+ }
+
+ let decryptedAttributes;
+ try {
+ decryptedAttributes = await this.options.service.decryptAttributes(
+ {
+ type: savedObject.type,
+ id: savedObject.id,
+ namespace: getDescriptorNamespace(
+ typeRegistry,
+ savedObject.type,
+ savedObject.namespaces
+ ),
+ },
+ savedObject.attributes as Record,
+ { omitPrimaryEncryptionKey: true, user }
+ );
+ } catch (err) {
+ if (!(err instanceof EncryptionError)) {
+ throw err;
+ }
+
+ continue;
+ }
+
+ decryptedSavedObjects.push({
+ ...savedObject,
+ attributes: decryptedAttributes,
+ // `bulkUpdate` expects objects with a single `namespace`.
+ namespace: savedObject.namespaces?.[0],
+ });
+ }
+
+ return decryptedSavedObjects;
+ }
+}
diff --git a/x-pack/plugins/encrypted_saved_objects/server/crypto/index.mock.ts b/x-pack/plugins/encrypted_saved_objects/server/crypto/index.mock.ts
index 3e4983deca625..4410cbac7beb9 100644
--- a/x-pack/plugins/encrypted_saved_objects/server/crypto/index.mock.ts
+++ b/x-pack/plugins/encrypted_saved_objects/server/crypto/index.mock.ts
@@ -5,3 +5,4 @@
*/
export { encryptedSavedObjectsServiceMock } from './encrypted_saved_objects_service.mocks';
+export { encryptionKeyRotationServiceMock } from './encryption_key_rotation_service.mocks';
diff --git a/x-pack/plugins/encrypted_saved_objects/server/crypto/index.ts b/x-pack/plugins/encrypted_saved_objects/server/crypto/index.ts
index 75445bd24eba8..ff5e5fdc01059 100644
--- a/x-pack/plugins/encrypted_saved_objects/server/crypto/index.ts
+++ b/x-pack/plugins/encrypted_saved_objects/server/crypto/index.ts
@@ -12,3 +12,4 @@ export {
} from './encrypted_saved_objects_service';
export { EncryptionError } from './encryption_error';
export { EncryptedSavedObjectAttributesDefinition } from './encrypted_saved_object_type_definition';
+export { EncryptionKeyRotationService } from './encryption_key_rotation_service';
diff --git a/x-pack/plugins/encrypted_saved_objects/server/plugin.test.ts b/x-pack/plugins/encrypted_saved_objects/server/plugin.test.ts
index 57108954f2568..8d8f1a51f6802 100644
--- a/x-pack/plugins/encrypted_saved_objects/server/plugin.test.ts
+++ b/x-pack/plugins/encrypted_saved_objects/server/plugin.test.ts
@@ -5,6 +5,7 @@
*/
import { Plugin } from './plugin';
+import { ConfigSchema } from './config';
import { coreMock } from 'src/core/server/mocks';
import { securityMock } from '../../security/server/mocks';
@@ -12,7 +13,9 @@ import { securityMock } from '../../security/server/mocks';
describe('EncryptedSavedObjects Plugin', () => {
describe('setup()', () => {
it('exposes proper contract', async () => {
- const plugin = new Plugin(coreMock.createPluginInitializerContext());
+ const plugin = new Plugin(
+ coreMock.createPluginInitializerContext(ConfigSchema.validate({}, { dist: true }))
+ );
await expect(plugin.setup(coreMock.createSetup(), { security: securityMock.createSetup() }))
.resolves.toMatchInlineSnapshot(`
Object {
@@ -26,7 +29,9 @@ describe('EncryptedSavedObjects Plugin', () => {
describe('start()', () => {
it('exposes proper contract', async () => {
- const plugin = new Plugin(coreMock.createPluginInitializerContext());
+ const plugin = new Plugin(
+ coreMock.createPluginInitializerContext(ConfigSchema.validate({}, { dist: true }))
+ );
await plugin.setup(coreMock.createSetup(), { security: securityMock.createSetup() });
const startContract = plugin.start();
diff --git a/x-pack/plugins/encrypted_saved_objects/server/plugin.ts b/x-pack/plugins/encrypted_saved_objects/server/plugin.ts
index 69777798ddf19..6e3724fa3fe58 100644
--- a/x-pack/plugins/encrypted_saved_objects/server/plugin.ts
+++ b/x-pack/plugins/encrypted_saved_objects/server/plugin.ts
@@ -4,19 +4,22 @@
* you may not use this file except in compliance with the Elastic License.
*/
+import { first, map } from 'rxjs/operators';
import nodeCrypto from '@elastic/node-crypto';
import { Logger, PluginInitializerContext, CoreSetup } from 'src/core/server';
-import { first } from 'rxjs/operators';
+import { TypeOf } from '@kbn/config-schema';
import { SecurityPluginSetup } from '../../security/server';
-import { createConfig$ } from './config';
+import { createConfig, ConfigSchema } from './config';
import {
EncryptedSavedObjectsService,
EncryptedSavedObjectTypeRegistration,
EncryptionError,
+ EncryptionKeyRotationService,
} from './crypto';
import { EncryptedSavedObjectsAuditLogger } from './audit';
import { setupSavedObjects, ClientInstanciator } from './saved_objects';
import { getCreateMigration, CreateEncryptedSavedObjectsMigrationFn } from './create_migration';
+import { defineRoutes } from './routes';
export interface PluginsSetup {
security?: SecurityPluginSetup;
@@ -48,18 +51,29 @@ export class Plugin {
core: CoreSetup,
deps: PluginsSetup
): Promise {
- const {
- config: { encryptionKey },
- usingEphemeralEncryptionKey,
- } = await createConfig$(this.initializerContext).pipe(first()).toPromise();
-
- const crypto = nodeCrypto({ encryptionKey });
-
+ const config = await this.initializerContext.config
+ .create>()
+ .pipe(
+ map((rawConfig) => createConfig(rawConfig, this.initializerContext.logger.get('config')))
+ )
+ .pipe(first())
+ .toPromise();
const auditLogger = new EncryptedSavedObjectsAuditLogger(
deps.security?.audit.getLogger('encryptedSavedObjects')
);
+
+ const primaryCrypto = nodeCrypto({ encryptionKey: config.encryptionKey });
+ const decryptionOnlyCryptos = config.keyRotation.decryptionOnlyKeys.map((decryptionKey) =>
+ nodeCrypto({ encryptionKey: decryptionKey })
+ );
+
const service = Object.freeze(
- new EncryptedSavedObjectsService(crypto, this.logger, auditLogger)
+ new EncryptedSavedObjectsService({
+ primaryCrypto,
+ decryptionOnlyCryptos,
+ logger: this.logger,
+ audit: auditLogger,
+ })
);
this.savedObjectsSetup = setupSavedObjects({
@@ -69,18 +83,33 @@ export class Plugin {
getStartServices: core.getStartServices,
});
+ defineRoutes({
+ router: core.http.createRouter(),
+ logger: this.initializerContext.logger.get('routes'),
+ encryptionKeyRotationService: Object.freeze(
+ new EncryptionKeyRotationService({
+ logger: this.logger.get('key-rotation-service'),
+ service,
+ getStartServices: core.getStartServices,
+ security: deps.security,
+ })
+ ),
+ config,
+ });
+
return {
registerType: (typeRegistration: EncryptedSavedObjectTypeRegistration) =>
service.registerType(typeRegistration),
- usingEphemeralEncryptionKey,
+ usingEphemeralEncryptionKey: config.usingEphemeralEncryptionKey,
createMigration: getCreateMigration(
service,
(typeRegistration: EncryptedSavedObjectTypeRegistration) => {
- const serviceForMigration = new EncryptedSavedObjectsService(
- crypto,
- this.logger,
- auditLogger
- );
+ const serviceForMigration = new EncryptedSavedObjectsService({
+ primaryCrypto,
+ decryptionOnlyCryptos,
+ logger: this.logger,
+ audit: auditLogger,
+ });
serviceForMigration.registerType(typeRegistration);
return serviceForMigration;
}
diff --git a/x-pack/plugins/encrypted_saved_objects/server/routes/index.mock.ts b/x-pack/plugins/encrypted_saved_objects/server/routes/index.mock.ts
new file mode 100644
index 0000000000000..b3d54c7f1ecac
--- /dev/null
+++ b/x-pack/plugins/encrypted_saved_objects/server/routes/index.mock.ts
@@ -0,0 +1,19 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { ConfigSchema, createConfig } from '../config';
+
+import { httpServiceMock, loggingSystemMock } from '../../../../../src/core/server/mocks';
+import { encryptionKeyRotationServiceMock } from '../crypto/index.mock';
+
+export const routeDefinitionParamsMock = {
+ create: (config: Record = {}) => ({
+ router: httpServiceMock.createRouter(),
+ logger: loggingSystemMock.create().get(),
+ config: createConfig(ConfigSchema.validate(config), loggingSystemMock.create().get()),
+ encryptionKeyRotationService: encryptionKeyRotationServiceMock.create(),
+ }),
+};
diff --git a/x-pack/plugins/encrypted_saved_objects/server/routes/index.ts b/x-pack/plugins/encrypted_saved_objects/server/routes/index.ts
new file mode 100644
index 0000000000000..72af8060de827
--- /dev/null
+++ b/x-pack/plugins/encrypted_saved_objects/server/routes/index.ts
@@ -0,0 +1,25 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { IRouter, Logger } from '../../../../../src/core/server';
+import { ConfigType } from '../config';
+import { EncryptionKeyRotationService } from '../crypto';
+
+import { defineKeyRotationRoutes } from './key_rotation';
+
+/**
+ * Describes parameters used to define HTTP routes.
+ */
+export interface RouteDefinitionParams {
+ router: IRouter;
+ logger: Logger;
+ config: ConfigType;
+ encryptionKeyRotationService: PublicMethodsOf;
+}
+
+export function defineRoutes(params: RouteDefinitionParams) {
+ defineKeyRotationRoutes(params);
+}
diff --git a/x-pack/plugins/encrypted_saved_objects/server/routes/key_rotation.test.ts b/x-pack/plugins/encrypted_saved_objects/server/routes/key_rotation.test.ts
new file mode 100644
index 0000000000000..ced4dda48fcd2
--- /dev/null
+++ b/x-pack/plugins/encrypted_saved_objects/server/routes/key_rotation.test.ts
@@ -0,0 +1,172 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { Type } from '@kbn/config-schema';
+import {
+ IRouter,
+ kibanaResponseFactory,
+ RequestHandler,
+ RequestHandlerContext,
+ RouteConfig,
+} from '../../../../../src/core/server';
+import { defineKeyRotationRoutes } from './key_rotation';
+
+import { httpServerMock } from '../../../../../src/core/server/mocks';
+import { routeDefinitionParamsMock } from './index.mock';
+import { EncryptionKeyRotationService } from '../crypto';
+
+describe('Key rotation routes', () => {
+ let router: jest.Mocked;
+ let mockContext: RequestHandlerContext;
+ let mockEncryptionKeyRotationService: jest.Mocked;
+ beforeEach(() => {
+ const routeParamsMock = routeDefinitionParamsMock.create({
+ keyRotation: { decryptionOnlyKeys: ['b'.repeat(32)] },
+ });
+ router = routeParamsMock.router;
+ mockEncryptionKeyRotationService = routeParamsMock.encryptionKeyRotationService;
+
+ mockContext = ({} as unknown) as RequestHandlerContext;
+
+ defineKeyRotationRoutes(routeParamsMock);
+ });
+
+ describe('rotate', () => {
+ let routeHandler: RequestHandler;
+ let routeConfig: RouteConfig;
+ beforeEach(() => {
+ const [rotateRouteConfig, rotateRouteHandler] = router.post.mock.calls.find(
+ ([{ path }]) => path === '/api/encrypted_saved_objects/_rotate_key'
+ )!;
+
+ routeConfig = rotateRouteConfig;
+ routeHandler = rotateRouteHandler;
+ });
+
+ it('correctly defines route.', () => {
+ expect(routeConfig.options).toEqual({ tags: ['access:rotateEncryptionKey'] });
+ expect(routeConfig.validate).toEqual({
+ body: undefined,
+ query: expect.any(Type),
+ params: undefined,
+ });
+
+ const queryValidator = (routeConfig.validate as any).query as Type;
+ expect(
+ queryValidator.validate({
+ batchSize: 100,
+ type: 'some-type',
+ })
+ ).toEqual({
+ batchSize: 100,
+ type: 'some-type',
+ });
+ expect(queryValidator.validate({ batchSize: 1 })).toEqual({ batchSize: 1 });
+ expect(queryValidator.validate({ batchSize: 10000 })).toEqual({ batchSize: 10000 });
+ expect(queryValidator.validate({})).toEqual({ batchSize: 10000 });
+
+ expect(() => queryValidator.validate({ batchSize: 0 })).toThrowErrorMatchingInlineSnapshot(
+ `"[batchSize]: Value must be equal to or greater than [1]."`
+ );
+ expect(() =>
+ queryValidator.validate({ batchSize: 10001 })
+ ).toThrowErrorMatchingInlineSnapshot(
+ `"[batchSize]: Value must be equal to or lower than [10000]."`
+ );
+
+ expect(() => queryValidator.validate({ type: 100 })).toThrowErrorMatchingInlineSnapshot(
+ `"[type]: expected value of type [string] but got [number]"`
+ );
+ });
+
+ it('returns 400 if decryption only keys are not specified.', async () => {
+ const routeParamsMock = routeDefinitionParamsMock.create();
+ defineKeyRotationRoutes(routeParamsMock);
+ const [, rotateRouteHandler] = routeParamsMock.router.post.mock.calls.find(
+ ([{ path }]) => path === '/api/encrypted_saved_objects/_rotate_key'
+ )!;
+
+ await expect(
+ rotateRouteHandler(mockContext, httpServerMock.createKibanaRequest(), kibanaResponseFactory)
+ ).resolves.toEqual({
+ status: 400,
+ payload:
+ 'Kibana is not configured to support encryption key rotation. Update `kibana.yml` to include `xpack.encryptedSavedObjects.keyRotation.decryptionOnlyKeys` to rotate your encryption keys.',
+ options: {
+ body:
+ 'Kibana is not configured to support encryption key rotation. Update `kibana.yml` to include `xpack.encryptedSavedObjects.keyRotation.decryptionOnlyKeys` to rotate your encryption keys.',
+ },
+ });
+ });
+
+ it('returns 500 if `rotate` throws unhandled exception.', async () => {
+ const unhandledException = new Error('Something went wrong.');
+ mockEncryptionKeyRotationService.rotate.mockRejectedValue(unhandledException);
+
+ const mockRequest = httpServerMock.createKibanaRequest({ query: { batchSize: 1234 } });
+ const response = await routeHandler(mockContext, mockRequest, kibanaResponseFactory);
+
+ expect(response.status).toBe(500);
+ expect(response.payload).toEqual(unhandledException);
+ expect(mockEncryptionKeyRotationService.rotate).toHaveBeenCalledWith(mockRequest, {
+ batchSize: 1234,
+ });
+ });
+
+ it('returns whatever `rotate` returns.', async () => {
+ const mockRequest = httpServerMock.createKibanaRequest({ query: { batchSize: 1234 } });
+ mockEncryptionKeyRotationService.rotate.mockResolvedValue({
+ total: 3,
+ successful: 6,
+ failed: 0,
+ });
+
+ await expect(routeHandler(mockContext, mockRequest, kibanaResponseFactory)).resolves.toEqual({
+ status: 200,
+ payload: { total: 3, successful: 6, failed: 0 },
+ options: { body: { total: 3, successful: 6, failed: 0 } },
+ });
+ });
+
+ it('returns 429 if called while rotation is in progress.', async () => {
+ const mockRequest = httpServerMock.createKibanaRequest({ query: { batchSize: 1234 } });
+ mockEncryptionKeyRotationService.rotate.mockResolvedValue({
+ total: 3,
+ successful: 6,
+ failed: 0,
+ });
+
+ // Run rotation, but don't wait until it's complete.
+ const firstRequestPromise = routeHandler(mockContext, mockRequest, kibanaResponseFactory);
+
+ // Try to run rotation once again.
+ await expect(routeHandler(mockContext, mockRequest, kibanaResponseFactory)).resolves.toEqual({
+ status: 429,
+ payload:
+ 'Encryption key rotation is in progress already. Please wait until it is completed and try again.',
+ options: {
+ statusCode: 429,
+ body:
+ 'Encryption key rotation is in progress already. Please wait until it is completed and try again.',
+ },
+ });
+
+ // Initial request properly resolves.
+ await expect(firstRequestPromise).resolves.toEqual({
+ status: 200,
+ payload: { total: 3, successful: 6, failed: 0 },
+ options: { body: { total: 3, successful: 6, failed: 0 } },
+ });
+
+ // And subsequent requests resolve properly too.
+ await expect(routeHandler(mockContext, mockRequest, kibanaResponseFactory)).resolves.toEqual({
+ status: 200,
+ payload: { total: 3, successful: 6, failed: 0 },
+ options: { body: { total: 3, successful: 6, failed: 0 } },
+ });
+ });
+ });
+});
diff --git a/x-pack/plugins/encrypted_saved_objects/server/routes/key_rotation.ts b/x-pack/plugins/encrypted_saved_objects/server/routes/key_rotation.ts
new file mode 100644
index 0000000000000..48b29387106ee
--- /dev/null
+++ b/x-pack/plugins/encrypted_saved_objects/server/routes/key_rotation.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;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { schema } from '@kbn/config-schema';
+import { RouteDefinitionParams } from '.';
+
+/**
+ * The default maximum value of from + size for searches to .kibana index. Since we cannot use scroll
+ * or search_after functionality with the .kibana index we limit maximum batch size with this value.
+ */
+const DEFAULT_MAX_RESULT_WINDOW = 10000;
+
+/**
+ * Defines routes that are used for encryption key rotation.
+ */
+export function defineKeyRotationRoutes({
+ encryptionKeyRotationService,
+ router,
+ logger,
+ config,
+}: RouteDefinitionParams) {
+ let rotationInProgress = false;
+ router.post(
+ {
+ path: '/api/encrypted_saved_objects/_rotate_key',
+ validate: {
+ query: schema.object({
+ batchSize: schema.number({
+ min: 1,
+ max: DEFAULT_MAX_RESULT_WINDOW,
+ defaultValue: DEFAULT_MAX_RESULT_WINDOW,
+ }),
+ type: schema.maybe(schema.string()),
+ }),
+ },
+ options: {
+ tags: ['access:rotateEncryptionKey'],
+ },
+ },
+ async (context, request, response) => {
+ if (config.keyRotation.decryptionOnlyKeys.length === 0) {
+ return response.badRequest({
+ body:
+ 'Kibana is not configured to support encryption key rotation. Update `kibana.yml` to include `xpack.encryptedSavedObjects.keyRotation.decryptionOnlyKeys` to rotate your encryption keys.',
+ });
+ }
+
+ if (rotationInProgress) {
+ return response.customError({
+ body:
+ 'Encryption key rotation is in progress already. Please wait until it is completed and try again.',
+ statusCode: 429,
+ });
+ }
+
+ rotationInProgress = true;
+ try {
+ return response.ok({
+ body: await encryptionKeyRotationService.rotate(request, {
+ batchSize: request.query.batchSize,
+ type: request.query.type,
+ }),
+ });
+ } catch (err) {
+ logger.error(err);
+ return response.customError({ body: err, statusCode: 500 });
+ } finally {
+ rotationInProgress = false;
+ }
+ }
+ );
+}
diff --git a/x-pack/plugins/encrypted_saved_objects/server/saved_objects/get_descriptor_namespace.test.ts b/x-pack/plugins/encrypted_saved_objects/server/saved_objects/get_descriptor_namespace.test.ts
index 7ba90a5a76ab3..33ea1d8c3acec 100644
--- a/x-pack/plugins/encrypted_saved_objects/server/saved_objects/get_descriptor_namespace.test.ts
+++ b/x-pack/plugins/encrypted_saved_objects/server/saved_objects/get_descriptor_namespace.test.ts
@@ -66,5 +66,16 @@ describe('getDescriptorNamespace', () => {
'foo-namespace'
);
});
+
+ it('returns the provided namespace if it is in array format', () => {
+ const mockBaseTypeRegistry = savedObjectsTypeRegistryMock.create();
+ mockBaseTypeRegistry.isSingleNamespace.mockReturnValue(true);
+ mockBaseTypeRegistry.isMultiNamespace.mockReturnValue(false);
+ mockBaseTypeRegistry.isNamespaceAgnostic.mockReturnValue(false);
+
+ expect(getDescriptorNamespace(mockBaseTypeRegistry, 'singletype', ['foo-namespace'])).toEqual(
+ 'foo-namespace'
+ );
+ });
});
});
diff --git a/x-pack/plugins/encrypted_saved_objects/server/saved_objects/get_descriptor_namespace.ts b/x-pack/plugins/encrypted_saved_objects/server/saved_objects/get_descriptor_namespace.ts
index 7201f13fb930b..7c237b82cbb15 100644
--- a/x-pack/plugins/encrypted_saved_objects/server/saved_objects/get_descriptor_namespace.ts
+++ b/x-pack/plugins/encrypted_saved_objects/server/saved_objects/get_descriptor_namespace.ts
@@ -9,9 +9,13 @@ import { ISavedObjectTypeRegistry, SavedObjectsUtils } from '../../../../../src/
export const getDescriptorNamespace = (
typeRegistry: ISavedObjectTypeRegistry,
type: string,
- namespace?: string
+ namespace?: string | string[]
) => {
- const descriptorNamespace = typeRegistry.isSingleNamespace(type) ? namespace : undefined;
+ const descriptorNamespace = typeRegistry.isSingleNamespace(type)
+ ? Array.isArray(namespace)
+ ? namespace[0]
+ : namespace
+ : undefined;
return normalizeNamespace(descriptorNamespace);
};
diff --git a/x-pack/plugins/global_search_bar/public/assets/illustration_product_no_search_results_dark.svg b/x-pack/plugins/global_search_bar/public/assets/illustration_product_no_search_results_dark.svg
new file mode 100644
index 0000000000000..3a87f06b7bcc8
--- /dev/null
+++ b/x-pack/plugins/global_search_bar/public/assets/illustration_product_no_search_results_dark.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/x-pack/plugins/global_search_bar/public/assets/illustration_product_no_search_results_light.svg b/x-pack/plugins/global_search_bar/public/assets/illustration_product_no_search_results_light.svg
new file mode 100644
index 0000000000000..ac5298be17cca
--- /dev/null
+++ b/x-pack/plugins/global_search_bar/public/assets/illustration_product_no_search_results_light.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/x-pack/plugins/global_search_bar/public/components/search_bar.test.tsx b/x-pack/plugins/global_search_bar/public/components/search_bar.test.tsx
index 11fbc7931e620..6fad3335c5efc 100644
--- a/x-pack/plugins/global_search_bar/public/components/search_bar.test.tsx
+++ b/x-pack/plugins/global_search_bar/public/components/search_bar.test.tsx
@@ -8,6 +8,7 @@ import React from 'react';
import { wait } from '@testing-library/react';
import { of } from 'rxjs';
import { mountWithIntl } from 'test_utils/enzyme_helpers';
+import { httpServiceMock, uiSettingsServiceMock } from '../../../../../src/core/public/mocks';
import {
GlobalSearchBatchedResults,
GlobalSearchPluginStart,
@@ -47,6 +48,10 @@ const getSearchProps: any = (component: any) => component.find('EuiFieldSearch')
describe('SearchBar', () => {
let searchService: GlobalSearchPluginStart;
let findSpy: jest.SpyInstance;
+ const http = httpServiceMock.createSetupContract({ basePath: '/test' });
+ const basePathUrl = http.basePath.prepend('/plugins/globalSearchBar/assets/');
+ const uiSettings = uiSettingsServiceMock.createStartContract();
+ const darkMode = uiSettings.get('theme:darkMode');
beforeEach(() => {
searchService = globalSearchPluginMock.createStartContract();
@@ -66,7 +71,12 @@ describe('SearchBar', () => {
.mockReturnValueOnce(of(createBatch('Discover', { id: 'My Dashboard', type: 'test' })));
const component = mountWithIntl(
-
+
);
expect(findSpy).toHaveBeenCalledTimes(0);
@@ -85,7 +95,14 @@ describe('SearchBar', () => {
});
it('supports keyboard shortcuts', () => {
- mountWithIntl( );
+ mountWithIntl(
+
+ );
const searchEvent = new KeyboardEvent('keydown', {
key: '/',
diff --git a/x-pack/plugins/global_search_bar/public/components/search_bar.tsx b/x-pack/plugins/global_search_bar/public/components/search_bar.tsx
index 0dde28db0436d..4ca0f8cf81b7b 100644
--- a/x-pack/plugins/global_search_bar/public/components/search_bar.tsx
+++ b/x-pack/plugins/global_search_bar/public/components/search_bar.tsx
@@ -12,6 +12,7 @@ import {
EuiSelectableTemplateSitewideOption,
EuiText,
EuiIcon,
+ EuiImage,
EuiHeaderSectionItemButton,
EuiSelectableMessage,
} from '@elastic/eui';
@@ -27,6 +28,8 @@ import { GlobalSearchPluginStart, GlobalSearchResult } from '../../../global_sea
interface Props {
globalSearch: GlobalSearchPluginStart['find'];
navigateToUrl: ApplicationStart['navigateToUrl'];
+ basePathUrl: string;
+ darkMode: boolean;
}
const clearField = (field: HTMLInputElement) => {
@@ -42,7 +45,7 @@ const clearField = (field: HTMLInputElement) => {
const cleanMeta = (str: string) => (str.charAt(0).toUpperCase() + str.slice(1)).replace(/-/g, ' ');
const blurEvent = new FocusEvent('blur');
-export function SearchBar({ globalSearch, navigateToUrl }: Props) {
+export function SearchBar({ globalSearch, navigateToUrl, basePathUrl, darkMode }: Props) {
const isMounted = useMountedState();
const [searchValue, setSearchValue] = useState('');
const [searchRef, setSearchRef] = useState(null);
@@ -134,6 +137,34 @@ export function SearchBar({ globalSearch, navigateToUrl }: Props) {
}
};
+ const emptyMessage = (
+
+
+
+
+
+
+
+
+
+
+
+ );
+
useEvent('keydown', onKeyDown);
return (
@@ -164,22 +195,8 @@ export function SearchBar({ globalSearch, navigateToUrl }: Props) {
popoverProps={{
repositionOnScroll: true,
}}
- emptyMessage={
-
-
-
-
-
-
-
-
- }
+ emptyMessage={emptyMessage}
+ noMatchesMessage={emptyMessage}
popoverFooter={
{
public start(core: CoreStart, { globalSearch }: GlobalSearchBarPluginStartDeps) {
core.chrome.navControls.registerCenter({
order: 1000,
- mount: (target) => this.mount(target, globalSearch, core.application.navigateToUrl),
+ mount: (target) =>
+ this.mount(
+ target,
+ globalSearch,
+ core.application.navigateToUrl,
+ core.http.basePath.prepend('/plugins/globalSearchBar/assets/'),
+ core.uiSettings.get('theme:darkMode')
+ ),
});
return {};
}
@@ -32,11 +39,18 @@ export class GlobalSearchBarPlugin implements Plugin<{}, {}> {
private mount(
targetDomElement: HTMLElement,
globalSearch: GlobalSearchPluginStart,
- navigateToUrl: ApplicationStart['navigateToUrl']
+ navigateToUrl: ApplicationStart['navigateToUrl'],
+ basePathUrl: string,
+ darkMode: boolean
) {
ReactDOM.render(
-
+
,
targetDomElement
);
diff --git a/x-pack/plugins/infra/public/alerting/common/components/get_alert_preview.ts b/x-pack/plugins/infra/public/alerting/common/components/get_alert_preview.ts
index 207d8a722a8c6..ea50ea6f11f3a 100644
--- a/x-pack/plugins/infra/public/alerting/common/components/get_alert_preview.ts
+++ b/x-pack/plugins/infra/public/alerting/common/components/get_alert_preview.ts
@@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { HttpSetup } from 'src/core/public';
+import type { HttpHandler } from 'src/core/public';
import {
INFRA_ALERT_PREVIEW_PATH,
METRIC_THRESHOLD_ALERT_TYPE_ID,
@@ -22,7 +22,7 @@ export async function getAlertPreview({
params,
alertType,
}: {
- fetch: HttpSetup['fetch'];
+ fetch: HttpHandler;
params: AlertPreviewRequestParams;
alertType: PreviewableAlertTypes;
}): Promise {
diff --git a/x-pack/plugins/infra/public/containers/logs/log_analysis/api/ml_cleanup.ts b/x-pack/plugins/infra/public/containers/logs/log_analysis/api/ml_cleanup.ts
index 6fa2ac175ace6..4fdd6bdd282ba 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_analysis/api/ml_cleanup.ts
+++ b/x-pack/plugins/infra/public/containers/logs/log_analysis/api/ml_cleanup.ts
@@ -5,21 +5,25 @@
*/
import * as rt from 'io-ts';
-import { pipe } from 'fp-ts/lib/pipeable';
-import { fold } from 'fp-ts/lib/Either';
-import { identity } from 'fp-ts/lib/function';
-import { npStart } from '../../../../legacy_singletons';
+import type { HttpHandler } from 'src/core/public';
import { getDatafeedId, getJobId } from '../../../../../common/log_analysis';
-import { throwErrors, createPlainError } from '../../../../../common/runtime_types';
+import { decodeOrThrow } from '../../../../../common/runtime_types';
+
+interface DeleteJobsRequestArgs {
+ spaceId: string;
+ sourceId: string;
+ jobTypes: JobType[];
+}
export const callDeleteJobs = async (
- spaceId: string,
- sourceId: string,
- jobTypes: JobType[]
+ requestArgs: DeleteJobsRequestArgs,
+ fetch: HttpHandler
) => {
+ const { spaceId, sourceId, jobTypes } = requestArgs;
+
// NOTE: Deleting the jobs via this API will delete the datafeeds at the same time
- const deleteJobsResponse = await npStart.http.fetch('/api/ml/jobs/delete_jobs', {
+ const deleteJobsResponse = await fetch('/api/ml/jobs/delete_jobs', {
method: 'POST',
body: JSON.stringify(
deleteJobsRequestPayloadRT.encode({
@@ -28,28 +32,29 @@ export const callDeleteJobs = async (
),
});
- return pipe(
- deleteJobsResponsePayloadRT.decode(deleteJobsResponse),
- fold(throwErrors(createPlainError), identity)
- );
+ return decodeOrThrow(deleteJobsResponsePayloadRT)(deleteJobsResponse);
};
-export const callGetJobDeletionTasks = async () => {
- const jobDeletionTasksResponse = await npStart.http.fetch('/api/ml/jobs/deleting_jobs_tasks');
+export const callGetJobDeletionTasks = async (fetch: HttpHandler) => {
+ const jobDeletionTasksResponse = await fetch('/api/ml/jobs/deleting_jobs_tasks');
- return pipe(
- getJobDeletionTasksResponsePayloadRT.decode(jobDeletionTasksResponse),
- fold(throwErrors(createPlainError), identity)
- );
+ return decodeOrThrow(getJobDeletionTasksResponsePayloadRT)(jobDeletionTasksResponse);
};
+interface StopDatafeedsRequestArgs {
+ spaceId: string;
+ sourceId: string;
+ jobTypes: JobType[];
+}
+
export const callStopDatafeeds = async (
- spaceId: string,
- sourceId: string,
- jobTypes: JobType[]
+ requestArgs: StopDatafeedsRequestArgs,
+ fetch: HttpHandler
) => {
+ const { spaceId, sourceId, jobTypes } = requestArgs;
+
// Stop datafeed due to https://github.com/elastic/kibana/issues/44652
- const stopDatafeedResponse = await npStart.http.fetch('/api/ml/jobs/stop_datafeeds', {
+ const stopDatafeedResponse = await fetch('/api/ml/jobs/stop_datafeeds', {
method: 'POST',
body: JSON.stringify(
stopDatafeedsRequestPayloadRT.encode({
@@ -58,10 +63,7 @@ export const callStopDatafeeds = async (
),
});
- return pipe(
- stopDatafeedsResponsePayloadRT.decode(stopDatafeedResponse),
- fold(throwErrors(createPlainError), identity)
- );
+ return decodeOrThrow(stopDatafeedsResponsePayloadRT)(stopDatafeedResponse);
};
export const deleteJobsRequestPayloadRT = rt.type({
diff --git a/x-pack/plugins/infra/public/containers/logs/log_analysis/api/ml_get_jobs_summary_api.ts b/x-pack/plugins/infra/public/containers/logs/log_analysis/api/ml_get_jobs_summary_api.ts
index 7441c0ab7d34c..7cb477dbe5b37 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_analysis/api/ml_get_jobs_summary_api.ts
+++ b/x-pack/plugins/infra/public/containers/logs/log_analysis/api/ml_get_jobs_summary_api.ts
@@ -4,21 +4,24 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { fold } from 'fp-ts/lib/Either';
-import { identity } from 'fp-ts/lib/function';
-import { pipe } from 'fp-ts/lib/pipeable';
import * as rt from 'io-ts';
-import { npStart } from '../../../../legacy_singletons';
+import type { HttpHandler } from 'src/core/public';
import { getJobId, jobCustomSettingsRT } from '../../../../../common/log_analysis';
-import { createPlainError, throwErrors } from '../../../../../common/runtime_types';
+import { decodeOrThrow } from '../../../../../common/runtime_types';
+
+interface RequestArgs {
+ spaceId: string;
+ sourceId: string;
+ jobTypes: JobType[];
+}
export const callJobsSummaryAPI = async (
- spaceId: string,
- sourceId: string,
- jobTypes: JobType[]
+ requestArgs: RequestArgs,
+ fetch: HttpHandler
) => {
- const response = await npStart.http.fetch('/api/ml/jobs/jobs_summary', {
+ const { spaceId, sourceId, jobTypes } = requestArgs;
+ const response = await fetch('/api/ml/jobs/jobs_summary', {
method: 'POST',
body: JSON.stringify(
fetchJobStatusRequestPayloadRT.encode({
@@ -26,10 +29,7 @@ export const callJobsSummaryAPI = async (
})
),
});
- return pipe(
- fetchJobStatusResponsePayloadRT.decode(response),
- fold(throwErrors(createPlainError), identity)
- );
+ return decodeOrThrow(fetchJobStatusResponsePayloadRT)(response);
};
export const fetchJobStatusRequestPayloadRT = rt.type({
diff --git a/x-pack/plugins/infra/public/containers/logs/log_analysis/api/ml_get_module.ts b/x-pack/plugins/infra/public/containers/logs/log_analysis/api/ml_get_module.ts
index b6b40d6dc651f..2bf18d4e52c79 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_analysis/api/ml_get_module.ts
+++ b/x-pack/plugins/infra/public/containers/logs/log_analysis/api/ml_get_module.ts
@@ -4,24 +4,18 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { fold } from 'fp-ts/lib/Either';
-import { identity } from 'fp-ts/lib/function';
-import { pipe } from 'fp-ts/lib/pipeable';
import * as rt from 'io-ts';
-import { npStart } from '../../../../legacy_singletons';
+import type { HttpHandler } from 'src/core/public';
import { jobCustomSettingsRT } from '../../../../../common/log_analysis';
-import { createPlainError, throwErrors } from '../../../../../common/runtime_types';
+import { decodeOrThrow } from '../../../../../common/runtime_types';
-export const callGetMlModuleAPI = async (moduleId: string) => {
- const response = await npStart.http.fetch(`/api/ml/modules/get_module/${moduleId}`, {
+export const callGetMlModuleAPI = async (moduleId: string, fetch: HttpHandler) => {
+ const response = await fetch(`/api/ml/modules/get_module/${moduleId}`, {
method: 'GET',
});
- return pipe(
- getMlModuleResponsePayloadRT.decode(response),
- fold(throwErrors(createPlainError), identity)
- );
+ return decodeOrThrow(getMlModuleResponsePayloadRT)(response);
};
const jobDefinitionRT = rt.type({
diff --git a/x-pack/plugins/infra/public/containers/logs/log_analysis/api/ml_setup_module_api.ts b/x-pack/plugins/infra/public/containers/logs/log_analysis/api/ml_setup_module_api.ts
index 7c8d63374924c..1f203ef9618b8 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_analysis/api/ml_setup_module_api.ts
+++ b/x-pack/plugins/infra/public/containers/logs/log_analysis/api/ml_setup_module_api.ts
@@ -4,27 +4,38 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { fold } from 'fp-ts/lib/Either';
-import { identity } from 'fp-ts/lib/function';
-import { pipe } from 'fp-ts/lib/pipeable';
import * as rt from 'io-ts';
-import { npStart } from '../../../../legacy_singletons';
+import type { HttpHandler } from 'src/core/public';
import { getJobIdPrefix, jobCustomSettingsRT } from '../../../../../common/log_analysis';
-import { createPlainError, throwErrors } from '../../../../../common/runtime_types';
-
-export const callSetupMlModuleAPI = async (
- moduleId: string,
- start: number | undefined,
- end: number | undefined,
- spaceId: string,
- sourceId: string,
- indexPattern: string,
- jobOverrides: SetupMlModuleJobOverrides[] = [],
- datafeedOverrides: SetupMlModuleDatafeedOverrides[] = [],
- query?: object
-) => {
- const response = await npStart.http.fetch(`/api/ml/modules/setup/${moduleId}`, {
+import { decodeOrThrow } from '../../../../../common/runtime_types';
+
+interface RequestArgs {
+ moduleId: string;
+ start?: number;
+ end?: number;
+ spaceId: string;
+ sourceId: string;
+ indexPattern: string;
+ jobOverrides?: SetupMlModuleJobOverrides[];
+ datafeedOverrides?: SetupMlModuleDatafeedOverrides[];
+ query?: object;
+}
+
+export const callSetupMlModuleAPI = async (requestArgs: RequestArgs, fetch: HttpHandler) => {
+ const {
+ moduleId,
+ start,
+ end,
+ spaceId,
+ sourceId,
+ indexPattern,
+ jobOverrides = [],
+ datafeedOverrides = [],
+ query,
+ } = requestArgs;
+
+ const response = await fetch(`/api/ml/modules/setup/${moduleId}`, {
method: 'POST',
body: JSON.stringify(
setupMlModuleRequestPayloadRT.encode({
@@ -40,10 +51,7 @@ export const callSetupMlModuleAPI = async (
),
});
- return pipe(
- setupMlModuleResponsePayloadRT.decode(response),
- fold(throwErrors(createPlainError), identity)
- );
+ return decodeOrThrow(setupMlModuleResponsePayloadRT)(response);
};
const setupMlModuleTimeParamsRT = rt.partial({
diff --git a/x-pack/plugins/infra/public/containers/logs/log_analysis/api/validate_datasets.ts b/x-pack/plugins/infra/public/containers/logs/log_analysis/api/validate_datasets.ts
index 6c9d5e439d359..ec08d3ac107e5 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_analysis/api/validate_datasets.ts
+++ b/x-pack/plugins/infra/public/containers/logs/log_analysis/api/validate_datasets.ts
@@ -4,21 +4,24 @@
* you may not use this file except in compliance with the Elastic License.
*/
+import type { HttpHandler } from 'src/core/public';
import {
LOG_ANALYSIS_VALIDATE_DATASETS_PATH,
validateLogEntryDatasetsRequestPayloadRT,
validateLogEntryDatasetsResponsePayloadRT,
} from '../../../../../common/http_api';
import { decodeOrThrow } from '../../../../../common/runtime_types';
-import { npStart } from '../../../../legacy_singletons';
-export const callValidateDatasetsAPI = async (
- indices: string[],
- timestampField: string,
- startTime: number,
- endTime: number
-) => {
- const response = await npStart.http.fetch(LOG_ANALYSIS_VALIDATE_DATASETS_PATH, {
+interface RequestArgs {
+ indices: string[];
+ timestampField: string;
+ startTime: number;
+ endTime: number;
+}
+
+export const callValidateDatasetsAPI = async (requestArgs: RequestArgs, fetch: HttpHandler) => {
+ const { indices, timestampField, startTime, endTime } = requestArgs;
+ const response = await fetch(LOG_ANALYSIS_VALIDATE_DATASETS_PATH, {
method: 'POST',
body: JSON.stringify(
validateLogEntryDatasetsRequestPayloadRT.encode({
diff --git a/x-pack/plugins/infra/public/containers/logs/log_analysis/api/validate_indices.ts b/x-pack/plugins/infra/public/containers/logs/log_analysis/api/validate_indices.ts
index bbef7d201045f..465d09a744b19 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_analysis/api/validate_indices.ts
+++ b/x-pack/plugins/infra/public/containers/logs/log_analysis/api/validate_indices.ts
@@ -4,10 +4,8 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { fold } from 'fp-ts/lib/Either';
-import { pipe } from 'fp-ts/lib/pipeable';
-import { identity } from 'fp-ts/lib/function';
-import { npStart } from '../../../../legacy_singletons';
+import type { HttpHandler } from 'src/core/public';
+
import {
LOG_ANALYSIS_VALIDATE_INDICES_PATH,
ValidationIndicesFieldSpecification,
@@ -15,19 +13,19 @@ import {
validationIndicesResponsePayloadRT,
} from '../../../../../common/http_api';
-import { throwErrors, createPlainError } from '../../../../../common/runtime_types';
+import { decodeOrThrow } from '../../../../../common/runtime_types';
+
+interface RequestArgs {
+ indices: string[];
+ fields: ValidationIndicesFieldSpecification[];
+}
-export const callValidateIndicesAPI = async (
- indices: string[],
- fields: ValidationIndicesFieldSpecification[]
-) => {
- const response = await npStart.http.fetch(LOG_ANALYSIS_VALIDATE_INDICES_PATH, {
+export const callValidateIndicesAPI = async (requestArgs: RequestArgs, fetch: HttpHandler) => {
+ const { indices, fields } = requestArgs;
+ const response = await fetch(LOG_ANALYSIS_VALIDATE_INDICES_PATH, {
method: 'POST',
body: JSON.stringify(validationIndicesRequestPayloadRT.encode({ data: { indices, fields } })),
});
- return pipe(
- validationIndicesResponsePayloadRT.decode(response),
- fold(throwErrors(createPlainError), identity)
- );
+ return decodeOrThrow(validationIndicesResponsePayloadRT)(response);
};
diff --git a/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_capabilities.tsx b/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_capabilities.tsx
index 9116900ec2196..74b316f78259f 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_capabilities.tsx
+++ b/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_capabilities.tsx
@@ -6,18 +6,16 @@
import createContainer from 'constate';
import { useMemo, useState, useEffect } from 'react';
-import { fold } from 'fp-ts/lib/Either';
-import { pipe } from 'fp-ts/lib/pipeable';
-import { identity } from 'fp-ts/lib/function';
import { useTrackedPromise } from '../../../utils/use_tracked_promise';
-import { npStart } from '../../../legacy_singletons';
import {
getMlCapabilitiesResponsePayloadRT,
GetMlCapabilitiesResponsePayload,
} from './api/ml_api_types';
-import { throwErrors, createPlainError } from '../../../../common/runtime_types';
+import { decodeOrThrow } from '../../../../common/runtime_types';
+import { useKibanaContextForPlugin } from '../../../hooks/use_kibana';
export const useLogAnalysisCapabilities = () => {
+ const { services } = useKibanaContextForPlugin();
const [mlCapabilities, setMlCapabilities] = useState(
initialMlCapabilities
);
@@ -26,12 +24,9 @@ export const useLogAnalysisCapabilities = () => {
{
cancelPreviousOn: 'resolution',
createPromise: async () => {
- const rawResponse = await npStart.http.fetch('/api/ml/ml_capabilities');
+ const rawResponse = await services.http.fetch('/api/ml/ml_capabilities');
- return pipe(
- getMlCapabilitiesResponsePayloadRT.decode(rawResponse),
- fold(throwErrors(createPlainError), identity)
- );
+ return decodeOrThrow(getMlCapabilitiesResponsePayloadRT)(rawResponse);
},
onResolve: (response) => {
setMlCapabilities(response);
diff --git a/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_cleanup.tsx b/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_cleanup.tsx
index 522616f83d0cb..ec5e879131aa1 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_cleanup.tsx
+++ b/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_cleanup.tsx
@@ -3,17 +3,18 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
-
+import type { HttpHandler } from 'src/core/public';
import { getJobId } from '../../../../common/log_analysis';
import { callDeleteJobs, callGetJobDeletionTasks, callStopDatafeeds } from './api/ml_cleanup';
export const cleanUpJobsAndDatafeeds = async (
spaceId: string,
sourceId: string,
- jobTypes: JobType[]
+ jobTypes: JobType[],
+ fetch: HttpHandler
) => {
try {
- await callStopDatafeeds(spaceId, sourceId, jobTypes);
+ await callStopDatafeeds({ spaceId, sourceId, jobTypes }, fetch);
} catch (err) {
// Proceed only if datafeed has been deleted or didn't exist in the first place
if (err?.res?.status !== 404) {
@@ -21,27 +22,29 @@ export const cleanUpJobsAndDatafeeds = async (
}
}
- return await deleteJobs(spaceId, sourceId, jobTypes);
+ return await deleteJobs(spaceId, sourceId, jobTypes, fetch);
};
const deleteJobs = async (
spaceId: string,
sourceId: string,
- jobTypes: JobType[]
+ jobTypes: JobType[],
+ fetch: HttpHandler
) => {
- const deleteJobsResponse = await callDeleteJobs(spaceId, sourceId, jobTypes);
- await waitUntilJobsAreDeleted(spaceId, sourceId, jobTypes);
+ const deleteJobsResponse = await callDeleteJobs({ spaceId, sourceId, jobTypes }, fetch);
+ await waitUntilJobsAreDeleted(spaceId, sourceId, jobTypes, fetch);
return deleteJobsResponse;
};
const waitUntilJobsAreDeleted = async (
spaceId: string,
sourceId: string,
- jobTypes: JobType[]
+ jobTypes: JobType[],
+ fetch: HttpHandler
) => {
const moduleJobIds = jobTypes.map((jobType) => getJobId(spaceId, sourceId, jobType));
while (true) {
- const { jobIds: jobIdsBeingDeleted } = await callGetJobDeletionTasks();
+ const { jobIds: jobIdsBeingDeleted } = await callGetJobDeletionTasks(fetch);
const needToWait = jobIdsBeingDeleted.some((jobId) => moduleJobIds.includes(jobId));
if (needToWait) {
diff --git a/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_module.tsx b/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_module.tsx
index 79768302a7310..27ef0039ae49f 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_module.tsx
+++ b/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_module.tsx
@@ -6,6 +6,7 @@
import { useCallback, useMemo } from 'react';
import { DatasetFilter } from '../../../../common/log_analysis';
+import { useKibanaContextForPlugin } from '../../../hooks/use_kibana';
import { useTrackedPromise } from '../../../utils/use_tracked_promise';
import { useModuleStatus } from './log_analysis_module_status';
import { ModuleDescriptor, ModuleSourceConfiguration } from './log_analysis_module_types';
@@ -17,6 +18,7 @@ export const useLogAnalysisModule = ({
sourceConfiguration: ModuleSourceConfiguration;
moduleDescriptor: ModuleDescriptor;
}) => {
+ const { services } = useKibanaContextForPlugin();
const { spaceId, sourceId, timestampField } = sourceConfiguration;
const [moduleStatus, dispatchModuleStatus] = useModuleStatus(moduleDescriptor.jobTypes);
@@ -25,7 +27,7 @@ export const useLogAnalysisModule = ({
cancelPreviousOn: 'resolution',
createPromise: async () => {
dispatchModuleStatus({ type: 'fetchingJobStatuses' });
- return await moduleDescriptor.getJobSummary(spaceId, sourceId);
+ return await moduleDescriptor.getJobSummary(spaceId, sourceId, services.http.fetch);
},
onResolve: (jobResponse) => {
dispatchModuleStatus({
@@ -52,13 +54,23 @@ export const useLogAnalysisModule = ({
datasetFilter: DatasetFilter
) => {
dispatchModuleStatus({ type: 'startedSetup' });
- const setupResult = await moduleDescriptor.setUpModule(start, end, datasetFilter, {
- indices: selectedIndices,
- sourceId,
+ const setupResult = await moduleDescriptor.setUpModule(
+ start,
+ end,
+ datasetFilter,
+ {
+ indices: selectedIndices,
+ sourceId,
+ spaceId,
+ timestampField,
+ },
+ services.http.fetch
+ );
+ const jobSummaries = await moduleDescriptor.getJobSummary(
spaceId,
- timestampField,
- });
- const jobSummaries = await moduleDescriptor.getJobSummary(spaceId, sourceId);
+ sourceId,
+ services.http.fetch
+ );
return { setupResult, jobSummaries };
},
onResolve: ({ setupResult: { datafeeds, jobs }, jobSummaries }) => {
@@ -82,7 +94,7 @@ export const useLogAnalysisModule = ({
{
cancelPreviousOn: 'resolution',
createPromise: async () => {
- return await moduleDescriptor.cleanUpModule(spaceId, sourceId);
+ return await moduleDescriptor.cleanUpModule(spaceId, sourceId, services.http.fetch);
},
},
[spaceId, sourceId]
diff --git a/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_module_definition.tsx b/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_module_definition.tsx
index 1f643d0e5eb34..7a5c1d354dc34 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_module_definition.tsx
+++ b/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_module_definition.tsx
@@ -6,6 +6,7 @@
import { useCallback, useMemo, useState } from 'react';
import { getJobId } from '../../../../common/log_analysis';
+import { useKibanaContextForPlugin } from '../../../hooks/use_kibana';
import { useTrackedPromise } from '../../../utils/use_tracked_promise';
import { JobSummary } from './api/ml_get_jobs_summary_api';
import { GetMlModuleResponsePayload, JobDefinition } from './api/ml_get_module';
@@ -18,6 +19,7 @@ export const useLogAnalysisModuleDefinition = ({
sourceConfiguration: ModuleSourceConfiguration;
moduleDescriptor: ModuleDescriptor;
}) => {
+ const { services } = useKibanaContextForPlugin();
const [moduleDefinition, setModuleDefinition] = useState<
GetMlModuleResponsePayload | undefined
>();
@@ -40,7 +42,7 @@ export const useLogAnalysisModuleDefinition = ({
{
cancelPreviousOn: 'resolution',
createPromise: async () => {
- return await moduleDescriptor.getModuleDefinition();
+ return await moduleDescriptor.getModuleDefinition(services.http.fetch);
},
onResolve: (response) => {
setModuleDefinition(response);
diff --git a/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_module_types.ts b/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_module_types.ts
index ba355ad195b11..c42704860b032 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_module_types.ts
+++ b/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_module_types.ts
@@ -4,6 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
+import type { HttpHandler } from 'src/core/public';
import {
ValidateLogEntryDatasetsResponsePayload,
ValidationIndicesResponsePayload,
@@ -23,24 +24,35 @@ export interface ModuleDescriptor {
jobTypes: JobType[];
bucketSpan: number;
getJobIds: (spaceId: string, sourceId: string) => Record;
- getJobSummary: (spaceId: string, sourceId: string) => Promise;
- getModuleDefinition: () => Promise;
+ getJobSummary: (
+ spaceId: string,
+ sourceId: string,
+ fetch: HttpHandler
+ ) => Promise;
+ getModuleDefinition: (fetch: HttpHandler) => Promise;
setUpModule: (
start: number | undefined,
end: number | undefined,
datasetFilter: DatasetFilter,
- sourceConfiguration: ModuleSourceConfiguration
+ sourceConfiguration: ModuleSourceConfiguration,
+ fetch: HttpHandler
) => Promise;
- cleanUpModule: (spaceId: string, sourceId: string) => Promise;
+ cleanUpModule: (
+ spaceId: string,
+ sourceId: string,
+ fetch: HttpHandler
+ ) => Promise;
validateSetupIndices: (
indices: string[],
- timestampField: string
+ timestampField: string,
+ fetch: HttpHandler
) => Promise;
validateSetupDatasets: (
indices: string[],
timestampField: string,
startTime: number,
- endTime: number
+ endTime: number,
+ fetch: HttpHandler
) => Promise;
}
diff --git a/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_setup_state.ts b/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_setup_state.ts
index e6fe8f4e92cc4..750a7104a3a98 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_setup_state.ts
+++ b/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_setup_state.ts
@@ -18,6 +18,7 @@ import {
ValidationIndicesError,
ValidationUIError,
} from '../../../components/logging/log_analysis_setup/initial_configuration_step';
+import { useKibanaContextForPlugin } from '../../../hooks/use_kibana';
import { useTrackedPromise } from '../../../utils/use_tracked_promise';
import { ModuleDescriptor, ModuleSourceConfiguration } from './log_analysis_module_types';
@@ -43,6 +44,7 @@ export const useAnalysisSetupState = ({
setUpModule,
sourceConfiguration,
}: AnalysisSetupStateArguments) => {
+ const { services } = useKibanaContextForPlugin();
const [startTime, setStartTime] = useState(Date.now() - fourWeeksInMs);
const [endTime, setEndTime] = useState(undefined);
@@ -158,7 +160,8 @@ export const useAnalysisSetupState = ({
createPromise: async () => {
return await validateSetupIndices(
sourceConfiguration.indices,
- sourceConfiguration.timestampField
+ sourceConfiguration.timestampField,
+ services.http.fetch
);
},
onResolve: ({ data: { errors } }) => {
@@ -183,7 +186,8 @@ export const useAnalysisSetupState = ({
validIndexNames,
sourceConfiguration.timestampField,
startTime ?? 0,
- endTime ?? Date.now()
+ endTime ?? Date.now(),
+ services.http.fetch
);
},
onResolve: ({ data: { datasets } }) => {
diff --git a/x-pack/plugins/infra/public/containers/logs/log_analysis/modules/log_entry_categories/module_descriptor.ts b/x-pack/plugins/infra/public/containers/logs/log_analysis/modules/log_entry_categories/module_descriptor.ts
index 9682b3e74db3b..46b28e091cc5c 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_analysis/modules/log_entry_categories/module_descriptor.ts
+++ b/x-pack/plugins/infra/public/containers/logs/log_analysis/modules/log_entry_categories/module_descriptor.ts
@@ -5,6 +5,7 @@
*/
import { i18n } from '@kbn/i18n';
+import type { HttpHandler } from 'src/core/public';
import {
bucketSpan,
categoriesMessageField,
@@ -42,22 +43,26 @@ const getJobIds = (spaceId: string, sourceId: string) =>
{} as Record
);
-const getJobSummary = async (spaceId: string, sourceId: string) => {
- const response = await callJobsSummaryAPI(spaceId, sourceId, logEntryCategoriesJobTypes);
+const getJobSummary = async (spaceId: string, sourceId: string, fetch: HttpHandler) => {
+ const response = await callJobsSummaryAPI(
+ { spaceId, sourceId, jobTypes: logEntryCategoriesJobTypes },
+ fetch
+ );
const jobIds = Object.values(getJobIds(spaceId, sourceId));
return response.filter((jobSummary) => jobIds.includes(jobSummary.id));
};
-const getModuleDefinition = async () => {
- return await callGetMlModuleAPI(moduleId);
+const getModuleDefinition = async (fetch: HttpHandler) => {
+ return await callGetMlModuleAPI(moduleId, fetch);
};
const setUpModule = async (
start: number | undefined,
end: number | undefined,
datasetFilter: DatasetFilter,
- { spaceId, sourceId, indices, timestampField }: ModuleSourceConfiguration
+ { spaceId, sourceId, indices, timestampField }: ModuleSourceConfiguration,
+ fetch: HttpHandler
) => {
const indexNamePattern = indices.join(',');
const jobOverrides = [
@@ -101,46 +106,59 @@ const setUpModule = async (
};
return callSetupMlModuleAPI(
- moduleId,
- start,
- end,
- spaceId,
- sourceId,
- indexNamePattern,
- jobOverrides,
- [],
- query
+ {
+ moduleId,
+ start,
+ end,
+ spaceId,
+ sourceId,
+ indexPattern: indexNamePattern,
+ jobOverrides,
+ query,
+ },
+ fetch
);
};
-const cleanUpModule = async (spaceId: string, sourceId: string) => {
- return await cleanUpJobsAndDatafeeds(spaceId, sourceId, logEntryCategoriesJobTypes);
+const cleanUpModule = async (spaceId: string, sourceId: string, fetch: HttpHandler) => {
+ return await cleanUpJobsAndDatafeeds(spaceId, sourceId, logEntryCategoriesJobTypes, fetch);
};
-const validateSetupIndices = async (indices: string[], timestampField: string) => {
- return await callValidateIndicesAPI(indices, [
- {
- name: timestampField,
- validTypes: ['date'],
- },
- {
- name: partitionField,
- validTypes: ['keyword'],
- },
+const validateSetupIndices = async (
+ indices: string[],
+ timestampField: string,
+ fetch: HttpHandler
+) => {
+ return await callValidateIndicesAPI(
{
- name: categoriesMessageField,
- validTypes: ['text'],
+ indices,
+ fields: [
+ {
+ name: timestampField,
+ validTypes: ['date'],
+ },
+ {
+ name: partitionField,
+ validTypes: ['keyword'],
+ },
+ {
+ name: categoriesMessageField,
+ validTypes: ['text'],
+ },
+ ],
},
- ]);
+ fetch
+ );
};
const validateSetupDatasets = async (
indices: string[],
timestampField: string,
startTime: number,
- endTime: number
+ endTime: number,
+ fetch: HttpHandler
) => {
- return await callValidateDatasetsAPI(indices, timestampField, startTime, endTime);
+ return await callValidateDatasetsAPI({ indices, timestampField, startTime, endTime }, fetch);
};
export const logEntryCategoriesModule: ModuleDescriptor = {
diff --git a/x-pack/plugins/infra/public/containers/logs/log_analysis/modules/log_entry_rate/module_descriptor.ts b/x-pack/plugins/infra/public/containers/logs/log_analysis/modules/log_entry_rate/module_descriptor.ts
index 001174a2b7558..b97ec55105f5d 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_analysis/modules/log_entry_rate/module_descriptor.ts
+++ b/x-pack/plugins/infra/public/containers/logs/log_analysis/modules/log_entry_rate/module_descriptor.ts
@@ -5,6 +5,7 @@
*/
import { i18n } from '@kbn/i18n';
+import type { HttpHandler } from 'src/core/public';
import {
bucketSpan,
DatasetFilter,
@@ -41,22 +42,26 @@ const getJobIds = (spaceId: string, sourceId: string) =>
{} as Record
);
-const getJobSummary = async (spaceId: string, sourceId: string) => {
- const response = await callJobsSummaryAPI(spaceId, sourceId, logEntryRateJobTypes);
+const getJobSummary = async (spaceId: string, sourceId: string, fetch: HttpHandler) => {
+ const response = await callJobsSummaryAPI(
+ { spaceId, sourceId, jobTypes: logEntryRateJobTypes },
+ fetch
+ );
const jobIds = Object.values(getJobIds(spaceId, sourceId));
return response.filter((jobSummary) => jobIds.includes(jobSummary.id));
};
-const getModuleDefinition = async () => {
- return await callGetMlModuleAPI(moduleId);
+const getModuleDefinition = async (fetch: HttpHandler) => {
+ return await callGetMlModuleAPI(moduleId, fetch);
};
const setUpModule = async (
start: number | undefined,
end: number | undefined,
datasetFilter: DatasetFilter,
- { spaceId, sourceId, indices, timestampField }: ModuleSourceConfiguration
+ { spaceId, sourceId, indices, timestampField }: ModuleSourceConfiguration,
+ fetch: HttpHandler
) => {
const indexNamePattern = indices.join(',');
const jobOverrides = [
@@ -93,42 +98,55 @@ const setUpModule = async (
: undefined;
return callSetupMlModuleAPI(
- moduleId,
- start,
- end,
- spaceId,
- sourceId,
- indexNamePattern,
- jobOverrides,
- [],
- query
+ {
+ moduleId,
+ start,
+ end,
+ spaceId,
+ sourceId,
+ indexPattern: indexNamePattern,
+ jobOverrides,
+ query,
+ },
+ fetch
);
};
-const cleanUpModule = async (spaceId: string, sourceId: string) => {
- return await cleanUpJobsAndDatafeeds(spaceId, sourceId, logEntryRateJobTypes);
+const cleanUpModule = async (spaceId: string, sourceId: string, fetch: HttpHandler) => {
+ return await cleanUpJobsAndDatafeeds(spaceId, sourceId, logEntryRateJobTypes, fetch);
};
-const validateSetupIndices = async (indices: string[], timestampField: string) => {
- return await callValidateIndicesAPI(indices, [
- {
- name: timestampField,
- validTypes: ['date'],
- },
+const validateSetupIndices = async (
+ indices: string[],
+ timestampField: string,
+ fetch: HttpHandler
+) => {
+ return await callValidateIndicesAPI(
{
- name: partitionField,
- validTypes: ['keyword'],
+ indices,
+ fields: [
+ {
+ name: timestampField,
+ validTypes: ['date'],
+ },
+ {
+ name: partitionField,
+ validTypes: ['keyword'],
+ },
+ ],
},
- ]);
+ fetch
+ );
};
const validateSetupDatasets = async (
indices: string[],
timestampField: string,
startTime: number,
- endTime: number
+ endTime: number,
+ fetch: HttpHandler
) => {
- return await callValidateDatasetsAPI(indices, timestampField, startTime, endTime);
+ return await callValidateDatasetsAPI({ indices, timestampField, startTime, endTime }, fetch);
};
export const logEntryRateModule: ModuleDescriptor = {
diff --git a/x-pack/plugins/infra/public/containers/logs/log_entries/api/fetch_log_entries.ts b/x-pack/plugins/infra/public/containers/logs/log_entries/api/fetch_log_entries.ts
index 2a19a82892427..3bbd86cb0ef75 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_entries/api/fetch_log_entries.ts
+++ b/x-pack/plugins/infra/public/containers/logs/log_entries/api/fetch_log_entries.ts
@@ -4,12 +4,9 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { fold } from 'fp-ts/lib/Either';
-import { pipe } from 'fp-ts/lib/pipeable';
-import { identity } from 'fp-ts/lib/function';
-import { npStart } from '../../../../legacy_singletons';
+import type { HttpHandler } from 'src/core/public';
-import { throwErrors, createPlainError } from '../../../../../common/runtime_types';
+import { decodeOrThrow } from '../../../../../common/runtime_types';
import {
LOG_ENTRIES_PATH,
@@ -18,11 +15,11 @@ import {
logEntriesResponseRT,
} from '../../../../../common/http_api';
-export const fetchLogEntries = async (requestArgs: LogEntriesRequest) => {
- const response = await npStart.http.fetch(LOG_ENTRIES_PATH, {
+export const fetchLogEntries = async (requestArgs: LogEntriesRequest, fetch: HttpHandler) => {
+ const response = await fetch(LOG_ENTRIES_PATH, {
method: 'POST',
body: JSON.stringify(logEntriesRequestRT.encode(requestArgs)),
});
- return pipe(logEntriesResponseRT.decode(response), fold(throwErrors(createPlainError), identity));
+ return decodeOrThrow(logEntriesResponseRT)(response);
};
diff --git a/x-pack/plugins/infra/public/containers/logs/log_entries/api/fetch_log_entries_item.ts b/x-pack/plugins/infra/public/containers/logs/log_entries/api/fetch_log_entries_item.ts
index 5fde01e458e36..d459fba6cf957 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_entries/api/fetch_log_entries_item.ts
+++ b/x-pack/plugins/infra/public/containers/logs/log_entries/api/fetch_log_entries_item.ts
@@ -4,12 +4,9 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { fold } from 'fp-ts/lib/Either';
-import { pipe } from 'fp-ts/lib/pipeable';
-import { identity } from 'fp-ts/lib/function';
-import { npStart } from '../../../../legacy_singletons';
+import type { HttpHandler } from 'src/core/public';
-import { throwErrors, createPlainError } from '../../../../../common/runtime_types';
+import { decodeOrThrow } from '../../../../../common/runtime_types';
import {
LOG_ENTRIES_ITEM_PATH,
@@ -18,14 +15,14 @@ import {
logEntriesItemResponseRT,
} from '../../../../../common/http_api';
-export const fetchLogEntriesItem = async (requestArgs: LogEntriesItemRequest) => {
- const response = await npStart.http.fetch(LOG_ENTRIES_ITEM_PATH, {
+export const fetchLogEntriesItem = async (
+ requestArgs: LogEntriesItemRequest,
+ fetch: HttpHandler
+) => {
+ const response = await fetch(LOG_ENTRIES_ITEM_PATH, {
method: 'POST',
body: JSON.stringify(logEntriesItemRequestRT.encode(requestArgs)),
});
- return pipe(
- logEntriesItemResponseRT.decode(response),
- fold(throwErrors(createPlainError), identity)
- );
+ return decodeOrThrow(logEntriesItemResponseRT)(response);
};
diff --git a/x-pack/plugins/infra/public/containers/logs/log_entries/index.ts b/x-pack/plugins/infra/public/containers/logs/log_entries/index.ts
index d5b2a0aaa61c0..4c8c610794b2e 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_entries/index.ts
+++ b/x-pack/plugins/infra/public/containers/logs/log_entries/index.ts
@@ -14,6 +14,7 @@ import {
LogEntriesBaseRequest,
} from '../../../../common/http_api';
import { fetchLogEntries } from './api/fetch_log_entries';
+import { useKibanaContextForPlugin } from '../../../hooks/use_kibana';
const DESIRED_BUFFER_PAGES = 2;
const LIVE_STREAM_INTERVAL = 5000;
@@ -144,6 +145,7 @@ const useFetchEntriesEffect = (
dispatch: Dispatch,
props: LogEntriesProps
) => {
+ const { services } = useKibanaContextForPlugin();
const [prevParams, cachePrevParams] = useState();
const [startedStreaming, setStartedStreaming] = useState(false);
@@ -172,7 +174,7 @@ const useFetchEntriesEffect = (
before: 'last',
};
- const { data: payload } = await fetchLogEntries(fetchArgs);
+ const { data: payload } = await fetchLogEntries(fetchArgs, services.http.fetch);
dispatch({ type: Action.ReceiveNewEntries, payload });
// Move position to the bottom if it's the first load.
@@ -228,7 +230,7 @@ const useFetchEntriesEffect = (
after: state.bottomCursor,
};
- const { data: payload } = await fetchLogEntries(fetchArgs);
+ const { data: payload } = await fetchLogEntries(fetchArgs, services.http.fetch);
dispatch({
type: getEntriesBefore ? Action.ReceiveEntriesBefore : Action.ReceiveEntriesAfter,
diff --git a/x-pack/plugins/infra/public/containers/logs/log_flyout.tsx b/x-pack/plugins/infra/public/containers/logs/log_flyout.tsx
index 0489892e58f2a..9ed2f5ad175c7 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_flyout.tsx
+++ b/x-pack/plugins/infra/public/containers/logs/log_flyout.tsx
@@ -9,6 +9,7 @@ import { isString } from 'lodash';
import React, { useContext, useEffect, useMemo, useState } from 'react';
import { LogEntriesItem } from '../../../common/http_api';
+import { useKibanaContextForPlugin } from '../../hooks/use_kibana';
import { UrlStateContainer } from '../../utils/url_state';
import { useTrackedPromise } from '../../utils/use_tracked_promise';
import { fetchLogEntriesItem } from './log_entries/api/fetch_log_entries_item';
@@ -26,6 +27,7 @@ export interface FlyoutOptionsUrlState {
}
export const useLogFlyout = () => {
+ const { services } = useKibanaContextForPlugin();
const { sourceId } = useLogSourceContext();
const [flyoutVisible, setFlyoutVisibility] = useState(false);
const [flyoutId, setFlyoutId] = useState(null);
@@ -39,7 +41,7 @@ export const useLogFlyout = () => {
if (!flyoutId) {
return;
}
- return await fetchLogEntriesItem({ sourceId, id: flyoutId });
+ return await fetchLogEntriesItem({ sourceId, id: flyoutId }, services.http.fetch);
},
onResolve: (response) => {
if (response) {
diff --git a/x-pack/plugins/infra/public/containers/logs/log_highlights/api/fetch_log_entries_highlights.ts b/x-pack/plugins/infra/public/containers/logs/log_highlights/api/fetch_log_entries_highlights.ts
index 030a9d180c7b5..25865a30467f5 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_highlights/api/fetch_log_entries_highlights.ts
+++ b/x-pack/plugins/infra/public/containers/logs/log_highlights/api/fetch_log_entries_highlights.ts
@@ -4,12 +4,9 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { fold } from 'fp-ts/lib/Either';
-import { pipe } from 'fp-ts/lib/pipeable';
-import { identity } from 'fp-ts/lib/function';
-import { npStart } from '../../../../legacy_singletons';
+import type { HttpHandler } from 'src/core/public';
-import { throwErrors, createPlainError } from '../../../../../common/runtime_types';
+import { decodeOrThrow } from '../../../../../common/runtime_types';
import {
LOG_ENTRIES_HIGHLIGHTS_PATH,
@@ -18,14 +15,14 @@ import {
logEntriesHighlightsResponseRT,
} from '../../../../../common/http_api';
-export const fetchLogEntriesHighlights = async (requestArgs: LogEntriesHighlightsRequest) => {
- const response = await npStart.http.fetch(LOG_ENTRIES_HIGHLIGHTS_PATH, {
+export const fetchLogEntriesHighlights = async (
+ requestArgs: LogEntriesHighlightsRequest,
+ fetch: HttpHandler
+) => {
+ const response = await fetch(LOG_ENTRIES_HIGHLIGHTS_PATH, {
method: 'POST',
body: JSON.stringify(logEntriesHighlightsRequestRT.encode(requestArgs)),
});
- return pipe(
- logEntriesHighlightsResponseRT.decode(response),
- fold(throwErrors(createPlainError), identity)
- );
+ return decodeOrThrow(logEntriesHighlightsResponseRT)(response);
};
diff --git a/x-pack/plugins/infra/public/containers/logs/log_highlights/api/fetch_log_summary_highlights.ts b/x-pack/plugins/infra/public/containers/logs/log_highlights/api/fetch_log_summary_highlights.ts
index bda8f535549c7..1cf95bc08a521 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_highlights/api/fetch_log_summary_highlights.ts
+++ b/x-pack/plugins/infra/public/containers/logs/log_highlights/api/fetch_log_summary_highlights.ts
@@ -3,11 +3,9 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
-import { fold } from 'fp-ts/lib/Either';
-import { pipe } from 'fp-ts/lib/pipeable';
-import { identity } from 'fp-ts/lib/function';
-import { npStart } from '../../../../legacy_singletons';
-import { throwErrors, createPlainError } from '../../../../../common/runtime_types';
+
+import type { HttpHandler } from 'src/core/public';
+import { decodeOrThrow } from '../../../../../common/runtime_types';
import {
LOG_ENTRIES_SUMMARY_HIGHLIGHTS_PATH,
@@ -17,15 +15,13 @@ import {
} from '../../../../../common/http_api';
export const fetchLogSummaryHighlights = async (
- requestArgs: LogEntriesSummaryHighlightsRequest
+ requestArgs: LogEntriesSummaryHighlightsRequest,
+ fetch: HttpHandler
) => {
- const response = await npStart.http.fetch(LOG_ENTRIES_SUMMARY_HIGHLIGHTS_PATH, {
+ const response = await fetch(LOG_ENTRIES_SUMMARY_HIGHLIGHTS_PATH, {
method: 'POST',
body: JSON.stringify(logEntriesSummaryHighlightsRequestRT.encode(requestArgs)),
});
- return pipe(
- logEntriesSummaryHighlightsResponseRT.decode(response),
- fold(throwErrors(createPlainError), identity)
- );
+ return decodeOrThrow(logEntriesSummaryHighlightsResponseRT)(response);
};
diff --git a/x-pack/plugins/infra/public/containers/logs/log_highlights/log_entry_highlights.tsx b/x-pack/plugins/infra/public/containers/logs/log_highlights/log_entry_highlights.tsx
index dbeb8c71c11eb..b4edebe8f8207 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_highlights/log_entry_highlights.tsx
+++ b/x-pack/plugins/infra/public/containers/logs/log_highlights/log_entry_highlights.tsx
@@ -10,6 +10,7 @@ import { TimeKey } from '../../../../common/time';
import { useTrackedPromise } from '../../../utils/use_tracked_promise';
import { fetchLogEntriesHighlights } from './api/fetch_log_entries_highlights';
import { LogEntry, LogEntriesHighlightsResponse } from '../../../../common/http_api';
+import { useKibanaContextForPlugin } from '../../../hooks/use_kibana';
export const useLogEntryHighlights = (
sourceId: string,
@@ -21,6 +22,7 @@ export const useLogEntryHighlights = (
filterQuery: string | null,
highlightTerms: string[]
) => {
+ const { services } = useKibanaContextForPlugin();
const [logEntryHighlights, setLogEntryHighlights] = useState<
LogEntriesHighlightsResponse['data']
>([]);
@@ -32,15 +34,18 @@ export const useLogEntryHighlights = (
throw new Error('Skipping request: Insufficient parameters');
}
- return await fetchLogEntriesHighlights({
- sourceId,
- startTimestamp,
- endTimestamp,
- center: centerPoint,
- size,
- query: filterQuery || undefined,
- highlightTerms,
- });
+ return await fetchLogEntriesHighlights(
+ {
+ sourceId,
+ startTimestamp,
+ endTimestamp,
+ center: centerPoint,
+ size,
+ query: filterQuery || undefined,
+ highlightTerms,
+ },
+ services.http.fetch
+ );
},
onResolve: (response) => {
setLogEntryHighlights(response.data);
diff --git a/x-pack/plugins/infra/public/containers/logs/log_highlights/log_summary_highlights.ts b/x-pack/plugins/infra/public/containers/logs/log_highlights/log_summary_highlights.ts
index 6d982ee004ccc..14366891dbf59 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_highlights/log_summary_highlights.ts
+++ b/x-pack/plugins/infra/public/containers/logs/log_highlights/log_summary_highlights.ts
@@ -11,6 +11,7 @@ import { useTrackedPromise } from '../../../utils/use_tracked_promise';
import { fetchLogSummaryHighlights } from './api/fetch_log_summary_highlights';
import { LogEntriesSummaryHighlightsResponse } from '../../../../common/http_api';
import { useBucketSize } from '../log_summary/bucket_size';
+import { useKibanaContextForPlugin } from '../../../hooks/use_kibana';
export const useLogSummaryHighlights = (
sourceId: string,
@@ -20,6 +21,7 @@ export const useLogSummaryHighlights = (
filterQuery: string | null,
highlightTerms: string[]
) => {
+ const { services } = useKibanaContextForPlugin();
const [logSummaryHighlights, setLogSummaryHighlights] = useState<
LogEntriesSummaryHighlightsResponse['data']
>([]);
@@ -34,14 +36,17 @@ export const useLogSummaryHighlights = (
throw new Error('Skipping request: Insufficient parameters');
}
- return await fetchLogSummaryHighlights({
- sourceId,
- startTimestamp,
- endTimestamp,
- bucketSize,
- query: filterQuery,
- highlightTerms,
- });
+ return await fetchLogSummaryHighlights(
+ {
+ sourceId,
+ startTimestamp,
+ endTimestamp,
+ bucketSize,
+ query: filterQuery,
+ highlightTerms,
+ },
+ services.http.fetch
+ );
},
onResolve: (response) => {
setLogSummaryHighlights(response.data);
diff --git a/x-pack/plugins/infra/public/containers/logs/log_source/api/fetch_log_source_configuration.ts b/x-pack/plugins/infra/public/containers/logs/log_source/api/fetch_log_source_configuration.ts
index e847302a6d367..c9ced069473a3 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_source/api/fetch_log_source_configuration.ts
+++ b/x-pack/plugins/infra/public/containers/logs/log_source/api/fetch_log_source_configuration.ts
@@ -4,17 +4,14 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { HttpSetup } from 'src/core/public';
+import type { HttpHandler } from 'src/core/public';
import {
getLogSourceConfigurationPath,
getLogSourceConfigurationSuccessResponsePayloadRT,
} from '../../../../../common/http_api/log_sources';
import { decodeOrThrow } from '../../../../../common/runtime_types';
-export const callFetchLogSourceConfigurationAPI = async (
- sourceId: string,
- fetch: HttpSetup['fetch']
-) => {
+export const callFetchLogSourceConfigurationAPI = async (sourceId: string, fetch: HttpHandler) => {
const response = await fetch(getLogSourceConfigurationPath(sourceId), {
method: 'GET',
});
diff --git a/x-pack/plugins/infra/public/containers/logs/log_source/api/fetch_log_source_status.ts b/x-pack/plugins/infra/public/containers/logs/log_source/api/fetch_log_source_status.ts
index 20e67a0a59c9f..5bc409115e595 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_source/api/fetch_log_source_status.ts
+++ b/x-pack/plugins/infra/public/containers/logs/log_source/api/fetch_log_source_status.ts
@@ -4,14 +4,14 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { HttpSetup } from 'src/core/public';
+import type { HttpHandler } from 'src/core/public';
import {
getLogSourceStatusPath,
getLogSourceStatusSuccessResponsePayloadRT,
} from '../../../../../common/http_api/log_sources';
import { decodeOrThrow } from '../../../../../common/runtime_types';
-export const callFetchLogSourceStatusAPI = async (sourceId: string, fetch: HttpSetup['fetch']) => {
+export const callFetchLogSourceStatusAPI = async (sourceId: string, fetch: HttpHandler) => {
const response = await fetch(getLogSourceStatusPath(sourceId), {
method: 'GET',
});
diff --git a/x-pack/plugins/infra/public/containers/logs/log_source/api/patch_log_source_configuration.ts b/x-pack/plugins/infra/public/containers/logs/log_source/api/patch_log_source_configuration.ts
index 4361e4bef827f..33212c5d3b0f2 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_source/api/patch_log_source_configuration.ts
+++ b/x-pack/plugins/infra/public/containers/logs/log_source/api/patch_log_source_configuration.ts
@@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { HttpSetup } from 'src/core/public';
+import type { HttpHandler } from 'src/core/public';
import {
getLogSourceConfigurationPath,
patchLogSourceConfigurationSuccessResponsePayloadRT,
@@ -16,7 +16,7 @@ import { decodeOrThrow } from '../../../../../common/runtime_types';
export const callPatchLogSourceConfigurationAPI = async (
sourceId: string,
patchedProperties: LogSourceConfigurationPropertiesPatch,
- fetch: HttpSetup['fetch']
+ fetch: HttpHandler
) => {
const response = await fetch(getLogSourceConfigurationPath(sourceId), {
method: 'PATCH',
diff --git a/x-pack/plugins/infra/public/containers/logs/log_source/log_source.ts b/x-pack/plugins/infra/public/containers/logs/log_source/log_source.ts
index 51b32a4c4eacf..e2dd4c523c03f 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_source/log_source.ts
+++ b/x-pack/plugins/infra/public/containers/logs/log_source/log_source.ts
@@ -7,7 +7,7 @@
import createContainer from 'constate';
import { useCallback, useMemo, useState } from 'react';
import { useMountedState } from 'react-use';
-import { HttpSetup } from 'src/core/public';
+import type { HttpHandler } from 'src/core/public';
import {
LogSourceConfiguration,
LogSourceConfigurationProperties,
@@ -26,13 +26,7 @@ export {
LogSourceStatus,
};
-export const useLogSource = ({
- sourceId,
- fetch,
-}: {
- sourceId: string;
- fetch: HttpSetup['fetch'];
-}) => {
+export const useLogSource = ({ sourceId, fetch }: { sourceId: string; fetch: HttpHandler }) => {
const getIsMounted = useMountedState();
const [sourceConfiguration, setSourceConfiguration] = useState<
LogSourceConfiguration | undefined
diff --git a/x-pack/plugins/infra/public/containers/logs/log_stream/index.ts b/x-pack/plugins/infra/public/containers/logs/log_stream/index.ts
index b414408512db2..4a6da6063e960 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_stream/index.ts
+++ b/x-pack/plugins/infra/public/containers/logs/log_stream/index.ts
@@ -9,6 +9,7 @@ import { esKuery } from '../../../../../../../src/plugins/data/public';
import { fetchLogEntries } from '../log_entries/api/fetch_log_entries';
import { useTrackedPromise } from '../../../utils/use_tracked_promise';
import { LogEntry, LogEntriesCursor } from '../../../../common/http_api';
+import { useKibanaContextForPlugin } from '../../../hooks/use_kibana';
interface LogStreamProps {
sourceId: string;
@@ -31,6 +32,7 @@ export function useLogStream({
query,
center,
}: LogStreamProps): LogStreamState {
+ const { services } = useKibanaContextForPlugin();
const [entries, setEntries] = useState([]);
const parsedQuery = useMemo(() => {
@@ -47,13 +49,16 @@ export function useLogStream({
setEntries([]);
const fetchPosition = center ? { center } : { before: 'last' };
- return fetchLogEntries({
- sourceId,
- startTimestamp,
- endTimestamp,
- query: parsedQuery,
- ...fetchPosition,
- });
+ return fetchLogEntries(
+ {
+ sourceId,
+ startTimestamp,
+ endTimestamp,
+ query: parsedQuery,
+ ...fetchPosition,
+ },
+ services.http.fetch
+ );
},
onResolve: ({ data }) => {
setEntries(data.entries);
diff --git a/x-pack/plugins/infra/public/containers/logs/log_summary/api/fetch_log_summary.ts b/x-pack/plugins/infra/public/containers/logs/log_summary/api/fetch_log_summary.ts
index f74f0dc0e3117..2be6538e21ebe 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_summary/api/fetch_log_summary.ts
+++ b/x-pack/plugins/infra/public/containers/logs/log_summary/api/fetch_log_summary.ts
@@ -4,11 +4,8 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { fold } from 'fp-ts/lib/Either';
-import { pipe } from 'fp-ts/lib/pipeable';
-import { identity } from 'fp-ts/lib/function';
-import { npStart } from '../../../../legacy_singletons';
-import { throwErrors, createPlainError } from '../../../../../common/runtime_types';
+import type { HttpHandler } from 'src/core/public';
+import { decodeOrThrow } from '../../../../../common/runtime_types';
import {
LOG_ENTRIES_SUMMARY_PATH,
@@ -17,14 +14,14 @@ import {
logEntriesSummaryResponseRT,
} from '../../../../../common/http_api';
-export const fetchLogSummary = async (requestArgs: LogEntriesSummaryRequest) => {
- const response = await npStart.http.fetch(LOG_ENTRIES_SUMMARY_PATH, {
+export const fetchLogSummary = async (
+ requestArgs: LogEntriesSummaryRequest,
+ fetch: HttpHandler
+) => {
+ const response = await fetch(LOG_ENTRIES_SUMMARY_PATH, {
method: 'POST',
body: JSON.stringify(logEntriesSummaryRequestRT.encode(requestArgs)),
});
- return pipe(
- logEntriesSummaryResponseRT.decode(response),
- fold(throwErrors(createPlainError), identity)
- );
+ return decodeOrThrow(logEntriesSummaryResponseRT)(response);
};
diff --git a/x-pack/plugins/infra/public/containers/logs/log_summary/log_summary.test.tsx b/x-pack/plugins/infra/public/containers/logs/log_summary/log_summary.test.tsx
index 73d0e5efdf06b..652ea8c71dc44 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_summary/log_summary.test.tsx
+++ b/x-pack/plugins/infra/public/containers/logs/log_summary/log_summary.test.tsx
@@ -5,6 +5,8 @@
*/
import { renderHook } from '@testing-library/react-hooks';
+// We are using this inside a `jest.mock` call. Jest requires dynamic dependencies to be prefixed with `mock`
+import { coreMock as mockCoreMock } from 'src/core/public/mocks';
import { useLogSummary } from './log_summary';
@@ -16,6 +18,10 @@ import { datemathToEpochMillis } from '../../../utils/datemath';
jest.mock('./api/fetch_log_summary', () => ({ fetchLogSummary: jest.fn() }));
const fetchLogSummaryMock = fetchLogSummary as jest.MockedFunction;
+jest.mock('../../../hooks/use_kibana', () => ({
+ useKibanaContextForPlugin: () => ({ services: mockCoreMock.createStart() }),
+}));
+
describe('useLogSummary hook', () => {
beforeEach(() => {
fetchLogSummaryMock.mockClear();
@@ -53,7 +59,8 @@ describe('useLogSummary hook', () => {
expect(fetchLogSummaryMock).toHaveBeenLastCalledWith(
expect.objectContaining({
sourceId: 'INITIAL_SOURCE_ID',
- })
+ }),
+ expect.anything()
);
expect(result.current.buckets).toEqual(firstMockResponse.data.buckets);
@@ -64,7 +71,8 @@ describe('useLogSummary hook', () => {
expect(fetchLogSummaryMock).toHaveBeenLastCalledWith(
expect.objectContaining({
sourceId: 'CHANGED_SOURCE_ID',
- })
+ }),
+ expect.anything()
);
expect(result.current.buckets).toEqual(secondMockResponse.data.buckets);
});
@@ -96,7 +104,8 @@ describe('useLogSummary hook', () => {
expect(fetchLogSummaryMock).toHaveBeenLastCalledWith(
expect.objectContaining({
query: 'INITIAL_FILTER_QUERY',
- })
+ }),
+ expect.anything()
);
expect(result.current.buckets).toEqual(firstMockResponse.data.buckets);
@@ -107,7 +116,8 @@ describe('useLogSummary hook', () => {
expect(fetchLogSummaryMock).toHaveBeenLastCalledWith(
expect.objectContaining({
query: 'CHANGED_FILTER_QUERY',
- })
+ }),
+ expect.anything()
);
expect(result.current.buckets).toEqual(secondMockResponse.data.buckets);
});
@@ -132,7 +142,8 @@ describe('useLogSummary hook', () => {
expect.objectContaining({
startTimestamp: firstRange.startTimestamp,
endTimestamp: firstRange.endTimestamp,
- })
+ }),
+ expect.anything()
);
const secondRange = createMockDateRange('now-20s', 'now');
@@ -145,7 +156,8 @@ describe('useLogSummary hook', () => {
expect.objectContaining({
startTimestamp: secondRange.startTimestamp,
endTimestamp: secondRange.endTimestamp,
- })
+ }),
+ expect.anything()
);
});
});
diff --git a/x-pack/plugins/infra/public/containers/logs/log_summary/log_summary.tsx b/x-pack/plugins/infra/public/containers/logs/log_summary/log_summary.tsx
index b83be77656863..be0d87f5d267d 100644
--- a/x-pack/plugins/infra/public/containers/logs/log_summary/log_summary.tsx
+++ b/x-pack/plugins/infra/public/containers/logs/log_summary/log_summary.tsx
@@ -10,6 +10,7 @@ import { useCancellableEffect } from '../../../utils/cancellable_effect';
import { fetchLogSummary } from './api/fetch_log_summary';
import { LogEntriesSummaryResponse } from '../../../../common/http_api';
import { useBucketSize } from './bucket_size';
+import { useKibanaContextForPlugin } from '../../../hooks/use_kibana';
export type LogSummaryBuckets = LogEntriesSummaryResponse['data']['buckets'];
@@ -19,6 +20,7 @@ export const useLogSummary = (
endTimestamp: number | null,
filterQuery: string | null
) => {
+ const { services } = useKibanaContextForPlugin();
const [logSummaryBuckets, setLogSummaryBuckets] = useState([]);
const bucketSize = useBucketSize(startTimestamp, endTimestamp);
@@ -28,13 +30,16 @@ export const useLogSummary = (
return;
}
- fetchLogSummary({
- sourceId,
- startTimestamp,
- endTimestamp,
- bucketSize,
- query: filterQuery,
- }).then((response) => {
+ fetchLogSummary(
+ {
+ sourceId,
+ startTimestamp,
+ endTimestamp,
+ bucketSize,
+ query: filterQuery,
+ },
+ services.http.fetch
+ ).then((response) => {
if (!getIsCancelled()) {
setLogSummaryBuckets(response.data.buckets);
}
diff --git a/x-pack/plugins/infra/public/containers/ml/api/ml_cleanup.ts b/x-pack/plugins/infra/public/containers/ml/api/ml_cleanup.ts
index 23fa338e74f14..fa7d8f14c6a9a 100644
--- a/x-pack/plugins/infra/public/containers/ml/api/ml_cleanup.ts
+++ b/x-pack/plugins/infra/public/containers/ml/api/ml_cleanup.ts
@@ -5,21 +5,24 @@
*/
import * as rt from 'io-ts';
-import { pipe } from 'fp-ts/lib/pipeable';
-import { fold } from 'fp-ts/lib/Either';
-import { identity } from 'fp-ts/lib/function';
-import { npStart } from '../../../legacy_singletons';
-
+import type { HttpHandler } from 'src/core/public';
import { getDatafeedId, getJobId } from '../../../../common/infra_ml';
-import { throwErrors, createPlainError } from '../../../../common/runtime_types';
+import { decodeOrThrow } from '../../../../common/runtime_types';
+
+interface DeleteJobsRequestArgs {
+ spaceId: string;
+ sourceId: string;
+ jobTypes: JobType[];
+}
export const callDeleteJobs = async (
- spaceId: string,
- sourceId: string,
- jobTypes: JobType[]
+ requestArgs: DeleteJobsRequestArgs,
+ fetch: HttpHandler
) => {
+ const { spaceId, sourceId, jobTypes } = requestArgs;
+
// NOTE: Deleting the jobs via this API will delete the datafeeds at the same time
- const deleteJobsResponse = await npStart.http.fetch('/api/ml/jobs/delete_jobs', {
+ const deleteJobsResponse = await fetch('/api/ml/jobs/delete_jobs', {
method: 'POST',
body: JSON.stringify(
deleteJobsRequestPayloadRT.encode({
@@ -28,28 +31,29 @@ export const callDeleteJobs = async (
),
});
- return pipe(
- deleteJobsResponsePayloadRT.decode(deleteJobsResponse),
- fold(throwErrors(createPlainError), identity)
- );
+ return decodeOrThrow(deleteJobsResponsePayloadRT)(deleteJobsResponse);
};
-export const callGetJobDeletionTasks = async () => {
- const jobDeletionTasksResponse = await npStart.http.fetch('/api/ml/jobs/deleting_jobs_tasks');
+export const callGetJobDeletionTasks = async (fetch: HttpHandler) => {
+ const jobDeletionTasksResponse = await fetch('/api/ml/jobs/deleting_jobs_tasks');
- return pipe(
- getJobDeletionTasksResponsePayloadRT.decode(jobDeletionTasksResponse),
- fold(throwErrors(createPlainError), identity)
- );
+ return decodeOrThrow(getJobDeletionTasksResponsePayloadRT)(jobDeletionTasksResponse);
};
+interface StopDatafeedsRequestArgs {
+ spaceId: string;
+ sourceId: string;
+ jobTypes: JobType[];
+}
+
export const callStopDatafeeds = async (
- spaceId: string,
- sourceId: string,
- jobTypes: JobType[]
+ requestArgs: StopDatafeedsRequestArgs,
+ fetch: HttpHandler
) => {
+ const { spaceId, sourceId, jobTypes } = requestArgs;
+
// Stop datafeed due to https://github.com/elastic/kibana/issues/44652
- const stopDatafeedResponse = await npStart.http.fetch('/api/ml/jobs/stop_datafeeds', {
+ const stopDatafeedResponse = await fetch('/api/ml/jobs/stop_datafeeds', {
method: 'POST',
body: JSON.stringify(
stopDatafeedsRequestPayloadRT.encode({
@@ -58,10 +62,7 @@ export const callStopDatafeeds = async (
),
});
- return pipe(
- stopDatafeedsResponsePayloadRT.decode(stopDatafeedResponse),
- fold(throwErrors(createPlainError), identity)
- );
+ return decodeOrThrow(stopDatafeedsResponsePayloadRT)(stopDatafeedResponse);
};
export const deleteJobsRequestPayloadRT = rt.type({
diff --git a/x-pack/plugins/infra/public/containers/ml/api/ml_get_jobs_summary_api.ts b/x-pack/plugins/infra/public/containers/ml/api/ml_get_jobs_summary_api.ts
index 3fddb63f69791..84b5df3d172c7 100644
--- a/x-pack/plugins/infra/public/containers/ml/api/ml_get_jobs_summary_api.ts
+++ b/x-pack/plugins/infra/public/containers/ml/api/ml_get_jobs_summary_api.ts
@@ -4,21 +4,24 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { fold } from 'fp-ts/lib/Either';
-import { identity } from 'fp-ts/lib/function';
-import { pipe } from 'fp-ts/lib/pipeable';
import * as rt from 'io-ts';
-import { npStart } from '../../../legacy_singletons';
+import type { HttpHandler } from 'src/core/public';
import { getJobId, jobCustomSettingsRT } from '../../../../common/infra_ml';
-import { createPlainError, throwErrors } from '../../../../common/runtime_types';
+import { decodeOrThrow } from '../../../../common/runtime_types';
+
+interface RequestArgs {
+ spaceId: string;
+ sourceId: string;
+ jobTypes: JobType[];
+}
export const callJobsSummaryAPI = async (
- spaceId: string,
- sourceId: string,
- jobTypes: JobType[]
+ requestArgs: RequestArgs,
+ fetch: HttpHandler
) => {
- const response = await npStart.http.fetch('/api/ml/jobs/jobs_summary', {
+ const { spaceId, sourceId, jobTypes } = requestArgs;
+ const response = await fetch('/api/ml/jobs/jobs_summary', {
method: 'POST',
body: JSON.stringify(
fetchJobStatusRequestPayloadRT.encode({
@@ -26,10 +29,7 @@ export const callJobsSummaryAPI = async (
})
),
});
- return pipe(
- fetchJobStatusResponsePayloadRT.decode(response),
- fold(throwErrors(createPlainError), identity)
- );
+ return decodeOrThrow(fetchJobStatusResponsePayloadRT)(response);
};
export const fetchJobStatusRequestPayloadRT = rt.type({
diff --git a/x-pack/plugins/infra/public/containers/ml/api/ml_get_module.ts b/x-pack/plugins/infra/public/containers/ml/api/ml_get_module.ts
index d492522c120a1..75ce335fbe49c 100644
--- a/x-pack/plugins/infra/public/containers/ml/api/ml_get_module.ts
+++ b/x-pack/plugins/infra/public/containers/ml/api/ml_get_module.ts
@@ -4,24 +4,18 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { fold } from 'fp-ts/lib/Either';
-import { identity } from 'fp-ts/lib/function';
-import { pipe } from 'fp-ts/lib/pipeable';
import * as rt from 'io-ts';
-import { npStart } from '../../../legacy_singletons';
+import type { HttpHandler } from 'src/core/public';
import { jobCustomSettingsRT } from '../../../../common/log_analysis';
-import { createPlainError, throwErrors } from '../../../../common/runtime_types';
+import { decodeOrThrow } from '../../../../common/runtime_types';
-export const callGetMlModuleAPI = async (moduleId: string) => {
- const response = await npStart.http.fetch(`/api/ml/modules/get_module/${moduleId}`, {
+export const callGetMlModuleAPI = async (moduleId: string, fetch: HttpHandler) => {
+ const response = await fetch(`/api/ml/modules/get_module/${moduleId}`, {
method: 'GET',
});
- return pipe(
- getMlModuleResponsePayloadRT.decode(response),
- fold(throwErrors(createPlainError), identity)
- );
+ return decodeOrThrow(getMlModuleResponsePayloadRT)(response);
};
const jobDefinitionRT = rt.type({
diff --git a/x-pack/plugins/infra/public/containers/ml/api/ml_setup_module_api.ts b/x-pack/plugins/infra/public/containers/ml/api/ml_setup_module_api.ts
index 06b0e075387b0..36dced1bd2680 100644
--- a/x-pack/plugins/infra/public/containers/ml/api/ml_setup_module_api.ts
+++ b/x-pack/plugins/infra/public/containers/ml/api/ml_setup_module_api.ts
@@ -4,27 +4,38 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { fold } from 'fp-ts/lib/Either';
-import { identity } from 'fp-ts/lib/function';
-import { pipe } from 'fp-ts/lib/pipeable';
import * as rt from 'io-ts';
-import { npStart } from '../../../legacy_singletons';
+import type { HttpHandler } from 'src/core/public';
import { getJobIdPrefix, jobCustomSettingsRT } from '../../../../common/infra_ml';
-import { createPlainError, throwErrors } from '../../../../common/runtime_types';
-
-export const callSetupMlModuleAPI = async (
- moduleId: string,
- start: number | undefined,
- end: number | undefined,
- spaceId: string,
- sourceId: string,
- indexPattern: string,
- jobOverrides: SetupMlModuleJobOverrides[] = [],
- datafeedOverrides: SetupMlModuleDatafeedOverrides[] = [],
- query?: object
-) => {
- const response = await npStart.http.fetch(`/api/ml/modules/setup/${moduleId}`, {
+import { decodeOrThrow } from '../../../../common/runtime_types';
+
+interface RequestArgs {
+ moduleId: string;
+ start?: number;
+ end?: number;
+ spaceId: string;
+ sourceId: string;
+ indexPattern: string;
+ jobOverrides?: SetupMlModuleJobOverrides[];
+ datafeedOverrides?: SetupMlModuleDatafeedOverrides[];
+ query?: object;
+}
+
+export const callSetupMlModuleAPI = async (requestArgs: RequestArgs, fetch: HttpHandler) => {
+ const {
+ moduleId,
+ start,
+ end,
+ spaceId,
+ sourceId,
+ indexPattern,
+ jobOverrides = [],
+ datafeedOverrides = [],
+ query,
+ } = requestArgs;
+
+ const response = await fetch(`/api/ml/modules/setup/${moduleId}`, {
method: 'POST',
body: JSON.stringify(
setupMlModuleRequestPayloadRT.encode({
@@ -40,10 +51,7 @@ export const callSetupMlModuleAPI = async (
),
});
- return pipe(
- setupMlModuleResponsePayloadRT.decode(response),
- fold(throwErrors(createPlainError), identity)
- );
+ return decodeOrThrow(setupMlModuleResponsePayloadRT)(response);
};
const setupMlModuleTimeParamsRT = rt.partial({
diff --git a/x-pack/plugins/infra/public/containers/ml/infra_ml_capabilities.tsx b/x-pack/plugins/infra/public/containers/ml/infra_ml_capabilities.tsx
index f4c90a459af6a..bc488a51e2aff 100644
--- a/x-pack/plugins/infra/public/containers/ml/infra_ml_capabilities.tsx
+++ b/x-pack/plugins/infra/public/containers/ml/infra_ml_capabilities.tsx
@@ -10,14 +10,15 @@ import { fold } from 'fp-ts/lib/Either';
import { pipe } from 'fp-ts/lib/pipeable';
import { identity } from 'fp-ts/lib/function';
import { useTrackedPromise } from '../../utils/use_tracked_promise';
-import { npStart } from '../../legacy_singletons';
import {
getMlCapabilitiesResponsePayloadRT,
GetMlCapabilitiesResponsePayload,
} from './api/ml_api_types';
import { throwErrors, createPlainError } from '../../../common/runtime_types';
+import { useKibanaContextForPlugin } from '../../hooks/use_kibana';
export const useInfraMLCapabilities = () => {
+ const { services } = useKibanaContextForPlugin();
const [mlCapabilities, setMlCapabilities] = useState(
initialMlCapabilities
);
@@ -26,7 +27,7 @@ export const useInfraMLCapabilities = () => {
{
cancelPreviousOn: 'resolution',
createPromise: async () => {
- const rawResponse = await npStart.http.fetch('/api/ml/ml_capabilities');
+ const rawResponse = await services.http.fetch('/api/ml/ml_capabilities');
return pipe(
getMlCapabilitiesResponsePayloadRT.decode(rawResponse),
diff --git a/x-pack/plugins/infra/public/containers/ml/infra_ml_cleanup.tsx b/x-pack/plugins/infra/public/containers/ml/infra_ml_cleanup.tsx
index 736982c8043b1..871e61ecfe507 100644
--- a/x-pack/plugins/infra/public/containers/ml/infra_ml_cleanup.tsx
+++ b/x-pack/plugins/infra/public/containers/ml/infra_ml_cleanup.tsx
@@ -4,16 +4,18 @@
* you may not use this file except in compliance with the Elastic License.
*/
+import { HttpHandler } from 'src/core/public';
import { getJobId } from '../../../common/infra_ml';
import { callDeleteJobs, callGetJobDeletionTasks, callStopDatafeeds } from './api/ml_cleanup';
export const cleanUpJobsAndDatafeeds = async (
spaceId: string,
sourceId: string,
- jobTypes: JobType[]
+ jobTypes: JobType[],
+ fetch: HttpHandler
) => {
try {
- await callStopDatafeeds(spaceId, sourceId, jobTypes);
+ await callStopDatafeeds({ spaceId, sourceId, jobTypes }, fetch);
} catch (err) {
// Proceed only if datafeed has been deleted or didn't exist in the first place
if (err?.res?.status !== 404) {
@@ -21,27 +23,29 @@ export const cleanUpJobsAndDatafeeds = async (
}
}
- return await deleteJobs(spaceId, sourceId, jobTypes);
+ return await deleteJobs(spaceId, sourceId, jobTypes, fetch);
};
const deleteJobs = async (
spaceId: string,
sourceId: string,
- jobTypes: JobType[]
+ jobTypes: JobType[],
+ fetch: HttpHandler
) => {
- const deleteJobsResponse = await callDeleteJobs(spaceId, sourceId, jobTypes);
- await waitUntilJobsAreDeleted(spaceId, sourceId, jobTypes);
+ const deleteJobsResponse = await callDeleteJobs({ spaceId, sourceId, jobTypes }, fetch);
+ await waitUntilJobsAreDeleted(spaceId, sourceId, jobTypes, fetch);
return deleteJobsResponse;
};
const waitUntilJobsAreDeleted = async (
spaceId: string,
sourceId: string,
- jobTypes: JobType[]
+ jobTypes: JobType[],
+ fetch: HttpHandler
) => {
const moduleJobIds = jobTypes.map((jobType) => getJobId(spaceId, sourceId, jobType));
while (true) {
- const { jobIds: jobIdsBeingDeleted } = await callGetJobDeletionTasks();
+ const { jobIds: jobIdsBeingDeleted } = await callGetJobDeletionTasks(fetch);
const needToWait = jobIdsBeingDeleted.some((jobId) => moduleJobIds.includes(jobId));
if (needToWait) {
diff --git a/x-pack/plugins/infra/public/containers/ml/infra_ml_module.tsx b/x-pack/plugins/infra/public/containers/ml/infra_ml_module.tsx
index 349541d108f5e..5408084a5246e 100644
--- a/x-pack/plugins/infra/public/containers/ml/infra_ml_module.tsx
+++ b/x-pack/plugins/infra/public/containers/ml/infra_ml_module.tsx
@@ -6,6 +6,7 @@
import { useCallback, useMemo } from 'react';
import { DatasetFilter } from '../../../common/infra_ml';
+import { useKibanaContextForPlugin } from '../../hooks/use_kibana';
import { useTrackedPromise } from '../../utils/use_tracked_promise';
import { useModuleStatus } from './infra_ml_module_status';
import { ModuleDescriptor, ModuleSourceConfiguration } from './infra_ml_module_types';
@@ -17,6 +18,7 @@ export const useInfraMLModule = ({
sourceConfiguration: ModuleSourceConfiguration;
moduleDescriptor: ModuleDescriptor;
}) => {
+ const { services } = useKibanaContextForPlugin();
const { spaceId, sourceId, timestampField } = sourceConfiguration;
const [moduleStatus, dispatchModuleStatus] = useModuleStatus(moduleDescriptor.jobTypes);
@@ -25,7 +27,7 @@ export const useInfraMLModule = ({
cancelPreviousOn: 'resolution',
createPromise: async () => {
dispatchModuleStatus({ type: 'fetchingJobStatuses' });
- return await moduleDescriptor.getJobSummary(spaceId, sourceId);
+ return await moduleDescriptor.getJobSummary(spaceId, sourceId, services.http.fetch);
},
onResolve: (jobResponse) => {
dispatchModuleStatus({
@@ -54,18 +56,25 @@ export const useInfraMLModule = ({
) => {
dispatchModuleStatus({ type: 'startedSetup' });
const setupResult = await moduleDescriptor.setUpModule(
- start,
- end,
- datasetFilter,
{
- indices: selectedIndices,
- sourceId,
- spaceId,
- timestampField,
+ start,
+ end,
+ datasetFilter,
+ moduleSourceConfiguration: {
+ indices: selectedIndices,
+ sourceId,
+ spaceId,
+ timestampField,
+ },
+ partitionField,
},
- partitionField
+ services.http.fetch
+ );
+ const jobSummaries = await moduleDescriptor.getJobSummary(
+ spaceId,
+ sourceId,
+ services.http.fetch
);
- const jobSummaries = await moduleDescriptor.getJobSummary(spaceId, sourceId);
return { setupResult, jobSummaries };
},
onResolve: ({ setupResult: { datafeeds, jobs }, jobSummaries }) => {
@@ -89,7 +98,7 @@ export const useInfraMLModule = ({
{
cancelPreviousOn: 'resolution',
createPromise: async () => {
- return await moduleDescriptor.cleanUpModule(spaceId, sourceId);
+ return await moduleDescriptor.cleanUpModule(spaceId, sourceId, services.http.fetch);
},
},
[spaceId, sourceId]
diff --git a/x-pack/plugins/infra/public/containers/ml/infra_ml_module_definition.tsx b/x-pack/plugins/infra/public/containers/ml/infra_ml_module_definition.tsx
index 3c7ffcfd4a4e2..a747a2853d1f7 100644
--- a/x-pack/plugins/infra/public/containers/ml/infra_ml_module_definition.tsx
+++ b/x-pack/plugins/infra/public/containers/ml/infra_ml_module_definition.tsx
@@ -6,6 +6,7 @@
import { useCallback, useMemo, useState } from 'react';
import { getJobId } from '../../../common/log_analysis';
+import { useKibanaContextForPlugin } from '../../hooks/use_kibana';
import { useTrackedPromise } from '../../utils/use_tracked_promise';
import { JobSummary } from './api/ml_get_jobs_summary_api';
import { GetMlModuleResponsePayload, JobDefinition } from './api/ml_get_module';
@@ -18,6 +19,7 @@ export const useInfraMLModuleDefinition = ({
sourceConfiguration: ModuleSourceConfiguration;
moduleDescriptor: ModuleDescriptor;
}) => {
+ const { services } = useKibanaContextForPlugin();
const [moduleDefinition, setModuleDefinition] = useState<
GetMlModuleResponsePayload | undefined
>();
@@ -40,7 +42,7 @@ export const useInfraMLModuleDefinition = ({
{
cancelPreviousOn: 'resolution',
createPromise: async () => {
- return await moduleDescriptor.getModuleDefinition();
+ return await moduleDescriptor.getModuleDefinition(services.http.fetch);
},
onResolve: (response) => {
setModuleDefinition(response);
diff --git a/x-pack/plugins/infra/public/containers/ml/infra_ml_module_types.ts b/x-pack/plugins/infra/public/containers/ml/infra_ml_module_types.ts
index a9f2671de8259..976a64e8034bc 100644
--- a/x-pack/plugins/infra/public/containers/ml/infra_ml_module_types.ts
+++ b/x-pack/plugins/infra/public/containers/ml/infra_ml_module_types.ts
@@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
-
+import { HttpHandler } from 'src/core/public';
import {
ValidateLogEntryDatasetsResponsePayload,
ValidationIndicesResponsePayload,
@@ -16,6 +16,14 @@ import { SetupMlModuleResponsePayload } from './api/ml_setup_module_api';
export { JobModelSizeStats, JobSummary } from './api/ml_get_jobs_summary_api';
+export interface SetUpModuleArgs {
+ start?: number | undefined;
+ end?: number | undefined;
+ datasetFilter?: DatasetFilter;
+ moduleSourceConfiguration: ModuleSourceConfiguration;
+ partitionField?: string;
+}
+
export interface ModuleDescriptor {
moduleId: string;
moduleName: string;
@@ -23,25 +31,32 @@ export interface ModuleDescriptor {
jobTypes: JobType[];
bucketSpan: number;
getJobIds: (spaceId: string, sourceId: string) => Record;
- getJobSummary: (spaceId: string, sourceId: string) => Promise;
- getModuleDefinition: () => Promise;
+ getJobSummary: (
+ spaceId: string,
+ sourceId: string,
+ fetch: HttpHandler
+ ) => Promise;
+ getModuleDefinition: (fetch: HttpHandler) => Promise;
setUpModule: (
- start: number | undefined,
- end: number | undefined,
- datasetFilter: DatasetFilter,
- sourceConfiguration: ModuleSourceConfiguration,
- partitionField?: string
+ setUpModuleArgs: SetUpModuleArgs,
+ fetch: HttpHandler
) => Promise;
- cleanUpModule: (spaceId: string, sourceId: string) => Promise;
- validateSetupIndices: (
+ cleanUpModule: (
+ spaceId: string,
+ sourceId: string,
+ fetch: HttpHandler
+ ) => Promise;
+ validateSetupIndices?: (
indices: string[],
- timestampField: string
+ timestampField: string,
+ fetch: HttpHandler
) => Promise;
- validateSetupDatasets: (
+ validateSetupDatasets?: (
indices: string[],
timestampField: string,
startTime: number,
- endTime: number
+ endTime: number,
+ fetch: HttpHandler
) => Promise;
}
diff --git a/x-pack/plugins/infra/public/containers/ml/infra_ml_setup_state.ts b/x-pack/plugins/infra/public/containers/ml/infra_ml_setup_state.ts
deleted file mode 100644
index 0dfe3b301f240..0000000000000
--- a/x-pack/plugins/infra/public/containers/ml/infra_ml_setup_state.ts
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License;
- * you may not use this file except in compliance with the Elastic License.
- */
-
-import { isEqual } from 'lodash';
-import { useCallback, useEffect, useMemo, useState } from 'react';
-import { usePrevious } from 'react-use';
-import {
- combineDatasetFilters,
- DatasetFilter,
- filterDatasetFilter,
- isExampleDataIndex,
-} from '../../../common/infra_ml';
-import {
- AvailableIndex,
- ValidationIndicesError,
- ValidationUIError,
-} from '../../components/logging/log_analysis_setup/initial_configuration_step';
-import { useTrackedPromise } from '../../utils/use_tracked_promise';
-import { ModuleDescriptor, ModuleSourceConfiguration } from './infra_ml_module_types';
-
-type SetupHandler = (
- indices: string[],
- startTime: number | undefined,
- endTime: number | undefined,
- datasetFilter: DatasetFilter
-) => void;
-
-interface AnalysisSetupStateArguments {
- cleanUpAndSetUpModule: SetupHandler;
- moduleDescriptor: ModuleDescriptor;
- setUpModule: SetupHandler;
- sourceConfiguration: ModuleSourceConfiguration;
-}
-
-const fourWeeksInMs = 86400000 * 7 * 4;
-
-export const useAnalysisSetupState = ({
- cleanUpAndSetUpModule,
- moduleDescriptor: { validateSetupDatasets, validateSetupIndices },
- setUpModule,
- sourceConfiguration,
-}: AnalysisSetupStateArguments) => {
- const [startTime, setStartTime] = useState(Date.now() - fourWeeksInMs);
- const [endTime, setEndTime] = useState(undefined);
-
- const isTimeRangeValid = useMemo(
- () => (startTime != null && endTime != null ? startTime < endTime : true),
- [endTime, startTime]
- );
-
- const [validatedIndices, setValidatedIndices] = useState(
- sourceConfiguration.indices.map((indexName) => ({
- name: indexName,
- validity: 'unknown' as const,
- }))
- );
-
- const updateIndicesWithValidationErrors = useCallback(
- (validationErrors: ValidationIndicesError[]) =>
- setValidatedIndices((availableIndices) =>
- availableIndices.map((previousAvailableIndex) => {
- const indexValiationErrors = validationErrors.filter(
- ({ index }) => index === previousAvailableIndex.name
- );
-
- if (indexValiationErrors.length > 0) {
- return {
- validity: 'invalid',
- name: previousAvailableIndex.name,
- errors: indexValiationErrors,
- };
- } else if (previousAvailableIndex.validity === 'valid') {
- return {
- ...previousAvailableIndex,
- validity: 'valid',
- errors: [],
- };
- } else {
- return {
- validity: 'valid',
- name: previousAvailableIndex.name,
- isSelected: !isExampleDataIndex(previousAvailableIndex.name),
- availableDatasets: [],
- datasetFilter: {
- type: 'includeAll' as const,
- },
- };
- }
- })
- ),
- []
- );
-
- const updateIndicesWithAvailableDatasets = useCallback(
- (availableDatasets: Array<{ indexName: string; datasets: string[] }>) =>
- setValidatedIndices((availableIndices) =>
- availableIndices.map((previousAvailableIndex) => {
- if (previousAvailableIndex.validity !== 'valid') {
- return previousAvailableIndex;
- }
-
- const availableDatasetsForIndex = availableDatasets.filter(
- ({ indexName }) => indexName === previousAvailableIndex.name
- );
- const newAvailableDatasets = availableDatasetsForIndex.flatMap(
- ({ datasets }) => datasets
- );
-
- // filter out datasets that have disappeared if this index' datasets were updated
- const newDatasetFilter: DatasetFilter =
- availableDatasetsForIndex.length > 0
- ? filterDatasetFilter(previousAvailableIndex.datasetFilter, (dataset) =>
- newAvailableDatasets.includes(dataset)
- )
- : previousAvailableIndex.datasetFilter;
-
- return {
- ...previousAvailableIndex,
- availableDatasets: newAvailableDatasets,
- datasetFilter: newDatasetFilter,
- };
- })
- ),
- []
- );
-
- const validIndexNames = useMemo(
- () => validatedIndices.filter((index) => index.validity === 'valid').map((index) => index.name),
- [validatedIndices]
- );
-
- const selectedIndexNames = useMemo(
- () =>
- validatedIndices
- .filter((index) => index.validity === 'valid' && index.isSelected)
- .map((i) => i.name),
- [validatedIndices]
- );
-
- const datasetFilter = useMemo(
- () =>
- validatedIndices
- .flatMap((validatedIndex) =>
- validatedIndex.validity === 'valid'
- ? validatedIndex.datasetFilter
- : { type: 'includeAll' as const }
- )
- .reduce(combineDatasetFilters, { type: 'includeAll' as const }),
- [validatedIndices]
- );
-
- const [validateIndicesRequest, validateIndices] = useTrackedPromise(
- {
- cancelPreviousOn: 'resolution',
- createPromise: async () => {
- return await validateSetupIndices(
- sourceConfiguration.indices,
- sourceConfiguration.timestampField
- );
- },
- onResolve: ({ data: { errors } }) => {
- updateIndicesWithValidationErrors(errors);
- },
- onReject: () => {
- setValidatedIndices([]);
- },
- },
- [sourceConfiguration.indices, sourceConfiguration.timestampField]
- );
-
- const [validateDatasetsRequest, validateDatasets] = useTrackedPromise(
- {
- cancelPreviousOn: 'resolution',
- createPromise: async () => {
- if (validIndexNames.length === 0) {
- return { data: { datasets: [] } };
- }
-
- return await validateSetupDatasets(
- validIndexNames,
- sourceConfiguration.timestampField,
- startTime ?? 0,
- endTime ?? Date.now()
- );
- },
- onResolve: ({ data: { datasets } }) => {
- updateIndicesWithAvailableDatasets(datasets);
- },
- },
- [validIndexNames, sourceConfiguration.timestampField, startTime, endTime]
- );
-
- const setUp = useCallback(() => {
- return setUpModule(selectedIndexNames, startTime, endTime, datasetFilter);
- }, [setUpModule, selectedIndexNames, startTime, endTime, datasetFilter]);
-
- const cleanUpAndSetUp = useCallback(() => {
- return cleanUpAndSetUpModule(selectedIndexNames, startTime, endTime, datasetFilter);
- }, [cleanUpAndSetUpModule, selectedIndexNames, startTime, endTime, datasetFilter]);
-
- const isValidating = useMemo(
- () => validateIndicesRequest.state === 'pending' || validateDatasetsRequest.state === 'pending',
- [validateDatasetsRequest.state, validateIndicesRequest.state]
- );
-
- const validationErrors = useMemo(() => {
- if (isValidating) {
- return [];
- }
-
- return [
- // validate request status
- ...(validateIndicesRequest.state === 'rejected' ||
- validateDatasetsRequest.state === 'rejected'
- ? [{ error: 'NETWORK_ERROR' as const }]
- : []),
- // validation request results
- ...validatedIndices.reduce((errors, index) => {
- return index.validity === 'invalid' && selectedIndexNames.includes(index.name)
- ? [...errors, ...index.errors]
- : errors;
- }, []),
- // index count
- ...(selectedIndexNames.length === 0 ? [{ error: 'TOO_FEW_SELECTED_INDICES' as const }] : []),
- // time range
- ...(!isTimeRangeValid ? [{ error: 'INVALID_TIME_RANGE' as const }] : []),
- ];
- }, [
- isValidating,
- validateIndicesRequest.state,
- validateDatasetsRequest.state,
- validatedIndices,
- selectedIndexNames,
- isTimeRangeValid,
- ]);
-
- const prevStartTime = usePrevious(startTime);
- const prevEndTime = usePrevious(endTime);
- const prevValidIndexNames = usePrevious(validIndexNames);
-
- useEffect(() => {
- if (!isTimeRangeValid) {
- return;
- }
-
- validateIndices();
- }, [isTimeRangeValid, validateIndices]);
-
- useEffect(() => {
- if (!isTimeRangeValid) {
- return;
- }
-
- if (
- startTime !== prevStartTime ||
- endTime !== prevEndTime ||
- !isEqual(validIndexNames, prevValidIndexNames)
- ) {
- validateDatasets();
- }
- }, [
- endTime,
- isTimeRangeValid,
- prevEndTime,
- prevStartTime,
- prevValidIndexNames,
- startTime,
- validIndexNames,
- validateDatasets,
- ]);
-
- return {
- cleanUpAndSetUp,
- datasetFilter,
- endTime,
- isValidating,
- selectedIndexNames,
- setEndTime,
- setStartTime,
- setUp,
- startTime,
- validatedIndices,
- setValidatedIndices,
- validationErrors,
- };
-};
diff --git a/x-pack/plugins/infra/public/containers/ml/modules/metrics_hosts/module_descriptor.ts b/x-pack/plugins/infra/public/containers/ml/modules/metrics_hosts/module_descriptor.ts
index cec87fb1144e3..47230cbed977f 100644
--- a/x-pack/plugins/infra/public/containers/ml/modules/metrics_hosts/module_descriptor.ts
+++ b/x-pack/plugins/infra/public/containers/ml/modules/metrics_hosts/module_descriptor.ts
@@ -5,22 +5,32 @@
*/
import { i18n } from '@kbn/i18n';
-import { ModuleDescriptor, ModuleSourceConfiguration } from '../../infra_ml_module_types';
+import { HttpHandler } from 'src/core/public';
+import { ModuleDescriptor, SetUpModuleArgs } from '../../infra_ml_module_types';
import { cleanUpJobsAndDatafeeds } from '../../infra_ml_cleanup';
import { callJobsSummaryAPI } from '../../api/ml_get_jobs_summary_api';
import { callGetMlModuleAPI } from '../../api/ml_get_module';
import { callSetupMlModuleAPI } from '../../api/ml_setup_module_api';
-import { callValidateIndicesAPI } from '../../../logs/log_analysis/api/validate_indices';
-import { callValidateDatasetsAPI } from '../../../logs/log_analysis/api/validate_datasets';
import {
metricsHostsJobTypes,
getJobId,
MetricsHostsJobType,
- DatasetFilter,
bucketSpan,
- partitionField,
} from '../../../../../common/infra_ml';
+// eslint-disable-next-line @kbn/eslint/no-restricted-paths
+import MemoryJob from '../../../../../../ml/server/models/data_recognizer/modules/metrics_ui_hosts/ml/hosts_memory_usage.json';
+// eslint-disable-next-line @kbn/eslint/no-restricted-paths
+import MemoryDatafeed from '../../../../../../ml/server/models/data_recognizer/modules/metrics_ui_hosts/ml/datafeed_hosts_memory_usage.json';
+// eslint-disable-next-line @kbn/eslint/no-restricted-paths
+import NetworkInJob from '../../../../../../ml/server/models/data_recognizer/modules/metrics_ui_hosts/ml/hosts_network_in.json';
+// eslint-disable-next-line @kbn/eslint/no-restricted-paths
+import NetworkInDatafeed from '../../../../../../ml/server/models/data_recognizer/modules/metrics_ui_hosts/ml/datafeed_hosts_network_in.json';
+// eslint-disable-next-line @kbn/eslint/no-restricted-paths
+import NetworkOutJob from '../../../../../../ml/server/models/data_recognizer/modules/metrics_ui_hosts/ml/hosts_network_out.json';
+// eslint-disable-next-line @kbn/eslint/no-restricted-paths
+import NetworkOutDatafeed from '../../../../../../ml/server/models/data_recognizer/modules/metrics_ui_hosts/ml/datafeed_hosts_network_out.json';
+type JobType = 'hosts_memory_usage' | 'hosts_network_in' | 'hosts_network_out';
const moduleId = 'metrics_ui_hosts';
const moduleName = i18n.translate('xpack.infra.ml.metricsModuleName', {
defaultMessage: 'Metrics anomanly detection',
@@ -38,76 +48,126 @@ const getJobIds = (spaceId: string, sourceId: string) =>
{} as Record
);
-const getJobSummary = async (spaceId: string, sourceId: string) => {
- const response = await callJobsSummaryAPI(spaceId, sourceId, metricsHostsJobTypes);
+const getJobSummary = async (spaceId: string, sourceId: string, fetch: HttpHandler) => {
+ const response = await callJobsSummaryAPI(
+ { spaceId, sourceId, jobTypes: metricsHostsJobTypes },
+ fetch
+ );
const jobIds = Object.values(getJobIds(spaceId, sourceId));
return response.filter((jobSummary) => jobIds.includes(jobSummary.id));
};
-const getModuleDefinition = async () => {
- return await callGetMlModuleAPI(moduleId);
+const getModuleDefinition = async (fetch: HttpHandler) => {
+ return await callGetMlModuleAPI(moduleId, fetch);
};
-const setUpModule = async (
- start: number | undefined,
- end: number | undefined,
- datasetFilter: DatasetFilter,
- { spaceId, sourceId, indices, timestampField }: ModuleSourceConfiguration,
- pField?: string
-) => {
+const setUpModule = async (setUpModuleArgs: SetUpModuleArgs, fetch: HttpHandler) => {
+ const {
+ start,
+ end,
+ moduleSourceConfiguration: { spaceId, sourceId, indices, timestampField },
+ partitionField,
+ } = setUpModuleArgs;
+
const indexNamePattern = indices.join(',');
- const jobIds = ['hosts_memory_usage', 'hosts_network_in', 'hosts_network_out'];
- const jobOverrides = jobIds.map((id) => ({
- job_id: id,
- data_description: {
- time_field: timestampField,
- },
- custom_settings: {
- metrics_source_config: {
- indexPattern: indexNamePattern,
- timestampField,
- bucketSpan,
+ const jobIds: JobType[] = ['hosts_memory_usage', 'hosts_network_in', 'hosts_network_out'];
+
+ const jobOverrides = jobIds.map((id) => {
+ const { job: defaultJobConfig } = getDefaultJobConfigs(id);
+
+ // eslint-disable-next-line @typescript-eslint/naming-convention
+ const analysis_config: any = {
+ ...defaultJobConfig.analysis_config,
+ };
+
+ if (partitionField) {
+ analysis_config.detectors[0].partition_field_name = partitionField;
+ if (analysis_config.influencers.indexOf(partitionField) === -1) {
+ analysis_config.influencers.push(partitionField);
+ }
+ }
+
+ return {
+ job_id: id,
+ data_description: {
+ time_field: timestampField,
},
- },
- }));
+ analysis_config,
+ custom_settings: {
+ metrics_source_config: {
+ indexPattern: indexNamePattern,
+ timestampField,
+ bucketSpan,
+ },
+ },
+ };
+ });
- return callSetupMlModuleAPI(
- moduleId,
- start,
- end,
- spaceId,
- sourceId,
- indexNamePattern,
- jobOverrides,
- []
- );
-};
+ const datafeedOverrides = jobIds.map((id) => {
+ const { datafeed: defaultDatafeedConfig } = getDefaultJobConfigs(id);
-const cleanUpModule = async (spaceId: string, sourceId: string) => {
- return await cleanUpJobsAndDatafeeds(spaceId, sourceId, metricsHostsJobTypes);
-};
+ if (!partitionField || id === 'hosts_memory_usage') {
+ // Since the host memory usage doesn't have custom aggs, we don't need to do anything to add a partition field
+ return defaultDatafeedConfig;
+ }
-const validateSetupIndices = async (indices: string[], timestampField: string) => {
- return await callValidateIndicesAPI(indices, [
- {
- name: timestampField,
- validTypes: ['date'],
- },
+ // If we have a partition field, we need to change the aggregation to do a terms agg at the top level
+ const aggregations = {
+ [partitionField]: {
+ terms: {
+ field: partitionField,
+ },
+ aggregations: {
+ ...defaultDatafeedConfig.aggregations,
+ },
+ },
+ };
+
+ return {
+ ...defaultDatafeedConfig,
+ job_id: id,
+ aggregations,
+ };
+ });
+
+ return callSetupMlModuleAPI(
{
- name: partitionField,
- validTypes: ['keyword'],
+ moduleId,
+ start,
+ end,
+ spaceId,
+ sourceId,
+ indexPattern: indexNamePattern,
+ jobOverrides,
+ datafeedOverrides,
},
- ]);
+ fetch
+ );
+};
+
+const getDefaultJobConfigs = (jobId: JobType): { datafeed: any; job: any } => {
+ switch (jobId) {
+ case 'hosts_memory_usage':
+ return {
+ datafeed: MemoryDatafeed,
+ job: MemoryJob,
+ };
+ case 'hosts_network_in':
+ return {
+ datafeed: NetworkInDatafeed,
+ job: NetworkInJob,
+ };
+ case 'hosts_network_out':
+ return {
+ datafeed: NetworkOutDatafeed,
+ job: NetworkOutJob,
+ };
+ }
};
-const validateSetupDatasets = async (
- indices: string[],
- timestampField: string,
- startTime: number,
- endTime: number
-) => {
- return await callValidateDatasetsAPI(indices, timestampField, startTime, endTime);
+const cleanUpModule = async (spaceId: string, sourceId: string, fetch: HttpHandler) => {
+ return await cleanUpJobsAndDatafeeds(spaceId, sourceId, metricsHostsJobTypes, fetch);
};
export const metricHostsModule: ModuleDescriptor = {
@@ -121,6 +181,4 @@ export const metricHostsModule: ModuleDescriptor = {
getModuleDefinition,
setUpModule,
cleanUpModule,
- validateSetupDatasets,
- validateSetupIndices,
};
diff --git a/x-pack/plugins/infra/public/containers/ml/modules/metrics_k8s/module_descriptor.ts b/x-pack/plugins/infra/public/containers/ml/modules/metrics_k8s/module_descriptor.ts
index cbcff1c307af6..488803dc113b0 100644
--- a/x-pack/plugins/infra/public/containers/ml/modules/metrics_k8s/module_descriptor.ts
+++ b/x-pack/plugins/infra/public/containers/ml/modules/metrics_k8s/module_descriptor.ts
@@ -5,22 +5,33 @@
*/
import { i18n } from '@kbn/i18n';
-import { ModuleDescriptor, ModuleSourceConfiguration } from '../../infra_ml_module_types';
+import { HttpHandler } from 'src/core/public';
+import { ModuleDescriptor, SetUpModuleArgs } from '../../infra_ml_module_types';
import { cleanUpJobsAndDatafeeds } from '../../infra_ml_cleanup';
import { callJobsSummaryAPI } from '../../api/ml_get_jobs_summary_api';
import { callGetMlModuleAPI } from '../../api/ml_get_module';
import { callSetupMlModuleAPI } from '../../api/ml_setup_module_api';
-import { callValidateIndicesAPI } from '../../../logs/log_analysis/api/validate_indices';
-import { callValidateDatasetsAPI } from '../../../logs/log_analysis/api/validate_datasets';
import {
metricsK8SJobTypes,
getJobId,
MetricK8sJobType,
- DatasetFilter,
bucketSpan,
- partitionField,
} from '../../../../../common/infra_ml';
+// eslint-disable-next-line @kbn/eslint/no-restricted-paths
+import MemoryJob from '../../../../../../ml/server/models/data_recognizer/modules/metrics_ui_k8s/ml/k8s_memory_usage.json';
+// eslint-disable-next-line @kbn/eslint/no-restricted-paths
+import MemoryDatafeed from '../../../../../../ml/server/models/data_recognizer/modules/metrics_ui_k8s/ml/datafeed_k8s_memory_usage.json';
+// eslint-disable-next-line @kbn/eslint/no-restricted-paths
+import NetworkInJob from '../../../../../../ml/server/models/data_recognizer/modules/metrics_ui_k8s/ml/k8s_network_in.json';
+// eslint-disable-next-line @kbn/eslint/no-restricted-paths
+import NetworkInDatafeed from '../../../../../../ml/server/models/data_recognizer/modules/metrics_ui_k8s/ml/datafeed_k8s_network_in.json';
+// eslint-disable-next-line @kbn/eslint/no-restricted-paths
+import NetworkOutJob from '../../../../../../ml/server/models/data_recognizer/modules/metrics_ui_k8s/ml/k8s_network_out.json';
+// eslint-disable-next-line @kbn/eslint/no-restricted-paths
+import NetworkOutDatafeed from '../../../../../../ml/server/models/data_recognizer/modules/metrics_ui_k8s/ml/datafeed_k8s_network_out.json';
+type JobType = 'k8s_memory_usage' | 'k8s_network_in' | 'k8s_network_out';
+export const DEFAULT_K8S_PARTITION_FIELD = 'kubernetes.namespace';
const moduleId = 'metrics_ui_k8s';
const moduleName = i18n.translate('xpack.infra.ml.metricsModuleName', {
defaultMessage: 'Metrics anomanly detection',
@@ -38,79 +49,130 @@ const getJobIds = (spaceId: string, sourceId: string) =>
{} as Record
);
-const getJobSummary = async (spaceId: string, sourceId: string) => {
- const response = await callJobsSummaryAPI(spaceId, sourceId, metricsK8SJobTypes);
+const getJobSummary = async (spaceId: string, sourceId: string, fetch: HttpHandler) => {
+ const response = await callJobsSummaryAPI(
+ { spaceId, sourceId, jobTypes: metricsK8SJobTypes },
+ fetch
+ );
const jobIds = Object.values(getJobIds(spaceId, sourceId));
return response.filter((jobSummary) => jobIds.includes(jobSummary.id));
};
-const getModuleDefinition = async () => {
- return await callGetMlModuleAPI(moduleId);
+const getModuleDefinition = async (fetch: HttpHandler) => {
+ return await callGetMlModuleAPI(moduleId, fetch);
};
-const setUpModule = async (
- start: number | undefined,
- end: number | undefined,
- datasetFilter: DatasetFilter,
- { spaceId, sourceId, indices, timestampField }: ModuleSourceConfiguration,
- pField?: string
-) => {
+const setUpModule = async (setUpModuleArgs: SetUpModuleArgs, fetch: HttpHandler) => {
+ const {
+ start,
+ end,
+ moduleSourceConfiguration: { spaceId, sourceId, indices, timestampField },
+ partitionField,
+ } = setUpModuleArgs;
+
const indexNamePattern = indices.join(',');
- const jobIds = ['k8s_memory_usage', 'k8s_network_in', 'k8s_network_out'];
- const jobOverrides = jobIds.map((id) => ({
- job_id: id,
- analysis_config: {
- bucket_span: `${bucketSpan}ms`,
- },
- data_description: {
- time_field: timestampField,
- },
- custom_settings: {
- metrics_source_config: {
- indexPattern: indexNamePattern,
- timestampField,
- bucketSpan,
+ const jobIds: JobType[] = ['k8s_memory_usage', 'k8s_network_in', 'k8s_network_out'];
+ const jobOverrides = jobIds.map((id) => {
+ const { job: defaultJobConfig } = getDefaultJobConfigs(id);
+
+ // eslint-disable-next-line @typescript-eslint/naming-convention
+ const analysis_config: any = {
+ ...defaultJobConfig.analysis_config,
+ };
+
+ if (partitionField) {
+ analysis_config.detectors[0].partition_field_name = partitionField;
+ if (analysis_config.influencers.indexOf(partitionField) === -1) {
+ analysis_config.influencers.push(partitionField);
+ }
+ }
+
+ return {
+ job_id: id,
+ data_description: {
+ time_field: timestampField,
},
- },
- }));
+ analysis_config,
+ custom_settings: {
+ metrics_source_config: {
+ indexPattern: indexNamePattern,
+ timestampField,
+ bucketSpan,
+ },
+ },
+ };
+ });
- return callSetupMlModuleAPI(
- moduleId,
- start,
- end,
- spaceId,
- sourceId,
- indexNamePattern,
- jobOverrides,
- []
- );
-};
+ const datafeedOverrides = jobIds.map((id) => {
+ const { datafeed: defaultDatafeedConfig } = getDefaultJobConfigs(id);
-const cleanUpModule = async (spaceId: string, sourceId: string) => {
- return await cleanUpJobsAndDatafeeds(spaceId, sourceId, metricsK8SJobTypes);
-};
+ if (!partitionField || id === 'k8s_memory_usage') {
+ // Since the host memory usage doesn't have custom aggs, we don't need to do anything to add a partition field
+ return defaultDatafeedConfig;
+ }
-const validateSetupIndices = async (indices: string[], timestampField: string) => {
- return await callValidateIndicesAPI(indices, [
- {
- name: timestampField,
- validTypes: ['date'],
- },
+ // Because the ML K8s jobs ship with a default partition field of {kubernetes.namespace}, ignore that agg and wrap it in our own agg.
+ const innerAggregation =
+ defaultDatafeedConfig.aggregations[DEFAULT_K8S_PARTITION_FIELD].aggregations;
+
+ // If we have a partition field, we need to change the aggregation to do a terms agg to partition the data at the top level
+ const aggregations = {
+ [partitionField]: {
+ terms: {
+ field: partitionField,
+ size: 25, // 25 is arbitratry and only used to keep the number of buckets to a managable level in the event that the user choose a high cardinality partition field.
+ },
+ aggregations: {
+ ...innerAggregation,
+ },
+ },
+ };
+
+ return {
+ ...defaultDatafeedConfig,
+ job_id: id,
+ aggregations,
+ };
+ });
+
+ return callSetupMlModuleAPI(
{
- name: partitionField,
- validTypes: ['keyword'],
+ moduleId,
+ start,
+ end,
+ spaceId,
+ sourceId,
+ indexPattern: indexNamePattern,
+ jobOverrides,
+ datafeedOverrides,
},
- ]);
+ fetch
+ );
+};
+
+const getDefaultJobConfigs = (jobId: JobType): { datafeed: any; job: any } => {
+ switch (jobId) {
+ case 'k8s_memory_usage':
+ return {
+ datafeed: MemoryDatafeed,
+ job: MemoryJob,
+ };
+ case 'k8s_network_in':
+ return {
+ datafeed: NetworkInDatafeed,
+ job: NetworkInJob,
+ };
+ case 'k8s_network_out':
+ return {
+ datafeed: NetworkOutDatafeed,
+ job: NetworkOutJob,
+ };
+ }
};
-const validateSetupDatasets = async (
- indices: string[],
- timestampField: string,
- startTime: number,
- endTime: number
-) => {
- return await callValidateDatasetsAPI(indices, timestampField, startTime, endTime);
+const cleanUpModule = async (spaceId: string, sourceId: string, fetch: HttpHandler) => {
+ return await cleanUpJobsAndDatafeeds(spaceId, sourceId, metricsK8SJobTypes, fetch);
};
export const metricHostsModule: ModuleDescriptor = {
@@ -124,6 +186,4 @@ export const metricHostsModule: ModuleDescriptor = {
getModuleDefinition,
setUpModule,
cleanUpModule,
- validateSetupDatasets,
- validateSetupIndices,
};
diff --git a/x-pack/plugins/infra/public/pages/link_to/link_to_logs.test.tsx b/x-pack/plugins/infra/public/pages/link_to/link_to_logs.test.tsx
index 945b299674aaa..4f83e37d7e029 100644
--- a/x-pack/plugins/infra/public/pages/link_to/link_to_logs.test.tsx
+++ b/x-pack/plugins/infra/public/pages/link_to/link_to_logs.test.tsx
@@ -14,7 +14,6 @@ import { createMemoryHistory } from 'history';
import React from 'react';
import { Route, Router, Switch } from 'react-router-dom';
import { httpServiceMock } from 'src/core/public/mocks';
-// import { HttpSetup } from 'src/core/public';
import { KibanaContextProvider } from 'src/plugins/kibana_react/public';
import { useLogSource } from '../../containers/logs/log_source';
import {
diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/service_calls/get_log_entry_category_datasets.ts b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/service_calls/get_log_entry_category_datasets.ts
index a8cd7854efb6b..5f34d45635b60 100644
--- a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/service_calls/get_log_entry_category_datasets.ts
+++ b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/service_calls/get_log_entry_category_datasets.ts
@@ -4,24 +4,28 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { fold } from 'fp-ts/lib/Either';
-import { pipe } from 'fp-ts/lib/pipeable';
-import { identity } from 'fp-ts/lib/function';
-import { npStart } from '../../../../legacy_singletons';
+import type { HttpHandler } from 'src/core/public';
import {
getLogEntryCategoryDatasetsRequestPayloadRT,
getLogEntryCategoryDatasetsSuccessReponsePayloadRT,
LOG_ANALYSIS_GET_LOG_ENTRY_CATEGORY_DATASETS_PATH,
} from '../../../../../common/http_api/log_analysis';
-import { createPlainError, throwErrors } from '../../../../../common/runtime_types';
+import { decodeOrThrow } from '../../../../../common/runtime_types';
+
+interface RequestArgs {
+ sourceId: string;
+ startTime: number;
+ endTime: number;
+}
export const callGetLogEntryCategoryDatasetsAPI = async (
- sourceId: string,
- startTime: number,
- endTime: number
+ requestArgs: RequestArgs,
+ fetch: HttpHandler
) => {
- const response = await npStart.http.fetch(LOG_ANALYSIS_GET_LOG_ENTRY_CATEGORY_DATASETS_PATH, {
+ const { sourceId, startTime, endTime } = requestArgs;
+
+ const response = await fetch(LOG_ANALYSIS_GET_LOG_ENTRY_CATEGORY_DATASETS_PATH, {
method: 'POST',
body: JSON.stringify(
getLogEntryCategoryDatasetsRequestPayloadRT.encode({
@@ -36,8 +40,5 @@ export const callGetLogEntryCategoryDatasetsAPI = async (
),
});
- return pipe(
- getLogEntryCategoryDatasetsSuccessReponsePayloadRT.decode(response),
- fold(throwErrors(createPlainError), identity)
- );
+ return decodeOrThrow(getLogEntryCategoryDatasetsSuccessReponsePayloadRT)(response);
};
diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/service_calls/get_log_entry_category_examples.ts b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/service_calls/get_log_entry_category_examples.ts
index a10d077a2dd4f..c4b756ebf5d58 100644
--- a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/service_calls/get_log_entry_category_examples.ts
+++ b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/service_calls/get_log_entry_category_examples.ts
@@ -4,26 +4,30 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { fold } from 'fp-ts/lib/Either';
-import { pipe } from 'fp-ts/lib/pipeable';
-import { identity } from 'fp-ts/lib/function';
-import { npStart } from '../../../../legacy_singletons';
+import type { HttpHandler } from 'src/core/public';
import {
getLogEntryCategoryExamplesRequestPayloadRT,
getLogEntryCategoryExamplesSuccessReponsePayloadRT,
LOG_ANALYSIS_GET_LOG_ENTRY_CATEGORY_EXAMPLES_PATH,
} from '../../../../../common/http_api/log_analysis';
-import { createPlainError, throwErrors } from '../../../../../common/runtime_types';
+import { decodeOrThrow } from '../../../../../common/runtime_types';
+
+interface RequestArgs {
+ sourceId: string;
+ startTime: number;
+ endTime: number;
+ categoryId: number;
+ exampleCount: number;
+}
export const callGetLogEntryCategoryExamplesAPI = async (
- sourceId: string,
- startTime: number,
- endTime: number,
- categoryId: number,
- exampleCount: number
+ requestArgs: RequestArgs,
+ fetch: HttpHandler
) => {
- const response = await npStart.http.fetch(LOG_ANALYSIS_GET_LOG_ENTRY_CATEGORY_EXAMPLES_PATH, {
+ const { sourceId, startTime, endTime, categoryId, exampleCount } = requestArgs;
+
+ const response = await fetch(LOG_ANALYSIS_GET_LOG_ENTRY_CATEGORY_EXAMPLES_PATH, {
method: 'POST',
body: JSON.stringify(
getLogEntryCategoryExamplesRequestPayloadRT.encode({
@@ -40,8 +44,5 @@ export const callGetLogEntryCategoryExamplesAPI = async (
),
});
- return pipe(
- getLogEntryCategoryExamplesSuccessReponsePayloadRT.decode(response),
- fold(throwErrors(createPlainError), identity)
- );
+ return decodeOrThrow(getLogEntryCategoryExamplesSuccessReponsePayloadRT)(response);
};
diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/service_calls/get_top_log_entry_categories.ts b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/service_calls/get_top_log_entry_categories.ts
index 2ebcff4fd3ca5..fd53803796339 100644
--- a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/service_calls/get_top_log_entry_categories.ts
+++ b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/service_calls/get_top_log_entry_categories.ts
@@ -4,28 +4,31 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { fold } from 'fp-ts/lib/Either';
-import { pipe } from 'fp-ts/lib/pipeable';
-import { identity } from 'fp-ts/lib/function';
-import { npStart } from '../../../../legacy_singletons';
+import type { HttpHandler } from 'src/core/public';
import {
getLogEntryCategoriesRequestPayloadRT,
getLogEntryCategoriesSuccessReponsePayloadRT,
LOG_ANALYSIS_GET_LOG_ENTRY_CATEGORIES_PATH,
} from '../../../../../common/http_api/log_analysis';
-import { createPlainError, throwErrors } from '../../../../../common/runtime_types';
+import { decodeOrThrow } from '../../../../../common/runtime_types';
+
+interface RequestArgs {
+ sourceId: string;
+ startTime: number;
+ endTime: number;
+ categoryCount: number;
+ datasets?: string[];
+}
export const callGetTopLogEntryCategoriesAPI = async (
- sourceId: string,
- startTime: number,
- endTime: number,
- categoryCount: number,
- datasets?: string[]
+ requestArgs: RequestArgs,
+ fetch: HttpHandler
) => {
+ const { sourceId, startTime, endTime, categoryCount, datasets } = requestArgs;
const intervalDuration = endTime - startTime;
- const response = await npStart.http.fetch(LOG_ANALYSIS_GET_LOG_ENTRY_CATEGORIES_PATH, {
+ const response = await fetch(LOG_ANALYSIS_GET_LOG_ENTRY_CATEGORIES_PATH, {
method: 'POST',
body: JSON.stringify(
getLogEntryCategoriesRequestPayloadRT.encode({
@@ -60,8 +63,5 @@ export const callGetTopLogEntryCategoriesAPI = async (
),
});
- return pipe(
- getLogEntryCategoriesSuccessReponsePayloadRT.decode(response),
- fold(throwErrors(createPlainError), identity)
- );
+ return decodeOrThrow(getLogEntryCategoriesSuccessReponsePayloadRT)(response);
};
diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/use_log_entry_categories_results.ts b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/use_log_entry_categories_results.ts
index 123b188046b85..0a12c433db60a 100644
--- a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/use_log_entry_categories_results.ts
+++ b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/use_log_entry_categories_results.ts
@@ -13,6 +13,7 @@ import {
import { useTrackedPromise, CanceledPromiseError } from '../../../utils/use_tracked_promise';
import { callGetTopLogEntryCategoriesAPI } from './service_calls/get_top_log_entry_categories';
import { callGetLogEntryCategoryDatasetsAPI } from './service_calls/get_log_entry_category_datasets';
+import { useKibanaContextForPlugin } from '../../../hooks/use_kibana';
type TopLogEntryCategories = GetLogEntryCategoriesSuccessResponsePayload['data']['categories'];
type LogEntryCategoryDatasets = GetLogEntryCategoryDatasetsSuccessResponsePayload['data']['datasets'];
@@ -34,6 +35,7 @@ export const useLogEntryCategoriesResults = ({
sourceId: string;
startTime: number;
}) => {
+ const { services } = useKibanaContextForPlugin();
const [topLogEntryCategories, setTopLogEntryCategories] = useState([]);
const [logEntryCategoryDatasets, setLogEntryCategoryDatasets] = useState<
LogEntryCategoryDatasets
@@ -44,11 +46,14 @@ export const useLogEntryCategoriesResults = ({
cancelPreviousOn: 'creation',
createPromise: async () => {
return await callGetTopLogEntryCategoriesAPI(
- sourceId,
- startTime,
- endTime,
- categoriesCount,
- filteredDatasets
+ {
+ sourceId,
+ startTime,
+ endTime,
+ categoryCount: categoriesCount,
+ datasets: filteredDatasets,
+ },
+ services.http.fetch
);
},
onResolve: ({ data: { categories } }) => {
@@ -71,7 +76,10 @@ export const useLogEntryCategoriesResults = ({
{
cancelPreviousOn: 'creation',
createPromise: async () => {
- return await callGetLogEntryCategoryDatasetsAPI(sourceId, startTime, endTime);
+ return await callGetLogEntryCategoryDatasetsAPI(
+ { sourceId, startTime, endTime },
+ services.http.fetch
+ );
},
onResolve: ({ data: { datasets } }) => {
setLogEntryCategoryDatasets(datasets);
diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/use_log_entry_category_examples.tsx b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/use_log_entry_category_examples.tsx
index cdf3b642a8012..84b9f045288cc 100644
--- a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/use_log_entry_category_examples.tsx
+++ b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/use_log_entry_category_examples.tsx
@@ -7,6 +7,7 @@
import { useMemo, useState } from 'react';
import { LogEntryCategoryExample } from '../../../../common/http_api';
+import { useKibanaContextForPlugin } from '../../../hooks/use_kibana';
import { useTrackedPromise } from '../../../utils/use_tracked_promise';
import { callGetLogEntryCategoryExamplesAPI } from './service_calls/get_log_entry_category_examples';
@@ -23,6 +24,8 @@ export const useLogEntryCategoryExamples = ({
sourceId: string;
startTime: number;
}) => {
+ const { services } = useKibanaContextForPlugin();
+
const [logEntryCategoryExamples, setLogEntryCategoryExamples] = useState<
LogEntryCategoryExample[]
>([]);
@@ -32,11 +35,14 @@ export const useLogEntryCategoryExamples = ({
cancelPreviousOn: 'creation',
createPromise: async () => {
return await callGetLogEntryCategoryExamplesAPI(
- sourceId,
- startTime,
- endTime,
- categoryId,
- exampleCount
+ {
+ sourceId,
+ startTime,
+ endTime,
+ categoryId,
+ exampleCount,
+ },
+ services.http.fetch
);
},
onResolve: ({ data: { examples } }) => {
diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/service_calls/get_log_entry_anomalies.ts b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/service_calls/get_log_entry_anomalies.ts
index 21696df566ed9..7f90604bfefdd 100644
--- a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/service_calls/get_log_entry_anomalies.ts
+++ b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/service_calls/get_log_entry_anomalies.ts
@@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { npStart } from '../../../../legacy_singletons';
+import type { HttpHandler } from 'src/core/public';
import {
getLogEntryAnomaliesRequestPayloadRT,
getLogEntryAnomaliesSuccessReponsePayloadRT,
@@ -13,15 +13,18 @@ import {
import { decodeOrThrow } from '../../../../../common/runtime_types';
import { Sort, Pagination } from '../../../../../common/http_api/log_analysis';
-export const callGetLogEntryAnomaliesAPI = async (
- sourceId: string,
- startTime: number,
- endTime: number,
- sort: Sort,
- pagination: Pagination,
- datasets?: string[]
-) => {
- const response = await npStart.http.fetch(LOG_ANALYSIS_GET_LOG_ENTRY_ANOMALIES_PATH, {
+interface RequestArgs {
+ sourceId: string;
+ startTime: number;
+ endTime: number;
+ sort: Sort;
+ pagination: Pagination;
+ datasets?: string[];
+}
+
+export const callGetLogEntryAnomaliesAPI = async (requestArgs: RequestArgs, fetch: HttpHandler) => {
+ const { sourceId, startTime, endTime, sort, pagination, datasets } = requestArgs;
+ const response = await fetch(LOG_ANALYSIS_GET_LOG_ENTRY_ANOMALIES_PATH, {
method: 'POST',
body: JSON.stringify(
getLogEntryAnomaliesRequestPayloadRT.encode({
diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/service_calls/get_log_entry_anomalies_datasets.ts b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/service_calls/get_log_entry_anomalies_datasets.ts
index 24be5a646d103..c62bec691590c 100644
--- a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/service_calls/get_log_entry_anomalies_datasets.ts
+++ b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/service_calls/get_log_entry_anomalies_datasets.ts
@@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { npStart } from '../../../../legacy_singletons';
+import type { HttpHandler } from 'src/core/public';
import { decodeOrThrow } from '../../../../../common/runtime_types';
import {
getLogEntryAnomaliesDatasetsRequestPayloadRT,
@@ -12,12 +12,18 @@ import {
LOG_ANALYSIS_GET_LOG_ENTRY_ANOMALIES_DATASETS_PATH,
} from '../../../../../common/http_api/log_analysis';
+interface RequestArgs {
+ sourceId: string;
+ startTime: number;
+ endTime: number;
+}
+
export const callGetLogEntryAnomaliesDatasetsAPI = async (
- sourceId: string,
- startTime: number,
- endTime: number
+ requestArgs: RequestArgs,
+ fetch: HttpHandler
) => {
- const response = await npStart.http.fetch(LOG_ANALYSIS_GET_LOG_ENTRY_ANOMALIES_DATASETS_PATH, {
+ const { sourceId, startTime, endTime } = requestArgs;
+ const response = await fetch(LOG_ANALYSIS_GET_LOG_ENTRY_ANOMALIES_DATASETS_PATH, {
method: 'POST',
body: JSON.stringify(
getLogEntryAnomaliesDatasetsRequestPayloadRT.encode({
diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/service_calls/get_log_entry_examples.ts b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/service_calls/get_log_entry_examples.ts
index a125b53f9e635..ab724a2f435b2 100644
--- a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/service_calls/get_log_entry_examples.ts
+++ b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/service_calls/get_log_entry_examples.ts
@@ -4,27 +4,27 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { fold } from 'fp-ts/lib/Either';
-import { pipe } from 'fp-ts/lib/pipeable';
-import { identity } from 'fp-ts/lib/function';
-import { npStart } from '../../../../legacy_singletons';
+import type { HttpHandler } from 'src/core/public';
import {
getLogEntryExamplesRequestPayloadRT,
getLogEntryExamplesSuccessReponsePayloadRT,
LOG_ANALYSIS_GET_LOG_ENTRY_RATE_EXAMPLES_PATH,
} from '../../../../../common/http_api/log_analysis';
-import { createPlainError, throwErrors } from '../../../../../common/runtime_types';
+import { decodeOrThrow } from '../../../../../common/runtime_types';
-export const callGetLogEntryExamplesAPI = async (
- sourceId: string,
- startTime: number,
- endTime: number,
- dataset: string,
- exampleCount: number,
- categoryId?: string
-) => {
- const response = await npStart.http.fetch(LOG_ANALYSIS_GET_LOG_ENTRY_RATE_EXAMPLES_PATH, {
+interface RequestArgs {
+ sourceId: string;
+ startTime: number;
+ endTime: number;
+ dataset: string;
+ exampleCount: number;
+ categoryId?: string;
+}
+
+export const callGetLogEntryExamplesAPI = async (requestArgs: RequestArgs, fetch: HttpHandler) => {
+ const { sourceId, startTime, endTime, dataset, exampleCount, categoryId } = requestArgs;
+ const response = await fetch(LOG_ANALYSIS_GET_LOG_ENTRY_RATE_EXAMPLES_PATH, {
method: 'POST',
body: JSON.stringify(
getLogEntryExamplesRequestPayloadRT.encode({
@@ -42,8 +42,5 @@ export const callGetLogEntryExamplesAPI = async (
),
});
- return pipe(
- getLogEntryExamplesSuccessReponsePayloadRT.decode(response),
- fold(throwErrors(createPlainError), identity)
- );
+ return decodeOrThrow(getLogEntryExamplesSuccessReponsePayloadRT)(response);
};
diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/service_calls/get_log_entry_rate.ts b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/service_calls/get_log_entry_rate.ts
index 77111d279309d..c9189bd803955 100644
--- a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/service_calls/get_log_entry_rate.ts
+++ b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/service_calls/get_log_entry_rate.ts
@@ -4,25 +4,25 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { fold } from 'fp-ts/lib/Either';
-import { pipe } from 'fp-ts/lib/pipeable';
-import { identity } from 'fp-ts/lib/function';
-import { npStart } from '../../../../legacy_singletons';
+import type { HttpHandler } from 'src/core/public';
import {
getLogEntryRateRequestPayloadRT,
getLogEntryRateSuccessReponsePayloadRT,
LOG_ANALYSIS_GET_LOG_ENTRY_RATE_PATH,
} from '../../../../../common/http_api/log_analysis';
-import { createPlainError, throwErrors } from '../../../../../common/runtime_types';
+import { decodeOrThrow } from '../../../../../common/runtime_types';
-export const callGetLogEntryRateAPI = async (
- sourceId: string,
- startTime: number,
- endTime: number,
- bucketDuration: number,
- datasets?: string[]
-) => {
- const response = await npStart.http.fetch(LOG_ANALYSIS_GET_LOG_ENTRY_RATE_PATH, {
+interface RequestArgs {
+ sourceId: string;
+ startTime: number;
+ endTime: number;
+ bucketDuration: number;
+ datasets?: string[];
+}
+
+export const callGetLogEntryRateAPI = async (requestArgs: RequestArgs, fetch: HttpHandler) => {
+ const { sourceId, startTime, endTime, bucketDuration, datasets } = requestArgs;
+ const response = await fetch(LOG_ANALYSIS_GET_LOG_ENTRY_RATE_PATH, {
method: 'POST',
body: JSON.stringify(
getLogEntryRateRequestPayloadRT.encode({
@@ -38,8 +38,5 @@ export const callGetLogEntryRateAPI = async (
})
),
});
- return pipe(
- getLogEntryRateSuccessReponsePayloadRT.decode(response),
- fold(throwErrors(createPlainError), identity)
- );
+ return decodeOrThrow(getLogEntryRateSuccessReponsePayloadRT)(response);
};
diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_log_entry_anomalies_results.ts b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_log_entry_anomalies_results.ts
index 52632e54390a9..37c99272f0872 100644
--- a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_log_entry_anomalies_results.ts
+++ b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_log_entry_anomalies_results.ts
@@ -16,6 +16,7 @@ import {
GetLogEntryAnomaliesDatasetsSuccessResponsePayload,
LogEntryAnomaly,
} from '../../../../common/http_api/log_analysis';
+import { useKibanaContextForPlugin } from '../../../hooks/use_kibana';
export type SortOptions = Sort;
export type PaginationOptions = Pick;
@@ -161,6 +162,8 @@ export const useLogEntryAnomaliesResults = ({
};
};
+ const { services } = useKibanaContextForPlugin();
+
const [reducerState, dispatch] = useReducer(stateReducer, STATE_DEFAULTS, initStateReducer);
const [logEntryAnomalies, setLogEntryAnomalies] = useState([]);
@@ -177,15 +180,18 @@ export const useLogEntryAnomaliesResults = ({
filteredDatasets: queryFilteredDatasets,
} = reducerState;
return await callGetLogEntryAnomaliesAPI(
- sourceId,
- queryStartTime,
- queryEndTime,
- sortOptions,
{
- ...paginationOptions,
- cursor: paginationCursor,
+ sourceId,
+ startTime: queryStartTime,
+ endTime: queryEndTime,
+ sort: sortOptions,
+ pagination: {
+ ...paginationOptions,
+ cursor: paginationCursor,
+ },
+ datasets: queryFilteredDatasets,
},
- queryFilteredDatasets
+ services.http.fetch
);
},
onResolve: ({ data: { anomalies, paginationCursors: requestCursors, hasMoreEntries } }) => {
@@ -286,7 +292,10 @@ export const useLogEntryAnomaliesResults = ({
{
cancelPreviousOn: 'creation',
createPromise: async () => {
- return await callGetLogEntryAnomaliesDatasetsAPI(sourceId, startTime, endTime);
+ return await callGetLogEntryAnomaliesDatasetsAPI(
+ { sourceId, startTime, endTime },
+ services.http.fetch
+ );
},
onResolve: ({ data: { datasets } }) => {
setLogEntryAnomaliesDatasets(datasets);
diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_log_entry_examples.ts b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_log_entry_examples.ts
index fae5bd200a415..e809ab9cd5a6f 100644
--- a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_log_entry_examples.ts
+++ b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_log_entry_examples.ts
@@ -7,6 +7,7 @@
import { useMemo, useState } from 'react';
import { LogEntryExample } from '../../../../common/http_api';
+import { useKibanaContextForPlugin } from '../../../hooks/use_kibana';
import { useTrackedPromise } from '../../../utils/use_tracked_promise';
import { callGetLogEntryExamplesAPI } from './service_calls/get_log_entry_examples';
@@ -25,6 +26,7 @@ export const useLogEntryExamples = ({
startTime: number;
categoryId?: string;
}) => {
+ const { services } = useKibanaContextForPlugin();
const [logEntryExamples, setLogEntryExamples] = useState([]);
const [getLogEntryExamplesRequest, getLogEntryExamples] = useTrackedPromise(
@@ -32,12 +34,15 @@ export const useLogEntryExamples = ({
cancelPreviousOn: 'creation',
createPromise: async () => {
return await callGetLogEntryExamplesAPI(
- sourceId,
- startTime,
- endTime,
- dataset,
- exampleCount,
- categoryId
+ {
+ sourceId,
+ startTime,
+ endTime,
+ dataset,
+ exampleCount,
+ categoryId,
+ },
+ services.http.fetch
);
},
onResolve: ({ data: { examples } }) => {
diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_log_entry_rate_results.ts b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_log_entry_rate_results.ts
index a52dab58cb018..aef94afa505f1 100644
--- a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_log_entry_rate_results.ts
+++ b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_log_entry_rate_results.ts
@@ -12,6 +12,7 @@ import {
LogEntryRatePartition,
LogEntryRateAnomaly,
} from '../../../../common/http_api/log_analysis';
+import { useKibanaContextForPlugin } from '../../../hooks/use_kibana';
import { useTrackedPromise } from '../../../utils/use_tracked_promise';
import { callGetLogEntryRateAPI } from './service_calls/get_log_entry_rate';
@@ -49,6 +50,7 @@ export const useLogEntryRateResults = ({
bucketDuration: number;
filteredDatasets?: string[];
}) => {
+ const { services } = useKibanaContextForPlugin();
const [logEntryRate, setLogEntryRate] = useState(null);
const [getLogEntryRateRequest, getLogEntryRate] = useTrackedPromise(
@@ -56,11 +58,14 @@ export const useLogEntryRateResults = ({
cancelPreviousOn: 'resolution',
createPromise: async () => {
return await callGetLogEntryRateAPI(
- sourceId,
- startTime,
- endTime,
- bucketDuration,
- filteredDatasets
+ {
+ sourceId,
+ startTime,
+ endTime,
+ bucketDuration,
+ datasets: filteredDatasets,
+ },
+ services.http.fetch
);
},
onResolve: ({ data }) => {
diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomoly_detection_flyout.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomoly_detection_flyout.tsx
index b063713fa2c97..b5d224910e819 100644
--- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomoly_detection_flyout.tsx
+++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomoly_detection_flyout.tsx
@@ -50,10 +50,10 @@ export const AnomalyDetectionFlyout = () => {
return (
<>
-
+
{showFlyout && (
diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/flyout_home.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/flyout_home.tsx
index 801dff9c4a17a..5b520084ebb74 100644
--- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/flyout_home.tsx
+++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/flyout_home.tsx
@@ -5,7 +5,7 @@
*/
import React, { useState, useCallback, useEffect } from 'react';
-import { EuiFlyoutHeader, EuiTitle, EuiFlyoutBody, EuiTabs, EuiTab, EuiSpacer } from '@elastic/eui';
+import { EuiFlyoutHeader, EuiTitle, EuiFlyoutBody, EuiSpacer } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { EuiText, EuiFlexGroup, EuiFlexItem, EuiCard, EuiIcon } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
@@ -30,7 +30,7 @@ interface Props {
}
export const FlyoutHome = (props: Props) => {
- const [tab, setTab] = useState<'jobs' | 'anomalies'>('jobs');
+ const [tab] = useState<'jobs' | 'anomalies'>('jobs');
const { goToSetup } = props;
const {
fetchJobStatus: fetchHostJobStatus,
@@ -56,18 +56,10 @@ export const FlyoutHome = (props: Props) => {
goToSetup('kubernetes');
}, [goToSetup]);
- const goToJobs = useCallback(() => {
- setTab('jobs');
- }, []);
-
const jobIds = [
...(k8sJobSummaries || []).map((k) => k.id),
...(hostJobSummaries || []).map((h) => h.id),
];
- const anomaliesUrl = useLinkProps({
- app: 'ml',
- pathname: `/explorer?_g=${createResultsUrl(jobIds)}`,
- });
useEffect(() => {
if (hasInfraMLReadCapabilities) {
@@ -105,30 +97,24 @@ export const FlyoutHome = (props: Props) => {
-
-
-
-
-
-
-
-
+
+
{hostJobSummaries.length > 0 && (
<>
0}
hasK8sJobs={k8sJobSummaries.length > 0}
+ jobIds={jobIds}
/>
>
@@ -151,6 +137,7 @@ export const FlyoutHome = (props: Props) => {
interface CalloutProps {
hasHostJobs: boolean;
hasK8sJobs: boolean;
+ jobIds: string[];
}
const JobsEnabledCallout = (props: CalloutProps) => {
let target = '';
@@ -175,8 +162,34 @@ const JobsEnabledCallout = (props: CalloutProps) => {
pathname: '/jobs',
});
+ const anomaliesUrl = useLinkProps({
+ app: 'ml',
+ pathname: `/explorer?_g=${createResultsUrl(props.jobIds)}`,
+ });
+
return (
<>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{
}
iconType="check"
/>
-
-
-
-
>
);
};
@@ -211,30 +217,11 @@ interface CreateJobTab {
const CreateJobTab = (props: CreateJobTab) => {
return (
<>
-
-
-
+ {/* */}
}
// title="Hosts"
title={
@@ -245,7 +232,7 @@ const CreateJobTab = (props: CreateJobTab) => {
}
description={
}
@@ -254,7 +241,7 @@ const CreateJobTab = (props: CreateJobTab) => {
{props.hasHostJobs && (
@@ -262,7 +249,7 @@ const CreateJobTab = (props: CreateJobTab) => {
{!props.hasHostJobs && (
@@ -273,7 +260,7 @@ const CreateJobTab = (props: CreateJobTab) => {
}
title={
{
}
description={
}
@@ -292,7 +279,7 @@ const CreateJobTab = (props: CreateJobTab) => {
{props.hasK8sJobs && (
@@ -300,7 +287,7 @@ const CreateJobTab = (props: CreateJobTab) => {
{!props.hasK8sJobs && (
diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/job_setup_screen.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/job_setup_screen.tsx
index 428c002da6383..c327d187f6bc2 100644
--- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/job_setup_screen.tsx
+++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/job_setup_screen.tsx
@@ -20,6 +20,7 @@ import { useSourceViaHttp } from '../../../../../../containers/source/use_source
import { useMetricK8sModuleContext } from '../../../../../../containers/ml/modules/metrics_k8s/module';
import { useMetricHostsModuleContext } from '../../../../../../containers/ml/modules/metrics_hosts/module';
import { FixedDatePicker } from '../../../../../../components/fixed_datepicker';
+import { DEFAULT_K8S_PARTITION_FIELD } from '../../../../../../containers/ml/modules/metrics_k8s/module_descriptor';
interface Props {
jobType: 'hosts' | 'kubernetes';
@@ -107,7 +108,7 @@ export const JobSetupScreen = (props: Props) => {
useEffect(() => {
if (props.jobType === 'kubernetes') {
- setPartitionField(['kubernetes.namespace']);
+ setPartitionField([DEFAULT_K8S_PARTITION_FIELD]);
}
}, [props.jobType]);
diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_metrics_hosts_anomalies.ts b/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_metrics_hosts_anomalies.ts
index f33e3ea16b389..02170f41a32ca 100644
--- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_metrics_hosts_anomalies.ts
+++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_metrics_hosts_anomalies.ts
@@ -5,6 +5,7 @@
*/
import { useMemo, useState, useCallback, useEffect, useReducer } from 'react';
+import { HttpHandler } from 'src/core/public';
import {
INFA_ML_GET_METRICS_HOSTS_ANOMALIES_PATH,
Metric,
@@ -16,8 +17,8 @@ import {
getMetricsHostsAnomaliesSuccessReponsePayloadRT,
} from '../../../../../common/http_api/infra_ml';
import { useTrackedPromise } from '../../../../utils/use_tracked_promise';
-import { npStart } from '../../../../legacy_singletons';
import { decodeOrThrow } from '../../../../../common/runtime_types';
+import { useKibanaContextForPlugin } from '../../../../hooks/use_kibana';
export type SortOptions = Sort;
export type PaginationOptions = Pick;
@@ -149,6 +150,7 @@ export const useMetricsHostsAnomaliesResults = ({
onGetMetricsHostsAnomaliesDatasetsError?: (error: Error) => void;
filteredDatasets?: string[];
}) => {
+ const { services } = useKibanaContextForPlugin();
const initStateReducer = (stateDefaults: ReducerStateDefaults): ReducerState => {
return {
...stateDefaults,
@@ -177,15 +179,18 @@ export const useMetricsHostsAnomaliesResults = ({
paginationCursor,
} = reducerState;
return await callGetMetricHostsAnomaliesAPI(
- sourceId,
- queryStartTime,
- queryEndTime,
- metric,
- sortOptions,
{
- ...paginationOptions,
- cursor: paginationCursor,
- }
+ sourceId,
+ startTime: queryStartTime,
+ endTime: queryEndTime,
+ metric,
+ sort: sortOptions,
+ pagination: {
+ ...paginationOptions,
+ cursor: paginationCursor,
+ },
+ },
+ services.http.fetch
);
},
onResolve: ({ data: { anomalies, paginationCursors: requestCursors, hasMoreEntries } }) => {
@@ -288,15 +293,21 @@ export const useMetricsHostsAnomaliesResults = ({
};
};
+interface RequestArgs {
+ sourceId: string;
+ startTime: number;
+ endTime: number;
+ metric: Metric;
+ sort: Sort;
+ pagination: Pagination;
+}
+
export const callGetMetricHostsAnomaliesAPI = async (
- sourceId: string,
- startTime: number,
- endTime: number,
- metric: Metric,
- sort: Sort,
- pagination: Pagination
+ requestArgs: RequestArgs,
+ fetch: HttpHandler
) => {
- const response = await npStart.http.fetch(INFA_ML_GET_METRICS_HOSTS_ANOMALIES_PATH, {
+ const { sourceId, startTime, endTime, metric, sort, pagination } = requestArgs;
+ const response = await fetch(INFA_ML_GET_METRICS_HOSTS_ANOMALIES_PATH, {
method: 'POST',
body: JSON.stringify(
getMetricsHostsAnomaliesRequestPayloadRT.encode({
diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_metrics_k8s_anomalies.ts b/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_metrics_k8s_anomalies.ts
index 89e70c4c5c4c7..951951b9b6106 100644
--- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_metrics_k8s_anomalies.ts
+++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_metrics_k8s_anomalies.ts
@@ -5,6 +5,7 @@
*/
import { useMemo, useState, useCallback, useEffect, useReducer } from 'react';
+import { HttpHandler } from 'src/core/public';
import {
Sort,
Pagination,
@@ -16,8 +17,8 @@ import {
Metric,
} from '../../../../../common/http_api/infra_ml';
import { useTrackedPromise } from '../../../../utils/use_tracked_promise';
-import { npStart } from '../../../../legacy_singletons';
import { decodeOrThrow } from '../../../../../common/runtime_types';
+import { useKibanaContextForPlugin } from '../../../../hooks/use_kibana';
export type SortOptions = Sort;
export type PaginationOptions = Pick;
@@ -149,6 +150,7 @@ export const useMetricsK8sAnomaliesResults = ({
onGetMetricsHostsAnomaliesDatasetsError?: (error: Error) => void;
filteredDatasets?: string[];
}) => {
+ const { services } = useKibanaContextForPlugin();
const initStateReducer = (stateDefaults: ReducerStateDefaults): ReducerState => {
return {
...stateDefaults,
@@ -178,16 +180,19 @@ export const useMetricsK8sAnomaliesResults = ({
filteredDatasets: queryFilteredDatasets,
} = reducerState;
return await callGetMetricsK8sAnomaliesAPI(
- sourceId,
- queryStartTime,
- queryEndTime,
- metric,
- sortOptions,
{
- ...paginationOptions,
- cursor: paginationCursor,
+ sourceId,
+ startTime: queryStartTime,
+ endTime: queryEndTime,
+ metric,
+ sort: sortOptions,
+ pagination: {
+ ...paginationOptions,
+ cursor: paginationCursor,
+ },
+ datasets: queryFilteredDatasets,
},
- queryFilteredDatasets
+ services.http.fetch
);
},
onResolve: ({ data: { anomalies, paginationCursors: requestCursors, hasMoreEntries } }) => {
@@ -290,16 +295,22 @@ export const useMetricsK8sAnomaliesResults = ({
};
};
+interface RequestArgs {
+ sourceId: string;
+ startTime: number;
+ endTime: number;
+ metric: Metric;
+ sort: Sort;
+ pagination: Pagination;
+ datasets?: string[];
+}
+
export const callGetMetricsK8sAnomaliesAPI = async (
- sourceId: string,
- startTime: number,
- endTime: number,
- metric: Metric,
- sort: Sort,
- pagination: Pagination,
- datasets?: string[]
+ requestArgs: RequestArgs,
+ fetch: HttpHandler
) => {
- const response = await npStart.http.fetch(INFA_ML_GET_METRICS_K8S_ANOMALIES_PATH, {
+ const { sourceId, startTime, endTime, metric, sort, pagination, datasets } = requestArgs;
+ const response = await fetch(INFA_ML_GET_METRICS_K8S_ANOMALIES_PATH, {
method: 'POST',
body: JSON.stringify(
getMetricsK8sAnomaliesRequestPayloadRT.encode({
diff --git a/x-pack/plugins/infra/public/plugin.ts b/x-pack/plugins/infra/public/plugin.ts
index 3c6b1a14cfd47..0e49ca93010fd 100644
--- a/x-pack/plugins/infra/public/plugin.ts
+++ b/x-pack/plugins/infra/public/plugin.ts
@@ -9,7 +9,6 @@ import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/public';
import { createMetricThresholdAlertType } from './alerting/metric_threshold';
import { createInventoryMetricAlertType } from './alerting/inventory';
import { getAlertType as getLogsAlertType } from './alerting/log_threshold';
-import { registerStartSingleton } from './legacy_singletons';
import { registerFeatures } from './register_feature';
import {
InfraClientSetupDeps,
@@ -98,9 +97,7 @@ export class Plugin implements InfraClientPluginClass {
});
}
- start(core: InfraClientCoreStart, _plugins: InfraClientStartDeps) {
- registerStartSingleton(core);
- }
+ start(_core: InfraClientCoreStart, _plugins: InfraClientStartDeps) {}
stop() {}
}
diff --git a/x-pack/plugins/ingest_manager/common/constants/agent.ts b/x-pack/plugins/ingest_manager/common/constants/agent.ts
index 82d2ad712ef02..30b8a6b740609 100644
--- a/x-pack/plugins/ingest_manager/common/constants/agent.ts
+++ b/x-pack/plugins/ingest_manager/common/constants/agent.ts
@@ -13,10 +13,12 @@ export const AGENT_TYPE_EPHEMERAL = 'EPHEMERAL';
export const AGENT_TYPE_TEMPORARY = 'TEMPORARY';
export const AGENT_POLLING_REQUEST_TIMEOUT_MS = 300000; // 5 minutes
+export const AGENT_POLLING_REQUEST_TIMEOUT_MARGIN_MS = 20000; // 20s
+
export const AGENT_POLLING_THRESHOLD_MS = 30000;
export const AGENT_POLLING_INTERVAL = 1000;
export const AGENT_UPDATE_LAST_CHECKIN_INTERVAL_MS = 30000;
export const AGENT_UPDATE_ACTIONS_INTERVAL_MS = 5000;
-export const AGENT_POLICY_ROLLOUT_RATE_LIMIT_INTERVAL_MS = 5000;
-export const AGENT_POLICY_ROLLOUT_RATE_LIMIT_REQUEST_PER_INTERVAL = 25;
+export const AGENT_POLICY_ROLLOUT_RATE_LIMIT_INTERVAL_MS = 1000;
+export const AGENT_POLICY_ROLLOUT_RATE_LIMIT_REQUEST_PER_INTERVAL = 5;
diff --git a/x-pack/plugins/ingest_manager/server/constants/index.ts b/x-pack/plugins/ingest_manager/server/constants/index.ts
index 3965e27da0542..c69ee7e4b6092 100644
--- a/x-pack/plugins/ingest_manager/server/constants/index.ts
+++ b/x-pack/plugins/ingest_manager/server/constants/index.ts
@@ -8,6 +8,7 @@ export {
AGENT_TYPE_EPHEMERAL,
AGENT_TYPE_TEMPORARY,
AGENT_POLLING_THRESHOLD_MS,
+ AGENT_POLLING_REQUEST_TIMEOUT_MARGIN_MS,
AGENT_POLLING_INTERVAL,
AGENT_UPDATE_LAST_CHECKIN_INTERVAL_MS,
AGENT_POLICY_ROLLOUT_RATE_LIMIT_REQUEST_PER_INTERVAL,
diff --git a/x-pack/plugins/ingest_manager/server/services/agents/checkin/rxjs_utils.test.ts b/x-pack/plugins/ingest_manager/server/services/agents/checkin/rxjs_utils.test.ts
index 5e84e3a50bb44..2909899418ec2 100644
--- a/x-pack/plugins/ingest_manager/server/services/agents/checkin/rxjs_utils.test.ts
+++ b/x-pack/plugins/ingest_manager/server/services/agents/checkin/rxjs_utils.test.ts
@@ -15,9 +15,13 @@ describe('createRateLimiter', () => {
scheduler.run(({ expectObservable, cold }) => {
const source = cold('a-b-c-d-e-f|');
- const rateLimiter = createRateLimiter(10, 1, 2, scheduler);
+ const intervalMs = 10;
+ const perInterval = 1;
+ const maxDelayMs = 50;
+ const rateLimiter = createRateLimiter(intervalMs, perInterval, maxDelayMs, scheduler);
const obs = source.pipe(rateLimiter());
- const results = 'a 9ms b 9ms c 9ms d 9ms e 9ms (f|)';
+ // f should be dropped because of maxDelay
+ const results = 'a 9ms b 9ms c 9ms d 9ms (e|)';
expectObservable(obs).toBe(results);
});
});
diff --git a/x-pack/plugins/ingest_manager/server/services/agents/checkin/rxjs_utils.ts b/x-pack/plugins/ingest_manager/server/services/agents/checkin/rxjs_utils.ts
index 3bbfbbd4ec1bf..bbdaa9975eeac 100644
--- a/x-pack/plugins/ingest_manager/server/services/agents/checkin/rxjs_utils.ts
+++ b/x-pack/plugins/ingest_manager/server/services/agents/checkin/rxjs_utils.ts
@@ -54,6 +54,8 @@ export function createRateLimiter(
let countInCurrentInterval = 0;
function createRateLimitOperator(): Rx.OperatorFunction {
+ const maxIntervalEnd = scheduler.now() + maxDelay;
+
return Rx.pipe(
concatMap(function rateLimit(value: T) {
const now = scheduler.now();
@@ -61,9 +63,9 @@ export function createRateLimiter(
countInCurrentInterval = 1;
intervalEnd = now + ratelimitIntervalMs;
return Rx.of(value);
- } else if (intervalEnd >= now + maxDelay) {
- // re-rate limit in the future to avoid to schedule too far in the future as some observer can unsubscribe
- return Rx.of(value).pipe(delay(maxDelay, scheduler), createRateLimitOperator());
+ } else if (intervalEnd >= maxIntervalEnd) {
+ // drop the value as it's never going to success as long polling timeout is going to happen before we can send the policy
+ return Rx.EMPTY;
} else {
if (++countInCurrentInterval > ratelimitRequestPerInterval) {
countInCurrentInterval = 1;
diff --git a/x-pack/plugins/ingest_manager/server/services/agents/checkin/state_new_actions.ts b/x-pack/plugins/ingest_manager/server/services/agents/checkin/state_new_actions.ts
index 51ccdc8eb1c7c..8ae151577fefa 100644
--- a/x-pack/plugins/ingest_manager/server/services/agents/checkin/state_new_actions.ts
+++ b/x-pack/plugins/ingest_manager/server/services/agents/checkin/state_new_actions.ts
@@ -27,6 +27,7 @@ import * as APIKeysService from '../../api_keys';
import {
AGENT_SAVED_OBJECT_TYPE,
AGENT_UPDATE_ACTIONS_INTERVAL_MS,
+ AGENT_POLLING_REQUEST_TIMEOUT_MARGIN_MS,
AGENT_POLICY_ROLLOUT_RATE_LIMIT_INTERVAL_MS,
AGENT_POLICY_ROLLOUT_RATE_LIMIT_REQUEST_PER_INTERVAL,
} from '../../../constants';
@@ -38,8 +39,6 @@ import {
import { appContextService } from '../../app_context';
import { toPromiseAbortable, AbortError, createRateLimiter } from './rxjs_utils';
-const RATE_LIMIT_MAX_DELAY_MS = 5 * 60 * 1000; // 5 minutes
-
function getInternalUserSOClient() {
const fakeRequest = ({
headers: {},
@@ -166,19 +165,29 @@ export async function createAgentActionFromPolicyAction(
return [newAgentAction];
}
+function getPollingTimeoutMs() {
+ const pollingTimeoutMs = appContextService.getConfig()?.fleet.pollingRequestTimeout ?? 0;
+ // Set a timeout 20s before the real timeout to have a chance to respond an empty response before socket timeout
+ return Math.max(
+ pollingTimeoutMs - AGENT_POLLING_REQUEST_TIMEOUT_MARGIN_MS,
+ AGENT_POLLING_REQUEST_TIMEOUT_MARGIN_MS
+ );
+}
+
export function agentCheckinStateNewActionsFactory() {
// Shared Observables
const agentPolicies$ = new Map>();
const newActions$ = createNewActionsSharedObservable();
// Rx operators
- const pollingTimeoutMs = appContextService.getConfig()?.fleet.pollingRequestTimeout ?? 0;
+ const pollingTimeoutMs = getPollingTimeoutMs();
+
const rateLimiterIntervalMs =
appContextService.getConfig()?.fleet.agentPolicyRolloutRateLimitIntervalMs ??
AGENT_POLICY_ROLLOUT_RATE_LIMIT_INTERVAL_MS;
const rateLimiterRequestPerInterval =
appContextService.getConfig()?.fleet.agentPolicyRolloutRateLimitRequestPerInterval ??
AGENT_POLICY_ROLLOUT_RATE_LIMIT_REQUEST_PER_INTERVAL;
- const rateLimiterMaxDelay = Math.min(RATE_LIMIT_MAX_DELAY_MS, pollingTimeoutMs);
+ const rateLimiterMaxDelay = pollingTimeoutMs;
const rateLimiter = createRateLimiter(
rateLimiterIntervalMs,
@@ -204,10 +213,7 @@ export function agentCheckinStateNewActionsFactory() {
}
const stream$ = agentPolicy$.pipe(
- timeout(
- // Set a timeout 3s before the real timeout to have a chance to respond an empty response before socket timeout
- Math.max(pollingTimeoutMs - 3000, 3000)
- ),
+ timeout(pollingTimeoutMs),
filter(
(action) =>
agent.policy_id !== undefined &&
diff --git a/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx b/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx
index f6234d063d8cd..9162af52052ee 100644
--- a/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx
+++ b/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx
@@ -30,24 +30,22 @@ export function getLensTopNavConfig(options: {
defaultMessage: 'Save',
});
- if (showSaveAndReturn) {
+ if (showCancel) {
topNavMenu.push({
- label: i18n.translate('xpack.lens.app.saveAndReturn', {
- defaultMessage: 'Save and return',
+ label: i18n.translate('xpack.lens.app.cancel', {
+ defaultMessage: 'cancel',
}),
- emphasize: true,
- iconType: 'check',
- run: actions.saveAndReturn,
- testId: 'lnsApp_saveAndReturnButton',
- disableButton: !savingPermitted,
- description: i18n.translate('xpack.lens.app.saveAndReturnButtonAriaLabel', {
- defaultMessage: 'Save the current lens visualization and return to the last app',
+ run: actions.cancel,
+ testId: 'lnsApp_cancelButton',
+ description: i18n.translate('xpack.lens.app.cancelButtonAriaLabel', {
+ defaultMessage: 'Return to the last app without saving changes',
}),
});
}
topNavMenu.push({
label: saveButtonLabel,
+ iconType: !showSaveAndReturn ? 'save' : undefined,
emphasize: !showSaveAndReturn,
run: actions.showSaveModal,
testId: 'lnsApp_saveButton',
@@ -57,17 +55,21 @@ export function getLensTopNavConfig(options: {
disableButton: !savingPermitted,
});
- if (showCancel) {
+ if (showSaveAndReturn) {
topNavMenu.push({
- label: i18n.translate('xpack.lens.app.cancel', {
- defaultMessage: 'cancel',
+ label: i18n.translate('xpack.lens.app.saveAndReturn', {
+ defaultMessage: 'Save and return',
}),
- run: actions.cancel,
- testId: 'lnsApp_cancelButton',
- description: i18n.translate('xpack.lens.app.cancelButtonAriaLabel', {
- defaultMessage: 'Return to the last app without saving changes',
+ emphasize: true,
+ iconType: 'checkInCircleFilled',
+ run: actions.saveAndReturn,
+ testId: 'lnsApp_saveAndReturnButton',
+ disableButton: !savingPermitted,
+ description: i18n.translate('xpack.lens.app.saveAndReturnButtonAriaLabel', {
+ defaultMessage: 'Save the current lens visualization and return to the last app',
}),
});
}
+
return topNavMenu;
}
diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx
index 2a5798ac6a70c..3993b4ffc02b0 100644
--- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx
+++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx
@@ -208,27 +208,22 @@ export function InnerWorkspacePanel({
>
- {expression === null ? (
-
- ) : (
-
- )}
+ {expression === null
+ ? i18n.translate('xpack.lens.editorFrame.emptyWorkspace', {
+ defaultMessage: 'Drop some fields here to start',
+ })
+ : i18n.translate('xpack.lens.editorFrame.emptyWorkspaceSimple', {
+ defaultMessage: 'Drop field here',
+ })}
{expression === null && (
<>
-
+ {i18n.translate('xpack.lens.editorFrame.emptyWorkspaceHeading', {
+ defaultMessage: 'Lens is a new tool for creating visualization',
+ })}
@@ -237,10 +232,9 @@ export function InnerWorkspacePanel({
target="_blank"
external
>
-
+ {i18n.translate('xpack.lens.editorFrame.goToForums', {
+ defaultMessage: 'Make requests and give feedback',
+ })}
diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/advanced_editor.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/advanced_editor.tsx
index a6756df403ba7..16b861ae034fa 100644
--- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/advanced_editor.tsx
+++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/advanced_editor.tsx
@@ -132,11 +132,11 @@ export const RangePopover = ({
{
const newRange = {
...tempRange,
- to: target.value !== '' ? Number(target.value) : -Infinity,
+ to: target.value !== '' ? Number(target.value) : Infinity,
};
setTempRange(newRange);
saveRangeAndReset(newRange);
diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/ranges.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/ranges.test.tsx
index 2409406afcdbc..fb6cf6df8573f 100644
--- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/ranges.test.tsx
+++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/ranges.test.tsx
@@ -485,7 +485,7 @@ describe('ranges', () => {
/>
);
- // This series of act clojures are made to make it work properly the update flush
+ // This series of act closures are made to make it work properly the update flush
act(() => {
instance.find(RangePopover).find(EuiLink).prop('onClick')!({} as ReactMouseEvent);
});
@@ -550,6 +550,46 @@ describe('ranges', () => {
expect(instance.find(RangePopover)).toHaveLength(1);
});
});
+
+ it('should handle correctly open ranges when saved', () => {
+ const setStateSpy = jest.fn();
+
+ // Add an extra open range:
+ (state.layers.first.columns.col1 as RangeIndexPatternColumn).params.ranges.push({
+ from: null,
+ to: null,
+ label: '',
+ });
+
+ const instance = mount(
+
+ );
+
+ act(() => {
+ instance.find(RangePopover).last().find(EuiLink).prop('onClick')!({} as ReactMouseEvent);
+ });
+
+ act(() => {
+ // need another wrapping for this in order to work
+ instance.update();
+
+ // Check UI values for open ranges
+ expect(
+ instance.find(RangePopover).last().find(EuiFieldNumber).first().prop('value')
+ ).toBe('');
+
+ expect(instance.find(RangePopover).last().find(EuiFieldNumber).last().prop('value')).toBe(
+ ''
+ );
+ });
+ });
});
});
});
diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/ranges.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/ranges.tsx
index a59780ef59939..a8304456262eb 100644
--- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/ranges.tsx
+++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/ranges.tsx
@@ -16,7 +16,13 @@ import { updateColumnParam, changeColumn } from '../../../state_helpers';
import { MODES, AUTO_BARS, DEFAULT_INTERVAL, MIN_HISTOGRAM_BARS, SLICES } from './constants';
type RangeType = Omit;
-export type RangeTypeLens = RangeType & { label: string };
+// Try to cover all possible serialized states for ranges
+export type RangeTypeLens = (RangeType | { from: Range['from'] | null; to: Range['to'] | null }) & {
+ label: string;
+};
+
+// This is a subset of RangeTypeLens which has both from and to defined
+type FullRangeTypeLens = Extract>;
export type MODES_TYPES = typeof MODES[keyof typeof MODES];
@@ -35,10 +41,13 @@ export type UpdateParamsFnType = (
value: RangeColumnParams[K]
) => void;
-export const isValidNumber = (value: number | '') =>
- value !== '' && !isNaN(value) && isFinite(value);
-export const isRangeWithin = (range: RangeTypeLens): boolean => range.from <= range.to;
-const isFullRange = ({ from, to }: RangeType) => isValidNumber(from) && isValidNumber(to);
+// on initialization values can be null (from the Infinity serialization), so handle it correctly
+// or they will be casted to 0 by the editor ( see #78867 )
+export const isValidNumber = (value: number | '' | null): value is number =>
+ value != null && value !== '' && !isNaN(value) && isFinite(value);
+export const isRangeWithin = (range: RangeType): boolean => range.from <= range.to;
+const isFullRange = (range: RangeTypeLens): range is FullRangeTypeLens =>
+ isValidNumber(range.from) && isValidNumber(range.to);
export const isValidRange = (range: RangeTypeLens): boolean => {
if (isFullRange(range)) {
return isRangeWithin(range);
diff --git a/x-pack/plugins/lens/public/xy_visualization/expression.test.tsx b/x-pack/plugins/lens/public/xy_visualization/expression.test.tsx
index 3bd6cc73d6320..405491ddc372a 100644
--- a/x-pack/plugins/lens/public/xy_visualization/expression.test.tsx
+++ b/x-pack/plugins/lens/public/xy_visualization/expression.test.tsx
@@ -751,7 +751,7 @@ describe('xy_expression', () => {
});
test('onElementClick returns correct context data', () => {
- const geometry: GeometryValue = { x: 5, y: 1, accessor: 'y1', mark: null };
+ const geometry: GeometryValue = { x: 5, y: 1, accessor: 'y1', mark: null, datum: {} };
const series = {
key: 'spec{d}yAccessor{d}splitAccessors{b-2}',
specId: 'd',
@@ -896,7 +896,12 @@ describe('xy_expression', () => {
test('it applies histogram mode to the series for single series', () => {
const { data, args } = sampleArgs();
- const firstLayer: LayerArgs = { ...args.layers[0], seriesType: 'bar', isHistogram: true };
+ const firstLayer: LayerArgs = {
+ ...args.layers[0],
+ accessors: ['b'],
+ seriesType: 'bar',
+ isHistogram: true,
+ };
delete firstLayer.splitAccessor;
const component = shallow(
{
/>
);
expect(component.find(BarSeries).at(0).prop('enableHistogramMode')).toEqual(true);
- expect(component.find(BarSeries).at(1).prop('enableHistogramMode')).toEqual(true);
+ });
+
+ test('it does not apply histogram mode to more than one bar series for unstacked bar chart', () => {
+ const { data, args } = sampleArgs();
+ const firstLayer: LayerArgs = { ...args.layers[0], seriesType: 'bar', isHistogram: true };
+ delete firstLayer.splitAccessor;
+ const component = shallow(
+
+ );
+ expect(component.find(BarSeries).at(0).prop('enableHistogramMode')).toEqual(false);
+ expect(component.find(BarSeries).at(1).prop('enableHistogramMode')).toEqual(false);
+ });
+
+ test('it applies histogram mode to more than one the series for unstacked line/area chart', () => {
+ const { data, args } = sampleArgs();
+ const firstLayer: LayerArgs = { ...args.layers[0], seriesType: 'line', isHistogram: true };
+ delete firstLayer.splitAccessor;
+ const secondLayer: LayerArgs = { ...args.layers[0], seriesType: 'line', isHistogram: true };
+ delete secondLayer.splitAccessor;
+ const component = shallow(
+
+ );
+ expect(component.find(LineSeries).at(0).prop('enableHistogramMode')).toEqual(true);
+ expect(component.find(LineSeries).at(1).prop('enableHistogramMode')).toEqual(true);
});
test('it applies histogram mode to the series for stacked series', () => {
diff --git a/x-pack/plugins/lens/public/xy_visualization/expression.tsx b/x-pack/plugins/lens/public/xy_visualization/expression.tsx
index f36525a9a0b14..a59739ec78f7f 100644
--- a/x-pack/plugins/lens/public/xy_visualization/expression.tsx
+++ b/x-pack/plugins/lens/public/xy_visualization/expression.tsx
@@ -299,6 +299,13 @@ export function XYChart({
yRight: true,
};
+ const filteredBarLayers = filteredLayers.filter((layer) => layer.seriesType.includes('bar'));
+
+ const chartHasMoreThanOneBarSeries =
+ filteredBarLayers.length > 1 ||
+ filteredBarLayers.some((layer) => layer.accessors.length > 1) ||
+ filteredBarLayers.some((layer) => layer.splitAccessor);
+
function calculateMinInterval() {
// check all the tables to see if all of the rows have the same timestamp
// that would mean that chart will draw a single bar
@@ -599,7 +606,12 @@ export function XYChart({
groupId: yAxesConfiguration.find((axisConfiguration) =>
axisConfiguration.series.find((currentSeries) => currentSeries.accessor === accessor)
)?.groupId,
- enableHistogramMode: isHistogram && (seriesType.includes('stacked') || !splitAccessor),
+ enableHistogramMode:
+ isHistogram &&
+ (seriesType.includes('stacked') || !splitAccessor) &&
+ (seriesType.includes('stacked') ||
+ !seriesType.includes('bar') ||
+ !chartHasMoreThanOneBarSeries),
stackMode: seriesType.includes('percentage') ? StackMode.Percentage : undefined,
timeZone,
areaSeriesStyle: {
diff --git a/x-pack/plugins/lens/server/routes/existing_fields.test.ts b/x-pack/plugins/lens/server/routes/existing_fields.test.ts
index 9799dcf92ae41..c877e69d7b0dd 100644
--- a/x-pack/plugins/lens/server/routes/existing_fields.test.ts
+++ b/x-pack/plugins/lens/server/routes/existing_fields.test.ts
@@ -14,99 +14,55 @@ describe('existingFields', () => {
return {
name,
isScript: false,
- isAlias: false,
isMeta: false,
- path: name.split('.'),
...obj,
};
}
- function indexPattern(_source: unknown, fields: unknown = {}) {
- return { _source, fields };
+ function searchResults(fields: Record = {}) {
+ return { fields };
}
it('should handle root level fields', () => {
const result = existingFields(
- [indexPattern({ foo: 'bar' }), indexPattern({ baz: 0 })],
+ [searchResults({ foo: ['bar'] }), searchResults({ baz: [0] })],
[field('foo'), field('bar'), field('baz')]
);
expect(result).toEqual(['foo', 'baz']);
});
- it('should handle arrays of objects', () => {
+ it('should handle basic arrays, ignoring empty ones', () => {
const result = existingFields(
- [indexPattern({ stuff: [{ foo: 'bar' }, { baz: 0 }] })],
- [field('stuff.foo'), field('stuff.bar'), field('stuff.baz')]
+ [searchResults({ stuff: ['heyo', 'there'], empty: [] })],
+ [field('stuff'), field('empty')]
);
- expect(result).toEqual(['stuff.foo', 'stuff.baz']);
- });
-
- it('should handle basic arrays', () => {
- const result = existingFields([indexPattern({ stuff: ['heyo', 'there'] })], [field('stuff')]);
-
expect(result).toEqual(['stuff']);
});
- it('should handle deep object structures', () => {
- const result = existingFields(
- [indexPattern({ geo: { coordinates: { lat: 40, lon: -77 } } })],
- [field('geo.coordinates')]
- );
-
- expect(result).toEqual(['geo.coordinates']);
- });
-
it('should handle objects with dotted fields', () => {
const result = existingFields(
- [indexPattern({ 'geo.country_name': 'US' })],
+ [searchResults({ 'geo.country_name': ['US'] })],
[field('geo.country_name')]
);
expect(result).toEqual(['geo.country_name']);
});
- it('should handle arrays with dotted fields on both sides', () => {
- const result = existingFields(
- [indexPattern({ 'process.cpu': [{ 'user.pct': 50 }] })],
- [field('process.cpu.user.pct')]
- );
-
- expect(result).toEqual(['process.cpu.user.pct']);
- });
-
- it('should be false if it hits a positive leaf before the end of the path', () => {
- const result = existingFields(
- [indexPattern({ geo: { coordinates: 32 } })],
- [field('geo.coordinates.lat')]
- );
-
- expect(result).toEqual([]);
- });
-
- it('should use path, not name', () => {
- const result = existingFields(
- [indexPattern({ stuff: [{ foo: 'bar' }, { baz: 0 }] })],
- [field({ name: 'goober', path: ['stuff', 'foo'] })]
- );
-
- expect(result).toEqual(['goober']);
- });
-
it('supports scripted fields', () => {
const result = existingFields(
- [indexPattern({}, { bar: 'scriptvalue' })],
- [field({ name: 'baz', isScript: true, path: ['bar'] })]
+ [searchResults({ bar: ['scriptvalue'] })],
+ [field({ name: 'bar', isScript: true })]
);
- expect(result).toEqual(['baz']);
+ expect(result).toEqual(['bar']);
});
it('supports meta fields', () => {
const result = existingFields(
- [{ _mymeta: 'abc', ...indexPattern({}, { bar: 'scriptvalue' }) }],
- [field({ name: '_mymeta', isMeta: true, path: ['_mymeta'] })]
+ [{ _mymeta: 'abc', ...searchResults({ bar: ['scriptvalue'] }) }],
+ [field({ name: '_mymeta', isMeta: true })]
);
expect(result).toEqual(['_mymeta']);
@@ -132,81 +88,22 @@ describe('buildFieldList', () => {
references: [],
};
- const mappings = {
- testpattern: {
- mappings: {
- properties: {
- '@bar': {
- type: 'alias',
- path: 'bar',
- },
- },
- },
- },
- };
-
- const fieldDescriptors = [
- {
- name: 'baz',
- subType: { multi: { parent: 'a.b.c' } },
- },
- ];
-
- it('uses field descriptors to determine the path', () => {
- const fields = buildFieldList(indexPattern, mappings, fieldDescriptors, []);
- expect(fields.find((f) => f.name === 'baz')).toMatchObject({
- isAlias: false,
- isScript: false,
- name: 'baz',
- path: ['a', 'b', 'c'],
- });
- });
-
- it('uses aliases to determine the path', () => {
- const fields = buildFieldList(indexPattern, mappings, fieldDescriptors, []);
- expect(fields.find((f) => f.isAlias)).toMatchObject({
- isAlias: true,
- isScript: false,
- name: '@bar',
- path: ['bar'],
- });
- });
-
it('supports scripted fields', () => {
- const fields = buildFieldList(indexPattern, mappings, fieldDescriptors, []);
+ const fields = buildFieldList(indexPattern, []);
expect(fields.find((f) => f.isScript)).toMatchObject({
- isAlias: false,
isScript: true,
name: 'foo',
- path: ['foo'],
lang: 'painless',
script: '2+2',
});
});
it('supports meta fields', () => {
- const fields = buildFieldList(indexPattern, mappings, fieldDescriptors, ['_mymeta']);
+ const fields = buildFieldList(indexPattern, ['_mymeta']);
expect(fields.find((f) => f.isMeta)).toMatchObject({
- isAlias: false,
isScript: false,
isMeta: true,
name: '_mymeta',
- path: ['_mymeta'],
- });
- });
-
- it('handles missing mappings', () => {
- const fields = buildFieldList(indexPattern, {}, fieldDescriptors, []);
- expect(fields.every((f) => f.isAlias === false)).toEqual(true);
- });
-
- it('handles empty fieldDescriptors by skipping multi-mappings', () => {
- const fields = buildFieldList(indexPattern, mappings, [], []);
- expect(fields.find((f) => f.name === 'baz')).toMatchObject({
- isAlias: false,
- isScript: false,
- name: 'baz',
- path: ['baz'],
});
});
});
diff --git a/x-pack/plugins/lens/server/routes/existing_fields.ts b/x-pack/plugins/lens/server/routes/existing_fields.ts
index 33fcafacfad73..c925517b572da 100644
--- a/x-pack/plugins/lens/server/routes/existing_fields.ts
+++ b/x-pack/plugins/lens/server/routes/existing_fields.ts
@@ -9,36 +9,17 @@ import { schema } from '@kbn/config-schema';
import { ILegacyScopedClusterClient, SavedObject, RequestHandlerContext } from 'src/core/server';
import { CoreSetup } from 'src/core/server';
import { BASE_API_URL } from '../../common';
-import {
- IndexPatternsFetcher,
- IndexPatternAttributes,
- UI_SETTINGS,
-} from '../../../../../src/plugins/data/server';
+import { IndexPatternAttributes, UI_SETTINGS } from '../../../../../src/plugins/data/server';
/**
* The number of docs to sample to determine field empty status.
*/
const SAMPLE_SIZE = 500;
-interface MappingResult {
- [indexPatternTitle: string]: {
- mappings: {
- properties: Record;
- };
- };
-}
-
-interface FieldDescriptor {
- name: string;
- subType?: { multi?: { parent?: string } };
-}
-
export interface Field {
name: string;
isScript: boolean;
- isAlias: boolean;
isMeta: boolean;
- path: string[];
lang?: string;
script?: string;
}
@@ -105,14 +86,12 @@ async function fetchFieldExistence({
timeFieldName?: string;
}) {
const metaFields: string[] = await context.core.uiSettings.client.get(UI_SETTINGS.META_FIELDS);
- const {
- indexPattern,
- indexPatternTitle,
- mappings,
- fieldDescriptors,
- } = await fetchIndexPatternDefinition(indexPatternId, context, metaFields);
+ const { indexPattern, indexPatternTitle } = await fetchIndexPatternDefinition(
+ indexPatternId,
+ context
+ );
- const fields = buildFieldList(indexPattern, mappings, fieldDescriptors, metaFields);
+ const fields = buildFieldList(indexPattern, metaFields);
const docs = await fetchIndexPatternStats({
fromDate,
toDate,
@@ -129,51 +108,17 @@ async function fetchFieldExistence({
};
}
-async function fetchIndexPatternDefinition(
- indexPatternId: string,
- context: RequestHandlerContext,
- metaFields: string[]
-) {
+async function fetchIndexPatternDefinition(indexPatternId: string, context: RequestHandlerContext) {
const savedObjectsClient = context.core.savedObjects.client;
- const requestClient = context.core.elasticsearch.legacy.client;
const indexPattern = await savedObjectsClient.get(
'index-pattern',
indexPatternId
);
const indexPatternTitle = indexPattern.attributes.title;
- if (indexPatternTitle.includes(':')) {
- // Cross cluster search patterns include a colon, and we aren't able to fetch
- // mapping information.
- return {
- indexPattern,
- indexPatternTitle,
- mappings: {},
- fieldDescriptors: [],
- };
- }
-
- // TODO: maybe don't use IndexPatternsFetcher at all, since we're only using it
- // to look up field values in the resulting documents. We can accomplish the same
- // using the mappings which we're also fetching here.
- const indexPatternsFetcher = new IndexPatternsFetcher(requestClient.callAsCurrentUser);
- const [mappings, fieldDescriptors] = await Promise.all([
- requestClient.callAsCurrentUser('indices.getMapping', {
- index: indexPatternTitle,
- }),
-
- indexPatternsFetcher.getFieldsForWildcard({
- pattern: indexPatternTitle,
- // TODO: Pull this from kibana advanced settings
- metaFields,
- }),
- ]);
-
return {
indexPattern,
indexPatternTitle,
- mappings,
- fieldDescriptors,
};
}
@@ -182,32 +127,13 @@ async function fetchIndexPatternDefinition(
*/
export function buildFieldList(
indexPattern: SavedObject,
- mappings: MappingResult | {},
- fieldDescriptors: FieldDescriptor[],
metaFields: string[]
): Field[] {
- const aliasMap = Object.entries(Object.values(mappings)[0]?.mappings.properties ?? {})
- .map(([name, v]) => ({ ...v, name }))
- .filter((f) => f.type === 'alias')
- .reduce((acc, f) => {
- acc[f.name] = f.path;
- return acc;
- }, {} as Record);
-
- const descriptorMap = fieldDescriptors.reduce((acc, f) => {
- acc[f.name] = f;
- return acc;
- }, {} as Record);
-
return JSON.parse(indexPattern.attributes.fields).map(
(field: { name: string; lang: string; scripted?: boolean; script?: string }) => {
- const path =
- aliasMap[field.name] || descriptorMap[field.name]?.subType?.multi?.parent || field.name;
return {
name: field.name,
isScript: !!field.scripted,
- isAlias: !!aliasMap[field.name],
- path: path.split('.'),
lang: field.lang,
script: field.script,
// id is a special case - it doesn't show up in the meta field list,
@@ -263,8 +189,8 @@ async function fetchIndexPatternStats({
size: SAMPLE_SIZE,
query,
sort: timeFieldName && fromDate && toDate ? [{ [timeFieldName]: 'desc' }] : [],
- // _source is required because we are also providing script fields.
- _source: '*',
+ fields: ['*'],
+ _source: false,
script_fields: scriptedFields.reduce((acc, field) => {
acc[field.name] = {
script: {
@@ -279,49 +205,11 @@ async function fetchIndexPatternStats({
return result.hits.hits;
}
-// Recursive function to determine if the _source of a document
-// contains a known path.
-function exists(obj: unknown, path: string[], i = 0): boolean {
- if (obj == null) {
- return false;
- }
-
- if (path.length === i) {
- return true;
- }
-
- if (Array.isArray(obj)) {
- return obj.some((child) => exists(child, path, i));
- }
-
- if (typeof obj === 'object') {
- // Because Elasticsearch flattens paths, dots in the field name are allowed
- // as JSON keys. For example, { 'a.b': 10 }
- const partialKeyMatches = Object.getOwnPropertyNames(obj)
- .map((key) => key.split('.'))
- .filter((keyPaths) => keyPaths.every((key, keyIndex) => key === path[keyIndex + i]));
-
- if (partialKeyMatches.length) {
- return partialKeyMatches.every((keyPaths) => {
- return exists(
- (obj as Record)[keyPaths.join('.')],
- path,
- i + keyPaths.length
- );
- });
- }
-
- return exists((obj as Record)[path[i]], path, i + 1);
- }
-
- return path.length === i;
-}
-
/**
* Exported only for unit tests.
*/
export function existingFields(
- docs: Array<{ _source: unknown; fields: unknown; [key: string]: unknown }>,
+ docs: Array<{ fields: Record; [key: string]: unknown }>,
fields: Field[]
): string[] {
const missingFields = new Set(fields);
@@ -332,14 +220,14 @@ export function existingFields(
}
missingFields.forEach((field) => {
- let fieldStore = doc._source;
- if (field.isScript) {
- fieldStore = doc.fields;
- }
+ let fieldStore: Record = doc.fields;
if (field.isMeta) {
fieldStore = doc;
}
- if (exists(fieldStore, field.path)) {
+ const value = fieldStore[field.name];
+ if (Array.isArray(value) && value.length) {
+ missingFields.delete(field);
+ } else if (!Array.isArray(value) && value) {
missingFields.delete(field);
}
});
diff --git a/x-pack/plugins/maps/common/constants.ts b/x-pack/plugins/maps/common/constants.ts
index be891b6e59608..469a4023434a8 100644
--- a/x-pack/plugins/maps/common/constants.ts
+++ b/x-pack/plugins/maps/common/constants.ts
@@ -5,6 +5,7 @@
*/
import { i18n } from '@kbn/i18n';
import { FeatureCollection } from 'geojson';
+
export const EMS_APP_NAME = 'kibana';
export const EMS_CATALOGUE_PATH = 'ems/catalogue';
diff --git a/x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.ts b/x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.ts
index f3521cca2e456..16b60492c9b78 100644
--- a/x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.ts
+++ b/x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.ts
@@ -38,15 +38,21 @@ export type VectorSourceRequestMeta = MapFilters & {
applyGlobalQuery: boolean;
fieldNames: string[];
geogridPrecision?: number;
- sourceQuery: MapQuery;
+ sourceQuery?: MapQuery;
sourceMeta: VectorSourceSyncMeta;
};
+export type VectorJoinSourceRequestMeta = MapFilters & {
+ applyGlobalQuery: boolean;
+ fieldNames: string[];
+ sourceQuery: MapQuery;
+};
+
export type VectorStyleRequestMeta = MapFilters & {
dynamicStyleFields: string[];
isTimeAware: boolean;
sourceQuery: MapQuery;
- timeFilters: unknown;
+ timeFilters: TimeRange;
};
export type ESSearchSourceResponseMeta = {
@@ -59,9 +65,12 @@ export type ESSearchSourceResponseMeta = {
};
// Partial because objects are justified downstream in constructors
-export type DataMeta = Partial &
- Partial &
- Partial;
+export type DataMeta = Partial<
+ VectorSourceRequestMeta &
+ VectorJoinSourceRequestMeta &
+ VectorStyleRequestMeta &
+ ESSearchSourceResponseMeta
+>;
type NumericalStyleFieldData = {
avg: number;
diff --git a/x-pack/plugins/maps/common/descriptor_types/map_descriptor.ts b/x-pack/plugins/maps/common/descriptor_types/map_descriptor.ts
index d064dfb1c4a37..b769b125cf0f8 100644
--- a/x-pack/plugins/maps/common/descriptor_types/map_descriptor.ts
+++ b/x-pack/plugins/maps/common/descriptor_types/map_descriptor.ts
@@ -17,7 +17,7 @@ export type MapExtent = {
};
export type MapQuery = Query & {
- queryLastTriggeredAt: string;
+ queryLastTriggeredAt?: string;
};
export type MapRefreshConfig = {
diff --git a/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts b/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts
index 7828c3cc6410b..f157ffe9f1c80 100644
--- a/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts
+++ b/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts
@@ -33,8 +33,10 @@ export function addFieldToDSL(dsl: object, field: IFieldType) {
};
}
+export type BucketProperties = Record;
+
export function extractPropertiesFromBucket(bucket: any, ignoreKeys: string[] = []) {
- const properties: Record = {};
+ const properties: BucketProperties = {};
for (const key in bucket) {
if (ignoreKeys.includes(key) || !bucket.hasOwnProperty(key)) {
continue;
diff --git a/x-pack/plugins/maps/public/actions/data_request_actions.ts b/x-pack/plugins/maps/public/actions/data_request_actions.ts
index 14d8196900506..d7d9259e1539e 100644
--- a/x-pack/plugins/maps/public/actions/data_request_actions.ts
+++ b/x-pack/plugins/maps/public/actions/data_request_actions.ts
@@ -47,7 +47,7 @@ const FIT_TO_BOUNDS_SCALE_FACTOR = 0.1;
export type DataRequestContext = {
startLoading(dataId: string, requestToken: symbol, meta: DataMeta): void;
- stopLoading(dataId: string, requestToken: symbol, data: object, meta: DataMeta): void;
+ stopLoading(dataId: string, requestToken: symbol, data: object, meta?: DataMeta): void;
onLoadError(dataId: string, requestToken: symbol, errorMessage: string): void;
updateSourceData(newData: unknown): void;
isRequestStillActive(dataId: string, requestToken: symbol): boolean;
diff --git a/x-pack/plugins/maps/public/actions/layer_actions.test.ts b/x-pack/plugins/maps/public/actions/layer_actions.test.ts
new file mode 100644
index 0000000000000..09a22dca271d7
--- /dev/null
+++ b/x-pack/plugins/maps/public/actions/layer_actions.test.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;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { addLayer } from './layer_actions';
+import { LayerDescriptor } from '../../common/descriptor_types';
+import { LICENSED_FEATURES } from '../licensed_features';
+
+const getStoreMock = jest.fn();
+const dispatchMock = jest.fn();
+
+describe('layer_actions', () => {
+ afterEach(() => {
+ jest.resetAllMocks();
+ });
+
+ describe('addLayer', () => {
+ const notifyLicensedFeatureUsageMock = jest.fn();
+
+ beforeEach(() => {
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
+ require('../licensed_features').notifyLicensedFeatureUsage = (feature: LICENSED_FEATURES) => {
+ notifyLicensedFeatureUsageMock(feature);
+ };
+
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
+ require('../selectors/map_selectors').getMapReady = () => {
+ return true;
+ };
+
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
+ require('../selectors/map_selectors').createLayerInstance = () => {
+ return {
+ getLicensedFeatures() {
+ return [LICENSED_FEATURES.GEO_SHAPE_AGGS_GEO_TILE];
+ },
+ };
+ };
+ });
+
+ it('should register feature-use', async () => {
+ const action = addLayer(({} as unknown) as LayerDescriptor);
+ await action(dispatchMock, getStoreMock);
+ expect(notifyLicensedFeatureUsageMock).toHaveBeenCalledWith(
+ LICENSED_FEATURES.GEO_SHAPE_AGGS_GEO_TILE
+ );
+ });
+ });
+});
diff --git a/x-pack/plugins/maps/public/actions/layer_actions.ts b/x-pack/plugins/maps/public/actions/layer_actions.ts
index 675bb14722889..19c9adfadd45a 100644
--- a/x-pack/plugins/maps/public/actions/layer_actions.ts
+++ b/x-pack/plugins/maps/public/actions/layer_actions.ts
@@ -14,6 +14,7 @@ import {
getSelectedLayerId,
getMapReady,
getMapColors,
+ createLayerInstance,
} from '../selectors/map_selectors';
import { FLYOUT_STATE } from '../reducers/ui';
import { cancelRequest } from '../reducers/non_serializable_instances';
@@ -42,6 +43,7 @@ import { ILayer } from '../classes/layers/layer';
import { IVectorLayer } from '../classes/layers/vector_layer/vector_layer';
import { LAYER_STYLE_TYPE, LAYER_TYPE } from '../../common/constants';
import { IVectorStyle } from '../classes/styles/vector/vector_style';
+import { notifyLicensedFeatureUsage } from '../licensed_features';
export function trackCurrentLayerState(layerId: string) {
return {
@@ -108,7 +110,7 @@ export function cloneLayer(layerId: string) {
}
export function addLayer(layerDescriptor: LayerDescriptor) {
- return (dispatch: Dispatch, getState: () => MapStoreState) => {
+ return async (dispatch: Dispatch, getState: () => MapStoreState) => {
const isMapReady = getMapReady(getState());
if (!isMapReady) {
dispatch({
@@ -123,6 +125,10 @@ export function addLayer(layerDescriptor: LayerDescriptor) {
layer: layerDescriptor,
});
dispatch(syncDataForLayerId(layerDescriptor.id));
+
+ const layer = createLayerInstance(layerDescriptor);
+ const features = await layer.getLicensedFeatures();
+ features.forEach(notifyLicensedFeatureUsage);
};
}
diff --git a/x-pack/plugins/maps/public/classes/joins/inner_join.d.ts b/x-pack/plugins/maps/public/classes/joins/inner_join.d.ts
index befff0965fb70..3e2ceac4971c4 100644
--- a/x-pack/plugins/maps/public/classes/joins/inner_join.d.ts
+++ b/x-pack/plugins/maps/public/classes/joins/inner_join.d.ts
@@ -4,19 +4,40 @@
* you may not use this file except in compliance with the Elastic License.
*/
+import { Feature, GeoJsonProperties } from 'geojson';
import { IESTermSource } from '../sources/es_term_source';
-import { IJoin } from './join';
+import { IJoin, PropertiesMap } from './join';
import { JoinDescriptor } from '../../../common/descriptor_types';
import { ISource } from '../sources/source';
+import { ITooltipProperty } from '../tooltips/tooltip_property';
+import { IField } from '../fields/field';
export class InnerJoin implements IJoin {
constructor(joinDescriptor: JoinDescriptor, leftSource: ISource);
+ destroy: () => void;
+
getRightJoinSource(): IESTermSource;
toDescriptor(): JoinDescriptor;
+ getJoinFields: () => IField[];
+
+ getLeftField: () => IField;
+
+ getIndexPatternIds: () => string[];
+
+ getQueryableIndexPatternIds: () => string[];
+
+ getSourceDataRequestId: () => string;
+
getSourceMetaDataRequestId(): string;
getSourceFormattersDataRequestId(): string;
+
+ getTooltipProperties(properties: GeoJsonProperties): Promise;
+
+ hasCompleteConfig: () => boolean;
+
+ joinPropertiesToFeature: (feature: Feature, propertiesMap?: PropertiesMap) => boolean;
}
diff --git a/x-pack/plugins/maps/public/classes/joins/join.ts b/x-pack/plugins/maps/public/classes/joins/join.ts
index 5bcc4bfdec87e..df6f6f684f4d2 100644
--- a/x-pack/plugins/maps/public/classes/joins/join.ts
+++ b/x-pack/plugins/maps/public/classes/joins/join.ts
@@ -4,15 +4,39 @@
* you may not use this file except in compliance with the Elastic License.
*/
+import { Feature, GeoJsonProperties } from 'geojson';
import { IESTermSource } from '../sources/es_term_source';
import { JoinDescriptor } from '../../../common/descriptor_types';
+import { ITooltipProperty } from '../tooltips/tooltip_property';
+import { IField } from '../fields/field';
+import { BucketProperties } from '../../../common/elasticsearch_util';
+
+export type PropertiesMap = Map;
export interface IJoin {
- getRightJoinSource(): IESTermSource;
+ destroy: () => void;
+
+ getRightJoinSource: () => IESTermSource;
+
+ toDescriptor: () => JoinDescriptor;
+
+ getJoinFields: () => IField[];
+
+ getLeftField: () => IField;
+
+ getIndexPatternIds: () => string[];
+
+ getQueryableIndexPatternIds: () => string[];
+
+ getSourceDataRequestId: () => string;
+
+ getSourceMetaDataRequestId: () => string;
+
+ getSourceFormattersDataRequestId: () => string;
- toDescriptor(): JoinDescriptor;
+ getTooltipProperties: (properties: GeoJsonProperties) => Promise;
- getSourceMetaDataRequestId(): string;
+ hasCompleteConfig: () => boolean;
- getSourceFormattersDataRequestId(): string;
+ joinPropertiesToFeature: (feature: Feature, propertiesMap?: PropertiesMap) => boolean;
}
diff --git a/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts b/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts
index 90e8d25a77958..65a76f0c54ffb 100644
--- a/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts
+++ b/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts
@@ -37,8 +37,8 @@ import {
LayerDescriptor,
VectorLayerDescriptor,
} from '../../../../common/descriptor_types';
-import { IStyle } from '../../styles/style';
import { IVectorSource } from '../../sources/vector_source';
+import { LICENSED_FEATURES } from '../../../licensed_features';
const ACTIVE_COUNT_DATA_ID = 'ACTIVE_COUNT_DATA_ID';
@@ -257,7 +257,7 @@ export class BlendedVectorLayer extends VectorLayer implements IVectorLayer {
return clonedDescriptor;
}
- getSource() {
+ getSource(): IVectorSource {
return this._isClustered ? this._clusterSource : this._documentSource;
}
@@ -268,11 +268,11 @@ export class BlendedVectorLayer extends VectorLayer implements IVectorLayer {
return this._documentSource;
}
- getCurrentStyle(): IStyle {
+ getCurrentStyle(): IVectorStyle {
return this._isClustered ? this._clusterStyle : this._documentStyle;
}
- getStyleForEditing(): IStyle {
+ getStyleForEditing(): IVectorStyle {
return this._documentStyle;
}
@@ -281,8 +281,8 @@ export class BlendedVectorLayer extends VectorLayer implements IVectorLayer {
const requestToken = Symbol(`layer-active-count:${this.getId()}`);
const searchFilters = this._getSearchFilters(
syncContext.dataFilters,
- this.getSource() as IVectorSource,
- this.getCurrentStyle() as IVectorStyle
+ this.getSource(),
+ this.getCurrentStyle()
);
const canSkipFetch = await canSkipSourceUpdate({
source: this.getSource(),
@@ -328,4 +328,11 @@ export class BlendedVectorLayer extends VectorLayer implements IVectorLayer {
super._syncData(syncContext, activeSource, activeStyle);
}
+
+ async getLicensedFeatures(): Promise {
+ return [
+ ...(await this._clusterSource.getLicensedFeatures()),
+ ...(await this._documentSource.getLicensedFeatures()),
+ ];
+ }
}
diff --git a/x-pack/plugins/maps/public/classes/layers/heatmap_layer/heatmap_layer.js b/x-pack/plugins/maps/public/classes/layers/heatmap_layer/heatmap_layer.js
index adcc86b9d1546..33e82db79f3cf 100644
--- a/x-pack/plugins/maps/public/classes/layers/heatmap_layer/heatmap_layer.js
+++ b/x-pack/plugins/maps/public/classes/layers/heatmap_layer/heatmap_layer.js
@@ -31,6 +31,18 @@ export class HeatmapLayer extends VectorLayer {
}
}
+ getStyleForEditing() {
+ return this._style;
+ }
+
+ getStyle() {
+ return this._style;
+ }
+
+ getCurrentStyle() {
+ return this._style;
+ }
+
_getPropKeyOfSelectedMetric() {
const metricfields = this.getSource().getMetricFields();
return metricfields[0].getName();
diff --git a/x-pack/plugins/maps/public/classes/layers/layer.test.ts b/x-pack/plugins/maps/public/classes/layers/layer.test.ts
index 7bc91d71f83e2..76df7c2af840a 100644
--- a/x-pack/plugins/maps/public/classes/layers/layer.test.ts
+++ b/x-pack/plugins/maps/public/classes/layers/layer.test.ts
@@ -7,7 +7,6 @@
import { AbstractLayer } from './layer';
import { ISource } from '../sources/source';
-import { IStyle } from '../styles/style';
import { AGG_TYPE, FIELD_ORIGIN, LAYER_STYLE_TYPE, VECTOR_STYLES } from '../../../common/constants';
import { ESTermSourceDescriptor, VectorStyleDescriptor } from '../../../common/descriptor_types';
import { getDefaultDynamicProperties } from '../styles/vector/vector_style_defaults';
@@ -38,8 +37,6 @@ class MockSource {
}
}
-class MockStyle {}
-
describe('cloneDescriptor', () => {
describe('with joins', () => {
const styleDescriptor = {
@@ -84,7 +81,6 @@ describe('cloneDescriptor', () => {
const layer = new MockLayer({
layerDescriptor,
source: (new MockSource() as unknown) as ISource,
- style: (new MockStyle() as unknown) as IStyle,
});
const clonedDescriptor = await layer.cloneDescriptor();
const clonedStyleProps = (clonedDescriptor.style as VectorStyleDescriptor).properties;
@@ -122,7 +118,6 @@ describe('cloneDescriptor', () => {
const layer = new MockLayer({
layerDescriptor,
source: (new MockSource() as unknown) as ISource,
- style: (new MockStyle() as unknown) as IStyle,
});
const clonedDescriptor = await layer.cloneDescriptor();
const clonedStyleProps = (clonedDescriptor.style as VectorStyleDescriptor).properties;
@@ -165,7 +160,6 @@ describe('isFittable', () => {
const layer = new MockLayer({
layerDescriptor,
source: (new MockSource({ fitToBounds: test.fitToBounds }) as unknown) as ISource,
- style: (new MockStyle() as unknown) as IStyle,
});
expect(await layer.isFittable()).toBe(test.canFit);
});
diff --git a/x-pack/plugins/maps/public/classes/layers/layer.tsx b/x-pack/plugins/maps/public/classes/layers/layer.tsx
index cd720063c6703..d7fd5d34a9dd0 100644
--- a/x-pack/plugins/maps/public/classes/layers/layer.tsx
+++ b/x-pack/plugins/maps/public/classes/layers/layer.tsx
@@ -34,6 +34,7 @@ import { Attribution, ImmutableSourceProperty, ISource, SourceEditorArgs } from
import { DataRequestContext } from '../../actions';
import { IStyle } from '../styles/style';
import { getJoinAggKey } from '../../../common/get_agg_key';
+import { LICENSED_FEATURES } from '../../licensed_features';
export interface ILayer {
getBounds(dataRequestContext: DataRequestContext): Promise;
@@ -91,6 +92,7 @@ export interface ILayer {
showJoinEditor(): boolean;
getJoinsDisabledReason(): string | null;
isFittable(): Promise;
+ getLicensedFeatures(): Promise;
}
export type Footnote = {
icon: ReactElement;
@@ -110,13 +112,11 @@ export type CustomIconAndTooltipContent = {
export interface ILayerArguments {
layerDescriptor: LayerDescriptor;
source: ISource;
- style: IStyle;
}
export class AbstractLayer implements ILayer {
protected readonly _descriptor: LayerDescriptor;
protected readonly _source: ISource;
- protected readonly _style: IStyle;
protected readonly _dataRequests: DataRequest[];
static createDescriptor(options: Partial): LayerDescriptor {
@@ -140,10 +140,9 @@ export class AbstractLayer implements ILayer {
}
}
- constructor({ layerDescriptor, source, style }: ILayerArguments) {
+ constructor({ layerDescriptor, source }: ILayerArguments) {
this._descriptor = AbstractLayer.createDescriptor(layerDescriptor);
this._source = source;
- this._style = style;
if (this._descriptor.__dataRequests) {
this._dataRequests = this._descriptor.__dataRequests.map(
(dataRequest) => new DataRequest(dataRequest)
@@ -257,11 +256,15 @@ export class AbstractLayer implements ILayer {
}
getStyleForEditing(): IStyle {
- return this._style;
+ throw new Error('Should implement AbstractLayer#getStyleForEditing');
}
- getStyle() {
- return this._style;
+ getStyle(): IStyle {
+ throw new Error('Should implement AbstractLayer#getStyle');
+ }
+
+ getCurrentStyle(): IStyle {
+ throw new Error('Should implement AbstractLayer#getCurrentStyle');
}
getLabel(): string {
@@ -412,10 +415,6 @@ export class AbstractLayer implements ILayer {
return this._descriptor.query ? this._descriptor.query : null;
}
- getCurrentStyle(): IStyle {
- return this._style;
- }
-
async getImmutableSourceProperties() {
const source = this.getSource();
return await source.getImmutableProperties();
@@ -541,4 +540,8 @@ export class AbstractLayer implements ILayer {
supportsLabelsOnTop(): boolean {
return false;
}
+
+ async getLicensedFeatures(): Promise {
+ return [];
+ }
}
diff --git a/x-pack/plugins/maps/public/classes/layers/tile_layer/tile_layer.js b/x-pack/plugins/maps/public/classes/layers/tile_layer/tile_layer.js
index 3e2009c24a2e4..fa60017f0eaf7 100644
--- a/x-pack/plugins/maps/public/classes/layers/tile_layer/tile_layer.js
+++ b/x-pack/plugins/maps/public/classes/layers/tile_layer/tile_layer.js
@@ -21,7 +21,20 @@ export class TileLayer extends AbstractLayer {
}
constructor({ source, layerDescriptor }) {
- super({ source, layerDescriptor, style: new TileStyle() });
+ super({ source, layerDescriptor });
+ this._style = new TileStyle();
+ }
+
+ getStyleForEditing() {
+ return this._style;
+ }
+
+ getStyle() {
+ return this._style;
+ }
+
+ getCurrentStyle() {
+ return this._style;
}
async syncData({ startLoading, stopLoading, onLoadError, dataFilters }) {
diff --git a/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/tiled_vector_layer.tsx b/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/tiled_vector_layer.tsx
index 70bf8ea3883b7..68b9f2931f398 100644
--- a/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/tiled_vector_layer.tsx
+++ b/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/tiled_vector_layer.tsx
@@ -5,9 +5,14 @@
*/
import React from 'react';
+import {
+ Map as MbMap,
+ GeoJSONSource as MbGeoJSONSource,
+ VectorSource as MbVectorSource,
+} from 'mapbox-gl';
import { EuiIcon } from '@elastic/eui';
import { Feature } from 'geojson';
-import { VectorStyle } from '../../styles/vector/vector_style';
+import { IVectorStyle, VectorStyle } from '../../styles/vector/vector_style';
import { SOURCE_DATA_REQUEST_ID, LAYER_TYPE } from '../../../../common/constants';
import { VectorLayer, VectorLayerArguments } from '../vector_layer/vector_layer';
import { ITiledSingleLayerVectorSource } from '../../sources/vector_source';
@@ -59,7 +64,7 @@ export class TiledVectorLayer extends VectorLayer {
const searchFilters: VectorSourceRequestMeta = this._getSearchFilters(
dataFilters,
this.getSource(),
- this._style
+ this._style as IVectorStyle
);
const prevDataRequest = this.getSourceDataRequest();
@@ -88,13 +93,12 @@ export class TiledVectorLayer extends VectorLayer {
}
async syncData(syncContext: DataRequestContext) {
- await this._syncSourceStyleMeta(syncContext, this._source, this._style);
- await this._syncSourceFormatters(syncContext, this._source, this._style);
+ await this._syncSourceStyleMeta(syncContext, this._source, this._style as IVectorStyle);
+ await this._syncSourceFormatters(syncContext, this._source, this._style as IVectorStyle);
await this._syncMVTUrlTemplate(syncContext);
}
- _syncSourceBindingWithMb(mbMap: unknown) {
- // @ts-expect-error
+ _syncSourceBindingWithMb(mbMap: MbMap) {
const mbSource = mbMap.getSource(this._getMbSourceId());
if (mbSource) {
return;
@@ -113,7 +117,6 @@ export class TiledVectorLayer extends VectorLayer {
}
const mbSourceId = this._getMbSourceId();
- // @ts-expect-error
mbMap.addSource(mbSourceId, {
type: 'vector',
tiles: [sourceMeta.urlTemplate],
@@ -126,7 +129,7 @@ export class TiledVectorLayer extends VectorLayer {
return this._getMbSourceId() === mbSourceId;
}
- _syncStylePropertiesWithMb(mbMap: unknown) {
+ _syncStylePropertiesWithMb(mbMap: MbMap) {
// @ts-ignore
const mbSource = mbMap.getSource(this._getMbSourceId());
if (!mbSource) {
@@ -146,12 +149,16 @@ export class TiledVectorLayer extends VectorLayer {
this._setMbLinePolygonProperties(mbMap, sourceMeta.layerName);
}
- _requiresPrevSourceCleanup(mbMap: unknown): boolean {
- // @ts-expect-error
- const mbTileSource = mbMap.getSource(this._getMbSourceId());
- if (!mbTileSource) {
+ _requiresPrevSourceCleanup(mbMap: MbMap): boolean {
+ const mbSource = mbMap.getSource(this._getMbSourceId()) as MbVectorSource | MbGeoJSONSource;
+ if (!mbSource) {
return false;
}
+ if (!('tiles' in mbSource)) {
+ // Expected source is not compatible, so remove.
+ return true;
+ }
+ const mbTileSource = mbSource as MbVectorSource;
const dataRequest = this.getSourceDataRequest();
if (!dataRequest) {
@@ -163,13 +170,8 @@ export class TiledVectorLayer extends VectorLayer {
return false;
}
- if (!mbTileSource.tiles) {
- // Expected source is not compatible, so remove.
- return true;
- }
-
const isSourceDifferent =
- mbTileSource.tiles[0] !== tiledSourceMeta.urlTemplate ||
+ mbTileSource.tiles?.[0] !== tiledSourceMeta.urlTemplate ||
mbTileSource.minzoom !== tiledSourceMeta.minSourceZoom ||
mbTileSource.maxzoom !== tiledSourceMeta.maxSourceZoom;
@@ -179,9 +181,8 @@ export class TiledVectorLayer extends VectorLayer {
const layerIds = this.getMbLayerIds();
for (let i = 0; i < layerIds.length; i++) {
- // @ts-expect-error
const mbLayer = mbMap.getLayer(layerIds[i]);
- if (mbLayer && mbLayer.sourceLayer !== tiledSourceMeta.layerName) {
+ if (mbLayer && mbLayer['source-layer'] !== tiledSourceMeta.layerName) {
// If the source-pointer of one of the layers is stale, they will all be stale.
// In this case, all the mb-layers need to be removed and re-added.
return true;
@@ -191,7 +192,7 @@ export class TiledVectorLayer extends VectorLayer {
return false;
}
- syncLayerWithMB(mbMap: unknown) {
+ syncLayerWithMB(mbMap: MbMap) {
this._removeStaleMbSourcesAndLayers(mbMap);
this._syncSourceBindingWithMb(mbMap);
this._syncStylePropertiesWithMb(mbMap);
diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.d.ts b/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.d.ts
deleted file mode 100644
index fa614ae87b290..0000000000000
--- a/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.d.ts
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License;
- * you may not use this file except in compliance with the Elastic License.
- */
-/* eslint-disable @typescript-eslint/consistent-type-definitions */
-
-import { Feature, GeoJsonProperties } from 'geojson';
-import { AbstractLayer } from '../layer';
-import { IVectorSource } from '../../sources/vector_source';
-import {
- MapFilters,
- VectorLayerDescriptor,
- VectorSourceRequestMeta,
-} from '../../../../common/descriptor_types';
-import { ILayer } from '../layer';
-import { IJoin } from '../../joins/join';
-import { IVectorStyle } from '../../styles/vector/vector_style';
-import { IField } from '../../fields/field';
-import { DataRequestContext } from '../../../actions';
-import { ITooltipProperty } from '../../tooltips/tooltip_property';
-
-export type VectorLayerArguments = {
- source: IVectorSource;
- joins?: IJoin[];
- layerDescriptor: VectorLayerDescriptor;
-};
-
-export interface IVectorLayer extends ILayer {
- getFields(): Promise;
- getStyleEditorFields(): Promise;
- getJoins(): IJoin[];
- getValidJoins(): IJoin[];
- getSource(): IVectorSource;
- getFeatureById(id: string | number): Feature | null;
- getPropertiesForTooltip(properties: GeoJsonProperties): Promise;
- hasJoins(): boolean;
-}
-
-export class VectorLayer extends AbstractLayer implements IVectorLayer {
- static type: string;
-
- protected readonly _style: IVectorStyle;
- static createDescriptor(
- options: Partial,
- mapColors?: string[]
- ): VectorLayerDescriptor;
-
- constructor(options: VectorLayerArguments);
- getLayerTypeIconName(): string;
- getFields(): Promise;
- getStyleEditorFields(): Promise;
- getJoins(): IJoin[];
- getValidJoins(): IJoin[];
- _syncSourceStyleMeta(
- syncContext: DataRequestContext,
- source: IVectorSource,
- style: IVectorStyle
- ): Promise;
- _syncSourceFormatters(
- syncContext: DataRequestContext,
- source: IVectorSource,
- style: IVectorStyle
- ): Promise;
- syncLayerWithMB(mbMap: unknown): void;
- _getSearchFilters(
- dataFilters: MapFilters,
- source: IVectorSource,
- style: IVectorStyle
- ): VectorSourceRequestMeta;
- _syncData(
- syncContext: DataRequestContext,
- source: IVectorSource,
- style: IVectorStyle
- ): Promise;
- ownsMbSourceId(sourceId: string): boolean;
- ownsMbLayerId(sourceId: string): boolean;
- _setMbPointsProperties(mbMap: unknown, mvtSourceLayer?: string): void;
- _setMbLinePolygonProperties(mbMap: unknown, mvtSourceLayer?: string): void;
- getSource(): IVectorSource;
- getFeatureById(id: string | number): Feature | null;
- getPropertiesForTooltip(properties: GeoJsonProperties): Promise;
- hasJoins(): boolean;
- isFittable(): Promise;
-}
diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.js b/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.tsx
similarity index 77%
rename from x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.js
rename to x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.tsx
index 27c344b713a60..c44ebcf969f7c 100644
--- a/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.js
+++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.tsx
@@ -5,8 +5,13 @@
*/
import React from 'react';
+import { Map as MbMap, Layer as MbLayer, GeoJSONSource as MbGeoJSONSource } from 'mapbox-gl';
+import { Feature, FeatureCollection, GeoJsonProperties } from 'geojson';
+import _ from 'lodash';
+import { EuiIcon } from '@elastic/eui';
+import { i18n } from '@kbn/i18n';
import { AbstractLayer } from '../layer';
-import { VectorStyle } from '../../styles/vector/vector_style';
+import { IVectorStyle, VectorStyle } from '../../styles/vector/vector_style';
import {
FEATURE_ID_PROPERTY_NAME,
SOURCE_DATA_REQUEST_ID,
@@ -20,11 +25,9 @@ import {
FIELD_ORIGIN,
LAYER_STYLE_TYPE,
KBN_TOO_MANY_FEATURES_IMAGE_ID,
+ FieldFormatter,
} from '../../../../common/constants';
-import _ from 'lodash';
import { JoinTooltipProperty } from '../../tooltips/join_tooltip_property';
-import { EuiIcon } from '@elastic/eui';
-import { i18n } from '@kbn/i18n';
import { DataRequestAbortError } from '../../util/data_request';
import {
canSkipSourceUpdate,
@@ -39,15 +42,66 @@ import {
getPointFilterExpression,
} from '../../util/mb_filter_expressions';
+import {
+ DynamicStylePropertyOptions,
+ MapFilters,
+ MapQuery,
+ VectorLayerDescriptor,
+ VectorSourceRequestMeta,
+ VectorStyleRequestMeta,
+} from '../../../../common/descriptor_types';
+import { IVectorSource } from '../../sources/vector_source';
+import { CustomIconAndTooltipContent, ILayer } from '../layer';
+import { IJoin, PropertiesMap } from '../../joins/join';
+import { IField } from '../../fields/field';
+import { DataRequestContext } from '../../../actions';
+import { ITooltipProperty } from '../../tooltips/tooltip_property';
+import { IDynamicStyleProperty } from '../../styles/vector/properties/dynamic_style_property';
+import { IESSource } from '../../sources/es_source';
+
+interface SourceResult {
+ refreshed: boolean;
+ featureCollection?: FeatureCollection;
+}
+
+interface JoinState {
+ dataHasChanged: boolean;
+ join: IJoin;
+ propertiesMap?: PropertiesMap;
+}
+
+export interface VectorLayerArguments {
+ source: IVectorSource;
+ joins?: IJoin[];
+ layerDescriptor: VectorLayerDescriptor;
+}
+
+export interface IVectorLayer extends ILayer {
+ getFields(): Promise;
+ getStyleEditorFields(): Promise;
+ getJoins(): IJoin[];
+ getValidJoins(): IJoin[];
+ getSource(): IVectorSource;
+ getFeatureById(id: string | number): Feature | null;
+ getPropertiesForTooltip(properties: GeoJsonProperties): Promise;
+ hasJoins(): boolean;
+}
+
export class VectorLayer extends AbstractLayer {
static type = LAYER_TYPE.VECTOR;
- static createDescriptor(options, mapColors) {
+ protected readonly _style: IVectorStyle;
+ private readonly _joins: IJoin[];
+
+ static createDescriptor(
+ options: Partial,
+ mapColors?: string[]
+ ): VectorLayerDescriptor {
const layerDescriptor = super.createDescriptor(options);
layerDescriptor.type = VectorLayer.type;
if (!options.style) {
- const styleProperties = VectorStyle.createDefaultStyleProperties(mapColors);
+ const styleProperties = VectorStyle.createDefaultStyleProperties(mapColors ? mapColors : []);
layerDescriptor.style = VectorStyle.createDescriptor(styleProperties);
}
@@ -55,16 +109,31 @@ export class VectorLayer extends AbstractLayer {
layerDescriptor.joins = [];
}
- return layerDescriptor;
+ return layerDescriptor as VectorLayerDescriptor;
}
- constructor({ layerDescriptor, source, joins = [] }) {
- super({ layerDescriptor, source });
+ constructor({ layerDescriptor, source, joins = [] }: VectorLayerArguments) {
+ super({
+ layerDescriptor,
+ source,
+ });
this._joins = joins;
- this._style = new VectorStyle(this._descriptor.style, source, this);
+ this._style = new VectorStyle(layerDescriptor.style, source, this);
+ }
+
+ getSource(): IVectorSource {
+ return super.getSource() as IVectorSource;
+ }
+
+ getStyleForEditing(): IVectorStyle {
+ return this._style;
+ }
+
+ getStyle(): IVectorStyle {
+ return this._style;
}
- getStyle() {
+ getCurrentStyle(): IVectorStyle {
return this._style;
}
@@ -108,7 +177,7 @@ export class VectorLayer extends AbstractLayer {
return true;
}
- getCustomIconAndTooltipContent() {
+ getCustomIconAndTooltipContent(): CustomIconAndTooltipContent {
const featureCollection = this._getSourceFeatureCollection();
const noResultsIcon =