diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index dde90bf1bc47d0..2f2f260addb35e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -53,6 +53,7 @@ /src/plugins/navigation/ @elastic/kibana-app-services /src/plugins/share/ @elastic/kibana-app-services /src/plugins/ui_actions/ @elastic/kibana-app-services +/src/plugins/index_pattern_field_editor @elastic/kibana-app-services /x-pack/examples/ui_actions_enhanced_examples/ @elastic/kibana-app-services /x-pack/plugins/data_enhanced/ @elastic/kibana-app-services /x-pack/plugins/embeddable_enhanced/ @elastic/kibana-app-services diff --git a/api_docs/actions.json b/api_docs/actions.json index ec2bd86581f32d..f3f7f284c046c4 100644 --- a/api_docs/actions.json +++ b/api_docs/actions.json @@ -1646,6 +1646,21 @@ ], "enums": [], "misc": [ + { + "id": "def-common.AsApiContract", + "type": "Type", + "label": "AsApiContract", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/actions/common/rewrite_request_case.ts", + "lineNumber": 14 + }, + "signature": [ + "{ [K in keyof T as CamelToSnake>>]: T[K]; }" + ], + "initialIsOpen": false + }, { "tags": [], "id": "def-common.BASE_ACTION_API_PATH", @@ -1660,6 +1675,60 @@ "\"/api/actions\"" ], "initialIsOpen": false + }, + { + "id": "def-common.RewriteRequestCase", + "type": "Type", + "label": "RewriteRequestCase", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/actions/common/rewrite_request_case.ts", + "lineNumber": 18 + }, + "signature": [ + "(requested: ", + { + "pluginId": "actions", + "scope": "common", + "docId": "kibActionsPluginApi", + "section": "def-common.AsApiContract", + "text": "AsApiContract" + }, + ") => T" + ], + "initialIsOpen": false + }, + { + "id": "def-common.RewriteResponseCase", + "type": "Type", + "label": "RewriteResponseCase", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/actions/common/rewrite_request_case.ts", + "lineNumber": 19 + }, + "signature": [ + "(responded: T) => T extends (infer Item)[] ? ", + { + "pluginId": "actions", + "scope": "common", + "docId": "kibActionsPluginApi", + "section": "def-common.AsApiContract", + "text": "AsApiContract" + }, + "[] : ", + { + "pluginId": "actions", + "scope": "common", + "docId": "kibActionsPluginApi", + "section": "def-common.AsApiContract", + "text": "AsApiContract" + }, + "" + ], + "initialIsOpen": false } ], "objects": [] diff --git a/api_docs/alerting.json b/api_docs/alerting.json index 40f8e9c06ef159..5550798c4316f2 100644 --- a/api_docs/alerting.json +++ b/api_docs/alerting.json @@ -222,7 +222,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 92 + "lineNumber": 85 } }, { @@ -233,7 +233,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 93 + "lineNumber": 86 }, "signature": [ "Date" @@ -247,7 +247,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 94 + "lineNumber": 87 }, "signature": [ "Date | null" @@ -261,7 +261,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 95 + "lineNumber": 88 }, "signature": [ { @@ -282,7 +282,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 96 + "lineNumber": 89 }, "signature": [ "Params" @@ -296,7 +296,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 97 + "lineNumber": 90 }, "signature": [ "State" @@ -310,7 +310,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 98 + "lineNumber": 91 } }, { @@ -321,7 +321,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 99 + "lineNumber": 92 }, "signature": [ "string | undefined" @@ -335,7 +335,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 100 + "lineNumber": 93 } }, { @@ -346,7 +346,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 101 + "lineNumber": 94 }, "signature": [ "string[]" @@ -360,7 +360,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 102 + "lineNumber": 95 }, "signature": [ "string | null" @@ -374,7 +374,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 103 + "lineNumber": 96 }, "signature": [ "string | null" @@ -383,7 +383,7 @@ ], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 85 + "lineNumber": 78 }, "initialIsOpen": false }, @@ -404,7 +404,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 48 + "lineNumber": 46 }, "signature": [ "() => ", @@ -425,7 +425,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 49 + "lineNumber": 47 }, "signature": [ "() => Set<", @@ -447,7 +447,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 50 + "lineNumber": 48 }, "signature": [ "() => Promise<", @@ -464,7 +464,7 @@ ], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 47 + "lineNumber": 45 }, "initialIsOpen": false }, @@ -483,7 +483,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 226 + "lineNumber": 219 }, "signature": [ { @@ -503,7 +503,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 227 + "lineNumber": 220 }, "signature": [ { @@ -518,7 +518,7 @@ ], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 225 + "lineNumber": 218 }, "initialIsOpen": false }, @@ -548,7 +548,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 80 + "lineNumber": 73 }, "signature": [ "(id: string) => Pick<", @@ -565,7 +565,7 @@ ], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 75 + "lineNumber": 68 }, "initialIsOpen": false }, @@ -594,7 +594,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 127 + "lineNumber": 120 } }, { @@ -605,7 +605,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 128 + "lineNumber": 121 } }, { @@ -616,7 +616,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 129 + "lineNumber": 122 }, "signature": [ "{ params?: ", @@ -638,7 +638,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 132 + "lineNumber": 125 }, "signature": [ { @@ -659,7 +659,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 133 + "lineNumber": 126 }, "signature": [ "ActionGroupIds" @@ -673,7 +673,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 134 + "lineNumber": 127 }, "signature": [ { @@ -694,7 +694,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 135 + "lineNumber": 128 }, "signature": [ { @@ -723,7 +723,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 146 + "lineNumber": 139 } }, { @@ -734,7 +734,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 147 + "lineNumber": 140 }, "signature": [ "{ context?: ", @@ -772,7 +772,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 152 + "lineNumber": 145 }, "signature": [ "\"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\"" @@ -781,7 +781,7 @@ ], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 119 + "lineNumber": 112 }, "initialIsOpen": false }, @@ -905,7 +905,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/plugin.ts", - "lineNumber": 112 + "lineNumber": 111 } } ], @@ -913,13 +913,13 @@ "returnComment": [], "source": { "path": "x-pack/plugins/alerting/server/plugin.ts", - "lineNumber": 104 + "lineNumber": 103 } } ], "source": { "path": "x-pack/plugins/alerting/server/plugin.ts", - "lineNumber": 103 + "lineNumber": 102 }, "initialIsOpen": false }, @@ -938,7 +938,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/plugin.ts", - "lineNumber": 124 + "lineNumber": 123 }, "signature": [ "() => Set<", @@ -994,7 +994,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/plugin.ts", - "lineNumber": 125 + "lineNumber": 124 } } ], @@ -1002,7 +1002,7 @@ "returnComment": [], "source": { "path": "x-pack/plugins/alerting/server/plugin.ts", - "lineNumber": 125 + "lineNumber": 124 } }, { @@ -1013,7 +1013,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/plugin.ts", - "lineNumber": 126 + "lineNumber": 125 }, "signature": [ "() => Promise<", @@ -1030,7 +1030,7 @@ ], "source": { "path": "x-pack/plugins/alerting/server/plugin.ts", - "lineNumber": 123 + "lineNumber": 122 }, "initialIsOpen": false } @@ -1177,7 +1177,7 @@ "description": [], "source": { "path": "x-pack/plugins/alerting/server/types.ts", - "lineNumber": 185 + "lineNumber": 178 }, "signature": [ "Pick, \"id\"> & Partial, \"enabled\" | \"name\" | \"params\" | \"actions\" | \"muteAll\" | \"apiKey\" | \"tags\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"throttle\" | \"notifyWhen\" | \"mutedInstanceIds\" | \"executionStatus\">>" diff --git a/api_docs/charts.json b/api_docs/charts.json index f063a2271aec7d..70bf2166de7c84 100644 --- a/api_docs/charts.json +++ b/api_docs/charts.json @@ -9,7 +9,7 @@ "children": [ { "type": "Object", - "label": "{\n onChange,\n color: selectedColor,\n label,\n useLegacyColors = true,\n colorIsOverwritten = true,\n}", + "label": "{\n onChange,\n color: selectedColor,\n label,\n useLegacyColors = true,\n colorIsOverwritten = true,\n onKeyDown,\n}", "isRequired": true, "signature": [ "ColorPickerProps" @@ -17,18 +17,18 @@ "description": [], "source": { "path": "src/plugins/charts/public/static/components/color_picker.tsx", - "lineNumber": 108 + "lineNumber": 111 } } ], "signature": [ - "({ onChange, color: selectedColor, label, useLegacyColors, colorIsOverwritten, }: ColorPickerProps) => JSX.Element" + "({ onChange, color: selectedColor, label, useLegacyColors, colorIsOverwritten, onKeyDown, }: ColorPickerProps) => JSX.Element" ], "description": [], "label": "ColorPicker", "source": { "path": "src/plugins/charts/public/static/components/color_picker.tsx", - "lineNumber": 108 + "lineNumber": 111 }, "tags": [], "returnComment": [], @@ -1597,7 +1597,7 @@ "description": [], "source": { "path": "src/plugins/charts/public/static/color_maps/color_maps.ts", - "lineNumber": 3160 + "lineNumber": 174 }, "signature": [ { @@ -1816,7 +1816,7 @@ "description": [], "source": { "path": "src/plugins/charts/public/static/color_maps/color_maps.ts", - "lineNumber": 558 + "lineNumber": 56 }, "signature": [ { @@ -1837,7 +1837,7 @@ "description": [], "source": { "path": "src/plugins/charts/public/static/color_maps/color_maps.ts", - "lineNumber": 559 + "lineNumber": 57 } }, { @@ -1848,7 +1848,7 @@ "description": [], "source": { "path": "src/plugins/charts/public/static/color_maps/color_maps.ts", - "lineNumber": 562 + "lineNumber": 60 }, "signature": [ "[number, number[]][]" @@ -1859,7 +1859,7 @@ "label": "[ColorSchemas.Greens]", "source": { "path": "src/plugins/charts/public/static/color_maps/color_maps.ts", - "lineNumber": 557 + "lineNumber": 55 } }, { @@ -1875,7 +1875,7 @@ "description": [], "source": { "path": "src/plugins/charts/public/static/color_maps/color_maps.ts", - "lineNumber": 1078 + "lineNumber": 74 }, "signature": [ { @@ -1896,7 +1896,7 @@ "description": [], "source": { "path": "src/plugins/charts/public/static/color_maps/color_maps.ts", - "lineNumber": 1079 + "lineNumber": 75 } }, { @@ -1907,7 +1907,7 @@ "description": [], "source": { "path": "src/plugins/charts/public/static/color_maps/color_maps.ts", - "lineNumber": 1082 + "lineNumber": 78 }, "signature": [ "[number, number[]][]" @@ -1918,7 +1918,7 @@ "label": "[ColorSchemas.Greys]", "source": { "path": "src/plugins/charts/public/static/color_maps/color_maps.ts", - "lineNumber": 1077 + "lineNumber": 73 } }, { @@ -1934,7 +1934,7 @@ "description": [], "source": { "path": "src/plugins/charts/public/static/color_maps/color_maps.ts", - "lineNumber": 1598 + "lineNumber": 92 }, "signature": [ { @@ -1955,7 +1955,7 @@ "description": [], "source": { "path": "src/plugins/charts/public/static/color_maps/color_maps.ts", - "lineNumber": 1599 + "lineNumber": 93 } }, { @@ -1966,7 +1966,7 @@ "description": [], "source": { "path": "src/plugins/charts/public/static/color_maps/color_maps.ts", - "lineNumber": 1602 + "lineNumber": 96 }, "signature": [ "[number, number[]][]" @@ -1977,7 +1977,7 @@ "label": "[ColorSchemas.Reds]", "source": { "path": "src/plugins/charts/public/static/color_maps/color_maps.ts", - "lineNumber": 1597 + "lineNumber": 91 } }, { @@ -1993,7 +1993,7 @@ "description": [], "source": { "path": "src/plugins/charts/public/static/color_maps/color_maps.ts", - "lineNumber": 2118 + "lineNumber": 110 }, "signature": [ { @@ -2014,7 +2014,7 @@ "description": [], "source": { "path": "src/plugins/charts/public/static/color_maps/color_maps.ts", - "lineNumber": 2119 + "lineNumber": 111 } }, { @@ -2025,7 +2025,7 @@ "description": [], "source": { "path": "src/plugins/charts/public/static/color_maps/color_maps.ts", - "lineNumber": 2122 + "lineNumber": 114 }, "signature": [ "[number, number[]][]" @@ -2036,7 +2036,7 @@ "label": "[ColorSchemas.YellowToRed]", "source": { "path": "src/plugins/charts/public/static/color_maps/color_maps.ts", - "lineNumber": 2117 + "lineNumber": 109 } }, { @@ -2052,7 +2052,7 @@ "description": [], "source": { "path": "src/plugins/charts/public/static/color_maps/color_maps.ts", - "lineNumber": 2639 + "lineNumber": 129 }, "signature": [ { @@ -2073,7 +2073,7 @@ "description": [], "source": { "path": "src/plugins/charts/public/static/color_maps/color_maps.ts", - "lineNumber": 2640 + "lineNumber": 130 } }, { @@ -2084,7 +2084,7 @@ "description": [], "source": { "path": "src/plugins/charts/public/static/color_maps/color_maps.ts", - "lineNumber": 2643 + "lineNumber": 133 }, "signature": [ "[number, number[]][]" @@ -2095,7 +2095,7 @@ "label": "[ColorSchemas.GreenToRed]", "source": { "path": "src/plugins/charts/public/static/color_maps/color_maps.ts", - "lineNumber": 2638 + "lineNumber": 128 } } ], diff --git a/api_docs/core.json b/api_docs/core.json index 7129c2cff14de0..e02bd33d6671b4 100644 --- a/api_docs/core.json +++ b/api_docs/core.json @@ -1431,7 +1431,7 @@ "description": [], "source": { "path": "src/core/public/doc_links/doc_links_service.ts", - "lineNumber": 283 + "lineNumber": 300 } }, { @@ -1442,7 +1442,7 @@ "description": [], "source": { "path": "src/core/public/doc_links/doc_links_service.ts", - "lineNumber": 284 + "lineNumber": 301 } }, { @@ -1453,16 +1453,16 @@ "description": [], "source": { "path": "src/core/public/doc_links/doc_links_service.ts", - "lineNumber": 285 + "lineNumber": 302 }, "signature": [ - "{ readonly dashboard: { readonly guide: string; readonly drilldowns: string; readonly drilldownsTriggerPicker: string; readonly urlDrilldownTemplateSyntax: string; readonly urlDrilldownVariables: string; }; readonly discover: Record; readonly filebeat: { readonly base: string; readonly installation: string; readonly configuration: string; readonly elasticsearchOutput: string; readonly elasticsearchModule: string; readonly startup: string; readonly exportedFields: string; }; readonly auditbeat: { readonly base: string; }; readonly metricbeat: { readonly base: string; readonly configure: string; readonly httpEndpoint: string; readonly install: string; readonly start: string; }; readonly enterpriseSearch: { readonly base: string; readonly appSearchBase: string; readonly workplaceSearchBase: string; }; readonly heartbeat: { readonly base: string; }; readonly logstash: { readonly base: string; }; readonly functionbeat: { readonly base: string; }; readonly winlogbeat: { readonly base: string; }; readonly aggs: { readonly composite: string; readonly composite_missing_bucket: string; readonly date_histogram: string; readonly date_range: string; readonly date_format_pattern: 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 runtimeFields: string; readonly scriptedFields: { readonly scriptFields: string; readonly scriptAggs: string; readonly painless: string; readonly painlessApi: string; readonly painlessLangSpec: string; readonly painlessSyntax: string; readonly painlessWalkthrough: string; readonly luceneExpressions: string; }; readonly indexPatterns: { readonly loadingData: string; readonly introduction: string; }; readonly addData: string; readonly kibana: string; readonly elasticsearch: Record; 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 dateMathIndexNames: string; }; readonly management: Record; readonly ml: Record; readonly transforms: Record; readonly visualize: Record; readonly apis: Readonly<{ createIndex: string; createSnapshotLifecyclePolicy: string; createRoleMapping: string; createRoleMappingTemplates: string; createApiKey: string; createPipeline: string; createTransformRequest: string; cronExpressions: string; executeWatchActionModes: string; indexExists: string; openIndex: string; putComponentTemplate: string; painlessExecute: string; painlessExecuteAPIContexts: string; putComponentTemplateMetadata: string; putSnapshotLifecyclePolicy: string; putWatch: string; updateTransform: string; }>; readonly observability: Record; readonly alerting: Record; readonly maps: Record; readonly monitoring: Record; readonly security: Readonly<{ apiKeyServiceSettings: string; clusterPrivileges: string; elasticsearchSettings: string; elasticsearchEnableSecurity: string; indicesPrivileges: string; kibanaTLS: string; kibanaPrivileges: string; mappingRoles: string; mappingRolesFieldRules: string; runAsPrivilege: string; }>; readonly watcher: Record; readonly ccs: Record; readonly plugins: Record; readonly snapshotRestore: Record; }" + "{ readonly dashboard: { readonly guide: string; readonly drilldowns: string; readonly drilldownsTriggerPicker: string; readonly urlDrilldownTemplateSyntax: string; readonly urlDrilldownVariables: string; }; readonly discover: Record; readonly filebeat: { readonly base: string; readonly installation: string; readonly configuration: string; readonly elasticsearchOutput: string; readonly elasticsearchModule: string; readonly startup: string; readonly exportedFields: string; }; readonly auditbeat: { readonly base: string; }; readonly metricbeat: { readonly base: string; readonly configure: string; readonly httpEndpoint: string; readonly install: string; readonly start: string; }; readonly enterpriseSearch: { readonly base: string; readonly appSearchBase: string; readonly workplaceSearchBase: string; }; readonly heartbeat: { readonly base: string; }; readonly logstash: { readonly base: string; }; readonly functionbeat: { readonly base: string; }; readonly winlogbeat: { readonly base: string; }; readonly aggs: { readonly composite: string; readonly composite_missing_bucket: string; readonly date_histogram: string; readonly date_range: string; readonly date_format_pattern: 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 runtimeFields: string; readonly scriptedFields: { readonly scriptFields: string; readonly scriptAggs: string; readonly painless: string; readonly painlessApi: string; readonly painlessLangSpec: string; readonly painlessSyntax: string; readonly painlessWalkthrough: string; readonly luceneExpressions: string; }; readonly indexPatterns: { readonly introduction: string; readonly fieldFormattersNumber: string; readonly fieldFormattersString: string; }; readonly addData: string; readonly kibana: string; readonly elasticsearch: Record; 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 dateMathIndexNames: string; }; readonly management: Record; readonly ml: Record; readonly transforms: Record; readonly visualize: Record; readonly apis: Readonly<{ createIndex: string; createSnapshotLifecyclePolicy: string; createRoleMapping: string; createRoleMappingTemplates: string; createApiKey: string; createPipeline: string; createTransformRequest: string; cronExpressions: string; executeWatchActionModes: string; indexExists: string; openIndex: string; putComponentTemplate: string; painlessExecute: string; painlessExecuteAPIContexts: string; putComponentTemplateMetadata: string; putSnapshotLifecyclePolicy: string; putWatch: string; updateTransform: string; }>; readonly observability: Record; readonly alerting: Record; readonly maps: Record; readonly monitoring: Record; readonly security: Readonly<{ apiKeyServiceSettings: string; clusterPrivileges: string; elasticsearchSettings: string; elasticsearchEnableSecurity: string; indicesPrivileges: string; kibanaTLS: string; kibanaPrivileges: string; mappingRoles: string; mappingRolesFieldRules: string; runAsPrivilege: string; }>; readonly watcher: Record; readonly ccs: Record; readonly plugins: Record; readonly snapshotRestore: Record; readonly ingest: Record; }" ] } ], "source": { "path": "src/core/public/doc_links/doc_links_service.ts", - "lineNumber": 282 + "lineNumber": 299 }, "initialIsOpen": false }, @@ -5819,7 +5819,7 @@ "lineNumber": 33 }, "signature": [ - "Pick & { title?: string | MountPoint | undefined; text?: string | MountPoint | undefined; } & { id: string; }" + "Pick & { title?: string | MountPoint | undefined; text?: string | MountPoint | undefined; } & { id: string; }" ], "initialIsOpen": false }, @@ -5864,7 +5864,7 @@ "lineNumber": 28 }, "signature": [ - "Pick & { title?: string | MountPoint | undefined; text?: string | MountPoint | undefined; }" + "Pick & { title?: string | MountPoint | undefined; text?: string | MountPoint | undefined; }" ], "initialIsOpen": false }, diff --git a/api_docs/core_application.json b/api_docs/core_application.json index e5bbbf1ca3b580..c15b47dcb0982e 100644 --- a/api_docs/core_application.json +++ b/api_docs/core_application.json @@ -1824,7 +1824,7 @@ "lineNumber": 322 }, "signature": [ - "Pick, \"status\" | \"id\" | \"title\" | \"order\" | \"category\" | \"navLinkStatus\" | \"defaultPath\" | \"tooltip\" | \"euiIconType\" | \"icon\" | \"capabilities\" | \"chromeless\" | \"appRoute\" | \"exactRoute\"> & { status: AppStatus; navLinkStatus: AppNavLinkStatus; appRoute: string; meta: PublicAppMetaInfo; }" + "Pick, \"status\" | \"title\" | \"id\" | \"order\" | \"category\" | \"navLinkStatus\" | \"defaultPath\" | \"tooltip\" | \"euiIconType\" | \"icon\" | \"capabilities\" | \"chromeless\" | \"appRoute\" | \"exactRoute\"> & { status: AppStatus; navLinkStatus: AppNavLinkStatus; appRoute: string; meta: PublicAppMetaInfo; }" ], "initialIsOpen": false }, @@ -1862,7 +1862,7 @@ "lineNumber": 277 }, "signature": [ - "Pick & { searchDeepLinks: PublicAppSearchDeepLinkInfo[]; keywords: string[]; }" + "Pick & { searchDeepLinks: PublicAppSearchDeepLinkInfo[]; keywords: string[]; }" ], "initialIsOpen": false } diff --git a/api_docs/data.json b/api_docs/data.json index 13e2b402a4afd9..a9ef03d881ce88 100644 --- a/api_docs/data.json +++ b/api_docs/data.json @@ -608,7 +608,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 263 + "lineNumber": 265 } }, { @@ -634,7 +634,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 294 + "lineNumber": 296 } }, { @@ -654,7 +654,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 305 + "lineNumber": 307 } }, { @@ -680,7 +680,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 314 + "lineNumber": 316 } }, { @@ -712,7 +712,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 369 + "lineNumber": 371 } }, { @@ -736,7 +736,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 373 + "lineNumber": 375 } }, { @@ -760,7 +760,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 377 + "lineNumber": 379 } }, { @@ -782,7 +782,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 381 + "lineNumber": 383 } } ], @@ -790,7 +790,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 381 + "lineNumber": 383 } }, { @@ -812,7 +812,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 385 + "lineNumber": 387 } }, { @@ -825,7 +825,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 385 + "lineNumber": 387 } } ], @@ -833,7 +833,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 385 + "lineNumber": 387 } }, { @@ -849,7 +849,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 393 + "lineNumber": 395 } }, { @@ -865,7 +865,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 399 + "lineNumber": 401 } }, { @@ -883,7 +883,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 408 + "lineNumber": 410 } }, { @@ -905,7 +905,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 412 + "lineNumber": 414 } } ], @@ -913,7 +913,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 412 + "lineNumber": 414 } }, { @@ -936,7 +936,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 426 + "lineNumber": 428 } }, { @@ -960,7 +960,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 430 + "lineNumber": 432 } }, { @@ -976,7 +976,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 434 + "lineNumber": 436 } }, { @@ -992,7 +992,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 439 + "lineNumber": 441 } }, { @@ -1003,7 +1003,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 446 + "lineNumber": 448 }, "signature": [ { @@ -1023,7 +1023,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 450 + "lineNumber": 452 }, "signature": [ { @@ -1068,7 +1068,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 480 + "lineNumber": 482 } } ], @@ -1076,7 +1076,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 480 + "lineNumber": 482 } } ], @@ -1101,7 +1101,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 58 + "lineNumber": 65 }, "signature": [ { @@ -1121,7 +1121,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 59 + "lineNumber": 66 }, "signature": [ { @@ -1142,7 +1142,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 62 + "lineNumber": 69 }, "signature": [ { @@ -1180,7 +1180,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 65 + "lineNumber": 72 } }, { @@ -1217,7 +1217,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 66 + "lineNumber": 73 } }, { @@ -1236,7 +1236,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 67 + "lineNumber": 74 } } ], @@ -1244,7 +1244,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 64 + "lineNumber": 71 } }, { @@ -1280,7 +1280,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 79 + "lineNumber": 86 } } ], @@ -1288,7 +1288,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 79 + "lineNumber": 86 } }, { @@ -1317,7 +1317,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 97 + "lineNumber": 104 } } ], @@ -1325,7 +1325,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 97 + "lineNumber": 104 } }, { @@ -1366,7 +1366,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 111 + "lineNumber": 118 } }, { @@ -1379,7 +1379,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 112 + "lineNumber": 119 } } ], @@ -1429,7 +1429,7 @@ "label": "createAggConfig", "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 110 + "lineNumber": 117 }, "tags": [], "returnComment": [] @@ -1472,7 +1472,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 153 + "lineNumber": 160 } } ], @@ -1480,7 +1480,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 153 + "lineNumber": 160 } }, { @@ -1502,7 +1502,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 165 + "lineNumber": 172 } } ], @@ -1510,7 +1510,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 165 + "lineNumber": 172 } }, { @@ -1534,7 +1534,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 227 + "lineNumber": 241 } }, { @@ -1563,7 +1563,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 231 + "lineNumber": 245 } } ], @@ -1571,7 +1571,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 231 + "lineNumber": 245 } }, { @@ -1601,7 +1601,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 235 + "lineNumber": 249 } } ], @@ -1609,7 +1609,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 235 + "lineNumber": 249 } }, { @@ -1639,7 +1639,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 239 + "lineNumber": 253 } } ], @@ -1647,7 +1647,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 239 + "lineNumber": 253 } }, { @@ -1677,7 +1677,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 243 + "lineNumber": 257 } } ], @@ -1685,7 +1685,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 243 + "lineNumber": 257 } }, { @@ -1715,7 +1715,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 247 + "lineNumber": 261 } } ], @@ -1723,7 +1723,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 247 + "lineNumber": 261 } }, { @@ -1753,7 +1753,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 251 + "lineNumber": 265 } } ], @@ -1761,7 +1761,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 251 + "lineNumber": 265 } }, { @@ -1785,7 +1785,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 255 + "lineNumber": 269 } }, { @@ -1815,7 +1815,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 269 + "lineNumber": 283 } } ], @@ -1823,7 +1823,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 269 + "lineNumber": 283 } }, { @@ -1851,7 +1851,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 284 + "lineNumber": 298 } }, { @@ -1885,7 +1885,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 298 + "lineNumber": 312 } } ], @@ -1895,7 +1895,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 298 + "lineNumber": 312 } }, { @@ -1941,7 +1941,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 307 + "lineNumber": 321 } }, { @@ -1961,7 +1961,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 307 + "lineNumber": 321 } } ], @@ -1969,13 +1969,13 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 307 + "lineNumber": 321 } } ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 57 + "lineNumber": 64 }, "initialIsOpen": false }, @@ -5492,7 +5492,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 464 + "lineNumber": 465 } } ], @@ -5513,7 +5513,7 @@ "label": "get", "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 464 + "lineNumber": 465 }, "tags": [], "returnComment": [] @@ -5561,7 +5561,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 483 + "lineNumber": 484 } }, { @@ -5574,7 +5574,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 483 + "lineNumber": 484 } } ], @@ -5584,7 +5584,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 483 + "lineNumber": 484 } }, { @@ -5630,7 +5630,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 508 + "lineNumber": 509 } }, { @@ -5645,7 +5645,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 508 + "lineNumber": 509 } }, { @@ -5660,7 +5660,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 508 + "lineNumber": 509 } } ], @@ -5668,7 +5668,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 508 + "lineNumber": 509 } }, { @@ -5714,7 +5714,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 521 + "lineNumber": 522 } }, { @@ -5729,7 +5729,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 521 + "lineNumber": 522 } } ], @@ -5737,7 +5737,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 521 + "lineNumber": 522 } }, { @@ -5775,7 +5775,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 547 + "lineNumber": 548 } }, { @@ -5788,7 +5788,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 548 + "lineNumber": 549 } }, { @@ -5801,7 +5801,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 549 + "lineNumber": 550 } } ], @@ -5809,7 +5809,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 546 + "lineNumber": 547 } }, { @@ -5835,7 +5835,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 632 + "lineNumber": 633 } } ], @@ -5843,7 +5843,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 632 + "lineNumber": 633 } } ], @@ -6059,7 +6059,7 @@ "type": "Function", "label": "setField", "signature": [ - "(field: K, value: ", + "(field: K, value: ", { "pluginId": "data", "scope": "common", @@ -6123,7 +6123,7 @@ "type": "Function", "label": "removeField", "signature": [ - "(field: K) => this" + "(field: K) => this" ], "description": [ "\nremove field" @@ -6250,7 +6250,7 @@ "type": "Function", "label": "getField", "signature": [ - "(field: K, recurse?: boolean) => ", + "(field: K, recurse?: boolean) => ", { "pluginId": "data", "scope": "common", @@ -6303,7 +6303,7 @@ "type": "Function", "label": "getOwnField", "signature": [ - "(field: K) => ", + "(field: K) => ", { "pluginId": "data", "scope": "common", @@ -7635,7 +7635,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 204 + "lineNumber": 207 }, "signature": [ "FunctionDefinition" @@ -7649,7 +7649,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 205 + "lineNumber": 208 }, "signature": [ "FunctionDefinition" @@ -7663,7 +7663,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 206 + "lineNumber": 209 }, "signature": [ "FunctionDefinition" @@ -7677,7 +7677,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 207 + "lineNumber": 210 }, "signature": [ "FunctionDefinition" @@ -7691,7 +7691,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 208 + "lineNumber": 211 }, "signature": [ "FunctionDefinition" @@ -7705,7 +7705,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 209 + "lineNumber": 212 }, "signature": [ "FunctionDefinition" @@ -7719,7 +7719,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 210 + "lineNumber": 213 }, "signature": [ "FunctionDefinition" @@ -7733,7 +7733,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 211 + "lineNumber": 214 }, "signature": [ "FunctionDefinition" @@ -7747,7 +7747,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 212 + "lineNumber": 215 }, "signature": [ "FunctionDefinition" @@ -7761,7 +7761,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 213 + "lineNumber": 216 }, "signature": [ "FunctionDefinition" @@ -7775,7 +7775,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 214 + "lineNumber": 217 }, "signature": [ "FunctionDefinition" @@ -7789,7 +7789,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 215 + "lineNumber": 218 }, "signature": [ "FunctionDefinition" @@ -7803,7 +7803,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 216 + "lineNumber": 219 }, "signature": [ "FunctionDefinition" @@ -7817,7 +7817,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 217 + "lineNumber": 220 }, "signature": [ "FunctionDefinition" @@ -7831,7 +7831,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 218 + "lineNumber": 221 }, "signature": [ "FunctionDefinition" @@ -7845,7 +7845,21 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 219 + "lineNumber": 222 + }, + "signature": [ + "FunctionDefinition" + ] + }, + { + "tags": [], + "id": "def-public.AggFunctionsMapping.aggFilteredMetric", + "type": "Object", + "label": "aggFilteredMetric", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/types.ts", + "lineNumber": 223 }, "signature": [ "FunctionDefinition" @@ -7859,7 +7873,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 220 + "lineNumber": 224 }, "signature": [ "FunctionDefinition" @@ -7873,7 +7887,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 221 + "lineNumber": 225 }, "signature": [ "FunctionDefinition" @@ -7887,7 +7901,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 222 + "lineNumber": 226 }, "signature": [ "FunctionDefinition" @@ -7901,7 +7915,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 223 + "lineNumber": 227 }, "signature": [ "FunctionDefinition" @@ -7915,7 +7929,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 224 + "lineNumber": 228 }, "signature": [ "FunctionDefinition" @@ -7929,7 +7943,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 225 + "lineNumber": 229 }, "signature": [ "FunctionDefinition" @@ -7943,7 +7957,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 226 + "lineNumber": 230 }, "signature": [ "FunctionDefinition" @@ -7957,7 +7971,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 227 + "lineNumber": 231 }, "signature": [ "FunctionDefinition" @@ -7971,7 +7985,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 228 + "lineNumber": 232 }, "signature": [ "FunctionDefinition" @@ -7985,7 +7999,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 229 + "lineNumber": 233 }, "signature": [ "FunctionDefinition" @@ -7999,7 +8013,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 230 + "lineNumber": 234 }, "signature": [ "FunctionDefinition" @@ -8013,7 +8027,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 231 + "lineNumber": 235 }, "signature": [ "FunctionDefinition" @@ -8027,7 +8041,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 232 + "lineNumber": 236 }, "signature": [ "FunctionDefinition" @@ -8041,7 +8055,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 233 + "lineNumber": 237 }, "signature": [ "FunctionDefinition" @@ -8055,7 +8069,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 234 + "lineNumber": 238 }, "signature": [ "FunctionDefinition" @@ -8069,7 +8083,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 235 + "lineNumber": 239 }, "signature": [ "FunctionDefinition" @@ -8078,7 +8092,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 203 + "lineNumber": 206 }, "initialIsOpen": false }, @@ -11407,7 +11421,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 139 + "lineNumber": 141 }, "signature": [ "{ calculateAutoTimeExpression: (range: TimeRange) => string | undefined; getDateMetaByDatatableColumn: (column: DatatableColumn) => Promise<{ timeZone: string; timeRange?: TimeRange | undefined; interval: string; } | undefined>; datatableUtilities: { getIndexPattern: (column: DatatableColumn) => Promise; getAggConfig: (column: DatatableColumn) => Promise; isFilterable: (column: DatatableColumn) => boolean; }; createAggConfigs: (indexPattern: IndexPattern, configStates?: Pick>" @@ -11866,7 +11880,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 638 + "lineNumber": 639 }, "signature": [ "{ get: (id: string) => Promise; delete: (indexPatternId: string) => Promise<{}>; create: (spec: IndexPatternSpec, skipFetchFields?: boolean) => Promise; ensureDefaultIndexPattern: EnsureDefaultIndexPattern; getIds: (refresh?: boolean) => Promise; getTitles: (refresh?: boolean) => Promise; find: (search: string, size?: number) => Promise; getIdsWithTitle: (refresh?: boolean) => Promise<{ id: string; title: string; }[]>; clearCache: (id?: string | undefined) => void; getCache: () => Promise[] | null | undefined>; getDefault: () => Promise; setDefault: (id: string, force?: boolean) => Promise; getFieldsForWildcard: (options: GetFieldsOptions) => Promise; getFieldsForIndexPattern: (indexPattern: IndexPattern | IndexPatternSpec, options?: GetFieldsOptions | undefined) => Promise; refreshFields: (indexPattern: IndexPattern) => Promise; fieldArrayToMap: (fields: FieldSpec[], fieldAttrs?: FieldAttrs | undefined) => Record; savedObjectToSpec: (savedObject: SavedObject) => IndexPatternSpec; createAndSave: (spec: IndexPatternSpec, override?: boolean, skipFetchFields?: boolean) => Promise; createSavedObject: (indexPattern: IndexPattern, override?: boolean) => Promise; updateSavedObject: (indexPattern: IndexPattern, saveAttempts?: number, ignoreErrors?: boolean) => Promise; }" @@ -11946,7 +11960,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", - "lineNumber": 27 + "lineNumber": 32 }, "signature": [ "{ type: \"kibana_context\"; } & ExecutionContextSearch" @@ -12150,7 +12164,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 56 + "lineNumber": 57 }, "signature": [ "(props: ", @@ -12164,6 +12178,28 @@ ") => JSX.Element" ] }, + { + "tags": [], + "id": "def-public.esFilters.FilterItem", + "type": "Function", + "label": "FilterItem", + "description": [], + "source": { + "path": "src/plugins/data/public/index.ts", + "lineNumber": 58 + }, + "signature": [ + "(props: ", + { + "pluginId": "data", + "scope": "public", + "docId": "kibDataUiPluginApi", + "section": "def-public.FilterItemProps", + "text": "FilterItemProps" + }, + ") => JSX.Element" + ] + }, { "tags": [], "id": "def-public.esFilters.FILTERS", @@ -12172,7 +12208,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 58 + "lineNumber": 60 }, "signature": [ "typeof ", @@ -12193,7 +12229,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 59 + "lineNumber": 61 }, "signature": [ "typeof ", @@ -12214,7 +12250,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 61 + "lineNumber": 63 }, "signature": [ "(isPinned: boolean, index?: string | undefined) => ", @@ -12235,7 +12271,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 62 + "lineNumber": 64 }, "signature": [ "(field: ", @@ -12272,7 +12308,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 63 + "lineNumber": 65 }, "signature": [ "(field: ", @@ -12309,7 +12345,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 64 + "lineNumber": 66 }, "signature": [ "(field: ", @@ -12346,7 +12382,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 65 + "lineNumber": 67 }, "signature": [ "(query: any, index: string, alias: string) => ", @@ -12367,7 +12403,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 66 + "lineNumber": 68 }, "signature": [ "(field: ", @@ -12412,7 +12448,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 68 + "lineNumber": 70 }, "signature": [ "(filter: any) => filter is ", @@ -12433,7 +12469,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 69 + "lineNumber": 71 }, "signature": [ "(filter: any) => filter is ", @@ -12454,7 +12490,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 70 + "lineNumber": 72 }, "signature": [ "(filter: any) => filter is ", @@ -12475,7 +12511,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 71 + "lineNumber": 73 }, "signature": [ "(filter: any) => filter is ", @@ -12496,7 +12532,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 72 + "lineNumber": 74 }, "signature": [ "(filter: any) => filter is ", @@ -12517,7 +12553,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 73 + "lineNumber": 75 }, "signature": [ "(filter: any) => filter is ", @@ -12538,7 +12574,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 74 + "lineNumber": 76 }, "signature": [ "(filter: any) => filter is ", @@ -12559,7 +12595,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 75 + "lineNumber": 77 }, "signature": [ "(filter: ", @@ -12581,7 +12617,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 77 + "lineNumber": 79 }, "signature": [ "(filter: ", @@ -12611,7 +12647,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 78 + "lineNumber": 80 }, "signature": [ "(filter: ", @@ -12640,7 +12676,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 79 + "lineNumber": 81 }, "signature": [ "(filter: ", @@ -12662,7 +12698,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 80 + "lineNumber": 82 }, "signature": [ "(filter: ", @@ -12684,7 +12720,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 81 + "lineNumber": 83 }, "signature": [ "typeof ", @@ -12705,7 +12741,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 83 + "lineNumber": 85 }, "signature": [ "(first: ", @@ -12758,7 +12794,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 84 + "lineNumber": 86 }, "signature": [ { @@ -12778,7 +12814,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 85 + "lineNumber": 87 }, "signature": [ "typeof ", @@ -12799,7 +12835,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 86 + "lineNumber": 88 }, "signature": [ "(newFilters?: ", @@ -12829,7 +12865,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 88 + "lineNumber": 90 }, "signature": [ "typeof ", @@ -12850,7 +12886,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 89 + "lineNumber": 91 }, "signature": [ "typeof ", @@ -12871,7 +12907,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 90 + "lineNumber": 92 }, "signature": [ "(filters: ", @@ -12901,7 +12937,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 91 + "lineNumber": 93 }, "signature": [ "typeof ", @@ -12922,7 +12958,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 92 + "lineNumber": 94 }, "signature": [ "typeof ", @@ -12940,7 +12976,7 @@ "label": "esFilters", "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 55 + "lineNumber": 56 }, "initialIsOpen": false }, @@ -12957,7 +12993,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 122 + "lineNumber": 124 }, "signature": [ { @@ -12977,7 +13013,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 123 + "lineNumber": 125 }, "signature": [ "(expression: any, parseOptions?: Partial<", @@ -13006,7 +13042,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 124 + "lineNumber": 126 }, "signature": [ "(node: ", @@ -13040,7 +13076,7 @@ "label": "esKuery", "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 121 + "lineNumber": 123 }, "initialIsOpen": false }, @@ -13057,7 +13093,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 128 + "lineNumber": 130 }, "signature": [ "typeof ", @@ -13078,7 +13114,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 129 + "lineNumber": 131 }, "signature": [ "typeof ", @@ -13099,7 +13135,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 130 + "lineNumber": 132 }, "signature": [ "(filters: ", @@ -13145,7 +13181,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 131 + "lineNumber": 133 }, "signature": [ "typeof ", @@ -13166,7 +13202,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 132 + "lineNumber": 134 }, "signature": [ "typeof ", @@ -13184,7 +13220,7 @@ "label": "esQuery", "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 127 + "lineNumber": 129 }, "initialIsOpen": false }, @@ -13201,7 +13237,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 212 + "lineNumber": 214 }, "signature": [ "typeof ", @@ -13222,7 +13258,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 213 + "lineNumber": 215 } } ], @@ -13230,7 +13266,7 @@ "label": "exporters", "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 211 + "lineNumber": 213 }, "initialIsOpen": false }, @@ -13247,7 +13283,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 169 + "lineNumber": 171 }, "signature": [ "typeof ", @@ -13268,7 +13304,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 170 + "lineNumber": 172 }, "signature": [ "typeof ", @@ -13289,7 +13325,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 172 + "lineNumber": 174 }, "signature": [ "{ range: string; regex: string; text: string; background: string; }" @@ -13303,7 +13339,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 173 + "lineNumber": 175 }, "signature": [ { @@ -13323,7 +13359,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 174 + "lineNumber": 176 }, "signature": [ { @@ -13343,7 +13379,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 175 + "lineNumber": 177 }, "signature": [ "typeof ", @@ -13364,7 +13400,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 177 + "lineNumber": 179 }, "signature": [ "typeof ", @@ -13385,7 +13421,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 178 + "lineNumber": 180 }, "signature": [ "typeof ", @@ -13406,7 +13442,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 179 + "lineNumber": 181 }, "signature": [ "typeof ", @@ -13427,7 +13463,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 180 + "lineNumber": 182 }, "signature": [ "typeof ", @@ -13448,7 +13484,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 181 + "lineNumber": 183 }, "signature": [ "typeof ", @@ -13469,7 +13505,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 182 + "lineNumber": 184 }, "signature": [ "typeof ", @@ -13490,7 +13526,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 183 + "lineNumber": 185 }, "signature": [ "typeof ", @@ -13511,7 +13547,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 184 + "lineNumber": 186 }, "signature": [ "typeof ", @@ -13532,7 +13568,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 185 + "lineNumber": 187 }, "signature": [ "typeof ", @@ -13553,7 +13589,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 186 + "lineNumber": 188 }, "signature": [ "typeof ", @@ -13574,7 +13610,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 187 + "lineNumber": 189 }, "signature": [ "typeof ", @@ -13595,7 +13631,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 188 + "lineNumber": 190 }, "signature": [ "typeof ", @@ -13616,7 +13652,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 189 + "lineNumber": 191 }, "signature": [ "typeof ", @@ -13637,7 +13673,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 190 + "lineNumber": 192 }, "signature": [ "typeof ", @@ -13658,7 +13694,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 191 + "lineNumber": 193 }, "signature": [ "typeof ", @@ -13679,7 +13715,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 192 + "lineNumber": 194 }, "signature": [ "typeof ", @@ -13697,7 +13733,7 @@ "label": "fieldFormats", "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 168 + "lineNumber": 170 }, "initialIsOpen": false }, @@ -13714,7 +13750,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 237 + "lineNumber": 239 } }, { @@ -13725,7 +13761,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 238 + "lineNumber": 240 } }, { @@ -13736,7 +13772,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 239 + "lineNumber": 241 }, "signature": [ "string[]" @@ -13750,7 +13786,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 240 + "lineNumber": 242 }, "signature": [ "string[]" @@ -13764,7 +13800,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 241 + "lineNumber": 243 }, "signature": [ "(indexPattern: ", @@ -13786,7 +13822,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 242 + "lineNumber": 244 }, "signature": [ "typeof ", @@ -13807,7 +13843,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 243 + "lineNumber": 245 }, "signature": [ "typeof ", @@ -13828,7 +13864,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 244 + "lineNumber": 246 }, "signature": [ "typeof ", @@ -13849,7 +13885,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 245 + "lineNumber": 247 }, "signature": [ "typeof ", @@ -13870,7 +13906,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 246 + "lineNumber": 248 }, "signature": [ "typeof ", @@ -13888,7 +13924,7 @@ "label": "indexPatterns", "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 236 + "lineNumber": 238 }, "initialIsOpen": false }, @@ -13910,7 +13946,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 403 + "lineNumber": 405 }, "signature": [ "typeof ", @@ -13931,7 +13967,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 404 + "lineNumber": 406 }, "signature": [ "typeof ", @@ -13952,7 +13988,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 405 + "lineNumber": 407 }, "signature": [ "({ display: string; val: string; enabled(agg: ", @@ -13974,7 +14010,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 406 + "lineNumber": 408 }, "signature": [ "typeof ", @@ -13995,7 +14031,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 407 + "lineNumber": 409 }, "signature": [ "typeof ", @@ -14016,7 +14052,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 408 + "lineNumber": 410 }, "signature": [ "typeof ", @@ -14037,7 +14073,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 409 + "lineNumber": 411 }, "signature": [ "typeof ", @@ -14058,7 +14094,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 410 + "lineNumber": 412 }, "signature": [ "(agg: ", @@ -14080,7 +14116,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 411 + "lineNumber": 413 }, "signature": [ "(agg: ", @@ -14102,7 +14138,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 412 + "lineNumber": 414 }, "signature": [ "(...types: string[]) => (agg: ", @@ -14124,7 +14160,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 413 + "lineNumber": 415 }, "signature": [ "typeof ", @@ -14145,7 +14181,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 414 + "lineNumber": 416 }, "signature": [ "typeof ", @@ -14166,7 +14202,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 415 + "lineNumber": 417 } }, { @@ -14177,7 +14213,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 416 + "lineNumber": 418 }, "signature": [ "typeof ", @@ -14198,7 +14234,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 417 + "lineNumber": 419 }, "signature": [ "typeof ", @@ -14219,7 +14255,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 418 + "lineNumber": 420 }, "signature": [ "typeof ", @@ -14240,7 +14276,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 419 + "lineNumber": 421 } }, { @@ -14251,7 +14287,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 420 + "lineNumber": 422 }, "signature": [ "string[]" @@ -14265,7 +14301,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 421 + "lineNumber": 423 }, "signature": [ "typeof ", @@ -14286,7 +14322,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 422 + "lineNumber": 424 }, "signature": [ "({ bound: number; interval: moment.Duration; boundLabel: string; intervalLabel: string; } | { bound: moment.Duration; interval: moment.Duration; boundLabel: string; intervalLabel: string; })[]" @@ -14300,7 +14336,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 423 + "lineNumber": 425 }, "signature": [ "(column: ", @@ -14319,7 +14355,7 @@ "label": "aggs", "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 402 + "lineNumber": 404 } }, { @@ -14330,7 +14366,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 425 + "lineNumber": 427 }, "signature": [ "typeof ", @@ -14351,7 +14387,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 426 + "lineNumber": 428 }, "signature": [ "typeof ", @@ -14372,7 +14408,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 427 + "lineNumber": 429 }, "signature": [ "typeof ", @@ -14393,7 +14429,7 @@ "description": [], "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 428 + "lineNumber": 430 }, "signature": [ "typeof ", @@ -14411,7 +14447,7 @@ "label": "search", "source": { "path": "src/plugins/data/public/index.ts", - "lineNumber": 401 + "lineNumber": 403 }, "initialIsOpen": false }, @@ -15154,7 +15190,7 @@ "description": [], "source": { "path": "src/plugins/data/server/plugin.ts", - "lineNumber": 104 + "lineNumber": 107 } } ], @@ -15162,7 +15198,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/server/plugin.ts", - "lineNumber": 104 + "lineNumber": 107 } }, { @@ -15178,7 +15214,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/server/plugin.ts", - "lineNumber": 118 + "lineNumber": 121 } } ], @@ -17056,7 +17092,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 464 + "lineNumber": 465 } } ], @@ -17077,7 +17113,7 @@ "label": "get", "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 464 + "lineNumber": 465 }, "tags": [], "returnComment": [] @@ -17125,7 +17161,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 483 + "lineNumber": 484 } }, { @@ -17138,7 +17174,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 483 + "lineNumber": 484 } } ], @@ -17148,7 +17184,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 483 + "lineNumber": 484 } }, { @@ -17194,7 +17230,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 508 + "lineNumber": 509 } }, { @@ -17209,7 +17245,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 508 + "lineNumber": 509 } }, { @@ -17224,7 +17260,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 508 + "lineNumber": 509 } } ], @@ -17232,7 +17268,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 508 + "lineNumber": 509 } }, { @@ -17278,7 +17314,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 521 + "lineNumber": 522 } }, { @@ -17293,7 +17329,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 521 + "lineNumber": 522 } } ], @@ -17301,7 +17337,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 521 + "lineNumber": 522 } }, { @@ -17339,7 +17375,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 547 + "lineNumber": 548 } }, { @@ -17352,7 +17388,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 548 + "lineNumber": 549 } }, { @@ -17365,7 +17401,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 549 + "lineNumber": 550 } } ], @@ -17373,7 +17409,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 546 + "lineNumber": 547 } }, { @@ -17399,7 +17435,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 632 + "lineNumber": 633 } } ], @@ -17407,7 +17443,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 632 + "lineNumber": 633 } } ], @@ -18117,7 +18153,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 464 + "lineNumber": 465 } } ], @@ -18138,7 +18174,7 @@ "label": "get", "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 464 + "lineNumber": 465 }, "tags": [], "returnComment": [] @@ -18186,7 +18222,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 483 + "lineNumber": 484 } }, { @@ -18199,7 +18235,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 483 + "lineNumber": 484 } } ], @@ -18209,7 +18245,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 483 + "lineNumber": 484 } }, { @@ -18255,7 +18291,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 508 + "lineNumber": 509 } }, { @@ -18270,7 +18306,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 508 + "lineNumber": 509 } }, { @@ -18285,7 +18321,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 508 + "lineNumber": 509 } } ], @@ -18293,7 +18329,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 508 + "lineNumber": 509 } }, { @@ -18339,7 +18375,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 521 + "lineNumber": 522 } }, { @@ -18354,7 +18390,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 521 + "lineNumber": 522 } } ], @@ -18362,7 +18398,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 521 + "lineNumber": 522 } }, { @@ -18400,7 +18436,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 547 + "lineNumber": 548 } }, { @@ -18413,7 +18449,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 548 + "lineNumber": 549 } }, { @@ -18426,7 +18462,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 549 + "lineNumber": 550 } } ], @@ -18434,7 +18470,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 546 + "lineNumber": 547 } }, { @@ -18460,7 +18496,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 632 + "lineNumber": 633 } } ], @@ -18468,7 +18504,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 632 + "lineNumber": 633 } } ], @@ -18785,7 +18821,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 204 + "lineNumber": 207 }, "signature": [ "FunctionDefinition" @@ -18799,7 +18835,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 205 + "lineNumber": 208 }, "signature": [ "FunctionDefinition" @@ -18813,7 +18849,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 206 + "lineNumber": 209 }, "signature": [ "FunctionDefinition" @@ -18827,7 +18863,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 207 + "lineNumber": 210 }, "signature": [ "FunctionDefinition" @@ -18841,7 +18877,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 208 + "lineNumber": 211 }, "signature": [ "FunctionDefinition" @@ -18855,7 +18891,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 209 + "lineNumber": 212 }, "signature": [ "FunctionDefinition" @@ -18869,7 +18905,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 210 + "lineNumber": 213 }, "signature": [ "FunctionDefinition" @@ -18883,7 +18919,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 211 + "lineNumber": 214 }, "signature": [ "FunctionDefinition" @@ -18897,7 +18933,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 212 + "lineNumber": 215 }, "signature": [ "FunctionDefinition" @@ -18911,7 +18947,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 213 + "lineNumber": 216 }, "signature": [ "FunctionDefinition" @@ -18925,7 +18961,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 214 + "lineNumber": 217 }, "signature": [ "FunctionDefinition" @@ -18939,7 +18975,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 215 + "lineNumber": 218 }, "signature": [ "FunctionDefinition" @@ -18953,7 +18989,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 216 + "lineNumber": 219 }, "signature": [ "FunctionDefinition" @@ -18967,7 +19003,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 217 + "lineNumber": 220 }, "signature": [ "FunctionDefinition" @@ -18981,7 +19017,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 218 + "lineNumber": 221 }, "signature": [ "FunctionDefinition" @@ -18995,7 +19031,21 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 219 + "lineNumber": 222 + }, + "signature": [ + "FunctionDefinition" + ] + }, + { + "tags": [], + "id": "def-server.AggFunctionsMapping.aggFilteredMetric", + "type": "Object", + "label": "aggFilteredMetric", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/types.ts", + "lineNumber": 223 }, "signature": [ "FunctionDefinition" @@ -19009,7 +19059,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 220 + "lineNumber": 224 }, "signature": [ "FunctionDefinition" @@ -19023,7 +19073,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 221 + "lineNumber": 225 }, "signature": [ "FunctionDefinition" @@ -19037,7 +19087,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 222 + "lineNumber": 226 }, "signature": [ "FunctionDefinition" @@ -19051,7 +19101,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 223 + "lineNumber": 227 }, "signature": [ "FunctionDefinition" @@ -19065,7 +19115,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 224 + "lineNumber": 228 }, "signature": [ "FunctionDefinition" @@ -19079,7 +19129,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 225 + "lineNumber": 229 }, "signature": [ "FunctionDefinition" @@ -19093,7 +19143,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 226 + "lineNumber": 230 }, "signature": [ "FunctionDefinition" @@ -19107,7 +19157,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 227 + "lineNumber": 231 }, "signature": [ "FunctionDefinition" @@ -19121,7 +19171,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 228 + "lineNumber": 232 }, "signature": [ "FunctionDefinition" @@ -19135,7 +19185,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 229 + "lineNumber": 233 }, "signature": [ "FunctionDefinition" @@ -19149,7 +19199,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 230 + "lineNumber": 234 }, "signature": [ "FunctionDefinition" @@ -19163,7 +19213,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 231 + "lineNumber": 235 }, "signature": [ "FunctionDefinition" @@ -19177,7 +19227,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 232 + "lineNumber": 236 }, "signature": [ "FunctionDefinition" @@ -19191,7 +19241,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 233 + "lineNumber": 237 }, "signature": [ "FunctionDefinition" @@ -19205,7 +19255,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 234 + "lineNumber": 238 }, "signature": [ "FunctionDefinition" @@ -19219,7 +19269,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 235 + "lineNumber": 239 }, "signature": [ "FunctionDefinition" @@ -19228,7 +19278,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 203 + "lineNumber": 206 }, "initialIsOpen": false }, @@ -20431,7 +20481,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", - "lineNumber": 14 + "lineNumber": 15 }, "signature": [ "{ filters?: Filter[] | undefined; query?: Query | Query[] | undefined; timeRange?: TimeRange | undefined; }" @@ -20477,7 +20527,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 23 + "lineNumber": 26 }, "signature": [ "ExpressionFunctionDefinition<\"kibana_context\", ", @@ -20508,7 +20558,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", - "lineNumber": 20 + "lineNumber": 21 }, "signature": [ "{ type: \"kibana_context\"; } & ExecutionContextSearch" @@ -20571,7 +20621,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 58 + "lineNumber": 59 }, "signature": [ "AggType>" @@ -20700,7 +20750,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", - "lineNumber": 27 + "lineNumber": 32 }, "signature": [ "{ type: \"kibana_context\"; } & ExecutionContextSearch" @@ -22632,7 +22682,7 @@ "description": [], "source": { "path": "src/plugins/data/common/es_query/filters/build_filters.ts", - "lineNumber": 40 + "lineNumber": 42 } }, { @@ -22645,7 +22695,7 @@ "description": [], "source": { "path": "src/plugins/data/common/es_query/filters/build_filters.ts", - "lineNumber": 41 + "lineNumber": 43 } }, { @@ -22658,7 +22708,7 @@ "description": [], "source": { "path": "src/plugins/data/common/es_query/filters/build_filters.ts", - "lineNumber": 42 + "lineNumber": 44 } }, { @@ -22671,7 +22721,7 @@ "description": [], "source": { "path": "src/plugins/data/common/es_query/filters/build_filters.ts", - "lineNumber": 43 + "lineNumber": 45 } }, { @@ -22684,7 +22734,7 @@ "description": [], "source": { "path": "src/plugins/data/common/es_query/filters/build_filters.ts", - "lineNumber": 44 + "lineNumber": 46 } }, { @@ -22703,7 +22753,7 @@ "description": [], "source": { "path": "src/plugins/data/common/es_query/filters/build_filters.ts", - "lineNumber": 45 + "lineNumber": 47 } } ], @@ -22711,7 +22761,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/es_query/filters/build_filters.ts", - "lineNumber": 39 + "lineNumber": 41 }, "initialIsOpen": false }, @@ -23040,7 +23090,7 @@ "section": "def-common.FilterStateStore", "text": "FilterStateStore" }, - ") => ", + " | undefined) => ", { "pluginId": "data", "scope": "common", @@ -23161,9 +23211,9 @@ } }, { - "type": "Enum", + "type": "CompoundType", "label": "store", - "isRequired": true, + "isRequired": false, "signature": [ { "pluginId": "data", @@ -23171,7 +23221,8 @@ "docId": "kibDataPluginApi", "section": "def-common.FilterStateStore", "text": "FilterStateStore" - } + }, + " | undefined" ], "description": [], "source": { @@ -27594,4 +27645,4 @@ } ] } -} +} \ No newline at end of file diff --git a/api_docs/data_enhanced.json b/api_docs/data_enhanced.json index 0505e87e796f42..5bd7a970f9b73a 100644 --- a/api_docs/data_enhanced.json +++ b/api_docs/data_enhanced.json @@ -531,8 +531,8 @@ "\nID of the async search request" ], "source": { - "path": "x-pack/plugins/data_enhanced/common/search/session/types.ts", - "lineNumber": 72 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 73 } }, { @@ -544,8 +544,8 @@ "\nSearch strategy used to submit the search request" ], "source": { - "path": "x-pack/plugins/data_enhanced/common/search/session/types.ts", - "lineNumber": 76 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 77 } }, { @@ -557,8 +557,8 @@ "\nstatus" ], "source": { - "path": "x-pack/plugins/data_enhanced/common/search/session/types.ts", - "lineNumber": 80 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 81 } }, { @@ -570,8 +570,8 @@ "\nAn optional error. Set if status is set to error." ], "source": { - "path": "x-pack/plugins/data_enhanced/common/search/session/types.ts", - "lineNumber": 84 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 85 }, "signature": [ "string | undefined" @@ -579,8 +579,8 @@ } ], "source": { - "path": "x-pack/plugins/data_enhanced/common/search/session/types.ts", - "lineNumber": 68 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 69 }, "initialIsOpen": false }, @@ -598,8 +598,8 @@ "label": "sessionId", "description": [], "source": { - "path": "x-pack/plugins/data_enhanced/common/search/session/types.ts", - "lineNumber": 12 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 13 } }, { @@ -611,8 +611,8 @@ "\nUser-facing session name to be displayed in session management" ], "source": { - "path": "x-pack/plugins/data_enhanced/common/search/session/types.ts", - "lineNumber": 16 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 17 }, "signature": [ "string | undefined" @@ -627,8 +627,8 @@ "\nApp that created the session. e.g 'discover'" ], "source": { - "path": "x-pack/plugins/data_enhanced/common/search/session/types.ts", - "lineNumber": 20 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 21 }, "signature": [ "string | undefined" @@ -643,8 +643,8 @@ "\nCreation time of the session" ], "source": { - "path": "x-pack/plugins/data_enhanced/common/search/session/types.ts", - "lineNumber": 24 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 25 } }, { @@ -656,8 +656,8 @@ "\nLast touch time of the session" ], "source": { - "path": "x-pack/plugins/data_enhanced/common/search/session/types.ts", - "lineNumber": 28 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 29 } }, { @@ -669,8 +669,8 @@ "\nExpiration time of the session. Expiration itself is managed by Elasticsearch." ], "source": { - "path": "x-pack/plugins/data_enhanced/common/search/session/types.ts", - "lineNumber": 32 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 33 } }, { @@ -682,14 +682,14 @@ "\nstatus" ], "source": { - "path": "x-pack/plugins/data_enhanced/common/search/session/types.ts", - "lineNumber": 36 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 37 }, "signature": [ { - "pluginId": "dataEnhanced", + "pluginId": "data", "scope": "common", - "docId": "kibDataEnhancedPluginApi", + "docId": "kibDataSearchPluginApi", "section": "def-common.SearchSessionStatus", "text": "SearchSessionStatus" } @@ -704,8 +704,8 @@ "\nurlGeneratorId" ], "source": { - "path": "x-pack/plugins/data_enhanced/common/search/session/types.ts", - "lineNumber": 40 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 41 }, "signature": [ "string | undefined" @@ -720,8 +720,8 @@ "\nThe application state that was used to create the session.\nShould be used, for example, to re-load an expired search session." ], "source": { - "path": "x-pack/plugins/data_enhanced/common/search/session/types.ts", - "lineNumber": 45 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 46 }, "signature": [ "Record | undefined" @@ -736,8 +736,8 @@ "\nApplication state that should be used to restore the session.\nFor example, relative dates are conveted to absolute ones." ], "source": { - "path": "x-pack/plugins/data_enhanced/common/search/session/types.ts", - "lineNumber": 50 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 51 }, "signature": [ "Record | undefined" @@ -752,15 +752,15 @@ "\nMapping of search request hashes to their corresponsing info (async search id, etc.)" ], "source": { - "path": "x-pack/plugins/data_enhanced/common/search/session/types.ts", - "lineNumber": 54 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 55 }, "signature": [ "Record, { expressions }: ", + ">, { logger, expressions }: ", { "pluginId": "data", "scope": "server", @@ -413,12 +413,12 @@ "description": [], "source": { "path": "src/plugins/data/server/index_patterns/index_patterns_service.ts", - "lineNumber": 47 + "lineNumber": 49 } }, { "type": "Object", - "label": "{ expressions }", + "label": "{ logger, expressions }", "isRequired": true, "signature": [ { @@ -432,7 +432,7 @@ "description": [], "source": { "path": "src/plugins/data/server/index_patterns/index_patterns_service.ts", - "lineNumber": 48 + "lineNumber": 50 } } ], @@ -440,7 +440,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/server/index_patterns/index_patterns_service.ts", - "lineNumber": 46 + "lineNumber": 48 } }, { @@ -507,7 +507,7 @@ "description": [], "source": { "path": "src/plugins/data/server/index_patterns/index_patterns_service.ts", - "lineNumber": 58 + "lineNumber": 76 } }, { @@ -526,7 +526,7 @@ "description": [], "source": { "path": "src/plugins/data/server/index_patterns/index_patterns_service.ts", - "lineNumber": 58 + "lineNumber": 76 } } ], @@ -534,13 +534,13 @@ "returnComment": [], "source": { "path": "src/plugins/data/server/index_patterns/index_patterns_service.ts", - "lineNumber": 58 + "lineNumber": 76 } } ], "source": { "path": "src/plugins/data/server/index_patterns/index_patterns_service.ts", - "lineNumber": 45 + "lineNumber": 47 }, "initialIsOpen": false } @@ -3455,7 +3455,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 464 + "lineNumber": 465 } } ], @@ -3476,7 +3476,7 @@ "label": "get", "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 464 + "lineNumber": 465 }, "tags": [], "returnComment": [] @@ -3524,7 +3524,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 483 + "lineNumber": 484 } }, { @@ -3537,7 +3537,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 483 + "lineNumber": 484 } } ], @@ -3547,7 +3547,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 483 + "lineNumber": 484 } }, { @@ -3593,7 +3593,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 508 + "lineNumber": 509 } }, { @@ -3608,7 +3608,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 508 + "lineNumber": 509 } }, { @@ -3623,7 +3623,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 508 + "lineNumber": 509 } } ], @@ -3631,7 +3631,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 508 + "lineNumber": 509 } }, { @@ -3677,7 +3677,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 521 + "lineNumber": 522 } }, { @@ -3692,7 +3692,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 521 + "lineNumber": 522 } } ], @@ -3700,7 +3700,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 521 + "lineNumber": 522 } }, { @@ -3738,7 +3738,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 547 + "lineNumber": 548 } }, { @@ -3751,7 +3751,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 548 + "lineNumber": 549 } }, { @@ -3764,7 +3764,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 549 + "lineNumber": 550 } } ], @@ -3772,7 +3772,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 546 + "lineNumber": 547 } }, { @@ -3798,7 +3798,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 632 + "lineNumber": 633 } } ], @@ -3806,7 +3806,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 632 + "lineNumber": 633 } } ], @@ -6710,7 +6710,7 @@ "description": [], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 638 + "lineNumber": 639 }, "signature": [ "{ get: (id: string) => Promise; delete: (indexPatternId: string) => Promise<{}>; create: (spec: IndexPatternSpec, skipFetchFields?: boolean) => Promise; ensureDefaultIndexPattern: EnsureDefaultIndexPattern; getIds: (refresh?: boolean) => Promise; getTitles: (refresh?: boolean) => Promise; find: (search: string, size?: number) => Promise; getIdsWithTitle: (refresh?: boolean) => Promise<{ id: string; title: string; }[]>; clearCache: (id?: string | undefined) => void; getCache: () => Promise[] | null | undefined>; getDefault: () => Promise; setDefault: (id: string, force?: boolean) => Promise; getFieldsForWildcard: (options: GetFieldsOptions) => Promise; getFieldsForIndexPattern: (indexPattern: IndexPattern | IndexPatternSpec, options?: GetFieldsOptions | undefined) => Promise; refreshFields: (indexPattern: IndexPattern) => Promise; fieldArrayToMap: (fields: FieldSpec[], fieldAttrs?: FieldAttrs | undefined) => Record; savedObjectToSpec: (savedObject: SavedObject) => IndexPatternSpec; createAndSave: (spec: IndexPatternSpec, override?: boolean, skipFetchFields?: boolean) => Promise; createSavedObject: (indexPattern: IndexPattern, override?: boolean) => Promise; updateSavedObject: (indexPattern: IndexPattern, saveAttempts?: number, ignoreErrors?: boolean) => Promise; }" diff --git a/api_docs/data_search.json b/api_docs/data_search.json index d0eb07083c2f6b..a75b669cbd288d 100644 --- a/api_docs/data_search.json +++ b/api_docs/data_search.json @@ -734,7 +734,7 @@ "section": "def-public.SessionService", "text": "SessionService" }, - ", \"start\" | \"destroy\" | \"state$\" | \"hasAccess\" | \"trackSearch\" | \"getSessionId\" | \"getSession$\" | \"isStored\" | \"isRestore\" | \"restore\" | \"clear\" | \"cancel\" | \"save\" | \"isCurrentSession\" | \"getSearchOptions\" | \"enableStorage\" | \"isSessionStorageReady\" | \"getSearchSessionIndicatorUiConfig\">" + ", \"start\" | \"destroy\" | \"state$\" | \"searchSessionName$\" | \"hasAccess\" | \"trackSearch\" | \"getSessionId\" | \"getSession$\" | \"isStored\" | \"isRestore\" | \"restore\" | \"clear\" | \"cancel\" | \"save\" | \"renameCurrentSession\" | \"isCurrentSession\" | \"getSearchOptions\" | \"enableStorage\" | \"isSessionStorageReady\" | \"getSearchSessionIndicatorUiConfig\">" ] }, { @@ -758,7 +758,7 @@ "section": "def-public.SessionsClient", "text": "SessionsClient" }, - ", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"extend\">" + ", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"rename\" | \"extend\">" ] } ], @@ -898,7 +898,7 @@ "section": "def-public.SessionService", "text": "SessionService" }, - ", \"start\" | \"destroy\" | \"state$\" | \"hasAccess\" | \"trackSearch\" | \"getSessionId\" | \"getSession$\" | \"isStored\" | \"isRestore\" | \"restore\" | \"clear\" | \"cancel\" | \"save\" | \"isCurrentSession\" | \"getSearchOptions\" | \"enableStorage\" | \"isSessionStorageReady\" | \"getSearchSessionIndicatorUiConfig\">" + ", \"start\" | \"destroy\" | \"state$\" | \"searchSessionName$\" | \"hasAccess\" | \"trackSearch\" | \"getSessionId\" | \"getSession$\" | \"isStored\" | \"isRestore\" | \"restore\" | \"clear\" | \"cancel\" | \"save\" | \"renameCurrentSession\" | \"isCurrentSession\" | \"getSearchOptions\" | \"enableStorage\" | \"isSessionStorageReady\" | \"getSearchSessionIndicatorUiConfig\">" ] }, { @@ -922,7 +922,7 @@ "section": "def-public.SessionsClient", "text": "SessionsClient" }, - ", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"extend\">" + ", \"get\" | \"delete\" | \"create\" | \"find\" | \"update\" | \"rename\" | \"extend\">" ] } ], @@ -1083,7 +1083,7 @@ "section": "def-public.SessionService", "text": "SessionService" }, - ", \"start\" | \"destroy\" | \"state$\" | \"hasAccess\" | \"trackSearch\" | \"getSessionId\" | \"getSession$\" | \"isStored\" | \"isRestore\" | \"restore\" | \"clear\" | \"cancel\" | \"save\" | \"isCurrentSession\" | \"getSearchOptions\" | \"enableStorage\" | \"isSessionStorageReady\" | \"getSearchSessionIndicatorUiConfig\">" + ", \"start\" | \"destroy\" | \"state$\" | \"searchSessionName$\" | \"hasAccess\" | \"trackSearch\" | \"getSessionId\" | \"getSession$\" | \"isStored\" | \"isRestore\" | \"restore\" | \"clear\" | \"cancel\" | \"save\" | \"renameCurrentSession\" | \"isCurrentSession\" | \"getSearchOptions\" | \"enableStorage\" | \"isSessionStorageReady\" | \"getSearchSessionIndicatorUiConfig\">" ] } ], @@ -1122,12 +1122,28 @@ ], "source": { "path": "src/plugins/data/public/search/session/session_service.ts", - "lineNumber": 39 + "lineNumber": 45 }, "signature": [ "() => Promise" ] }, + { + "tags": [], + "id": "def-public.SearchSessionInfoProvider.appendSessionStartTimeToName", + "type": "CompoundType", + "label": "appendSessionStartTimeToName", + "description": [ + "\nAppend session start time to a session name,\n`true` by default" + ], + "source": { + "path": "src/plugins/data/public/search/session/session_service.ts", + "lineNumber": 51 + }, + "signature": [ + "boolean | undefined" + ] + }, { "tags": [], "id": "def-public.SearchSessionInfoProvider.getUrlGeneratorData", @@ -1136,7 +1152,7 @@ "description": [], "source": { "path": "src/plugins/data/public/search/session/session_service.ts", - "lineNumber": 40 + "lineNumber": 53 }, "signature": [ "() => Promise<{ urlGeneratorId: ID; initialState: ", @@ -1161,7 +1177,7 @@ ], "source": { "path": "src/plugins/data/public/search/session/session_service.ts", - "lineNumber": 34 + "lineNumber": 40 }, "initialIsOpen": false } @@ -1179,7 +1195,7 @@ ], "source": { "path": "src/plugins/data/public/search/session/search_session_state.ts", - "lineNumber": 19 + "lineNumber": 20 }, "initialIsOpen": false }, @@ -1268,10 +1284,10 @@ "description": [], "source": { "path": "src/plugins/data/public/search/session/sessions_client.ts", - "lineNumber": 13 + "lineNumber": 18 }, "signature": [ - "{ get: (sessionId: string) => Promise>; delete: (sessionId: string) => Promise; create: ({ name, appId, urlGeneratorId, initialState, restoreState, sessionId, }: { name: string; appId: string; initialState: Record; restoreState: Record; urlGeneratorId: string; sessionId: string; }) => Promise>; find: (options: Pick) => Promise>; update: (sessionId: string, attributes: unknown) => Promise>; extend: (sessionId: string, expires: string) => Promise>; }" + "{ get: (sessionId: string) => Promise; delete: (sessionId: string) => Promise; create: ({ name, appId, urlGeneratorId, initialState, restoreState, sessionId, }: { name: string; appId: string; initialState: Record; restoreState: Record; urlGeneratorId: string; sessionId: string; }) => Promise; find: (options: Pick) => Promise>; update: (sessionId: string, attributes: unknown) => Promise>; rename: (sessionId: string, newName: string) => Promise>>; extend: (sessionId: string, expires: string) => Promise>; }" ], "initialIsOpen": false }, @@ -1283,10 +1299,10 @@ "description": [], "source": { "path": "src/plugins/data/public/search/session/session_service.ts", - "lineNumber": 25 + "lineNumber": 31 }, "signature": [ - "{ start: () => string; destroy: () => void; readonly state$: Observable; hasAccess: () => boolean; trackSearch: (searchDescriptor: TrackSearchDescriptor) => () => void; getSessionId: () => string | undefined; getSession$: () => Observable; isStored: () => boolean; isRestore: () => boolean; restore: (sessionId: string) => void; clear: () => void; cancel: () => Promise; save: () => Promise; isCurrentSession: (sessionId?: string | undefined) => boolean; getSearchOptions: (sessionId?: string | undefined) => Required> | null; enableStorage: (searchSessionInfoProvider: SearchSessionInfoProvider, searchSessionIndicatorUiConfig?: SearchSessionIndicatorUiConfig | undefined) => void; isSessionStorageReady: () => boolean; getSearchSessionIndicatorUiConfig: () => SearchSessionIndicatorUiConfig; }" + "{ start: () => string; destroy: () => void; readonly state$: Observable; readonly searchSessionName$: Observable; hasAccess: () => boolean; trackSearch: (searchDescriptor: TrackSearchDescriptor) => () => void; getSessionId: () => string | undefined; getSession$: () => Observable; isStored: () => boolean; isRestore: () => boolean; restore: (sessionId: string) => void; clear: () => void; cancel: () => Promise; save: () => Promise; renameCurrentSession: (newName: string) => Promise; isCurrentSession: (sessionId?: string | undefined) => boolean; getSearchOptions: (sessionId?: string | undefined) => Required> | null; enableStorage: (searchSessionInfoProvider: SearchSessionInfoProvider, searchSessionIndicatorUiConfig?: SearchSessionIndicatorUiConfig | undefined) => void; isSessionStorageReady: () => boolean; getSearchSessionIndicatorUiConfig: () => SearchSessionIndicatorUiConfig; }" ], "initialIsOpen": false }, @@ -1605,7 +1621,7 @@ "description": [], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 90 + "lineNumber": 88 }, "signature": [ "(sessionId: string, attributes: Partial) => Promise<", @@ -1627,7 +1643,7 @@ "description": [], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 91 + "lineNumber": 89 }, "signature": [ "(sessionId: string) => Promise<", @@ -1649,7 +1665,7 @@ "description": [], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 92 + "lineNumber": 90 }, "signature": [ "(options: Pick<", @@ -1679,7 +1695,7 @@ "description": [], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 93 + "lineNumber": 91 }, "signature": [ "(sessionId: string, attributes: Partial) => Promise<", @@ -1701,7 +1717,7 @@ "description": [], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 94 + "lineNumber": 92 }, "signature": [ "(sessionId: string) => Promise<{}>" @@ -1715,7 +1731,7 @@ "description": [], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 95 + "lineNumber": 93 }, "signature": [ "(sessionId: string) => Promise<{}>" @@ -1729,7 +1745,7 @@ "description": [], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 96 + "lineNumber": 94 }, "signature": [ "(sessionId: string, expires: Date) => Promise<", @@ -1746,7 +1762,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 89 + "lineNumber": 87 }, "initialIsOpen": false }, @@ -1827,7 +1843,7 @@ "description": [], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 43 + "lineNumber": 41 }, "signature": [ { @@ -1849,7 +1865,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 48 + "lineNumber": 46 }, "signature": [ " ", @@ -1993,7 +2009,7 @@ "description": [], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 112 + "lineNumber": 110 }, "signature": [ "(request: ", @@ -2022,7 +2038,7 @@ "description": [], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 113 + "lineNumber": 111 }, "signature": [ "{ asScoped: (request: ", @@ -2047,7 +2063,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 99 + "lineNumber": 97 }, "initialIsOpen": false }, @@ -2078,7 +2094,7 @@ "description": [], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 75 + "lineNumber": 73 }, "signature": [ "(request: SearchStrategyRequest, options: ", @@ -2110,7 +2126,7 @@ "description": [], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 80 + "lineNumber": 78 }, "signature": [ "((id: string, options: ", @@ -2140,7 +2156,7 @@ "description": [], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 81 + "lineNumber": 79 }, "signature": [ "((id: string, keepAlive: string, options: ", @@ -2165,7 +2181,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 71 + "lineNumber": 69 }, "initialIsOpen": false }, @@ -2184,7 +2200,7 @@ "description": [], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 36 + "lineNumber": 34 }, "signature": [ "Pick<", @@ -2206,7 +2222,7 @@ "description": [], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 37 + "lineNumber": 35 }, "signature": [ { @@ -2226,7 +2242,7 @@ "description": [], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 38 + "lineNumber": 36 }, "signature": [ { @@ -2246,7 +2262,7 @@ "description": [], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 39 + "lineNumber": 37 }, "signature": [ { @@ -2262,7 +2278,7 @@ ], "source": { "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 35 + "lineNumber": 33 }, "initialIsOpen": false }, @@ -2328,23 +2344,7 @@ } ], "enums": [], - "misc": [ - { - "id": "def-server.SearchRequestHandlerContext", - "type": "Type", - "label": "SearchRequestHandlerContext", - "tags": [], - "description": [], - "source": { - "path": "src/plugins/data/server/search/types.ts", - "lineNumber": 118 - }, - "signature": [ - "IScopedSearchClient" - ], - "initialIsOpen": false - } - ], + "misc": [], "objects": [] }, "common": { @@ -2955,7 +2955,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 263 + "lineNumber": 265 } }, { @@ -2981,7 +2981,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 294 + "lineNumber": 296 } }, { @@ -3001,7 +3001,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 305 + "lineNumber": 307 } }, { @@ -3027,7 +3027,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 314 + "lineNumber": 316 } }, { @@ -3059,7 +3059,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 369 + "lineNumber": 371 } }, { @@ -3083,7 +3083,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 373 + "lineNumber": 375 } }, { @@ -3107,7 +3107,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 377 + "lineNumber": 379 } }, { @@ -3129,7 +3129,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 381 + "lineNumber": 383 } } ], @@ -3137,7 +3137,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 381 + "lineNumber": 383 } }, { @@ -3159,7 +3159,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 385 + "lineNumber": 387 } }, { @@ -3172,7 +3172,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 385 + "lineNumber": 387 } } ], @@ -3180,7 +3180,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 385 + "lineNumber": 387 } }, { @@ -3196,7 +3196,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 393 + "lineNumber": 395 } }, { @@ -3212,7 +3212,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 399 + "lineNumber": 401 } }, { @@ -3230,7 +3230,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 408 + "lineNumber": 410 } }, { @@ -3252,7 +3252,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 412 + "lineNumber": 414 } } ], @@ -3260,7 +3260,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 412 + "lineNumber": 414 } }, { @@ -3283,7 +3283,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 426 + "lineNumber": 428 } }, { @@ -3307,7 +3307,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 430 + "lineNumber": 432 } }, { @@ -3323,7 +3323,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 434 + "lineNumber": 436 } }, { @@ -3339,7 +3339,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 439 + "lineNumber": 441 } }, { @@ -3350,7 +3350,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 446 + "lineNumber": 448 }, "signature": [ { @@ -3370,7 +3370,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 450 + "lineNumber": 452 }, "signature": [ { @@ -3415,7 +3415,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 480 + "lineNumber": 482 } } ], @@ -3423,7 +3423,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 480 + "lineNumber": 482 } } ], @@ -3448,7 +3448,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 58 + "lineNumber": 65 }, "signature": [ { @@ -3468,7 +3468,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 59 + "lineNumber": 66 }, "signature": [ { @@ -3489,7 +3489,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 62 + "lineNumber": 69 }, "signature": [ { @@ -3527,7 +3527,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 65 + "lineNumber": 72 } }, { @@ -3564,7 +3564,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 66 + "lineNumber": 73 } }, { @@ -3583,7 +3583,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 67 + "lineNumber": 74 } } ], @@ -3591,7 +3591,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 64 + "lineNumber": 71 } }, { @@ -3627,7 +3627,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 79 + "lineNumber": 86 } } ], @@ -3635,7 +3635,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 79 + "lineNumber": 86 } }, { @@ -3664,7 +3664,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 97 + "lineNumber": 104 } } ], @@ -3672,7 +3672,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 97 + "lineNumber": 104 } }, { @@ -3713,7 +3713,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 111 + "lineNumber": 118 } }, { @@ -3726,7 +3726,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 112 + "lineNumber": 119 } } ], @@ -3776,7 +3776,7 @@ "label": "createAggConfig", "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 110 + "lineNumber": 117 }, "tags": [], "returnComment": [] @@ -3819,7 +3819,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 153 + "lineNumber": 160 } } ], @@ -3827,7 +3827,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 153 + "lineNumber": 160 } }, { @@ -3849,7 +3849,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 165 + "lineNumber": 172 } } ], @@ -3857,7 +3857,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 165 + "lineNumber": 172 } }, { @@ -3881,7 +3881,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 227 + "lineNumber": 241 } }, { @@ -3910,7 +3910,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 231 + "lineNumber": 245 } } ], @@ -3918,7 +3918,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 231 + "lineNumber": 245 } }, { @@ -3948,7 +3948,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 235 + "lineNumber": 249 } } ], @@ -3956,7 +3956,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 235 + "lineNumber": 249 } }, { @@ -3986,7 +3986,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 239 + "lineNumber": 253 } } ], @@ -3994,7 +3994,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 239 + "lineNumber": 253 } }, { @@ -4024,7 +4024,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 243 + "lineNumber": 257 } } ], @@ -4032,7 +4032,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 243 + "lineNumber": 257 } }, { @@ -4062,7 +4062,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 247 + "lineNumber": 261 } } ], @@ -4070,7 +4070,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 247 + "lineNumber": 261 } }, { @@ -4100,7 +4100,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 251 + "lineNumber": 265 } } ], @@ -4108,7 +4108,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 251 + "lineNumber": 265 } }, { @@ -4132,7 +4132,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 255 + "lineNumber": 269 } }, { @@ -4162,7 +4162,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 269 + "lineNumber": 283 } } ], @@ -4170,7 +4170,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 269 + "lineNumber": 283 } }, { @@ -4198,7 +4198,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 284 + "lineNumber": 298 } }, { @@ -4232,7 +4232,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 298 + "lineNumber": 312 } } ], @@ -4242,7 +4242,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 298 + "lineNumber": 312 } }, { @@ -4288,7 +4288,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 307 + "lineNumber": 321 } }, { @@ -4308,7 +4308,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 307 + "lineNumber": 321 } } ], @@ -4316,13 +4316,13 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 307 + "lineNumber": 321 } } ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 57 + "lineNumber": 64 }, "initialIsOpen": false }, @@ -4572,7 +4572,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 70 + "lineNumber": 71 } }, { @@ -4583,7 +4583,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 72 + "lineNumber": 73 } }, { @@ -4594,7 +4594,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 73 + "lineNumber": 74 }, "signature": [ "string | undefined" @@ -4613,7 +4613,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 80 + "lineNumber": 81 } }, { @@ -4629,7 +4629,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 87 + "lineNumber": 88 } }, { @@ -4645,7 +4645,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 94 + "lineNumber": 95 } }, { @@ -4658,7 +4658,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 99 + "lineNumber": 100 }, "signature": [ "\"string\" | \"number\" | \"boolean\" | \"object\" | \"date\" | \"ip\" | \"_source\" | \"attachment\" | \"geo_point\" | \"geo_shape\" | \"murmur3\" | \"unknown\" | \"conflict\" | \"nested\" | \"histogram\" | \"null\" | undefined" @@ -4676,7 +4676,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 108 + "lineNumber": 109 }, "signature": [ "((aggConfig: TAggConfig) => string) | (() => string)" @@ -4695,7 +4695,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 123 + "lineNumber": 124 }, "signature": [ "any" @@ -4713,7 +4713,22 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 131 + "lineNumber": 132 + } + }, + { + "tags": [ + "type" + ], + "id": "def-common.AggType.hasNoDslParams", + "type": "boolean", + "label": "hasNoDslParams", + "description": [ + "\nFlag that prevents params from this aggregation from being included in the dsl. Sibling and parent aggs are still written.\n" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_type.ts", + "lineNumber": 138 } }, { @@ -4726,7 +4741,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 138 + "lineNumber": 145 }, "signature": [ "((aggConfig: TAggConfig, key: any, params?: any) => any) | undefined" @@ -4745,7 +4760,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 145 + "lineNumber": 152 }, "signature": [ "TParam[]" @@ -4763,7 +4778,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 155 + "lineNumber": 162 }, "signature": [ "((aggConfig: TAggConfig) => TAggConfig[]) | (() => void | TAggConfig[])" @@ -4781,7 +4796,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 166 + "lineNumber": 173 }, "signature": [ "((aggConfig: TAggConfig) => TAggConfig[]) | (() => void | TAggConfig[])" @@ -4797,7 +4812,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 171 + "lineNumber": 178 }, "signature": [ "() => any" @@ -4815,7 +4830,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 184 + "lineNumber": 191 }, "signature": [ "(resp: any, aggConfigs: ", @@ -4857,7 +4872,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 202 + "lineNumber": 209 }, "signature": [ "(agg: TAggConfig) => ", @@ -4879,7 +4894,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 204 + "lineNumber": 211 }, "signature": [ "(agg: TAggConfig, bucket: any) => any" @@ -4893,7 +4908,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 206 + "lineNumber": 213 }, "signature": [ "((bucket: any, key: any, agg: TAggConfig) => any) | undefined" @@ -4913,7 +4928,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 208 + "lineNumber": 215 } } ], @@ -4924,7 +4939,7 @@ "label": "paramByName", "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 208 + "lineNumber": 215 }, "tags": [], "returnComment": [] @@ -4943,7 +4958,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 212 + "lineNumber": 219 } } ], @@ -4954,7 +4969,7 @@ "label": "getValueBucketPath", "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 212 + "lineNumber": 219 }, "tags": [], "returnComment": [] @@ -4997,7 +5012,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 225 + "lineNumber": 232 } } ], @@ -5008,13 +5023,13 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 225 + "lineNumber": 232 } } ], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 60 + "lineNumber": 61 }, "initialIsOpen": false }, @@ -6450,7 +6465,7 @@ "type": "Function", "label": "setField", "signature": [ - "(field: K, value: ", + "(field: K, value: ", { "pluginId": "data", "scope": "common", @@ -6514,7 +6529,7 @@ "type": "Function", "label": "removeField", "signature": [ - "(field: K) => this" + "(field: K) => this" ], "description": [ "\nremove field" @@ -6641,7 +6656,7 @@ "type": "Function", "label": "getField", "signature": [ - "(field: K, recurse?: boolean) => ", + "(field: K, recurse?: boolean) => ", { "pluginId": "data", "scope": "common", @@ -6694,7 +6709,7 @@ "type": "Function", "label": "getOwnField", "signature": [ - "(field: K) => ", + "(field: K) => ", { "pluginId": "data", "scope": "common", @@ -7625,6 +7640,23 @@ "returnComment": [], "initialIsOpen": false }, + { + "id": "def-common.aggFilteredMetric", + "type": "Function", + "children": [], + "signature": [ + "() => FunctionDefinition" + ], + "description": [], + "label": "aggFilteredMetric", + "source": { + "path": "src/plugins/data/common/search/aggs/metrics/filtered_metric_fn.ts", + "lineNumber": 30 + }, + "tags": [], + "returnComment": [], + "initialIsOpen": false + }, { "id": "def-common.aggFilters", "type": "Function", @@ -8457,6 +8489,76 @@ }, "initialIsOpen": false }, + { + "id": "def-common.filtersToAst", + "type": "Function", + "children": [ + { + "type": "CompoundType", + "label": "filters", + "isRequired": true, + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + "[]" + ], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/filters_to_ast.ts", + "lineNumber": 13 + } + } + ], + "signature": [ + "(filters: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + "[]) => ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionAstExpressionBuilder", + "text": "ExpressionAstExpressionBuilder" + }, + "[]" + ], + "description": [], + "label": "filtersToAst", + "source": { + "path": "src/plugins/data/common/search/expressions/filters_to_ast.ts", + "lineNumber": 13 + }, + "tags": [], + "returnComment": [], + "initialIsOpen": false + }, { "id": "def-common.functionWrapper", "type": "Function", @@ -8983,31 +9085,92 @@ { "id": "def-common.getFilterBucketAgg", "type": "Function", - "children": [], - "signature": [ - "() => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.BucketAggType", - "text": "BucketAggType" - }, - "<", + "children": [ { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IBucketAggConfig", - "text": "IBucketAggConfig" - }, - ">" - ], - "description": [], - "label": "getFilterBucketAgg", - "source": { - "path": "src/plugins/data/common/search/aggs/buckets/filter.ts", - "lineNumber": 24 + "id": "def-common.getFilterBucketAgg.{-getConfig }", + "type": "Object", + "label": "{ getConfig }", + "tags": [], + "description": [], + "children": [ + { + "tags": [], + "id": "def-common.getFilterBucketAgg.{-getConfig }.getConfig", + "type": "Function", + "label": "getConfig", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/filter.ts", + "lineNumber": 27 + }, + "signature": [ + "(key: string) => any" + ] + } + ], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/filter.ts", + "lineNumber": 27 + } + } + ], + "signature": [ + "({ getConfig }: { getConfig: (key: string) => any; }) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.BucketAggType", + "text": "BucketAggType" + }, + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IBucketAggConfig", + "text": "IBucketAggConfig" + }, + ">" + ], + "description": [], + "label": "getFilterBucketAgg", + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/filter.ts", + "lineNumber": 27 + }, + "tags": [], + "returnComment": [], + "initialIsOpen": false + }, + { + "id": "def-common.getFilteredMetricAgg", + "type": "Function", + "children": [], + "signature": [ + "() => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.MetricAggType", + "text": "MetricAggType" + }, + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IMetricAggConfig", + "text": "IMetricAggConfig" + }, + ">" + ], + "description": [], + "label": "getFilteredMetricAgg", + "source": { + "path": "src/plugins/data/common/search/aggs/metrics/filtered_metric.ts", + "lineNumber": 30 }, "tags": [], "returnComment": [], @@ -10920,6 +11083,58 @@ }, "initialIsOpen": false }, + { + "id": "def-common.queryToAst", + "type": "Function", + "children": [ + { + "type": "Object", + "label": "query", + "isRequired": true, + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + } + ], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/query_to_ast.ts", + "lineNumber": 14 + } + } + ], + "signature": [ + "(query: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, + ") => ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionAstExpressionBuilder", + "text": "ExpressionAstExpressionBuilder" + } + ], + "description": [], + "label": "queryToAst", + "source": { + "path": "src/plugins/data/common/search/expressions/query_to_ast.ts", + "lineNumber": 14 + }, + "tags": [], + "returnComment": [], + "initialIsOpen": false + }, { "id": "def-common.splitStringInterval", "type": "Function", @@ -11300,6 +11515,67 @@ }, "initialIsOpen": false }, + { + "id": "def-common.timerangeToAst", + "type": "Function", + "children": [ + { + "type": "Object", + "label": "timerange", + "isRequired": true, + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + } + ], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/timerange_to_ast.ts", + "lineNumber": 13 + } + } + ], + "signature": [ + "(timerange: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, + ") => ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionAstFunctionBuilder", + "text": "ExpressionAstFunctionBuilder" + }, + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ExpressionFunctionKibanaTimerange", + "text": "ExpressionFunctionKibanaTimerange" + }, + ">" + ], + "description": [], + "label": "timerangeToAst", + "source": { + "path": "src/plugins/data/common/search/expressions/timerange_to_ast.ts", + "lineNumber": 13 + }, + "tags": [], + "returnComment": [], + "initialIsOpen": false + }, { "id": "def-common.toAbsoluteDates", "type": "Function", @@ -11362,7 +11638,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 38 + "lineNumber": 45 }, "signature": [ { @@ -11377,7 +11653,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 37 + "lineNumber": 44 }, "initialIsOpen": false }, @@ -11398,7 +11674,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 204 + "lineNumber": 207 }, "signature": [ "FunctionDefinition" @@ -11412,7 +11688,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 205 + "lineNumber": 208 }, "signature": [ "FunctionDefinition" @@ -11426,7 +11702,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 206 + "lineNumber": 209 }, "signature": [ "FunctionDefinition" @@ -11440,7 +11716,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 207 + "lineNumber": 210 }, "signature": [ "FunctionDefinition" @@ -11454,7 +11730,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 208 + "lineNumber": 211 }, "signature": [ "FunctionDefinition" @@ -11468,7 +11744,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 209 + "lineNumber": 212 }, "signature": [ "FunctionDefinition" @@ -11482,7 +11758,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 210 + "lineNumber": 213 }, "signature": [ "FunctionDefinition" @@ -11496,7 +11772,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 211 + "lineNumber": 214 }, "signature": [ "FunctionDefinition" @@ -11510,7 +11786,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 212 + "lineNumber": 215 }, "signature": [ "FunctionDefinition" @@ -11524,7 +11800,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 213 + "lineNumber": 216 }, "signature": [ "FunctionDefinition" @@ -11538,7 +11814,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 214 + "lineNumber": 217 }, "signature": [ "FunctionDefinition" @@ -11552,7 +11828,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 215 + "lineNumber": 218 }, "signature": [ "FunctionDefinition" @@ -11566,7 +11842,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 216 + "lineNumber": 219 }, "signature": [ "FunctionDefinition" @@ -11580,7 +11856,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 217 + "lineNumber": 220 }, "signature": [ "FunctionDefinition" @@ -11594,7 +11870,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 218 + "lineNumber": 221 }, "signature": [ "FunctionDefinition" @@ -11608,7 +11884,21 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 219 + "lineNumber": 222 + }, + "signature": [ + "FunctionDefinition" + ] + }, + { + "tags": [], + "id": "def-common.AggFunctionsMapping.aggFilteredMetric", + "type": "Object", + "label": "aggFilteredMetric", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/types.ts", + "lineNumber": 223 }, "signature": [ "FunctionDefinition" @@ -11622,7 +11912,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 220 + "lineNumber": 224 }, "signature": [ "FunctionDefinition" @@ -11636,7 +11926,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 221 + "lineNumber": 225 }, "signature": [ "FunctionDefinition" @@ -11650,7 +11940,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 222 + "lineNumber": 226 }, "signature": [ "FunctionDefinition" @@ -11664,7 +11954,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 223 + "lineNumber": 227 }, "signature": [ "FunctionDefinition" @@ -11678,7 +11968,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 224 + "lineNumber": 228 }, "signature": [ "FunctionDefinition" @@ -11692,7 +11982,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 225 + "lineNumber": 229 }, "signature": [ "FunctionDefinition" @@ -11706,7 +11996,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 226 + "lineNumber": 230 }, "signature": [ "FunctionDefinition" @@ -11720,7 +12010,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 227 + "lineNumber": 231 }, "signature": [ "FunctionDefinition" @@ -11734,7 +12024,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 228 + "lineNumber": 232 }, "signature": [ "FunctionDefinition" @@ -11748,7 +12038,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 229 + "lineNumber": 233 }, "signature": [ "FunctionDefinition" @@ -11762,7 +12052,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 230 + "lineNumber": 234 }, "signature": [ "FunctionDefinition" @@ -11776,7 +12066,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 231 + "lineNumber": 235 }, "signature": [ "FunctionDefinition" @@ -11790,7 +12080,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 232 + "lineNumber": 236 }, "signature": [ "FunctionDefinition" @@ -11804,7 +12094,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 233 + "lineNumber": 237 }, "signature": [ "FunctionDefinition" @@ -11818,7 +12108,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 234 + "lineNumber": 238 }, "signature": [ "FunctionDefinition" @@ -11832,7 +12122,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 235 + "lineNumber": 239 }, "signature": [ "FunctionDefinition" @@ -11841,7 +12131,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 203 + "lineNumber": 206 }, "initialIsOpen": false }, @@ -12710,7 +13000,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/buckets/filter.ts", - "lineNumber": 21 + "lineNumber": 24 }, "signature": [ "Partial<{ top_left: GeoPoint; top_right: GeoPoint; bottom_right: GeoPoint; bottom_left: GeoPoint; }> | { wkt: string; } | GeoBox | undefined" @@ -12719,23 +13009,92 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/filter.ts", - "lineNumber": 20 + "lineNumber": 23 }, "initialIsOpen": false }, { - "id": "def-common.AggParamsFilters", + "id": "def-common.AggParamsFilteredMetric", "type": "Interface", - "label": "AggParamsFilters", + "label": "AggParamsFilteredMetric", "signature": [ { "pluginId": "data", "scope": "common", "docId": "kibDataSearchPluginApi", - "section": "def-common.AggParamsFilters", - "text": "AggParamsFilters" + "section": "def-common.AggParamsFilteredMetric", + "text": "AggParamsFilteredMetric" }, - " extends Pick<", + " extends ", + "BaseAggParams" + ], + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.AggParamsFilteredMetric.customMetric", + "type": "Object", + "label": "customMetric", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/metrics/filtered_metric.ts", + "lineNumber": 18 + }, + "signature": [ + "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SerializableState", + "text": "SerializableState" + }, + " | undefined; schema?: string | undefined; } | undefined" + ] + }, + { + "tags": [], + "id": "def-common.AggParamsFilteredMetric.customBucket", + "type": "Object", + "label": "customBucket", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/metrics/filtered_metric.ts", + "lineNumber": 19 + }, + "signature": [ + "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SerializableState", + "text": "SerializableState" + }, + " | undefined; schema?: string | undefined; } | undefined" + ] + } + ], + "source": { + "path": "src/plugins/data/common/search/aggs/metrics/filtered_metric.ts", + "lineNumber": 17 + }, + "initialIsOpen": false + }, + { + "id": "def-common.AggParamsFilters", + "type": "Interface", + "label": "AggParamsFilters", + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggParamsFilters", + "text": "AggParamsFilters" + }, + " extends Pick<", "BaseAggParams", ", \"json\">" ], @@ -14234,6 +14593,20 @@ "boolean | undefined" ] }, + { + "tags": [], + "id": "def-common.AggTypeConfig.hasNoDslParams", + "type": "CompoundType", + "label": "hasNoDslParams", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_type.ts", + "lineNumber": 35 + }, + "signature": [ + "boolean | undefined" + ] + }, { "tags": [], "id": "def-common.AggTypeConfig.params", @@ -14242,7 +14615,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 35 + "lineNumber": 36 }, "signature": [ "Partial[] | undefined" @@ -14256,7 +14629,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 36 + "lineNumber": 37 }, "signature": [ "\"string\" | \"number\" | \"boolean\" | \"object\" | \"date\" | \"ip\" | \"_source\" | \"attachment\" | \"geo_point\" | \"geo_shape\" | \"murmur3\" | \"unknown\" | \"conflict\" | \"nested\" | \"histogram\" | \"null\" | undefined" @@ -14270,7 +14643,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 37 + "lineNumber": 38 }, "signature": [ "((aggConfig: TAggConfig) => TAggConfig[]) | (() => void | TAggConfig[]) | undefined" @@ -14284,7 +14657,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 38 + "lineNumber": 39 }, "signature": [ "((aggConfig: TAggConfig) => TAggConfig[]) | (() => void | TAggConfig[]) | undefined" @@ -14298,7 +14671,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 39 + "lineNumber": 40 }, "signature": [ "boolean | undefined" @@ -14312,7 +14685,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 40 + "lineNumber": 41 }, "signature": [ "boolean | undefined" @@ -14326,7 +14699,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 41 + "lineNumber": 42 }, "signature": [ "(() => any) | undefined" @@ -14340,7 +14713,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 42 + "lineNumber": 43 }, "signature": [ "((resp: any, aggConfigs: ", @@ -14378,7 +14751,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 51 + "lineNumber": 52 }, "signature": [ "((agg: TAggConfig) => ", @@ -14400,7 +14773,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 52 + "lineNumber": 53 }, "signature": [ "((agg: TAggConfig, bucket: any) => any) | undefined" @@ -14414,7 +14787,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 53 + "lineNumber": 54 }, "signature": [ "((bucket: any, key: any, agg: TAggConfig) => any) | undefined" @@ -14428,7 +14801,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 54 + "lineNumber": 55 }, "signature": [ "((agg: TAggConfig) => string) | undefined" @@ -16306,74 +16679,49 @@ "initialIsOpen": false }, { - "id": "def-common.SearchSourceDependencies", + "id": "def-common.SearchSessionFindOptions", "type": "Interface", - "label": "SearchSourceDependencies", - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceDependencies", - "text": "SearchSourceDependencies" - }, - " extends ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.FetchHandlers", - "text": "FetchHandlers" - } - ], + "label": "SearchSessionFindOptions", "description": [], "tags": [], "children": [ { "tags": [], - "id": "def-common.SearchSourceDependencies.search", - "type": "Function", - "label": "search", + "id": "def-common.SearchSessionFindOptions.page", + "type": "number", + "label": "page", "description": [], "source": { - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 99 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 89 }, "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ISearchGeneric", - "text": "ISearchGeneric" - } + "number | undefined" ] - } - ], - "source": { - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 98 - }, - "initialIsOpen": false - }, - { - "id": "def-common.SearchSourceFields", - "type": "Interface", - "label": "SearchSourceFields", - "description": [ - "\nsearch source fields" - ], - "tags": [], - "children": [ + }, { "tags": [], - "id": "def-common.SearchSourceFields.type", + "id": "def-common.SearchSessionFindOptions.perPage", + "type": "number", + "label": "perPage", + "description": [], + "source": { + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 90 + }, + "signature": [ + "number | undefined" + ] + }, + { + "tags": [], + "id": "def-common.SearchSessionFindOptions.sortField", "type": "string", - "label": "type", + "label": "sortField", "description": [], "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 62 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 91 }, "signature": [ "string | undefined" @@ -16381,330 +16729,315 @@ }, { "tags": [], - "id": "def-common.SearchSourceFields.query", - "type": "Object", - "label": "query", - "description": [ - "\n{@link Query}" - ], + "id": "def-common.SearchSessionFindOptions.sortOrder", + "type": "string", + "label": "sortOrder", + "description": [], "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 66 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 92 }, "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.Query", - "text": "Query" - }, - " | undefined" + "string | undefined" ] }, { "tags": [], - "id": "def-common.SearchSourceFields.filter", - "type": "CompoundType", + "id": "def-common.SearchSessionFindOptions.filter", + "type": "string", "label": "filter", - "description": [ - "\n{@link Filter}" - ], + "description": [], "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 70 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 93 }, "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataPluginApi", - "section": "def-common.Filter", - "text": "Filter" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataPluginApi", - "section": "def-common.Filter", - "text": "Filter" - }, - "[] | (() => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataPluginApi", - "section": "def-common.Filter", - "text": "Filter" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataPluginApi", - "section": "def-common.Filter", - "text": "Filter" - }, - "[] | undefined) | undefined" + "string | undefined" ] - }, + } + ], + "source": { + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 88 + }, + "initialIsOpen": false + }, + { + "id": "def-common.SearchSessionRequestInfo", + "type": "Interface", + "label": "SearchSessionRequestInfo", + "description": [], + "tags": [], + "children": [ { "tags": [], - "id": "def-common.SearchSourceFields.sort", - "type": "CompoundType", - "label": "sort", + "id": "def-common.SearchSessionRequestInfo.id", + "type": "string", + "label": "id", "description": [ - "\n{@link EsQuerySortValue}" + "\nID of the async search request" ], "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 74 - }, - "signature": [ - "Record | Record[] | undefined" - ] + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 73 + } }, { "tags": [], - "id": "def-common.SearchSourceFields.highlight", - "type": "Any", - "label": "highlight", - "description": [], + "id": "def-common.SearchSessionRequestInfo.strategy", + "type": "string", + "label": "strategy", + "description": [ + "\nSearch strategy used to submit the search request" + ], "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 75 - }, - "signature": [ - "any" - ] + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 77 + } }, { "tags": [], - "id": "def-common.SearchSourceFields.highlightAll", - "type": "CompoundType", - "label": "highlightAll", - "description": [], + "id": "def-common.SearchSessionRequestInfo.status", + "type": "string", + "label": "status", + "description": [ + "\nstatus" + ], "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 76 - }, - "signature": [ - "boolean | undefined" - ] + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 81 + } }, { "tags": [], - "id": "def-common.SearchSourceFields.trackTotalHits", - "type": "CompoundType", - "label": "trackTotalHits", - "description": [], + "id": "def-common.SearchSessionRequestInfo.error", + "type": "string", + "label": "error", + "description": [ + "\nAn optional error. Set if status is set to error." + ], "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 77 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 85 }, "signature": [ - "number | boolean | undefined" + "string | undefined" ] + } + ], + "source": { + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 69 + }, + "initialIsOpen": false + }, + { + "id": "def-common.SearchSessionSavedObjectAttributes", + "type": "Interface", + "label": "SearchSessionSavedObjectAttributes", + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.SearchSessionSavedObjectAttributes.sessionId", + "type": "string", + "label": "sessionId", + "description": [], + "source": { + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 13 + } }, { "tags": [], - "id": "def-common.SearchSourceFields.aggs", - "type": "Any", - "label": "aggs", + "id": "def-common.SearchSessionSavedObjectAttributes.name", + "type": "string", + "label": "name", "description": [ - "\n{@link AggConfigs}" + "\nUser-facing session name to be displayed in session management" ], "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 81 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 17 }, "signature": [ - "any" + "string | undefined" ] }, { "tags": [], - "id": "def-common.SearchSourceFields.from", - "type": "number", - "label": "from", - "description": [], + "id": "def-common.SearchSessionSavedObjectAttributes.appId", + "type": "string", + "label": "appId", + "description": [ + "\nApp that created the session. e.g 'discover'" + ], "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 82 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 21 }, "signature": [ - "number | undefined" + "string | undefined" ] }, { "tags": [], - "id": "def-common.SearchSourceFields.size", - "type": "number", - "label": "size", - "description": [], + "id": "def-common.SearchSessionSavedObjectAttributes.created", + "type": "string", + "label": "created", + "description": [ + "\nCreation time of the session" + ], "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 83 - }, - "signature": [ - "number | undefined" - ] + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 25 + } }, { "tags": [], - "id": "def-common.SearchSourceFields.source", - "type": "CompoundType", - "label": "source", - "description": [], + "id": "def-common.SearchSessionSavedObjectAttributes.touched", + "type": "string", + "label": "touched", + "description": [ + "\nLast touch time of the session" + ], "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 84 - }, - "signature": [ - "string | boolean | string[] | undefined" - ] + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 29 + } }, { "tags": [], - "id": "def-common.SearchSourceFields.version", - "type": "CompoundType", - "label": "version", - "description": [], + "id": "def-common.SearchSessionSavedObjectAttributes.expires", + "type": "string", + "label": "expires", + "description": [ + "\nExpiration time of the session. Expiration itself is managed by Elasticsearch." + ], "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 85 - }, - "signature": [ - "boolean | undefined" - ] + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 33 + } }, { "tags": [], - "id": "def-common.SearchSourceFields.fields", - "type": "Array", - "label": "fields", + "id": "def-common.SearchSessionSavedObjectAttributes.status", + "type": "Enum", + "label": "status", "description": [ - "\nRetrieve fields via the search Fields API" + "\nstatus" ], "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 89 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 37 }, "signature": [ { "pluginId": "data", "scope": "common", "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchFieldValue", - "text": "SearchFieldValue" - }, - "[] | undefined" + "section": "def-common.SearchSessionStatus", + "text": "SearchSessionStatus" + } ] }, { - "tags": [ - "deprecated" + "tags": [], + "id": "def-common.SearchSessionSavedObjectAttributes.urlGeneratorId", + "type": "string", + "label": "urlGeneratorId", + "description": [ + "\nurlGeneratorId" ], - "id": "def-common.SearchSourceFields.fieldsFromSource", - "type": "CompoundType", - "label": "fieldsFromSource", + "source": { + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 41 + }, + "signature": [ + "string | undefined" + ] + }, + { + "tags": [], + "id": "def-common.SearchSessionSavedObjectAttributes.initialState", + "type": "Object", + "label": "initialState", "description": [ - "\nRetreive fields directly from _source (legacy behavior)\n" + "\nThe application state that was used to create the session.\nShould be used, for example, to re-load an expired search session." ], "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 95 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 46 }, "signature": [ - "string | boolean | string[] | undefined" + "Record | undefined" ] }, { "tags": [], - "id": "def-common.SearchSourceFields.index", + "id": "def-common.SearchSessionSavedObjectAttributes.restoreState", "type": "Object", - "label": "index", + "label": "restoreState", "description": [ - "\n{@link IndexPatternService}" + "\nApplication state that should be used to restore the session.\nFor example, relative dates are conveted to absolute ones." ], "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 99 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 51 }, "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - " | undefined" + "Record | undefined" ] }, { "tags": [], - "id": "def-common.SearchSourceFields.searchAfter", + "id": "def-common.SearchSessionSavedObjectAttributes.idMapping", "type": "Object", - "label": "searchAfter", - "description": [], + "label": "idMapping", + "description": [ + "\nMapping of search request hashes to their corresponsing info (async search id, etc.)" + ], "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 100 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 55 }, "signature": [ + "Record" ] }, { "tags": [], - "id": "def-common.SearchSourceFields.timeout", + "id": "def-common.SearchSessionSavedObjectAttributes.persisted", + "type": "boolean", + "label": "persisted", + "description": [ + "\nThis value is true if the session was actively stored by the user. If it is false, the session may be purged by the system." + ], + "source": { + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 60 + } + }, + { + "tags": [], + "id": "def-common.SearchSessionSavedObjectAttributes.realmType", "type": "string", - "label": "timeout", - "description": [], + "label": "realmType", + "description": [ + "\nThe realm type/name & username uniquely identifies the user who created this search session" + ], "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 101 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 64 }, "signature": [ "string | undefined" @@ -16712,423 +17045,439 @@ }, { "tags": [], - "id": "def-common.SearchSourceFields.terminate_after", - "type": "number", - "label": "terminate_after", + "id": "def-common.SearchSessionSavedObjectAttributes.realmName", + "type": "string", + "label": "realmName", "description": [], "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 102 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 65 }, "signature": [ - "number | undefined" + "string | undefined" ] }, { "tags": [], - "id": "def-common.SearchSourceFields.parent", - "type": "Object", - "label": "parent", + "id": "def-common.SearchSessionSavedObjectAttributes.username", + "type": "string", + "label": "username", "description": [], "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 104 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 66 }, "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" - }, - " | undefined" + "string | undefined" ] } ], "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 61 + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 12 }, "initialIsOpen": false }, { - "id": "def-common.SearchSourceOptions", + "id": "def-common.SearchSourceDependencies", "type": "Interface", - "label": "SearchSourceOptions", + "label": "SearchSourceDependencies", + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceDependencies", + "text": "SearchSourceDependencies" + }, + " extends ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.FetchHandlers", + "text": "FetchHandlers" + } + ], "description": [], "tags": [], "children": [ { "tags": [], - "id": "def-common.SearchSourceOptions.callParentStartHandlers", - "type": "CompoundType", - "label": "callParentStartHandlers", + "id": "def-common.SearchSourceDependencies.search", + "type": "Function", + "label": "search", "description": [], "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 108 + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "lineNumber": 99 }, "signature": [ - "boolean | undefined" + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ISearchGeneric", + "text": "ISearchGeneric" + } ] } ], "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 107 + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "lineNumber": 98 }, "initialIsOpen": false }, { - "id": "def-common.SearchStrategyProvider", + "id": "def-common.SearchSourceFields", "type": "Interface", - "label": "SearchStrategyProvider", - "description": [], + "label": "SearchSourceFields", + "description": [ + "\nsearch source fields" + ], "tags": [], "children": [ { "tags": [], - "id": "def-common.SearchStrategyProvider.id", + "id": "def-common.SearchSourceFields.type", "type": "string", - "label": "id", + "label": "type", "description": [], "source": { - "path": "src/plugins/data/common/search/search_source/legacy/types.ts", - "lineNumber": 49 - } + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 62 + }, + "signature": [ + "string | undefined" + ] }, { "tags": [], - "id": "def-common.SearchStrategyProvider.search", - "type": "Function", - "label": "search", - "description": [], + "id": "def-common.SearchSourceFields.query", + "type": "Object", + "label": "query", + "description": [ + "\n{@link Query}" + ], "source": { - "path": "src/plugins/data/common/search/search_source/legacy/types.ts", - "lineNumber": 50 + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 66 }, "signature": [ - "(params: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, + " | undefined" + ] + }, + { + "tags": [], + "id": "def-common.SearchSourceFields.filter", + "type": "CompoundType", + "label": "filter", + "description": [ + "\n{@link Filter}" + ], + "source": { + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 70 + }, + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + "[] | (() => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + "[] | undefined) | undefined" + ] + }, + { + "tags": [], + "id": "def-common.SearchSourceFields.sort", + "type": "CompoundType", + "label": "sort", + "description": [ + "\n{@link EsQuerySortValue}" + ], + "source": { + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 74 + }, + "signature": [ + "Record ", + " | ", { "pluginId": "data", "scope": "common", "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchStrategyResponse", - "text": "SearchStrategyResponse" + "section": "def-common.SortDirectionNumeric", + "text": "SortDirectionNumeric" }, - "" + "> | Record[] | undefined" ] - } - ], - "source": { - "path": "src/plugins/data/common/search/search_source/legacy/types.ts", - "lineNumber": 48 - }, - "initialIsOpen": false - }, - { - "id": "def-common.SearchStrategyResponse", - "type": "Interface", - "label": "SearchStrategyResponse", - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchStrategyResponse", - "text": "SearchStrategyResponse" }, - "" - ], - "description": [], - "tags": [], - "children": [ { "tags": [], - "id": "def-common.SearchStrategyResponse.searching", - "type": "Object", - "label": "searching", + "id": "def-common.SearchSourceFields.highlight", + "type": "Any", + "label": "highlight", "description": [], "source": { - "path": "src/plugins/data/common/search/search_source/legacy/types.ts", - "lineNumber": 54 + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 75 }, "signature": [ - "Promise<", - "SearchResponse", - "[]>" + "any" ] }, { "tags": [], - "id": "def-common.SearchStrategyResponse.abort", - "type": "Function", - "label": "abort", + "id": "def-common.SearchSourceFields.highlightAll", + "type": "CompoundType", + "label": "highlightAll", "description": [], "source": { - "path": "src/plugins/data/common/search/search_source/legacy/types.ts", - "lineNumber": 55 + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 76 }, "signature": [ - "() => void" + "boolean | undefined" ] - } - ], - "source": { - "path": "src/plugins/data/common/search/search_source/legacy/types.ts", - "lineNumber": 53 - }, - "initialIsOpen": false - }, - { - "id": "def-common.SearchStrategySearchParams", - "type": "Interface", - "label": "SearchStrategySearchParams", - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchStrategySearchParams", - "text": "SearchStrategySearchParams" }, - " extends ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.FetchHandlers", - "text": "FetchHandlers" - } - ], - "description": [], - "tags": [], - "children": [ { "tags": [], - "id": "def-common.SearchStrategySearchParams.searchRequests", - "type": "Array", - "label": "searchRequests", + "id": "def-common.SearchSourceFields.trackTotalHits", + "type": "CompoundType", + "label": "trackTotalHits", "description": [], "source": { - "path": "src/plugins/data/common/search/search_source/legacy/types.ts", - "lineNumber": 44 + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 77 }, "signature": [ - "Record[]" + "number | boolean | undefined" ] - } - ], - "source": { - "path": "src/plugins/data/common/search/search_source/legacy/types.ts", - "lineNumber": 43 - }, - "initialIsOpen": false - }, - { - "id": "def-common.ShardFailure", - "type": "Interface", - "label": "ShardFailure", - "description": [], - "tags": [], - "children": [ - { - "tags": [], - "id": "def-common.ShardFailure.index", - "type": "string", - "label": "index", - "description": [], - "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 142 - } }, { "tags": [], - "id": "def-common.ShardFailure.node", - "type": "string", - "label": "node", - "description": [], + "id": "def-common.SearchSourceFields.aggs", + "type": "Any", + "label": "aggs", + "description": [ + "\n{@link AggConfigs}" + ], "source": { "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 143 - } + "lineNumber": 81 + }, + "signature": [ + "any" + ] }, { "tags": [], - "id": "def-common.ShardFailure.reason", - "type": "Object", - "label": "reason", + "id": "def-common.SearchSourceFields.from", + "type": "number", + "label": "from", "description": [], "source": { "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 144 + "lineNumber": 82 }, "signature": [ - "{ caused_by: { reason: string; type: string; }; reason: string; lang?: string | undefined; script?: string | undefined; script_stack?: string[] | undefined; type: string; }" + "number | undefined" ] }, { "tags": [], - "id": "def-common.ShardFailure.shard", + "id": "def-common.SearchSourceFields.size", "type": "number", - "label": "shard", - "description": [], - "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 155 - } - } - ], - "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 141 - }, - "initialIsOpen": false - }, - { - "id": "def-common.SortDirectionNumeric", - "type": "Interface", - "label": "SortDirectionNumeric", - "description": [], - "tags": [], - "children": [ - { - "tags": [], - "id": "def-common.SortDirectionNumeric.order", - "type": "Enum", - "label": "order", + "label": "size", "description": [], "source": { "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 45 + "lineNumber": 83 }, "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SortDirection", - "text": "SortDirection" - } + "number | undefined" ] }, { "tags": [], - "id": "def-common.SortDirectionNumeric.numeric_type", + "id": "def-common.SearchSourceFields.source", "type": "CompoundType", - "label": "numeric_type", + "label": "source", "description": [], "source": { "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 46 + "lineNumber": 84 }, "signature": [ - "\"date\" | \"long\" | \"double\" | \"date_nanos\" | undefined" + "string | boolean | string[] | undefined" ] - } - ], - "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 44 - }, - "initialIsOpen": false - }, - { - "id": "def-common.SortOptions", - "type": "Interface", - "label": "SortOptions", - "description": [], - "tags": [], - "children": [ + }, { "tags": [], - "id": "def-common.SortOptions.mode", + "id": "def-common.SearchSourceFields.version", "type": "CompoundType", - "label": "mode", + "label": "version", "description": [], "source": { "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 112 + "lineNumber": 85 }, "signature": [ - "\"max\" | \"min\" | \"sum\" | \"avg\" | \"median\" | undefined" + "boolean | undefined" ] }, { "tags": [], - "id": "def-common.SortOptions.type", - "type": "CompoundType", - "label": "type", - "description": [], + "id": "def-common.SearchSourceFields.fields", + "type": "Array", + "label": "fields", + "description": [ + "\nRetrieve fields via the search Fields API" + ], "source": { "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 113 + "lineNumber": 89 }, "signature": [ - "\"date\" | \"long\" | \"double\" | \"date_nanos\" | undefined" + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchFieldValue", + "text": "SearchFieldValue" + }, + "[] | undefined" ] }, { - "tags": [], - "id": "def-common.SortOptions.nested", - "type": "Uncategorized", - "label": "nested", - "description": [], + "tags": [ + "deprecated" + ], + "id": "def-common.SearchSourceFields.fieldsFromSource", + "type": "CompoundType", + "label": "fieldsFromSource", + "description": [ + "\nRetreive fields directly from _source (legacy behavior)\n" + ], "source": { "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 114 + "lineNumber": 95 }, "signature": [ - "object | undefined" + "string | boolean | string[] | undefined" ] }, { "tags": [], - "id": "def-common.SortOptions.unmapped_type", - "type": "string", - "label": "unmapped_type", - "description": [], + "id": "def-common.SearchSourceFields.index", + "type": "Object", + "label": "index", + "description": [ + "\n{@link IndexPatternService}" + ], "source": { "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 115 + "lineNumber": 99 }, "signature": [ - "string | undefined" + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IndexPattern", + "text": "IndexPattern" + }, + " | undefined" ] }, { "tags": [], - "id": "def-common.SortOptions.distance_type", - "type": "CompoundType", - "label": "distance_type", + "id": "def-common.SearchSourceFields.searchAfter", + "type": "Object", + "label": "searchAfter", "description": [], "source": { "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 116 + "lineNumber": 100 }, "signature": [ - "\"arc\" | \"plane\" | undefined" + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.EsQuerySearchAfter", + "text": "EsQuerySearchAfter" + }, + " | undefined" ] }, { "tags": [], - "id": "def-common.SortOptions.unit", + "id": "def-common.SearchSourceFields.timeout", "type": "string", - "label": "unit", + "label": "timeout", "description": [], "source": { "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 117 + "lineNumber": 101 }, "signature": [ "string | undefined" @@ -17136,205 +17485,641 @@ }, { "tags": [], - "id": "def-common.SortOptions.ignore_unmapped", - "type": "CompoundType", - "label": "ignore_unmapped", + "id": "def-common.SearchSourceFields.terminate_after", + "type": "number", + "label": "terminate_after", "description": [], "source": { "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 118 + "lineNumber": 102 }, "signature": [ - "boolean | undefined" + "number | undefined" ] }, { "tags": [], - "id": "def-common.SortOptions._script", - "type": "Uncategorized", - "label": "_script", - "description": [], - "source": { + "id": "def-common.SearchSourceFields.parent", + "type": "Object", + "label": "parent", + "description": [], + "source": { "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 119 + "lineNumber": 104 }, "signature": [ - "object | undefined" + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" + }, + " | undefined" ] } ], "source": { "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 111 - }, - "initialIsOpen": false - } - ], - "enums": [ - { - "id": "def-common.BUCKET_TYPES", - "type": "Enum", - "label": "BUCKET_TYPES", - "tags": [], - "description": [], - "source": { - "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_types.ts", - "lineNumber": 9 + "lineNumber": 61 }, "initialIsOpen": false }, { - "id": "def-common.IP_RANGE_TYPES", - "type": "Enum", - "label": "IP_RANGE_TYPES", - "tags": [], + "id": "def-common.SearchSourceOptions", + "type": "Interface", + "label": "SearchSourceOptions", "description": [], - "source": { - "path": "src/plugins/data/common/search/aggs/buckets/ip_range.ts", - "lineNumber": 24 - }, - "initialIsOpen": false - }, - { - "id": "def-common.METRIC_TYPES", - "type": "Enum", - "label": "METRIC_TYPES", "tags": [], - "description": [], + "children": [ + { + "tags": [], + "id": "def-common.SearchSourceOptions.callParentStartHandlers", + "type": "CompoundType", + "label": "callParentStartHandlers", + "description": [], + "source": { + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 108 + }, + "signature": [ + "boolean | undefined" + ] + } + ], "source": { - "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_types.ts", - "lineNumber": 9 + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 107 }, "initialIsOpen": false }, { - "id": "def-common.SortDirection", - "type": "Enum", - "label": "SortDirection", - "tags": [], + "id": "def-common.SearchStrategyProvider", + "type": "Interface", + "label": "SearchStrategyProvider", "description": [], - "source": { - "path": "src/plugins/data/common/search/search_source/types.ts", - "lineNumber": 39 - }, - "initialIsOpen": false - } - ], - "misc": [ - { "tags": [], - "id": "def-common.aggAvgFnName", - "type": "string", - "label": "aggAvgFnName", - "description": [], + "children": [ + { + "tags": [], + "id": "def-common.SearchStrategyProvider.id", + "type": "string", + "label": "id", + "description": [], + "source": { + "path": "src/plugins/data/common/search/search_source/legacy/types.ts", + "lineNumber": 49 + } + }, + { + "tags": [], + "id": "def-common.SearchStrategyProvider.search", + "type": "Function", + "label": "search", + "description": [], + "source": { + "path": "src/plugins/data/common/search/search_source/legacy/types.ts", + "lineNumber": 50 + }, + "signature": [ + "(params: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchStrategySearchParams", + "text": "SearchStrategySearchParams" + }, + ") => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchStrategyResponse", + "text": "SearchStrategyResponse" + }, + "" + ] + } + ], "source": { - "path": "src/plugins/data/common/search/aggs/metrics/avg_fn.ts", - "lineNumber": 13 + "path": "src/plugins/data/common/search/search_source/legacy/types.ts", + "lineNumber": 48 }, - "signature": [ - "\"aggAvg\"" - ], "initialIsOpen": false }, { - "tags": [], - "id": "def-common.aggBucketAvgFnName", - "type": "string", - "label": "aggBucketAvgFnName", - "description": [], - "source": { - "path": "src/plugins/data/common/search/aggs/metrics/bucket_avg_fn.ts", - "lineNumber": 14 - }, + "id": "def-common.SearchStrategyResponse", + "type": "Interface", + "label": "SearchStrategyResponse", "signature": [ - "\"aggBucketAvg\"" + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchStrategyResponse", + "text": "SearchStrategyResponse" + }, + "" ], - "initialIsOpen": false - }, - { - "tags": [], - "id": "def-common.aggBucketMaxFnName", - "type": "string", - "label": "aggBucketMaxFnName", "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.SearchStrategyResponse.searching", + "type": "Object", + "label": "searching", + "description": [], + "source": { + "path": "src/plugins/data/common/search/search_source/legacy/types.ts", + "lineNumber": 54 + }, + "signature": [ + "Promise<", + "SearchResponse", + "[]>" + ] + }, + { + "tags": [], + "id": "def-common.SearchStrategyResponse.abort", + "type": "Function", + "label": "abort", + "description": [], + "source": { + "path": "src/plugins/data/common/search/search_source/legacy/types.ts", + "lineNumber": 55 + }, + "signature": [ + "() => void" + ] + } + ], "source": { - "path": "src/plugins/data/common/search/aggs/metrics/bucket_max_fn.ts", - "lineNumber": 14 + "path": "src/plugins/data/common/search/search_source/legacy/types.ts", + "lineNumber": 53 }, - "signature": [ - "\"aggBucketMax\"" - ], "initialIsOpen": false }, { - "tags": [], - "id": "def-common.aggBucketMinFnName", - "type": "string", - "label": "aggBucketMinFnName", + "id": "def-common.SearchStrategySearchParams", + "type": "Interface", + "label": "SearchStrategySearchParams", + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchStrategySearchParams", + "text": "SearchStrategySearchParams" + }, + " extends ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.FetchHandlers", + "text": "FetchHandlers" + } + ], "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.SearchStrategySearchParams.searchRequests", + "type": "Array", + "label": "searchRequests", + "description": [], + "source": { + "path": "src/plugins/data/common/search/search_source/legacy/types.ts", + "lineNumber": 44 + }, + "signature": [ + "Record[]" + ] + } + ], "source": { - "path": "src/plugins/data/common/search/aggs/metrics/bucket_min_fn.ts", - "lineNumber": 14 + "path": "src/plugins/data/common/search/search_source/legacy/types.ts", + "lineNumber": 43 }, - "signature": [ - "\"aggBucketMin\"" - ], "initialIsOpen": false }, { - "tags": [], - "id": "def-common.aggBucketSumFnName", - "type": "string", - "label": "aggBucketSumFnName", + "id": "def-common.ShardFailure", + "type": "Interface", + "label": "ShardFailure", "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.ShardFailure.index", + "type": "string", + "label": "index", + "description": [], + "source": { + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 142 + } + }, + { + "tags": [], + "id": "def-common.ShardFailure.node", + "type": "string", + "label": "node", + "description": [], + "source": { + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 143 + } + }, + { + "tags": [], + "id": "def-common.ShardFailure.reason", + "type": "Object", + "label": "reason", + "description": [], + "source": { + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 144 + }, + "signature": [ + "{ caused_by: { reason: string; type: string; }; reason: string; lang?: string | undefined; script?: string | undefined; script_stack?: string[] | undefined; type: string; }" + ] + }, + { + "tags": [], + "id": "def-common.ShardFailure.shard", + "type": "number", + "label": "shard", + "description": [], + "source": { + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 155 + } + } + ], "source": { - "path": "src/plugins/data/common/search/aggs/metrics/bucket_sum_fn.ts", - "lineNumber": 14 + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 141 }, - "signature": [ - "\"aggBucketSum\"" - ], "initialIsOpen": false }, { - "tags": [], - "id": "def-common.aggCardinalityFnName", - "type": "string", - "label": "aggCardinalityFnName", + "id": "def-common.SortDirectionNumeric", + "type": "Interface", + "label": "SortDirectionNumeric", "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.SortDirectionNumeric.order", + "type": "Enum", + "label": "order", + "description": [], + "source": { + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 45 + }, + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SortDirection", + "text": "SortDirection" + } + ] + }, + { + "tags": [], + "id": "def-common.SortDirectionNumeric.numeric_type", + "type": "CompoundType", + "label": "numeric_type", + "description": [], + "source": { + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 46 + }, + "signature": [ + "\"date\" | \"long\" | \"double\" | \"date_nanos\" | undefined" + ] + } + ], "source": { - "path": "src/plugins/data/common/search/aggs/metrics/cardinality_fn.ts", - "lineNumber": 13 + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 44 }, - "signature": [ - "\"aggCardinality\"" - ], "initialIsOpen": false }, { - "id": "def-common.AggConfigOptions", - "type": "Type", - "label": "AggConfigOptions", - "tags": [], + "id": "def-common.SortOptions", + "type": "Interface", + "label": "SortOptions", "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.SortOptions.mode", + "type": "CompoundType", + "label": "mode", + "description": [], + "source": { + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 112 + }, + "signature": [ + "\"max\" | \"min\" | \"sum\" | \"avg\" | \"median\" | undefined" + ] + }, + { + "tags": [], + "id": "def-common.SortOptions.type", + "type": "CompoundType", + "label": "type", + "description": [], + "source": { + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 113 + }, + "signature": [ + "\"date\" | \"long\" | \"double\" | \"date_nanos\" | undefined" + ] + }, + { + "tags": [], + "id": "def-common.SortOptions.nested", + "type": "Uncategorized", + "label": "nested", + "description": [], + "source": { + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 114 + }, + "signature": [ + "object | undefined" + ] + }, + { + "tags": [], + "id": "def-common.SortOptions.unmapped_type", + "type": "string", + "label": "unmapped_type", + "description": [], + "source": { + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 115 + }, + "signature": [ + "string | undefined" + ] + }, + { + "tags": [], + "id": "def-common.SortOptions.distance_type", + "type": "CompoundType", + "label": "distance_type", + "description": [], + "source": { + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 116 + }, + "signature": [ + "\"arc\" | \"plane\" | undefined" + ] + }, + { + "tags": [], + "id": "def-common.SortOptions.unit", + "type": "string", + "label": "unit", + "description": [], + "source": { + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 117 + }, + "signature": [ + "string | undefined" + ] + }, + { + "tags": [], + "id": "def-common.SortOptions.ignore_unmapped", + "type": "CompoundType", + "label": "ignore_unmapped", + "description": [], + "source": { + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 118 + }, + "signature": [ + "boolean | undefined" + ] + }, + { + "tags": [], + "id": "def-common.SortOptions._script", + "type": "Uncategorized", + "label": "_script", + "description": [], + "source": { + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 119 + }, + "signature": [ + "object | undefined" + ] + } + ], "source": { - "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 43 + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 111 }, - "signature": [ - "{ type: IAggType; enabled?: boolean | undefined; id?: string | undefined; schema?: string | undefined; params?: {} | SerializableState | undefined; }" - ], "initialIsOpen": false - }, + } + ], + "enums": [ { + "id": "def-common.BUCKET_TYPES", + "type": "Enum", + "label": "BUCKET_TYPES", "tags": [], - "id": "def-common.aggCountFnName", - "type": "string", - "label": "aggCountFnName", "description": [], "source": { - "path": "src/plugins/data/common/search/aggs/metrics/count_fn.ts", - "lineNumber": 13 + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_types.ts", + "lineNumber": 9 + }, + "initialIsOpen": false + }, + { + "id": "def-common.IP_RANGE_TYPES", + "type": "Enum", + "label": "IP_RANGE_TYPES", + "tags": [], + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/ip_range.ts", + "lineNumber": 24 + }, + "initialIsOpen": false + }, + { + "id": "def-common.METRIC_TYPES", + "type": "Enum", + "label": "METRIC_TYPES", + "tags": [], + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_types.ts", + "lineNumber": 9 + }, + "initialIsOpen": false + }, + { + "id": "def-common.SearchSessionStatus", + "type": "Enum", + "label": "SearchSessionStatus", + "tags": [], + "description": [], + "source": { + "path": "src/plugins/data/common/search/session/status.ts", + "lineNumber": 9 + }, + "initialIsOpen": false + }, + { + "id": "def-common.SortDirection", + "type": "Enum", + "label": "SortDirection", + "tags": [], + "description": [], + "source": { + "path": "src/plugins/data/common/search/search_source/types.ts", + "lineNumber": 39 + }, + "initialIsOpen": false + } + ], + "misc": [ + { + "tags": [], + "id": "def-common.aggAvgFnName", + "type": "string", + "label": "aggAvgFnName", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/metrics/avg_fn.ts", + "lineNumber": 13 + }, + "signature": [ + "\"aggAvg\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.aggBucketAvgFnName", + "type": "string", + "label": "aggBucketAvgFnName", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/metrics/bucket_avg_fn.ts", + "lineNumber": 14 + }, + "signature": [ + "\"aggBucketAvg\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.aggBucketMaxFnName", + "type": "string", + "label": "aggBucketMaxFnName", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/metrics/bucket_max_fn.ts", + "lineNumber": 14 + }, + "signature": [ + "\"aggBucketMax\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.aggBucketMinFnName", + "type": "string", + "label": "aggBucketMinFnName", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/metrics/bucket_min_fn.ts", + "lineNumber": 14 + }, + "signature": [ + "\"aggBucketMin\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.aggBucketSumFnName", + "type": "string", + "label": "aggBucketSumFnName", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/metrics/bucket_sum_fn.ts", + "lineNumber": 14 + }, + "signature": [ + "\"aggBucketSum\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.aggCardinalityFnName", + "type": "string", + "label": "aggCardinalityFnName", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/metrics/cardinality_fn.ts", + "lineNumber": 13 + }, + "signature": [ + "\"aggCardinality\"" + ], + "initialIsOpen": false + }, + { + "id": "def-common.AggConfigOptions", + "type": "Type", + "label": "AggConfigOptions", + "tags": [], + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_config.ts", + "lineNumber": 43 + }, + "signature": [ + "{ type: IAggType; enabled?: boolean | undefined; id?: string | undefined; schema?: string | undefined; params?: {} | SerializableState | undefined; }" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.aggCountFnName", + "type": "string", + "label": "aggCountFnName", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/metrics/count_fn.ts", + "lineNumber": 13 }, "signature": [ "\"aggCount\"" @@ -17401,6 +18186,21 @@ ], "initialIsOpen": false }, + { + "tags": [], + "id": "def-common.aggFilteredMetricFnName", + "type": "string", + "label": "aggFilteredMetricFnName", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/metrics/filtered_metric_fn.ts", + "lineNumber": 14 + }, + "signature": [ + "\"aggFilteredMetric\"" + ], + "initialIsOpen": false + }, { "tags": [], "id": "def-common.aggFilterFnName", @@ -17698,7 +18498,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 139 + "lineNumber": 141 }, "signature": [ "{ calculateAutoTimeExpression: (range: TimeRange) => string | undefined; getDateMetaByDatatableColumn: (column: DatatableColumn) => Promise<{ timeZone: string; timeRange?: TimeRange | undefined; interval: string; } | undefined>; datatableUtilities: { getIndexPattern: (column: DatatableColumn) => Promise; getAggConfig: (column: DatatableColumn) => Promise; isFilterable: (column: DatatableColumn) => boolean; }; createAggConfigs: (indexPattern: IndexPattern, configStates?: Pick | null, object, ", + "<\"kibana_filter\", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + ">, ", { "pluginId": "expressions", "scope": "common", "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionValueBoxed", - "text": "ExpressionValueBoxed" + "section": "def-common.ExecutionContext", + "text": "ExecutionContext" }, - "<\"kibana_context\", ExecutionContextSearch>, ExecutionContext>" + "<", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" + }, + ", ", + "SerializableState" ], "initialIsOpen": false }, { - "id": "def-common.ExpressionFunctionKibanaContext", + "id": "def-common.ExpressionFunctionField", "type": "Type", - "label": "ExpressionFunctionKibanaContext", + "label": "ExpressionFunctionField", "tags": [], "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 23 + "path": "src/plugins/data/common/search/expressions/field.ts", + "lineNumber": 19 }, "signature": [ - "ExpressionFunctionDefinition<\"kibana_context\", ", + "ExpressionFunctionDefinition<\"field\", null, Arguments, ", { "pluginId": "expressions", "scope": "common", @@ -17992,206 +18809,591 @@ "section": "def-common.ExpressionValueBoxed", "text": "ExpressionValueBoxed" }, - "<\"kibana_context\", ExecutionContextSearch> | null, Arguments, Promise<", + "<\"kibana_field\", ", + { + "pluginId": "data", + "scope": "public", + "docId": "kibDataPluginApi", + "section": "def-public.IndexPatternField", + "text": "IndexPatternField" + }, + ">, ", { "pluginId": "expressions", "scope": "common", "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionValueBoxed", - "text": "ExpressionValueBoxed" + "section": "def-common.ExecutionContext", + "text": "ExecutionContext" }, - "<\"kibana_context\", ExecutionContextSearch>>, ExecutionContext>" + "<", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" + }, + ", ", + "SerializableState" ], "initialIsOpen": false }, { - "id": "def-common.ExpressionValueSearchContext", + "id": "def-common.ExpressionFunctionKibana", "type": "Type", - "label": "ExpressionValueSearchContext", + "label": "ExpressionFunctionKibana", "tags": [], "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", - "lineNumber": 20 + "path": "src/plugins/data/common/search/expressions/kibana.ts", + "lineNumber": 17 }, "signature": [ - "{ type: \"kibana_context\"; } & ExecutionContextSearch" - ], - "initialIsOpen": false - }, - { - "id": "def-common.FieldTypes", - "type": "Type", - "label": "FieldTypes", - "tags": [], - "description": [], - "source": { - "path": "src/plugins/data/common/search/aggs/param_types/field.ts", - "lineNumber": 19 - }, - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataPluginApi", - "section": "def-common.KBN_FIELD_TYPES", - "text": "KBN_FIELD_TYPES" - }, - "._SOURCE | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataPluginApi", - "section": "def-common.KBN_FIELD_TYPES", - "text": "KBN_FIELD_TYPES" - }, - ".ATTACHMENT | ", + "ExpressionFunctionDefinition<\"kibana\", ", { - "pluginId": "data", + "pluginId": "expressions", "scope": "common", - "docId": "kibDataPluginApi", - "section": "def-common.KBN_FIELD_TYPES", - "text": "KBN_FIELD_TYPES" + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" }, - ".BOOLEAN | ", + "<\"kibana_context\", ExecutionContextSearch> | null, object, ", { - "pluginId": "data", + "pluginId": "expressions", "scope": "common", - "docId": "kibDataPluginApi", - "section": "def-common.KBN_FIELD_TYPES", - "text": "KBN_FIELD_TYPES" + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" }, - ".DATE | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataPluginApi", - "section": "def-common.KBN_FIELD_TYPES", - "text": "KBN_FIELD_TYPES" - } + "<\"kibana_context\", ExecutionContextSearch>, ExecutionContext>" ], "initialIsOpen": false }, { - "id": "def-common.IAggConfig", + "id": "def-common.ExpressionFunctionKibanaContext", "type": "Type", - "label": "IAggConfig", - "tags": [ - "name", - "description" - ], + "label": "ExpressionFunctionKibanaContext", + "tags": [], "description": [], "source": { - "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 53 + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 26 }, "signature": [ - "AggConfig" + "ExpressionFunctionDefinition<\"kibana_context\", ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"kibana_context\", ExecutionContextSearch> | null, Arguments, Promise<", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"kibana_context\", ExecutionContextSearch>>, ExecutionContext>" ], "initialIsOpen": false }, { - "id": "def-common.IAggType", + "id": "def-common.ExpressionFunctionKibanaFilter", "type": "Type", - "label": "IAggType", + "label": "ExpressionFunctionKibanaFilter", "tags": [], "description": [], "source": { - "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 58 + "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", + "lineNumber": 18 }, "signature": [ - "AggType>" + "ExpressionFunctionDefinition<\"kibanaFilter\", null, Arguments, ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"kibana_filter\", ", + { + "pluginId": "data", + "scope": "public", + "docId": "kibDataPluginApi", + "section": "def-public.Filter", + "text": "Filter" + }, + ">, ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExecutionContext", + "text": "ExecutionContext" + }, + "<", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" + }, + ", ", + "SerializableState" ], "initialIsOpen": false }, { - "id": "def-common.IEsSearchResponse", + "id": "def-common.ExpressionFunctionKibanaTimerange", "type": "Type", - "label": "IEsSearchResponse", + "label": "ExpressionFunctionKibanaTimerange", "tags": [], "description": [], "source": { - "path": "src/plugins/data/common/search/es_search/types.ts", - "lineNumber": 23 + "path": "src/plugins/data/common/search/expressions/timerange.ts", + "lineNumber": 15 }, "signature": [ - "IKibanaSearchResponse>" + "ExpressionFunctionDefinition<\"timerange\", null, TimeRange, ExpressionValueBoxed<\"timerange\", TimeRange>, ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExecutionContext", + "text": "ExecutionContext" + }, + "<", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" + }, + ", ", + "SerializableState", + ">>" ], "initialIsOpen": false }, { - "id": "def-common.IFieldParamType", + "id": "def-common.ExpressionFunctionKql", "type": "Type", - "label": "IFieldParamType", + "label": "ExpressionFunctionKql", "tags": [], "description": [], "source": { - "path": "src/plugins/data/common/search/aggs/param_types/field.ts", - "lineNumber": 21 + "path": "src/plugins/data/common/search/expressions/kql.ts", + "lineNumber": 17 }, "signature": [ - "FieldParamType" + "ExpressionFunctionDefinition<\"kql\", null, Arguments, ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"kibana_query\", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.Query", + "text": "Query" + }, + ">, ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExecutionContext", + "text": "ExecutionContext" + }, + "<", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" + }, + ", ", + "SerializableState" ], "initialIsOpen": false }, { - "id": "def-common.IMetricAggType", + "id": "def-common.ExpressionFunctionLucene", "type": "Type", - "label": "IMetricAggType", + "label": "ExpressionFunctionLucene", "tags": [], "description": [], "source": { - "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 35 + "path": "src/plugins/data/common/search/expressions/lucene.ts", + "lineNumber": 17 }, "signature": [ - "MetricAggType" + "ExpressionFunctionDefinition<\"lucene\", null, Arguments, ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"kibana_query\", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.Query", + "text": "Query" + }, + ">, ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExecutionContext", + "text": "ExecutionContext" + }, + "<", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" + }, + ", ", + "SerializableState" ], "initialIsOpen": false }, { + "id": "def-common.ExpressionFunctionPhraseFilter", + "type": "Type", + "label": "ExpressionFunctionPhraseFilter", "tags": [], - "id": "def-common.intervalOptions", - "type": "Array", - "label": "intervalOptions", "description": [], "source": { - "path": "src/plugins/data/common/search/aggs/buckets/_interval_options.ts", - "lineNumber": 15 + "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", + "lineNumber": 21 }, "signature": [ - "({ display: string; val: string; enabled(agg: ", + "ExpressionFunctionDefinition<\"rangeFilter\", null, Arguments, ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"kibana_filter\", ", { "pluginId": "data", "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IBucketAggConfig", - "text": "IBucketAggConfig" + "docId": "kibDataPluginApi", + "section": "def-common.Filter", + "text": "Filter" }, - "): boolean | \"\" | undefined; } | { display: string; val: string; })[]" + ">, ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExecutionContext", + "text": "ExecutionContext" + }, + "<", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" + }, + ", ", + "SerializableState" ], "initialIsOpen": false }, { - "id": "def-common.IPercentileAggConfig", + "id": "def-common.ExpressionFunctionRange", "type": "Type", - "label": "IPercentileAggConfig", + "label": "ExpressionFunctionRange", "tags": [], "description": [], "source": { - "path": "src/plugins/data/common/search/aggs/metrics/percentiles.ts", - "lineNumber": 24 + "path": "src/plugins/data/common/search/expressions/range.ts", + "lineNumber": 21 }, "signature": [ - "IResponseAggConfig" - ], - "initialIsOpen": false - }, - { - "id": "def-common.IPercentileRanksAggConfig", - "type": "Type", - "label": "IPercentileRanksAggConfig", + "ExpressionFunctionDefinition<\"range\", null, Arguments, ExpressionValueBoxed<\"kibana_range\", Arguments>, ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExecutionContext", + "text": "ExecutionContext" + }, + "<", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" + }, + ", ", + "SerializableState", + ">>" + ], + "initialIsOpen": false + }, + { + "id": "def-common.ExpressionFunctionRangeFilter", + "type": "Type", + "label": "ExpressionFunctionRangeFilter", + "tags": [], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/range_filter.ts", + "lineNumber": 22 + }, + "signature": [ + "ExpressionFunctionDefinition<\"rangeFilter\", null, Arguments, ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"kibana_filter\", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + ">, ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExecutionContext", + "text": "ExecutionContext" + }, + "<", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" + }, + ", ", + "SerializableState" + ], + "initialIsOpen": false + }, + { + "id": "def-common.ExpressionValueSearchContext", + "type": "Type", + "label": "ExpressionValueSearchContext", + "tags": [], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", + "lineNumber": 21 + }, + "signature": [ + "{ type: \"kibana_context\"; } & ExecutionContextSearch" + ], + "initialIsOpen": false + }, + { + "id": "def-common.FieldTypes", + "type": "Type", + "label": "FieldTypes", + "tags": [], + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/param_types/field.ts", + "lineNumber": 19 + }, + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, + "._SOURCE | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, + ".ATTACHMENT | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, + ".BOOLEAN | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + }, + ".DATE | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.KBN_FIELD_TYPES", + "text": "KBN_FIELD_TYPES" + } + ], + "initialIsOpen": false + }, + { + "id": "def-common.IAggConfig", + "type": "Type", + "label": "IAggConfig", + "tags": [ + "name", + "description" + ], + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_config.ts", + "lineNumber": 53 + }, + "signature": [ + "AggConfig" + ], + "initialIsOpen": false + }, + { + "id": "def-common.IAggType", + "type": "Type", + "label": "IAggType", + "tags": [], + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_type.ts", + "lineNumber": 59 + }, + "signature": [ + "AggType>" + ], + "initialIsOpen": false + }, + { + "id": "def-common.IEsSearchResponse", + "type": "Type", + "label": "IEsSearchResponse", + "tags": [], + "description": [], + "source": { + "path": "src/plugins/data/common/search/es_search/types.ts", + "lineNumber": 23 + }, + "signature": [ + "IKibanaSearchResponse>" + ], + "initialIsOpen": false + }, + { + "id": "def-common.IFieldParamType", + "type": "Type", + "label": "IFieldParamType", + "tags": [], + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/param_types/field.ts", + "lineNumber": 21 + }, + "signature": [ + "FieldParamType" + ], + "initialIsOpen": false + }, + { + "id": "def-common.IMetricAggType", + "type": "Type", + "label": "IMetricAggType", + "tags": [], + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", + "lineNumber": 35 + }, + "signature": [ + "MetricAggType" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.intervalOptions", + "type": "Array", + "label": "intervalOptions", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/_interval_options.ts", + "lineNumber": 15 + }, + "signature": [ + "({ display: string; val: string; enabled(agg: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IBucketAggConfig", + "text": "IBucketAggConfig" + }, + "): boolean | \"\" | undefined; } | { display: string; val: string; })[]" + ], + "initialIsOpen": false + }, + { + "id": "def-common.IPercentileAggConfig", + "type": "Type", + "label": "IPercentileAggConfig", + "tags": [], + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/metrics/percentiles.ts", + "lineNumber": 24 + }, + "signature": [ + "IResponseAggConfig" + ], + "initialIsOpen": false + }, + { + "id": "def-common.IPercentileRanksAggConfig", + "type": "Type", + "label": "IPercentileRanksAggConfig", "tags": [], "description": [], "source": { @@ -18383,7 +19585,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", - "lineNumber": 26 + "lineNumber": 31 }, "signature": [ "\"kibana_context\"" @@ -18398,7 +19600,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", - "lineNumber": 27 + "lineNumber": 32 }, "signature": [ "{ type: \"kibana_context\"; } & ExecutionContextSearch" @@ -18406,15 +19608,90 @@ "initialIsOpen": false }, { + "id": "def-common.KibanaField", + "type": "Type", + "label": "KibanaField", "tags": [], - "id": "def-common.parentPipelineType", - "type": "string", - "label": "parentPipelineType", "description": [], "source": { - "path": "src/plugins/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.ts", + "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", + "lineNumber": 28 + }, + "signature": [ + "{ type: \"kibana_field\"; } & IndexPatternField" + ], + "initialIsOpen": false + }, + { + "id": "def-common.KibanaFilter", + "type": "Type", + "label": "KibanaFilter", + "tags": [], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", + "lineNumber": 27 + }, + "signature": [ + "{ type: \"kibana_filter\"; } & Filter" + ], + "initialIsOpen": false + }, + { + "id": "def-common.KibanaQueryOutput", + "type": "Type", + "label": "KibanaQueryOutput", + "tags": [], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", "lineNumber": 26 }, + "signature": [ + "{ type: \"kibana_query\"; } & Query" + ], + "initialIsOpen": false + }, + { + "id": "def-common.KibanaRange", + "type": "Type", + "label": "KibanaRange", + "tags": [], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/range.ts", + "lineNumber": 19 + }, + "signature": [ + "{ type: \"kibana_range\"; } & Arguments" + ], + "initialIsOpen": false + }, + { + "id": "def-common.KibanaTimerangeOutput", + "type": "Type", + "label": "KibanaTimerangeOutput", + "tags": [], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/timerange.ts", + "lineNumber": 13 + }, + "signature": [ + "{ type: \"timerange\"; } & TimeRange" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.parentPipelineType", + "type": "string", + "label": "parentPipelineType", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.ts", + "lineNumber": 27 + }, "initialIsOpen": false }, { @@ -18432,6 +19709,36 @@ ], "initialIsOpen": false }, + { + "tags": [], + "id": "def-common.SEARCH_SESSION_TYPE", + "type": "string", + "label": "SEARCH_SESSION_TYPE", + "description": [], + "source": { + "path": "src/plugins/data/common/search/session/types.ts", + "lineNumber": 11 + }, + "signature": [ + "\"search-session\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.SEARCH_SESSIONS_TABLE_ID", + "type": "string", + "label": "SEARCH_SESSIONS_TABLE_ID", + "description": [], + "source": { + "path": "src/plugins/data/common/search/session/index.ts", + "lineNumber": 12 + }, + "signature": [ + "\"searchSessionsMgmtUiTable\"" + ], + "initialIsOpen": false + }, { "id": "def-common.SearchFieldValue", "type": "Type", @@ -18445,728 +19752,3214 @@ "signature": [ "string | SearchField" ], - "initialIsOpen": false - }, - { - "tags": [], - "id": "def-common.siblingPipelineType", - "type": "string", - "label": "siblingPipelineType", + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.siblingPipelineType", + "type": "string", + "label": "siblingPipelineType", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_helper.ts", + "lineNumber": 34 + }, + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.termsAggFilter", + "type": "Array", + "label": "termsAggFilter", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", + "lineNumber": 32 + }, + "signature": [ + "string[]" + ], + "initialIsOpen": false + } + ], + "objects": [ + { + "id": "def-common.AggGroupLabels", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.AggGroupLabels.[AggGroupNames.Buckets]", + "type": "string", + "label": "[AggGroupNames.Buckets]", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_groups.ts", + "lineNumber": 21 + } + }, + { + "tags": [], + "id": "def-common.AggGroupLabels.[AggGroupNames.Metrics]", + "type": "string", + "label": "[AggGroupNames.Metrics]", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_groups.ts", + "lineNumber": 24 + } + }, + { + "tags": [], + "id": "def-common.AggGroupLabels.[AggGroupNames.None]", + "type": "string", + "label": "[AggGroupNames.None]", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_groups.ts", + "lineNumber": 27 + } + } + ], + "description": [], + "label": "AggGroupLabels", + "source": { + "path": "src/plugins/data/common/search/aggs/agg_groups.ts", + "lineNumber": 20 + }, + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.AggGroupNames", + "type": "Object", + "label": "AggGroupNames", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_groups.ts", + "lineNumber": 12 + }, + "signature": [ + "Readonly<{ Buckets: \"buckets\"; Metrics: \"metrics\"; None: \"none\"; }>" + ], + "initialIsOpen": false + }, + { + "id": "def-common.existsFilterFunction", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.existsFilterFunction.name", + "type": "string", + "label": "name", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/exists_filter.ts", + "lineNumber": 28 + }, + "signature": [ + "\"existsFilter\"" + ] + }, + { + "tags": [], + "id": "def-common.existsFilterFunction.type", + "type": "string", + "label": "type", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/exists_filter.ts", + "lineNumber": 29 + }, + "signature": [ + "\"kibana_filter\"" + ] + }, + { + "tags": [], + "id": "def-common.existsFilterFunction.inputTypes", + "type": "Array", + "label": "inputTypes", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/exists_filter.ts", + "lineNumber": 30 + }, + "signature": [ + "\"null\"[]" + ] + }, + { + "tags": [], + "id": "def-common.existsFilterFunction.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/exists_filter.ts", + "lineNumber": 31 + } + }, + { + "id": "def-common.existsFilterFunction.args", + "type": "Object", + "tags": [], + "children": [ + { + "id": "def-common.existsFilterFunction.args.field", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.existsFilterFunction.args.field.types", + "type": "Array", + "label": "types", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/exists_filter.ts", + "lineNumber": 36 + }, + "signature": [ + "\"kibana_field\"[]" + ] + }, + { + "tags": [], + "id": "def-common.existsFilterFunction.args.field.required", + "type": "boolean", + "label": "required", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/exists_filter.ts", + "lineNumber": 37 + }, + "signature": [ + "true" + ] + }, + { + "tags": [], + "id": "def-common.existsFilterFunction.args.field.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/exists_filter.ts", + "lineNumber": 38 + } + } + ], + "description": [], + "label": "field", + "source": { + "path": "src/plugins/data/common/search/expressions/exists_filter.ts", + "lineNumber": 35 + } + }, + { + "id": "def-common.existsFilterFunction.args.negate", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.existsFilterFunction.args.negate.types", + "type": "Array", + "label": "types", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/exists_filter.ts", + "lineNumber": 43 + }, + "signature": [ + "\"boolean\"[]" + ] + }, + { + "tags": [], + "id": "def-common.existsFilterFunction.args.negate.default", + "type": "boolean", + "label": "default", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/exists_filter.ts", + "lineNumber": 44 + }, + "signature": [ + "false" + ] + }, + { + "tags": [], + "id": "def-common.existsFilterFunction.args.negate.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/exists_filter.ts", + "lineNumber": 45 + } + } + ], + "description": [], + "label": "negate", + "source": { + "path": "src/plugins/data/common/search/expressions/exists_filter.ts", + "lineNumber": 42 + } + } + ], + "description": [], + "label": "args", + "source": { + "path": "src/plugins/data/common/search/expressions/exists_filter.ts", + "lineNumber": 34 + } + }, + { + "id": "def-common.existsFilterFunction.fn", + "type": "Function", + "label": "fn", + "signature": [ + "(input: null, args: Arguments) => { $state?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.FilterState", + "text": "FilterState" + }, + " | undefined; meta: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.FilterMeta", + "text": "FilterMeta" + }, + "; query?: any; type: \"kibana_filter\"; }" + ], + "description": [], + "children": [ + { + "type": "Uncategorized", + "label": "input", + "isRequired": true, + "signature": [ + "null" + ], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/exists_filter.ts", + "lineNumber": 51 + } + }, + { + "type": "Object", + "label": "args", + "isRequired": true, + "signature": [ + "Arguments" + ], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/exists_filter.ts", + "lineNumber": 51 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "src/plugins/data/common/search/expressions/exists_filter.ts", + "lineNumber": 51 + } + } + ], + "description": [], + "label": "existsFilterFunction", + "source": { + "path": "src/plugins/data/common/search/expressions/exists_filter.ts", + "lineNumber": 27 + }, + "initialIsOpen": false + }, + { + "id": "def-common.fieldFunction", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.fieldFunction.name", + "type": "string", + "label": "name", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/field.ts", + "lineNumber": 27 + }, + "signature": [ + "\"field\"" + ] + }, + { + "tags": [], + "id": "def-common.fieldFunction.type", + "type": "string", + "label": "type", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/field.ts", + "lineNumber": 28 + }, + "signature": [ + "\"kibana_field\"" + ] + }, + { + "tags": [], + "id": "def-common.fieldFunction.inputTypes", + "type": "Array", + "label": "inputTypes", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/field.ts", + "lineNumber": 29 + }, + "signature": [ + "\"null\"[]" + ] + }, + { + "tags": [], + "id": "def-common.fieldFunction.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/field.ts", + "lineNumber": 30 + } + }, + { + "id": "def-common.fieldFunction.args", + "type": "Object", + "tags": [], + "children": [ + { + "id": "def-common.fieldFunction.args.name", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.fieldFunction.args.name.types", + "type": "Array", + "label": "types", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/field.ts", + "lineNumber": 35 + }, + "signature": [ + "\"string\"[]" + ] + }, + { + "tags": [], + "id": "def-common.fieldFunction.args.name.required", + "type": "boolean", + "label": "required", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/field.ts", + "lineNumber": 36 + }, + "signature": [ + "true" + ] + }, + { + "tags": [], + "id": "def-common.fieldFunction.args.name.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/field.ts", + "lineNumber": 37 + } + } + ], + "description": [], + "label": "name", + "source": { + "path": "src/plugins/data/common/search/expressions/field.ts", + "lineNumber": 34 + } + }, + { + "id": "def-common.fieldFunction.args.type", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.fieldFunction.args.type.types", + "type": "Array", + "label": "types", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/field.ts", + "lineNumber": 42 + }, + "signature": [ + "\"string\"[]" + ] + }, + { + "tags": [], + "id": "def-common.fieldFunction.args.type.required", + "type": "boolean", + "label": "required", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/field.ts", + "lineNumber": 43 + }, + "signature": [ + "true" + ] + }, + { + "tags": [], + "id": "def-common.fieldFunction.args.type.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/field.ts", + "lineNumber": 44 + } + } + ], + "description": [], + "label": "type", + "source": { + "path": "src/plugins/data/common/search/expressions/field.ts", + "lineNumber": 41 + } + }, + { + "id": "def-common.fieldFunction.args.script", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.fieldFunction.args.script.types", + "type": "Array", + "label": "types", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/field.ts", + "lineNumber": 49 + }, + "signature": [ + "\"string\"[]" + ] + }, + { + "tags": [], + "id": "def-common.fieldFunction.args.script.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/field.ts", + "lineNumber": 50 + } + } + ], + "description": [], + "label": "script", + "source": { + "path": "src/plugins/data/common/search/expressions/field.ts", + "lineNumber": 48 + } + } + ], + "description": [], + "label": "args", + "source": { + "path": "src/plugins/data/common/search/expressions/field.ts", + "lineNumber": 33 + } + }, + { + "id": "def-common.fieldFunction.fn", + "type": "Function", + "label": "fn", + "signature": [ + "(input: null, args: Arguments) => ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"kibana_field\", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IndexPatternField", + "text": "IndexPatternField" + }, + ">" + ], + "description": [], + "children": [ + { + "type": "Uncategorized", + "label": "input", + "isRequired": true, + "signature": [ + "null" + ], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/field.ts", + "lineNumber": 56 + } + }, + { + "type": "Object", + "label": "args", + "isRequired": true, + "signature": [ + "Arguments" + ], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/field.ts", + "lineNumber": 56 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "src/plugins/data/common/search/expressions/field.ts", + "lineNumber": 56 + } + } + ], + "description": [], + "label": "fieldFunction", + "source": { + "path": "src/plugins/data/common/search/expressions/field.ts", + "lineNumber": 26 + }, + "initialIsOpen": false + }, + { + "id": "def-common.kibana", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.kibana.name", + "type": "string", + "label": "name", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana.ts", + "lineNumber": 27 + }, + "signature": [ + "\"kibana\"" + ] + }, + { + "tags": [], + "id": "def-common.kibana.type", + "type": "string", + "label": "type", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana.ts", + "lineNumber": 28 + }, + "signature": [ + "\"kibana_context\"" + ] + }, + { + "tags": [], + "id": "def-common.kibana.inputTypes", + "type": "Array", + "label": "inputTypes", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana.ts", + "lineNumber": 30 + }, + "signature": [ + "(\"kibana_context\" | \"null\")[]" + ] + }, + { + "tags": [], + "id": "def-common.kibana.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana.ts", + "lineNumber": 32 + } + }, + { + "id": "def-common.kibana.args", + "type": "Object", + "tags": [], + "children": [], + "description": [], + "label": "args", + "source": { + "path": "src/plugins/data/common/search/expressions/kibana.ts", + "lineNumber": 36 + } + }, + { + "id": "def-common.kibana.fn", + "type": "Function", + "label": "fn", + "signature": [ + "(input: Input, _: object, { getSearchContext }: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExecutionContext", + "text": "ExecutionContext" + }, + "<", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" + }, + ", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ExecutionContextSearch", + "text": "ExecutionContextSearch" + }, + ">) => ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"kibana_context\", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ExecutionContextSearch", + "text": "ExecutionContextSearch" + } + ], + "description": [], + "children": [ + { + "type": "CompoundType", + "label": "input", + "isRequired": false, + "signature": [ + "Input" + ], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana.ts", + "lineNumber": 38 + } + }, + { + "type": "Uncategorized", + "label": "_", + "isRequired": true, + "signature": [ + "object" + ], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana.ts", + "lineNumber": 38 + } + }, + { + "type": "Object", + "label": "{ getSearchContext }", + "isRequired": true, + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExecutionContext", + "text": "ExecutionContext" + }, + "<", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" + }, + ", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ExecutionContextSearch", + "text": "ExecutionContextSearch" + }, + ">" + ], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana.ts", + "lineNumber": 38 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana.ts", + "lineNumber": 38 + } + } + ], + "description": [], + "label": "kibana", + "source": { + "path": "src/plugins/data/common/search/expressions/kibana.ts", + "lineNumber": 26 + }, + "initialIsOpen": false + }, + { + "id": "def-common.kibanaContext", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.kibanaContext.name", + "type": "string", + "label": "name", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", + "lineNumber": 35 + } + }, + { + "id": "def-common.kibanaContext.from", + "type": "Object", + "tags": [], + "children": [ + { + "id": "def-common.kibanaContext.from.null", + "type": "Function", + "children": [], + "signature": [ + "() => { type: string; }" + ], + "description": [], + "label": "null", + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", + "lineNumber": 37 + }, + "tags": [], + "returnComment": [] + } + ], + "description": [], + "label": "from", + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", + "lineNumber": 36 + } + }, + { + "id": "def-common.kibanaContext.to", + "type": "Object", + "tags": [], + "children": [ + { + "id": "def-common.kibanaContext.to.null", + "type": "Function", + "children": [], + "signature": [ + "() => { type: string; }" + ], + "description": [], + "label": "null", + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", + "lineNumber": 44 + }, + "tags": [], + "returnComment": [] + } + ], + "description": [], + "label": "to", + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", + "lineNumber": 43 + } + } + ], + "description": [], + "label": "kibanaContext", + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", + "lineNumber": 34 + }, + "initialIsOpen": false + }, + { + "id": "def-common.kibanaContextFunction", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.kibanaContextFunction.name", + "type": "string", + "label": "name", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 44 + }, + "signature": [ + "\"kibana_context\"" + ] + }, + { + "tags": [], + "id": "def-common.kibanaContextFunction.type", + "type": "string", + "label": "type", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 45 + }, + "signature": [ + "\"kibana_context\"" + ] + }, + { + "tags": [], + "id": "def-common.kibanaContextFunction.inputTypes", + "type": "Array", + "label": "inputTypes", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 46 + }, + "signature": [ + "(\"kibana_context\" | \"null\")[]" + ] + }, + { + "tags": [], + "id": "def-common.kibanaContextFunction.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 47 + } + }, + { + "id": "def-common.kibanaContextFunction.args", + "type": "Object", + "tags": [], + "children": [ + { + "id": "def-common.kibanaContextFunction.args.q", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.kibanaContextFunction.args.q.types", + "type": "Array", + "label": "types", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 52 + }, + "signature": [ + "(\"null\" | \"kibana_query\")[]" + ] + }, + { + "tags": [], + "id": "def-common.kibanaContextFunction.args.q.aliases", + "type": "Array", + "label": "aliases", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 53 + }, + "signature": [ + "string[]" + ] + }, + { + "tags": [], + "id": "def-common.kibanaContextFunction.args.q.default", + "type": "Uncategorized", + "label": "default", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 54 + }, + "signature": [ + "null" + ] + }, + { + "tags": [], + "id": "def-common.kibanaContextFunction.args.q.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 55 + } + } + ], + "description": [], + "label": "q", + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 51 + } + }, + { + "id": "def-common.kibanaContextFunction.args.filters", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.kibanaContextFunction.args.filters.types", + "type": "Array", + "label": "types", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 60 + }, + "signature": [ + "(\"null\" | \"kibana_filter\")[]" + ] + }, + { + "tags": [], + "id": "def-common.kibanaContextFunction.args.filters.multi", + "type": "boolean", + "label": "multi", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 61 + }, + "signature": [ + "true" + ] + }, + { + "tags": [], + "id": "def-common.kibanaContextFunction.args.filters.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 62 + } + } + ], + "description": [], + "label": "filters", + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 59 + } + }, + { + "id": "def-common.kibanaContextFunction.args.timeRange", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.kibanaContextFunction.args.timeRange.types", + "type": "Array", + "label": "types", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 67 + }, + "signature": [ + "(\"null\" | \"timerange\")[]" + ] + }, + { + "tags": [], + "id": "def-common.kibanaContextFunction.args.timeRange.default", + "type": "Uncategorized", + "label": "default", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 68 + }, + "signature": [ + "null" + ] + }, + { + "tags": [], + "id": "def-common.kibanaContextFunction.args.timeRange.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 69 + } + } + ], + "description": [], + "label": "timeRange", + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 66 + } + }, + { + "id": "def-common.kibanaContextFunction.args.savedSearchId", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.kibanaContextFunction.args.savedSearchId.types", + "type": "Array", + "label": "types", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 74 + }, + "signature": [ + "(\"string\" | \"null\")[]" + ] + }, + { + "tags": [], + "id": "def-common.kibanaContextFunction.args.savedSearchId.default", + "type": "Uncategorized", + "label": "default", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 75 + }, + "signature": [ + "null" + ] + }, + { + "tags": [], + "id": "def-common.kibanaContextFunction.args.savedSearchId.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 76 + } + } + ], + "description": [], + "label": "savedSearchId", + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 73 + } + } + ], + "description": [], + "label": "args", + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 50 + } + }, + { + "id": "def-common.kibanaContextFunction.fn", + "type": "Function", + "label": "fn", + "signature": [ + "(input: Input, args: Arguments, { getSavedObject }: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExecutionContext", + "text": "ExecutionContext" + }, + "<", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" + }, + ", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ExecutionContextSearch", + "text": "ExecutionContextSearch" + }, + ">) => Promise<{ type: \"kibana_context\"; query: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, + "[]; filters: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.Filter", + "text": "Filter" + } + ], + "description": [], + "children": [ + { + "type": "CompoundType", + "label": "input", + "isRequired": false, + "signature": [ + "Input" + ], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 82 + } + }, + { + "type": "Object", + "label": "args", + "isRequired": true, + "signature": [ + "Arguments" + ], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 82 + } + }, + { + "type": "Object", + "label": "{ getSavedObject }", + "isRequired": true, + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExecutionContext", + "text": "ExecutionContext" + }, + "<", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" + }, + ", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ExecutionContextSearch", + "text": "ExecutionContextSearch" + }, + ">" + ], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 82 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 82 + } + } + ], + "description": [], + "label": "kibanaContextFunction", + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "lineNumber": 43 + }, + "initialIsOpen": false + }, + { + "id": "def-common.kibanaFilterFunction", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.kibanaFilterFunction.name", + "type": "string", + "label": "name", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", + "lineNumber": 26 + }, + "signature": [ + "\"kibanaFilter\"" + ] + }, + { + "tags": [], + "id": "def-common.kibanaFilterFunction.type", + "type": "string", + "label": "type", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", + "lineNumber": 27 + }, + "signature": [ + "\"kibana_filter\"" + ] + }, + { + "tags": [], + "id": "def-common.kibanaFilterFunction.inputTypes", + "type": "Array", + "label": "inputTypes", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", + "lineNumber": 28 + }, + "signature": [ + "\"null\"[]" + ] + }, + { + "tags": [], + "id": "def-common.kibanaFilterFunction.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", + "lineNumber": 29 + } + }, + { + "id": "def-common.kibanaFilterFunction.args", + "type": "Object", + "tags": [], + "children": [ + { + "id": "def-common.kibanaFilterFunction.args.query", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.kibanaFilterFunction.args.query.types", + "type": "Array", + "label": "types", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", + "lineNumber": 34 + }, + "signature": [ + "\"string\"[]" + ] + }, + { + "tags": [], + "id": "def-common.kibanaFilterFunction.args.query.aliases", + "type": "Array", + "label": "aliases", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", + "lineNumber": 35 + }, + "signature": [ + "string[]" + ] + }, + { + "tags": [], + "id": "def-common.kibanaFilterFunction.args.query.required", + "type": "boolean", + "label": "required", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", + "lineNumber": 36 + }, + "signature": [ + "true" + ] + }, + { + "tags": [], + "id": "def-common.kibanaFilterFunction.args.query.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", + "lineNumber": 37 + } + } + ], + "description": [], + "label": "query", + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", + "lineNumber": 33 + } + }, + { + "id": "def-common.kibanaFilterFunction.args.negate", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.kibanaFilterFunction.args.negate.types", + "type": "Array", + "label": "types", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", + "lineNumber": 42 + }, + "signature": [ + "\"boolean\"[]" + ] + }, + { + "tags": [], + "id": "def-common.kibanaFilterFunction.args.negate.default", + "type": "boolean", + "label": "default", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", + "lineNumber": 43 + }, + "signature": [ + "false" + ] + }, + { + "tags": [], + "id": "def-common.kibanaFilterFunction.args.negate.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", + "lineNumber": 44 + } + } + ], + "description": [], + "label": "negate", + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", + "lineNumber": 41 + } + } + ], + "description": [], + "label": "args", + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", + "lineNumber": 32 + } + }, + { + "id": "def-common.kibanaFilterFunction.fn", + "type": "Function", + "label": "fn", + "signature": [ + "(input: null, args: Arguments) => any" + ], + "description": [], + "children": [ + { + "type": "Uncategorized", + "label": "input", + "isRequired": true, + "signature": [ + "null" + ], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", + "lineNumber": 50 + } + }, + { + "type": "Object", + "label": "args", + "isRequired": true, + "signature": [ + "Arguments" + ], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", + "lineNumber": 50 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", + "lineNumber": 50 + } + } + ], + "description": [], + "label": "kibanaFilterFunction", + "source": { + "path": "src/plugins/data/common/search/expressions/kibana_filter.ts", + "lineNumber": 25 + }, + "initialIsOpen": false + }, + { + "id": "def-common.kibanaTimerangeFunction", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.kibanaTimerangeFunction.name", + "type": "string", + "label": "name", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/timerange.ts", + "lineNumber": 23 + }, + "signature": [ + "\"timerange\"" + ] + }, + { + "tags": [], + "id": "def-common.kibanaTimerangeFunction.type", + "type": "string", + "label": "type", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/timerange.ts", + "lineNumber": 24 + }, + "signature": [ + "\"timerange\"" + ] + }, + { + "tags": [], + "id": "def-common.kibanaTimerangeFunction.inputTypes", + "type": "Array", + "label": "inputTypes", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/timerange.ts", + "lineNumber": 25 + }, + "signature": [ + "\"null\"[]" + ] + }, + { + "tags": [], + "id": "def-common.kibanaTimerangeFunction.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/timerange.ts", + "lineNumber": 26 + } + }, + { + "id": "def-common.kibanaTimerangeFunction.args", + "type": "Object", + "tags": [], + "children": [ + { + "id": "def-common.kibanaTimerangeFunction.args.from", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.kibanaTimerangeFunction.args.from.types", + "type": "Array", + "label": "types", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/timerange.ts", + "lineNumber": 31 + }, + "signature": [ + "\"string\"[]" + ] + }, + { + "tags": [], + "id": "def-common.kibanaTimerangeFunction.args.from.required", + "type": "boolean", + "label": "required", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/timerange.ts", + "lineNumber": 32 + }, + "signature": [ + "true" + ] + }, + { + "tags": [], + "id": "def-common.kibanaTimerangeFunction.args.from.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/timerange.ts", + "lineNumber": 33 + } + } + ], + "description": [], + "label": "from", + "source": { + "path": "src/plugins/data/common/search/expressions/timerange.ts", + "lineNumber": 30 + } + }, + { + "id": "def-common.kibanaTimerangeFunction.args.to", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.kibanaTimerangeFunction.args.to.types", + "type": "Array", + "label": "types", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/timerange.ts", + "lineNumber": 38 + }, + "signature": [ + "\"string\"[]" + ] + }, + { + "tags": [], + "id": "def-common.kibanaTimerangeFunction.args.to.required", + "type": "boolean", + "label": "required", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/timerange.ts", + "lineNumber": 39 + }, + "signature": [ + "true" + ] + }, + { + "tags": [], + "id": "def-common.kibanaTimerangeFunction.args.to.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/timerange.ts", + "lineNumber": 40 + } + } + ], + "description": [], + "label": "to", + "source": { + "path": "src/plugins/data/common/search/expressions/timerange.ts", + "lineNumber": 37 + } + }, + { + "id": "def-common.kibanaTimerangeFunction.args.mode", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.kibanaTimerangeFunction.args.mode.types", + "type": "Array", + "label": "types", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/timerange.ts", + "lineNumber": 45 + }, + "signature": [ + "\"string\"[]" + ] + }, + { + "tags": [], + "id": "def-common.kibanaTimerangeFunction.args.mode.options", + "type": "Array", + "label": "options", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/timerange.ts", + "lineNumber": 46 + }, + "signature": [ + "(\"absolute\" | \"relative\")[]" + ] + }, + { + "tags": [], + "id": "def-common.kibanaTimerangeFunction.args.mode.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/timerange.ts", + "lineNumber": 47 + } + } + ], + "description": [], + "label": "mode", + "source": { + "path": "src/plugins/data/common/search/expressions/timerange.ts", + "lineNumber": 44 + } + } + ], + "description": [], + "label": "args", + "source": { + "path": "src/plugins/data/common/search/expressions/timerange.ts", + "lineNumber": 29 + } + }, + { + "id": "def-common.kibanaTimerangeFunction.fn", + "type": "Function", + "label": "fn", + "signature": [ + "(input: null, args: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, + ") => { type: \"timerange\"; from: string; to: string; mode: \"absolute\" | \"relative\" | undefined; }" + ], + "description": [], + "children": [ + { + "type": "Uncategorized", + "label": "input", + "isRequired": true, + "signature": [ + "null" + ], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/timerange.ts", + "lineNumber": 53 + } + }, + { + "type": "Object", + "label": "args", + "isRequired": true, + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + } + ], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/timerange.ts", + "lineNumber": 53 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "src/plugins/data/common/search/expressions/timerange.ts", + "lineNumber": 53 + } + } + ], "description": [], + "label": "kibanaTimerangeFunction", "source": { - "path": "src/plugins/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_helper.ts", - "lineNumber": 33 + "path": "src/plugins/data/common/search/expressions/timerange.ts", + "lineNumber": 22 }, "initialIsOpen": false }, { - "tags": [], - "id": "def-common.termsAggFilter", - "type": "Array", - "label": "termsAggFilter", - "description": [], - "source": { - "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 32 - }, - "signature": [ - "string[]" - ], - "initialIsOpen": false - } - ], - "objects": [ - { - "id": "def-common.AggGroupLabels", + "id": "def-common.kqlFunction", "type": "Object", "tags": [], "children": [ { "tags": [], - "id": "def-common.AggGroupLabels.[AggGroupNames.Buckets]", + "id": "def-common.kqlFunction.name", "type": "string", - "label": "[AggGroupNames.Buckets]", + "label": "name", "description": [], "source": { - "path": "src/plugins/data/common/search/aggs/agg_groups.ts", - "lineNumber": 21 - } + "path": "src/plugins/data/common/search/expressions/kql.ts", + "lineNumber": 25 + }, + "signature": [ + "\"kql\"" + ] }, { "tags": [], - "id": "def-common.AggGroupLabels.[AggGroupNames.Metrics]", + "id": "def-common.kqlFunction.type", "type": "string", - "label": "[AggGroupNames.Metrics]", + "label": "type", "description": [], "source": { - "path": "src/plugins/data/common/search/aggs/agg_groups.ts", - "lineNumber": 24 - } + "path": "src/plugins/data/common/search/expressions/kql.ts", + "lineNumber": 26 + }, + "signature": [ + "\"kibana_query\"" + ] }, { "tags": [], - "id": "def-common.AggGroupLabels.[AggGroupNames.None]", + "id": "def-common.kqlFunction.inputTypes", + "type": "Array", + "label": "inputTypes", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kql.ts", + "lineNumber": 27 + }, + "signature": [ + "\"null\"[]" + ] + }, + { + "tags": [], + "id": "def-common.kqlFunction.help", "type": "string", - "label": "[AggGroupNames.None]", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kql.ts", + "lineNumber": 28 + } + }, + { + "id": "def-common.kqlFunction.args", + "type": "Object", + "tags": [], + "children": [ + { + "id": "def-common.kqlFunction.args.q", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.kqlFunction.args.q.types", + "type": "Array", + "label": "types", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kql.ts", + "lineNumber": 33 + }, + "signature": [ + "\"string\"[]" + ] + }, + { + "tags": [], + "id": "def-common.kqlFunction.args.q.required", + "type": "boolean", + "label": "required", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kql.ts", + "lineNumber": 34 + }, + "signature": [ + "true" + ] + }, + { + "tags": [], + "id": "def-common.kqlFunction.args.q.aliases", + "type": "Array", + "label": "aliases", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kql.ts", + "lineNumber": 35 + }, + "signature": [ + "string[]" + ] + }, + { + "tags": [], + "id": "def-common.kqlFunction.args.q.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kql.ts", + "lineNumber": 36 + } + } + ], + "description": [], + "label": "q", + "source": { + "path": "src/plugins/data/common/search/expressions/kql.ts", + "lineNumber": 32 + } + } + ], "description": [], + "label": "args", + "source": { + "path": "src/plugins/data/common/search/expressions/kql.ts", + "lineNumber": 31 + } + }, + { + "id": "def-common.kqlFunction.fn", + "type": "Function", + "label": "fn", + "signature": [ + "(input: null, args: Arguments) => { type: \"kibana_query\"; language: string; query: string; }" + ], + "description": [], + "children": [ + { + "type": "Uncategorized", + "label": "input", + "isRequired": true, + "signature": [ + "null" + ], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kql.ts", + "lineNumber": 42 + } + }, + { + "type": "Object", + "label": "args", + "isRequired": true, + "signature": [ + "Arguments" + ], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/kql.ts", + "lineNumber": 42 + } + } + ], + "tags": [], + "returnComment": [], "source": { - "path": "src/plugins/data/common/search/aggs/agg_groups.ts", - "lineNumber": 27 + "path": "src/plugins/data/common/search/expressions/kql.ts", + "lineNumber": 42 } } ], "description": [], - "label": "AggGroupLabels", - "source": { - "path": "src/plugins/data/common/search/aggs/agg_groups.ts", - "lineNumber": 20 - }, - "initialIsOpen": false - }, - { - "tags": [], - "id": "def-common.AggGroupNames", - "type": "Object", - "label": "AggGroupNames", - "description": [], + "label": "kqlFunction", "source": { - "path": "src/plugins/data/common/search/aggs/agg_groups.ts", - "lineNumber": 12 + "path": "src/plugins/data/common/search/expressions/kql.ts", + "lineNumber": 24 }, - "signature": [ - "Readonly<{ Buckets: \"buckets\"; Metrics: \"metrics\"; None: \"none\"; }>" - ], "initialIsOpen": false }, { - "id": "def-common.kibana", + "id": "def-common.luceneFunction", "type": "Object", "tags": [], "children": [ { "tags": [], - "id": "def-common.kibana.name", + "id": "def-common.luceneFunction.name", "type": "string", "label": "name", "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana.ts", - "lineNumber": 27 + "path": "src/plugins/data/common/search/expressions/lucene.ts", + "lineNumber": 25 }, "signature": [ - "\"kibana\"" + "\"lucene\"" ] }, { "tags": [], - "id": "def-common.kibana.type", + "id": "def-common.luceneFunction.type", "type": "string", "label": "type", "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana.ts", - "lineNumber": 28 + "path": "src/plugins/data/common/search/expressions/lucene.ts", + "lineNumber": 26 }, "signature": [ - "\"kibana_context\"" + "\"kibana_query\"" ] }, { "tags": [], - "id": "def-common.kibana.inputTypes", + "id": "def-common.luceneFunction.inputTypes", "type": "Array", "label": "inputTypes", "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana.ts", - "lineNumber": 30 + "path": "src/plugins/data/common/search/expressions/lucene.ts", + "lineNumber": 27 }, "signature": [ - "(\"kibana_context\" | \"null\")[]" + "\"null\"[]" ] }, { "tags": [], - "id": "def-common.kibana.help", + "id": "def-common.luceneFunction.help", "type": "string", "label": "help", "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana.ts", - "lineNumber": 32 + "path": "src/plugins/data/common/search/expressions/lucene.ts", + "lineNumber": 28 } }, { - "id": "def-common.kibana.args", + "id": "def-common.luceneFunction.args", "type": "Object", "tags": [], - "children": [], + "children": [ + { + "id": "def-common.luceneFunction.args.q", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.luceneFunction.args.q.types", + "type": "Array", + "label": "types", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/lucene.ts", + "lineNumber": 33 + }, + "signature": [ + "\"string\"[]" + ] + }, + { + "tags": [], + "id": "def-common.luceneFunction.args.q.required", + "type": "boolean", + "label": "required", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/lucene.ts", + "lineNumber": 34 + }, + "signature": [ + "true" + ] + }, + { + "tags": [], + "id": "def-common.luceneFunction.args.q.aliases", + "type": "Array", + "label": "aliases", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/lucene.ts", + "lineNumber": 35 + }, + "signature": [ + "string[]" + ] + }, + { + "tags": [], + "id": "def-common.luceneFunction.args.q.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/lucene.ts", + "lineNumber": 36 + } + } + ], + "description": [], + "label": "q", + "source": { + "path": "src/plugins/data/common/search/expressions/lucene.ts", + "lineNumber": 32 + } + } + ], "description": [], "label": "args", "source": { - "path": "src/plugins/data/common/search/expressions/kibana.ts", - "lineNumber": 36 + "path": "src/plugins/data/common/search/expressions/lucene.ts", + "lineNumber": 31 } }, { - "id": "def-common.kibana.fn", + "id": "def-common.luceneFunction.fn", "type": "Function", "label": "fn", "signature": [ - "(input: Input, _: object, { getSearchContext }: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExecutionContext", - "text": "ExecutionContext" - }, - "<", - { - "pluginId": "inspector", - "scope": "common", - "docId": "kibInspectorPluginApi", - "section": "def-common.Adapters", - "text": "Adapters" - }, - ", ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ExecutionContextSearch", - "text": "ExecutionContextSearch" - }, - ">) => ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionValueBoxed", - "text": "ExpressionValueBoxed" - }, - "<\"kibana_context\", ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ExecutionContextSearch", - "text": "ExecutionContextSearch" - } + "(input: null, args: Arguments) => { type: \"kibana_query\"; language: string; query: any; }" ], "description": [], "children": [ { - "type": "CompoundType", + "type": "Uncategorized", "label": "input", - "isRequired": false, + "isRequired": true, "signature": [ - "Input" + "null" ], "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana.ts", - "lineNumber": 38 + "path": "src/plugins/data/common/search/expressions/lucene.ts", + "lineNumber": 42 } }, { - "type": "Uncategorized", - "label": "_", + "type": "Object", + "label": "args", "isRequired": true, "signature": [ - "object" + "Arguments" ], "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana.ts", - "lineNumber": 38 + "path": "src/plugins/data/common/search/expressions/lucene.ts", + "lineNumber": 42 } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "src/plugins/data/common/search/expressions/lucene.ts", + "lineNumber": 42 + } + } + ], + "description": [], + "label": "luceneFunction", + "source": { + "path": "src/plugins/data/common/search/expressions/lucene.ts", + "lineNumber": 24 + }, + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.migrateIncludeExcludeFormat", + "type": "Object", + "label": "migrateIncludeExcludeFormat", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/migrate_include_exclude_format.ts", + "lineNumber": 25 + }, + "signature": [ + "Partial<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.BucketAggParam", + "text": "BucketAggParam" + }, + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IBucketAggConfig", + "text": "IBucketAggConfig" + }, + ">>" + ], + "initialIsOpen": false + }, + { + "id": "def-common.parentPipelineAggHelper", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.parentPipelineAggHelper.subtype", + "type": "string", + "label": "subtype", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.ts", + "lineNumber": 35 + } + }, + { + "id": "def-common.parentPipelineAggHelper.params", + "type": "Function", + "label": "params", + "signature": [ + "() => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.MetricAggParam", + "text": "MetricAggParam" + }, + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IMetricAggConfig", + "text": "IMetricAggConfig" + }, + ">[]" + ], + "description": [], + "children": [], + "tags": [], + "returnComment": [], + "source": { + "path": "src/plugins/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.ts", + "lineNumber": 36 + } + }, + { + "id": "def-common.parentPipelineAggHelper.getSerializedFormat", + "type": "Function", + "label": "getSerializedFormat", + "signature": [ + "(agg: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IMetricAggConfig", + "text": "IMetricAggConfig" }, + ") => any" + ], + "description": [], + "children": [ { "type": "Object", - "label": "{ getSearchContext }", + "label": "agg", "isRequired": true, "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExecutionContext", - "text": "ExecutionContext" - }, - "<", - { - "pluginId": "inspector", - "scope": "common", - "docId": "kibInspectorPluginApi", - "section": "def-common.Adapters", - "text": "Adapters" - }, - ", ", { "pluginId": "data", "scope": "common", "docId": "kibDataSearchPluginApi", - "section": "def-common.ExecutionContextSearch", - "text": "ExecutionContextSearch" - }, - ">" + "section": "def-common.IMetricAggConfig", + "text": "IMetricAggConfig" + } ], "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana.ts", - "lineNumber": 38 + "path": "src/plugins/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.ts", + "lineNumber": 64 } } ], "tags": [], "returnComment": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana.ts", - "lineNumber": 38 + "path": "src/plugins/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.ts", + "lineNumber": 64 } } ], "description": [], - "label": "kibana", + "label": "parentPipelineAggHelper", "source": { - "path": "src/plugins/data/common/search/expressions/kibana.ts", - "lineNumber": 26 + "path": "src/plugins/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.ts", + "lineNumber": 34 }, "initialIsOpen": false }, { - "id": "def-common.kibanaContext", + "id": "def-common.phraseFilterFunction", "type": "Object", "tags": [], "children": [ { "tags": [], - "id": "def-common.kibanaContext.name", + "id": "def-common.phraseFilterFunction.name", "type": "string", "label": "name", "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", + "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", + "lineNumber": 29 + }, + "signature": [ + "\"rangeFilter\"" + ] + }, + { + "tags": [], + "id": "def-common.phraseFilterFunction.type", + "type": "string", + "label": "type", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", "lineNumber": 30 + }, + "signature": [ + "\"kibana_filter\"" + ] + }, + { + "tags": [], + "id": "def-common.phraseFilterFunction.inputTypes", + "type": "Array", + "label": "inputTypes", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", + "lineNumber": 31 + }, + "signature": [ + "\"null\"[]" + ] + }, + { + "tags": [], + "id": "def-common.phraseFilterFunction.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", + "lineNumber": 32 } }, { - "id": "def-common.kibanaContext.from", + "id": "def-common.phraseFilterFunction.args", "type": "Object", "tags": [], "children": [ { - "id": "def-common.kibanaContext.from.null", - "type": "Function", - "children": [], - "signature": [ - "() => { type: string; }" + "id": "def-common.phraseFilterFunction.args.field", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.phraseFilterFunction.args.field.types", + "type": "Array", + "label": "types", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", + "lineNumber": 37 + }, + "signature": [ + "\"kibana_field\"[]" + ] + }, + { + "tags": [], + "id": "def-common.phraseFilterFunction.args.field.required", + "type": "boolean", + "label": "required", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", + "lineNumber": 38 + }, + "signature": [ + "true" + ] + }, + { + "tags": [], + "id": "def-common.phraseFilterFunction.args.field.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", + "lineNumber": 39 + } + } ], "description": [], - "label": "null", + "label": "field", "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", - "lineNumber": 32 - }, + "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", + "lineNumber": 36 + } + }, + { + "id": "def-common.phraseFilterFunction.args.phrase", + "type": "Object", "tags": [], - "returnComment": [] + "children": [ + { + "tags": [], + "id": "def-common.phraseFilterFunction.args.phrase.types", + "type": "Array", + "label": "types", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", + "lineNumber": 44 + }, + "signature": [ + "\"string\"[]" + ] + }, + { + "tags": [], + "id": "def-common.phraseFilterFunction.args.phrase.multi", + "type": "boolean", + "label": "multi", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", + "lineNumber": 45 + }, + "signature": [ + "true" + ] + }, + { + "tags": [], + "id": "def-common.phraseFilterFunction.args.phrase.required", + "type": "boolean", + "label": "required", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", + "lineNumber": 46 + }, + "signature": [ + "true" + ] + }, + { + "tags": [], + "id": "def-common.phraseFilterFunction.args.phrase.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", + "lineNumber": 47 + } + } + ], + "description": [], + "label": "phrase", + "source": { + "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", + "lineNumber": 43 + } + }, + { + "id": "def-common.phraseFilterFunction.args.negate", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.phraseFilterFunction.args.negate.types", + "type": "Array", + "label": "types", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", + "lineNumber": 52 + }, + "signature": [ + "\"boolean\"[]" + ] + }, + { + "tags": [], + "id": "def-common.phraseFilterFunction.args.negate.default", + "type": "boolean", + "label": "default", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", + "lineNumber": 53 + }, + "signature": [ + "false" + ] + }, + { + "tags": [], + "id": "def-common.phraseFilterFunction.args.negate.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", + "lineNumber": 54 + } + } + ], + "description": [], + "label": "negate", + "source": { + "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", + "lineNumber": 51 + } } ], "description": [], - "label": "from", + "label": "args", "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", - "lineNumber": 31 + "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", + "lineNumber": 35 } }, { - "id": "def-common.kibanaContext.to", - "type": "Object", - "tags": [], + "id": "def-common.phraseFilterFunction.fn", + "type": "Function", + "label": "fn", + "signature": [ + "(input: null, args: Arguments) => { $state?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.FilterState", + "text": "FilterState" + }, + " | undefined; meta: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.FilterMeta", + "text": "FilterMeta" + }, + "; query?: any; type: \"kibana_filter\"; }" + ], + "description": [], "children": [ { - "id": "def-common.kibanaContext.to.null", - "type": "Function", - "children": [], + "type": "Uncategorized", + "label": "input", + "isRequired": true, "signature": [ - "() => { type: string; }" + "null" ], "description": [], - "label": "null", "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", - "lineNumber": 39 - }, - "tags": [], - "returnComment": [] + "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", + "lineNumber": 60 + } + }, + { + "type": "Object", + "label": "args", + "isRequired": true, + "signature": [ + "Arguments" + ], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", + "lineNumber": 60 + } } ], - "description": [], - "label": "to", + "tags": [], + "returnComment": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", - "lineNumber": 38 + "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", + "lineNumber": 60 } } ], "description": [], - "label": "kibanaContext", + "label": "phraseFilterFunction", "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", - "lineNumber": 29 + "path": "src/plugins/data/common/search/expressions/phrase_filter.ts", + "lineNumber": 28 }, "initialIsOpen": false }, { - "id": "def-common.kibanaContextFunction", + "id": "def-common.rangeFilterFunction", "type": "Object", "tags": [], "children": [ { "tags": [], - "id": "def-common.kibanaContextFunction.name", + "id": "def-common.rangeFilterFunction.name", "type": "string", "label": "name", "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 41 + "path": "src/plugins/data/common/search/expressions/range_filter.ts", + "lineNumber": 30 }, "signature": [ - "\"kibana_context\"" + "\"rangeFilter\"" ] }, { "tags": [], - "id": "def-common.kibanaContextFunction.type", + "id": "def-common.rangeFilterFunction.type", "type": "string", "label": "type", "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 42 + "path": "src/plugins/data/common/search/expressions/range_filter.ts", + "lineNumber": 31 }, "signature": [ - "\"kibana_context\"" + "\"kibana_filter\"" ] }, { "tags": [], - "id": "def-common.kibanaContextFunction.inputTypes", + "id": "def-common.rangeFilterFunction.inputTypes", "type": "Array", "label": "inputTypes", "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 43 + "path": "src/plugins/data/common/search/expressions/range_filter.ts", + "lineNumber": 32 }, "signature": [ - "(\"kibana_context\" | \"null\")[]" + "\"null\"[]" ] }, { "tags": [], - "id": "def-common.kibanaContextFunction.help", + "id": "def-common.rangeFilterFunction.help", "type": "string", "label": "help", "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 44 + "path": "src/plugins/data/common/search/expressions/range_filter.ts", + "lineNumber": 33 } }, { - "id": "def-common.kibanaContextFunction.args", + "id": "def-common.rangeFilterFunction.args", "type": "Object", "tags": [], "children": [ { - "id": "def-common.kibanaContextFunction.args.q", + "id": "def-common.rangeFilterFunction.args.field", "type": "Object", "tags": [], "children": [ { "tags": [], - "id": "def-common.kibanaContextFunction.args.q.types", + "id": "def-common.rangeFilterFunction.args.field.types", "type": "Array", "label": "types", "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 49 + "path": "src/plugins/data/common/search/expressions/range_filter.ts", + "lineNumber": 38 }, "signature": [ - "(\"string\" | \"null\")[]" + "\"kibana_field\"[]" ] }, { "tags": [], - "id": "def-common.kibanaContextFunction.args.q.aliases", + "id": "def-common.rangeFilterFunction.args.field.required", + "type": "boolean", + "label": "required", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/range_filter.ts", + "lineNumber": 39 + }, + "signature": [ + "true" + ] + }, + { + "tags": [], + "id": "def-common.rangeFilterFunction.args.field.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/range_filter.ts", + "lineNumber": 40 + } + } + ], + "description": [], + "label": "field", + "source": { + "path": "src/plugins/data/common/search/expressions/range_filter.ts", + "lineNumber": 37 + } + }, + { + "id": "def-common.rangeFilterFunction.args.range", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.rangeFilterFunction.args.range.types", "type": "Array", - "label": "aliases", + "label": "types", "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 50 + "path": "src/plugins/data/common/search/expressions/range_filter.ts", + "lineNumber": 45 }, "signature": [ - "string[]" + "\"kibana_range\"[]" ] }, { "tags": [], - "id": "def-common.kibanaContextFunction.args.q.default", - "type": "Uncategorized", - "label": "default", + "id": "def-common.rangeFilterFunction.args.range.required", + "type": "boolean", + "label": "required", "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 51 + "path": "src/plugins/data/common/search/expressions/range_filter.ts", + "lineNumber": 46 }, "signature": [ - "null" + "true" ] }, { "tags": [], - "id": "def-common.kibanaContextFunction.args.q.help", + "id": "def-common.rangeFilterFunction.args.range.help", "type": "string", "label": "help", "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 52 + "path": "src/plugins/data/common/search/expressions/range_filter.ts", + "lineNumber": 47 } } ], "description": [], - "label": "q", + "label": "range", "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 48 + "path": "src/plugins/data/common/search/expressions/range_filter.ts", + "lineNumber": 44 } }, { - "id": "def-common.kibanaContextFunction.args.filters", + "id": "def-common.rangeFilterFunction.args.negate", "type": "Object", "tags": [], "children": [ { "tags": [], - "id": "def-common.kibanaContextFunction.args.filters.types", + "id": "def-common.rangeFilterFunction.args.negate.types", "type": "Array", "label": "types", "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 57 + "path": "src/plugins/data/common/search/expressions/range_filter.ts", + "lineNumber": 52 }, "signature": [ - "(\"string\" | \"null\")[]" + "\"boolean\"[]" ] }, { "tags": [], - "id": "def-common.kibanaContextFunction.args.filters.default", - "type": "string", + "id": "def-common.rangeFilterFunction.args.negate.default", + "type": "boolean", "label": "default", "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 58 - } + "path": "src/plugins/data/common/search/expressions/range_filter.ts", + "lineNumber": 53 + }, + "signature": [ + "false" + ] }, { "tags": [], - "id": "def-common.kibanaContextFunction.args.filters.help", + "id": "def-common.rangeFilterFunction.args.negate.help", "type": "string", "label": "help", "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 59 + "path": "src/plugins/data/common/search/expressions/range_filter.ts", + "lineNumber": 54 } } ], "description": [], - "label": "filters", + "label": "negate", "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 56 + "path": "src/plugins/data/common/search/expressions/range_filter.ts", + "lineNumber": 51 } + } + ], + "description": [], + "label": "args", + "source": { + "path": "src/plugins/data/common/search/expressions/range_filter.ts", + "lineNumber": 36 + } + }, + { + "id": "def-common.rangeFilterFunction.fn", + "type": "Function", + "label": "fn", + "signature": [ + "(input: null, args: Arguments) => { $state?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.FilterState", + "text": "FilterState" }, + " | undefined; meta: ", { - "id": "def-common.kibanaContextFunction.args.timeRange", + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.FilterMeta", + "text": "FilterMeta" + }, + "; query?: any; type: \"kibana_filter\"; }" + ], + "description": [], + "children": [ + { + "type": "Uncategorized", + "label": "input", + "isRequired": true, + "signature": [ + "null" + ], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/range_filter.ts", + "lineNumber": 60 + } + }, + { + "type": "Object", + "label": "args", + "isRequired": true, + "signature": [ + "Arguments" + ], + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/range_filter.ts", + "lineNumber": 60 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "src/plugins/data/common/search/expressions/range_filter.ts", + "lineNumber": 60 + } + } + ], + "description": [], + "label": "rangeFilterFunction", + "source": { + "path": "src/plugins/data/common/search/expressions/range_filter.ts", + "lineNumber": 29 + }, + "initialIsOpen": false + }, + { + "id": "def-common.rangeFunction", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.rangeFunction.name", + "type": "string", + "label": "name", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/range.ts", + "lineNumber": 29 + }, + "signature": [ + "\"range\"" + ] + }, + { + "tags": [], + "id": "def-common.rangeFunction.type", + "type": "string", + "label": "type", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/range.ts", + "lineNumber": 30 + }, + "signature": [ + "\"kibana_range\"" + ] + }, + { + "tags": [], + "id": "def-common.rangeFunction.inputTypes", + "type": "Array", + "label": "inputTypes", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/range.ts", + "lineNumber": 31 + }, + "signature": [ + "\"null\"[]" + ] + }, + { + "tags": [], + "id": "def-common.rangeFunction.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/range.ts", + "lineNumber": 32 + } + }, + { + "id": "def-common.rangeFunction.args", + "type": "Object", + "tags": [], + "children": [ + { + "id": "def-common.rangeFunction.args.gt", "type": "Object", "tags": [], "children": [ { "tags": [], - "id": "def-common.kibanaContextFunction.args.timeRange.types", + "id": "def-common.rangeFunction.args.gt.types", "type": "Array", "label": "types", "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 64 + "path": "src/plugins/data/common/search/expressions/range.ts", + "lineNumber": 37 }, "signature": [ - "(\"string\" | \"null\")[]" + "(\"string\" | \"number\")[]" ] }, { "tags": [], - "id": "def-common.kibanaContextFunction.args.timeRange.default", - "type": "Uncategorized", - "label": "default", + "id": "def-common.rangeFunction.args.gt.help", + "type": "string", + "label": "help", "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 65 + "path": "src/plugins/data/common/search/expressions/range.ts", + "lineNumber": 38 + } + } + ], + "description": [], + "label": "gt", + "source": { + "path": "src/plugins/data/common/search/expressions/range.ts", + "lineNumber": 36 + } + }, + { + "id": "def-common.rangeFunction.args.lt", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.rangeFunction.args.lt.types", + "type": "Array", + "label": "types", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/range.ts", + "lineNumber": 43 }, "signature": [ - "null" + "(\"string\" | \"number\")[]" ] }, { "tags": [], - "id": "def-common.kibanaContextFunction.args.timeRange.help", + "id": "def-common.rangeFunction.args.lt.help", "type": "string", "label": "help", "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 66 + "path": "src/plugins/data/common/search/expressions/range.ts", + "lineNumber": 44 } } ], "description": [], - "label": "timeRange", + "label": "lt", "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 63 + "path": "src/plugins/data/common/search/expressions/range.ts", + "lineNumber": 42 } }, { - "id": "def-common.kibanaContextFunction.args.savedSearchId", + "id": "def-common.rangeFunction.args.gte", "type": "Object", "tags": [], "children": [ { "tags": [], - "id": "def-common.kibanaContextFunction.args.savedSearchId.types", + "id": "def-common.rangeFunction.args.gte.types", "type": "Array", "label": "types", "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 71 + "path": "src/plugins/data/common/search/expressions/range.ts", + "lineNumber": 49 }, "signature": [ - "(\"string\" | \"null\")[]" + "(\"string\" | \"number\")[]" ] }, { "tags": [], - "id": "def-common.kibanaContextFunction.args.savedSearchId.default", - "type": "Uncategorized", - "label": "default", + "id": "def-common.rangeFunction.args.gte.help", + "type": "string", + "label": "help", + "description": [], + "source": { + "path": "src/plugins/data/common/search/expressions/range.ts", + "lineNumber": 50 + } + } + ], + "description": [], + "label": "gte", + "source": { + "path": "src/plugins/data/common/search/expressions/range.ts", + "lineNumber": 48 + } + }, + { + "id": "def-common.rangeFunction.args.lte", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.rangeFunction.args.lte.types", + "type": "Array", + "label": "types", "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 72 + "path": "src/plugins/data/common/search/expressions/range.ts", + "lineNumber": 55 }, "signature": [ - "null" + "(\"string\" | \"number\")[]" ] }, { "tags": [], - "id": "def-common.kibanaContextFunction.args.savedSearchId.help", + "id": "def-common.rangeFunction.args.lte.help", "type": "string", "label": "help", "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 73 + "path": "src/plugins/data/common/search/expressions/range.ts", + "lineNumber": 56 } } ], "description": [], - "label": "savedSearchId", + "label": "lte", "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 70 + "path": "src/plugins/data/common/search/expressions/range.ts", + "lineNumber": 54 } } ], "description": [], "label": "args", "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 47 + "path": "src/plugins/data/common/search/expressions/range.ts", + "lineNumber": 35 } }, { - "id": "def-common.kibanaContextFunction.fn", + "id": "def-common.rangeFunction.fn", "type": "Function", "label": "fn", "signature": [ - "(input: Input, args: Arguments, { getSavedObject }: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExecutionContext", - "text": "ExecutionContext" - }, - "<", - { - "pluginId": "inspector", - "scope": "common", - "docId": "kibInspectorPluginApi", - "section": "def-common.Adapters", - "text": "Adapters" - }, - ", ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ExecutionContextSearch", - "text": "ExecutionContextSearch" - }, - ">) => Promise<{ type: \"kibana_context\"; query: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.Query", - "text": "Query" - }, - "[]; filters: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataPluginApi", - "section": "def-common.Filter", - "text": "Filter" - } + "(input: null, args: Arguments) => { gt?: string | number | undefined; lt?: string | number | undefined; gte?: string | number | undefined; lte?: string | number | undefined; type: \"kibana_range\"; }" ], "description": [], "children": [ { - "type": "CompoundType", + "type": "Uncategorized", "label": "input", - "isRequired": false, + "isRequired": true, "signature": [ - "Input" + "null" ], "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 79 + "path": "src/plugins/data/common/search/expressions/range.ts", + "lineNumber": 62 } }, { @@ -19178,116 +22971,49 @@ ], "description": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 79 - } - }, - { - "type": "Object", - "label": "{ getSavedObject }", - "isRequired": true, - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExecutionContext", - "text": "ExecutionContext" - }, - "<", - { - "pluginId": "inspector", - "scope": "common", - "docId": "kibInspectorPluginApi", - "section": "def-common.Adapters", - "text": "Adapters" - }, - ", ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ExecutionContextSearch", - "text": "ExecutionContextSearch" - }, - ">" - ], - "description": [], - "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 79 + "path": "src/plugins/data/common/search/expressions/range.ts", + "lineNumber": 62 } } ], "tags": [], "returnComment": [], "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 79 + "path": "src/plugins/data/common/search/expressions/range.ts", + "lineNumber": 62 } } ], "description": [], - "label": "kibanaContextFunction", - "source": { - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "lineNumber": 40 - }, - "initialIsOpen": false - }, - { - "tags": [], - "id": "def-common.migrateIncludeExcludeFormat", - "type": "Object", - "label": "migrateIncludeExcludeFormat", - "description": [], + "label": "rangeFunction", "source": { - "path": "src/plugins/data/common/search/aggs/buckets/migrate_include_exclude_format.ts", - "lineNumber": 25 + "path": "src/plugins/data/common/search/expressions/range.ts", + "lineNumber": 28 }, - "signature": [ - "Partial<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.BucketAggParam", - "text": "BucketAggParam" - }, - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IBucketAggConfig", - "text": "IBucketAggConfig" - }, - ">>" - ], "initialIsOpen": false }, { - "id": "def-common.parentPipelineAggHelper", + "id": "def-common.siblingPipelineAggHelper", "type": "Object", "tags": [], "children": [ { "tags": [], - "id": "def-common.parentPipelineAggHelper.subtype", + "id": "def-common.siblingPipelineAggHelper.subtype", "type": "string", "label": "subtype", "description": [], "source": { - "path": "src/plugins/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.ts", - "lineNumber": 34 + "path": "src/plugins/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_helper.ts", + "lineNumber": 42 } }, { - "id": "def-common.parentPipelineAggHelper.params", + "id": "def-common.siblingPipelineAggHelper.params", "type": "Function", "label": "params", "signature": [ - "() => ", + "(bucketFilter?: string[]) => ", { "pluginId": "data", "scope": "common", @@ -19306,113 +23032,26 @@ ">[]" ], "description": [], - "children": [], - "tags": [], - "returnComment": [], - "source": { - "path": "src/plugins/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.ts", - "lineNumber": 35 - } - }, - { - "id": "def-common.parentPipelineAggHelper.getSerializedFormat", - "type": "Function", - "label": "getSerializedFormat", - "signature": [ - "(agg: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IMetricAggConfig", - "text": "IMetricAggConfig" - }, - ") => any" - ], - "description": [], "children": [ { - "type": "Object", - "label": "agg", + "type": "Array", + "label": "bucketFilter", "isRequired": true, "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IMetricAggConfig", - "text": "IMetricAggConfig" - } + "string[]" ], "description": [], "source": { - "path": "src/plugins/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.ts", - "lineNumber": 63 + "path": "src/plugins/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_helper.ts", + "lineNumber": 43 } } ], "tags": [], "returnComment": [], - "source": { - "path": "src/plugins/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.ts", - "lineNumber": 63 - } - } - ], - "description": [], - "label": "parentPipelineAggHelper", - "source": { - "path": "src/plugins/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.ts", - "lineNumber": 33 - }, - "initialIsOpen": false - }, - { - "id": "def-common.siblingPipelineAggHelper", - "type": "Object", - "tags": [], - "children": [ - { - "tags": [], - "id": "def-common.siblingPipelineAggHelper.subtype", - "type": "string", - "label": "subtype", - "description": [], - "source": { - "path": "src/plugins/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_helper.ts", - "lineNumber": 41 - } - }, - { - "id": "def-common.siblingPipelineAggHelper.params", - "type": "Function", - "label": "params", - "signature": [ - "() => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.MetricAggParam", - "text": "MetricAggParam" - }, - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IMetricAggConfig", - "text": "IMetricAggConfig" - }, - ">[]" - ], - "description": [], - "children": [], - "tags": [], - "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_helper.ts", - "lineNumber": 42 + "lineNumber": 43 } }, { @@ -19448,7 +23087,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_helper.ts", - "lineNumber": 77 + "lineNumber": 79 } } ], @@ -19456,7 +23095,7 @@ "returnComment": [], "source": { "path": "src/plugins/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_helper.ts", - "lineNumber": 77 + "lineNumber": 79 } } ], @@ -19464,10 +23103,10 @@ "label": "siblingPipelineAggHelper", "source": { "path": "src/plugins/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_helper.ts", - "lineNumber": 40 + "lineNumber": 41 }, "initialIsOpen": false } ] } -} +} \ No newline at end of file diff --git a/api_docs/data_search.mdx b/api_docs/data_search.mdx index 370bd2ffd101e8..70cbd231252480 100644 --- a/api_docs/data_search.mdx +++ b/api_docs/data_search.mdx @@ -36,9 +36,6 @@ import dataSearchObj from './data_search.json'; ### Interfaces -### Consts, variables and types - - ## Common ### Objects diff --git a/api_docs/data_ui.json b/api_docs/data_ui.json index cf0528bc7fafff..52d51002373949 100644 --- a/api_docs/data_ui.json +++ b/api_docs/data_ui.json @@ -290,6 +290,20 @@ ") => void) | undefined" ] }, + { + "tags": [], + "id": "def-public.QueryStringInputProps.submitOnBlur", + "type": "CompoundType", + "label": "submitOnBlur", + "description": [], + "source": { + "path": "src/plugins/data/public/ui/query_string_input/query_string_input.tsx", + "lineNumber": 56 + }, + "signature": [ + "boolean | undefined" + ] + }, { "tags": [], "id": "def-public.QueryStringInputProps.dataTestSubj", @@ -298,7 +312,7 @@ "description": [], "source": { "path": "src/plugins/data/public/ui/query_string_input/query_string_input.tsx", - "lineNumber": 56 + "lineNumber": 57 }, "signature": [ "string | undefined" @@ -312,7 +326,7 @@ "description": [], "source": { "path": "src/plugins/data/public/ui/query_string_input/query_string_input.tsx", - "lineNumber": 57 + "lineNumber": 58 }, "signature": [ "\"s\" | \"l\" | undefined" @@ -326,7 +340,7 @@ "description": [], "source": { "path": "src/plugins/data/public/ui/query_string_input/query_string_input.tsx", - "lineNumber": 58 + "lineNumber": 59 }, "signature": [ "string | undefined" @@ -340,7 +354,7 @@ "description": [], "source": { "path": "src/plugins/data/public/ui/query_string_input/query_string_input.tsx", - "lineNumber": 59 + "lineNumber": 60 }, "signature": [ "boolean | undefined" @@ -354,7 +368,7 @@ "description": [], "source": { "path": "src/plugins/data/public/ui/query_string_input/query_string_input.tsx", - "lineNumber": 60 + "lineNumber": 61 }, "signature": [ "boolean | undefined" @@ -368,7 +382,7 @@ "description": [], "source": { "path": "src/plugins/data/public/ui/query_string_input/query_string_input.tsx", - "lineNumber": 61 + "lineNumber": 62 }, "signature": [ "string | React.ComponentClass<{}, any> | React.FunctionComponent<{}> | undefined" @@ -382,7 +396,7 @@ "description": [], "source": { "path": "src/plugins/data/public/ui/query_string_input/query_string_input.tsx", - "lineNumber": 67 + "lineNumber": 68 }, "signature": [ "\"text\" | \"lucene\" | undefined" @@ -396,7 +410,7 @@ "description": [], "source": { "path": "src/plugins/data/public/ui/query_string_input/query_string_input.tsx", - "lineNumber": 68 + "lineNumber": 69 }, "signature": [ "string | undefined" @@ -423,7 +437,7 @@ "lineNumber": 17 }, "signature": [ - "Pick, \"children\" | \"onClick\" | \"color\" | \"id\" | \"title\" | \"placeholder\" | \"isClearable\" | \"async\" | \"compressed\" | \"fullWidth\" | \"singleSelection\" | \"prepend\" | \"append\" | \"sortMatchesBy\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDown\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"customOptionText\" | \"onCreateOption\" | \"renderOption\" | \"inputRef\" | \"isDisabled\" | \"isInvalid\" | \"noSuggestions\" | \"rowHeight\" | \"delimiter\">, \"children\" | \"onClick\" | \"color\" | \"id\" | \"title\" | \"isClearable\" | \"async\" | \"compressed\" | \"fullWidth\" | \"singleSelection\" | \"prepend\" | \"append\" | \"sortMatchesBy\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDown\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"customOptionText\" | \"onCreateOption\" | \"renderOption\" | \"inputRef\" | \"isDisabled\" | \"isInvalid\" | \"noSuggestions\" | \"rowHeight\" | \"delimiter\"> & globalThis.Required, \"children\" | \"onClick\" | \"color\" | \"id\" | \"title\" | \"placeholder\" | \"isClearable\" | \"async\" | \"compressed\" | \"fullWidth\" | \"singleSelection\" | \"prepend\" | \"append\" | \"sortMatchesBy\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDown\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"customOptionText\" | \"onCreateOption\" | \"renderOption\" | \"inputRef\" | \"isDisabled\" | \"isInvalid\" | \"noSuggestions\" | \"rowHeight\" | \"delimiter\">, \"placeholder\">> & { onChange: (indexPatternId?: string | undefined) => void; indexPatternId: string; fieldTypes?: string[] | undefined; onNoIndexPatterns?: (() => void) | undefined; maxIndexPatterns?: number | undefined; }" + "Pick, \"children\" | \"onClick\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"placeholder\" | \"isClearable\" | \"async\" | \"compressed\" | \"fullWidth\" | \"singleSelection\" | \"prepend\" | \"append\" | \"sortMatchesBy\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"customOptionText\" | \"onCreateOption\" | \"renderOption\" | \"inputRef\" | \"isDisabled\" | \"isInvalid\" | \"noSuggestions\" | \"rowHeight\" | \"delimiter\">, \"children\" | \"onClick\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"isClearable\" | \"async\" | \"compressed\" | \"fullWidth\" | \"singleSelection\" | \"prepend\" | \"append\" | \"sortMatchesBy\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"customOptionText\" | \"onCreateOption\" | \"renderOption\" | \"inputRef\" | \"isDisabled\" | \"isInvalid\" | \"noSuggestions\" | \"rowHeight\" | \"delimiter\"> & globalThis.Required, \"children\" | \"onClick\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"placeholder\" | \"isClearable\" | \"async\" | \"compressed\" | \"fullWidth\" | \"singleSelection\" | \"prepend\" | \"append\" | \"sortMatchesBy\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"customOptionText\" | \"onCreateOption\" | \"renderOption\" | \"inputRef\" | \"isDisabled\" | \"isInvalid\" | \"noSuggestions\" | \"rowHeight\" | \"delimiter\">, \"placeholder\">> & { onChange: (indexPatternId?: string | undefined) => void; indexPatternId: string; fieldTypes?: string[] | undefined; onNoIndexPatterns?: (() => void) | undefined; maxIndexPatterns?: number | undefined; }" ], "initialIsOpen": false }, diff --git a/api_docs/discover.json b/api_docs/discover.json index 267669692051f8..a785c254efeab5 100644 --- a/api_docs/discover.json +++ b/api_docs/discover.json @@ -807,8 +807,8 @@ "label": "docViews", "description": [], "source": { - "path": "src/plugins/discover/public/plugin.ts", - "lineNumber": 75 + "path": "src/plugins/discover/public/plugin.tsx", + "lineNumber": 76 }, "signature": [ "{ addDocView(docViewRaw: ", @@ -832,8 +832,8 @@ } ], "source": { - "path": "src/plugins/discover/public/plugin.ts", - "lineNumber": 74 + "path": "src/plugins/discover/public/plugin.tsx", + "lineNumber": 75 }, "lifecycle": "setup", "initialIsOpen": true @@ -852,8 +852,8 @@ "label": "savedSearchLoader", "description": [], "source": { - "path": "src/plugins/discover/public/plugin.ts", - "lineNumber": 86 + "path": "src/plugins/discover/public/plugin.tsx", + "lineNumber": 87 }, "signature": [ { @@ -874,8 +874,8 @@ "\n`share` plugin URL generator for Discover app. Use it to generate links into\nDiscover application, example:\n\n```ts\nconst url = await plugins.discover.urlGenerator.createUrl({\n savedSearchId: '571aaf70-4c88-11e8-b3d7-01146121b73d',\n indexPatternId: 'c367b774-a4c2-11ea-bb37-0242ac130002',\n timeRange: {\n to: 'now',\n from: 'now-15m',\n mode: 'relative',\n },\n});\n```" ], "source": { - "path": "src/plugins/discover/public/plugin.ts", - "lineNumber": 104 + "path": "src/plugins/discover/public/plugin.tsx", + "lineNumber": 105 }, "signature": [ { @@ -890,8 +890,8 @@ } ], "source": { - "path": "src/plugins/discover/public/plugin.ts", - "lineNumber": 85 + "path": "src/plugins/discover/public/plugin.tsx", + "lineNumber": 86 }, "lifecycle": "start", "initialIsOpen": true diff --git a/api_docs/expressions.json b/api_docs/expressions.json index ee496cc7c06a33..eefffb009be2ac 100644 --- a/api_docs/expressions.json +++ b/api_docs/expressions.json @@ -5364,7 +5364,7 @@ "section": "def-common.InferFunctionDefinition", "text": "InferFunctionDefinition" }, - "[\"name\"], initialArgs: { [K in keyof FunctionArgs]: ", + "[\"name\"], initialArgs: { [K in keyof FunctionArgs]: FunctionArgs[K] | ", { "pluginId": "expressions", "scope": "common", @@ -5372,7 +5372,7 @@ "section": "def-common.ExpressionAstExpressionBuilder", "text": "ExpressionAstExpressionBuilder" }, - " | FunctionArgs[K] | ", + " | ", { "pluginId": "expressions", "scope": "common", @@ -5421,7 +5421,7 @@ "label": "initialArgs", "isRequired": true, "signature": [ - "{ [K in keyof FunctionArgs]: ", + "{ [K in keyof FunctionArgs]: FunctionArgs[K] | ", { "pluginId": "expressions", "scope": "common", @@ -5429,7 +5429,7 @@ "section": "def-common.ExpressionAstExpressionBuilder", "text": "ExpressionAstExpressionBuilder" }, - " | FunctionArgs[K] | ", + " | ", { "pluginId": "expressions", "scope": "common", @@ -13485,7 +13485,7 @@ "section": "def-common.InferFunctionDefinition", "text": "InferFunctionDefinition" }, - "[\"name\"], initialArgs: { [K in keyof FunctionArgs]: ", + "[\"name\"], initialArgs: { [K in keyof FunctionArgs]: FunctionArgs[K] | ", { "pluginId": "expressions", "scope": "common", @@ -13493,7 +13493,7 @@ "section": "def-common.ExpressionAstExpressionBuilder", "text": "ExpressionAstExpressionBuilder" }, - " | FunctionArgs[K] | ", + " | ", { "pluginId": "expressions", "scope": "common", @@ -13542,7 +13542,7 @@ "label": "initialArgs", "isRequired": true, "signature": [ - "{ [K in keyof FunctionArgs]: ", + "{ [K in keyof FunctionArgs]: FunctionArgs[K] | ", { "pluginId": "expressions", "scope": "common", @@ -13550,7 +13550,7 @@ "section": "def-common.ExpressionAstExpressionBuilder", "text": "ExpressionAstExpressionBuilder" }, - " | FunctionArgs[K] | ", + " | ", { "pluginId": "expressions", "scope": "common", @@ -21552,7 +21552,7 @@ "section": "def-common.InferFunctionDefinition", "text": "InferFunctionDefinition" }, - "[\"name\"], initialArgs: { [K in keyof FunctionArgs]: ", + "[\"name\"], initialArgs: { [K in keyof FunctionArgs]: FunctionArgs[K] | ", { "pluginId": "expressions", "scope": "common", @@ -21560,7 +21560,7 @@ "section": "def-common.ExpressionAstExpressionBuilder", "text": "ExpressionAstExpressionBuilder" }, - " | FunctionArgs[K] | ", + " | ", { "pluginId": "expressions", "scope": "common", @@ -21609,7 +21609,7 @@ "label": "initialArgs", "isRequired": true, "signature": [ - "{ [K in keyof FunctionArgs]: ", + "{ [K in keyof FunctionArgs]: FunctionArgs[K] | ", { "pluginId": "expressions", "scope": "common", @@ -21617,7 +21617,7 @@ "section": "def-common.ExpressionAstExpressionBuilder", "text": "ExpressionAstExpressionBuilder" }, - " | FunctionArgs[K] | ", + " | ", { "pluginId": "expressions", "scope": "common", @@ -21952,6 +21952,41 @@ "returnComment": [], "initialIsOpen": false }, + { + "id": "def-common.createMockContext", + "type": "Function", + "children": [], + "signature": [ + "() => ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExecutionContext", + "text": "ExecutionContext" + }, + "<", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" + }, + ", ", + "SerializableState", + ">" + ], + "description": [], + "label": "createMockContext", + "source": { + "path": "src/plugins/expressions/common/util/test_utils.ts", + "lineNumber": 11 + }, + "tags": [], + "returnComment": [], + "initialIsOpen": false + }, { "id": "def-common.format", "type": "Function", @@ -22465,6 +22500,52 @@ "tags": [], "returnComment": [], "initialIsOpen": false + }, + { + "id": "def-common.unboxExpressionValue", + "type": "Function", + "label": "unboxExpressionValue", + "signature": [ + "({\n type,\n ...value\n}: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + ") => T" + ], + "description": [], + "children": [ + { + "type": "CompoundType", + "label": "{\n type,\n ...value\n}", + "isRequired": true, + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "" + ], + "description": [], + "source": { + "path": "src/plugins/expressions/common/expression_types/unbox_expression_value.ts", + "lineNumber": 11 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "src/plugins/expressions/common/expression_types/unbox_expression_value.ts", + "lineNumber": 11 + }, + "initialIsOpen": false } ], "interfaces": [ @@ -33883,4 +33964,4 @@ } ] } -} +} \ No newline at end of file diff --git a/api_docs/file_upload.json b/api_docs/file_upload.json index 350bd1aa067f3e..6a624f87bfcd29 100644 --- a/api_docs/file_upload.json +++ b/api_docs/file_upload.json @@ -4,6 +4,61 @@ "classes": [], "functions": [], "interfaces": [ + { + "id": "def-public.AnalysisResult", + "type": "Interface", + "label": "AnalysisResult", + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-public.AnalysisResult.results", + "type": "Object", + "label": "results", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 21 + }, + "signature": [ + { + "pluginId": "fileUpload", + "scope": "common", + "docId": "kibFileUploadPluginApi", + "section": "def-common.FindFileStructureResponse", + "text": "FindFileStructureResponse" + } + ] + }, + { + "tags": [], + "id": "def-public.AnalysisResult.overrides", + "type": "CompoundType", + "label": "overrides", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 22 + }, + "signature": [ + { + "pluginId": "fileUpload", + "scope": "common", + "docId": "kibFileUploadPluginApi", + "section": "def-common.FormattedOverrides", + "text": "FormattedOverrides" + }, + " | undefined" + ] + } + ], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 20 + }, + "initialIsOpen": false + }, { "id": "def-public.CreateDocsResponse", "type": "Interface", @@ -90,13 +145,13 @@ "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 26 + "lineNumber": 93 } } ], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 25 + "lineNumber": 92 }, "initialIsOpen": false }, @@ -212,335 +267,240 @@ "initialIsOpen": false }, { - "id": "def-public.IImporter", + "id": "def-public.FindFileStructureResponse", "type": "Interface", - "label": "IImporter", + "label": "FindFileStructureResponse", "description": [], "tags": [], "children": [ { - "id": "def-public.IImporter.read", - "type": "Function", - "label": "read", + "tags": [], + "id": "def-public.FindFileStructureResponse.charset", + "type": "string", + "label": "charset", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 26 + } + }, + { + "tags": [], + "id": "def-public.FindFileStructureResponse.has_header_row", + "type": "boolean", + "label": "has_header_row", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 27 + } + }, + { + "tags": [], + "id": "def-public.FindFileStructureResponse.has_byte_order_marker", + "type": "boolean", + "label": "has_byte_order_marker", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 28 + } + }, + { + "tags": [], + "id": "def-public.FindFileStructureResponse.format", + "type": "string", + "label": "format", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 29 + } + }, + { + "tags": [], + "id": "def-public.FindFileStructureResponse.field_stats", + "type": "Object", + "label": "field_stats", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 30 + }, "signature": [ - "(data: ArrayBuffer) => { success: boolean; }" - ], + "{ [fieldName: string]: { count: number; cardinality: number; top_hits: { count: number; value: any; }[]; mean_value?: number | undefined; median_value?: number | undefined; max_value?: number | undefined; min_value?: number | undefined; earliest?: string | undefined; latest?: string | undefined; }; }" + ] + }, + { + "tags": [], + "id": "def-public.FindFileStructureResponse.sample_start", + "type": "string", + "label": "sample_start", "description": [], - "children": [ - { - "type": "Object", - "label": "data", - "isRequired": true, - "signature": [ - "ArrayBuffer" - ], - "description": [], - "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 44 - } - } - ], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 43 + } + }, + { "tags": [], - "returnComment": [], + "id": "def-public.FindFileStructureResponse.num_messages_analyzed", + "type": "number", + "label": "num_messages_analyzed", + "description": [], "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "path": "x-pack/plugins/file_upload/common/types.ts", "lineNumber": 44 } }, { - "id": "def-public.IImporter.initializeImport", - "type": "Function", - "label": "initializeImport", + "tags": [], + "id": "def-public.FindFileStructureResponse.mappings", + "type": "Object", + "label": "mappings", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 45 + }, "signature": [ - "(index: string, settings: ", + "{ properties: { [fieldName: string]: { type: ", { - "pluginId": "fileUpload", + "pluginId": "data", "scope": "common", - "docId": "kibFileUploadPluginApi", - "section": "def-common.Settings", - "text": "Settings" + "docId": "kibDataPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" }, - ", mappings: ", + ".STRING | ", { - "pluginId": "fileUpload", + "pluginId": "data", "scope": "common", - "docId": "kibFileUploadPluginApi", - "section": "def-common.Mappings", - "text": "Mappings" + "docId": "kibDataPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" }, - ", pipeline: ", + ".TEXT | ", { - "pluginId": "fileUpload", + "pluginId": "data", "scope": "common", - "docId": "kibFileUploadPluginApi", - "section": "def-common.IngestPipeline", - "text": "IngestPipeline" + "docId": "kibDataPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" }, - ") => Promise<", + ".KEYWORD | ", { - "pluginId": "fileUpload", + "pluginId": "data", "scope": "common", - "docId": "kibFileUploadPluginApi", - "section": "def-common.ImportResponse", - "text": "ImportResponse" - }, - ">" - ], - "description": [], - "children": [ - { - "type": "string", - "label": "index", - "isRequired": true, - "signature": [ - "string" - ], - "description": [], - "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 46 - } - }, - { - "type": "Object", - "label": "settings", - "isRequired": true, - "signature": [ - { - "pluginId": "fileUpload", - "scope": "common", - "docId": "kibFileUploadPluginApi", - "section": "def-common.Settings", - "text": "Settings" - } - ], - "description": [], - "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 47 - } - }, - { - "type": "Object", - "label": "mappings", - "isRequired": true, - "signature": [ - { - "pluginId": "fileUpload", - "scope": "common", - "docId": "kibFileUploadPluginApi", - "section": "def-common.Mappings", - "text": "Mappings" - } - ], - "description": [], - "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 48 - } + "docId": "kibDataPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" }, + ".BOOLEAN | ", { - "type": "Object", - "label": "pipeline", - "isRequired": true, - "signature": [ - { - "pluginId": "fileUpload", - "scope": "common", - "docId": "kibFileUploadPluginApi", - "section": "def-common.IngestPipeline", - "text": "IngestPipeline" - } - ], - "description": [], - "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 49 - } + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" } - ], + ] + }, + { "tags": [], - "returnComment": [], + "id": "def-public.FindFileStructureResponse.quote", + "type": "string", + "label": "quote", + "description": [], "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 45 + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 58 } }, { - "id": "def-public.IImporter.import", - "type": "Function", - "label": "import", - "signature": [ - "(id: string, index: string, pipelineId: string | undefined, setImportProgress: (progress: number) => void) => Promise<", - { - "pluginId": "fileUpload", - "scope": "public", - "docId": "kibFileUploadPluginApi", - "section": "def-public.ImportResults", - "text": "ImportResults" - }, - ">" - ], - "description": [], - "children": [ - { - "type": "string", - "label": "id", - "isRequired": true, - "signature": [ - "string" - ], - "description": [], - "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 52 - } - }, - { - "type": "string", - "label": "index", - "isRequired": true, - "signature": [ - "string" - ], - "description": [], - "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 53 - } - }, - { - "type": "string", - "label": "pipelineId", - "isRequired": false, - "signature": [ - "string | undefined" - ], - "description": [], - "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 54 - } - }, - { - "type": "Function", - "label": "setImportProgress", - "isRequired": true, - "signature": [ - "(progress: number) => void" - ], - "description": [], - "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 55 - } - } - ], "tags": [], - "returnComment": [], + "id": "def-public.FindFileStructureResponse.delimiter", + "type": "string", + "label": "delimiter", + "description": [], "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 51 + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 59 } - } - ], - "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 43 - }, - "initialIsOpen": false - }, - { - "id": "def-public.ImportConfig", - "type": "Interface", - "label": "ImportConfig", - "description": [], - "tags": [], - "children": [ + }, { "tags": [], - "id": "def-public.ImportConfig.settings", - "type": "Object", - "label": "settings", + "id": "def-public.FindFileStructureResponse.need_client_timezone", + "type": "boolean", + "label": "need_client_timezone", "description": [], "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 18 + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 60 + } + }, + { + "tags": [], + "id": "def-public.FindFileStructureResponse.num_lines_analyzed", + "type": "number", + "label": "num_lines_analyzed", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 61 + } + }, + { + "tags": [], + "id": "def-public.FindFileStructureResponse.column_names", + "type": "Array", + "label": "column_names", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 62 }, "signature": [ - { - "pluginId": "fileUpload", - "scope": "common", - "docId": "kibFileUploadPluginApi", - "section": "def-common.Settings", - "text": "Settings" - } + "string[] | undefined" ] }, { "tags": [], - "id": "def-public.ImportConfig.mappings", - "type": "Object", - "label": "mappings", + "id": "def-public.FindFileStructureResponse.explanation", + "type": "Array", + "label": "explanation", "description": [], "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 19 + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 63 }, "signature": [ - { - "pluginId": "fileUpload", - "scope": "common", - "docId": "kibFileUploadPluginApi", - "section": "def-common.Mappings", - "text": "Mappings" - } + "string[] | undefined" ] }, { "tags": [], - "id": "def-public.ImportConfig.pipeline", - "type": "Object", - "label": "pipeline", + "id": "def-public.FindFileStructureResponse.grok_pattern", + "type": "string", + "label": "grok_pattern", "description": [], "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 20 + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 64 }, "signature": [ - { - "pluginId": "fileUpload", - "scope": "common", - "docId": "kibFileUploadPluginApi", - "section": "def-common.IngestPipeline", - "text": "IngestPipeline" - } + "string | undefined" ] - } - ], - "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 17 - }, - "initialIsOpen": false - }, - { - "id": "def-public.ImportFactoryOptions", - "type": "Interface", - "label": "ImportFactoryOptions", - "description": [], - "tags": [], - "children": [ + }, { "tags": [], - "id": "def-public.ImportFactoryOptions.excludeLinesPattern", + "id": "def-public.FindFileStructureResponse.multiline_start_pattern", "type": "string", - "label": "excludeLinesPattern", + "label": "multiline_start_pattern", "description": [], "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 38 + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 65 }, "signature": [ "string | undefined" @@ -548,13 +508,13 @@ }, { "tags": [], - "id": "def-public.ImportFactoryOptions.multilineStartPattern", + "id": "def-public.FindFileStructureResponse.exclude_lines_pattern", "type": "string", - "label": "multilineStartPattern", + "label": "exclude_lines_pattern", "description": [], "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 39 + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 66 }, "signature": [ "string | undefined" @@ -562,427 +522,1435 @@ }, { "tags": [], - "id": "def-public.ImportFactoryOptions.importConfig", - "type": "Object", - "label": "importConfig", + "id": "def-public.FindFileStructureResponse.java_timestamp_formats", + "type": "Array", + "label": "java_timestamp_formats", "description": [], "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 40 + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 67 }, "signature": [ - { - "pluginId": "fileUpload", - "scope": "public", - "docId": "kibFileUploadPluginApi", - "section": "def-public.ImportConfig", - "text": "ImportConfig" - } + "string[] | undefined" ] - } - ], - "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 37 - }, - "initialIsOpen": false - }, - { - "id": "def-public.ImportFailure", - "type": "Interface", - "label": "ImportFailure", - "description": [], - "tags": [], - "children": [ + }, { "tags": [], - "id": "def-public.ImportFailure.item", - "type": "number", - "label": "item", + "id": "def-public.FindFileStructureResponse.joda_timestamp_formats", + "type": "Array", + "label": "joda_timestamp_formats", "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 20 - } + "lineNumber": 68 + }, + "signature": [ + "string[] | undefined" + ] }, { "tags": [], - "id": "def-public.ImportFailure.reason", + "id": "def-public.FindFileStructureResponse.timestamp_field", "type": "string", - "label": "reason", + "label": "timestamp_field", "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 21 - } + "lineNumber": 69 + }, + "signature": [ + "string | undefined" + ] }, { "tags": [], - "id": "def-public.ImportFailure.doc", + "id": "def-public.FindFileStructureResponse.should_trim_fields", "type": "CompoundType", - "label": "doc", + "label": "should_trim_fields", "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 22 + "lineNumber": 70 }, "signature": [ - { - "pluginId": "fileUpload", - "scope": "common", - "docId": "kibFileUploadPluginApi", - "section": "def-common.ImportDoc", - "text": "ImportDoc" - } + "boolean | undefined" ] } ], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 19 + "lineNumber": 25 }, "initialIsOpen": false }, { - "id": "def-public.ImportResponse", + "id": "def-public.IImporter", "type": "Interface", - "label": "ImportResponse", + "label": "IImporter", "description": [], "tags": [], "children": [ + { + "id": "def-public.IImporter.read", + "type": "Function", + "label": "read", + "signature": [ + "(data: ArrayBuffer) => { success: boolean; }" + ], + "description": [], + "children": [ + { + "type": "Object", + "label": "data", + "isRequired": true, + "signature": [ + "ArrayBuffer" + ], + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 44 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 44 + } + }, + { + "id": "def-public.IImporter.initializeImport", + "type": "Function", + "label": "initializeImport", + "signature": [ + "(index: string, settings: ", + { + "pluginId": "fileUpload", + "scope": "common", + "docId": "kibFileUploadPluginApi", + "section": "def-common.Settings", + "text": "Settings" + }, + ", mappings: ", + { + "pluginId": "fileUpload", + "scope": "common", + "docId": "kibFileUploadPluginApi", + "section": "def-common.Mappings", + "text": "Mappings" + }, + ", pipeline: ", + { + "pluginId": "fileUpload", + "scope": "common", + "docId": "kibFileUploadPluginApi", + "section": "def-common.IngestPipeline", + "text": "IngestPipeline" + }, + ") => Promise<", + { + "pluginId": "fileUpload", + "scope": "common", + "docId": "kibFileUploadPluginApi", + "section": "def-common.ImportResponse", + "text": "ImportResponse" + }, + ">" + ], + "description": [], + "children": [ + { + "type": "string", + "label": "index", + "isRequired": true, + "signature": [ + "string" + ], + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 46 + } + }, + { + "type": "Object", + "label": "settings", + "isRequired": true, + "signature": [ + { + "pluginId": "fileUpload", + "scope": "common", + "docId": "kibFileUploadPluginApi", + "section": "def-common.Settings", + "text": "Settings" + } + ], + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 47 + } + }, + { + "type": "Object", + "label": "mappings", + "isRequired": true, + "signature": [ + { + "pluginId": "fileUpload", + "scope": "common", + "docId": "kibFileUploadPluginApi", + "section": "def-common.Mappings", + "text": "Mappings" + } + ], + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 48 + } + }, + { + "type": "Object", + "label": "pipeline", + "isRequired": true, + "signature": [ + { + "pluginId": "fileUpload", + "scope": "common", + "docId": "kibFileUploadPluginApi", + "section": "def-common.IngestPipeline", + "text": "IngestPipeline" + } + ], + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 49 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 45 + } + }, + { + "id": "def-public.IImporter.import", + "type": "Function", + "label": "import", + "signature": [ + "(id: string, index: string, pipelineId: string | undefined, setImportProgress: (progress: number) => void) => Promise<", + { + "pluginId": "fileUpload", + "scope": "public", + "docId": "kibFileUploadPluginApi", + "section": "def-public.ImportResults", + "text": "ImportResults" + }, + ">" + ], + "description": [], + "children": [ + { + "type": "string", + "label": "id", + "isRequired": true, + "signature": [ + "string" + ], + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 52 + } + }, + { + "type": "string", + "label": "index", + "isRequired": true, + "signature": [ + "string" + ], + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 53 + } + }, + { + "type": "string", + "label": "pipelineId", + "isRequired": false, + "signature": [ + "string | undefined" + ], + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 54 + } + }, + { + "type": "Function", + "label": "setImportProgress", + "isRequired": true, + "signature": [ + "(progress: number) => void" + ], + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 55 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 51 + } + } + ], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 43 + }, + "initialIsOpen": false + }, + { + "id": "def-public.ImportConfig", + "type": "Interface", + "label": "ImportConfig", + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-public.ImportConfig.settings", + "type": "Object", + "label": "settings", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 18 + }, + "signature": [ + { + "pluginId": "fileUpload", + "scope": "common", + "docId": "kibFileUploadPluginApi", + "section": "def-common.Settings", + "text": "Settings" + } + ] + }, + { + "tags": [], + "id": "def-public.ImportConfig.mappings", + "type": "Object", + "label": "mappings", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 19 + }, + "signature": [ + { + "pluginId": "fileUpload", + "scope": "common", + "docId": "kibFileUploadPluginApi", + "section": "def-common.Mappings", + "text": "Mappings" + } + ] + }, + { + "tags": [], + "id": "def-public.ImportConfig.pipeline", + "type": "Object", + "label": "pipeline", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 20 + }, + "signature": [ + { + "pluginId": "fileUpload", + "scope": "common", + "docId": "kibFileUploadPluginApi", + "section": "def-common.IngestPipeline", + "text": "IngestPipeline" + } + ] + } + ], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 17 + }, + "initialIsOpen": false + }, + { + "id": "def-public.ImportFactoryOptions", + "type": "Interface", + "label": "ImportFactoryOptions", + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-public.ImportFactoryOptions.excludeLinesPattern", + "type": "string", + "label": "excludeLinesPattern", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 38 + }, + "signature": [ + "string | undefined" + ] + }, + { + "tags": [], + "id": "def-public.ImportFactoryOptions.multilineStartPattern", + "type": "string", + "label": "multilineStartPattern", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 39 + }, + "signature": [ + "string | undefined" + ] + }, + { + "tags": [], + "id": "def-public.ImportFactoryOptions.importConfig", + "type": "Object", + "label": "importConfig", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 40 + }, + "signature": [ + { + "pluginId": "fileUpload", + "scope": "public", + "docId": "kibFileUploadPluginApi", + "section": "def-public.ImportConfig", + "text": "ImportConfig" + } + ] + } + ], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 37 + }, + "initialIsOpen": false + }, + { + "id": "def-public.ImportFailure", + "type": "Interface", + "label": "ImportFailure", + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-public.ImportFailure.item", + "type": "number", + "label": "item", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 87 + } + }, + { + "tags": [], + "id": "def-public.ImportFailure.reason", + "type": "string", + "label": "reason", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 88 + } + }, + { + "tags": [], + "id": "def-public.ImportFailure.doc", + "type": "CompoundType", + "label": "doc", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 89 + }, + "signature": [ + { + "pluginId": "fileUpload", + "scope": "common", + "docId": "kibFileUploadPluginApi", + "section": "def-common.ImportDoc", + "text": "ImportDoc" + } + ] + } + ], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 86 + }, + "initialIsOpen": false + }, + { + "id": "def-public.ImportResponse", + "type": "Interface", + "label": "ImportResponse", + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-public.ImportResponse.success", + "type": "boolean", + "label": "success", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 76 + } + }, + { + "tags": [], + "id": "def-public.ImportResponse.id", + "type": "string", + "label": "id", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 77 + } + }, + { + "tags": [], + "id": "def-public.ImportResponse.index", + "type": "string", + "label": "index", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 78 + }, + "signature": [ + "string | undefined" + ] + }, + { + "tags": [], + "id": "def-public.ImportResponse.pipelineId", + "type": "string", + "label": "pipelineId", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 79 + }, + "signature": [ + "string | undefined" + ] + }, + { + "tags": [], + "id": "def-public.ImportResponse.docCount", + "type": "number", + "label": "docCount", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 80 + } + }, + { + "tags": [], + "id": "def-public.ImportResponse.failures", + "type": "Array", + "label": "failures", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 81 + }, + "signature": [ + { + "pluginId": "fileUpload", + "scope": "common", + "docId": "kibFileUploadPluginApi", + "section": "def-common.ImportFailure", + "text": "ImportFailure" + }, + "[]" + ] + }, + { + "tags": [], + "id": "def-public.ImportResponse.error", + "type": "Any", + "label": "error", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 82 + }, + "signature": [ + "any" + ] + }, + { + "tags": [], + "id": "def-public.ImportResponse.ingestError", + "type": "CompoundType", + "label": "ingestError", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 83 + }, + "signature": [ + "boolean | undefined" + ] + } + ], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 75 + }, + "initialIsOpen": false + }, + { + "id": "def-public.ImportResults", + "type": "Interface", + "label": "ImportResults", + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-public.ImportResults.success", + "type": "boolean", + "label": "success", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 24 + } + }, + { + "tags": [], + "id": "def-public.ImportResults.failures", + "type": "Array", + "label": "failures", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 25 + }, + "signature": [ + { + "pluginId": "fileUpload", + "scope": "common", + "docId": "kibFileUploadPluginApi", + "section": "def-common.ImportFailure", + "text": "ImportFailure" + }, + "[] | undefined" + ] + }, + { + "tags": [], + "id": "def-public.ImportResults.docCount", + "type": "number", + "label": "docCount", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 26 + }, + "signature": [ + "number | undefined" + ] + }, + { + "tags": [], + "id": "def-public.ImportResults.error", + "type": "Any", + "label": "error", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 27 + }, + "signature": [ + "any" + ] + } + ], + "source": { + "path": "x-pack/plugins/file_upload/public/importer/types.ts", + "lineNumber": 23 + }, + "initialIsOpen": false + }, + { + "id": "def-public.IngestPipeline", + "type": "Interface", + "label": "IngestPipeline", + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-public.IngestPipeline.description", + "type": "string", + "label": "description", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 120 + } + }, + { + "tags": [], + "id": "def-public.IngestPipeline.processors", + "type": "Array", + "label": "processors", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 121 + }, + "signature": [ + "any[]" + ] + } + ], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 119 + }, + "initialIsOpen": false + }, + { + "id": "def-public.IngestPipelineWrapper", + "type": "Interface", + "label": "IngestPipelineWrapper", + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-public.IngestPipelineWrapper.id", + "type": "string", + "label": "id", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 115 + } + }, + { + "tags": [], + "id": "def-public.IngestPipelineWrapper.pipeline", + "type": "Object", + "label": "pipeline", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 116 + }, + "signature": [ + { + "pluginId": "fileUpload", + "scope": "common", + "docId": "kibFileUploadPluginApi", + "section": "def-common.IngestPipeline", + "text": "IngestPipeline" + } + ] + } + ], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 114 + }, + "initialIsOpen": false + }, + { + "id": "def-public.InputOverrides", + "type": "Interface", + "label": "InputOverrides", + "description": [], + "tags": [], + "children": [ + { + "id": "def-public.InputOverrides.Unnamed", + "type": "Any", + "label": "Unnamed", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 11 + }, + "signature": [ + "any" + ] + } + ], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 10 + }, + "initialIsOpen": false + }, + { + "id": "def-public.Mappings", + "type": "Interface", + "label": "Mappings", + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-public.Mappings._meta", + "type": "Object", + "label": "_meta", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 106 + }, + "signature": [ + "{ created_by: string; } | undefined" + ] + }, + { + "tags": [], + "id": "def-public.Mappings.properties", + "type": "Object", + "label": "properties", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 109 + }, + "signature": [ + "{ [key: string]: any; }" + ] + } + ], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 105 + }, + "initialIsOpen": false + }, + { + "id": "def-public.Settings", + "type": "Interface", + "label": "Settings", + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-public.Settings.pipeline", + "type": "string", + "label": "pipeline", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 99 + }, + "signature": [ + "string | undefined" + ] + }, + { + "tags": [], + "id": "def-public.Settings.index", + "type": "string", + "label": "index", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 100 + } + }, + { + "tags": [], + "id": "def-public.Settings.body", + "type": "Array", + "label": "body", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 101 + }, + "signature": [ + "any[]" + ] + }, + { + "id": "def-public.Settings.Unnamed", + "type": "Any", + "label": "Unnamed", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 102 + }, + "signature": [ + "any" + ] + } + ], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 98 + }, + "initialIsOpen": false + } + ], + "enums": [], + "misc": [ + { + "tags": [], + "id": "def-public.ABSOLUTE_MAX_FILE_SIZE_BYTES", + "type": "number", + "label": "ABSOLUTE_MAX_FILE_SIZE_BYTES", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/constants.ts", + "lineNumber": 14 + }, + "signature": [ + "1073741274" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-public.FILE_SIZE_DISPLAY_FORMAT", + "type": "string", + "label": "FILE_SIZE_DISPLAY_FORMAT", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/constants.ts", + "lineNumber": 15 + }, + "signature": [ + "\"0,0.[0] b\"" + ], + "initialIsOpen": false + }, + { + "id": "def-public.FormattedOverrides", + "type": "Type", + "label": "FormattedOverrides", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 14 + }, + "signature": [ + "InputOverrides & { column_names: string[]; has_header_row: boolean; should_trim_fields: boolean; }" + ], + "initialIsOpen": false + }, + { + "id": "def-public.ImportDoc", + "type": "Type", + "label": "ImportDoc", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 96 + }, + "signature": [ + "string | object | ", + { + "pluginId": "fileUpload", + "scope": "common", + "docId": "kibFileUploadPluginApi", + "section": "def-common.Doc", + "text": "Doc" + } + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-public.INDEX_META_DATA_CREATED_BY", + "type": "string", + "label": "INDEX_META_DATA_CREATED_BY", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/constants.ts", + "lineNumber": 19 + }, + "signature": [ + "\"ml-file-data-visualizer\"" + ], + "initialIsOpen": false + }, + { + "id": "def-public.InputData", + "type": "Type", + "label": "InputData", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 73 + }, + "signature": [ + "any[]" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-public.MAX_FILE_SIZE", + "type": "string", + "label": "MAX_FILE_SIZE", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/constants.ts", + "lineNumber": 11 + }, + "signature": [ + "\"100MB\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-public.MAX_FILE_SIZE_BYTES", + "type": "number", + "label": "MAX_FILE_SIZE_BYTES", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/constants.ts", + "lineNumber": 12 + }, + "signature": [ + "104857600" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-public.MB", + "type": "number", + "label": "MB", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/constants.ts", + "lineNumber": 10 + }, + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-public.UI_SETTING_MAX_FILE_SIZE", + "type": "string", + "label": "UI_SETTING_MAX_FILE_SIZE", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/constants.ts", + "lineNumber": 8 + }, + "signature": [ + "\"fileUpload:maxFileSize\"" + ], + "initialIsOpen": false + } + ], + "objects": [], + "start": { + "id": "def-public.FileUploadPluginStart", + "type": "Type", + "label": "FileUploadPluginStart", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/public/plugin.ts", + "lineNumber": 21 + }, + "signature": [ + "FileUploadStartApi" + ], + "lifecycle": "start", + "initialIsOpen": true + } + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [ + { + "id": "def-common.AnalysisResult", + "type": "Interface", + "label": "AnalysisResult", + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.AnalysisResult.results", + "type": "Object", + "label": "results", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 21 + }, + "signature": [ + { + "pluginId": "fileUpload", + "scope": "common", + "docId": "kibFileUploadPluginApi", + "section": "def-common.FindFileStructureResponse", + "text": "FindFileStructureResponse" + } + ] + }, + { + "tags": [], + "id": "def-common.AnalysisResult.overrides", + "type": "CompoundType", + "label": "overrides", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 22 + }, + "signature": [ + { + "pluginId": "fileUpload", + "scope": "common", + "docId": "kibFileUploadPluginApi", + "section": "def-common.FormattedOverrides", + "text": "FormattedOverrides" + }, + " | undefined" + ] + } + ], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 20 + }, + "initialIsOpen": false + }, + { + "id": "def-common.Doc", + "type": "Interface", + "label": "Doc", + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.Doc.message", + "type": "string", + "label": "message", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 93 + } + } + ], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 92 + }, + "initialIsOpen": false + }, + { + "id": "def-common.FindFileStructureResponse", + "type": "Interface", + "label": "FindFileStructureResponse", + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.FindFileStructureResponse.charset", + "type": "string", + "label": "charset", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 26 + } + }, { "tags": [], - "id": "def-public.ImportResponse.success", + "id": "def-common.FindFileStructureResponse.has_header_row", "type": "boolean", - "label": "success", + "label": "has_header_row", "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 9 + "lineNumber": 27 } }, { "tags": [], - "id": "def-public.ImportResponse.id", - "type": "string", - "label": "id", + "id": "def-common.FindFileStructureResponse.has_byte_order_marker", + "type": "boolean", + "label": "has_byte_order_marker", "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 10 + "lineNumber": 28 } }, { "tags": [], - "id": "def-public.ImportResponse.index", + "id": "def-common.FindFileStructureResponse.format", "type": "string", - "label": "index", + "label": "format", "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 11 + "lineNumber": 29 + } + }, + { + "tags": [], + "id": "def-common.FindFileStructureResponse.field_stats", + "type": "Object", + "label": "field_stats", + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 30 }, "signature": [ - "string | undefined" + "{ [fieldName: string]: { count: number; cardinality: number; top_hits: { count: number; value: any; }[]; mean_value?: number | undefined; median_value?: number | undefined; max_value?: number | undefined; min_value?: number | undefined; earliest?: string | undefined; latest?: string | undefined; }; }" ] }, { "tags": [], - "id": "def-public.ImportResponse.pipelineId", + "id": "def-common.FindFileStructureResponse.sample_start", "type": "string", - "label": "pipelineId", + "label": "sample_start", "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 12 - }, - "signature": [ - "string | undefined" - ] + "lineNumber": 43 + } }, { "tags": [], - "id": "def-public.ImportResponse.docCount", + "id": "def-common.FindFileStructureResponse.num_messages_analyzed", "type": "number", - "label": "docCount", + "label": "num_messages_analyzed", "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 13 + "lineNumber": 44 } }, { "tags": [], - "id": "def-public.ImportResponse.failures", - "type": "Array", - "label": "failures", + "id": "def-common.FindFileStructureResponse.mappings", + "type": "Object", + "label": "mappings", "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 14 + "lineNumber": 45 }, "signature": [ + "{ properties: { [fieldName: string]: { type: ", { - "pluginId": "fileUpload", + "pluginId": "data", "scope": "common", - "docId": "kibFileUploadPluginApi", - "section": "def-common.ImportFailure", - "text": "ImportFailure" + "docId": "kibDataPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" }, - "[]" + ".STRING | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, + ".TEXT | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, + ".KEYWORD | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + }, + ".BOOLEAN | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.ES_FIELD_TYPES", + "text": "ES_FIELD_TYPES" + } ] }, { "tags": [], - "id": "def-public.ImportResponse.error", - "type": "Any", - "label": "error", + "id": "def-common.FindFileStructureResponse.quote", + "type": "string", + "label": "quote", "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 15 - }, - "signature": [ - "any" - ] + "lineNumber": 58 + } }, { "tags": [], - "id": "def-public.ImportResponse.ingestError", - "type": "CompoundType", - "label": "ingestError", + "id": "def-common.FindFileStructureResponse.delimiter", + "type": "string", + "label": "delimiter", "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 16 - }, - "signature": [ - "boolean | undefined" - ] - } - ], - "source": { - "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 8 - }, - "initialIsOpen": false - }, - { - "id": "def-public.ImportResults", - "type": "Interface", - "label": "ImportResults", - "description": [], - "tags": [], - "children": [ - { - "tags": [], - "id": "def-public.ImportResults.success", - "type": "boolean", - "label": "success", - "description": [], - "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 24 + "lineNumber": 59 } }, { "tags": [], - "id": "def-public.ImportResults.failures", - "type": "Array", - "label": "failures", + "id": "def-common.FindFileStructureResponse.need_client_timezone", + "type": "boolean", + "label": "need_client_timezone", "description": [], "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 25 - }, - "signature": [ - { - "pluginId": "fileUpload", - "scope": "common", - "docId": "kibFileUploadPluginApi", - "section": "def-common.ImportFailure", - "text": "ImportFailure" - }, - "[] | undefined" - ] + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 60 + } }, { "tags": [], - "id": "def-public.ImportResults.docCount", + "id": "def-common.FindFileStructureResponse.num_lines_analyzed", "type": "number", - "label": "docCount", - "description": [], - "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 26 - }, - "signature": [ - "number | undefined" - ] - }, - { - "tags": [], - "id": "def-public.ImportResults.error", - "type": "Any", - "label": "error", - "description": [], - "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 27 - }, - "signature": [ - "any" - ] - } - ], - "source": { - "path": "x-pack/plugins/file_upload/public/importer/types.ts", - "lineNumber": 23 - }, - "initialIsOpen": false - }, - { - "id": "def-public.IngestPipeline", - "type": "Interface", - "label": "IngestPipeline", - "description": [], - "tags": [], - "children": [ - { - "tags": [], - "id": "def-public.IngestPipeline.description", - "type": "string", - "label": "description", + "label": "num_lines_analyzed", "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 53 + "lineNumber": 61 } }, { "tags": [], - "id": "def-public.IngestPipeline.processors", + "id": "def-common.FindFileStructureResponse.column_names", "type": "Array", - "label": "processors", + "label": "column_names", "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 54 + "lineNumber": 62 }, "signature": [ - "any[]" + "string[] | undefined" ] - } - ], - "source": { - "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 52 - }, - "initialIsOpen": false - }, - { - "id": "def-public.IngestPipelineWrapper", - "type": "Interface", - "label": "IngestPipelineWrapper", - "description": [], - "tags": [], - "children": [ - { - "tags": [], - "id": "def-public.IngestPipelineWrapper.id", - "type": "string", - "label": "id", - "description": [], - "source": { - "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 48 - } }, { "tags": [], - "id": "def-public.IngestPipelineWrapper.pipeline", - "type": "Object", - "label": "pipeline", + "id": "def-common.FindFileStructureResponse.explanation", + "type": "Array", + "label": "explanation", "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 49 + "lineNumber": 63 }, "signature": [ - { - "pluginId": "fileUpload", - "scope": "common", - "docId": "kibFileUploadPluginApi", - "section": "def-common.IngestPipeline", - "text": "IngestPipeline" - } + "string[] | undefined" ] - } - ], - "source": { - "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 47 - }, - "initialIsOpen": false - }, - { - "id": "def-public.Mappings", - "type": "Interface", - "label": "Mappings", - "description": [], - "tags": [], - "children": [ + }, { "tags": [], - "id": "def-public.Mappings._meta", - "type": "Object", - "label": "_meta", + "id": "def-common.FindFileStructureResponse.grok_pattern", + "type": "string", + "label": "grok_pattern", "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 39 + "lineNumber": 64 }, "signature": [ - "{ created_by: string; } | undefined" + "string | undefined" ] }, { "tags": [], - "id": "def-public.Mappings.properties", - "type": "Object", - "label": "properties", + "id": "def-common.FindFileStructureResponse.multiline_start_pattern", + "type": "string", + "label": "multiline_start_pattern", "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 42 + "lineNumber": 65 }, "signature": [ - "{ [key: string]: any; }" + "string | undefined" ] - } - ], - "source": { - "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 38 - }, - "initialIsOpen": false - }, - { - "id": "def-public.Settings", - "type": "Interface", - "label": "Settings", - "description": [], - "tags": [], - "children": [ + }, { "tags": [], - "id": "def-public.Settings.pipeline", + "id": "def-common.FindFileStructureResponse.exclude_lines_pattern", "type": "string", - "label": "pipeline", + "label": "exclude_lines_pattern", "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 32 + "lineNumber": 66 }, "signature": [ "string | undefined" @@ -990,225 +1958,59 @@ }, { "tags": [], - "id": "def-public.Settings.index", - "type": "string", - "label": "index", + "id": "def-common.FindFileStructureResponse.java_timestamp_formats", + "type": "Array", + "label": "java_timestamp_formats", "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 33 - } + "lineNumber": 67 + }, + "signature": [ + "string[] | undefined" + ] }, { "tags": [], - "id": "def-public.Settings.body", + "id": "def-common.FindFileStructureResponse.joda_timestamp_formats", "type": "Array", - "label": "body", + "label": "joda_timestamp_formats", "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 34 + "lineNumber": 68 }, "signature": [ - "any[]" + "string[] | undefined" ] }, { - "id": "def-public.Settings.Unnamed", - "type": "Any", - "label": "Unnamed", "tags": [], + "id": "def-common.FindFileStructureResponse.timestamp_field", + "type": "string", + "label": "timestamp_field", "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 35 + "lineNumber": 69 }, "signature": [ - "any" + "string | undefined" ] - } - ], - "source": { - "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 31 - }, - "initialIsOpen": false - } - ], - "enums": [], - "misc": [ - { - "tags": [], - "id": "def-public.ABSOLUTE_MAX_FILE_SIZE_BYTES", - "type": "number", - "label": "ABSOLUTE_MAX_FILE_SIZE_BYTES", - "description": [], - "source": { - "path": "x-pack/plugins/file_upload/common/constants.ts", - "lineNumber": 14 - }, - "signature": [ - "1073741274" - ], - "initialIsOpen": false - }, - { - "tags": [], - "id": "def-public.FILE_SIZE_DISPLAY_FORMAT", - "type": "string", - "label": "FILE_SIZE_DISPLAY_FORMAT", - "description": [], - "source": { - "path": "x-pack/plugins/file_upload/common/constants.ts", - "lineNumber": 15 - }, - "signature": [ - "\"0,0.[0] b\"" - ], - "initialIsOpen": false - }, - { - "id": "def-public.ImportDoc", - "type": "Type", - "label": "ImportDoc", - "tags": [], - "description": [], - "source": { - "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 29 - }, - "signature": [ - "string | object | ", - { - "pluginId": "fileUpload", - "scope": "common", - "docId": "kibFileUploadPluginApi", - "section": "def-common.Doc", - "text": "Doc" - } - ], - "initialIsOpen": false - }, - { - "tags": [], - "id": "def-public.INDEX_META_DATA_CREATED_BY", - "type": "string", - "label": "INDEX_META_DATA_CREATED_BY", - "description": [], - "source": { - "path": "x-pack/plugins/file_upload/common/constants.ts", - "lineNumber": 19 - }, - "signature": [ - "\"ml-file-data-visualizer\"" - ], - "initialIsOpen": false - }, - { - "tags": [], - "id": "def-public.MAX_FILE_SIZE", - "type": "string", - "label": "MAX_FILE_SIZE", - "description": [], - "source": { - "path": "x-pack/plugins/file_upload/common/constants.ts", - "lineNumber": 11 - }, - "signature": [ - "\"100MB\"" - ], - "initialIsOpen": false - }, - { - "tags": [], - "id": "def-public.MAX_FILE_SIZE_BYTES", - "type": "number", - "label": "MAX_FILE_SIZE_BYTES", - "description": [], - "source": { - "path": "x-pack/plugins/file_upload/common/constants.ts", - "lineNumber": 12 - }, - "signature": [ - "104857600" - ], - "initialIsOpen": false - }, - { - "tags": [], - "id": "def-public.MB", - "type": "number", - "label": "MB", - "description": [], - "source": { - "path": "x-pack/plugins/file_upload/common/constants.ts", - "lineNumber": 10 - }, - "initialIsOpen": false - }, - { - "tags": [], - "id": "def-public.UI_SETTING_MAX_FILE_SIZE", - "type": "string", - "label": "UI_SETTING_MAX_FILE_SIZE", - "description": [], - "source": { - "path": "x-pack/plugins/file_upload/common/constants.ts", - "lineNumber": 8 - }, - "signature": [ - "\"fileUpload:maxFileSize\"" - ], - "initialIsOpen": false - } - ], - "objects": [], - "start": { - "id": "def-public.FileUploadPluginStart", - "type": "Type", - "label": "FileUploadPluginStart", - "tags": [], - "description": [], - "source": { - "path": "x-pack/plugins/file_upload/public/plugin.ts", - "lineNumber": 21 - }, - "signature": [ - "FileUploadStartApi" - ], - "lifecycle": "start", - "initialIsOpen": true - } - }, - "server": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [ - { - "id": "def-common.Doc", - "type": "Interface", - "label": "Doc", - "description": [], - "tags": [], - "children": [ + }, { "tags": [], - "id": "def-common.Doc.message", - "type": "string", - "label": "message", + "id": "def-common.FindFileStructureResponse.should_trim_fields", + "type": "CompoundType", + "label": "should_trim_fields", "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 26 - } + "lineNumber": 70 + }, + "signature": [ + "boolean | undefined" + ] } ], "source": { @@ -1232,7 +2034,7 @@ "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 20 + "lineNumber": 87 } }, { @@ -1243,7 +2045,7 @@ "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 21 + "lineNumber": 88 } }, { @@ -1254,7 +2056,7 @@ "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 22 + "lineNumber": 89 }, "signature": [ { @@ -1269,7 +2071,7 @@ ], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 19 + "lineNumber": 86 }, "initialIsOpen": false }, @@ -1288,7 +2090,7 @@ "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 9 + "lineNumber": 76 } }, { @@ -1299,7 +2101,7 @@ "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 10 + "lineNumber": 77 } }, { @@ -1310,7 +2112,7 @@ "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 11 + "lineNumber": 78 }, "signature": [ "string | undefined" @@ -1324,7 +2126,7 @@ "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 12 + "lineNumber": 79 }, "signature": [ "string | undefined" @@ -1338,7 +2140,7 @@ "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 13 + "lineNumber": 80 } }, { @@ -1349,7 +2151,7 @@ "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 14 + "lineNumber": 81 }, "signature": [ { @@ -1370,7 +2172,7 @@ "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 15 + "lineNumber": 82 }, "signature": [ "any" @@ -1384,7 +2186,7 @@ "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 16 + "lineNumber": 83 }, "signature": [ "boolean | undefined" @@ -1393,7 +2195,7 @@ ], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 8 + "lineNumber": 75 }, "initialIsOpen": false }, @@ -1412,7 +2214,7 @@ "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 53 + "lineNumber": 120 } }, { @@ -1423,7 +2225,7 @@ "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 54 + "lineNumber": 121 }, "signature": [ "any[]" @@ -1432,7 +2234,7 @@ ], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 52 + "lineNumber": 119 }, "initialIsOpen": false }, @@ -1451,7 +2253,7 @@ "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 48 + "lineNumber": 115 } }, { @@ -1462,7 +2264,7 @@ "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 49 + "lineNumber": 116 }, "signature": [ { @@ -1477,7 +2279,35 @@ ], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 47 + "lineNumber": 114 + }, + "initialIsOpen": false + }, + { + "id": "def-common.InputOverrides", + "type": "Interface", + "label": "InputOverrides", + "description": [], + "tags": [], + "children": [ + { + "id": "def-common.InputOverrides.Unnamed", + "type": "Any", + "label": "Unnamed", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 11 + }, + "signature": [ + "any" + ] + } + ], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 10 }, "initialIsOpen": false }, @@ -1496,7 +2326,7 @@ "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 39 + "lineNumber": 106 }, "signature": [ "{ created_by: string; } | undefined" @@ -1510,7 +2340,7 @@ "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 42 + "lineNumber": 109 }, "signature": [ "{ [key: string]: any; }" @@ -1519,7 +2349,7 @@ ], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 38 + "lineNumber": 105 }, "initialIsOpen": false }, @@ -1538,7 +2368,7 @@ "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 32 + "lineNumber": 99 }, "signature": [ "string | undefined" @@ -1552,7 +2382,7 @@ "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 33 + "lineNumber": 100 } }, { @@ -1563,7 +2393,7 @@ "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 34 + "lineNumber": 101 }, "signature": [ "any[]" @@ -1577,7 +2407,7 @@ "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 35 + "lineNumber": 102 }, "signature": [ "any" @@ -1586,7 +2416,7 @@ ], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 31 + "lineNumber": 98 }, "initialIsOpen": false } @@ -1623,6 +2453,21 @@ ], "initialIsOpen": false }, + { + "id": "def-common.FormattedOverrides", + "type": "Type", + "label": "FormattedOverrides", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 14 + }, + "signature": [ + "InputOverrides & { column_names: string[]; has_header_row: boolean; should_trim_fields: boolean; }" + ], + "initialIsOpen": false + }, { "id": "def-common.ImportDoc", "type": "Type", @@ -1631,7 +2476,7 @@ "description": [], "source": { "path": "x-pack/plugins/file_upload/common/types.ts", - "lineNumber": 29 + "lineNumber": 96 }, "signature": [ "string | object | ", @@ -1660,6 +2505,21 @@ ], "initialIsOpen": false }, + { + "id": "def-common.InputData", + "type": "Type", + "label": "InputData", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/file_upload/common/types.ts", + "lineNumber": 73 + }, + "signature": [ + "any[]" + ], + "initialIsOpen": false + }, { "tags": [], "id": "def-common.MAX_FILE_SIZE", diff --git a/api_docs/fleet.json b/api_docs/fleet.json index a4c8dce90a0627..ed51f88ee9d5d9 100644 --- a/api_docs/fleet.json +++ b/api_docs/fleet.json @@ -1699,7 +1699,7 @@ "children": [], "source": { "path": "x-pack/plugins/fleet/server/errors/index.ts", - "lineNumber": 34 + "lineNumber": 37 }, "initialIsOpen": false } @@ -1721,6 +1721,45 @@ "tags": [], "returnComment": [], "initialIsOpen": false + }, + { + "id": "def-server.relativeDownloadUrlFromArtifact", + "type": "Function", + "children": [ + { + "type": "Uncategorized", + "label": "{\n identifier,\n decodedSha256,\n}", + "isRequired": true, + "signature": [ + "T" + ], + "description": [], + "source": { + "path": "x-pack/plugins/fleet/server/services/artifacts/mappings.ts", + "lineNumber": 66 + } + } + ], + "signature": [ + ">({ identifier, decodedSha256, }: T) => string" + ], + "description": [], + "label": "relativeDownloadUrlFromArtifact", + "source": { + "path": "x-pack/plugins/fleet/server/services/artifacts/mappings.ts", + "lineNumber": 64 + }, + "tags": [], + "returnComment": [], + "initialIsOpen": false } ], "interfaces": [ @@ -1877,8 +1916,8 @@ "pluginId": "fleet", "scope": "server", "docId": "kibFleetPluginApi", - "section": "def-server.getAgent", - "text": "getAgent" + "section": "def-server.getAgentById", + "text": "getAgentById" } ] }, @@ -2049,8 +2088,8 @@ "pluginId": "fleet", "scope": "server", "docId": "kibFleetPluginApi", - "section": "def-server.listAgents", - "text": "listAgents" + "section": "def-server.getAgentsByKuery", + "text": "getAgentsByKuery" } ] } @@ -2061,6 +2100,318 @@ }, "initialIsOpen": false }, + { + "id": "def-server.Artifact", + "type": "Interface", + "label": "Artifact", + "signature": [ + { + "pluginId": "fleet", + "scope": "server", + "docId": "kibFleetPluginApi", + "section": "def-server.Artifact", + "text": "Artifact" + }, + " extends ", + "NewArtifact" + ], + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-server.Artifact.id", + "type": "string", + "label": "id", + "description": [], + "source": { + "path": "x-pack/plugins/fleet/server/services/artifacts/types.ts", + "lineNumber": 34 + } + }, + { + "tags": [], + "id": "def-server.Artifact.created", + "type": "string", + "label": "created", + "description": [], + "source": { + "path": "x-pack/plugins/fleet/server/services/artifacts/types.ts", + "lineNumber": 35 + } + } + ], + "source": { + "path": "x-pack/plugins/fleet/server/services/artifacts/types.ts", + "lineNumber": 33 + }, + "initialIsOpen": false + }, + { + "id": "def-server.ArtifactsClientInterface", + "type": "Interface", + "label": "ArtifactsClientInterface", + "description": [ + "\nThe interface exposed out of Fleet's Artifact service via the client class" + ], + "tags": [], + "children": [ + { + "id": "def-server.ArtifactsClientInterface.getArtifact", + "type": "Function", + "label": "getArtifact", + "signature": [ + "(id: string) => Promise<", + { + "pluginId": "fleet", + "scope": "server", + "docId": "kibFleetPluginApi", + "section": "def-server.Artifact", + "text": "Artifact" + }, + " | undefined>" + ], + "description": [], + "children": [ + { + "type": "string", + "label": "id", + "isRequired": true, + "signature": [ + "string" + ], + "description": [], + "source": { + "path": "x-pack/plugins/fleet/server/services/artifacts/types.ts", + "lineNumber": 79 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "x-pack/plugins/fleet/server/services/artifacts/types.ts", + "lineNumber": 79 + } + }, + { + "id": "def-server.ArtifactsClientInterface.createArtifact", + "type": "Function", + "label": "createArtifact", + "signature": [ + "(options: ", + { + "pluginId": "fleet", + "scope": "server", + "docId": "kibFleetPluginApi", + "section": "def-server.ArtifactsClientCreateOptions", + "text": "ArtifactsClientCreateOptions" + }, + ") => Promise<", + { + "pluginId": "fleet", + "scope": "server", + "docId": "kibFleetPluginApi", + "section": "def-server.Artifact", + "text": "Artifact" + }, + ">" + ], + "description": [], + "children": [ + { + "type": "CompoundType", + "label": "options", + "isRequired": true, + "signature": [ + { + "pluginId": "fleet", + "scope": "server", + "docId": "kibFleetPluginApi", + "section": "def-server.ArtifactsClientCreateOptions", + "text": "ArtifactsClientCreateOptions" + } + ], + "description": [], + "source": { + "path": "x-pack/plugins/fleet/server/services/artifacts/types.ts", + "lineNumber": 81 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "x-pack/plugins/fleet/server/services/artifacts/types.ts", + "lineNumber": 81 + } + }, + { + "id": "def-server.ArtifactsClientInterface.deleteArtifact", + "type": "Function", + "label": "deleteArtifact", + "signature": [ + "(id: string) => Promise" + ], + "description": [], + "children": [ + { + "type": "string", + "label": "id", + "isRequired": true, + "signature": [ + "string" + ], + "description": [], + "source": { + "path": "x-pack/plugins/fleet/server/services/artifacts/types.ts", + "lineNumber": 83 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "x-pack/plugins/fleet/server/services/artifacts/types.ts", + "lineNumber": 83 + } + }, + { + "id": "def-server.ArtifactsClientInterface.listArtifacts", + "type": "Function", + "label": "listArtifacts", + "signature": [ + "(options?: ", + { + "pluginId": "fleet", + "scope": "server", + "docId": "kibFleetPluginApi", + "section": "def-server.ListArtifactsProps", + "text": "ListArtifactsProps" + }, + " | undefined) => Promise<", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.ListResult", + "text": "ListResult" + }, + "<", + { + "pluginId": "fleet", + "scope": "server", + "docId": "kibFleetPluginApi", + "section": "def-server.Artifact", + "text": "Artifact" + }, + ">>" + ], + "description": [], + "children": [ + { + "type": "CompoundType", + "label": "options", + "isRequired": false, + "signature": [ + { + "pluginId": "fleet", + "scope": "server", + "docId": "kibFleetPluginApi", + "section": "def-server.ListArtifactsProps", + "text": "ListArtifactsProps" + }, + " | undefined" + ], + "description": [], + "source": { + "path": "x-pack/plugins/fleet/server/services/artifacts/types.ts", + "lineNumber": 85 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "x-pack/plugins/fleet/server/services/artifacts/types.ts", + "lineNumber": 85 + } + }, + { + "id": "def-server.ArtifactsClientInterface.encodeContent", + "type": "Function", + "label": "encodeContent", + "signature": [ + "(content: string) => Promise>" + ], + "description": [], + "children": [ + { + "type": "string", + "label": "content", + "isRequired": true, + "signature": [ + "string" + ], + "description": [], + "source": { + "path": "x-pack/plugins/fleet/server/services/artifacts/types.ts", + "lineNumber": 87 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "x-pack/plugins/fleet/server/services/artifacts/types.ts", + "lineNumber": 87 + } + }, + { + "id": "def-server.ArtifactsClientInterface.generateHash", + "type": "Function", + "label": "generateHash", + "signature": [ + "(content: string) => string" + ], + "description": [], + "children": [ + { + "type": "string", + "label": "content", + "isRequired": true, + "signature": [ + "string" + ], + "description": [], + "source": { + "path": "x-pack/plugins/fleet/server/services/artifacts/types.ts", + "lineNumber": 89 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "x-pack/plugins/fleet/server/services/artifacts/types.ts", + "lineNumber": 89 + } + } + ], + "source": { + "path": "x-pack/plugins/fleet/server/services/artifacts/types.ts", + "lineNumber": 78 + }, + "initialIsOpen": false + }, { "id": "def-server.ESIndexPatternService", "type": "Interface", @@ -2164,7 +2515,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 91 + "lineNumber": 95 }, "signature": [ { @@ -2184,7 +2535,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 92 + "lineNumber": 96 }, "signature": [ { @@ -2205,7 +2556,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 93 + "lineNumber": 97 }, "signature": [ { @@ -2226,7 +2577,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 94 + "lineNumber": 98 }, "signature": [ { @@ -2246,7 +2597,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 95 + "lineNumber": 99 }, "signature": [ { @@ -2267,7 +2618,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 96 + "lineNumber": 100 }, "signature": [ "Pick<", @@ -2284,7 +2635,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 90 + "lineNumber": 94 }, "initialIsOpen": false }, @@ -2384,7 +2735,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 134 + "lineNumber": 140 }, "signature": [ "[\"packagePolicyCreate\", (newPackagePolicy: ", @@ -2438,7 +2789,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/server/index.ts", - "lineNumber": 76 + "lineNumber": 78 }, "signature": [ "any" @@ -2486,7 +2837,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 119 + "lineNumber": 125 }, "signature": [ "void" @@ -2511,7 +2862,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 158 + "lineNumber": 164 }, "signature": [ { @@ -2531,7 +2882,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 159 + "lineNumber": 165 }, "signature": [ { @@ -2551,7 +2902,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 160 + "lineNumber": 166 }, "signature": [ { @@ -2573,7 +2924,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 164 + "lineNumber": 170 }, "signature": [ { @@ -2593,7 +2944,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 165 + "lineNumber": 171 }, "signature": [ { @@ -2615,7 +2966,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 170 + "lineNumber": 176 }, "signature": [ "(...args: ", @@ -2628,11 +2979,34 @@ }, ") => void" ] + }, + { + "tags": [], + "id": "def-server.FleetStartContract.createArtifactsClient", + "type": "Function", + "label": "createArtifactsClient", + "description": [ + "\nCreate a Fleet Artifact Client instance" + ], + "source": { + "path": "x-pack/plugins/fleet/server/plugin.ts", + "lineNumber": 182 + }, + "signature": [ + "(packageName: string) => ", + { + "pluginId": "fleet", + "scope": "server", + "docId": "kibFleetPluginApi", + "section": "def-server.FleetArtifactsClient", + "text": "FleetArtifactsClient" + } + ] } ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 157 + "lineNumber": 163 }, "lifecycle": "start", "initialIsOpen": true @@ -2900,7 +3274,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/index.ts", - "lineNumber": 38 + "lineNumber": 39 }, "signature": [ "(o: T) => [keyof T, T[keyof T]][]" @@ -3370,7 +3744,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 148 + "lineNumber": 152 } }, { @@ -3381,7 +3755,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 149 + "lineNumber": 153 }, "signature": [ { @@ -3402,7 +3776,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 150 + "lineNumber": 154 }, "signature": [ "string | undefined" @@ -3416,7 +3790,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 151 + "lineNumber": 155 }, "signature": [ "string | undefined" @@ -3430,7 +3804,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 152 + "lineNumber": 156 }, "signature": [ "string[]" @@ -3439,7 +3813,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 147 + "lineNumber": 151 }, "initialIsOpen": false }, @@ -3475,7 +3849,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 45 + "lineNumber": 49 }, "signature": [ { @@ -3495,7 +3869,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 46 + "lineNumber": 50 }, "signature": [ "any" @@ -3509,7 +3883,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 47 + "lineNumber": 51 }, "signature": [ "string | undefined" @@ -3523,7 +3897,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 48 + "lineNumber": 52 } }, { @@ -3534,7 +3908,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 49 + "lineNumber": 53 } }, { @@ -3545,7 +3919,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 50 + "lineNumber": 54 } }, { @@ -3556,7 +3930,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 51 + "lineNumber": 55 }, "signature": [ "any" @@ -3565,7 +3939,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 44 + "lineNumber": 48 }, "initialIsOpen": false }, @@ -3601,13 +3975,13 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 120 + "lineNumber": 124 } } ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 119 + "lineNumber": 123 }, "initialIsOpen": false }, @@ -3626,7 +4000,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 126 + "lineNumber": 130 }, "signature": [ "any" @@ -3635,7 +4009,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 125 + "lineNumber": 129 }, "initialIsOpen": false }, @@ -3800,7 +4174,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 55 + "lineNumber": 59 } }, { @@ -3811,7 +4185,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 56 + "lineNumber": 60 }, "signature": [ { @@ -3831,7 +4205,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 57 + "lineNumber": 61 }, "signature": [ "{ policy: ", @@ -3853,7 +4227,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 60 + "lineNumber": 64 } }, { @@ -3864,7 +4238,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 61 + "lineNumber": 65 } }, { @@ -3875,7 +4249,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 62 + "lineNumber": 66 } }, { @@ -3886,7 +4260,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 63 + "lineNumber": 67 }, "signature": [ "any" @@ -3895,7 +4269,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 54 + "lineNumber": 58 }, "initialIsOpen": false }, @@ -3924,7 +4298,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 156 + "lineNumber": 160 }, "signature": [ "string | undefined" @@ -3938,7 +4312,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 157 + "lineNumber": 161 }, "signature": [ "string[] | undefined" @@ -3947,7 +4321,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 155 + "lineNumber": 159 }, "initialIsOpen": false }, @@ -4046,30 +4420,8 @@ "type": "Interface", "label": "BaseSettings", "description": [], - "tags": [], - "children": [ - { - "tags": [], - "id": "def-common.BaseSettings.agent_auto_upgrade", - "type": "boolean", - "label": "agent_auto_upgrade", - "description": [], - "source": { - "path": "x-pack/plugins/fleet/common/types/models/settings.ts", - "lineNumber": 11 - } - }, - { - "tags": [], - "id": "def-common.BaseSettings.package_auto_upgrade", - "type": "boolean", - "label": "package_auto_upgrade", - "description": [], - "source": { - "path": "x-pack/plugins/fleet/common/types/models/settings.ts", - "lineNumber": 12 - } - }, + "tags": [], + "children": [ { "tags": [], "id": "def-common.BaseSettings.kibana_urls", @@ -4078,7 +4430,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/settings.ts", - "lineNumber": 13 + "lineNumber": 11 }, "signature": [ "string[]" @@ -4092,7 +4444,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/settings.ts", - "lineNumber": 14 + "lineNumber": 12 }, "signature": [ "string | undefined" @@ -4106,7 +4458,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/settings.ts", - "lineNumber": 15 + "lineNumber": 13 }, "signature": [ "boolean | undefined" @@ -4134,59 +4486,44 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/rest_spec/epm.ts", - "lineNumber": 86 + "lineNumber": 91 } }, { "tags": [], - "id": "def-common.BulkInstallPackageInfo.newVersion", + "id": "def-common.BulkInstallPackageInfo.version", "type": "string", - "label": "newVersion", + "label": "version", "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/rest_spec/epm.ts", - "lineNumber": 87 + "lineNumber": 92 } }, { "tags": [], - "id": "def-common.BulkInstallPackageInfo.oldVersion", - "type": "CompoundType", - "label": "oldVersion", - "description": [], - "source": { - "path": "x-pack/plugins/fleet/common/types/rest_spec/epm.ts", - "lineNumber": 89 - }, - "signature": [ - "string | null" - ] - }, - { - "tags": [], - "id": "def-common.BulkInstallPackageInfo.assets", - "type": "Array", - "label": "assets", + "id": "def-common.BulkInstallPackageInfo.result", + "type": "Object", + "label": "result", "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/rest_spec/epm.ts", - "lineNumber": 90 + "lineNumber": 93 }, "signature": [ { "pluginId": "fleet", "scope": "common", "docId": "kibFleetPluginApi", - "section": "def-common.AssetReference", - "text": "AssetReference" - }, - "[]" + "section": "def-common.InstallResult", + "text": "InstallResult" + } ] } ], "source": { "path": "x-pack/plugins/fleet/common/types/rest_spec/epm.ts", - "lineNumber": 85 + "lineNumber": 90 }, "initialIsOpen": false }, @@ -4205,7 +4542,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/rest_spec/epm.ts", - "lineNumber": 98 + "lineNumber": 101 }, "signature": [ "{ packages: string[]; }" @@ -4214,7 +4551,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/rest_spec/epm.ts", - "lineNumber": 97 + "lineNumber": 100 }, "initialIsOpen": false }, @@ -4233,7 +4570,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/rest_spec/epm.ts", - "lineNumber": 94 + "lineNumber": 97 }, "signature": [ "(", @@ -4258,7 +4595,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/rest_spec/epm.ts", - "lineNumber": 93 + "lineNumber": 96 }, "initialIsOpen": false }, @@ -4883,7 +5220,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/rest_spec/epm.ts", - "lineNumber": 108 + "lineNumber": 111 }, "signature": [ "{ pkgkey: string; }" @@ -4892,7 +5229,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/rest_spec/epm.ts", - "lineNumber": 107 + "lineNumber": 110 }, "initialIsOpen": false }, @@ -4911,7 +5248,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/rest_spec/epm.ts", - "lineNumber": 114 + "lineNumber": 117 }, "signature": [ { @@ -4927,7 +5264,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/rest_spec/epm.ts", - "lineNumber": 113 + "lineNumber": 116 }, "initialIsOpen": false }, @@ -5155,7 +5492,7 @@ "lineNumber": 15 }, "signature": [ - "{ enabled: boolean; tlsCheckDisabled: boolean; pollingRequestTimeout: number; maxConcurrentConnections: number; kibana: { host?: string | string[] | undefined; ca_sha256?: string | undefined; }; elasticsearch: { host?: string | undefined; ca_sha256?: string | undefined; }; agentPolicyRolloutRateLimitIntervalMs: number; agentPolicyRolloutRateLimitRequestPerInterval: number; }" + "{ enabled: boolean; fleetServerEnabled: boolean; tlsCheckDisabled: boolean; pollingRequestTimeout: number; maxConcurrentConnections: number; kibana: { host?: string | string[] | undefined; ca_sha256?: string | undefined; }; elasticsearch: { host?: string | undefined; ca_sha256?: string | undefined; }; agentPolicyRolloutRateLimitIntervalMs: number; agentPolicyRolloutRateLimitRequestPerInterval: number; }" ] } ], @@ -5184,7 +5521,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 169 + "lineNumber": 173 }, "signature": [ "number | undefined" @@ -5200,7 +5537,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 173 + "lineNumber": 177 }, "signature": [ "string | undefined" @@ -5216,7 +5553,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 177 + "lineNumber": 181 }, "signature": [ { @@ -5238,7 +5575,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 181 + "lineNumber": 185 } }, { @@ -5251,7 +5588,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 185 + "lineNumber": 189 } }, { @@ -5264,7 +5601,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 189 + "lineNumber": 193 }, "signature": [ "string | undefined" @@ -5280,7 +5617,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 193 + "lineNumber": 197 }, "signature": [ "string | undefined" @@ -5296,7 +5633,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 197 + "lineNumber": 201 }, "signature": [ "string | null | undefined" @@ -5312,7 +5649,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 201 + "lineNumber": 205 }, "signature": [ "string | null | undefined" @@ -5328,7 +5665,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 205 + "lineNumber": 209 }, "signature": [ "string | undefined" @@ -5342,7 +5679,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 206 + "lineNumber": 210 }, "signature": [ { @@ -5365,7 +5702,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 210 + "lineNumber": 214 }, "signature": [ { @@ -5387,7 +5724,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 214 + "lineNumber": 218 }, "signature": [ { @@ -5409,7 +5746,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 218 + "lineNumber": 222 }, "signature": [ "string | undefined" @@ -5425,7 +5762,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 222 + "lineNumber": 226 }, "signature": [ "number | null | undefined" @@ -5441,7 +5778,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 226 + "lineNumber": 230 }, "signature": [ "number | undefined" @@ -5457,7 +5794,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 230 + "lineNumber": 234 }, "signature": [ "string | undefined" @@ -5473,7 +5810,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 234 + "lineNumber": 238 }, "signature": [ "string | undefined" @@ -5489,7 +5826,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 238 + "lineNumber": 242 }, "signature": [ "\"online\" | \"error\" | \"updating\" | \"degraded\" | undefined" @@ -5505,7 +5842,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 242 + "lineNumber": 246 }, "signature": [ "string | undefined" @@ -5521,7 +5858,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 246 + "lineNumber": 250 }, "signature": [ "string | undefined" @@ -5537,7 +5874,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 250 + "lineNumber": 254 }, "signature": [ "string | undefined" @@ -5553,7 +5890,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 254 + "lineNumber": 258 }, "signature": [ "string[] | undefined" @@ -5569,7 +5906,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 258 + "lineNumber": 262 }, "signature": [ "number | undefined" @@ -5578,7 +5915,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 165 + "lineNumber": 169 }, "initialIsOpen": false }, @@ -5601,7 +5938,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 282 + "lineNumber": 286 }, "signature": [ "string | undefined" @@ -5617,7 +5954,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 286 + "lineNumber": 290 }, "signature": [ "number | undefined" @@ -5633,7 +5970,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 290 + "lineNumber": 294 }, "signature": [ "string | undefined" @@ -5649,7 +5986,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 294 + "lineNumber": 298 }, "signature": [ "string | undefined" @@ -5665,7 +6002,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 298 + "lineNumber": 302 }, "signature": [ "string | undefined" @@ -5681,7 +6018,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 302 + "lineNumber": 306 }, "signature": [ "string | undefined" @@ -5697,7 +6034,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 306 + "lineNumber": 310 }, "signature": [ "string | undefined" @@ -5713,7 +6050,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 310 + "lineNumber": 314 }, "signature": [ "string[] | undefined" @@ -5729,7 +6066,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 314 + "lineNumber": 318 }, "signature": [ "{ [k: string]: unknown; } | undefined" @@ -5743,7 +6080,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 317 + "lineNumber": 321 }, "signature": [ "any" @@ -5752,7 +6089,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 278 + "lineNumber": 282 }, "initialIsOpen": false }, @@ -5775,7 +6112,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 267 + "lineNumber": 271 } }, { @@ -5788,7 +6125,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 271 + "lineNumber": 275 } }, { @@ -5799,7 +6136,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 272 + "lineNumber": 276 }, "signature": [ "any" @@ -5808,7 +6145,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 263 + "lineNumber": 267 }, "initialIsOpen": false }, @@ -8257,6 +8594,55 @@ }, "initialIsOpen": false }, + { + "id": "def-common.InstallResult", + "type": "Interface", + "label": "InstallResult", + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.InstallResult.assets", + "type": "Array", + "label": "assets", + "description": [], + "source": { + "path": "x-pack/plugins/fleet/common/types/rest_spec/epm.ts", + "lineNumber": 86 + }, + "signature": [ + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.AssetReference", + "text": "AssetReference" + }, + "[]" + ] + }, + { + "tags": [], + "id": "def-common.InstallResult.status", + "type": "CompoundType", + "label": "status", + "description": [], + "source": { + "path": "x-pack/plugins/fleet/common/types/rest_spec/epm.ts", + "lineNumber": 87 + }, + "signature": [ + "\"installed\" | \"already_installed\"" + ] + } + ], + "source": { + "path": "x-pack/plugins/fleet/common/types/rest_spec/epm.ts", + "lineNumber": 85 + }, + "initialIsOpen": false + }, { "id": "def-common.InstallScriptRequest", "type": "Interface", @@ -8472,13 +8858,13 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/rest_spec/epm.ts", - "lineNumber": 104 + "lineNumber": 107 } } ], "source": { "path": "x-pack/plugins/fleet/common/types/rest_spec/epm.ts", - "lineNumber": 103 + "lineNumber": 106 }, "initialIsOpen": false }, @@ -8497,7 +8883,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 39 + "lineNumber": 43 }, "signature": [ { @@ -8517,7 +8903,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 40 + "lineNumber": 44 }, "signature": [ "any" @@ -8531,7 +8917,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 41 + "lineNumber": 45 }, "signature": [ "string | undefined" @@ -8540,7 +8926,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 38 + "lineNumber": 42 }, "initialIsOpen": false }, @@ -8559,7 +8945,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 94 + "lineNumber": 98 }, "signature": [ "\"STATE\" | \"ERROR\" | \"ACTION_RESULT\" | \"ACTION\"" @@ -8573,7 +8959,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 95 + "lineNumber": 99 }, "signature": [ "\"RUNNING\" | \"STARTING\" | \"IN_PROGRESS\" | \"CONFIG\" | \"FAILED\" | \"STOPPING\" | \"STOPPED\" | \"DEGRADED\" | \"UPDATING\" | \"DATA_DUMP\" | \"ACKNOWLEDGED\" | \"UNKNOWN\"" @@ -8587,7 +8973,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 110 + "lineNumber": 114 } }, { @@ -8598,7 +8984,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 111 + "lineNumber": 115 } }, { @@ -8609,7 +8995,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 112 + "lineNumber": 116 }, "signature": [ "any" @@ -8623,7 +9009,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 113 + "lineNumber": 117 } }, { @@ -8634,7 +9020,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 114 + "lineNumber": 118 }, "signature": [ "string | undefined" @@ -8648,7 +9034,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 115 + "lineNumber": 119 }, "signature": [ "string | undefined" @@ -8662,7 +9048,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 116 + "lineNumber": 120 }, "signature": [ "string | undefined" @@ -8671,7 +9057,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 93 + "lineNumber": 97 }, "initialIsOpen": false }, @@ -10803,7 +11189,7 @@ "section": "def-common.Settings", "text": "Settings" }, - ", \"agent_auto_upgrade\" | \"package_auto_upgrade\" | \"kibana_urls\" | \"kibana_ca_sha256\" | \"has_seen_add_data_notice\">>" + ", \"kibana_urls\" | \"kibana_ca_sha256\" | \"has_seen_add_data_notice\">>" ] } ], @@ -11616,13 +12002,13 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/settings.ts", - "lineNumber": 19 + "lineNumber": 17 } } ], "source": { "path": "x-pack/plugins/fleet/common/types/models/settings.ts", - "lineNumber": 18 + "lineNumber": 16 }, "initialIsOpen": false }, @@ -11654,7 +12040,7 @@ "children": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/settings.ts", - "lineNumber": 22 + "lineNumber": 20 }, "initialIsOpen": false }, @@ -11930,7 +12316,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/epm.ts", - "lineNumber": 277 + "lineNumber": 278 }, "initialIsOpen": false } @@ -12211,7 +12597,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 84 + "lineNumber": 88 }, "signature": [ "CommonAgentActionSOAttributes & { agent_id: string; }" @@ -12226,7 +12612,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 30 + "lineNumber": 34 }, "signature": [ "\"POLICY_CHANGE\" | \"UNENROLL\" | \"UPGRADE\" | \"SETTINGS\" | \"INTERNAL_POLICY_REASSIGN\"" @@ -12256,7 +12642,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 123 + "lineNumber": 127 }, "signature": [ "NewAgentEvent" @@ -12271,7 +12657,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 87 + "lineNumber": 91 }, "signature": [ "CommonAgentActionSOAttributes & { policy_id: string; policy_revision: number; }" @@ -12286,7 +12672,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 68 + "lineNumber": 72 }, "signature": [ "Pick & { type: 'CONFIG_CHANGE'; data: { config: FullAgentPolicy;}; }" @@ -12346,7 +12732,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 17 + "lineNumber": 21 }, "signature": [ "\"warning\" | \"offline\" | \"online\" | \"error\" | \"inactive\" | \"enrolling\" | \"unenrolling\" | \"updating\" | \"degraded\"" @@ -12361,7 +12747,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 12 + "lineNumber": 16 }, "signature": [ "\"PERMANENT\" | \"EPHEMERAL\" | \"TEMPORARY\"" @@ -12534,7 +12920,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 91 + "lineNumber": 95 }, "signature": [ { @@ -12804,6 +13190,21 @@ ], "initialIsOpen": false }, + { + "tags": [], + "id": "def-common.FLEET_SERVER_ARTIFACTS_INDEX", + "type": "string", + "label": "FLEET_SERVER_ARTIFACTS_INDEX", + "description": [], + "source": { + "path": "x-pack/plugins/fleet/common/constants/index.ts", + "lineNumber": 27 + }, + "signature": [ + "\".fleet-artifacts\"" + ], + "initialIsOpen": false + }, { "tags": [], "id": "def-common.FLEET_SERVER_INDICES", @@ -12812,7 +13213,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/constants/index.ts", - "lineNumber": 27 + "lineNumber": 29 }, "signature": [ "string[]" @@ -12842,7 +13243,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/constants/epm.ts", - "lineNumber": 13 + "lineNumber": 12 }, "signature": [ "\"fleet_server\"" @@ -12879,21 +13280,6 @@ ], "initialIsOpen": false }, - { - "tags": [], - "id": "def-common.INDEX_PATTERN_SAVED_OBJECT_TYPE", - "type": "string", - "label": "INDEX_PATTERN_SAVED_OBJECT_TYPE", - "description": [], - "source": { - "path": "x-pack/plugins/fleet/common/constants/epm.ts", - "lineNumber": 10 - }, - "signature": [ - "\"index-pattern\"" - ], - "initialIsOpen": false - }, { "tags": [], "id": "def-common.INSTALL_SCRIPT_API_ROUTES", @@ -13093,7 +13479,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/constants/epm.ts", - "lineNumber": 11 + "lineNumber": 10 }, "signature": [ "60000" @@ -13512,7 +13898,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/epm.ts", - "lineNumber": 289 + "lineNumber": 277 }, "signature": [ "\"string\" | \"text\" | \"password\" | \"integer\" | \"bool\" | \"yaml\"" @@ -13643,7 +14029,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/types/models/agent.ts", - "lineNumber": 28 + "lineNumber": 32 }, "signature": [ "\"offline\" | \"inactive\" | \"updating\" | \"healthy\" | \"unhealthy\"" @@ -13720,7 +14106,7 @@ ], "source": { "path": "x-pack/plugins/fleet/common/types/index.ts", - "lineNumber": 43 + "lineNumber": 44 }, "signature": [ "T[keyof T]" @@ -14076,7 +14462,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/constants/epm.ts", - "lineNumber": 24 + "lineNumber": 23 }, "signature": [ "{ readonly Input: \"input\"; }" @@ -14784,7 +15170,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/constants/epm.ts", - "lineNumber": 28 + "lineNumber": 27 }, "signature": [ "{ readonly Logs: \"logs\"; readonly Metrics: \"metrics\"; }" @@ -15114,7 +15500,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/constants/epm.ts", - "lineNumber": 22 + "lineNumber": 21 }, "signature": [ "{ readonly System: \"system\"; readonly Endpoint: \"endpoint\"; readonly ElasticAgent: \"elastic_agent\"; }" @@ -15691,7 +16077,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/constants/epm.ts", - "lineNumber": 33 + "lineNumber": 32 }, "signature": [ "{ readonly Installed: \"installed\"; readonly NotInstalled: \"not_installed\"; }" @@ -16049,7 +16435,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/common/constants/epm.ts", - "lineNumber": 15 + "lineNumber": 14 }, "signature": [ "{ readonly System: \"system\"; readonly Endpoint: \"endpoint\"; readonly ElasticAgent: \"elastic_agent\"; }" diff --git a/api_docs/global_search.json b/api_docs/global_search.json index 1743ce6e588b17..985abf3417935a 100644 --- a/api_docs/global_search.json +++ b/api_docs/global_search.json @@ -527,7 +527,7 @@ "lineNumber": 72 }, "signature": [ - "Pick & { url: string; }" + "Pick & { url: string; }" ], "initialIsOpen": false } @@ -1242,7 +1242,7 @@ "lineNumber": 72 }, "signature": [ - "Pick & { url: string; }" + "Pick & { url: string; }" ], "initialIsOpen": false } diff --git a/api_docs/kibana_react.json b/api_docs/kibana_react.json index 7541987ba42157..79ea4b3f66132e 100644 --- a/api_docs/kibana_react.json +++ b/api_docs/kibana_react.json @@ -2042,7 +2042,7 @@ }, " extends Pick<", "EuiTokenProps", - ", \"children\" | \"onClick\" | \"onChange\" | \"color\" | \"id\" | \"title\" | \"size\" | \"placeholder\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDown\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"fill\" | \"shape\">" + ", \"children\" | \"onClick\" | \"onChange\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"size\" | \"placeholder\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"fill\" | \"shape\">" ], "description": [], "tags": [], diff --git a/api_docs/lens.json b/api_docs/lens.json index 235f2021e98235..e586016c22fc3f 100644 --- a/api_docs/lens.json +++ b/api_docs/lens.json @@ -288,7 +288,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/column_types.ts", - "lineNumber": 44 + "lineNumber": 46 }, "signature": [ "\"range\" | \"filters\" | \"count\" | \"max\" | \"min\" | \"date_histogram\" | \"sum\" | \"terms\" | \"avg\" | \"median\" | \"cumulative_sum\" | \"derivative\" | \"moving_average\" | \"counter_rate\" | \"cardinality\" | \"percentile\" | \"last_value\" | undefined" @@ -302,7 +302,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/column_types.ts", - "lineNumber": 45 + "lineNumber": 47 }, "signature": [ "string | undefined" @@ -311,7 +311,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/column_types.ts", - "lineNumber": 43 + "lineNumber": 45 }, "initialIsOpen": false }, @@ -1318,7 +1318,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx", - "lineNumber": 125 + "lineNumber": 127 }, "signature": [ "BaseIndexPatternColumn & { params?: { format?: { id: string; params?: { decimals: number; } | undefined; } | undefined; } | undefined; } & FieldBasedIndexPatternColumn & { operationType: \"avg\"; }" @@ -1475,7 +1475,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx", - "lineNumber": 127 + "lineNumber": 129 }, "signature": [ "BaseIndexPatternColumn & { params?: { format?: { id: string; params?: { decimals: number; } | undefined; } | undefined; } | undefined; } & FieldBasedIndexPatternColumn & { operationType: \"max\"; }" @@ -1490,7 +1490,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx", - "lineNumber": 128 + "lineNumber": 130 }, "signature": [ "BaseIndexPatternColumn & { params?: { format?: { id: string; params?: { decimals: number; } | undefined; } | undefined; } | undefined; } & FieldBasedIndexPatternColumn & { operationType: \"median\"; }" @@ -1505,7 +1505,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx", - "lineNumber": 126 + "lineNumber": 128 }, "signature": [ "BaseIndexPatternColumn & { params?: { format?: { id: string; params?: { decimals: number; } | undefined; } | undefined; } | undefined; } & FieldBasedIndexPatternColumn & { operationType: \"min\"; }" @@ -1538,7 +1538,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/index.ts", - "lineNumber": 405 + "lineNumber": 406 }, "signature": [ "\"range\" | \"filters\" | \"count\" | \"max\" | \"min\" | \"date_histogram\" | \"sum\" | \"terms\" | \"avg\" | \"median\" | \"cumulative_sum\" | \"derivative\" | \"moving_average\" | \"counter_rate\" | \"cardinality\" | \"percentile\" | \"last_value\"" @@ -1598,7 +1598,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx", - "lineNumber": 124 + "lineNumber": 126 }, "signature": [ "BaseIndexPatternColumn & { params?: { format?: { id: string; params?: { decimals: number; } | undefined; } | undefined; } | undefined; } & FieldBasedIndexPatternColumn & { operationType: \"sum\"; }" @@ -1618,7 +1618,7 @@ "lineNumber": 38 }, "signature": [ - "Pick & { attributes: LensAttributes<'lnsXY', XYState> | LensAttributes<'lnsPie', PieVisualizationState> | LensAttributes<'lnsDatatable', DatatableVisualizationState> | LensAttributes<'lnsMetric', MetricState>; }" + "Pick & { attributes: LensAttributes<'lnsXY', XYState> | LensAttributes<'lnsPie', PieVisualizationState> | LensAttributes<'lnsDatatable', DatatableVisualizationState> | LensAttributes<'lnsMetric', MetricState>; }" ], "initialIsOpen": false }, diff --git a/api_docs/lists.json b/api_docs/lists.json index 3e6a22c538504c..fe06ebe62ce232 100644 --- a/api_docs/lists.json +++ b/api_docs/lists.json @@ -2296,7 +2296,7 @@ "children": [ { "type": "Object", - "label": "{ spaceId, user, config, callCluster }", + "label": "{ spaceId, user, config, esClient }", "isRequired": true, "signature": [ { diff --git a/api_docs/management.json b/api_docs/management.json index 5441f665c7784c..fb3c2ad2c33cf7 100644 --- a/api_docs/management.json +++ b/api_docs/management.json @@ -175,7 +175,7 @@ "section": "def-public.CreateManagementItemArgs", "text": "CreateManagementItemArgs" }, - ", \"title\" | \"order\" | \"euiIconType\" | \"icon\" | \"tip\"> & Pick<{ id: string; }, \"id\"> & Pick<{ id: string; }, never>, \"id\" | \"title\" | \"order\" | \"euiIconType\" | \"icon\" | \"tip\">" + ", \"title\" | \"order\" | \"euiIconType\" | \"icon\" | \"tip\"> & Pick<{ id: string; }, \"id\"> & Pick<{ id: string; }, never>, \"title\" | \"id\" | \"order\" | \"euiIconType\" | \"icon\" | \"tip\">" ], "description": [], "source": { @@ -204,7 +204,7 @@ "section": "def-public.RegisterManagementAppArgs", "text": "RegisterManagementAppArgs" }, - ", \"id\" | \"title\" | \"order\" | \"meta\" | \"mount\" | \"euiIconType\" | \"icon\" | \"tip\">) => ", + ", \"title\" | \"id\" | \"order\" | \"meta\" | \"mount\" | \"euiIconType\" | \"icon\" | \"tip\">) => ", { "pluginId": "management", "scope": "public", @@ -228,7 +228,7 @@ "section": "def-public.RegisterManagementAppArgs", "text": "RegisterManagementAppArgs" }, - ", \"id\" | \"title\" | \"order\" | \"meta\" | \"mount\" | \"euiIconType\" | \"icon\" | \"tip\">" + ", \"title\" | \"id\" | \"order\" | \"meta\" | \"mount\" | \"euiIconType\" | \"icon\" | \"tip\">" ], "description": [], "source": { diff --git a/api_docs/maps.json b/api_docs/maps.json index 6c5c7110bb1e07..7d25efab1f6f59 100644 --- a/api_docs/maps.json +++ b/api_docs/maps.json @@ -16,7 +16,7 @@ "type": "Function", "label": "addFilters", "signature": [ - "(filter: object) => void" + "(filter: object, actionId: string) => void" ], "description": [], "children": [ @@ -32,6 +32,19 @@ "path": "x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts", "lineNumber": 32 } + }, + { + "type": "string", + "label": "actionId", + "isRequired": true, + "signature": [ + "string" + ], + "description": [], + "source": { + "path": "x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts", + "lineNumber": 32 + } } ], "tags": [], @@ -409,10 +422,1558 @@ }, "common": { "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] + "functions": [ + { + "id": "def-common.getEditPath", + "type": "Function", + "label": "getEditPath", + "signature": [ + "(id: string) => string" + ], + "description": [], + "children": [ + { + "type": "string", + "label": "id", + "isRequired": true, + "signature": [ + "string" + ], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 64 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 64 + }, + "initialIsOpen": false + }, + { + "id": "def-common.getExistingMapPath", + "type": "Function", + "label": "getExistingMapPath", + "signature": [ + "(id: string) => string" + ], + "description": [], + "children": [ + { + "type": "string", + "label": "id", + "isRequired": true, + "signature": [ + "string" + ], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 61 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 61 + }, + "initialIsOpen": false + }, + { + "id": "def-common.getNewMapPath", + "type": "Function", + "label": "getNewMapPath", + "signature": [ + "() => string" + ], + "description": [], + "children": [], + "tags": [], + "returnComment": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 58 + }, + "initialIsOpen": false + } + ], + "interfaces": [ + { + "id": "def-common.BodySettings", + "type": "Interface", + "label": "BodySettings", + "description": [], + "tags": [], + "children": [ + { + "id": "def-common.BodySettings.Unnamed", + "type": "Any", + "label": "Unnamed", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/types.ts", + "lineNumber": 23 + }, + "signature": [ + "any" + ] + } + ], + "source": { + "path": "x-pack/plugins/maps/common/types.ts", + "lineNumber": 22 + }, + "initialIsOpen": false + }, + { + "id": "def-common.CreateDocSourceResp", + "type": "Interface", + "label": "CreateDocSourceResp", + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.CreateDocSourceResp.success", + "type": "boolean", + "label": "success", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/types.ts", + "lineNumber": 9 + } + }, + { + "tags": [], + "id": "def-common.CreateDocSourceResp.error", + "type": "Object", + "label": "error", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/types.ts", + "lineNumber": 10 + }, + "signature": [ + "Error | undefined" + ] + } + ], + "source": { + "path": "x-pack/plugins/maps/common/types.ts", + "lineNumber": 8 + }, + "initialIsOpen": false + }, + { + "id": "def-common.IndexSourceMappings", + "type": "Interface", + "label": "IndexSourceMappings", + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.IndexSourceMappings._meta", + "type": "Object", + "label": "_meta", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/types.ts", + "lineNumber": 14 + }, + "signature": [ + "{ created_by: string; } | undefined" + ] + }, + { + "tags": [], + "id": "def-common.IndexSourceMappings.properties", + "type": "Object", + "label": "properties", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/types.ts", + "lineNumber": 17 + }, + "signature": [ + "{ [key: string]: any; }" + ] + } + ], + "source": { + "path": "x-pack/plugins/maps/common/types.ts", + "lineNumber": 13 + }, + "initialIsOpen": false + } + ], + "enums": [ + { + "id": "def-common.AGG_TYPE", + "type": "Enum", + "label": "AGG_TYPE", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 161 + }, + "initialIsOpen": false + }, + { + "id": "def-common.COLOR_MAP_TYPE", + "type": "Enum", + "label": "COLOR_MAP_TYPE", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 209 + }, + "initialIsOpen": false + }, + { + "id": "def-common.DATA_MAPPING_FUNCTION", + "type": "Enum", + "label": "DATA_MAPPING_FUNCTION", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 290 + }, + "initialIsOpen": false + }, + { + "id": "def-common.DRAW_TYPE", + "type": "Enum", + "label": "DRAW_TYPE", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 154 + }, + "initialIsOpen": false + }, + { + "id": "def-common.ES_GEO_FIELD_TYPE", + "type": "Enum", + "label": "ES_GEO_FIELD_TYPE", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 121 + }, + "initialIsOpen": false + }, + { + "id": "def-common.ES_SPATIAL_RELATIONS", + "type": "Enum", + "label": "ES_SPATIAL_RELATIONS", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 129 + }, + "initialIsOpen": false + }, + { + "id": "def-common.FIELD_ORIGIN", + "type": "Enum", + "label": "FIELD_ORIGIN", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 94 + }, + "initialIsOpen": false + }, + { + "id": "def-common.FORMAT_TYPE", + "type": "Enum", + "label": "FORMAT_TYPE", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 253 + }, + "initialIsOpen": false + }, + { + "id": "def-common.GEO_JSON_TYPE", + "type": "Enum", + "label": "GEO_JSON_TYPE", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 135 + }, + "initialIsOpen": false + }, + { + "id": "def-common.GRID_RESOLUTION", + "type": "Enum", + "label": "GRID_RESOLUTION", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 178 + }, + "initialIsOpen": false + }, + { + "id": "def-common.INITIAL_LOCATION", + "type": "Enum", + "label": "INITIAL_LOCATION", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 265 + }, + "initialIsOpen": false + }, + { + "id": "def-common.LABEL_BORDER_SIZES", + "type": "Enum", + "label": "LABEL_BORDER_SIZES", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 222 + }, + "initialIsOpen": false + }, + { + "id": "def-common.LAYER_STYLE_TYPE", + "type": "Enum", + "label": "LAYER_STYLE_TYPE", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 203 + }, + "initialIsOpen": false + }, + { + "id": "def-common.LAYER_TYPE", + "type": "Enum", + "label": "LAYER_TYPE", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 68 + }, + "initialIsOpen": false + }, + { + "id": "def-common.LAYER_WIZARD_CATEGORY", + "type": "Enum", + "label": "LAYER_WIZARD_CATEGORY", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 272 + }, + "initialIsOpen": false + }, + { + "id": "def-common.MB_LOOKUP_FUNCTION", + "type": "Enum", + "label": "MB_LOOKUP_FUNCTION", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 285 + }, + "initialIsOpen": false + }, + { + "id": "def-common.MVT_FIELD_TYPE", + "type": "Enum", + "label": "MVT_FIELD_TYPE", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 258 + }, + "initialIsOpen": false + }, + { + "id": "def-common.RENDER_AS", + "type": "Enum", + "label": "RENDER_AS", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 172 + }, + "initialIsOpen": false + }, + { + "id": "def-common.SCALING_TYPES", + "type": "Enum", + "label": "SCALING_TYPES", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 246 + }, + "initialIsOpen": false + }, + { + "id": "def-common.SOURCE_TYPES", + "type": "Enum", + "label": "SOURCE_TYPES", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 77 + }, + "initialIsOpen": false + }, + { + "id": "def-common.STYLE_TYPE", + "type": "Enum", + "label": "STYLE_TYPE", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 198 + }, + "initialIsOpen": false + }, + { + "id": "def-common.SYMBOLIZE_AS_TYPES", + "type": "Enum", + "label": "SYMBOLIZE_AS_TYPES", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 217 + }, + "initialIsOpen": false + }, + { + "id": "def-common.VECTOR_SHAPE_TYPE", + "type": "Enum", + "label": "VECTOR_SHAPE_TYPE", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 278 + }, + "initialIsOpen": false + }, + { + "id": "def-common.VECTOR_STYLES", + "type": "Enum", + "label": "VECTOR_STYLES", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 231 + }, + "initialIsOpen": false + } + ], + "misc": [ + { + "tags": [], + "id": "def-common.AGG_DELIMITER", + "type": "string", + "label": "AGG_DELIMITER", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 160 + }, + "signature": [ + "\"_of_\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.API_ROOT_PATH", + "type": "string", + "label": "API_ROOT_PATH", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 44 + }, + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.APP_ICON", + "type": "string", + "label": "APP_ICON", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 31 + }, + "signature": [ + "\"gisApp\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.APP_ICON_SOLUTION", + "type": "string", + "label": "APP_ICON_SOLUTION", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 32 + }, + "signature": [ + "\"logoKibana\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.APP_ID", + "type": "string", + "label": "APP_ID", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 30 + }, + "signature": [ + "\"maps\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.APP_NAME", + "type": "string", + "label": "APP_NAME", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 33 + }, + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.CATEGORICAL_DATA_TYPES", + "type": "Array", + "label": "CATEGORICAL_DATA_TYPES", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 214 + }, + "signature": [ + "string[]" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.COUNT_PROP_LABEL", + "type": "string", + "label": "COUNT_PROP_LABEL", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 192 + }, + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.COUNT_PROP_NAME", + "type": "string", + "label": "COUNT_PROP_NAME", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 196 + }, + "signature": [ + "\"doc_count\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.DECIMAL_DEGREES_PRECISION", + "type": "number", + "label": "DECIMAL_DEGREES_PRECISION", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 110 + }, + "signature": [ + "5" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.DEFAULT_ICON", + "type": "string", + "label": "DEFAULT_ICON", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 229 + }, + "signature": [ + "\"marker\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.DEFAULT_MAX_BUCKETS_LIMIT", + "type": "number", + "label": "DEFAULT_MAX_BUCKETS_LIMIT", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 114 + }, + "signature": [ + "65535" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.DEFAULT_MAX_INNER_RESULT_WINDOW", + "type": "number", + "label": "DEFAULT_MAX_INNER_RESULT_WINDOW", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 113 + }, + "signature": [ + "100" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.DEFAULT_MAX_RESULT_WINDOW", + "type": "number", + "label": "DEFAULT_MAX_RESULT_WINDOW", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 112 + }, + "signature": [ + "10000" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.DEFAULT_PERCENTILE", + "type": "number", + "label": "DEFAULT_PERCENTILE", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 190 + }, + "signature": [ + "50" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.DEFAULT_PERCENTILES", + "type": "Array", + "label": "DEFAULT_PERCENTILES", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 294 + }, + "signature": [ + "number[]" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.EMS_APP_NAME", + "type": "string", + "label": "EMS_APP_NAME", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 11 + }, + "signature": [ + "\"kibana\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.EMS_CATALOGUE_PATH", + "type": "string", + "label": "EMS_CATALOGUE_PATH", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 12 + }, + "signature": [ + "\"ems/catalogue\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.EMS_FILES_API_PATH", + "type": "string", + "label": "EMS_FILES_API_PATH", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 15 + }, + "signature": [ + "\"ems/files\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.EMS_FILES_CATALOGUE_PATH", + "type": "string", + "label": "EMS_FILES_CATALOGUE_PATH", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 14 + }, + "signature": [ + "\"ems/files\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.EMS_FILES_DEFAULT_JSON_PATH", + "type": "string", + "label": "EMS_FILES_DEFAULT_JSON_PATH", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 16 + }, + "signature": [ + "\"file\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.EMS_GLYPHS_PATH", + "type": "string", + "label": "EMS_GLYPHS_PATH", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 17 + }, + "signature": [ + "\"fonts\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.EMS_SPRITES_PATH", + "type": "string", + "label": "EMS_SPRITES_PATH", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 18 + }, + "signature": [ + "\"sprites\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.EMS_TILES_API_PATH", + "type": "string", + "label": "EMS_TILES_API_PATH", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 21 + }, + "signature": [ + "\"ems/tiles\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.EMS_TILES_CATALOGUE_PATH", + "type": "string", + "label": "EMS_TILES_CATALOGUE_PATH", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 20 + }, + "signature": [ + "\"ems/tiles\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.EMS_TILES_RASTER_STYLE_PATH", + "type": "string", + "label": "EMS_TILES_RASTER_STYLE_PATH", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 22 + }, + "signature": [ + "\"raster/style\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.EMS_TILES_RASTER_TILE_PATH", + "type": "string", + "label": "EMS_TILES_RASTER_TILE_PATH", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 23 + }, + "signature": [ + "\"raster/tile\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.EMS_TILES_VECTOR_SOURCE_PATH", + "type": "string", + "label": "EMS_TILES_VECTOR_SOURCE_PATH", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 26 + }, + "signature": [ + "\"vector/source\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.EMS_TILES_VECTOR_STYLE_PATH", + "type": "string", + "label": "EMS_TILES_VECTOR_STYLE_PATH", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 25 + }, + "signature": [ + "\"vector/style\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.EMS_TILES_VECTOR_TILE_PATH", + "type": "string", + "label": "EMS_TILES_VECTOR_TILE_PATH", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 27 + }, + "signature": [ + "\"vector/tile\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.ES_GEO_FIELD_TYPES", + "type": "Array", + "label": "ES_GEO_FIELD_TYPES", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 127 + }, + "signature": [ + "string[]" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.FEATURE_ID_PROPERTY_NAME", + "type": "string", + "label": "FEATURE_ID_PROPERTY_NAME", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 116 + }, + "signature": [ + "\"__kbn__feature_id__\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.FEATURE_VISIBLE_PROPERTY_NAME", + "type": "string", + "label": "FEATURE_VISIBLE_PROPERTY_NAME", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 117 + }, + "signature": [ + "\"__kbn_isvisibleduetojoin__\"" + ], + "initialIsOpen": false + }, + { + "id": "def-common.FieldFormatter", + "type": "Type", + "label": "FieldFormatter", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 298 + }, + "signature": [ + "(value: ", + { + "pluginId": "maps", + "scope": "common", + "docId": "kibMapsPluginApi", + "section": "def-common.RawValue", + "text": "RawValue" + }, + ") => React.ReactText" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.FONTS_API_PATH", + "type": "string", + "label": "FONTS_API_PATH", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 42 + }, + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.FORMATTERS_DATA_REQUEST_ID_SUFFIX", + "type": "string", + "label": "FORMATTERS_DATA_REQUEST_ID_SUFFIX", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 101 + }, + "signature": [ + "\"formatters\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.GEOCENTROID_AGG_NAME", + "type": "string", + "label": "GEOCENTROID_AGG_NAME", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 187 + }, + "signature": [ + "\"gridCentroid\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.GEOTILE_GRID_AGG_NAME", + "type": "string", + "label": "GEOTILE_GRID_AGG_NAME", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 186 + }, + "signature": [ + "\"gridSplit\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.GIS_API_PATH", + "type": "string", + "label": "GIS_API_PATH", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 40 + }, + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.INDEX_META_DATA_CREATED_BY", + "type": "string", + "label": "INDEX_META_DATA_CREATED_BY", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 300 + }, + "signature": [ + "\"maps-drawing-data-ingest\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.INDEX_SETTINGS_API_PATH", + "type": "string", + "label": "INDEX_SETTINGS_API_PATH", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 41 + }, + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.INDEX_SOURCE_API_PATH", + "type": "string", + "label": "INDEX_SOURCE_API_PATH", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 43 + }, + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.INITIAL_LAYERS_KEY", + "type": "string", + "label": "INITIAL_LAYERS_KEY", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 36 + }, + "signature": [ + "\"initialLayers\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.JOIN_FIELD_NAME_PREFIX", + "type": "string", + "label": "JOIN_FIELD_NAME_PREFIX", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 98 + }, + "signature": [ + "\"__kbnjoin__\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.KBN_IS_CENTROID_FEATURE", + "type": "string", + "label": "KBN_IS_CENTROID_FEATURE", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 55 + }, + "signature": [ + "\"__kbn_is_centroid_feature__\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.KBN_TOO_MANY_FEATURES_IMAGE_ID", + "type": "string", + "label": "KBN_TOO_MANY_FEATURES_IMAGE_ID", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 52 + }, + "signature": [ + "\"__kbn_too_many_features_image_id__\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.KBN_TOO_MANY_FEATURES_PROPERTY", + "type": "string", + "label": "KBN_TOO_MANY_FEATURES_PROPERTY", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 51 + }, + "signature": [ + "\"__kbn_too_many_features__\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.LAT_INDEX", + "type": "number", + "label": "LAT_INDEX", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 147 + }, + "signature": [ + "1" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.LON_INDEX", + "type": "number", + "label": "LON_INDEX", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 146 + }, + "signature": [ + "0" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.MAP_PATH", + "type": "string", + "label": "MAP_PATH", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 39 + }, + "signature": [ + "\"map\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.MAP_SAVED_OBJECT_TYPE", + "type": "string", + "label": "MAP_SAVED_OBJECT_TYPE", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 29 + }, + "signature": [ + "\"map\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.MAPS_APP_PATH", + "type": "string", + "label": "MAPS_APP_PATH", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 38 + }, + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.MAX_ZOOM", + "type": "number", + "label": "MAX_ZOOM", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 108 + }, + "signature": [ + "24" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.MB_SOURCE_ID_LAYER_ID_PREFIX_DELIMITER", + "type": "string", + "label": "MB_SOURCE_ID_LAYER_ID_PREFIX_DELIMITER", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 119 + }, + "signature": [ + "\"_\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.META_DATA_REQUEST_ID_SUFFIX", + "type": "string", + "label": "META_DATA_REQUEST_ID_SUFFIX", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 100 + }, + "signature": [ + "\"meta\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.MIN_ZOOM", + "type": "number", + "label": "MIN_ZOOM", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 107 + }, + "signature": [ + "0" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.MVT_GETGRIDTILE_API_PATH", + "type": "string", + "label": "MVT_GETGRIDTILE_API_PATH", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 47 + }, + "signature": [ + "\"mvt/getGridTile\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.MVT_GETTILE_API_PATH", + "type": "string", + "label": "MVT_GETTILE_API_PATH", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 46 + }, + "signature": [ + "\"mvt/getTile\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.MVT_SOURCE_LAYER_NAME", + "type": "string", + "label": "MVT_SOURCE_LAYER_NAME", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 48 + }, + "signature": [ + "\"source_layer\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.ORDINAL_DATA_TYPES", + "type": "Array", + "label": "ORDINAL_DATA_TYPES", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 215 + }, + "signature": [ + "string[]" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.POLYGON_COORDINATES_EXTERIOR_INDEX", + "type": "number", + "label": "POLYGON_COORDINATES_EXTERIOR_INDEX", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 145 + }, + "signature": [ + "0" + ], + "initialIsOpen": false + }, + { + "id": "def-common.RawValue", + "type": "Type", + "label": "RawValue", + "tags": [], + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 296 + }, + "signature": [ + "undefined | null | string | number | false | true" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.SOURCE_BOUNDS_DATA_REQUEST_ID", + "type": "string", + "label": "SOURCE_BOUNDS_DATA_REQUEST_ID", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 105 + }, + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.SOURCE_DATA_REQUEST_ID", + "type": "string", + "label": "SOURCE_DATA_REQUEST_ID", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 102 + }, + "signature": [ + "\"source\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.SOURCE_FORMATTERS_DATA_REQUEST_ID", + "type": "string", + "label": "SOURCE_FORMATTERS_DATA_REQUEST_ID", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 104 + }, + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.SOURCE_META_DATA_REQUEST_ID", + "type": "string", + "label": "SOURCE_META_DATA_REQUEST_ID", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 103 + }, + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.SPATIAL_FILTERS_LAYER_ID", + "type": "string", + "label": "SPATIAL_FILTERS_LAYER_ID", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 263 + }, + "signature": [ + "\"SPATIAL_FILTERS_LAYER_ID\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.SUPER_FINE_ZOOM_DELTA", + "type": "number", + "label": "SUPER_FINE_ZOOM_DELTA", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 185 + }, + "signature": [ + "7" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.TOP_TERM_PERCENTAGE_SUFFIX", + "type": "string", + "label": "TOP_TERM_PERCENTAGE_SUFFIX", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 189 + }, + "signature": [ + "\"__percentage\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.ZOOM_PRECISION", + "type": "number", + "label": "ZOOM_PRECISION", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 111 + }, + "signature": [ + "2" + ], + "initialIsOpen": false + } + ], + "objects": [ + { + "id": "def-common.EMPTY_FEATURE_COLLECTION", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.EMPTY_FEATURE_COLLECTION.type", + "type": "string", + "label": "type", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 150 + }, + "signature": [ + "\"FeatureCollection\"" + ] + }, + { + "tags": [], + "id": "def-common.EMPTY_FEATURE_COLLECTION.features", + "type": "Array", + "label": "features", + "description": [], + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 151 + }, + "signature": [ + "never[]" + ] + } + ], + "description": [], + "label": "EMPTY_FEATURE_COLLECTION", + "source": { + "path": "x-pack/plugins/maps/common/constants.ts", + "lineNumber": 149 + }, + "initialIsOpen": false + } + ] } } \ No newline at end of file diff --git a/api_docs/maps.mdx b/api_docs/maps.mdx index 3e95ab1f79e985..9799fa17693912 100644 --- a/api_docs/maps.mdx +++ b/api_docs/maps.mdx @@ -22,3 +22,20 @@ import mapsObj from './maps.json'; ### Consts, variables and types +## Common + +### Objects + + +### Functions + + +### Interfaces + + +### Enums + + +### Consts, variables and types + + diff --git a/api_docs/maps_ems.json b/api_docs/maps_ems.json new file mode 100644 index 00000000000000..472f6974207676 --- /dev/null +++ b/api_docs/maps_ems.json @@ -0,0 +1,1157 @@ +{ + "id": "mapsEms", + "client": { + "classes": [], + "functions": [], + "interfaces": [ + { + "id": "def-public.FileLayer", + "type": "Interface", + "label": "FileLayer", + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-public.FileLayer.name", + "type": "string", + "label": "name", + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 18 + } + }, + { + "tags": [], + "id": "def-public.FileLayer.origin", + "type": "string", + "label": "origin", + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 19 + } + }, + { + "tags": [], + "id": "def-public.FileLayer.id", + "type": "string", + "label": "id", + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 20 + } + }, + { + "tags": [], + "id": "def-public.FileLayer.format", + "type": "CompoundType", + "label": "format", + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 21 + }, + "signature": [ + "string | { type: string; }" + ] + }, + { + "tags": [], + "id": "def-public.FileLayer.fields", + "type": "Array", + "label": "fields", + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 22 + }, + "signature": [ + { + "pluginId": "mapsEms", + "scope": "public", + "docId": "kibMapsEmsPluginApi", + "section": "def-public.FileLayerField", + "text": "FileLayerField" + }, + "[]" + ] + }, + { + "tags": [], + "id": "def-public.FileLayer.url", + "type": "string", + "label": "url", + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 23 + }, + "signature": [ + "string | undefined" + ] + }, + { + "tags": [], + "id": "def-public.FileLayer.layerId", + "type": "string", + "label": "layerId", + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 24 + }, + "signature": [ + "string | undefined" + ] + }, + { + "tags": [], + "id": "def-public.FileLayer.created_at", + "type": "string", + "label": "created_at", + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 25 + }, + "signature": [ + "string | undefined" + ] + }, + { + "tags": [], + "id": "def-public.FileLayer.attribution", + "type": "string", + "label": "attribution", + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 26 + }, + "signature": [ + "string | undefined" + ] + }, + { + "tags": [], + "id": "def-public.FileLayer.meta", + "type": "Object", + "label": "meta", + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 27 + }, + "signature": [ + "{ [key: string]: string; } | undefined" + ] + } + ], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 17 + }, + "initialIsOpen": false + }, + { + "id": "def-public.FileLayerField", + "type": "Interface", + "label": "FileLayerField", + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-public.FileLayerField.name", + "type": "string", + "label": "name", + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 33 + } + }, + { + "tags": [], + "id": "def-public.FileLayerField.description", + "type": "string", + "label": "description", + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 34 + } + }, + { + "tags": [], + "id": "def-public.FileLayerField.type", + "type": "string", + "label": "type", + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 35 + } + } + ], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 32 + }, + "initialIsOpen": false + }, + { + "id": "def-public.IServiceSettings", + "type": "Interface", + "label": "IServiceSettings", + "description": [], + "tags": [], + "children": [ + { + "id": "def-public.IServiceSettings.getEMSHotLink", + "type": "Function", + "label": "getEMSHotLink", + "signature": [ + "(layer: ", + { + "pluginId": "mapsEms", + "scope": "public", + "docId": "kibMapsEmsPluginApi", + "section": "def-public.FileLayer", + "text": "FileLayer" + }, + ") => Promise" + ], + "description": [], + "children": [ + { + "type": "Object", + "label": "layer", + "isRequired": true, + "signature": [ + { + "pluginId": "mapsEms", + "scope": "public", + "docId": "kibMapsEmsPluginApi", + "section": "def-public.FileLayer", + "text": "FileLayer" + } + ], + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 44 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 44 + } + }, + { + "id": "def-public.IServiceSettings.getTMSServices", + "type": "Function", + "label": "getTMSServices", + "signature": [ + "() => Promise<", + { + "pluginId": "mapsEms", + "scope": "public", + "docId": "kibMapsEmsPluginApi", + "section": "def-public.TmsLayer", + "text": "TmsLayer" + }, + "[]>" + ], + "description": [], + "children": [], + "tags": [], + "returnComment": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 45 + } + }, + { + "id": "def-public.IServiceSettings.getFileLayers", + "type": "Function", + "label": "getFileLayers", + "signature": [ + "() => Promise<", + { + "pluginId": "mapsEms", + "scope": "public", + "docId": "kibMapsEmsPluginApi", + "section": "def-public.FileLayer", + "text": "FileLayer" + }, + "[]>" + ], + "description": [], + "children": [], + "tags": [], + "returnComment": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 46 + } + }, + { + "id": "def-public.IServiceSettings.getUrlForRegionLayer", + "type": "Function", + "label": "getUrlForRegionLayer", + "signature": [ + "(layer: ", + { + "pluginId": "mapsEms", + "scope": "public", + "docId": "kibMapsEmsPluginApi", + "section": "def-public.FileLayer", + "text": "FileLayer" + }, + ") => Promise" + ], + "description": [], + "children": [ + { + "type": "Object", + "label": "layer", + "isRequired": true, + "signature": [ + { + "pluginId": "mapsEms", + "scope": "public", + "docId": "kibMapsEmsPluginApi", + "section": "def-public.FileLayer", + "text": "FileLayer" + } + ], + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 47 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 47 + } + }, + { + "id": "def-public.IServiceSettings.setQueryParams", + "type": "Function", + "label": "setQueryParams", + "signature": [ + "(params: { [p: string]: string; }) => void" + ], + "description": [], + "children": [ + { + "id": "def-public.IServiceSettings.setQueryParams.params", + "type": "Object", + "label": "params", + "tags": [], + "description": [], + "children": [ + { + "id": "def-public.IServiceSettings.setQueryParams.params.Unnamed", + "type": "Any", + "label": "Unnamed", + "tags": [], + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 48 + }, + "signature": [ + "any" + ] + } + ], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 48 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 48 + } + }, + { + "id": "def-public.IServiceSettings.enableZoomMessage", + "type": "Function", + "label": "enableZoomMessage", + "signature": [ + "() => void" + ], + "description": [], + "children": [], + "tags": [], + "returnComment": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 49 + } + }, + { + "id": "def-public.IServiceSettings.disableZoomMessage", + "type": "Function", + "label": "disableZoomMessage", + "signature": [ + "() => void" + ], + "description": [], + "children": [], + "tags": [], + "returnComment": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 50 + } + }, + { + "id": "def-public.IServiceSettings.getAttributesForTMSLayer", + "type": "Function", + "label": "getAttributesForTMSLayer", + "signature": [ + "(tmsServiceConfig: ", + { + "pluginId": "mapsEms", + "scope": "public", + "docId": "kibMapsEmsPluginApi", + "section": "def-public.TmsLayer", + "text": "TmsLayer" + }, + ", isDesaturated: boolean, isDarkMode: boolean) => any" + ], + "description": [], + "children": [ + { + "type": "Object", + "label": "tmsServiceConfig", + "isRequired": true, + "signature": [ + { + "pluginId": "mapsEms", + "scope": "public", + "docId": "kibMapsEmsPluginApi", + "section": "def-public.TmsLayer", + "text": "TmsLayer" + } + ], + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 52 + } + }, + { + "type": "boolean", + "label": "isDesaturated", + "isRequired": true, + "signature": [ + "boolean" + ], + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 53 + } + }, + { + "type": "boolean", + "label": "isDarkMode", + "isRequired": true, + "signature": [ + "boolean" + ], + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 54 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 51 + } + } + ], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 43 + }, + "initialIsOpen": false + }, + { + "id": "def-public.TmsLayer", + "type": "Interface", + "label": "TmsLayer", + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-public.TmsLayer.id", + "type": "string", + "label": "id", + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 10 + } + }, + { + "tags": [], + "id": "def-public.TmsLayer.origin", + "type": "string", + "label": "origin", + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 11 + } + }, + { + "tags": [], + "id": "def-public.TmsLayer.minZoom", + "type": "number", + "label": "minZoom", + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 12 + } + }, + { + "tags": [], + "id": "def-public.TmsLayer.maxZoom", + "type": "number", + "label": "maxZoom", + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 13 + } + }, + { + "tags": [], + "id": "def-public.TmsLayer.attribution", + "type": "string", + "label": "attribution", + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 14 + } + } + ], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 9 + }, + "initialIsOpen": false + }, + { + "id": "def-public.VectorLayer", + "type": "Interface", + "label": "VectorLayer", + "signature": [ + { + "pluginId": "mapsEms", + "scope": "public", + "docId": "kibMapsEmsPluginApi", + "section": "def-public.VectorLayer", + "text": "VectorLayer" + }, + " extends ", + { + "pluginId": "mapsEms", + "scope": "public", + "docId": "kibMapsEmsPluginApi", + "section": "def-public.FileLayer", + "text": "FileLayer" + } + ], + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-public.VectorLayer.layerId", + "type": "string", + "label": "layerId", + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 39 + } + }, + { + "tags": [], + "id": "def-public.VectorLayer.isEMS", + "type": "boolean", + "label": "isEMS", + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 40 + } + } + ], + "source": { + "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", + "lineNumber": 38 + }, + "initialIsOpen": false + } + ], + "enums": [], + "misc": [ + { + "tags": [], + "id": "def-public.DEFAULT_EMS_FILE_API_URL", + "type": "string", + "label": "DEFAULT_EMS_FILE_API_URL", + "description": [], + "source": { + "path": "src/plugins/maps_ems/common/ems_defaults.ts", + "lineNumber": 10 + }, + "signature": [ + "\"https://vector.maps.elastic.co\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-public.DEFAULT_EMS_FONT_LIBRARY_URL", + "type": "string", + "label": "DEFAULT_EMS_FONT_LIBRARY_URL", + "description": [], + "source": { + "path": "src/plugins/maps_ems/common/ems_defaults.ts", + "lineNumber": 13 + }, + "signature": [ + "\"https://tiles.maps.elastic.co/fonts/{fontstack}/{range}.pbf\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-public.DEFAULT_EMS_LANDING_PAGE_URL", + "type": "string", + "label": "DEFAULT_EMS_LANDING_PAGE_URL", + "description": [], + "source": { + "path": "src/plugins/maps_ems/common/ems_defaults.ts", + "lineNumber": 12 + }, + "signature": [ + "\"https://maps.elastic.co/v7.12\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-public.DEFAULT_EMS_TILE_API_URL", + "type": "string", + "label": "DEFAULT_EMS_TILE_API_URL", + "description": [], + "source": { + "path": "src/plugins/maps_ems/common/ems_defaults.ts", + "lineNumber": 11 + }, + "signature": [ + "\"https://tiles.maps.elastic.co\"" + ], + "initialIsOpen": false + }, + { + "id": "def-public.LayerConfig", + "type": "Type", + "label": "LayerConfig", + "tags": [], + "description": [], + "source": { + "path": "src/plugins/maps_ems/config.ts", + "lineNumber": 54 + }, + "signature": [ + "{ readonly name: string; readonly format: Readonly<{} & { type: string; }>; readonly fields: Readonly<{} & { description: string; name: string; }>[]; readonly meta: Readonly<{} & { feature_collection_path: string; }>; readonly url: string; readonly attribution: string; }" + ], + "initialIsOpen": false + }, + { + "id": "def-public.MapsEmsConfig", + "type": "Type", + "label": "MapsEmsConfig", + "tags": [], + "description": [], + "source": { + "path": "src/plugins/maps_ems/config.ts", + "lineNumber": 86 + }, + "signature": [ + "{ readonly includeElasticMapsService: boolean; readonly proxyElasticMapsServiceInMaps: boolean; readonly regionmap: Readonly<{} & { includeElasticMapsService: boolean; layers: Readonly<{} & { name: string; format: Readonly<{} & { type: string; }>; fields: Readonly<{} & { description: string; name: string; }>[]; meta: Readonly<{} & { feature_collection_path: string; }>; url: string; attribution: string; }>[]; }>; readonly tilemap: Readonly<{ url?: string | undefined; } & { options: Readonly<{ default?: boolean | undefined; tileSize?: number | undefined; subdomains?: string[] | undefined; errorTileUrl?: string | undefined; tms?: boolean | undefined; reuseTiles?: boolean | undefined; bounds?: number[] | undefined; } & { attribution: string; minZoom: number; maxZoom: number; }>; }>; readonly manifestServiceUrl: string; readonly emsUrl: string; readonly emsFileApiUrl: string; readonly emsTileApiUrl: string; readonly emsLandingPageUrl: string; readonly emsFontLibraryUrl: string; readonly emsTileLayerId: Readonly<{} & { bright: string; desaturated: string; dark: string; }>; }" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-public.TMS_IN_YML_ID", + "type": "string", + "label": "TMS_IN_YML_ID", + "description": [], + "source": { + "path": "src/plugins/maps_ems/common/index.ts", + "lineNumber": 9 + }, + "signature": [ + "\"TMS in config/kibana.yml\"" + ], + "initialIsOpen": false + } + ], + "objects": [ + { + "id": "def-public.ORIGIN", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-public.ORIGIN.EMS", + "type": "string", + "label": "EMS", + "description": [], + "source": { + "path": "src/plugins/maps_ems/common/origin.ts", + "lineNumber": 10 + } + }, + { + "tags": [], + "id": "def-public.ORIGIN.KIBANA_YML", + "type": "string", + "label": "KIBANA_YML", + "description": [], + "source": { + "path": "src/plugins/maps_ems/common/origin.ts", + "lineNumber": 11 + } + } + ], + "description": [], + "label": "ORIGIN", + "source": { + "path": "src/plugins/maps_ems/common/origin.ts", + "lineNumber": 9 + }, + "initialIsOpen": false + } + ], + "setup": { + "id": "def-public.MapsEmsPluginSetup", + "type": "Interface", + "label": "MapsEmsPluginSetup", + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-public.MapsEmsPluginSetup.config", + "type": "Object", + "label": "config", + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/index.ts", + "lineNumber": 32 + }, + "signature": [ + "Readonly<{} & { includeElasticMapsService: boolean; proxyElasticMapsServiceInMaps: boolean; regionmap: Readonly<{} & { includeElasticMapsService: boolean; layers: Readonly<{} & { name: string; format: Readonly<{} & { type: string; }>; fields: Readonly<{} & { description: string; name: string; }>[]; meta: Readonly<{} & { feature_collection_path: string; }>; url: string; attribution: string; }>[]; }>; tilemap: Readonly<{ url?: string | undefined; } & { options: Readonly<{ default?: boolean | undefined; tileSize?: number | undefined; subdomains?: string[] | undefined; errorTileUrl?: string | undefined; tms?: boolean | undefined; reuseTiles?: boolean | undefined; bounds?: number[] | undefined; } & { attribution: string; minZoom: number; maxZoom: number; }>; }>; manifestServiceUrl: string; emsUrl: string; emsFileApiUrl: string; emsTileApiUrl: string; emsLandingPageUrl: string; emsFontLibraryUrl: string; emsTileLayerId: Readonly<{} & { bright: string; desaturated: string; dark: string; }>; }>" + ] + }, + { + "tags": [], + "id": "def-public.MapsEmsPluginSetup.getServiceSettings", + "type": "Function", + "label": "getServiceSettings", + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/index.ts", + "lineNumber": 33 + }, + "signature": [ + "() => Promise<", + { + "pluginId": "mapsEms", + "scope": "public", + "docId": "kibMapsEmsPluginApi", + "section": "def-public.IServiceSettings", + "text": "IServiceSettings" + }, + ">" + ] + } + ], + "source": { + "path": "src/plugins/maps_ems/public/index.ts", + "lineNumber": 31 + }, + "lifecycle": "setup", + "initialIsOpen": true + }, + "start": { + "id": "def-public.MapsEmsPluginStart", + "type": "Type", + "label": "MapsEmsPluginStart", + "tags": [], + "description": [], + "source": { + "path": "src/plugins/maps_ems/public/index.ts", + "lineNumber": 35 + }, + "signature": [ + "void" + ], + "lifecycle": "start", + "initialIsOpen": true + } + }, + "server": { + "classes": [ + { + "id": "def-server.MapsEmsPlugin", + "type": "Class", + "tags": [], + "label": "MapsEmsPlugin", + "description": [], + "signature": [ + { + "pluginId": "mapsEms", + "scope": "server", + "docId": "kibMapsEmsPluginApi", + "section": "def-server.MapsEmsPlugin", + "text": "MapsEmsPlugin" + }, + " implements ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.Plugin", + "text": "Plugin" + }, + "<", + { + "pluginId": "mapsEms", + "scope": "server", + "docId": "kibMapsEmsPluginApi", + "section": "def-server.MapsEmsPluginSetup", + "text": "MapsEmsPluginSetup" + }, + ", void, object, object>" + ], + "children": [ + { + "tags": [], + "id": "def-server.MapsEmsPlugin._initializerContext", + "type": "Object", + "label": "_initializerContext", + "description": [], + "source": { + "path": "src/plugins/maps_ems/server/index.ts", + "lineNumber": 39 + }, + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.PluginInitializerContext", + "text": "PluginInitializerContext" + }, + "; fields: Readonly<{} & { description: string; name: string; }>[]; meta: Readonly<{} & { feature_collection_path: string; }>; url: string; attribution: string; }>[]; }>; tilemap: Readonly<{ url?: string | undefined; } & { options: Readonly<{ default?: boolean | undefined; tileSize?: number | undefined; subdomains?: string[] | undefined; errorTileUrl?: string | undefined; tms?: boolean | undefined; reuseTiles?: boolean | undefined; bounds?: number[] | undefined; } & { attribution: string; minZoom: number; maxZoom: number; }>; }>; manifestServiceUrl: string; emsUrl: string; emsFileApiUrl: string; emsTileApiUrl: string; emsLandingPageUrl: string; emsFontLibraryUrl: string; emsTileLayerId: Readonly<{} & { bright: string; desaturated: string; dark: string; }>; }>>" + ] + }, + { + "id": "def-server.MapsEmsPlugin.Unnamed", + "type": "Function", + "label": "Constructor", + "signature": [ + "any" + ], + "description": [], + "children": [ + { + "type": "Object", + "label": "initializerContext", + "isRequired": true, + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.PluginInitializerContext", + "text": "PluginInitializerContext" + }, + "; fields: Readonly<{} & { description: string; name: string; }>[]; meta: Readonly<{} & { feature_collection_path: string; }>; url: string; attribution: string; }>[]; }>; tilemap: Readonly<{ url?: string | undefined; } & { options: Readonly<{ default?: boolean | undefined; tileSize?: number | undefined; subdomains?: string[] | undefined; errorTileUrl?: string | undefined; tms?: boolean | undefined; reuseTiles?: boolean | undefined; bounds?: number[] | undefined; } & { attribution: string; minZoom: number; maxZoom: number; }>; }>; manifestServiceUrl: string; emsUrl: string; emsFileApiUrl: string; emsTileApiUrl: string; emsLandingPageUrl: string; emsFontLibraryUrl: string; emsTileLayerId: Readonly<{} & { bright: string; desaturated: string; dark: string; }>; }>>" + ], + "description": [], + "source": { + "path": "src/plugins/maps_ems/server/index.ts", + "lineNumber": 41 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "src/plugins/maps_ems/server/index.ts", + "lineNumber": 41 + } + }, + { + "id": "def-server.MapsEmsPlugin.setup", + "type": "Function", + "label": "setup", + "signature": [ + "(core: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.CoreSetup", + "text": "CoreSetup" + }, + ") => { config: Readonly<{} & { includeElasticMapsService: boolean; proxyElasticMapsServiceInMaps: boolean; regionmap: Readonly<{} & { includeElasticMapsService: boolean; layers: Readonly<{} & { name: string; format: Readonly<{} & { type: string; }>; fields: Readonly<{} & { description: string; name: string; }>[]; meta: Readonly<{} & { feature_collection_path: string; }>; url: string; attribution: string; }>[]; }>; tilemap: Readonly<{ url?: string | undefined; } & { options: Readonly<{ default?: boolean | undefined; tileSize?: number | undefined; subdomains?: string[] | undefined; errorTileUrl?: string | undefined; tms?: boolean | undefined; reuseTiles?: boolean | undefined; bounds?: number[] | undefined; } & { attribution: string; minZoom: number; maxZoom: number; }>; }>; manifestServiceUrl: string; emsUrl: string; emsFileApiUrl: string; emsTileApiUrl: string; emsLandingPageUrl: string; emsFontLibraryUrl: string; emsTileLayerId: Readonly<{} & { bright: string; desaturated: string; dark: string; }>; }>; }" + ], + "description": [], + "children": [ + { + "type": "Object", + "label": "core", + "isRequired": true, + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.CoreSetup", + "text": "CoreSetup" + }, + "" + ], + "description": [], + "source": { + "path": "src/plugins/maps_ems/server/index.ts", + "lineNumber": 45 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "src/plugins/maps_ems/server/index.ts", + "lineNumber": 45 + } + }, + { + "id": "def-server.MapsEmsPlugin.start", + "type": "Function", + "label": "start", + "signature": [ + "() => void" + ], + "description": [], + "children": [], + "tags": [], + "returnComment": [], + "source": { + "path": "src/plugins/maps_ems/server/index.ts", + "lineNumber": 52 + } + } + ], + "source": { + "path": "src/plugins/maps_ems/server/index.ts", + "lineNumber": 38 + }, + "initialIsOpen": false + } + ], + "functions": [], + "interfaces": [ + { + "id": "def-server.MapsEmsPluginSetup", + "type": "Interface", + "label": "MapsEmsPluginSetup", + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-server.MapsEmsPluginSetup.config", + "type": "Object", + "label": "config", + "description": [], + "source": { + "path": "src/plugins/maps_ems/server/index.ts", + "lineNumber": 35 + }, + "signature": [ + "Readonly<{} & { includeElasticMapsService: boolean; proxyElasticMapsServiceInMaps: boolean; regionmap: Readonly<{} & { includeElasticMapsService: boolean; layers: Readonly<{} & { name: string; format: Readonly<{} & { type: string; }>; fields: Readonly<{} & { description: string; name: string; }>[]; meta: Readonly<{} & { feature_collection_path: string; }>; url: string; attribution: string; }>[]; }>; tilemap: Readonly<{ url?: string | undefined; } & { options: Readonly<{ default?: boolean | undefined; tileSize?: number | undefined; subdomains?: string[] | undefined; errorTileUrl?: string | undefined; tms?: boolean | undefined; reuseTiles?: boolean | undefined; bounds?: number[] | undefined; } & { attribution: string; minZoom: number; maxZoom: number; }>; }>; manifestServiceUrl: string; emsUrl: string; emsFileApiUrl: string; emsTileApiUrl: string; emsLandingPageUrl: string; emsFontLibraryUrl: string; emsTileLayerId: Readonly<{} & { bright: string; desaturated: string; dark: string; }>; }>" + ] + } + ], + "source": { + "path": "src/plugins/maps_ems/server/index.ts", + "lineNumber": 34 + }, + "initialIsOpen": false + } + ], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [ + { + "tags": [], + "id": "def-common.DEFAULT_EMS_FILE_API_URL", + "type": "string", + "label": "DEFAULT_EMS_FILE_API_URL", + "description": [], + "source": { + "path": "src/plugins/maps_ems/common/ems_defaults.ts", + "lineNumber": 10 + }, + "signature": [ + "\"https://vector.maps.elastic.co\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.DEFAULT_EMS_FONT_LIBRARY_URL", + "type": "string", + "label": "DEFAULT_EMS_FONT_LIBRARY_URL", + "description": [], + "source": { + "path": "src/plugins/maps_ems/common/ems_defaults.ts", + "lineNumber": 13 + }, + "signature": [ + "\"https://tiles.maps.elastic.co/fonts/{fontstack}/{range}.pbf\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.DEFAULT_EMS_LANDING_PAGE_URL", + "type": "string", + "label": "DEFAULT_EMS_LANDING_PAGE_URL", + "description": [], + "source": { + "path": "src/plugins/maps_ems/common/ems_defaults.ts", + "lineNumber": 12 + }, + "signature": [ + "\"https://maps.elastic.co/v7.12\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.DEFAULT_EMS_TILE_API_URL", + "type": "string", + "label": "DEFAULT_EMS_TILE_API_URL", + "description": [], + "source": { + "path": "src/plugins/maps_ems/common/ems_defaults.ts", + "lineNumber": 11 + }, + "signature": [ + "\"https://tiles.maps.elastic.co\"" + ], + "initialIsOpen": false + }, + { + "tags": [], + "id": "def-common.TMS_IN_YML_ID", + "type": "string", + "label": "TMS_IN_YML_ID", + "description": [], + "source": { + "path": "src/plugins/maps_ems/common/index.ts", + "lineNumber": 9 + }, + "signature": [ + "\"TMS in config/kibana.yml\"" + ], + "initialIsOpen": false + } + ], + "objects": [ + { + "id": "def-common.ORIGIN", + "type": "Object", + "tags": [], + "children": [ + { + "tags": [], + "id": "def-common.ORIGIN.EMS", + "type": "string", + "label": "EMS", + "description": [], + "source": { + "path": "src/plugins/maps_ems/common/origin.ts", + "lineNumber": 10 + } + }, + { + "tags": [], + "id": "def-common.ORIGIN.KIBANA_YML", + "type": "string", + "label": "KIBANA_YML", + "description": [], + "source": { + "path": "src/plugins/maps_ems/common/origin.ts", + "lineNumber": 11 + } + } + ], + "description": [], + "label": "ORIGIN", + "source": { + "path": "src/plugins/maps_ems/common/origin.ts", + "lineNumber": 9 + }, + "initialIsOpen": false + } + ] + } +} \ No newline at end of file diff --git a/api_docs/maps_ems.mdx b/api_docs/maps_ems.mdx new file mode 100644 index 00000000000000..5907add0c54659 --- /dev/null +++ b/api_docs/maps_ems.mdx @@ -0,0 +1,46 @@ +--- +id: kibMapsEmsPluginApi +slug: /kibana-dev-docs/mapsEmsPluginApi +title: mapsEms +image: https://source.unsplash.com/400x175/?github +summary: API docs for the mapsEms plugin +date: 2020-11-16 +tags: ['contributor', 'dev', 'apidocs', 'kibana', 'mapsEms'] +warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. +--- + +import mapsEmsObj from './maps_ems.json'; + +## Client + +### Setup + + +### Start + + +### Objects + + +### Interfaces + + +### Consts, variables and types + + +## Server + +### Classes + + +### Interfaces + + +## Common + +### Objects + + +### Consts, variables and types + + diff --git a/api_docs/maps_legacy.json b/api_docs/maps_legacy.json deleted file mode 100644 index 09c94af4e0367c..00000000000000 --- a/api_docs/maps_legacy.json +++ /dev/null @@ -1,277 +0,0 @@ -{ - "id": "mapsLegacy", - "client": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "server": { - "classes": [ - { - "id": "def-server.MapsLegacyPlugin", - "type": "Class", - "tags": [], - "label": "MapsLegacyPlugin", - "description": [], - "signature": [ - { - "pluginId": "mapsLegacy", - "scope": "server", - "docId": "kibMapsLegacyPluginApi", - "section": "def-server.MapsLegacyPlugin", - "text": "MapsLegacyPlugin" - }, - " implements ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.Plugin", - "text": "Plugin" - }, - "<", - { - "pluginId": "mapsLegacy", - "scope": "server", - "docId": "kibMapsLegacyPluginApi", - "section": "def-server.MapsLegacyPluginSetup", - "text": "MapsLegacyPluginSetup" - }, - ", void, object, object>" - ], - "children": [ - { - "tags": [], - "id": "def-server.MapsLegacyPlugin._initializerContext", - "type": "Object", - "label": "_initializerContext", - "description": [], - "source": { - "path": "src/plugins/maps_legacy/server/index.ts", - "lineNumber": 36 - }, - "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.PluginInitializerContext", - "text": "PluginInitializerContext" - }, - "; }>; regionmap: Readonly<{} & { includeElasticMapsService: boolean; layers: Readonly<{} & { name: string; format: Readonly<{} & { type: string; }>; fields: Readonly<{} & { description: string; name: string; }>[]; meta: Readonly<{} & { feature_collection_path: string; }>; url: string; attribution: string; }>[]; }>; manifestServiceUrl: string; emsUrl: string; emsFileApiUrl: string; emsTileApiUrl: string; emsLandingPageUrl: string; emsFontLibraryUrl: string; emsTileLayerId: Readonly<{} & { bright: string; desaturated: string; dark: string; }>; }>>" - ] - }, - { - "id": "def-server.MapsLegacyPlugin.Unnamed", - "type": "Function", - "label": "Constructor", - "signature": [ - "any" - ], - "description": [], - "children": [ - { - "type": "Object", - "label": "initializerContext", - "isRequired": true, - "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.PluginInitializerContext", - "text": "PluginInitializerContext" - }, - "; }>; regionmap: Readonly<{} & { includeElasticMapsService: boolean; layers: Readonly<{} & { name: string; format: Readonly<{} & { type: string; }>; fields: Readonly<{} & { description: string; name: string; }>[]; meta: Readonly<{} & { feature_collection_path: string; }>; url: string; attribution: string; }>[]; }>; manifestServiceUrl: string; emsUrl: string; emsFileApiUrl: string; emsTileApiUrl: string; emsLandingPageUrl: string; emsFontLibraryUrl: string; emsTileLayerId: Readonly<{} & { bright: string; desaturated: string; dark: string; }>; }>>" - ], - "description": [], - "source": { - "path": "src/plugins/maps_legacy/server/index.ts", - "lineNumber": 38 - } - } - ], - "tags": [], - "returnComment": [], - "source": { - "path": "src/plugins/maps_legacy/server/index.ts", - "lineNumber": 38 - } - }, - { - "id": "def-server.MapsLegacyPlugin.setup", - "type": "Function", - "label": "setup", - "signature": [ - "(core: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.CoreSetup", - "text": "CoreSetup" - }, - ") => { config: Readonly<{} & { includeElasticMapsService: boolean; proxyElasticMapsServiceInMaps: boolean; tilemap: Readonly<{ url?: string | undefined; } & { options: Readonly<{ default?: boolean | undefined; tileSize?: number | undefined; subdomains?: string[] | undefined; errorTileUrl?: string | undefined; tms?: boolean | undefined; reuseTiles?: boolean | undefined; bounds?: number[] | undefined; } & { attribution: string; minZoom: number; maxZoom: number; }>; }>; regionmap: Readonly<{} & { includeElasticMapsService: boolean; layers: Readonly<{} & { name: string; format: Readonly<{} & { type: string; }>; fields: Readonly<{} & { description: string; name: string; }>[]; meta: Readonly<{} & { feature_collection_path: string; }>; url: string; attribution: string; }>[]; }>; manifestServiceUrl: string; emsUrl: string; emsFileApiUrl: string; emsTileApiUrl: string; emsLandingPageUrl: string; emsFontLibraryUrl: string; emsTileLayerId: Readonly<{} & { bright: string; desaturated: string; dark: string; }>; }>; }" - ], - "description": [], - "children": [ - { - "type": "Object", - "label": "core", - "isRequired": true, - "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.CoreSetup", - "text": "CoreSetup" - }, - "" - ], - "description": [], - "source": { - "path": "src/plugins/maps_legacy/server/index.ts", - "lineNumber": 42 - } - } - ], - "tags": [], - "returnComment": [], - "source": { - "path": "src/plugins/maps_legacy/server/index.ts", - "lineNumber": 42 - } - }, - { - "id": "def-server.MapsLegacyPlugin.start", - "type": "Function", - "label": "start", - "signature": [ - "() => void" - ], - "description": [], - "children": [], - "tags": [], - "returnComment": [], - "source": { - "path": "src/plugins/maps_legacy/server/index.ts", - "lineNumber": 51 - } - } - ], - "source": { - "path": "src/plugins/maps_legacy/server/index.ts", - "lineNumber": 35 - }, - "initialIsOpen": false - } - ], - "functions": [], - "interfaces": [ - { - "id": "def-server.MapsLegacyPluginSetup", - "type": "Interface", - "label": "MapsLegacyPluginSetup", - "description": [], - "tags": [], - "children": [ - { - "tags": [], - "id": "def-server.MapsLegacyPluginSetup.config", - "type": "Object", - "label": "config", - "description": [], - "source": { - "path": "src/plugins/maps_legacy/server/index.ts", - "lineNumber": 32 - }, - "signature": [ - "Readonly<{} & { includeElasticMapsService: boolean; proxyElasticMapsServiceInMaps: boolean; tilemap: Readonly<{ url?: string | undefined; } & { options: Readonly<{ default?: boolean | undefined; tileSize?: number | undefined; subdomains?: string[] | undefined; errorTileUrl?: string | undefined; tms?: boolean | undefined; reuseTiles?: boolean | undefined; bounds?: number[] | undefined; } & { attribution: string; minZoom: number; maxZoom: number; }>; }>; regionmap: Readonly<{} & { includeElasticMapsService: boolean; layers: Readonly<{} & { name: string; format: Readonly<{} & { type: string; }>; fields: Readonly<{} & { description: string; name: string; }>[]; meta: Readonly<{} & { feature_collection_path: string; }>; url: string; attribution: string; }>[]; }>; manifestServiceUrl: string; emsUrl: string; emsFileApiUrl: string; emsTileApiUrl: string; emsLandingPageUrl: string; emsFontLibraryUrl: string; emsTileLayerId: Readonly<{} & { bright: string; desaturated: string; dark: string; }>; }>" - ] - } - ], - "source": { - "path": "src/plugins/maps_legacy/server/index.ts", - "lineNumber": 31 - }, - "initialIsOpen": false - } - ], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [ - { - "tags": [], - "id": "def-common.DEFAULT_EMS_FILE_API_URL", - "type": "string", - "label": "DEFAULT_EMS_FILE_API_URL", - "description": [], - "source": { - "path": "src/plugins/maps_legacy/common/ems_defaults.ts", - "lineNumber": 10 - }, - "signature": [ - "\"https://vector.maps.elastic.co\"" - ], - "initialIsOpen": false - }, - { - "tags": [], - "id": "def-common.DEFAULT_EMS_FONT_LIBRARY_URL", - "type": "string", - "label": "DEFAULT_EMS_FONT_LIBRARY_URL", - "description": [], - "source": { - "path": "src/plugins/maps_legacy/common/ems_defaults.ts", - "lineNumber": 13 - }, - "signature": [ - "\"https://tiles.maps.elastic.co/fonts/{fontstack}/{range}.pbf\"" - ], - "initialIsOpen": false - }, - { - "tags": [], - "id": "def-common.DEFAULT_EMS_LANDING_PAGE_URL", - "type": "string", - "label": "DEFAULT_EMS_LANDING_PAGE_URL", - "description": [], - "source": { - "path": "src/plugins/maps_legacy/common/ems_defaults.ts", - "lineNumber": 12 - }, - "signature": [ - "\"https://maps.elastic.co/v7.12\"" - ], - "initialIsOpen": false - }, - { - "tags": [], - "id": "def-common.DEFAULT_EMS_TILE_API_URL", - "type": "string", - "label": "DEFAULT_EMS_TILE_API_URL", - "description": [], - "source": { - "path": "src/plugins/maps_legacy/common/ems_defaults.ts", - "lineNumber": 11 - }, - "signature": [ - "\"https://tiles.maps.elastic.co\"" - ], - "initialIsOpen": false - } - ], - "objects": [] - } -} \ No newline at end of file diff --git a/api_docs/maps_legacy.mdx b/api_docs/maps_legacy.mdx deleted file mode 100644 index ade3ebfd39b055..00000000000000 --- a/api_docs/maps_legacy.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -id: kibMapsLegacyPluginApi -slug: /kibana-dev-docs/mapsLegacyPluginApi -title: mapsLegacy -image: https://source.unsplash.com/400x175/?github -summary: API docs for the mapsLegacy plugin -date: 2020-11-16 -tags: ['contributor', 'dev', 'apidocs', 'kibana', 'mapsLegacy'] -warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. ---- - -import mapsLegacyObj from './maps_legacy.json'; - -## Server - -### Classes - - -### Interfaces - - -## Common - -### Consts, variables and types - - diff --git a/api_docs/ml.json b/api_docs/ml.json index efa66ac9c9e8f7..fa9bd613195a67 100644 --- a/api_docs/ml.json +++ b/api_docs/ml.json @@ -786,7 +786,7 @@ "description": [], "source": { "path": "x-pack/plugins/ml/common/types/capabilities.ts", - "lineNumber": 147 + "lineNumber": 151 }, "signature": [ { @@ -806,7 +806,7 @@ "description": [], "source": { "path": "x-pack/plugins/ml/common/types/capabilities.ts", - "lineNumber": 148 + "lineNumber": 152 } }, { @@ -817,7 +817,7 @@ "description": [], "source": { "path": "x-pack/plugins/ml/common/types/capabilities.ts", - "lineNumber": 149 + "lineNumber": 153 } }, { @@ -828,13 +828,13 @@ "description": [], "source": { "path": "x-pack/plugins/ml/common/types/capabilities.ts", - "lineNumber": 150 + "lineNumber": 154 } } ], "source": { "path": "x-pack/plugins/ml/common/types/capabilities.ts", - "lineNumber": 146 + "lineNumber": 150 }, "initialIsOpen": false }, @@ -1178,7 +1178,7 @@ "description": [], "source": { "path": "x-pack/plugins/ml/public/application/components/data_grid/types.ts", - "lineNumber": 78 + "lineNumber": 83 }, "signature": [ { @@ -1193,7 +1193,7 @@ ], "source": { "path": "x-pack/plugins/ml/public/application/components/data_grid/types.ts", - "lineNumber": 52 + "lineNumber": 57 }, "initialIsOpen": false } @@ -1266,7 +1266,7 @@ "description": [], "source": { "path": "x-pack/plugins/ml/public/application/components/data_grid/types.ts", - "lineNumber": 48 + "lineNumber": 53 }, "signature": [ "Dictionary<{ order: 'asc' | 'desc'; }>" @@ -1297,10 +1297,12 @@ "description": [], "source": { "path": "x-pack/plugins/ml/public/application/components/data_grid/types.ts", - "lineNumber": 38 + "lineNumber": 43 }, "signature": [ - "(__0: { rowIndex: number; columnId: string; setCellProps: any; }) => any" + "(__0: { rowIndex: number; columnId: string; setCellProps: (props: ", + "CommonProps", + " & React.HTMLAttributes) => void; }) => any" ], "initialIsOpen": false } @@ -3455,7 +3457,14 @@ "lineNumber": 28 }, "signature": [ - "IndicesOptions | undefined" + { + "pluginId": "ml", + "scope": "common", + "docId": "kibMlPluginApi", + "section": "def-common.IndicesOptions", + "text": "IndicesOptions" + }, + " | undefined" ] } ], @@ -3805,6 +3814,76 @@ }, "initialIsOpen": false }, + { + "id": "def-server.IndicesOptions", + "type": "Interface", + "label": "IndicesOptions", + "description": [], + "tags": [], + "children": [ + { + "tags": [], + "id": "def-server.IndicesOptions.expand_wildcards", + "type": "CompoundType", + "label": "expand_wildcards", + "description": [], + "source": { + "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/datafeed.ts", + "lineNumber": 49 + }, + "signature": [ + "\"all\" | \"none\" | \"hidden\" | \"open\" | \"closed\" | undefined" + ] + }, + { + "tags": [], + "id": "def-server.IndicesOptions.ignore_unavailable", + "type": "CompoundType", + "label": "ignore_unavailable", + "description": [], + "source": { + "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/datafeed.ts", + "lineNumber": 50 + }, + "signature": [ + "boolean | undefined" + ] + }, + { + "tags": [], + "id": "def-server.IndicesOptions.allow_no_indices", + "type": "CompoundType", + "label": "allow_no_indices", + "description": [], + "source": { + "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/datafeed.ts", + "lineNumber": 51 + }, + "signature": [ + "boolean | undefined" + ] + }, + { + "tags": [], + "id": "def-server.IndicesOptions.ignore_throttled", + "type": "CompoundType", + "label": "ignore_throttled", + "description": [], + "source": { + "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/datafeed.ts", + "lineNumber": 52 + }, + "signature": [ + "boolean | undefined" + ] + } + ], + "source": { + "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/datafeed.ts", + "lineNumber": 48 + }, + "initialIsOpen": false + }, { "id": "def-server.Influencer", "type": "Interface", @@ -5424,7 +5503,7 @@ "description": [], "source": { "path": "x-pack/plugins/ml/server/plugin.ts", - "lineNumber": 64 + "lineNumber": 63 }, "signature": [ "JobServiceProvider", @@ -5448,7 +5527,7 @@ "description": [], "source": { "path": "x-pack/plugins/ml/server/plugin.ts", - "lineNumber": 65 + "lineNumber": 64 }, "signature": [ "void" @@ -5498,11 +5577,17 @@ "type": "Function", "children": [ { - "type": "Any", + "type": "CompoundType", "label": "error", - "isRequired": true, + "isRequired": false, "signature": [ - "any" + { + "pluginId": "ml", + "scope": "common", + "docId": "kibMlPluginApi", + "section": "def-common.ErrorType", + "text": "ErrorType" + } ], "description": [], "source": { @@ -5512,7 +5597,9 @@ } ], "signature": [ - "(error: any) => string" + "(error: ", + "ErrorType", + ") => string" ], "description": [], "label": "extractErrorMessage", diff --git a/api_docs/monitoring.json b/api_docs/monitoring.json index b24cdd89e424f6..d8b8b60495f8f9 100644 --- a/api_docs/monitoring.json +++ b/api_docs/monitoring.json @@ -27,7 +27,7 @@ "description": [], "source": { "path": "x-pack/plugins/monitoring/server/types.ts", - "lineNumber": 93 + "lineNumber": 94 }, "signature": [ "() => any" @@ -41,7 +41,7 @@ "description": [], "source": { "path": "x-pack/plugins/monitoring/server/types.ts", - "lineNumber": 94 + "lineNumber": 95 }, "signature": [ "() => void" @@ -55,10 +55,18 @@ "description": [], "source": { "path": "x-pack/plugins/monitoring/server/types.ts", - "lineNumber": 95 + "lineNumber": 96 }, "signature": [ - "() => void" + "(esClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, + ") => void" ] }, { @@ -69,7 +77,7 @@ "description": [], "source": { "path": "x-pack/plugins/monitoring/server/types.ts", - "lineNumber": 96 + "lineNumber": 97 }, "signature": [ "() => void" @@ -78,7 +86,7 @@ ], "source": { "path": "x-pack/plugins/monitoring/server/types.ts", - "lineNumber": 92 + "lineNumber": 93 }, "initialIsOpen": false } @@ -134,7 +142,7 @@ "description": [], "source": { "path": "x-pack/plugins/monitoring/server/types.ts", - "lineNumber": 100 + "lineNumber": 101 }, "signature": [ "() => any" @@ -143,7 +151,7 @@ ], "source": { "path": "x-pack/plugins/monitoring/server/types.ts", - "lineNumber": 99 + "lineNumber": 100 }, "lifecycle": "setup", "initialIsOpen": true diff --git a/api_docs/observability.json b/api_docs/observability.json index 81032f62ee3177..439fd18db6469f 100644 --- a/api_docs/observability.json +++ b/api_docs/observability.json @@ -51,6 +51,45 @@ }, "initialIsOpen": false }, + { + "id": "def-public.FieldValueSuggestions", + "type": "Function", + "label": "FieldValueSuggestions", + "signature": [ + "(props: ", + "FieldValueSuggestionsProps", + ") => JSX.Element" + ], + "description": [], + "children": [ + { + "type": "Object", + "label": "props", + "isRequired": true, + "signature": [ + { + "pluginId": "observability", + "scope": "public", + "docId": "kibObservabilityPluginApi", + "section": "def-public.FieldValueSuggestionsProps", + "text": "FieldValueSuggestionsProps" + } + ], + "description": [], + "source": { + "path": "x-pack/plugins/observability/public/components/shared/index.tsx", + "lineNumber": 34 + } + } + ], + "tags": [], + "returnComment": [], + "source": { + "path": "x-pack/plugins/observability/public/components/shared/index.tsx", + "lineNumber": 34 + }, + "initialIsOpen": false + }, { "id": "def-public.getApmTraceUrl", "type": "Function", @@ -142,7 +181,7 @@ "description": [], "source": { "path": "x-pack/plugins/observability/public/components/shared/index.tsx", - "lineNumber": 13 + "lineNumber": 14 } } ], @@ -150,7 +189,7 @@ "returnComment": [], "source": { "path": "x-pack/plugins/observability/public/components/shared/index.tsx", - "lineNumber": 13 + "lineNumber": 14 }, "initialIsOpen": false }, @@ -181,7 +220,7 @@ "description": [], "source": { "path": "x-pack/plugins/observability/public/components/shared/index.tsx", - "lineNumber": 23 + "lineNumber": 24 } } ], @@ -189,7 +228,7 @@ "returnComment": [], "source": { "path": "x-pack/plugins/observability/public/components/shared/index.tsx", - "lineNumber": 23 + "lineNumber": 24 }, "initialIsOpen": false }, @@ -249,7 +288,7 @@ "signature": [ "({ children, ...props }: { children?: React.ReactNode; } & ", "CommonProps", - " & Pick, \"children\" | \"onClick\" | \"onChange\" | \"id\" | \"title\" | \"placeholder\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDown\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\"> & { bordered?: boolean | undefined; flush?: boolean | undefined; gutterSize?: \"m\" | \"s\" | \"none\" | undefined; listItems?: ", + " & Pick, \"children\" | \"onClick\" | \"onChange\" | \"onKeyDown\" | \"title\" | \"id\" | \"placeholder\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\"> & { bordered?: boolean | undefined; flush?: boolean | undefined; gutterSize?: \"m\" | \"s\" | \"none\" | undefined; listItems?: ", "EuiListGroupItemProps", "[] | undefined; color?: \"text\" | \"primary\" | \"inherit\" | \"ghost\" | \"subdued\" | undefined; size?: \"m\" | \"s\" | \"l\" | \"xs\" | undefined; maxWidth?: string | number | boolean | undefined; showToolTips?: boolean | undefined; wrapText?: boolean | undefined; ariaLabelledby?: string | undefined; }) => JSX.Element" ], @@ -262,7 +301,7 @@ "signature": [ "{ children?: React.ReactNode; } & ", "CommonProps", - " & Pick, \"children\" | \"onClick\" | \"onChange\" | \"id\" | \"title\" | \"placeholder\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDown\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\"> & { bordered?: boolean | undefined; flush?: boolean | undefined; gutterSize?: \"m\" | \"s\" | \"none\" | undefined; listItems?: ", + " & Pick, \"children\" | \"onClick\" | \"onChange\" | \"onKeyDown\" | \"title\" | \"id\" | \"placeholder\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\"> & { bordered?: boolean | undefined; flush?: boolean | undefined; gutterSize?: \"m\" | \"s\" | \"none\" | undefined; listItems?: ", "EuiListGroupItemProps", "[] | undefined; color?: \"text\" | \"primary\" | \"inherit\" | \"ghost\" | \"subdued\" | undefined; size?: \"m\" | \"s\" | \"l\" | \"xs\" | undefined; maxWidth?: string | number | boolean | undefined; showToolTips?: boolean | undefined; wrapText?: boolean | undefined; ariaLabelledby?: string | undefined; }" ], @@ -1864,9 +1903,9 @@ "DisambiguateSet", "<(", "DisambiguateSet", - ", Pick, \"children\" | \"type\" | \"onClick\" | \"onChange\" | \"color\" | \"id\" | \"title\" | \"placeholder\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDown\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"media\" | \"target\" | \"download\" | \"ping\" | \"hrefLang\" | \"rel\" | \"referrerPolicy\">> & Pick, \"children\" | \"type\" | \"onClick\" | \"onChange\" | \"color\" | \"id\" | \"title\" | \"placeholder\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDown\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"media\" | \"target\" | \"download\" | \"ping\" | \"hrefLang\" | \"rel\" | \"referrerPolicy\">) | (", + ", Pick, \"children\" | \"type\" | \"onClick\" | \"onChange\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"placeholder\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"media\" | \"target\" | \"download\" | \"ping\" | \"hrefLang\" | \"rel\" | \"referrerPolicy\">> & Pick, \"children\" | \"type\" | \"onClick\" | \"onChange\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"placeholder\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"media\" | \"target\" | \"download\" | \"ping\" | \"hrefLang\" | \"rel\" | \"referrerPolicy\">) | (", "DisambiguateSet", - ", \"children\" | \"type\" | \"onClick\" | \"onChange\" | \"color\" | \"id\" | \"title\" | \"placeholder\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDown\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"media\" | \"target\" | \"download\" | \"ping\" | \"hrefLang\" | \"rel\" | \"referrerPolicy\">, React.ButtonHTMLAttributes> & React.ButtonHTMLAttributes), React.HTMLAttributes> & React.HTMLAttributes) | (", + ", \"children\" | \"type\" | \"onClick\" | \"onChange\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"placeholder\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"media\" | \"target\" | \"download\" | \"ping\" | \"hrefLang\" | \"rel\" | \"referrerPolicy\">, React.ButtonHTMLAttributes> & React.ButtonHTMLAttributes), React.HTMLAttributes> & React.HTMLAttributes) | (", "DisambiguateSet" ], "initialIsOpen": false @@ -2312,7 +2351,7 @@ "description": [], "source": { "path": "x-pack/plugins/observability/server/plugin.ts", - "lineNumber": 22 + "lineNumber": 23 }, "signature": [ "LazyScopedAnnotationsClientFactory" @@ -2321,7 +2360,7 @@ ], "source": { "path": "x-pack/plugins/observability/server/plugin.ts", - "lineNumber": 21 + "lineNumber": 22 }, "lifecycle": "setup", "initialIsOpen": true diff --git a/api_docs/presentation_util.json b/api_docs/presentation_util.json index c0bff9d0447ec6..55204d129800e3 100644 --- a/api_docs/presentation_util.json +++ b/api_docs/presentation_util.json @@ -154,7 +154,7 @@ "section": "def-public.OnSaveProps", "text": "OnSaveProps" }, - " & { dashboardId: string | null; }) => void" + " & { dashboardId: string | null; addToLibrary: boolean; }) => void" ] }, { diff --git a/api_docs/reporting.json b/api_docs/reporting.json index 44050591f71cb8..29d0d485452da4 100644 --- a/api_docs/reporting.json +++ b/api_docs/reporting.json @@ -1823,7 +1823,7 @@ "description": [], "source": { "path": "x-pack/plugins/reporting/server/plugin.ts", - "lineNumber": 30 + "lineNumber": 31 } } ], @@ -1831,7 +1831,7 @@ "returnComment": [], "source": { "path": "x-pack/plugins/reporting/server/plugin.ts", - "lineNumber": 30 + "lineNumber": 31 } }, { @@ -1876,7 +1876,7 @@ "description": [], "source": { "path": "x-pack/plugins/reporting/server/plugin.ts", - "lineNumber": 36 + "lineNumber": 37 } }, { @@ -1895,7 +1895,7 @@ "description": [], "source": { "path": "x-pack/plugins/reporting/server/plugin.ts", - "lineNumber": 36 + "lineNumber": 37 } } ], @@ -1903,7 +1903,7 @@ "returnComment": [], "source": { "path": "x-pack/plugins/reporting/server/plugin.ts", - "lineNumber": 36 + "lineNumber": 37 } }, { @@ -1947,7 +1947,7 @@ "description": [], "source": { "path": "x-pack/plugins/reporting/server/plugin.ts", - "lineNumber": 106 + "lineNumber": 86 } }, { @@ -1966,7 +1966,7 @@ "description": [], "source": { "path": "x-pack/plugins/reporting/server/plugin.ts", - "lineNumber": 106 + "lineNumber": 86 } } ], @@ -1974,13 +1974,13 @@ "returnComment": [], "source": { "path": "x-pack/plugins/reporting/server/plugin.ts", - "lineNumber": 106 + "lineNumber": 86 } } ], "source": { "path": "x-pack/plugins/reporting/server/plugin.ts", - "lineNumber": 24 + "lineNumber": 25 }, "initialIsOpen": false } diff --git a/api_docs/saved_objects.json b/api_docs/saved_objects.json index a3bc4b059c712f..0842bd216383ca 100644 --- a/api_docs/saved_objects.json +++ b/api_docs/saved_objects.json @@ -777,7 +777,7 @@ "section": "def-public.SavedObject", "text": "SavedObject" }, - ", \"id\" | \"title\" | \"getDisplayName\" | \"lastSavedTitle\" | \"copyOnSave\" | \"getEsType\">, isTitleDuplicateConfirmed: boolean, onTitleDuplicate: (() => void) | undefined, services: Pick<", + ", \"title\" | \"id\" | \"getDisplayName\" | \"lastSavedTitle\" | \"copyOnSave\" | \"getEsType\">, isTitleDuplicateConfirmed: boolean, onTitleDuplicate: (() => void) | undefined, services: Pick<", "SavedObjectKibanaServices", ", \"savedObjectsClient\" | \"overlays\">) => Promise" ], @@ -798,7 +798,7 @@ "section": "def-public.SavedObject", "text": "SavedObject" }, - ", \"id\" | \"title\" | \"getDisplayName\" | \"lastSavedTitle\" | \"copyOnSave\" | \"getEsType\">" + ", \"title\" | \"id\" | \"getDisplayName\" | \"lastSavedTitle\" | \"copyOnSave\" | \"getEsType\">" ], "description": [], "source": { diff --git a/api_docs/saved_objects_management.json b/api_docs/saved_objects_management.json index 04164f2849a4b0..8cd47981d4558d 100644 --- a/api_docs/saved_objects_management.json +++ b/api_docs/saved_objects_management.json @@ -332,7 +332,7 @@ "section": "def-server.SavedObjectsImportFailure", "text": "SavedObjectsImportFailure" }, - ", \"type\" | \"id\" | \"title\" | \"meta\" | \"overwrite\">" + ", \"type\" | \"title\" | \"id\" | \"meta\" | \"overwrite\">" ] }, { @@ -837,7 +837,7 @@ "section": "def-common.SavedObjectsManagementRecord", "text": "SavedObjectsManagementRecord" }, - ">, \"children\" | \"headers\" | \"onClick\" | \"onChange\" | \"color\" | \"id\" | \"description\" | \"title\" | \"name\" | \"field\" | \"placeholder\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDown\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"width\" | \"render\" | \"align\" | \"abbr\" | \"footer\" | \"colSpan\" | \"rowSpan\" | \"scope\" | \"valign\" | \"dataType\" | \"isExpander\" | \"textOnly\" | \"truncateText\" | \"isMobileHeader\" | \"mobileOptions\" | \"hideForMobile\">" + ">, \"children\" | \"headers\" | \"onClick\" | \"onChange\" | \"color\" | \"onKeyDown\" | \"description\" | \"title\" | \"id\" | \"name\" | \"field\" | \"placeholder\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"width\" | \"render\" | \"align\" | \"abbr\" | \"footer\" | \"colSpan\" | \"rowSpan\" | \"scope\" | \"valign\" | \"dataType\" | \"isExpander\" | \"textOnly\" | \"truncateText\" | \"isMobileHeader\" | \"mobileOptions\" | \"hideForMobile\">" ] } ], diff --git a/api_docs/saved_objects_tagging.json b/api_docs/saved_objects_tagging.json index 0372b39ba242de..5b09e25344537a 100644 --- a/api_docs/saved_objects_tagging.json +++ b/api_docs/saved_objects_tagging.json @@ -717,7 +717,7 @@ "lineNumber": 20 }, "signature": [ - "Partial>" + "Partial>" ] } ], diff --git a/api_docs/security_solution.json b/api_docs/security_solution.json index cbcd660749f2dd..ae208eb4facc74 100644 --- a/api_docs/security_solution.json +++ b/api_docs/security_solution.json @@ -362,7 +362,7 @@ "label": "config", "isRequired": true, "signature": [ - "Readonly<{} & { enabled: boolean; signalsIndex: string; maxRuleImportExportSize: number; maxRuleImportPayloadBytes: number; maxTimelineImportExportSize: number; maxTimelineImportPayloadBytes: number; endpointResultListDefaultFirstPageIndex: number; endpointResultListDefaultPageSize: number; alertResultListDefaultDateRange: Readonly<{} & { from: string; to: string; }>; packagerTaskInterval: string; validateArtifactDownloads: boolean; }>" + "Readonly<{} & { enabled: boolean; signalsIndex: string; maxRuleImportExportSize: number; maxRuleImportPayloadBytes: number; maxTimelineImportExportSize: number; maxTimelineImportPayloadBytes: number; enableExperimental: string[]; endpointResultListDefaultFirstPageIndex: number; endpointResultListDefaultPageSize: number; alertResultListDefaultDateRange: Readonly<{} & { from: string; to: string; }>; packagerTaskInterval: string; validateArtifactDownloads: boolean; }>" ], "description": [], "source": { @@ -451,7 +451,7 @@ "description": [], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 144 + "lineNumber": 145 } } ], @@ -459,7 +459,7 @@ "returnComment": [], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 144 + "lineNumber": 145 } }, { @@ -536,7 +536,7 @@ "description": [], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 156 + "lineNumber": 157 } }, { @@ -555,7 +555,7 @@ "description": [], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 156 + "lineNumber": 157 } } ], @@ -563,7 +563,7 @@ "returnComment": [], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 156 + "lineNumber": 157 } }, { @@ -607,7 +607,7 @@ "description": [], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 337 + "lineNumber": 338 } }, { @@ -626,7 +626,7 @@ "description": [], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 337 + "lineNumber": 338 } } ], @@ -634,7 +634,7 @@ "returnComment": [], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 337 + "lineNumber": 338 } }, { @@ -650,13 +650,13 @@ "returnComment": [], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 398 + "lineNumber": 404 } } ], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 128 + "lineNumber": 129 }, "initialIsOpen": false } @@ -795,18 +795,17 @@ "type": "Function", "children": [ { - "type": "Function", - "label": "callWithRequest", + "type": "CompoundType", + "label": "esClient", "isRequired": true, "signature": [ { - "pluginId": "security", - "scope": "common", - "docId": "kibSecurityPluginApi", - "section": "def-common.CallWithRequest", - "text": "CallWithRequest" - }, - "<{ path: string; method: \"PUT\"; body: unknown; }, boolean>" + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "description": [], "source": { @@ -829,9 +828,15 @@ } ], "signature": [ - "(callWithRequest: ", - "CallWithRequest", - "<{ path: string; method: \"PUT\"; body: unknown; }, boolean>, index: string) => Promise" + "(esClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, + ", index: string) => Promise" ], "description": [], "label": "createBootstrapIndex", @@ -848,25 +853,22 @@ "type": "Function", "children": [ { - "type": "Function", - "label": "callWithRequest", + "type": "CompoundType", + "label": "esClient", "isRequired": true, "signature": [ { - "pluginId": "security", - "scope": "common", - "docId": "kibSecurityPluginApi", - "section": "def-common.CallWithRequest", - "text": "CallWithRequest" - }, - "<", - "IndicesDeleteParams", - ", Promise>" + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "description": [], "source": { "path": "x-pack/plugins/security_solution/server/lib/detection_engine/index/delete_all_index.ts", - "lineNumber": 12 + "lineNumber": 11 } }, { @@ -879,7 +881,7 @@ "description": [], "source": { "path": "x-pack/plugins/security_solution/server/lib/detection_engine/index/delete_all_index.ts", - "lineNumber": 13 + "lineNumber": 12 } }, { @@ -892,22 +894,26 @@ "description": [], "source": { "path": "x-pack/plugins/security_solution/server/lib/detection_engine/index/delete_all_index.ts", - "lineNumber": 14 + "lineNumber": 13 } } ], "signature": [ - "(callWithRequest: ", - "CallWithRequest", - "<", - "IndicesDeleteParams", - ", Promise>, pattern: string, maxAttempts?: number) => Promise" + "(esClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, + ", pattern: string, maxAttempts?: number) => Promise" ], "description": [], "label": "deleteAllIndex", "source": { "path": "x-pack/plugins/security_solution/server/lib/detection_engine/index/delete_all_index.ts", - "lineNumber": 11 + "lineNumber": 10 }, "tags": [], "returnComment": [], @@ -918,18 +924,17 @@ "type": "Function", "children": [ { - "type": "Function", - "label": "callWithRequest", + "type": "CompoundType", + "label": "esClient", "isRequired": true, "signature": [ { - "pluginId": "security", - "scope": "common", - "docId": "kibSecurityPluginApi", - "section": "def-common.CallWithRequest", - "text": "CallWithRequest" - }, - "<{ path: string; method: \"DELETE\"; }, unknown>" + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "description": [], "source": { @@ -952,9 +957,15 @@ } ], "signature": [ - "(callWithRequest: ", - "CallWithRequest", - "<{ path: string; method: \"DELETE\"; }, unknown>, policy: string) => Promise" + "(esClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, + ", policy: string) => Promise" ], "description": [], "label": "deletePolicy", @@ -971,25 +982,22 @@ "type": "Function", "children": [ { - "type": "Function", - "label": "callWithRequest", + "type": "CompoundType", + "label": "esClient", "isRequired": true, "signature": [ { - "pluginId": "security", - "scope": "common", - "docId": "kibSecurityPluginApi", - "section": "def-common.CallWithRequest", - "text": "CallWithRequest" - }, - "<", - "IndicesDeleteTemplateParams", - ", unknown>" + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "description": [], "source": { "path": "x-pack/plugins/security_solution/server/lib/detection_engine/index/delete_template.ts", - "lineNumber": 12 + "lineNumber": 10 } }, { @@ -1002,22 +1010,26 @@ "description": [], "source": { "path": "x-pack/plugins/security_solution/server/lib/detection_engine/index/delete_template.ts", - "lineNumber": 13 + "lineNumber": 11 } } ], "signature": [ - "(callWithRequest: ", - "CallWithRequest", - "<", - "IndicesDeleteTemplateParams", - ", unknown>, name: string) => Promise" + "(esClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, + ", name: string) => Promise" ], "description": [], "label": "deleteTemplate", "source": { "path": "x-pack/plugins/security_solution/server/lib/detection_engine/index/delete_template.ts", - "lineNumber": 11 + "lineNumber": 9 }, "tags": [], "returnComment": [], @@ -1028,18 +1040,17 @@ "type": "Function", "children": [ { - "type": "Function", - "label": "callWithRequest", + "type": "CompoundType", + "label": "esClient", "isRequired": true, "signature": [ { - "pluginId": "security", - "scope": "common", - "docId": "kibSecurityPluginApi", - "section": "def-common.CallWithRequest", - "text": "CallWithRequest" - }, - "<{ index: string; size: number; terminate_after: number; allow_no_indices: boolean; }, { _shards: { total: number; }; }>" + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "description": [], "source": { @@ -1057,14 +1068,20 @@ "description": [], "source": { "path": "x-pack/plugins/security_solution/server/lib/detection_engine/index/get_index_exists.ts", - "lineNumber": 15 + "lineNumber": 12 } } ], "signature": [ - "(callWithRequest: ", - "CallWithRequest", - "<{ index: string; size: number; terminate_after: number; allow_no_indices: boolean; }, { _shards: { total: number; }; }>, index: string) => Promise" + "(esClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, + ", index: string) => Promise" ], "description": [], "label": "getIndexExists", @@ -1081,18 +1098,17 @@ "type": "Function", "children": [ { - "type": "Function", - "label": "callWithRequest", + "type": "CompoundType", + "label": "esClient", "isRequired": true, "signature": [ { - "pluginId": "security", - "scope": "common", - "docId": "kibSecurityPluginApi", - "section": "def-common.CallWithRequest", - "text": "CallWithRequest" - }, - "<{ path: string; method: \"GET\"; }, unknown>" + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "description": [], "source": { @@ -1115,9 +1131,15 @@ } ], "signature": [ - "(callWithRequest: ", - "CallWithRequest", - "<{ path: string; method: \"GET\"; }, unknown>, policy: string) => Promise" + "(esClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, + ", policy: string) => Promise" ], "description": [], "label": "getPolicyExists", @@ -1134,25 +1156,22 @@ "type": "Function", "children": [ { - "type": "Function", - "label": "callWithRequest", + "type": "CompoundType", + "label": "esClient", "isRequired": true, "signature": [ { - "pluginId": "security", - "scope": "common", - "docId": "kibSecurityPluginApi", - "section": "def-common.CallWithRequest", - "text": "CallWithRequest" - }, - "<", - "IndicesExistsTemplateParams", - ", boolean>" + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "description": [], "source": { "path": "x-pack/plugins/security_solution/server/lib/detection_engine/index/get_template_exists.ts", - "lineNumber": 12 + "lineNumber": 11 } }, { @@ -1165,22 +1184,26 @@ "description": [], "source": { "path": "x-pack/plugins/security_solution/server/lib/detection_engine/index/get_template_exists.ts", - "lineNumber": 13 + "lineNumber": 12 } } ], "signature": [ - "(callWithRequest: ", - "CallWithRequest", - "<", - "IndicesExistsTemplateParams", - ", boolean>, template: string) => Promise" + "(esClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, + ", template: string) => Promise" ], "description": [], "label": "getTemplateExists", "source": { "path": "x-pack/plugins/security_solution/server/lib/detection_engine/index/get_template_exists.ts", - "lineNumber": 11 + "lineNumber": 10 }, "tags": [], "returnComment": [], @@ -1244,18 +1267,17 @@ "type": "Function", "children": [ { - "type": "Function", - "label": "callWithRequest", + "type": "CompoundType", + "label": "esClient", "isRequired": true, "signature": [ { - "pluginId": "security", - "scope": "common", - "docId": "kibSecurityPluginApi", - "section": "def-common.CallWithRequest", - "text": "CallWithRequest" - }, - "<{ path: string; method: \"PUT\"; body: unknown; }, unknown>" + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "description": [], "source": { @@ -1277,11 +1299,11 @@ } }, { - "type": "Unknown", + "type": "Object", "label": "body", "isRequired": true, "signature": [ - "unknown" + "Record" ], "description": [], "source": { @@ -1291,9 +1313,15 @@ } ], "signature": [ - "(callWithRequest: ", - "CallWithRequest", - "<{ path: string; method: \"PUT\"; body: unknown; }, unknown>, policy: string, body: unknown) => Promise" + "(esClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, + ", policy: string, body: Record) => Promise" ], "description": [], "label": "setPolicy", @@ -1310,25 +1338,22 @@ "type": "Function", "children": [ { - "type": "Function", - "label": "callWithRequest", + "type": "CompoundType", + "label": "esClient", "isRequired": true, "signature": [ { - "pluginId": "security", - "scope": "common", - "docId": "kibSecurityPluginApi", - "section": "def-common.CallWithRequest", - "text": "CallWithRequest" - }, - "<", - "IndicesPutTemplateParams", - ", unknown>" + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } ], "description": [], "source": { "path": "x-pack/plugins/security_solution/server/lib/detection_engine/index/set_template.ts", - "lineNumber": 12 + "lineNumber": 11 } }, { @@ -1341,35 +1366,39 @@ "description": [], "source": { "path": "x-pack/plugins/security_solution/server/lib/detection_engine/index/set_template.ts", - "lineNumber": 13 + "lineNumber": 12 } }, { - "type": "Unknown", + "type": "Object", "label": "body", "isRequired": true, "signature": [ - "unknown" + "Record" ], "description": [], "source": { "path": "x-pack/plugins/security_solution/server/lib/detection_engine/index/set_template.ts", - "lineNumber": 14 + "lineNumber": 13 } } ], "signature": [ - "(callWithRequest: ", - "CallWithRequest", - "<", - "IndicesPutTemplateParams", - ", unknown>, name: string, body: unknown) => Promise" + "(esClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, + ", name: string, body: Record) => Promise" ], "description": [], "label": "setTemplate", "source": { "path": "x-pack/plugins/security_solution/server/lib/detection_engine/index/set_template.ts", - "lineNumber": 11 + "lineNumber": 10 }, "tags": [], "returnComment": [], @@ -1463,10 +1492,10 @@ "description": [], "source": { "path": "x-pack/plugins/security_solution/server/config.ts", - "lineNumber": 43 + "lineNumber": 75 }, "signature": [ - "{ readonly enabled: boolean; readonly signalsIndex: string; readonly maxRuleImportExportSize: number; readonly maxRuleImportPayloadBytes: number; readonly maxTimelineImportExportSize: number; readonly maxTimelineImportPayloadBytes: number; readonly endpointResultListDefaultFirstPageIndex: number; readonly endpointResultListDefaultPageSize: number; readonly alertResultListDefaultDateRange: Readonly<{} & { from: string; to: string; }>; readonly packagerTaskInterval: string; readonly validateArtifactDownloads: boolean; }" + "{ readonly enabled: boolean; readonly signalsIndex: string; readonly maxRuleImportExportSize: number; readonly maxRuleImportPayloadBytes: number; readonly maxTimelineImportExportSize: number; readonly maxTimelineImportPayloadBytes: number; readonly enableExperimental: string[]; readonly endpointResultListDefaultFirstPageIndex: number; readonly endpointResultListDefaultPageSize: number; readonly alertResultListDefaultDateRange: Readonly<{} & { from: string; to: string; }>; readonly packagerTaskInterval: string; readonly validateArtifactDownloads: boolean; }" ], "initialIsOpen": false } @@ -1481,7 +1510,7 @@ "children": [], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 105 + "lineNumber": 106 }, "lifecycle": "setup", "initialIsOpen": true @@ -1495,7 +1524,7 @@ "children": [], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 107 + "lineNumber": 108 }, "lifecycle": "start", "initialIsOpen": true @@ -1725,162 +1754,6 @@ "returnComment": [], "initialIsOpen": false }, - { - "id": "def-common.migratePackagePolicyToV7110", - "type": "Function", - "children": [ - { - "type": "CompoundType", - "label": "packagePolicyDoc", - "isRequired": true, - "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreSavedObjectsPluginApi", - "section": "def-server.SavedObjectUnsanitizedDoc", - "text": "SavedObjectUnsanitizedDoc" - }, - "<", - { - "pluginId": "fleet", - "scope": "common", - "docId": "kibFleetPluginApi", - "section": "def-common.PackagePolicy", - "text": "PackagePolicy" - }, - ">" - ], - "description": [], - "source": { - "path": "x-pack/plugins/security_solution/common/endpoint/policy/migrations/to_v7_11_0.ts", - "lineNumber": 13 - } - } - ], - "signature": [ - "(packagePolicyDoc: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreSavedObjectsPluginApi", - "section": "def-server.SavedObjectUnsanitizedDoc", - "text": "SavedObjectUnsanitizedDoc" - }, - "<", - { - "pluginId": "fleet", - "scope": "common", - "docId": "kibFleetPluginApi", - "section": "def-common.PackagePolicy", - "text": "PackagePolicy" - }, - ">) => ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreSavedObjectsPluginApi", - "section": "def-server.SavedObjectUnsanitizedDoc", - "text": "SavedObjectUnsanitizedDoc" - }, - "<", - { - "pluginId": "fleet", - "scope": "common", - "docId": "kibFleetPluginApi", - "section": "def-common.PackagePolicy", - "text": "PackagePolicy" - }, - ">" - ], - "description": [], - "label": "migratePackagePolicyToV7110", - "source": { - "path": "x-pack/plugins/security_solution/common/endpoint/policy/migrations/to_v7_11_0.ts", - "lineNumber": 12 - }, - "tags": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "id": "def-common.migratePackagePolicyToV7120", - "type": "Function", - "children": [ - { - "type": "CompoundType", - "label": "packagePolicyDoc", - "isRequired": true, - "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreSavedObjectsPluginApi", - "section": "def-server.SavedObjectUnsanitizedDoc", - "text": "SavedObjectUnsanitizedDoc" - }, - "<", - { - "pluginId": "fleet", - "scope": "common", - "docId": "kibFleetPluginApi", - "section": "def-common.PackagePolicy", - "text": "PackagePolicy" - }, - ">" - ], - "description": [], - "source": { - "path": "x-pack/plugins/security_solution/common/endpoint/policy/migrations/to_v7_12_0.ts", - "lineNumber": 14 - } - } - ], - "signature": [ - "(packagePolicyDoc: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreSavedObjectsPluginApi", - "section": "def-server.SavedObjectUnsanitizedDoc", - "text": "SavedObjectUnsanitizedDoc" - }, - "<", - { - "pluginId": "fleet", - "scope": "common", - "docId": "kibFleetPluginApi", - "section": "def-common.PackagePolicy", - "text": "PackagePolicy" - }, - ">) => ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreSavedObjectsPluginApi", - "section": "def-server.SavedObjectUnsanitizedDoc", - "text": "SavedObjectUnsanitizedDoc" - }, - "<", - { - "pluginId": "fleet", - "scope": "common", - "docId": "kibFleetPluginApi", - "section": "def-common.PackagePolicy", - "text": "PackagePolicy" - }, - ">" - ], - "description": [], - "label": "migratePackagePolicyToV7120", - "source": { - "path": "x-pack/plugins/security_solution/common/endpoint/policy/migrations/to_v7_12_0.ts", - "lineNumber": 13 - }, - "tags": [], - "returnComment": [], - "initialIsOpen": false - }, { "id": "def-common.removeExternalLinkText", "type": "Function", diff --git a/api_docs/telemetry_collection_xpack.json b/api_docs/telemetry_collection_xpack.json index 6f651ecf212f40..cf1b1a5998553b 100644 --- a/api_docs/telemetry_collection_xpack.json +++ b/api_docs/telemetry_collection_xpack.json @@ -41,6 +41,17 @@ "lineNumber": 13 } }, + { + "tags": [], + "id": "def-server.ESLicense.hkey", + "type": "string", + "label": "hkey", + "description": [], + "source": { + "path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts", + "lineNumber": 14 + } + }, { "tags": [], "id": "def-server.ESLicense.type", @@ -49,7 +60,7 @@ "description": [], "source": { "path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts", - "lineNumber": 14 + "lineNumber": 15 } }, { @@ -60,7 +71,7 @@ "description": [], "source": { "path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts", - "lineNumber": 15 + "lineNumber": 16 } }, { @@ -71,7 +82,7 @@ "description": [], "source": { "path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts", - "lineNumber": 16 + "lineNumber": 17 } }, { @@ -82,18 +93,18 @@ "description": [], "source": { "path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts", - "lineNumber": 17 + "lineNumber": 18 } }, { "tags": [], - "id": "def-server.ESLicense.expirty_date_in_millis", + "id": "def-server.ESLicense.expiry_date_in_millis", "type": "number", - "label": "expirty_date_in_millis", + "label": "expiry_date_in_millis", "description": [], "source": { "path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts", - "lineNumber": 18 + "lineNumber": 19 } }, { @@ -104,7 +115,7 @@ "description": [], "source": { "path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts", - "lineNumber": 19 + "lineNumber": 20 } }, { @@ -115,7 +126,7 @@ "description": [], "source": { "path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts", - "lineNumber": 20 + "lineNumber": 21 } }, { @@ -126,7 +137,7 @@ "description": [], "source": { "path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts", - "lineNumber": 21 + "lineNumber": 22 } }, { @@ -137,7 +148,18 @@ "description": [], "source": { "path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts", - "lineNumber": 22 + "lineNumber": 23 + } + }, + { + "tags": [], + "id": "def-server.ESLicense.max_resource_units", + "type": "number", + "label": "max_resource_units", + "description": [], + "source": { + "path": "x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_license.ts", + "lineNumber": 24 } } ], diff --git a/api_docs/triggers_actions_ui.json b/api_docs/triggers_actions_ui.json index 147abd0831e9b5..245ead8a4d0e4c 100644 --- a/api_docs/triggers_actions_ui.json +++ b/api_docs/triggers_actions_ui.json @@ -746,8 +746,8 @@ "label": "http", "description": [], "source": { - "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/action_connector_api.ts", - "lineNumber": 13 + "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/action_connector_api/connector_types.ts", + "lineNumber": 29 }, "signature": [ { @@ -761,16 +761,16 @@ } ], "source": { - "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/action_connector_api.ts", - "lineNumber": 13 + "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/action_connector_api/connector_types.ts", + "lineNumber": 29 } } ], "tags": [], "returnComment": [], "source": { - "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/action_connector_api.ts", - "lineNumber": 13 + "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/action_connector_api/connector_types.ts", + "lineNumber": 29 }, "initialIsOpen": false }, diff --git a/api_docs/vis_type_timeseries.json b/api_docs/vis_type_timeseries.json index 907ced500294ac..6f349cb3dfb936 100644 --- a/api_docs/vis_type_timeseries.json +++ b/api_docs/vis_type_timeseries.json @@ -37,7 +37,7 @@ { "pluginId": "data", "scope": "server", - "docId": "kibDataSearchPluginApi", + "docId": "kibDataPluginApi", "section": "def-server.DataRequestHandlerContext", "text": "DataRequestHandlerContext" }, diff --git a/api_docs/visualizations.json b/api_docs/visualizations.json index d66aa8b8cbe679..b85d424a97bdeb 100644 --- a/api_docs/visualizations.json +++ b/api_docs/visualizations.json @@ -514,7 +514,7 @@ "section": "def-common.VisParams", "text": "VisParams" }, - ">, \"type\" | \"id\" | \"description\" | \"title\" | \"params\" | \"uiState\"> & Pick<{ data: Partial<", + ">, \"type\" | \"description\" | \"title\" | \"id\" | \"params\" | \"uiState\"> & Pick<{ data: Partial<", { "pluginId": "visualizations", "scope": "public", @@ -530,7 +530,7 @@ "section": "def-public.SerializedVisData", "text": "SerializedVisData" }, - ">; }, never>, \"type\" | \"id\" | \"data\" | \"description\" | \"title\" | \"params\" | \"uiState\">) => Promise" + ">; }, never>, \"type\" | \"data\" | \"description\" | \"title\" | \"id\" | \"params\" | \"uiState\">) => Promise" ], "description": [], "children": [ @@ -555,7 +555,7 @@ "section": "def-common.VisParams", "text": "VisParams" }, - ">, \"type\" | \"id\" | \"description\" | \"title\" | \"params\" | \"uiState\"> & Pick<{ data: Partial<", + ">, \"type\" | \"description\" | \"title\" | \"id\" | \"params\" | \"uiState\"> & Pick<{ data: Partial<", { "pluginId": "visualizations", "scope": "public", @@ -571,7 +571,7 @@ "section": "def-public.SerializedVisData", "text": "SerializedVisData" }, - ">; }, never>, \"type\" | \"id\" | \"data\" | \"description\" | \"title\" | \"params\" | \"uiState\">" + ">; }, never>, \"type\" | \"data\" | \"description\" | \"title\" | \"id\" | \"params\" | \"uiState\">" ], "description": [], "source": { diff --git a/dev_docs/assets/product_stages.png b/dev_docs/assets/product_stages.png new file mode 100644 index 00000000000000..d62c5570d0dde0 Binary files /dev/null and b/dev_docs/assets/product_stages.png differ diff --git a/dev_docs/best_practices.mdx b/dev_docs/best_practices.mdx new file mode 100644 index 00000000000000..6156c051972893 --- /dev/null +++ b/dev_docs/best_practices.mdx @@ -0,0 +1,148 @@ +--- +id: kibBestPractices +slug: /kibana-dev-docs/best-practices +title: Best practices +summary: Best practices to follow when building a Kibana plugin. +date: 2021-03-17 +tags: ['kibana', 'onboarding', 'dev', 'architecture'] +--- + +## General + +First things first, be sure to review our and check out all the available +platform that can simplify plugin development. + +## Performance + +Build with scalability in mind. + +- Consider data with many fields +- Consider data with high cardinality fields +- Consider large data sets, that span a long time range +- Consider slow internet and low bandwidth environments + +## Accessibility + +Did you know Kibana makes a public statement about our commitment to creating an accessible product for people +with disabilities? [We do](https://www.elastic.co/guide/en/kibana/master/accessibility.html)! It's very important +all of our apps are accessible. + +- Learn how [EUI tackles accessibility](https://elastic.github.io/eui/#/guidelines/accessibility) +- If you don't use EUI, follow the same EUI accessibility standards + + + Elasticians, check out the #accessibility channel to ask questions and receive guidance. + + +## Localization + +Kibana is translated into other languages. Use our i18n utilities to ensure your public facing strings will be translated to ensure all Kibana apps are localized. Read and adhere to our [i18n guidelines](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/GUIDELINE.md) + + + Elasticians, check out the #kibana-localization channel to ask questions and receive guidance. + + +## Styleguide + +We use es-lint rules when possible, but please review our [styleguide](https://github.com/elastic/kibana/blob/master/STYLEGUIDE.md), which includes recommendations that can't be linted on. + +Es-lint overrides on a per-plugin level are discouraged. + +## Plugin best practices + +Don't export without reason. Make your public APIs as small as possible. You will have to maintain them, and consider backward compatibility when making changes. + +Add `README.md` to all your plugins and services and include contact information. + +## Re-inventing the wheel + +Over-refactoring can be a problem in it's own right, but it's still important to be aware of the existing services that are out there and use them when it makes sense. Check out our to see what high-level services are at your disposal. In addition, our lists additional services. + +## Feature development + +### Timing + + + +Try not to put your PR in review mode, or merge large changes, right before Feature Freeze. It's inevitably one of the most volatile times for the +Kibana code base, try not to contribute to this volatility. Doing this can: + +- increase the likelyhood of conflicts from other features being merged at the last minute +- means your feature has less QA time +- means your feature gets less careful review as reviewers are often swamped at this time + +All of the above contributes to more bugs being found in the QA cycle and can cause a delay in the release. Prefer instead to merge +your large change right _after_ feature freeze. If you are worried about missing your initial release version goals, review our +[release train philophy](https://github.com/elastic/dev/blob/master/shared/time-based-releases.md). It's okay! + + + +### Size + +When possible, build features with incrementals sets of small and focused PRs, but don't check in unused code, and don't expose any feature on master that you would not be comfortable releasing. + +![product_stages](./assets/product_stages.png) + +If your feature cannot be broken down into smaller components, or multiple engineers will be contributing, you have a few other options to consider. + +**1. Hide your feature behind a feature flag** + +Features can be merged behind a flag if you are not ready to make them the default experience, but all code should still be tested, complete and bug free. + +A good question to ask yourself is, how will you feel if a customer turns this feature on? Is it usable, even if not up to the +level of something we would market? It should have some level of minimal utility. + +Another question to ask yourself is, if this feature gets cancelled, how difficult will it be to remove? + +**2. Develop on a feature branch** + +This option is useful if you have more than one contributor working on a large feature. The downside is handling code conflicts when rebasing with the main branch. + +Consider how you want to handle the PR review. Reviewing each PR going into the feature branch can lighten the review process when merging into the main branch. + +**3. Use an example plugin** + +If you are building a service for developers, create an [example plugin](https://github.com/elastic/kibana/tree/master/examples) to showcase and test intended usage. This is a great way for reviewers and PMs to play around with a feature through the UI, before the production UI is ready. This can also help developers consuming your services get hands on. + +## Embrace the monorepo + +Kibana uses a monorepo and our processes and tooling are built around this decision. Utilizing a monorepo allows us to have a consistent peer review process and enforce the same code quality standards across all of Kibana's code. It also eliminates the necessity to have separate versioning strategies and constantly coordinate changes across repos. + +When experimenting with code, it's completely fine to create a separate GitHub repo to use for initial development. Once the code has matured to a point where it's ready to be used within Kibana, it should be integrated into the Kibana GitHub repo. + +There are some exceptions where a separate repo makes sense. However, they are exceptions to the rule. A separate repo has proven beneficial when there's a dedicated team collaborating on a package which has multiple consumers, for example [EUI](https://github.com/elastic/eui). + +It may be tempting to get caught up in the dream of writing the next package which is published to npm and downloaded millions of times a week. Knowing the quality of developers that are working on Kibana, this is a real possibility. However, knowing which packages will see mass adoption is impossible to predict. Instead of jumping directly to writing code in a separate repo and accepting all of the complications that come along with it, prefer keeping code inside the Kibana repo. A [Kibana package](https://github.com/elastic/kibana/tree/master/packages) can be used to publish a package to npm, while still keeping the code inside the Kibana repo. Move code to an external repo only when there is a good reason, for example to enable external contributions. + +## Hardening + +Review the following items related to vulnerability and security risks. + +- XSS + - Check for usages of `dangerouslySetInnerHtml`, `Element.innerHTML`, `Element.outerHTML` + - Ensure all user input is properly escaped. + - Ensure any input in `$.html`, `$.append`, `$.appendTo`, $.prepend`, `$.prependTo`is escaped. Instead use`$.text`, or don't use jQuery at all. +- CSRF + - Ensure all APIs are running inside the Kibana HTTP service. +- RCE + - Ensure no usages of `eval` + - Ensure no usages of dynamic requires + - Check for template injection + - Check for usages of templating libraries, including `_.template`, and ensure that user provided input isn't influencing the template and is only used as data for rendering the template. + - Check for possible prototype pollution. +- Prototype Pollution - more info [here](https://docs.google.com/document/d/19V-d9sb6IF-fbzF4iyiPpAropQNydCnoJApzSX5FdcI/edit?usp=sharing) + - Check for instances of `anObject[a][b] = c` where a, b, and c are user defined. This includes code paths where the following logical code steps could be performed in separate files by completely different operations, or recursively using dynamic operations. + - Validate any user input, including API url-parameters/query-parameters/payloads, preferable against a schema which only allows specific keys/values. At a very minimum, black-list `__proto__` and `prototype.constructor` for use within keys + - When calling APIs which spawn new processes or potentially perform code generation from strings, defensively protect against Prototype Pollution by checking `Object.hasOwnProperty` if the arguments to the APIs originate from an Object. An example is the Code app's [spawnProcess](https://github.com/elastic/kibana/blob/b49192626a8528af5d888545fb14cd1ce66a72e7/x-pack/legacy/plugins/code/server/lsp/workspace_command.ts#L40-L44). + - Common Node.js offenders: `child_process.spawn`, `child_process.exec`, `eval`, `Function('some string')`, `vm.runIn*Context(x)` + - Common Client-side offenders: `eval`, `Function('some string')`, `setTimeout('some string', num)`, `setInterval('some string', num)` +- Check for accidental reveal of sensitive information + - The biggest culprit is errors which contain stack traces or other sensitive information which end up in the HTTP Response +- Checked for Mishandled API requests + - Ensure no sensitive cookies are forwarded to external resources. + - Ensure that all user controllable variables that are used in constructing a URL are escaped properly. This is relevant when using `transport.request` with the Elasticsearch client as no automatic escaping is performed. +- Reverse tabnabbing - https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/HTML5_Security_Cheat_Sheet.md#tabnabbing + - When there are user controllable links or hard-coded links to third-party domains that specify target="\_blank" or target="\_window", the `a` tag should have the rel="noreferrer noopener" attribute specified. + - Allowing users to input markdown is a common culprit, a custom link renderer should be used +- SSRF - https://www.owasp.org/index.php/Server_Side_Request_Forgery + - All network requests made from the Kibana server should use an explicit configuration or white-list specified in the `kibana.yml` diff --git a/docs/api/session-management.asciidoc b/docs/api/session-management.asciidoc new file mode 100644 index 00000000000000..7ac8b9dddcdbbb --- /dev/null +++ b/docs/api/session-management.asciidoc @@ -0,0 +1,9 @@ +[role="xpack"] +[[session-management-api]] +== User session management APIs + +The following <> management APIs are available: + +* <> to invalidate user sessions + +include::session-management/invalidate.asciidoc[] diff --git a/docs/api/session-management/invalidate.asciidoc b/docs/api/session-management/invalidate.asciidoc new file mode 100644 index 00000000000000..c3dced17e72b7d --- /dev/null +++ b/docs/api/session-management/invalidate.asciidoc @@ -0,0 +1,114 @@ +[[session-management-api-invalidate]] +=== Invalidate user sessions API +++++ +Invalidate user sessions +++++ + +experimental[] Invalidates user sessions that match provided query. + +[[session-management-api-invalidate-prereqs]] +==== Prerequisite + +To use the invalidate user sessions API, you must be a `superuser`. + +[[session-management-api-invalidate-request]] +==== Request + +`POST :/api/security/session/_invalidate` + +[role="child_attributes"] +[[session-management-api-invalidate-request-body]] +==== Request body + +`match`:: +(Required, string) Specifies how {kib} determines which sessions to invalidate. Can either be `all` to invalidate all existing sessions, or `query` to only invalidate sessions that match the query specified in the additional `query` parameter. + +`query`:: +(Optional, object) Specifies the query that {kib} uses to match the sessions to invalidate when the `match` parameter is set to `query`. You cannot use this parameter if `match` is set to `all`. ++ +.Properties of `query` +[%collapsible%open] +===== +`provider` ::: +(Required, object) Describes the <> for which to invalidate sessions. + +`type` :::: +(Required, string) The authentication provider `type`. + +`name` :::: +(Optional, string) The authentication provider `name`. + +`username` ::: +(Optional, string) The username for which to invalidate sessions. +===== + +[[session-management-api-invalidate-response-body]] +==== Response body + +`total`:: +(number) The number of successfully invalidated sessions. + +[[session-management-api-invalidate-response-codes]] +==== Response codes + +`200`:: + Indicates a successful call. + +`403`:: + Indicates that the user may not be authorized to invalidate sessions for other users. Refer to <>. + +==== Examples + +Invalidate all existing sessions: + +[source,sh] +-------------------------------------------------- +$ curl -X POST api/security/session/_invalidate +{ + "match" : "all" +} +-------------------------------------------------- +// KIBANA + +Invalidate sessions that were created by any <>: + +[source,sh] +-------------------------------------------------- +$ curl -X POST api/security/session/_invalidate +{ + "match" : "query", + "query": { + "provider" : { "type": "saml" } + } +} +-------------------------------------------------- +// KIBANA + +Invalidate sessions that were created by the <> with the name `saml1`: + +[source,sh] +-------------------------------------------------- +$ curl -X POST api/security/session/_invalidate +{ + "match" : "query", + "query": { + "provider" : { "type": "saml", "name": "saml1" } + } +} +-------------------------------------------------- +// KIBANA + +Invalidate sessions that were created by any <> for the user with the username `user@my-oidc-sso.com`: + +[source,sh] +-------------------------------------------------- +$ curl -X POST api/security/session/_invalidate +{ + "match" : "query", + "query": { + "provider" : { "type": "oidc" }, + "username": "user@my-oidc-sso.com" + } +} +-------------------------------------------------- +// KIBANA diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.aggfunctionsmapping.aggfilteredmetric.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.aggfunctionsmapping.aggfilteredmetric.md new file mode 100644 index 00000000000000..71e3e025b931df --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.aggfunctionsmapping.aggfilteredmetric.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [AggFunctionsMapping](./kibana-plugin-plugins-data-public.aggfunctionsmapping.md) > [aggFilteredMetric](./kibana-plugin-plugins-data-public.aggfunctionsmapping.aggfilteredmetric.md) + +## AggFunctionsMapping.aggFilteredMetric property + +Signature: + +```typescript +aggFilteredMetric: ReturnType; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.aggfunctionsmapping.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.aggfunctionsmapping.md index b175b8d473d34b..05388e2b86d7b5 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.aggfunctionsmapping.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.aggfunctionsmapping.md @@ -28,6 +28,7 @@ export interface AggFunctionsMapping | [aggDateRange](./kibana-plugin-plugins-data-public.aggfunctionsmapping.aggdaterange.md) | ReturnType<typeof aggDateRange> | | | [aggDerivative](./kibana-plugin-plugins-data-public.aggfunctionsmapping.aggderivative.md) | ReturnType<typeof aggDerivative> | | | [aggFilter](./kibana-plugin-plugins-data-public.aggfunctionsmapping.aggfilter.md) | ReturnType<typeof aggFilter> | | +| [aggFilteredMetric](./kibana-plugin-plugins-data-public.aggfunctionsmapping.aggfilteredmetric.md) | ReturnType<typeof aggFilteredMetric> | | | [aggFilters](./kibana-plugin-plugins-data-public.aggfunctionsmapping.aggfilters.md) | ReturnType<typeof aggFilters> | | | [aggGeoBounds](./kibana-plugin-plugins-data-public.aggfunctionsmapping.agggeobounds.md) | ReturnType<typeof aggGeoBounds> | | | [aggGeoCentroid](./kibana-plugin-plugins-data-public.aggfunctionsmapping.agggeocentroid.md) | ReturnType<typeof aggGeoCentroid> | | diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.metric_types.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.metric_types.md index 637717692a38c1..3b5cecf1a0b82a 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.metric_types.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.metric_types.md @@ -20,6 +20,7 @@ export declare enum METRIC_TYPES | COUNT | "count" | | | CUMULATIVE\_SUM | "cumulative_sum" | | | DERIVATIVE | "derivative" | | +| FILTERED\_METRIC | "filtered_metric" | | | GEO\_BOUNDS | "geo_bounds" | | | GEO\_CENTROID | "geo_centroid" | | | MAX | "max" | | diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.aggfunctionsmapping.aggfilteredmetric.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.aggfunctionsmapping.aggfilteredmetric.md new file mode 100644 index 00000000000000..9885a0afa40c6a --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.aggfunctionsmapping.aggfilteredmetric.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [AggFunctionsMapping](./kibana-plugin-plugins-data-server.aggfunctionsmapping.md) > [aggFilteredMetric](./kibana-plugin-plugins-data-server.aggfunctionsmapping.aggfilteredmetric.md) + +## AggFunctionsMapping.aggFilteredMetric property + +Signature: + +```typescript +aggFilteredMetric: ReturnType; +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.aggfunctionsmapping.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.aggfunctionsmapping.md index f059bb2914847e..86bf797572b09b 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.aggfunctionsmapping.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.aggfunctionsmapping.md @@ -28,6 +28,7 @@ export interface AggFunctionsMapping | [aggDateRange](./kibana-plugin-plugins-data-server.aggfunctionsmapping.aggdaterange.md) | ReturnType<typeof aggDateRange> | | | [aggDerivative](./kibana-plugin-plugins-data-server.aggfunctionsmapping.aggderivative.md) | ReturnType<typeof aggDerivative> | | | [aggFilter](./kibana-plugin-plugins-data-server.aggfunctionsmapping.aggfilter.md) | ReturnType<typeof aggFilter> | | +| [aggFilteredMetric](./kibana-plugin-plugins-data-server.aggfunctionsmapping.aggfilteredmetric.md) | ReturnType<typeof aggFilteredMetric> | | | [aggFilters](./kibana-plugin-plugins-data-server.aggfunctionsmapping.aggfilters.md) | ReturnType<typeof aggFilters> | | | [aggGeoBounds](./kibana-plugin-plugins-data-server.aggfunctionsmapping.agggeobounds.md) | ReturnType<typeof aggGeoBounds> | | | [aggGeoCentroid](./kibana-plugin-plugins-data-server.aggfunctionsmapping.agggeocentroid.md) | ReturnType<typeof aggGeoCentroid> | | diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternsserviceprovider.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternsserviceprovider.md index 698b4bc7f20434..d408f00e33c9e8 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternsserviceprovider.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpatternsserviceprovider.md @@ -14,6 +14,6 @@ export declare class IndexPatternsServiceProvider implements PluginSignature: ```typescript -setup(core: CoreSetup, { logger, expressions }: IndexPatternsServiceSetupDeps): void; +setup(core: CoreSetup, { expressions }: IndexPatternsServiceSetupDeps): void; ``` ## Parameters @@ -15,7 +15,7 @@ setup(core: CoreSetup, { logger, e | Parameter | Type | Description | | --- | --- | --- | | core | CoreSetup<DataPluginStartDependencies, DataPluginStart> | | -| { logger, expressions } | IndexPatternsServiceSetupDeps | | +| { expressions } | IndexPatternsServiceSetupDeps | | Returns: diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.md index 16d9ce457603eb..e0734bc017f4f5 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.md @@ -109,5 +109,6 @@ | [KibanaContext](./kibana-plugin-plugins-data-server.kibanacontext.md) | | | [ParsedInterval](./kibana-plugin-plugins-data-server.parsedinterval.md) | | | [Query](./kibana-plugin-plugins-data-server.query.md) | | +| [SearchRequestHandlerContext](./kibana-plugin-plugins-data-server.searchrequesthandlercontext.md) | | | [TimeRange](./kibana-plugin-plugins-data-server.timerange.md) | | diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.metric_types.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.metric_types.md index 49df98b6d70a19..250173d11a056d 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.metric_types.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.metric_types.md @@ -20,6 +20,7 @@ export declare enum METRIC_TYPES | COUNT | "count" | | | CUMULATIVE\_SUM | "cumulative_sum" | | | DERIVATIVE | "derivative" | | +| FILTERED\_METRIC | "filtered_metric" | | | GEO\_BOUNDS | "geo_bounds" | | | GEO\_CENTROID | "geo_centroid" | | | MAX | "max" | | diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.searchrequesthandlercontext.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.searchrequesthandlercontext.md new file mode 100644 index 00000000000000..f031ddfbd09af7 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.searchrequesthandlercontext.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [SearchRequestHandlerContext](./kibana-plugin-plugins-data-server.searchrequesthandlercontext.md) + +## SearchRequestHandlerContext type + +Signature: + +```typescript +export declare type SearchRequestHandlerContext = IScopedSearchClient; +``` diff --git a/docs/management/advanced-options.asciidoc b/docs/management/advanced-options.asciidoc index 5c27a7bdacdeee..446b6a2cfd8519 100644 --- a/docs/management/advanced-options.asciidoc +++ b/docs/management/advanced-options.asciidoc @@ -457,7 +457,7 @@ Enables the legacy charts library for aggregation-based area, line, and bar char [[visualization-colormapping]]`visualization:colorMapping`:: **This setting is deprecated and will not be supported as of 8.0.** -Maps values to specific colors in *Visualize* charts and *TSVB*. This setting does not apply to *Lens*. +Maps values to specific colors in charts using the *Compatibility* palette. [[visualization-dimmingopacity]]`visualization:dimmingOpacity`:: The opacity of the chart items that are dimmed when highlighting another element diff --git a/docs/user/api.asciidoc b/docs/user/api.asciidoc index 459dbbdd34b279..c41f3d8a829e4b 100644 --- a/docs/user/api.asciidoc +++ b/docs/user/api.asciidoc @@ -97,6 +97,7 @@ curl -X POST \ include::{kib-repo-dir}/api/features.asciidoc[] include::{kib-repo-dir}/api/spaces-management.asciidoc[] include::{kib-repo-dir}/api/role-management.asciidoc[] +include::{kib-repo-dir}/api/session-management.asciidoc[] include::{kib-repo-dir}/api/saved-objects.asciidoc[] include::{kib-repo-dir}/api/alerts.asciidoc[] include::{kib-repo-dir}/api/actions-and-connectors.asciidoc[] diff --git a/docs/user/dashboard/timelion.asciidoc b/docs/user/dashboard/timelion.asciidoc index 941f78168ecf71..676c46368a6ee4 100644 --- a/docs/user/dashboard/timelion.asciidoc +++ b/docs/user/dashboard/timelion.asciidoc @@ -13,7 +13,7 @@ dashboard features. In 8.0 and later, the *Timelion app* is removed from {kib}. To prepare for the removal of *Timelion app*, you must migrate *Timelion app* worksheets to a dashboard. For information on how to migrate *Timelion app* worksheets, refer to the -link:https://www.elastic.co/guide/en/kibana/current/release-notes-7.10.0.html#deprecation-v7.10.0[7.10.0 Release Notes]. +link:https://www.elastic.co/guide/en/kibana/7.10/release-notes-7.10.0.html#deprecation-v7.10.0[7.10.0 Release Notes]. ==== [float] diff --git a/docs/user/production-considerations/production.asciidoc b/docs/user/production-considerations/production.asciidoc index 8802719f95a957..726747d5d69d0e 100644 --- a/docs/user/production-considerations/production.asciidoc +++ b/docs/user/production-considerations/production.asciidoc @@ -10,6 +10,7 @@ * <> * <> * <> +* <> * <> * <> @@ -56,6 +57,7 @@ protections. To do this, set `csp.strict` to `true` in your `kibana.yml`: +[source,js] -------- csp.strict: true -------- @@ -82,6 +84,7 @@ To use a local client node to load balance Kibana requests: . Install Elasticsearch on the same machine as Kibana. . Configure the node as a Coordinating only node. In `elasticsearch.yml`, set `node.data`, `node.master` and `node.ingest` to `false`: + +[source,js] -------- # 3. You want this node to be neither master nor data node nor ingest node, but # to act as a "search load balancer" (fetching data from nodes, @@ -94,11 +97,13 @@ node.ingest: false . Configure the client node to join your Elasticsearch cluster. In `elasticsearch.yml`, set the `cluster.name` to the name of your cluster. + +[source,js] -------- cluster.name: "my_cluster" -------- . Check your transport and HTTP host configs in `elasticsearch.yml` under `network.host` and `transport.host`. The `transport.host` needs to be on the network reachable to the cluster members, the `network.host` is the network for the HTTP connection for Kibana (localhost:9200 by default). + +[source,js] -------- network.host: localhost http.port: 9200 @@ -110,6 +115,7 @@ transport.tcp.port: 9300 - 9400 . Make sure Kibana is configured to point to your local client node. In `kibana.yml`, the `elasticsearch.hosts` setting should be set to `["localhost:9200"]`. + +[source,js] -------- # The Elasticsearch instance to use for all your queries. elasticsearch.hosts: ["http://localhost:9200"] @@ -121,12 +127,14 @@ elasticsearch.hosts: ["http://localhost:9200"] To serve multiple Kibana installations behind a load balancer, you must change the configuration. See {kibana-ref}/settings.html[Configuring Kibana] for details on each setting. Settings unique across each Kibana instance: +[source,js] -------- server.uuid server.name -------- Settings unique across each host (for example, running multiple installations on the same virtual machine): +[source,js] -------- logging.dest path.data @@ -135,6 +143,7 @@ server.port -------- Settings that must be the same: +[source,js] -------- xpack.security.encryptionKey //decrypting session information xpack.reporting.encryptionKey //decrypting reports @@ -143,11 +152,24 @@ xpack.encryptedSavedObjects.keyRotation.decryptionOnlyKeys // saved objects encr -------- Separate configuration files can be used from the command line by using the `-c` flag: +[source,js] -------- bin/kibana -c config/instance1.yml bin/kibana -c config/instance2.yml -------- +[float] +[[accessing-load-balanced-kibana]] +=== Accessing multiple load-balanced {kib} clusters + +To access multiple load-balanced {kib} clusters from the same browser, +set `xpack.security.cookieName` in the configuration. +This avoids conflicts between cookies from the different {kib} instances. + +In each cluster, {kib} instances should have the same `cookieName` +value. This will achieve seamless high availability and keep the session +active in case of failure from the currently used instance. + [float] [[high-availability]] === High availability across multiple {es} nodes @@ -157,6 +179,7 @@ Kibana will transparently connect to an available node and continue operating. Currently the Console application is limited to connecting to the first node listed. In kibana.yml: +[source,js] -------- elasticsearch.hosts: - http://elasticsearch1:9200 @@ -175,6 +198,7 @@ it may make sense to tweak limits to meet more specific requirements. You can modify this limit by setting `--max-old-space-size` in the `node.options` config file that can be found inside `kibana/config` folder or any other configured with the environment variable `KBN_PATH_CONF` (for example in debian based system would be `/etc/kibana`). The option accepts a limit in MB: +[source,js] -------- --max-old-space-size=2048 -------- diff --git a/docs/user/security/authentication/index.asciidoc b/docs/user/security/authentication/index.asciidoc index b2d85de91b9fcd..a4acc93310e5db 100644 --- a/docs/user/security/authentication/index.asciidoc +++ b/docs/user/security/authentication/index.asciidoc @@ -397,6 +397,14 @@ NOTE: *Public URL* is available only when anonymous access is configured and you + For more information, refer to <>. +[float] +[[anonymous-access-session]] +===== Anonymous access session + +{kib} maintains a separate <> for every anonymous user, as it does for all other authentication mechanisms. + +You can configure <> and <> for anonymous sessions the same as you do for any other session with the exception that idle timeout is explicitly disabled for anonymous sessions by default. The global <> setting doesn't affect anonymous sessions. To change the idle timeout for anonymous sessions, you must configure the provider-level <.session.idleTimeout`>> setting. + [[http-authentication]] ==== HTTP authentication diff --git a/docs/user/security/session-management.asciidoc b/docs/user/security/session-management.asciidoc index 0df5b3b31a2033..ac7a777eb05807 100644 --- a/docs/user/security/session-management.asciidoc +++ b/docs/user/security/session-management.asciidoc @@ -6,6 +6,8 @@ When you log in, {kib} creates a session that is used to authenticate subsequent When your session expires, or you log out, {kib} will invalidate your cookie and remove session information from the index. {kib} also periodically invalidates and removes any expired sessions that weren't explicitly invalidated. +To manage user sessions programmatically, {kib} exposes <>. + [[session-idle-timeout]] ==== Session idle timeout diff --git a/package.json b/package.json index 32cf8dc1aee0f3..7cb6a505eeafe4 100644 --- a/package.json +++ b/package.json @@ -697,6 +697,7 @@ "jest-cli": "^26.6.3", "jest-diff": "^26.6.2", "jest-environment-jsdom-thirteen": "^1.0.1", + "jest-environment-jsdom": "^26.6.2", "jest-raw-loader": "^1.0.1", "jest-silent-reporter": "^0.2.1", "jest-snapshot": "^26.6.2", diff --git a/packages/kbn-test/jest-preset.js b/packages/kbn-test/jest-preset.js index a1475985af8df0..4949d6d1f9fad4 100644 --- a/packages/kbn-test/jest-preset.js +++ b/packages/kbn-test/jest-preset.js @@ -68,7 +68,7 @@ module.exports = { ], // The test environment that will be used for testing - testEnvironment: 'jest-environment-jsdom-thirteen', + testEnvironment: 'jest-environment-jsdom', // The glob patterns Jest uses to detect test files testMatch: ['**/*.test.{js,mjs,ts,tsx}'], diff --git a/src/core/public/doc_links/doc_links_service.ts b/src/core/public/doc_links/doc_links_service.ts index e187b7ea581bf7..6279d62d2c40e6 100644 --- a/src/core/public/doc_links/doc_links_service.ts +++ b/src/core/public/doc_links/doc_links_service.ts @@ -187,9 +187,9 @@ export class DocLinksService { }, visualize: { guide: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/dashboard.html`, - timelionDeprecation: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/create-panels-with-timelion.html`, + timelionDeprecation: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/timelion.html`, lens: `${ELASTIC_WEBSITE_URL}what-is/kibana-lens`, - lensPanels: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/dashboard.html#create-panels-with-lens`, + lensPanels: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/lens.html`, maps: `${ELASTIC_WEBSITE_URL}maps`, }, observability: { diff --git a/src/plugins/charts/public/mocks.ts b/src/plugins/charts/public/mocks.ts index a6cde79057be82..c85a91a1ef5636 100644 --- a/src/plugins/charts/public/mocks.ts +++ b/src/plugins/charts/public/mocks.ts @@ -17,13 +17,13 @@ export type Start = jest.Mocked>; const createSetupContract = (): Setup => ({ legacyColors: colorsServiceMock, theme: themeServiceMock, - palettes: paletteServiceMock.setup({} as any, {} as any), + palettes: paletteServiceMock.setup({} as any), }); const createStartContract = (): Start => ({ legacyColors: colorsServiceMock, theme: themeServiceMock, - palettes: paletteServiceMock.setup({} as any, {} as any), + palettes: paletteServiceMock.setup({} as any), }); export { colorMapsMock } from './static/color_maps/mock'; diff --git a/src/plugins/charts/public/plugin.ts b/src/plugins/charts/public/plugin.ts index a21264703f6c43..5bc0b8c84560f4 100644 --- a/src/plugins/charts/public/plugin.ts +++ b/src/plugins/charts/public/plugin.ts @@ -43,7 +43,7 @@ export class ChartsPlugin implements Plugin { - const palettes: Record = buildPalettes( - coreMock.createStart().uiSettings, - colorsServiceMock - ); + const palettes: Record = buildPalettes(colorsServiceMock); describe('default palette', () => { describe('syncColors: false', () => { it('should return different colors based on behind text flag', () => { @@ -302,6 +298,7 @@ describe('palettes', () => { beforeEach(() => { (colorsServiceMock.mappedColors.mapKeys as jest.Mock).mockClear(); + (colorsServiceMock.mappedColors.getColorFromConfig as jest.Mock).mockReset(); (colorsServiceMock.mappedColors.get as jest.Mock).mockClear(); }); @@ -323,6 +320,30 @@ describe('palettes', () => { expect(colorsServiceMock.mappedColors.get).not.toHaveBeenCalled(); }); + it('should respect the advanced settings color mapping', () => { + const configColorGetter = colorsServiceMock.mappedColors.getColorFromConfig as jest.Mock; + configColorGetter.mockImplementation(() => 'blue'); + const result = palette.getColor( + [ + { + name: 'abc', + rankAtDepth: 2, + totalSeriesAtDepth: 10, + }, + { + name: 'def', + rankAtDepth: 0, + totalSeriesAtDepth: 10, + }, + ], + { + syncColors: false, + } + ); + expect(result).toEqual('blue'); + expect(configColorGetter).toHaveBeenCalledWith('abc'); + }); + it('should return a color from the legacy palette based on position of first series', () => { const result = palette.getColor( [ @@ -363,6 +384,30 @@ describe('palettes', () => { expect(colorsServiceMock.mappedColors.get).toHaveBeenCalledWith('abc'); }); + it('should respect the advanced settings color mapping', () => { + const configColorGetter = colorsServiceMock.mappedColors.getColorFromConfig as jest.Mock; + configColorGetter.mockImplementation(() => 'blue'); + const result = palette.getColor( + [ + { + name: 'abc', + rankAtDepth: 2, + totalSeriesAtDepth: 10, + }, + { + name: 'def', + rankAtDepth: 0, + totalSeriesAtDepth: 10, + }, + ], + { + syncColors: false, + } + ); + expect(result).toEqual('blue'); + expect(configColorGetter).toHaveBeenCalledWith('abc'); + }); + it('should always use root series', () => { palette.getColor( [ diff --git a/src/plugins/charts/public/services/palettes/palettes.tsx b/src/plugins/charts/public/services/palettes/palettes.tsx index 8a1dee72139edb..b11d598c1c1cbc 100644 --- a/src/plugins/charts/public/services/palettes/palettes.tsx +++ b/src/plugins/charts/public/services/palettes/palettes.tsx @@ -9,7 +9,6 @@ // @ts-ignore import chroma from 'chroma-js'; import { i18n } from '@kbn/i18n'; -import { IUiSettingsClient } from 'src/core/public'; import { euiPaletteColorBlind, euiPaletteCool, @@ -130,7 +129,8 @@ function buildSyncedKibanaPalette( colors.mappedColors.mapKeys([series[0].name]); outputColor = colors.mappedColors.get(series[0].name); } else { - outputColor = staticColors[series[0].rankAtDepth % staticColors.length]; + const configColor = colors.mappedColors.getColorFromConfig(series[0].name); + outputColor = configColor || staticColors[series[0].rankAtDepth % staticColors.length]; } if (!chartConfiguration.maxDepth || chartConfiguration.maxDepth === 1) { @@ -199,9 +199,8 @@ function buildCustomPalette(): PaletteDefinition { } export const buildPalettes: ( - uiSettings: IUiSettingsClient, legacyColorsService: LegacyColorsService -) => Record = (uiSettings, legacyColorsService) => { +) => Record = (legacyColorsService) => { return { default: { title: i18n.translate('charts.palettes.defaultPaletteLabel', { diff --git a/src/plugins/charts/public/services/palettes/service.ts b/src/plugins/charts/public/services/palettes/service.ts index 6090bfc0fd1408..bb9000e896742e 100644 --- a/src/plugins/charts/public/services/palettes/service.ts +++ b/src/plugins/charts/public/services/palettes/service.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import { CoreSetup } from 'kibana/public'; import { ExpressionsSetup } from '../../../../../../src/plugins/expressions/public'; import { ChartsPluginSetup, @@ -24,12 +23,12 @@ export class PaletteService { private palettes: Record> | undefined = undefined; constructor() {} - public setup(core: CoreSetup, colorsService: LegacyColorsService) { + public setup(colorsService: LegacyColorsService) { return { getPalettes: async (): Promise => { if (!this.palettes) { const { buildPalettes } = await import('./palettes'); - this.palettes = buildPalettes(core.uiSettings, colorsService); + this.palettes = buildPalettes(colorsService); } return { get: (name: string) => { diff --git a/src/plugins/charts/public/static/color_maps/color_maps.ts b/src/plugins/charts/public/static/color_maps/color_maps.ts index fed0ae684e8417..22b200871ff70b 100644 --- a/src/plugins/charts/public/static/color_maps/color_maps.ts +++ b/src/plugins/charts/public/static/color_maps/color_maps.ts @@ -40,518 +40,16 @@ export const vislibColorMaps: ColorMap = { defaultMessage: 'Blues', }), value: [ - [0.0, [0.969, 0.984, 1.0]], - [0.002, [0.969, 0.984, 1.0]], - [0.004, [0.966, 0.982, 0.999]], - [0.006, [0.966, 0.982, 0.999]], - [0.008, [0.962, 0.98, 0.998]], - [0.01, [0.962, 0.98, 0.998]], - [0.012, [0.959, 0.978, 0.997]], - [0.014, [0.959, 0.978, 0.997]], - [0.016, [0.956, 0.976, 0.996]], - [0.018, [0.956, 0.976, 0.996]], - [0.02, [0.953, 0.974, 0.995]], - [0.022, [0.953, 0.974, 0.995]], - [0.023, [0.95, 0.973, 0.994]], - [0.025, [0.95, 0.973, 0.994]], - [0.027, [0.947, 0.971, 0.993]], - [0.029, [0.947, 0.971, 0.993]], - [0.031, [0.944, 0.969, 0.992]], - [0.033, [0.944, 0.969, 0.992]], - [0.035, [0.941, 0.967, 0.991]], - [0.037, [0.941, 0.967, 0.991]], - [0.039, [0.938, 0.965, 0.99]], - [0.041, [0.938, 0.965, 0.99]], - [0.043, [0.935, 0.963, 0.989]], - [0.045, [0.935, 0.963, 0.989]], - [0.047, [0.932, 0.961, 0.988]], - [0.049, [0.932, 0.961, 0.988]], - [0.051, [0.929, 0.959, 0.987]], - [0.053, [0.929, 0.959, 0.987]], - [0.055, [0.926, 0.957, 0.986]], - [0.057, [0.926, 0.957, 0.986]], - [0.059, [0.922, 0.955, 0.985]], - [0.061, [0.922, 0.955, 0.985]], - [0.063, [0.919, 0.953, 0.984]], - [0.065, [0.919, 0.953, 0.984]], - [0.067, [0.916, 0.951, 0.983]], - [0.068, [0.916, 0.951, 0.983]], - [0.07, [0.913, 0.949, 0.982]], - [0.072, [0.913, 0.949, 0.982]], - [0.074, [0.91, 0.947, 0.981]], - [0.076, [0.91, 0.947, 0.981]], - [0.078, [0.907, 0.945, 0.98]], - [0.08, [0.907, 0.945, 0.98]], - [0.082, [0.904, 0.943, 0.979]], - [0.084, [0.904, 0.943, 0.979]], - [0.086, [0.901, 0.941, 0.978]], - [0.088, [0.901, 0.941, 0.978]], - [0.09, [0.898, 0.939, 0.977]], - [0.092, [0.898, 0.939, 0.977]], - [0.094, [0.895, 0.937, 0.976]], - [0.096, [0.895, 0.937, 0.976]], - [0.098, [0.892, 0.935, 0.975]], - [0.1, [0.892, 0.935, 0.975]], - [0.102, [0.889, 0.933, 0.974]], - [0.104, [0.889, 0.933, 0.974]], - [0.106, [0.886, 0.931, 0.973]], - [0.108, [0.886, 0.931, 0.973]], - [0.11, [0.883, 0.929, 0.972]], - [0.112, [0.883, 0.929, 0.972]], + [0, [0.969, 0.984, 1]], [0.114, [0.879, 0.927, 0.971]], - [0.115, [0.879, 0.927, 0.971]], - [0.117, [0.876, 0.925, 0.97]], - [0.119, [0.876, 0.925, 0.97]], - [0.121, [0.873, 0.923, 0.969]], - [0.123, [0.873, 0.923, 0.969]], - [0.125, [0.87, 0.921, 0.969]], - [0.127, [0.87, 0.921, 0.969]], - [0.129, [0.867, 0.919, 0.968]], - [0.131, [0.867, 0.919, 0.968]], - [0.133, [0.864, 0.917, 0.967]], - [0.135, [0.864, 0.917, 0.967]], - [0.137, [0.861, 0.915, 0.966]], - [0.139, [0.861, 0.915, 0.966]], - [0.141, [0.858, 0.913, 0.965]], - [0.143, [0.858, 0.913, 0.965]], - [0.145, [0.855, 0.911, 0.964]], - [0.147, [0.855, 0.911, 0.964]], - [0.149, [0.853, 0.91, 0.963]], - [0.151, [0.853, 0.91, 0.963]], - [0.153, [0.85, 0.908, 0.962]], - [0.155, [0.85, 0.908, 0.962]], - [0.157, [0.847, 0.906, 0.961]], - [0.159, [0.847, 0.906, 0.961]], - [0.16, [0.844, 0.904, 0.96]], - [0.162, [0.844, 0.904, 0.96]], - [0.164, [0.841, 0.902, 0.959]], - [0.166, [0.841, 0.902, 0.959]], - [0.168, [0.838, 0.9, 0.958]], - [0.17, [0.838, 0.9, 0.958]], - [0.172, [0.835, 0.898, 0.957]], - [0.174, [0.835, 0.898, 0.957]], - [0.176, [0.832, 0.896, 0.956]], - [0.178, [0.832, 0.896, 0.956]], - [0.18, [0.829, 0.894, 0.955]], - [0.182, [0.829, 0.894, 0.955]], - [0.184, [0.826, 0.892, 0.954]], - [0.186, [0.826, 0.892, 0.954]], - [0.188, [0.823, 0.89, 0.953]], - [0.19, [0.823, 0.89, 0.953]], - [0.192, [0.82, 0.888, 0.952]], - [0.194, [0.82, 0.888, 0.952]], - [0.196, [0.817, 0.886, 0.951]], - [0.198, [0.817, 0.886, 0.951]], - [0.2, [0.814, 0.884, 0.95]], - [0.202, [0.814, 0.884, 0.95]], - [0.204, [0.811, 0.882, 0.949]], - [0.205, [0.811, 0.882, 0.949]], - [0.207, [0.808, 0.88, 0.948]], - [0.209, [0.808, 0.88, 0.948]], - [0.211, [0.805, 0.878, 0.947]], - [0.213, [0.805, 0.878, 0.947]], - [0.215, [0.802, 0.876, 0.946]], - [0.217, [0.802, 0.876, 0.946]], - [0.219, [0.799, 0.874, 0.945]], - [0.221, [0.799, 0.874, 0.945]], - [0.223, [0.796, 0.872, 0.944]], - [0.225, [0.796, 0.872, 0.944]], [0.227, [0.793, 0.87, 0.943]], - [0.229, [0.793, 0.87, 0.943]], - [0.231, [0.79, 0.868, 0.942]], - [0.233, [0.79, 0.868, 0.942]], - [0.235, [0.788, 0.866, 0.941]], - [0.237, [0.788, 0.866, 0.941]], - [0.239, [0.785, 0.864, 0.94]], - [0.241, [0.785, 0.864, 0.94]], - [0.243, [0.782, 0.862, 0.939]], - [0.245, [0.782, 0.862, 0.939]], - [0.247, [0.779, 0.86, 0.938]], - [0.249, [0.779, 0.86, 0.938]], - [0.25, [0.775, 0.858, 0.937]], - [0.252, [0.775, 0.858, 0.937]], - [0.254, [0.77, 0.856, 0.935]], - [0.256, [0.77, 0.856, 0.935]], - [0.258, [0.765, 0.854, 0.933]], - [0.26, [0.765, 0.854, 0.933]], - [0.262, [0.76, 0.852, 0.932]], - [0.264, [0.76, 0.852, 0.932]], - [0.266, [0.756, 0.85, 0.93]], - [0.268, [0.756, 0.85, 0.93]], - [0.27, [0.751, 0.848, 0.928]], - [0.272, [0.751, 0.848, 0.928]], - [0.274, [0.746, 0.846, 0.926]], - [0.276, [0.746, 0.846, 0.926]], - [0.278, [0.741, 0.844, 0.925]], - [0.28, [0.741, 0.844, 0.925]], - [0.282, [0.736, 0.842, 0.923]], - [0.284, [0.736, 0.842, 0.923]], - [0.286, [0.731, 0.839, 0.921]], - [0.288, [0.731, 0.839, 0.921]], - [0.29, [0.726, 0.837, 0.92]], - [0.292, [0.726, 0.837, 0.92]], - [0.294, [0.721, 0.835, 0.918]], - [0.295, [0.721, 0.835, 0.918]], - [0.297, [0.716, 0.833, 0.916]], - [0.299, [0.716, 0.833, 0.916]], - [0.301, [0.711, 0.831, 0.914]], - [0.303, [0.711, 0.831, 0.914]], - [0.305, [0.706, 0.829, 0.913]], - [0.307, [0.706, 0.829, 0.913]], - [0.309, [0.701, 0.827, 0.911]], - [0.311, [0.701, 0.827, 0.911]], - [0.313, [0.697, 0.825, 0.909]], - [0.315, [0.697, 0.825, 0.909]], - [0.317, [0.692, 0.823, 0.908]], - [0.319, [0.692, 0.823, 0.908]], - [0.321, [0.687, 0.821, 0.906]], - [0.323, [0.687, 0.821, 0.906]], - [0.325, [0.682, 0.819, 0.904]], - [0.327, [0.682, 0.819, 0.904]], - [0.329, [0.677, 0.816, 0.902]], - [0.331, [0.677, 0.816, 0.902]], - [0.333, [0.672, 0.814, 0.901]], - [0.335, [0.672, 0.814, 0.901]], - [0.337, [0.667, 0.812, 0.899]], - [0.339, [0.667, 0.812, 0.899]], [0.341, [0.662, 0.81, 0.897]], - [0.342, [0.662, 0.81, 0.897]], - [0.344, [0.657, 0.808, 0.895]], - [0.346, [0.657, 0.808, 0.895]], - [0.348, [0.652, 0.806, 0.894]], - [0.35, [0.652, 0.806, 0.894]], - [0.352, [0.647, 0.804, 0.892]], - [0.354, [0.647, 0.804, 0.892]], - [0.356, [0.642, 0.802, 0.89]], - [0.358, [0.642, 0.802, 0.89]], - [0.36, [0.637, 0.8, 0.889]], - [0.362, [0.637, 0.8, 0.889]], - [0.364, [0.633, 0.798, 0.887]], - [0.366, [0.633, 0.798, 0.887]], - [0.368, [0.628, 0.796, 0.885]], - [0.37, [0.628, 0.796, 0.885]], - [0.372, [0.623, 0.793, 0.883]], - [0.374, [0.623, 0.793, 0.883]], - [0.376, [0.617, 0.791, 0.882]], - [0.378, [0.617, 0.791, 0.882]], - [0.38, [0.611, 0.787, 0.88]], - [0.382, [0.611, 0.787, 0.88]], - [0.384, [0.605, 0.784, 0.879]], - [0.386, [0.605, 0.784, 0.879]], - [0.387, [0.598, 0.781, 0.878]], - [0.389, [0.598, 0.781, 0.878]], - [0.391, [0.592, 0.777, 0.876]], - [0.393, [0.592, 0.777, 0.876]], - [0.395, [0.586, 0.774, 0.875]], - [0.397, [0.586, 0.774, 0.875]], - [0.399, [0.58, 0.77, 0.874]], - [0.401, [0.58, 0.77, 0.874]], - [0.403, [0.573, 0.767, 0.872]], - [0.405, [0.573, 0.767, 0.872]], - [0.407, [0.567, 0.763, 0.871]], - [0.409, [0.567, 0.763, 0.871]], - [0.411, [0.561, 0.76, 0.87]], - [0.413, [0.561, 0.76, 0.87]], - [0.415, [0.555, 0.756, 0.868]], - [0.417, [0.555, 0.756, 0.868]], - [0.419, [0.548, 0.753, 0.867]], - [0.421, [0.548, 0.753, 0.867]], - [0.423, [0.542, 0.75, 0.866]], - [0.425, [0.542, 0.75, 0.866]], - [0.427, [0.536, 0.746, 0.864]], - [0.429, [0.536, 0.746, 0.864]], - [0.431, [0.529, 0.743, 0.863]], - [0.432, [0.529, 0.743, 0.863]], - [0.434, [0.523, 0.739, 0.862]], - [0.436, [0.523, 0.739, 0.862]], - [0.438, [0.517, 0.736, 0.86]], - [0.44, [0.517, 0.736, 0.86]], - [0.442, [0.511, 0.732, 0.859]], - [0.444, [0.511, 0.732, 0.859]], - [0.446, [0.504, 0.729, 0.857]], - [0.448, [0.504, 0.729, 0.857]], - [0.45, [0.498, 0.725, 0.856]], - [0.452, [0.498, 0.725, 0.856]], [0.454, [0.492, 0.722, 0.855]], - [0.456, [0.492, 0.722, 0.855]], - [0.458, [0.485, 0.719, 0.853]], - [0.46, [0.485, 0.719, 0.853]], - [0.462, [0.479, 0.715, 0.852]], - [0.464, [0.479, 0.715, 0.852]], - [0.466, [0.473, 0.712, 0.851]], - [0.468, [0.473, 0.712, 0.851]], - [0.47, [0.467, 0.708, 0.849]], - [0.472, [0.467, 0.708, 0.849]], - [0.474, [0.46, 0.705, 0.848]], - [0.476, [0.46, 0.705, 0.848]], - [0.477, [0.454, 0.701, 0.847]], - [0.479, [0.454, 0.701, 0.847]], - [0.481, [0.448, 0.698, 0.845]], - [0.483, [0.448, 0.698, 0.845]], - [0.485, [0.442, 0.694, 0.844]], - [0.487, [0.442, 0.694, 0.844]], - [0.489, [0.435, 0.691, 0.843]], - [0.491, [0.435, 0.691, 0.843]], - [0.493, [0.429, 0.688, 0.841]], - [0.495, [0.429, 0.688, 0.841]], - [0.497, [0.423, 0.684, 0.84]], - [0.499, [0.423, 0.684, 0.84]], - [0.501, [0.417, 0.681, 0.838]], - [0.503, [0.417, 0.681, 0.838]], - [0.505, [0.412, 0.677, 0.836]], - [0.507, [0.412, 0.677, 0.836]], - [0.509, [0.407, 0.674, 0.834]], - [0.511, [0.407, 0.674, 0.834]], - [0.513, [0.402, 0.67, 0.832]], - [0.515, [0.402, 0.67, 0.832]], - [0.517, [0.397, 0.667, 0.83]], - [0.519, [0.397, 0.667, 0.83]], - [0.521, [0.392, 0.663, 0.828]], - [0.523, [0.392, 0.663, 0.828]], - [0.524, [0.387, 0.66, 0.826]], - [0.526, [0.387, 0.66, 0.826]], - [0.528, [0.382, 0.657, 0.824]], - [0.53, [0.382, 0.657, 0.824]], - [0.532, [0.377, 0.653, 0.822]], - [0.534, [0.377, 0.653, 0.822]], - [0.536, [0.372, 0.65, 0.821]], - [0.538, [0.372, 0.65, 0.821]], - [0.54, [0.367, 0.646, 0.819]], - [0.542, [0.367, 0.646, 0.819]], - [0.544, [0.362, 0.643, 0.817]], - [0.546, [0.362, 0.643, 0.817]], - [0.548, [0.357, 0.639, 0.815]], - [0.55, [0.357, 0.639, 0.815]], - [0.552, [0.352, 0.636, 0.813]], - [0.554, [0.352, 0.636, 0.813]], - [0.556, [0.346, 0.632, 0.811]], - [0.558, [0.346, 0.632, 0.811]], - [0.56, [0.341, 0.629, 0.809]], - [0.562, [0.341, 0.629, 0.809]], - [0.564, [0.336, 0.626, 0.807]], - [0.566, [0.336, 0.626, 0.807]], [0.568, [0.331, 0.622, 0.805]], - [0.569, [0.331, 0.622, 0.805]], - [0.571, [0.326, 0.619, 0.803]], - [0.573, [0.326, 0.619, 0.803]], - [0.575, [0.321, 0.615, 0.801]], - [0.577, [0.321, 0.615, 0.801]], - [0.579, [0.316, 0.612, 0.799]], - [0.581, [0.316, 0.612, 0.799]], - [0.583, [0.311, 0.608, 0.797]], - [0.585, [0.311, 0.608, 0.797]], - [0.587, [0.306, 0.605, 0.795]], - [0.589, [0.306, 0.605, 0.795]], - [0.591, [0.301, 0.601, 0.793]], - [0.593, [0.301, 0.601, 0.793]], - [0.595, [0.296, 0.598, 0.791]], - [0.597, [0.296, 0.598, 0.791]], - [0.599, [0.291, 0.595, 0.789]], - [0.601, [0.291, 0.595, 0.789]], - [0.603, [0.286, 0.591, 0.787]], - [0.605, [0.286, 0.591, 0.787]], - [0.607, [0.281, 0.588, 0.785]], - [0.609, [0.281, 0.588, 0.785]], - [0.611, [0.276, 0.584, 0.783]], - [0.613, [0.276, 0.584, 0.783]], - [0.614, [0.271, 0.581, 0.781]], - [0.616, [0.271, 0.581, 0.781]], - [0.618, [0.266, 0.577, 0.779]], - [0.62, [0.266, 0.577, 0.779]], - [0.622, [0.261, 0.574, 0.777]], - [0.624, [0.261, 0.574, 0.777]], - [0.626, [0.256, 0.57, 0.775]], - [0.628, [0.256, 0.57, 0.775]], - [0.63, [0.252, 0.566, 0.773]], - [0.632, [0.252, 0.566, 0.773]], - [0.634, [0.248, 0.562, 0.771]], - [0.636, [0.248, 0.562, 0.771]], - [0.638, [0.244, 0.558, 0.769]], - [0.64, [0.244, 0.558, 0.769]], - [0.642, [0.24, 0.554, 0.767]], - [0.644, [0.24, 0.554, 0.767]], - [0.646, [0.236, 0.55, 0.765]], - [0.648, [0.236, 0.55, 0.765]], - [0.65, [0.232, 0.546, 0.763]], - [0.652, [0.232, 0.546, 0.763]], - [0.654, [0.228, 0.542, 0.761]], - [0.656, [0.228, 0.542, 0.761]], - [0.658, [0.224, 0.538, 0.758]], - [0.659, [0.224, 0.538, 0.758]], - [0.661, [0.22, 0.533, 0.756]], - [0.663, [0.22, 0.533, 0.756]], - [0.665, [0.216, 0.529, 0.754]], - [0.667, [0.216, 0.529, 0.754]], - [0.669, [0.212, 0.525, 0.752]], - [0.671, [0.212, 0.525, 0.752]], - [0.673, [0.208, 0.521, 0.75]], - [0.675, [0.208, 0.521, 0.75]], - [0.677, [0.204, 0.517, 0.748]], - [0.679, [0.204, 0.517, 0.748]], [0.681, [0.199, 0.513, 0.746]], - [0.683, [0.199, 0.513, 0.746]], - [0.685, [0.195, 0.509, 0.744]], - [0.687, [0.195, 0.509, 0.744]], - [0.689, [0.191, 0.505, 0.742]], - [0.691, [0.191, 0.505, 0.742]], - [0.693, [0.187, 0.501, 0.74]], - [0.695, [0.187, 0.501, 0.74]], - [0.697, [0.183, 0.497, 0.738]], - [0.699, [0.183, 0.497, 0.738]], - [0.701, [0.179, 0.493, 0.735]], - [0.703, [0.179, 0.493, 0.735]], - [0.705, [0.175, 0.489, 0.733]], - [0.706, [0.175, 0.489, 0.733]], - [0.708, [0.171, 0.485, 0.731]], - [0.71, [0.171, 0.485, 0.731]], - [0.712, [0.167, 0.481, 0.729]], - [0.714, [0.167, 0.481, 0.729]], - [0.716, [0.163, 0.477, 0.727]], - [0.718, [0.163, 0.477, 0.727]], - [0.72, [0.159, 0.473, 0.725]], - [0.722, [0.159, 0.473, 0.725]], - [0.724, [0.155, 0.469, 0.723]], - [0.726, [0.155, 0.469, 0.723]], - [0.728, [0.151, 0.464, 0.721]], - [0.73, [0.151, 0.464, 0.721]], - [0.732, [0.147, 0.46, 0.719]], - [0.734, [0.147, 0.46, 0.719]], - [0.736, [0.143, 0.456, 0.717]], - [0.738, [0.143, 0.456, 0.717]], - [0.74, [0.139, 0.452, 0.715]], - [0.742, [0.139, 0.452, 0.715]], - [0.744, [0.134, 0.448, 0.712]], - [0.746, [0.134, 0.448, 0.712]], - [0.748, [0.13, 0.444, 0.71]], - [0.75, [0.13, 0.444, 0.71]], - [0.751, [0.127, 0.44, 0.707]], - [0.753, [0.127, 0.44, 0.707]], - [0.755, [0.124, 0.436, 0.704]], - [0.757, [0.124, 0.436, 0.704]], - [0.759, [0.121, 0.432, 0.701]], - [0.761, [0.121, 0.432, 0.701]], - [0.763, [0.118, 0.428, 0.698]], - [0.765, [0.118, 0.428, 0.698]], - [0.767, [0.115, 0.424, 0.695]], - [0.769, [0.115, 0.424, 0.695]], - [0.771, [0.112, 0.42, 0.692]], - [0.773, [0.112, 0.42, 0.692]], - [0.775, [0.109, 0.417, 0.689]], - [0.777, [0.109, 0.417, 0.689]], - [0.779, [0.106, 0.413, 0.686]], - [0.781, [0.106, 0.413, 0.686]], - [0.783, [0.102, 0.409, 0.683]], - [0.785, [0.102, 0.409, 0.683]], - [0.787, [0.099, 0.405, 0.68]], - [0.789, [0.099, 0.405, 0.68]], - [0.791, [0.096, 0.401, 0.677]], - [0.793, [0.096, 0.401, 0.677]], [0.795, [0.093, 0.397, 0.674]], - [0.796, [0.093, 0.397, 0.674]], - [0.798, [0.09, 0.393, 0.671]], - [0.8, [0.09, 0.393, 0.671]], - [0.802, [0.087, 0.389, 0.668]], - [0.804, [0.087, 0.389, 0.668]], - [0.806, [0.084, 0.385, 0.664]], - [0.808, [0.084, 0.385, 0.664]], - [0.81, [0.081, 0.381, 0.661]], - [0.812, [0.081, 0.381, 0.661]], - [0.814, [0.078, 0.377, 0.658]], - [0.816, [0.078, 0.377, 0.658]], - [0.818, [0.075, 0.373, 0.655]], - [0.82, [0.075, 0.373, 0.655]], - [0.822, [0.072, 0.369, 0.652]], - [0.824, [0.072, 0.369, 0.652]], - [0.826, [0.069, 0.365, 0.649]], - [0.828, [0.069, 0.365, 0.649]], - [0.83, [0.066, 0.361, 0.646]], - [0.832, [0.066, 0.361, 0.646]], - [0.834, [0.063, 0.358, 0.643]], - [0.836, [0.063, 0.358, 0.643]], - [0.838, [0.059, 0.354, 0.64]], - [0.84, [0.059, 0.354, 0.64]], - [0.841, [0.056, 0.35, 0.637]], - [0.843, [0.056, 0.35, 0.637]], - [0.845, [0.053, 0.346, 0.634]], - [0.847, [0.053, 0.346, 0.634]], - [0.849, [0.05, 0.342, 0.631]], - [0.851, [0.05, 0.342, 0.631]], - [0.853, [0.047, 0.338, 0.628]], - [0.855, [0.047, 0.338, 0.628]], - [0.857, [0.044, 0.334, 0.624]], - [0.859, [0.044, 0.334, 0.624]], - [0.861, [0.041, 0.33, 0.621]], - [0.863, [0.041, 0.33, 0.621]], - [0.865, [0.038, 0.326, 0.618]], - [0.867, [0.038, 0.326, 0.618]], - [0.869, [0.035, 0.322, 0.615]], - [0.871, [0.035, 0.322, 0.615]], - [0.873, [0.032, 0.318, 0.612]], - [0.875, [0.032, 0.318, 0.612]], - [0.877, [0.031, 0.314, 0.606]], - [0.879, [0.031, 0.314, 0.606]], - [0.881, [0.031, 0.31, 0.6]], - [0.883, [0.031, 0.31, 0.6]], - [0.885, [0.031, 0.306, 0.594]], - [0.886, [0.031, 0.306, 0.594]], - [0.888, [0.031, 0.302, 0.588]], - [0.89, [0.031, 0.302, 0.588]], - [0.892, [0.031, 0.298, 0.582]], - [0.894, [0.031, 0.298, 0.582]], - [0.896, [0.031, 0.294, 0.576]], - [0.898, [0.031, 0.294, 0.576]], - [0.9, [0.031, 0.29, 0.57]], - [0.902, [0.031, 0.29, 0.57]], - [0.904, [0.031, 0.286, 0.564]], - [0.906, [0.031, 0.286, 0.564]], [0.908, [0.031, 0.282, 0.558]], - [0.91, [0.031, 0.282, 0.558]], - [0.912, [0.031, 0.278, 0.552]], - [0.914, [0.031, 0.278, 0.552]], - [0.916, [0.031, 0.273, 0.546]], - [0.918, [0.031, 0.273, 0.546]], - [0.92, [0.031, 0.269, 0.54]], - [0.922, [0.031, 0.269, 0.54]], - [0.924, [0.031, 0.265, 0.534]], - [0.926, [0.031, 0.265, 0.534]], - [0.928, [0.031, 0.261, 0.528]], - [0.93, [0.031, 0.261, 0.528]], - [0.932, [0.031, 0.257, 0.522]], - [0.933, [0.031, 0.257, 0.522]], - [0.935, [0.031, 0.253, 0.516]], - [0.937, [0.031, 0.253, 0.516]], - [0.939, [0.031, 0.249, 0.51]], - [0.941, [0.031, 0.249, 0.51]], - [0.943, [0.031, 0.245, 0.504]], - [0.945, [0.031, 0.245, 0.504]], - [0.947, [0.031, 0.241, 0.498]], - [0.949, [0.031, 0.241, 0.498]], - [0.951, [0.031, 0.237, 0.492]], - [0.953, [0.031, 0.237, 0.492]], - [0.955, [0.031, 0.233, 0.486]], - [0.957, [0.031, 0.233, 0.486]], - [0.959, [0.031, 0.229, 0.48]], - [0.961, [0.031, 0.229, 0.48]], - [0.963, [0.031, 0.225, 0.474]], - [0.965, [0.031, 0.225, 0.474]], - [0.967, [0.031, 0.221, 0.468]], - [0.969, [0.031, 0.221, 0.468]], - [0.971, [0.031, 0.217, 0.462]], - [0.973, [0.031, 0.217, 0.462]], - [0.975, [0.031, 0.213, 0.456]], - [0.977, [0.031, 0.213, 0.456]], - [0.978, [0.031, 0.209, 0.45]], - [0.98, [0.031, 0.209, 0.45]], - [0.982, [0.031, 0.204, 0.444]], - [0.984, [0.031, 0.204, 0.444]], - [0.986, [0.031, 0.2, 0.438]], - [0.988, [0.031, 0.2, 0.438]], - [0.99, [0.031, 0.196, 0.432]], - [0.992, [0.031, 0.196, 0.432]], - [0.994, [0.031, 0.192, 0.426]], - [0.996, [0.031, 0.192, 0.426]], - [0.998, [0.031, 0.188, 0.42]], - [1.0, [0.031, 0.188, 0.42]], + [1, [0.031, 0.188, 0.42]], ], }, [ColorSchemas.Greens]: { @@ -560,518 +58,16 @@ export const vislibColorMaps: ColorMap = { defaultMessage: 'Greens', }), value: [ - [0.0, [0.969, 0.988, 0.961]], - [0.002, [0.969, 0.988, 0.961]], - [0.004, [0.966, 0.987, 0.958]], - [0.006, [0.966, 0.987, 0.958]], - [0.008, [0.964, 0.987, 0.956]], - [0.01, [0.964, 0.987, 0.956]], - [0.012, [0.962, 0.986, 0.953]], - [0.014, [0.962, 0.986, 0.953]], - [0.016, [0.96, 0.985, 0.95]], - [0.018, [0.96, 0.985, 0.95]], - [0.02, [0.958, 0.984, 0.948]], - [0.022, [0.958, 0.984, 0.948]], - [0.023, [0.955, 0.983, 0.945]], - [0.025, [0.955, 0.983, 0.945]], - [0.027, [0.953, 0.982, 0.943]], - [0.029, [0.953, 0.982, 0.943]], - [0.031, [0.951, 0.981, 0.94]], - [0.033, [0.951, 0.981, 0.94]], - [0.035, [0.949, 0.98, 0.938]], - [0.037, [0.949, 0.98, 0.938]], - [0.039, [0.946, 0.98, 0.935]], - [0.041, [0.946, 0.98, 0.935]], - [0.043, [0.944, 0.979, 0.932]], - [0.045, [0.944, 0.979, 0.932]], - [0.047, [0.942, 0.978, 0.93]], - [0.049, [0.942, 0.978, 0.93]], - [0.051, [0.94, 0.977, 0.927]], - [0.053, [0.94, 0.977, 0.927]], - [0.055, [0.938, 0.976, 0.925]], - [0.057, [0.938, 0.976, 0.925]], - [0.059, [0.935, 0.975, 0.922]], - [0.061, [0.935, 0.975, 0.922]], - [0.063, [0.933, 0.974, 0.919]], - [0.065, [0.933, 0.974, 0.919]], - [0.067, [0.931, 0.974, 0.917]], - [0.068, [0.931, 0.974, 0.917]], - [0.07, [0.929, 0.973, 0.914]], - [0.072, [0.929, 0.973, 0.914]], - [0.074, [0.927, 0.972, 0.912]], - [0.076, [0.927, 0.972, 0.912]], - [0.078, [0.924, 0.971, 0.909]], - [0.08, [0.924, 0.971, 0.909]], - [0.082, [0.922, 0.97, 0.907]], - [0.084, [0.922, 0.97, 0.907]], - [0.086, [0.92, 0.969, 0.904]], - [0.088, [0.92, 0.969, 0.904]], - [0.09, [0.918, 0.968, 0.901]], - [0.092, [0.918, 0.968, 0.901]], - [0.094, [0.915, 0.968, 0.899]], - [0.096, [0.915, 0.968, 0.899]], - [0.098, [0.913, 0.967, 0.896]], - [0.1, [0.913, 0.967, 0.896]], - [0.102, [0.911, 0.966, 0.894]], - [0.104, [0.911, 0.966, 0.894]], - [0.106, [0.909, 0.965, 0.891]], - [0.108, [0.909, 0.965, 0.891]], - [0.11, [0.907, 0.964, 0.888]], - [0.112, [0.907, 0.964, 0.888]], + [0, [0.969, 0.988, 0.961]], [0.114, [0.904, 0.963, 0.886]], - [0.115, [0.904, 0.963, 0.886]], - [0.117, [0.902, 0.962, 0.883]], - [0.119, [0.902, 0.962, 0.883]], - [0.121, [0.9, 0.962, 0.881]], - [0.123, [0.9, 0.962, 0.881]], - [0.125, [0.898, 0.961, 0.878]], - [0.127, [0.898, 0.961, 0.878]], - [0.129, [0.894, 0.959, 0.874]], - [0.131, [0.894, 0.959, 0.874]], - [0.133, [0.89, 0.958, 0.87]], - [0.135, [0.89, 0.958, 0.87]], - [0.137, [0.887, 0.956, 0.866]], - [0.139, [0.887, 0.956, 0.866]], - [0.141, [0.883, 0.955, 0.862]], - [0.143, [0.883, 0.955, 0.862]], - [0.145, [0.879, 0.953, 0.858]], - [0.147, [0.879, 0.953, 0.858]], - [0.149, [0.875, 0.952, 0.854]], - [0.151, [0.875, 0.952, 0.854]], - [0.153, [0.872, 0.95, 0.85]], - [0.155, [0.872, 0.95, 0.85]], - [0.157, [0.868, 0.949, 0.846]], - [0.159, [0.868, 0.949, 0.846]], - [0.16, [0.864, 0.947, 0.843]], - [0.162, [0.864, 0.947, 0.843]], - [0.164, [0.861, 0.946, 0.839]], - [0.166, [0.861, 0.946, 0.839]], - [0.168, [0.857, 0.944, 0.835]], - [0.17, [0.857, 0.944, 0.835]], - [0.172, [0.853, 0.943, 0.831]], - [0.174, [0.853, 0.943, 0.831]], - [0.176, [0.85, 0.941, 0.827]], - [0.178, [0.85, 0.941, 0.827]], - [0.18, [0.846, 0.94, 0.823]], - [0.182, [0.846, 0.94, 0.823]], - [0.184, [0.842, 0.938, 0.819]], - [0.186, [0.842, 0.938, 0.819]], - [0.188, [0.839, 0.937, 0.815]], - [0.19, [0.839, 0.937, 0.815]], - [0.192, [0.835, 0.936, 0.811]], - [0.194, [0.835, 0.936, 0.811]], - [0.196, [0.831, 0.934, 0.807]], - [0.198, [0.831, 0.934, 0.807]], - [0.2, [0.827, 0.933, 0.803]], - [0.202, [0.827, 0.933, 0.803]], - [0.204, [0.824, 0.931, 0.799]], - [0.205, [0.824, 0.931, 0.799]], - [0.207, [0.82, 0.93, 0.795]], - [0.209, [0.82, 0.93, 0.795]], - [0.211, [0.816, 0.928, 0.791]], - [0.213, [0.816, 0.928, 0.791]], - [0.215, [0.813, 0.927, 0.787]], - [0.217, [0.813, 0.927, 0.787]], - [0.219, [0.809, 0.925, 0.783]], - [0.221, [0.809, 0.925, 0.783]], - [0.223, [0.805, 0.924, 0.78]], - [0.225, [0.805, 0.924, 0.78]], [0.227, [0.802, 0.922, 0.776]], - [0.229, [0.802, 0.922, 0.776]], - [0.231, [0.798, 0.921, 0.772]], - [0.233, [0.798, 0.921, 0.772]], - [0.235, [0.794, 0.919, 0.768]], - [0.237, [0.794, 0.919, 0.768]], - [0.239, [0.791, 0.918, 0.764]], - [0.241, [0.791, 0.918, 0.764]], - [0.243, [0.787, 0.916, 0.76]], - [0.245, [0.787, 0.916, 0.76]], - [0.247, [0.783, 0.915, 0.756]], - [0.249, [0.783, 0.915, 0.756]], - [0.25, [0.779, 0.913, 0.752]], - [0.252, [0.779, 0.913, 0.752]], - [0.254, [0.775, 0.911, 0.747]], - [0.256, [0.775, 0.911, 0.747]], - [0.258, [0.77, 0.909, 0.743]], - [0.26, [0.77, 0.909, 0.743]], - [0.262, [0.765, 0.907, 0.738]], - [0.264, [0.765, 0.907, 0.738]], - [0.266, [0.761, 0.905, 0.734]], - [0.268, [0.761, 0.905, 0.734]], - [0.27, [0.756, 0.903, 0.729]], - [0.272, [0.756, 0.903, 0.729]], - [0.274, [0.751, 0.901, 0.724]], - [0.276, [0.751, 0.901, 0.724]], - [0.278, [0.746, 0.899, 0.72]], - [0.28, [0.746, 0.899, 0.72]], - [0.282, [0.742, 0.897, 0.715]], - [0.284, [0.742, 0.897, 0.715]], - [0.286, [0.737, 0.896, 0.711]], - [0.288, [0.737, 0.896, 0.711]], - [0.29, [0.732, 0.894, 0.706]], - [0.292, [0.732, 0.894, 0.706]], - [0.294, [0.728, 0.892, 0.702]], - [0.295, [0.728, 0.892, 0.702]], - [0.297, [0.723, 0.89, 0.697]], - [0.299, [0.723, 0.89, 0.697]], - [0.301, [0.718, 0.888, 0.693]], - [0.303, [0.718, 0.888, 0.693]], - [0.305, [0.714, 0.886, 0.688]], - [0.307, [0.714, 0.886, 0.688]], - [0.309, [0.709, 0.884, 0.684]], - [0.311, [0.709, 0.884, 0.684]], - [0.313, [0.704, 0.882, 0.679]], - [0.315, [0.704, 0.882, 0.679]], - [0.317, [0.7, 0.88, 0.674]], - [0.319, [0.7, 0.88, 0.674]], - [0.321, [0.695, 0.878, 0.67]], - [0.323, [0.695, 0.878, 0.67]], - [0.325, [0.69, 0.876, 0.665]], - [0.327, [0.69, 0.876, 0.665]], - [0.329, [0.686, 0.874, 0.661]], - [0.331, [0.686, 0.874, 0.661]], - [0.333, [0.681, 0.872, 0.656]], - [0.335, [0.681, 0.872, 0.656]], - [0.337, [0.676, 0.87, 0.652]], - [0.339, [0.676, 0.87, 0.652]], [0.341, [0.672, 0.868, 0.647]], - [0.342, [0.672, 0.868, 0.647]], - [0.344, [0.667, 0.866, 0.643]], - [0.346, [0.667, 0.866, 0.643]], - [0.348, [0.662, 0.864, 0.638]], - [0.35, [0.662, 0.864, 0.638]], - [0.352, [0.658, 0.862, 0.633]], - [0.354, [0.658, 0.862, 0.633]], - [0.356, [0.653, 0.86, 0.629]], - [0.358, [0.653, 0.86, 0.629]], - [0.36, [0.648, 0.858, 0.624]], - [0.362, [0.648, 0.858, 0.624]], - [0.364, [0.644, 0.856, 0.62]], - [0.366, [0.644, 0.856, 0.62]], - [0.368, [0.639, 0.854, 0.615]], - [0.37, [0.639, 0.854, 0.615]], - [0.372, [0.634, 0.852, 0.611]], - [0.374, [0.634, 0.852, 0.611]], - [0.376, [0.629, 0.85, 0.606]], - [0.378, [0.629, 0.85, 0.606]], - [0.38, [0.624, 0.847, 0.602]], - [0.382, [0.624, 0.847, 0.602]], - [0.384, [0.618, 0.845, 0.597]], - [0.386, [0.618, 0.845, 0.597]], - [0.387, [0.613, 0.842, 0.592]], - [0.389, [0.613, 0.842, 0.592]], - [0.391, [0.607, 0.84, 0.588]], - [0.393, [0.607, 0.84, 0.588]], - [0.395, [0.602, 0.837, 0.583]], - [0.397, [0.602, 0.837, 0.583]], - [0.399, [0.596, 0.835, 0.579]], - [0.401, [0.596, 0.835, 0.579]], - [0.403, [0.591, 0.832, 0.574]], - [0.405, [0.591, 0.832, 0.574]], - [0.407, [0.585, 0.829, 0.57]], - [0.409, [0.585, 0.829, 0.57]], - [0.411, [0.579, 0.827, 0.565]], - [0.413, [0.579, 0.827, 0.565]], - [0.415, [0.574, 0.824, 0.561]], - [0.417, [0.574, 0.824, 0.561]], - [0.419, [0.568, 0.822, 0.556]], - [0.421, [0.568, 0.822, 0.556]], - [0.423, [0.563, 0.819, 0.552]], - [0.425, [0.563, 0.819, 0.552]], - [0.427, [0.557, 0.816, 0.547]], - [0.429, [0.557, 0.816, 0.547]], - [0.431, [0.552, 0.814, 0.542]], - [0.432, [0.552, 0.814, 0.542]], - [0.434, [0.546, 0.811, 0.538]], - [0.436, [0.546, 0.811, 0.538]], - [0.438, [0.541, 0.809, 0.533]], - [0.44, [0.541, 0.809, 0.533]], - [0.442, [0.535, 0.806, 0.529]], - [0.444, [0.535, 0.806, 0.529]], - [0.446, [0.53, 0.804, 0.524]], - [0.448, [0.53, 0.804, 0.524]], - [0.45, [0.524, 0.801, 0.52]], - [0.452, [0.524, 0.801, 0.52]], [0.454, [0.519, 0.798, 0.515]], - [0.456, [0.519, 0.798, 0.515]], - [0.458, [0.513, 0.796, 0.511]], - [0.46, [0.513, 0.796, 0.511]], - [0.462, [0.507, 0.793, 0.506]], - [0.464, [0.507, 0.793, 0.506]], - [0.466, [0.502, 0.791, 0.501]], - [0.468, [0.502, 0.791, 0.501]], - [0.47, [0.496, 0.788, 0.497]], - [0.472, [0.496, 0.788, 0.497]], - [0.474, [0.491, 0.785, 0.492]], - [0.476, [0.491, 0.785, 0.492]], - [0.477, [0.485, 0.783, 0.488]], - [0.479, [0.485, 0.783, 0.488]], - [0.481, [0.48, 0.78, 0.483]], - [0.483, [0.48, 0.78, 0.483]], - [0.485, [0.474, 0.778, 0.479]], - [0.487, [0.474, 0.778, 0.479]], - [0.489, [0.469, 0.775, 0.474]], - [0.491, [0.469, 0.775, 0.474]], - [0.493, [0.463, 0.773, 0.47]], - [0.495, [0.463, 0.773, 0.47]], - [0.497, [0.458, 0.77, 0.465]], - [0.499, [0.458, 0.77, 0.465]], - [0.501, [0.452, 0.767, 0.461]], - [0.503, [0.452, 0.767, 0.461]], - [0.505, [0.445, 0.764, 0.458]], - [0.507, [0.445, 0.764, 0.458]], - [0.509, [0.439, 0.761, 0.455]], - [0.511, [0.439, 0.761, 0.455]], - [0.513, [0.433, 0.758, 0.452]], - [0.515, [0.433, 0.758, 0.452]], - [0.517, [0.427, 0.755, 0.449]], - [0.519, [0.427, 0.755, 0.449]], - [0.521, [0.42, 0.752, 0.446]], - [0.523, [0.42, 0.752, 0.446]], - [0.524, [0.414, 0.749, 0.443]], - [0.526, [0.414, 0.749, 0.443]], - [0.528, [0.408, 0.746, 0.44]], - [0.53, [0.408, 0.746, 0.44]], - [0.532, [0.402, 0.742, 0.437]], - [0.534, [0.402, 0.742, 0.437]], - [0.536, [0.395, 0.739, 0.434]], - [0.538, [0.395, 0.739, 0.434]], - [0.54, [0.389, 0.736, 0.43]], - [0.542, [0.389, 0.736, 0.43]], - [0.544, [0.383, 0.733, 0.427]], - [0.546, [0.383, 0.733, 0.427]], - [0.548, [0.376, 0.73, 0.424]], - [0.55, [0.376, 0.73, 0.424]], - [0.552, [0.37, 0.727, 0.421]], - [0.554, [0.37, 0.727, 0.421]], - [0.556, [0.364, 0.724, 0.418]], - [0.558, [0.364, 0.724, 0.418]], - [0.56, [0.358, 0.721, 0.415]], - [0.562, [0.358, 0.721, 0.415]], - [0.564, [0.351, 0.718, 0.412]], - [0.566, [0.351, 0.718, 0.412]], [0.568, [0.345, 0.715, 0.409]], - [0.569, [0.345, 0.715, 0.409]], - [0.571, [0.339, 0.712, 0.406]], - [0.573, [0.339, 0.712, 0.406]], - [0.575, [0.333, 0.709, 0.403]], - [0.577, [0.333, 0.709, 0.403]], - [0.579, [0.326, 0.706, 0.4]], - [0.581, [0.326, 0.706, 0.4]], - [0.583, [0.32, 0.702, 0.397]], - [0.585, [0.32, 0.702, 0.397]], - [0.587, [0.314, 0.699, 0.394]], - [0.589, [0.314, 0.699, 0.394]], - [0.591, [0.307, 0.696, 0.39]], - [0.593, [0.307, 0.696, 0.39]], - [0.595, [0.301, 0.693, 0.387]], - [0.597, [0.301, 0.693, 0.387]], - [0.599, [0.295, 0.69, 0.384]], - [0.601, [0.295, 0.69, 0.384]], - [0.603, [0.289, 0.687, 0.381]], - [0.605, [0.289, 0.687, 0.381]], - [0.607, [0.282, 0.684, 0.378]], - [0.609, [0.282, 0.684, 0.378]], - [0.611, [0.276, 0.681, 0.375]], - [0.613, [0.276, 0.681, 0.375]], - [0.614, [0.27, 0.678, 0.372]], - [0.616, [0.27, 0.678, 0.372]], - [0.618, [0.264, 0.675, 0.369]], - [0.62, [0.264, 0.675, 0.369]], - [0.622, [0.257, 0.672, 0.366]], - [0.624, [0.257, 0.672, 0.366]], - [0.626, [0.253, 0.668, 0.363]], - [0.628, [0.253, 0.668, 0.363]], - [0.63, [0.249, 0.664, 0.36]], - [0.632, [0.249, 0.664, 0.36]], - [0.634, [0.245, 0.66, 0.357]], - [0.636, [0.245, 0.66, 0.357]], - [0.638, [0.242, 0.656, 0.354]], - [0.64, [0.242, 0.656, 0.354]], - [0.642, [0.238, 0.652, 0.351]], - [0.644, [0.238, 0.652, 0.351]], - [0.646, [0.234, 0.648, 0.348]], - [0.648, [0.234, 0.648, 0.348]], - [0.65, [0.23, 0.645, 0.345]], - [0.652, [0.23, 0.645, 0.345]], - [0.654, [0.227, 0.641, 0.342]], - [0.656, [0.227, 0.641, 0.342]], - [0.658, [0.223, 0.637, 0.339]], - [0.659, [0.223, 0.637, 0.339]], - [0.661, [0.219, 0.633, 0.336]], - [0.663, [0.219, 0.633, 0.336]], - [0.665, [0.216, 0.629, 0.333]], - [0.667, [0.216, 0.629, 0.333]], - [0.669, [0.212, 0.625, 0.33]], - [0.671, [0.212, 0.625, 0.33]], - [0.673, [0.208, 0.621, 0.327]], - [0.675, [0.208, 0.621, 0.327]], - [0.677, [0.205, 0.617, 0.324]], - [0.679, [0.205, 0.617, 0.324]], [0.681, [0.201, 0.613, 0.322]], - [0.683, [0.201, 0.613, 0.322]], - [0.685, [0.197, 0.609, 0.319]], - [0.687, [0.197, 0.609, 0.319]], - [0.689, [0.194, 0.605, 0.316]], - [0.691, [0.194, 0.605, 0.316]], - [0.693, [0.19, 0.601, 0.313]], - [0.695, [0.19, 0.601, 0.313]], - [0.697, [0.186, 0.597, 0.31]], - [0.699, [0.186, 0.597, 0.31]], - [0.701, [0.182, 0.593, 0.307]], - [0.703, [0.182, 0.593, 0.307]], - [0.705, [0.179, 0.589, 0.304]], - [0.706, [0.179, 0.589, 0.304]], - [0.708, [0.175, 0.585, 0.301]], - [0.71, [0.175, 0.585, 0.301]], - [0.712, [0.171, 0.582, 0.298]], - [0.714, [0.171, 0.582, 0.298]], - [0.716, [0.168, 0.578, 0.295]], - [0.718, [0.168, 0.578, 0.295]], - [0.72, [0.164, 0.574, 0.292]], - [0.722, [0.164, 0.574, 0.292]], - [0.724, [0.16, 0.57, 0.289]], - [0.726, [0.16, 0.57, 0.289]], - [0.728, [0.157, 0.566, 0.286]], - [0.73, [0.157, 0.566, 0.286]], - [0.732, [0.153, 0.562, 0.283]], - [0.734, [0.153, 0.562, 0.283]], - [0.736, [0.149, 0.558, 0.28]], - [0.738, [0.149, 0.558, 0.28]], - [0.74, [0.146, 0.554, 0.277]], - [0.742, [0.146, 0.554, 0.277]], - [0.744, [0.142, 0.55, 0.274]], - [0.746, [0.142, 0.55, 0.274]], - [0.748, [0.138, 0.546, 0.271]], - [0.75, [0.138, 0.546, 0.271]], - [0.751, [0.134, 0.542, 0.268]], - [0.753, [0.134, 0.542, 0.268]], - [0.755, [0.13, 0.539, 0.265]], - [0.757, [0.13, 0.539, 0.265]], - [0.759, [0.125, 0.535, 0.262]], - [0.761, [0.125, 0.535, 0.262]], - [0.763, [0.121, 0.531, 0.259]], - [0.765, [0.121, 0.531, 0.259]], - [0.767, [0.117, 0.528, 0.256]], - [0.769, [0.117, 0.528, 0.256]], - [0.771, [0.112, 0.524, 0.253]], - [0.773, [0.112, 0.524, 0.253]], - [0.775, [0.108, 0.52, 0.25]], - [0.777, [0.108, 0.52, 0.25]], - [0.779, [0.104, 0.516, 0.247]], - [0.781, [0.104, 0.516, 0.247]], - [0.783, [0.1, 0.513, 0.244]], - [0.785, [0.1, 0.513, 0.244]], - [0.787, [0.095, 0.509, 0.241]], - [0.789, [0.095, 0.509, 0.241]], - [0.791, [0.091, 0.505, 0.238]], - [0.793, [0.091, 0.505, 0.238]], [0.795, [0.087, 0.502, 0.234]], - [0.796, [0.087, 0.502, 0.234]], - [0.798, [0.082, 0.498, 0.231]], - [0.8, [0.082, 0.498, 0.231]], - [0.802, [0.078, 0.494, 0.228]], - [0.804, [0.078, 0.494, 0.228]], - [0.806, [0.074, 0.491, 0.225]], - [0.808, [0.074, 0.491, 0.225]], - [0.81, [0.069, 0.487, 0.222]], - [0.812, [0.069, 0.487, 0.222]], - [0.814, [0.065, 0.483, 0.219]], - [0.816, [0.065, 0.483, 0.219]], - [0.818, [0.061, 0.48, 0.216]], - [0.82, [0.061, 0.48, 0.216]], - [0.822, [0.057, 0.476, 0.213]], - [0.824, [0.057, 0.476, 0.213]], - [0.826, [0.052, 0.472, 0.21]], - [0.828, [0.052, 0.472, 0.21]], - [0.83, [0.048, 0.469, 0.207]], - [0.832, [0.048, 0.469, 0.207]], - [0.834, [0.044, 0.465, 0.204]], - [0.836, [0.044, 0.465, 0.204]], - [0.838, [0.039, 0.461, 0.201]], - [0.84, [0.039, 0.461, 0.201]], - [0.841, [0.035, 0.457, 0.198]], - [0.843, [0.035, 0.457, 0.198]], - [0.845, [0.031, 0.454, 0.194]], - [0.847, [0.031, 0.454, 0.194]], - [0.849, [0.026, 0.45, 0.191]], - [0.851, [0.026, 0.45, 0.191]], - [0.853, [0.022, 0.446, 0.188]], - [0.855, [0.022, 0.446, 0.188]], - [0.857, [0.018, 0.443, 0.185]], - [0.859, [0.018, 0.443, 0.185]], - [0.861, [0.013, 0.439, 0.182]], - [0.863, [0.013, 0.439, 0.182]], - [0.865, [0.009, 0.435, 0.179]], - [0.867, [0.009, 0.435, 0.179]], - [0.869, [0.005, 0.432, 0.176]], - [0.871, [0.005, 0.432, 0.176]], - [0.873, [0.001, 0.428, 0.173]], - [0.875, [0.001, 0.428, 0.173]], - [0.877, [0.0, 0.423, 0.171]], - [0.879, [0.0, 0.423, 0.171]], - [0.881, [0.0, 0.418, 0.169]], - [0.883, [0.0, 0.418, 0.169]], - [0.885, [0.0, 0.413, 0.167]], - [0.886, [0.0, 0.413, 0.167]], - [0.888, [0.0, 0.408, 0.164]], - [0.89, [0.0, 0.408, 0.164]], - [0.892, [0.0, 0.403, 0.162]], - [0.894, [0.0, 0.403, 0.162]], - [0.896, [0.0, 0.398, 0.16]], - [0.898, [0.0, 0.398, 0.16]], - [0.9, [0.0, 0.393, 0.158]], - [0.902, [0.0, 0.393, 0.158]], - [0.904, [0.0, 0.388, 0.156]], - [0.906, [0.0, 0.388, 0.156]], - [0.908, [0.0, 0.383, 0.154]], - [0.91, [0.0, 0.383, 0.154]], - [0.912, [0.0, 0.378, 0.152]], - [0.914, [0.0, 0.378, 0.152]], - [0.916, [0.0, 0.373, 0.15]], - [0.918, [0.0, 0.373, 0.15]], - [0.92, [0.0, 0.368, 0.148]], - [0.922, [0.0, 0.368, 0.148]], - [0.924, [0.0, 0.363, 0.146]], - [0.926, [0.0, 0.363, 0.146]], - [0.928, [0.0, 0.357, 0.144]], - [0.93, [0.0, 0.357, 0.144]], - [0.932, [0.0, 0.352, 0.141]], - [0.933, [0.0, 0.352, 0.141]], - [0.935, [0.0, 0.347, 0.139]], - [0.937, [0.0, 0.347, 0.139]], - [0.939, [0.0, 0.342, 0.137]], - [0.941, [0.0, 0.342, 0.137]], - [0.943, [0.0, 0.337, 0.135]], - [0.945, [0.0, 0.337, 0.135]], - [0.947, [0.0, 0.332, 0.133]], - [0.949, [0.0, 0.332, 0.133]], - [0.951, [0.0, 0.327, 0.131]], - [0.953, [0.0, 0.327, 0.131]], - [0.955, [0.0, 0.322, 0.129]], - [0.957, [0.0, 0.322, 0.129]], - [0.959, [0.0, 0.317, 0.127]], - [0.961, [0.0, 0.317, 0.127]], - [0.963, [0.0, 0.312, 0.125]], - [0.965, [0.0, 0.312, 0.125]], - [0.967, [0.0, 0.307, 0.123]], - [0.969, [0.0, 0.307, 0.123]], - [0.971, [0.0, 0.302, 0.121]], - [0.973, [0.0, 0.302, 0.121]], - [0.975, [0.0, 0.297, 0.118]], - [0.977, [0.0, 0.297, 0.118]], - [0.978, [0.0, 0.292, 0.116]], - [0.98, [0.0, 0.292, 0.116]], - [0.982, [0.0, 0.287, 0.114]], - [0.984, [0.0, 0.287, 0.114]], - [0.986, [0.0, 0.282, 0.112]], - [0.988, [0.0, 0.282, 0.112]], - [0.99, [0.0, 0.277, 0.11]], - [0.992, [0.0, 0.277, 0.11]], - [0.994, [0.0, 0.272, 0.108]], - [0.996, [0.0, 0.272, 0.108]], - [0.998, [0.0, 0.267, 0.106]], - [1.0, [0.0, 0.267, 0.106]], + [0.908, [0, 0.383, 0.154]], + [1, [0, 0.267, 0.106]], ], }, [ColorSchemas.Greys]: { @@ -1080,518 +76,16 @@ export const vislibColorMaps: ColorMap = { defaultMessage: 'Greys', }), value: [ - [0.0, [1.0, 1.0, 1.0]], - [0.002, [1.0, 1.0, 1.0]], - [0.004, [0.998, 0.998, 0.998]], - [0.006, [0.998, 0.998, 0.998]], - [0.008, [0.996, 0.996, 0.996]], - [0.01, [0.996, 0.996, 0.996]], - [0.012, [0.994, 0.994, 0.994]], - [0.014, [0.994, 0.994, 0.994]], - [0.016, [0.993, 0.993, 0.993]], - [0.018, [0.993, 0.993, 0.993]], - [0.02, [0.991, 0.991, 0.991]], - [0.022, [0.991, 0.991, 0.991]], - [0.023, [0.989, 0.989, 0.989]], - [0.025, [0.989, 0.989, 0.989]], - [0.027, [0.987, 0.987, 0.987]], - [0.029, [0.987, 0.987, 0.987]], - [0.031, [0.985, 0.985, 0.985]], - [0.033, [0.985, 0.985, 0.985]], - [0.035, [0.983, 0.983, 0.983]], - [0.037, [0.983, 0.983, 0.983]], - [0.039, [0.982, 0.982, 0.982]], - [0.041, [0.982, 0.982, 0.982]], - [0.043, [0.98, 0.98, 0.98]], - [0.045, [0.98, 0.98, 0.98]], - [0.047, [0.978, 0.978, 0.978]], - [0.049, [0.978, 0.978, 0.978]], - [0.051, [0.976, 0.976, 0.976]], - [0.053, [0.976, 0.976, 0.976]], - [0.055, [0.974, 0.974, 0.974]], - [0.057, [0.974, 0.974, 0.974]], - [0.059, [0.972, 0.972, 0.972]], - [0.061, [0.972, 0.972, 0.972]], - [0.063, [0.97, 0.97, 0.97]], - [0.065, [0.97, 0.97, 0.97]], - [0.067, [0.969, 0.969, 0.969]], - [0.068, [0.969, 0.969, 0.969]], - [0.07, [0.967, 0.967, 0.967]], - [0.072, [0.967, 0.967, 0.967]], - [0.074, [0.965, 0.965, 0.965]], - [0.076, [0.965, 0.965, 0.965]], - [0.078, [0.963, 0.963, 0.963]], - [0.08, [0.963, 0.963, 0.963]], - [0.082, [0.961, 0.961, 0.961]], - [0.084, [0.961, 0.961, 0.961]], - [0.086, [0.959, 0.959, 0.959]], - [0.088, [0.959, 0.959, 0.959]], - [0.09, [0.958, 0.958, 0.958]], - [0.092, [0.958, 0.958, 0.958]], - [0.094, [0.956, 0.956, 0.956]], - [0.096, [0.956, 0.956, 0.956]], - [0.098, [0.954, 0.954, 0.954]], - [0.1, [0.954, 0.954, 0.954]], - [0.102, [0.952, 0.952, 0.952]], - [0.104, [0.952, 0.952, 0.952]], - [0.106, [0.95, 0.95, 0.95]], - [0.108, [0.95, 0.95, 0.95]], - [0.11, [0.948, 0.948, 0.948]], - [0.112, [0.948, 0.948, 0.948]], + [0, [1, 1, 1]], [0.114, [0.946, 0.946, 0.946]], - [0.115, [0.946, 0.946, 0.946]], - [0.117, [0.945, 0.945, 0.945]], - [0.119, [0.945, 0.945, 0.945]], - [0.121, [0.943, 0.943, 0.943]], - [0.123, [0.943, 0.943, 0.943]], - [0.125, [0.941, 0.941, 0.941]], - [0.127, [0.941, 0.941, 0.941]], - [0.129, [0.938, 0.938, 0.938]], - [0.131, [0.938, 0.938, 0.938]], - [0.133, [0.935, 0.935, 0.935]], - [0.135, [0.935, 0.935, 0.935]], - [0.137, [0.932, 0.932, 0.932]], - [0.139, [0.932, 0.932, 0.932]], - [0.141, [0.93, 0.93, 0.93]], - [0.143, [0.93, 0.93, 0.93]], - [0.145, [0.927, 0.927, 0.927]], - [0.147, [0.927, 0.927, 0.927]], - [0.149, [0.924, 0.924, 0.924]], - [0.151, [0.924, 0.924, 0.924]], - [0.153, [0.921, 0.921, 0.921]], - [0.155, [0.921, 0.921, 0.921]], - [0.157, [0.918, 0.918, 0.918]], - [0.159, [0.918, 0.918, 0.918]], - [0.16, [0.915, 0.915, 0.915]], - [0.162, [0.915, 0.915, 0.915]], - [0.164, [0.913, 0.913, 0.913]], - [0.166, [0.913, 0.913, 0.913]], - [0.168, [0.91, 0.91, 0.91]], - [0.17, [0.91, 0.91, 0.91]], - [0.172, [0.907, 0.907, 0.907]], - [0.174, [0.907, 0.907, 0.907]], - [0.176, [0.904, 0.904, 0.904]], - [0.178, [0.904, 0.904, 0.904]], - [0.18, [0.901, 0.901, 0.901]], - [0.182, [0.901, 0.901, 0.901]], - [0.184, [0.898, 0.898, 0.898]], - [0.186, [0.898, 0.898, 0.898]], - [0.188, [0.896, 0.896, 0.896]], - [0.19, [0.896, 0.896, 0.896]], - [0.192, [0.893, 0.893, 0.893]], - [0.194, [0.893, 0.893, 0.893]], - [0.196, [0.89, 0.89, 0.89]], - [0.198, [0.89, 0.89, 0.89]], - [0.2, [0.887, 0.887, 0.887]], - [0.202, [0.887, 0.887, 0.887]], - [0.204, [0.884, 0.884, 0.884]], - [0.205, [0.884, 0.884, 0.884]], - [0.207, [0.881, 0.881, 0.881]], - [0.209, [0.881, 0.881, 0.881]], - [0.211, [0.879, 0.879, 0.879]], - [0.213, [0.879, 0.879, 0.879]], - [0.215, [0.876, 0.876, 0.876]], - [0.217, [0.876, 0.876, 0.876]], - [0.219, [0.873, 0.873, 0.873]], - [0.221, [0.873, 0.873, 0.873]], - [0.223, [0.87, 0.87, 0.87]], - [0.225, [0.87, 0.87, 0.87]], [0.227, [0.867, 0.867, 0.867]], - [0.229, [0.867, 0.867, 0.867]], - [0.231, [0.864, 0.864, 0.864]], - [0.233, [0.864, 0.864, 0.864]], - [0.235, [0.862, 0.862, 0.862]], - [0.237, [0.862, 0.862, 0.862]], - [0.239, [0.859, 0.859, 0.859]], - [0.241, [0.859, 0.859, 0.859]], - [0.243, [0.856, 0.856, 0.856]], - [0.245, [0.856, 0.856, 0.856]], - [0.247, [0.853, 0.853, 0.853]], - [0.249, [0.853, 0.853, 0.853]], - [0.25, [0.85, 0.85, 0.85]], - [0.252, [0.85, 0.85, 0.85]], - [0.254, [0.847, 0.847, 0.847]], - [0.256, [0.847, 0.847, 0.847]], - [0.258, [0.843, 0.843, 0.843]], - [0.26, [0.843, 0.843, 0.843]], - [0.262, [0.84, 0.84, 0.84]], - [0.264, [0.84, 0.84, 0.84]], - [0.266, [0.836, 0.836, 0.836]], - [0.268, [0.836, 0.836, 0.836]], - [0.27, [0.833, 0.833, 0.833]], - [0.272, [0.833, 0.833, 0.833]], - [0.274, [0.829, 0.829, 0.829]], - [0.276, [0.829, 0.829, 0.829]], - [0.278, [0.826, 0.826, 0.826]], - [0.28, [0.826, 0.826, 0.826]], - [0.282, [0.823, 0.823, 0.823]], - [0.284, [0.823, 0.823, 0.823]], - [0.286, [0.819, 0.819, 0.819]], - [0.288, [0.819, 0.819, 0.819]], - [0.29, [0.816, 0.816, 0.816]], - [0.292, [0.816, 0.816, 0.816]], - [0.294, [0.812, 0.812, 0.812]], - [0.295, [0.812, 0.812, 0.812]], - [0.297, [0.809, 0.809, 0.809]], - [0.299, [0.809, 0.809, 0.809]], - [0.301, [0.805, 0.805, 0.805]], - [0.303, [0.805, 0.805, 0.805]], - [0.305, [0.802, 0.802, 0.802]], - [0.307, [0.802, 0.802, 0.802]], - [0.309, [0.798, 0.798, 0.798]], - [0.311, [0.798, 0.798, 0.798]], - [0.313, [0.795, 0.795, 0.795]], - [0.315, [0.795, 0.795, 0.795]], - [0.317, [0.792, 0.792, 0.792]], - [0.319, [0.792, 0.792, 0.792]], - [0.321, [0.788, 0.788, 0.788]], - [0.323, [0.788, 0.788, 0.788]], - [0.325, [0.785, 0.785, 0.785]], - [0.327, [0.785, 0.785, 0.785]], - [0.329, [0.781, 0.781, 0.781]], - [0.331, [0.781, 0.781, 0.781]], - [0.333, [0.778, 0.778, 0.778]], - [0.335, [0.778, 0.778, 0.778]], - [0.337, [0.774, 0.774, 0.774]], - [0.339, [0.774, 0.774, 0.774]], [0.341, [0.771, 0.771, 0.771]], - [0.342, [0.771, 0.771, 0.771]], - [0.344, [0.767, 0.767, 0.767]], - [0.346, [0.767, 0.767, 0.767]], - [0.348, [0.764, 0.764, 0.764]], - [0.35, [0.764, 0.764, 0.764]], - [0.352, [0.761, 0.761, 0.761]], - [0.354, [0.761, 0.761, 0.761]], - [0.356, [0.757, 0.757, 0.757]], - [0.358, [0.757, 0.757, 0.757]], - [0.36, [0.754, 0.754, 0.754]], - [0.362, [0.754, 0.754, 0.754]], - [0.364, [0.75, 0.75, 0.75]], - [0.366, [0.75, 0.75, 0.75]], - [0.368, [0.747, 0.747, 0.747]], - [0.37, [0.747, 0.747, 0.747]], - [0.372, [0.743, 0.743, 0.743]], - [0.374, [0.743, 0.743, 0.743]], - [0.376, [0.739, 0.739, 0.739]], - [0.378, [0.739, 0.739, 0.739]], - [0.38, [0.735, 0.735, 0.735]], - [0.382, [0.735, 0.735, 0.735]], - [0.384, [0.73, 0.73, 0.73]], - [0.386, [0.73, 0.73, 0.73]], - [0.387, [0.725, 0.725, 0.725]], - [0.389, [0.725, 0.725, 0.725]], - [0.391, [0.72, 0.72, 0.72]], - [0.393, [0.72, 0.72, 0.72]], - [0.395, [0.715, 0.715, 0.715]], - [0.397, [0.715, 0.715, 0.715]], - [0.399, [0.711, 0.711, 0.711]], - [0.401, [0.711, 0.711, 0.711]], - [0.403, [0.706, 0.706, 0.706]], - [0.405, [0.706, 0.706, 0.706]], - [0.407, [0.701, 0.701, 0.701]], - [0.409, [0.701, 0.701, 0.701]], - [0.411, [0.696, 0.696, 0.696]], - [0.413, [0.696, 0.696, 0.696]], - [0.415, [0.691, 0.691, 0.691]], - [0.417, [0.691, 0.691, 0.691]], - [0.419, [0.687, 0.687, 0.687]], - [0.421, [0.687, 0.687, 0.687]], - [0.423, [0.682, 0.682, 0.682]], - [0.425, [0.682, 0.682, 0.682]], - [0.427, [0.677, 0.677, 0.677]], - [0.429, [0.677, 0.677, 0.677]], - [0.431, [0.672, 0.672, 0.672]], - [0.432, [0.672, 0.672, 0.672]], - [0.434, [0.667, 0.667, 0.667]], - [0.436, [0.667, 0.667, 0.667]], - [0.438, [0.663, 0.663, 0.663]], - [0.44, [0.663, 0.663, 0.663]], - [0.442, [0.658, 0.658, 0.658]], - [0.444, [0.658, 0.658, 0.658]], - [0.446, [0.653, 0.653, 0.653]], - [0.448, [0.653, 0.653, 0.653]], - [0.45, [0.648, 0.648, 0.648]], - [0.452, [0.648, 0.648, 0.648]], [0.454, [0.643, 0.643, 0.643]], - [0.456, [0.643, 0.643, 0.643]], - [0.458, [0.639, 0.639, 0.639]], - [0.46, [0.639, 0.639, 0.639]], - [0.462, [0.634, 0.634, 0.634]], - [0.464, [0.634, 0.634, 0.634]], - [0.466, [0.629, 0.629, 0.629]], - [0.468, [0.629, 0.629, 0.629]], - [0.47, [0.624, 0.624, 0.624]], - [0.472, [0.624, 0.624, 0.624]], - [0.474, [0.619, 0.619, 0.619]], - [0.476, [0.619, 0.619, 0.619]], - [0.477, [0.615, 0.615, 0.615]], - [0.479, [0.615, 0.615, 0.615]], - [0.481, [0.61, 0.61, 0.61]], - [0.483, [0.61, 0.61, 0.61]], - [0.485, [0.605, 0.605, 0.605]], - [0.487, [0.605, 0.605, 0.605]], - [0.489, [0.6, 0.6, 0.6]], - [0.491, [0.6, 0.6, 0.6]], - [0.493, [0.595, 0.595, 0.595]], - [0.495, [0.595, 0.595, 0.595]], - [0.497, [0.591, 0.591, 0.591]], - [0.499, [0.591, 0.591, 0.591]], - [0.501, [0.586, 0.586, 0.586]], - [0.503, [0.586, 0.586, 0.586]], - [0.505, [0.582, 0.582, 0.582]], - [0.507, [0.582, 0.582, 0.582]], - [0.509, [0.577, 0.577, 0.577]], - [0.511, [0.577, 0.577, 0.577]], - [0.513, [0.573, 0.573, 0.573]], - [0.515, [0.573, 0.573, 0.573]], - [0.517, [0.569, 0.569, 0.569]], - [0.519, [0.569, 0.569, 0.569]], - [0.521, [0.565, 0.565, 0.565]], - [0.523, [0.565, 0.565, 0.565]], - [0.524, [0.56, 0.56, 0.56]], - [0.526, [0.56, 0.56, 0.56]], - [0.528, [0.556, 0.556, 0.556]], - [0.53, [0.556, 0.556, 0.556]], - [0.532, [0.552, 0.552, 0.552]], - [0.534, [0.552, 0.552, 0.552]], - [0.536, [0.547, 0.547, 0.547]], - [0.538, [0.547, 0.547, 0.547]], - [0.54, [0.543, 0.543, 0.543]], - [0.542, [0.543, 0.543, 0.543]], - [0.544, [0.539, 0.539, 0.539]], - [0.546, [0.539, 0.539, 0.539]], - [0.548, [0.534, 0.534, 0.534]], - [0.55, [0.534, 0.534, 0.534]], - [0.552, [0.53, 0.53, 0.53]], - [0.554, [0.53, 0.53, 0.53]], - [0.556, [0.526, 0.526, 0.526]], - [0.558, [0.526, 0.526, 0.526]], - [0.56, [0.521, 0.521, 0.521]], - [0.562, [0.521, 0.521, 0.521]], - [0.564, [0.517, 0.517, 0.517]], - [0.566, [0.517, 0.517, 0.517]], [0.568, [0.513, 0.513, 0.513]], - [0.569, [0.513, 0.513, 0.513]], - [0.571, [0.509, 0.509, 0.509]], - [0.573, [0.509, 0.509, 0.509]], - [0.575, [0.504, 0.504, 0.504]], - [0.577, [0.504, 0.504, 0.504]], - [0.579, [0.5, 0.5, 0.5]], - [0.581, [0.5, 0.5, 0.5]], - [0.583, [0.496, 0.496, 0.496]], - [0.585, [0.496, 0.496, 0.496]], - [0.587, [0.491, 0.491, 0.491]], - [0.589, [0.491, 0.491, 0.491]], - [0.591, [0.487, 0.487, 0.487]], - [0.593, [0.487, 0.487, 0.487]], - [0.595, [0.483, 0.483, 0.483]], - [0.597, [0.483, 0.483, 0.483]], - [0.599, [0.478, 0.478, 0.478]], - [0.601, [0.478, 0.478, 0.478]], - [0.603, [0.474, 0.474, 0.474]], - [0.605, [0.474, 0.474, 0.474]], - [0.607, [0.47, 0.47, 0.47]], - [0.609, [0.47, 0.47, 0.47]], - [0.611, [0.466, 0.466, 0.466]], - [0.613, [0.466, 0.466, 0.466]], - [0.614, [0.461, 0.461, 0.461]], - [0.616, [0.461, 0.461, 0.461]], - [0.618, [0.457, 0.457, 0.457]], - [0.62, [0.457, 0.457, 0.457]], - [0.622, [0.453, 0.453, 0.453]], - [0.624, [0.453, 0.453, 0.453]], - [0.626, [0.448, 0.448, 0.448]], - [0.628, [0.448, 0.448, 0.448]], - [0.63, [0.444, 0.444, 0.444]], - [0.632, [0.444, 0.444, 0.444]], - [0.634, [0.44, 0.44, 0.44]], - [0.636, [0.44, 0.44, 0.44]], - [0.638, [0.436, 0.436, 0.436]], - [0.64, [0.436, 0.436, 0.436]], - [0.642, [0.432, 0.432, 0.432]], - [0.644, [0.432, 0.432, 0.432]], - [0.646, [0.428, 0.428, 0.428]], - [0.648, [0.428, 0.428, 0.428]], - [0.65, [0.424, 0.424, 0.424]], - [0.652, [0.424, 0.424, 0.424]], - [0.654, [0.42, 0.42, 0.42]], - [0.656, [0.42, 0.42, 0.42]], - [0.658, [0.416, 0.416, 0.416]], - [0.659, [0.416, 0.416, 0.416]], - [0.661, [0.412, 0.412, 0.412]], - [0.663, [0.412, 0.412, 0.412]], - [0.665, [0.408, 0.408, 0.408]], - [0.667, [0.408, 0.408, 0.408]], - [0.669, [0.404, 0.404, 0.404]], - [0.671, [0.404, 0.404, 0.404]], - [0.673, [0.4, 0.4, 0.4]], - [0.675, [0.4, 0.4, 0.4]], - [0.677, [0.396, 0.396, 0.396]], - [0.679, [0.396, 0.396, 0.396]], [0.681, [0.392, 0.392, 0.392]], - [0.683, [0.392, 0.392, 0.392]], - [0.685, [0.388, 0.388, 0.388]], - [0.687, [0.388, 0.388, 0.388]], - [0.689, [0.383, 0.383, 0.383]], - [0.691, [0.383, 0.383, 0.383]], - [0.693, [0.379, 0.379, 0.379]], - [0.695, [0.379, 0.379, 0.379]], - [0.697, [0.375, 0.375, 0.375]], - [0.699, [0.375, 0.375, 0.375]], - [0.701, [0.371, 0.371, 0.371]], - [0.703, [0.371, 0.371, 0.371]], - [0.705, [0.367, 0.367, 0.367]], - [0.706, [0.367, 0.367, 0.367]], - [0.708, [0.363, 0.363, 0.363]], - [0.71, [0.363, 0.363, 0.363]], - [0.712, [0.359, 0.359, 0.359]], - [0.714, [0.359, 0.359, 0.359]], - [0.716, [0.355, 0.355, 0.355]], - [0.718, [0.355, 0.355, 0.355]], - [0.72, [0.351, 0.351, 0.351]], - [0.722, [0.351, 0.351, 0.351]], - [0.724, [0.347, 0.347, 0.347]], - [0.726, [0.347, 0.347, 0.347]], - [0.728, [0.343, 0.343, 0.343]], - [0.73, [0.343, 0.343, 0.343]], - [0.732, [0.339, 0.339, 0.339]], - [0.734, [0.339, 0.339, 0.339]], - [0.736, [0.335, 0.335, 0.335]], - [0.738, [0.335, 0.335, 0.335]], - [0.74, [0.331, 0.331, 0.331]], - [0.742, [0.331, 0.331, 0.331]], - [0.744, [0.327, 0.327, 0.327]], - [0.746, [0.327, 0.327, 0.327]], - [0.748, [0.323, 0.323, 0.323]], - [0.75, [0.323, 0.323, 0.323]], - [0.751, [0.317, 0.317, 0.317]], - [0.753, [0.317, 0.317, 0.317]], - [0.755, [0.312, 0.312, 0.312]], - [0.757, [0.312, 0.312, 0.312]], - [0.759, [0.306, 0.306, 0.306]], - [0.761, [0.306, 0.306, 0.306]], - [0.763, [0.301, 0.301, 0.301]], - [0.765, [0.301, 0.301, 0.301]], - [0.767, [0.295, 0.295, 0.295]], - [0.769, [0.295, 0.295, 0.295]], - [0.771, [0.29, 0.29, 0.29]], - [0.773, [0.29, 0.29, 0.29]], - [0.775, [0.284, 0.284, 0.284]], - [0.777, [0.284, 0.284, 0.284]], - [0.779, [0.279, 0.279, 0.279]], - [0.781, [0.279, 0.279, 0.279]], - [0.783, [0.273, 0.273, 0.273]], - [0.785, [0.273, 0.273, 0.273]], - [0.787, [0.268, 0.268, 0.268]], - [0.789, [0.268, 0.268, 0.268]], - [0.791, [0.262, 0.262, 0.262]], - [0.793, [0.262, 0.262, 0.262]], [0.795, [0.257, 0.257, 0.257]], - [0.796, [0.257, 0.257, 0.257]], - [0.798, [0.251, 0.251, 0.251]], - [0.8, [0.251, 0.251, 0.251]], - [0.802, [0.245, 0.245, 0.245]], - [0.804, [0.245, 0.245, 0.245]], - [0.806, [0.24, 0.24, 0.24]], - [0.808, [0.24, 0.24, 0.24]], - [0.81, [0.234, 0.234, 0.234]], - [0.812, [0.234, 0.234, 0.234]], - [0.814, [0.229, 0.229, 0.229]], - [0.816, [0.229, 0.229, 0.229]], - [0.818, [0.223, 0.223, 0.223]], - [0.82, [0.223, 0.223, 0.223]], - [0.822, [0.218, 0.218, 0.218]], - [0.824, [0.218, 0.218, 0.218]], - [0.826, [0.212, 0.212, 0.212]], - [0.828, [0.212, 0.212, 0.212]], - [0.83, [0.207, 0.207, 0.207]], - [0.832, [0.207, 0.207, 0.207]], - [0.834, [0.201, 0.201, 0.201]], - [0.836, [0.201, 0.201, 0.201]], - [0.838, [0.196, 0.196, 0.196]], - [0.84, [0.196, 0.196, 0.196]], - [0.841, [0.19, 0.19, 0.19]], - [0.843, [0.19, 0.19, 0.19]], - [0.845, [0.185, 0.185, 0.185]], - [0.847, [0.185, 0.185, 0.185]], - [0.849, [0.179, 0.179, 0.179]], - [0.851, [0.179, 0.179, 0.179]], - [0.853, [0.173, 0.173, 0.173]], - [0.855, [0.173, 0.173, 0.173]], - [0.857, [0.168, 0.168, 0.168]], - [0.859, [0.168, 0.168, 0.168]], - [0.861, [0.162, 0.162, 0.162]], - [0.863, [0.162, 0.162, 0.162]], - [0.865, [0.157, 0.157, 0.157]], - [0.867, [0.157, 0.157, 0.157]], - [0.869, [0.151, 0.151, 0.151]], - [0.871, [0.151, 0.151, 0.151]], - [0.873, [0.146, 0.146, 0.146]], - [0.875, [0.146, 0.146, 0.146]], - [0.877, [0.141, 0.141, 0.141]], - [0.879, [0.141, 0.141, 0.141]], - [0.881, [0.137, 0.137, 0.137]], - [0.883, [0.137, 0.137, 0.137]], - [0.885, [0.132, 0.132, 0.132]], - [0.886, [0.132, 0.132, 0.132]], - [0.888, [0.127, 0.127, 0.127]], - [0.89, [0.127, 0.127, 0.127]], - [0.892, [0.123, 0.123, 0.123]], - [0.894, [0.123, 0.123, 0.123]], - [0.896, [0.118, 0.118, 0.118]], - [0.898, [0.118, 0.118, 0.118]], - [0.9, [0.114, 0.114, 0.114]], - [0.902, [0.114, 0.114, 0.114]], - [0.904, [0.109, 0.109, 0.109]], - [0.906, [0.109, 0.109, 0.109]], [0.908, [0.105, 0.105, 0.105]], - [0.91, [0.105, 0.105, 0.105]], - [0.912, [0.1, 0.1, 0.1]], - [0.914, [0.1, 0.1, 0.1]], - [0.916, [0.096, 0.096, 0.096]], - [0.918, [0.096, 0.096, 0.096]], - [0.92, [0.091, 0.091, 0.091]], - [0.922, [0.091, 0.091, 0.091]], - [0.924, [0.086, 0.086, 0.086]], - [0.926, [0.086, 0.086, 0.086]], - [0.928, [0.082, 0.082, 0.082]], - [0.93, [0.082, 0.082, 0.082]], - [0.932, [0.077, 0.077, 0.077]], - [0.933, [0.077, 0.077, 0.077]], - [0.935, [0.073, 0.073, 0.073]], - [0.937, [0.073, 0.073, 0.073]], - [0.939, [0.068, 0.068, 0.068]], - [0.941, [0.068, 0.068, 0.068]], - [0.943, [0.064, 0.064, 0.064]], - [0.945, [0.064, 0.064, 0.064]], - [0.947, [0.059, 0.059, 0.059]], - [0.949, [0.059, 0.059, 0.059]], - [0.951, [0.055, 0.055, 0.055]], - [0.953, [0.055, 0.055, 0.055]], - [0.955, [0.05, 0.05, 0.05]], - [0.957, [0.05, 0.05, 0.05]], - [0.959, [0.046, 0.046, 0.046]], - [0.961, [0.046, 0.046, 0.046]], - [0.963, [0.041, 0.041, 0.041]], - [0.965, [0.041, 0.041, 0.041]], - [0.967, [0.036, 0.036, 0.036]], - [0.969, [0.036, 0.036, 0.036]], - [0.971, [0.032, 0.032, 0.032]], - [0.973, [0.032, 0.032, 0.032]], - [0.975, [0.027, 0.027, 0.027]], - [0.977, [0.027, 0.027, 0.027]], - [0.978, [0.023, 0.023, 0.023]], - [0.98, [0.023, 0.023, 0.023]], - [0.982, [0.018, 0.018, 0.018]], - [0.984, [0.018, 0.018, 0.018]], - [0.986, [0.014, 0.014, 0.014]], - [0.988, [0.014, 0.014, 0.014]], - [0.99, [0.009, 0.009, 0.009]], - [0.992, [0.009, 0.009, 0.009]], - [0.994, [0.005, 0.005, 0.005]], - [0.996, [0.005, 0.005, 0.005]], - [0.998, [0.0, 0.0, 0.0]], - [1.0, [0.0, 0.0, 0.0]], + [1, [0, 0, 0]], ], }, [ColorSchemas.Reds]: { @@ -1600,518 +94,16 @@ export const vislibColorMaps: ColorMap = { defaultMessage: 'Reds', }), value: [ - [0.0, [1.0, 0.961, 0.941]], - [0.002, [1.0, 0.961, 0.941]], - [0.004, [1.0, 0.958, 0.937]], - [0.006, [1.0, 0.958, 0.937]], - [0.008, [1.0, 0.956, 0.934]], - [0.01, [1.0, 0.956, 0.934]], - [0.012, [1.0, 0.953, 0.93]], - [0.014, [1.0, 0.953, 0.93]], - [0.016, [1.0, 0.95, 0.926]], - [0.018, [1.0, 0.95, 0.926]], - [0.02, [0.999, 0.948, 0.923]], - [0.022, [0.999, 0.948, 0.923]], - [0.023, [0.999, 0.945, 0.919]], - [0.025, [0.999, 0.945, 0.919]], - [0.027, [0.999, 0.943, 0.915]], - [0.029, [0.999, 0.943, 0.915]], - [0.031, [0.999, 0.94, 0.912]], - [0.033, [0.999, 0.94, 0.912]], - [0.035, [0.999, 0.938, 0.908]], - [0.037, [0.999, 0.938, 0.908]], - [0.039, [0.999, 0.935, 0.904]], - [0.041, [0.999, 0.935, 0.904]], - [0.043, [0.999, 0.932, 0.901]], - [0.045, [0.999, 0.932, 0.901]], - [0.047, [0.999, 0.93, 0.897]], - [0.049, [0.999, 0.93, 0.897]], - [0.051, [0.998, 0.927, 0.893]], - [0.053, [0.998, 0.927, 0.893]], - [0.055, [0.998, 0.925, 0.89]], - [0.057, [0.998, 0.925, 0.89]], - [0.059, [0.998, 0.922, 0.886]], - [0.061, [0.998, 0.922, 0.886]], - [0.063, [0.998, 0.919, 0.882]], - [0.065, [0.998, 0.919, 0.882]], - [0.067, [0.998, 0.917, 0.878]], - [0.068, [0.998, 0.917, 0.878]], - [0.07, [0.998, 0.914, 0.875]], - [0.072, [0.998, 0.914, 0.875]], - [0.074, [0.998, 0.912, 0.871]], - [0.076, [0.998, 0.912, 0.871]], - [0.078, [0.998, 0.909, 0.867]], - [0.08, [0.998, 0.909, 0.867]], - [0.082, [0.997, 0.907, 0.864]], - [0.084, [0.997, 0.907, 0.864]], - [0.086, [0.997, 0.904, 0.86]], - [0.088, [0.997, 0.904, 0.86]], - [0.09, [0.997, 0.901, 0.856]], - [0.092, [0.997, 0.901, 0.856]], - [0.094, [0.997, 0.899, 0.853]], - [0.096, [0.997, 0.899, 0.853]], - [0.098, [0.997, 0.896, 0.849]], - [0.1, [0.997, 0.896, 0.849]], - [0.102, [0.997, 0.894, 0.845]], - [0.104, [0.997, 0.894, 0.845]], - [0.106, [0.997, 0.891, 0.842]], - [0.108, [0.997, 0.891, 0.842]], - [0.11, [0.997, 0.888, 0.838]], - [0.112, [0.997, 0.888, 0.838]], + [0, [1, 0.961, 0.941]], [0.114, [0.996, 0.886, 0.834]], - [0.115, [0.996, 0.886, 0.834]], - [0.117, [0.996, 0.883, 0.83]], - [0.119, [0.996, 0.883, 0.83]], - [0.121, [0.996, 0.881, 0.827]], - [0.123, [0.996, 0.881, 0.827]], - [0.125, [0.996, 0.878, 0.823]], - [0.127, [0.996, 0.878, 0.823]], - [0.129, [0.996, 0.873, 0.817]], - [0.131, [0.996, 0.873, 0.817]], - [0.133, [0.996, 0.869, 0.811]], - [0.135, [0.996, 0.869, 0.811]], - [0.137, [0.995, 0.864, 0.805]], - [0.139, [0.995, 0.864, 0.805]], - [0.141, [0.995, 0.86, 0.799]], - [0.143, [0.995, 0.86, 0.799]], - [0.145, [0.995, 0.855, 0.793]], - [0.147, [0.995, 0.855, 0.793]], - [0.149, [0.995, 0.851, 0.787]], - [0.151, [0.995, 0.851, 0.787]], - [0.153, [0.994, 0.846, 0.781]], - [0.155, [0.994, 0.846, 0.781]], - [0.157, [0.994, 0.841, 0.775]], - [0.159, [0.994, 0.841, 0.775]], - [0.16, [0.994, 0.837, 0.769]], - [0.162, [0.994, 0.837, 0.769]], - [0.164, [0.994, 0.832, 0.762]], - [0.166, [0.994, 0.832, 0.762]], - [0.168, [0.993, 0.828, 0.756]], - [0.17, [0.993, 0.828, 0.756]], - [0.172, [0.993, 0.823, 0.75]], - [0.174, [0.993, 0.823, 0.75]], - [0.176, [0.993, 0.819, 0.744]], - [0.178, [0.993, 0.819, 0.744]], - [0.18, [0.993, 0.814, 0.738]], - [0.182, [0.993, 0.814, 0.738]], - [0.184, [0.992, 0.81, 0.732]], - [0.186, [0.992, 0.81, 0.732]], - [0.188, [0.992, 0.805, 0.726]], - [0.19, [0.992, 0.805, 0.726]], - [0.192, [0.992, 0.8, 0.72]], - [0.194, [0.992, 0.8, 0.72]], - [0.196, [0.992, 0.796, 0.714]], - [0.198, [0.992, 0.796, 0.714]], - [0.2, [0.991, 0.791, 0.708]], - [0.202, [0.991, 0.791, 0.708]], - [0.204, [0.991, 0.787, 0.702]], - [0.205, [0.991, 0.787, 0.702]], - [0.207, [0.991, 0.782, 0.696]], - [0.209, [0.991, 0.782, 0.696]], - [0.211, [0.991, 0.778, 0.69]], - [0.213, [0.991, 0.778, 0.69]], - [0.215, [0.99, 0.773, 0.684]], - [0.217, [0.99, 0.773, 0.684]], - [0.219, [0.99, 0.769, 0.678]], - [0.221, [0.99, 0.769, 0.678]], - [0.223, [0.99, 0.764, 0.672]], - [0.225, [0.99, 0.764, 0.672]], [0.227, [0.99, 0.76, 0.666]], - [0.229, [0.99, 0.76, 0.666]], - [0.231, [0.989, 0.755, 0.66]], - [0.233, [0.989, 0.755, 0.66]], - [0.235, [0.989, 0.75, 0.654]], - [0.237, [0.989, 0.75, 0.654]], - [0.239, [0.989, 0.746, 0.648]], - [0.241, [0.989, 0.746, 0.648]], - [0.243, [0.989, 0.741, 0.642]], - [0.245, [0.989, 0.741, 0.642]], - [0.247, [0.988, 0.737, 0.636]], - [0.249, [0.988, 0.737, 0.636]], - [0.25, [0.988, 0.732, 0.63]], - [0.252, [0.988, 0.732, 0.63]], - [0.254, [0.988, 0.727, 0.624]], - [0.256, [0.988, 0.727, 0.624]], - [0.258, [0.988, 0.722, 0.618]], - [0.26, [0.988, 0.722, 0.618]], - [0.262, [0.988, 0.717, 0.613]], - [0.264, [0.988, 0.717, 0.613]], - [0.266, [0.988, 0.712, 0.607]], - [0.268, [0.988, 0.712, 0.607]], - [0.27, [0.988, 0.707, 0.601]], - [0.272, [0.988, 0.707, 0.601]], - [0.274, [0.988, 0.702, 0.595]], - [0.276, [0.988, 0.702, 0.595]], - [0.278, [0.988, 0.697, 0.589]], - [0.28, [0.988, 0.697, 0.589]], - [0.282, [0.988, 0.692, 0.584]], - [0.284, [0.988, 0.692, 0.584]], - [0.286, [0.988, 0.687, 0.578]], - [0.288, [0.988, 0.687, 0.578]], - [0.29, [0.988, 0.682, 0.572]], - [0.292, [0.988, 0.682, 0.572]], - [0.294, [0.988, 0.677, 0.566]], - [0.295, [0.988, 0.677, 0.566]], - [0.297, [0.988, 0.672, 0.561]], - [0.299, [0.988, 0.672, 0.561]], - [0.301, [0.988, 0.666, 0.555]], - [0.303, [0.988, 0.666, 0.555]], - [0.305, [0.988, 0.661, 0.549]], - [0.307, [0.988, 0.661, 0.549]], - [0.309, [0.988, 0.656, 0.543]], - [0.311, [0.988, 0.656, 0.543]], - [0.313, [0.988, 0.651, 0.537]], - [0.315, [0.988, 0.651, 0.537]], - [0.317, [0.988, 0.646, 0.532]], - [0.319, [0.988, 0.646, 0.532]], - [0.321, [0.988, 0.641, 0.526]], - [0.323, [0.988, 0.641, 0.526]], - [0.325, [0.988, 0.636, 0.52]], - [0.327, [0.988, 0.636, 0.52]], - [0.329, [0.988, 0.631, 0.514]], - [0.331, [0.988, 0.631, 0.514]], - [0.333, [0.988, 0.626, 0.508]], - [0.335, [0.988, 0.626, 0.508]], - [0.337, [0.988, 0.621, 0.503]], - [0.339, [0.988, 0.621, 0.503]], [0.341, [0.988, 0.616, 0.497]], - [0.342, [0.988, 0.616, 0.497]], - [0.344, [0.988, 0.611, 0.491]], - [0.346, [0.988, 0.611, 0.491]], - [0.348, [0.988, 0.606, 0.485]], - [0.35, [0.988, 0.606, 0.485]], - [0.352, [0.988, 0.601, 0.48]], - [0.354, [0.988, 0.601, 0.48]], - [0.356, [0.988, 0.596, 0.474]], - [0.358, [0.988, 0.596, 0.474]], - [0.36, [0.988, 0.591, 0.468]], - [0.362, [0.988, 0.591, 0.468]], - [0.364, [0.988, 0.586, 0.462]], - [0.366, [0.988, 0.586, 0.462]], - [0.368, [0.988, 0.581, 0.456]], - [0.37, [0.988, 0.581, 0.456]], - [0.372, [0.988, 0.576, 0.451]], - [0.374, [0.988, 0.576, 0.451]], - [0.376, [0.988, 0.571, 0.445]], - [0.378, [0.988, 0.571, 0.445]], - [0.38, [0.988, 0.566, 0.44]], - [0.382, [0.988, 0.566, 0.44]], - [0.384, [0.988, 0.561, 0.435]], - [0.386, [0.988, 0.561, 0.435]], - [0.387, [0.988, 0.556, 0.43]], - [0.389, [0.988, 0.556, 0.43]], - [0.391, [0.988, 0.551, 0.426]], - [0.393, [0.988, 0.551, 0.426]], - [0.395, [0.988, 0.546, 0.421]], - [0.397, [0.988, 0.546, 0.421]], - [0.399, [0.987, 0.541, 0.416]], - [0.401, [0.987, 0.541, 0.416]], - [0.403, [0.987, 0.536, 0.411]], - [0.405, [0.987, 0.536, 0.411]], - [0.407, [0.987, 0.531, 0.406]], - [0.409, [0.987, 0.531, 0.406]], - [0.411, [0.987, 0.526, 0.401]], - [0.413, [0.987, 0.526, 0.401]], - [0.415, [0.987, 0.521, 0.396]], - [0.417, [0.987, 0.521, 0.396]], - [0.419, [0.987, 0.517, 0.391]], - [0.421, [0.987, 0.517, 0.391]], - [0.423, [0.987, 0.512, 0.386]], - [0.425, [0.987, 0.512, 0.386]], - [0.427, [0.987, 0.507, 0.381]], - [0.429, [0.987, 0.507, 0.381]], - [0.431, [0.986, 0.502, 0.376]], - [0.432, [0.986, 0.502, 0.376]], - [0.434, [0.986, 0.497, 0.371]], - [0.436, [0.986, 0.497, 0.371]], - [0.438, [0.986, 0.492, 0.366]], - [0.44, [0.986, 0.492, 0.366]], - [0.442, [0.986, 0.487, 0.362]], - [0.444, [0.986, 0.487, 0.362]], - [0.446, [0.986, 0.482, 0.357]], - [0.448, [0.986, 0.482, 0.357]], - [0.45, [0.986, 0.477, 0.352]], - [0.452, [0.986, 0.477, 0.352]], [0.454, [0.986, 0.472, 0.347]], - [0.456, [0.986, 0.472, 0.347]], - [0.458, [0.986, 0.467, 0.342]], - [0.46, [0.986, 0.467, 0.342]], - [0.462, [0.985, 0.462, 0.337]], - [0.464, [0.985, 0.462, 0.337]], - [0.466, [0.985, 0.458, 0.332]], - [0.468, [0.985, 0.458, 0.332]], - [0.47, [0.985, 0.453, 0.327]], - [0.472, [0.985, 0.453, 0.327]], - [0.474, [0.985, 0.448, 0.322]], - [0.476, [0.985, 0.448, 0.322]], - [0.477, [0.985, 0.443, 0.317]], - [0.479, [0.985, 0.443, 0.317]], - [0.481, [0.985, 0.438, 0.312]], - [0.483, [0.985, 0.438, 0.312]], - [0.485, [0.985, 0.433, 0.307]], - [0.487, [0.985, 0.433, 0.307]], - [0.489, [0.985, 0.428, 0.302]], - [0.491, [0.985, 0.428, 0.302]], - [0.493, [0.984, 0.423, 0.298]], - [0.495, [0.984, 0.423, 0.298]], - [0.497, [0.984, 0.418, 0.293]], - [0.499, [0.984, 0.418, 0.293]], - [0.501, [0.984, 0.413, 0.288]], - [0.503, [0.984, 0.413, 0.288]], - [0.505, [0.982, 0.407, 0.285]], - [0.507, [0.982, 0.407, 0.285]], - [0.509, [0.981, 0.401, 0.281]], - [0.511, [0.981, 0.401, 0.281]], - [0.513, [0.979, 0.395, 0.277]], - [0.515, [0.979, 0.395, 0.277]], - [0.517, [0.978, 0.39, 0.274]], - [0.519, [0.978, 0.39, 0.274]], - [0.521, [0.976, 0.384, 0.27]], - [0.523, [0.976, 0.384, 0.27]], - [0.524, [0.975, 0.378, 0.266]], - [0.526, [0.975, 0.378, 0.266]], - [0.528, [0.973, 0.372, 0.263]], - [0.53, [0.973, 0.372, 0.263]], - [0.532, [0.972, 0.367, 0.259]], - [0.534, [0.972, 0.367, 0.259]], - [0.536, [0.97, 0.361, 0.255]], - [0.538, [0.97, 0.361, 0.255]], - [0.54, [0.969, 0.355, 0.251]], - [0.542, [0.969, 0.355, 0.251]], - [0.544, [0.967, 0.349, 0.248]], - [0.546, [0.967, 0.349, 0.248]], - [0.548, [0.966, 0.343, 0.244]], - [0.55, [0.966, 0.343, 0.244]], - [0.552, [0.964, 0.338, 0.24]], - [0.554, [0.964, 0.338, 0.24]], - [0.556, [0.963, 0.332, 0.237]], - [0.558, [0.963, 0.332, 0.237]], - [0.56, [0.961, 0.326, 0.233]], - [0.562, [0.961, 0.326, 0.233]], - [0.564, [0.96, 0.32, 0.229]], - [0.566, [0.96, 0.32, 0.229]], [0.568, [0.958, 0.314, 0.226]], - [0.569, [0.958, 0.314, 0.226]], - [0.571, [0.957, 0.309, 0.222]], - [0.573, [0.957, 0.309, 0.222]], - [0.575, [0.956, 0.303, 0.218]], - [0.577, [0.956, 0.303, 0.218]], - [0.579, [0.954, 0.297, 0.215]], - [0.581, [0.954, 0.297, 0.215]], - [0.583, [0.953, 0.291, 0.211]], - [0.585, [0.953, 0.291, 0.211]], - [0.587, [0.951, 0.286, 0.207]], - [0.589, [0.951, 0.286, 0.207]], - [0.591, [0.95, 0.28, 0.203]], - [0.593, [0.95, 0.28, 0.203]], - [0.595, [0.948, 0.274, 0.2]], - [0.597, [0.948, 0.274, 0.2]], - [0.599, [0.947, 0.268, 0.196]], - [0.601, [0.947, 0.268, 0.196]], - [0.603, [0.945, 0.262, 0.192]], - [0.605, [0.945, 0.262, 0.192]], - [0.607, [0.944, 0.257, 0.189]], - [0.609, [0.944, 0.257, 0.189]], - [0.611, [0.942, 0.251, 0.185]], - [0.613, [0.942, 0.251, 0.185]], - [0.614, [0.941, 0.245, 0.181]], - [0.616, [0.941, 0.245, 0.181]], - [0.618, [0.939, 0.239, 0.178]], - [0.62, [0.939, 0.239, 0.178]], - [0.622, [0.938, 0.234, 0.174]], - [0.624, [0.938, 0.234, 0.174]], - [0.626, [0.934, 0.229, 0.171]], - [0.628, [0.934, 0.229, 0.171]], - [0.63, [0.93, 0.224, 0.17]], - [0.632, [0.93, 0.224, 0.17]], - [0.634, [0.926, 0.22, 0.168]], - [0.636, [0.926, 0.22, 0.168]], - [0.638, [0.921, 0.216, 0.166]], - [0.64, [0.921, 0.216, 0.166]], - [0.642, [0.917, 0.211, 0.164]], - [0.644, [0.917, 0.211, 0.164]], - [0.646, [0.912, 0.207, 0.162]], - [0.648, [0.912, 0.207, 0.162]], - [0.65, [0.908, 0.203, 0.16]], - [0.652, [0.908, 0.203, 0.16]], - [0.654, [0.903, 0.199, 0.158]], - [0.656, [0.903, 0.199, 0.158]], - [0.658, [0.899, 0.194, 0.157]], - [0.659, [0.899, 0.194, 0.157]], - [0.661, [0.895, 0.19, 0.155]], - [0.663, [0.895, 0.19, 0.155]], - [0.665, [0.89, 0.186, 0.153]], - [0.667, [0.89, 0.186, 0.153]], - [0.669, [0.886, 0.181, 0.151]], - [0.671, [0.886, 0.181, 0.151]], - [0.673, [0.881, 0.177, 0.149]], - [0.675, [0.881, 0.177, 0.149]], - [0.677, [0.877, 0.173, 0.147]], - [0.679, [0.877, 0.173, 0.147]], [0.681, [0.872, 0.168, 0.146]], - [0.683, [0.872, 0.168, 0.146]], - [0.685, [0.868, 0.164, 0.144]], - [0.687, [0.868, 0.164, 0.144]], - [0.689, [0.864, 0.16, 0.142]], - [0.691, [0.864, 0.16, 0.142]], - [0.693, [0.859, 0.155, 0.14]], - [0.695, [0.859, 0.155, 0.14]], - [0.697, [0.855, 0.151, 0.138]], - [0.699, [0.855, 0.151, 0.138]], - [0.701, [0.85, 0.147, 0.136]], - [0.703, [0.85, 0.147, 0.136]], - [0.705, [0.846, 0.143, 0.134]], - [0.706, [0.846, 0.143, 0.134]], - [0.708, [0.841, 0.138, 0.133]], - [0.71, [0.841, 0.138, 0.133]], - [0.712, [0.837, 0.134, 0.131]], - [0.714, [0.837, 0.134, 0.131]], - [0.716, [0.833, 0.13, 0.129]], - [0.718, [0.833, 0.13, 0.129]], - [0.72, [0.828, 0.125, 0.127]], - [0.722, [0.828, 0.125, 0.127]], - [0.724, [0.824, 0.121, 0.125]], - [0.726, [0.824, 0.121, 0.125]], - [0.728, [0.819, 0.117, 0.123]], - [0.73, [0.819, 0.117, 0.123]], - [0.732, [0.815, 0.112, 0.122]], - [0.734, [0.815, 0.112, 0.122]], - [0.736, [0.81, 0.108, 0.12]], - [0.738, [0.81, 0.108, 0.12]], - [0.74, [0.806, 0.104, 0.118]], - [0.742, [0.806, 0.104, 0.118]], - [0.744, [0.802, 0.1, 0.116]], - [0.746, [0.802, 0.1, 0.116]], - [0.748, [0.797, 0.095, 0.114]], - [0.75, [0.797, 0.095, 0.114]], - [0.751, [0.793, 0.093, 0.113]], - [0.753, [0.793, 0.093, 0.113]], - [0.755, [0.788, 0.092, 0.112]], - [0.757, [0.788, 0.092, 0.112]], - [0.759, [0.783, 0.091, 0.111]], - [0.761, [0.783, 0.091, 0.111]], - [0.763, [0.779, 0.09, 0.11]], - [0.765, [0.779, 0.09, 0.11]], - [0.767, [0.774, 0.089, 0.109]], - [0.769, [0.774, 0.089, 0.109]], - [0.771, [0.769, 0.088, 0.108]], - [0.773, [0.769, 0.088, 0.108]], - [0.775, [0.765, 0.087, 0.107]], - [0.777, [0.765, 0.087, 0.107]], - [0.779, [0.76, 0.086, 0.106]], - [0.781, [0.76, 0.086, 0.106]], - [0.783, [0.755, 0.084, 0.105]], - [0.785, [0.755, 0.084, 0.105]], - [0.787, [0.75, 0.083, 0.104]], - [0.789, [0.75, 0.083, 0.104]], - [0.791, [0.746, 0.082, 0.103]], - [0.793, [0.746, 0.082, 0.103]], [0.795, [0.741, 0.081, 0.102]], - [0.796, [0.741, 0.081, 0.102]], - [0.798, [0.736, 0.08, 0.101]], - [0.8, [0.736, 0.08, 0.101]], - [0.802, [0.732, 0.079, 0.1]], - [0.804, [0.732, 0.079, 0.1]], - [0.806, [0.727, 0.078, 0.099]], - [0.808, [0.727, 0.078, 0.099]], - [0.81, [0.722, 0.077, 0.098]], - [0.812, [0.722, 0.077, 0.098]], - [0.814, [0.718, 0.076, 0.097]], - [0.816, [0.718, 0.076, 0.097]], - [0.818, [0.713, 0.074, 0.096]], - [0.82, [0.713, 0.074, 0.096]], - [0.822, [0.708, 0.073, 0.095]], - [0.824, [0.708, 0.073, 0.095]], - [0.826, [0.704, 0.072, 0.094]], - [0.828, [0.704, 0.072, 0.094]], - [0.83, [0.699, 0.071, 0.093]], - [0.832, [0.699, 0.071, 0.093]], - [0.834, [0.694, 0.07, 0.092]], - [0.836, [0.694, 0.07, 0.092]], - [0.838, [0.69, 0.069, 0.091]], - [0.84, [0.69, 0.069, 0.091]], - [0.841, [0.685, 0.068, 0.09]], - [0.843, [0.685, 0.068, 0.09]], - [0.845, [0.68, 0.067, 0.089]], - [0.847, [0.68, 0.067, 0.089]], - [0.849, [0.676, 0.066, 0.088]], - [0.851, [0.676, 0.066, 0.088]], - [0.853, [0.671, 0.064, 0.087]], - [0.855, [0.671, 0.064, 0.087]], - [0.857, [0.666, 0.063, 0.086]], - [0.859, [0.666, 0.063, 0.086]], - [0.861, [0.662, 0.062, 0.085]], - [0.863, [0.662, 0.062, 0.085]], - [0.865, [0.657, 0.061, 0.084]], - [0.867, [0.657, 0.061, 0.084]], - [0.869, [0.652, 0.06, 0.083]], - [0.871, [0.652, 0.06, 0.083]], - [0.873, [0.648, 0.059, 0.082]], - [0.875, [0.648, 0.059, 0.082]], - [0.877, [0.64, 0.057, 0.081]], - [0.879, [0.64, 0.057, 0.081]], - [0.881, [0.633, 0.055, 0.081]], - [0.883, [0.633, 0.055, 0.081]], - [0.885, [0.625, 0.054, 0.08]], - [0.886, [0.625, 0.054, 0.08]], - [0.888, [0.618, 0.052, 0.079]], - [0.89, [0.618, 0.052, 0.079]], - [0.892, [0.61, 0.05, 0.078]], - [0.894, [0.61, 0.05, 0.078]], - [0.896, [0.602, 0.048, 0.077]], - [0.898, [0.602, 0.048, 0.077]], - [0.9, [0.595, 0.046, 0.076]], - [0.902, [0.595, 0.046, 0.076]], - [0.904, [0.587, 0.044, 0.075]], - [0.906, [0.587, 0.044, 0.075]], [0.908, [0.579, 0.042, 0.074]], - [0.91, [0.579, 0.042, 0.074]], - [0.912, [0.572, 0.041, 0.073]], - [0.914, [0.572, 0.041, 0.073]], - [0.916, [0.564, 0.039, 0.072]], - [0.918, [0.564, 0.039, 0.072]], - [0.92, [0.556, 0.037, 0.071]], - [0.922, [0.556, 0.037, 0.071]], - [0.924, [0.549, 0.035, 0.07]], - [0.926, [0.549, 0.035, 0.07]], - [0.928, [0.541, 0.033, 0.069]], - [0.93, [0.541, 0.033, 0.069]], - [0.932, [0.534, 0.031, 0.068]], - [0.933, [0.534, 0.031, 0.068]], - [0.935, [0.526, 0.03, 0.067]], - [0.937, [0.526, 0.03, 0.067]], - [0.939, [0.518, 0.028, 0.066]], - [0.941, [0.518, 0.028, 0.066]], - [0.943, [0.511, 0.026, 0.065]], - [0.945, [0.511, 0.026, 0.065]], - [0.947, [0.503, 0.024, 0.064]], - [0.949, [0.503, 0.024, 0.064]], - [0.951, [0.495, 0.022, 0.063]], - [0.953, [0.495, 0.022, 0.063]], - [0.955, [0.488, 0.02, 0.062]], - [0.957, [0.488, 0.02, 0.062]], - [0.959, [0.48, 0.018, 0.061]], - [0.961, [0.48, 0.018, 0.061]], - [0.963, [0.473, 0.017, 0.06]], - [0.965, [0.473, 0.017, 0.06]], - [0.967, [0.465, 0.015, 0.059]], - [0.969, [0.465, 0.015, 0.059]], - [0.971, [0.457, 0.013, 0.058]], - [0.973, [0.457, 0.013, 0.058]], - [0.975, [0.45, 0.011, 0.057]], - [0.977, [0.45, 0.011, 0.057]], - [0.978, [0.442, 0.009, 0.056]], - [0.98, [0.442, 0.009, 0.056]], - [0.982, [0.434, 0.007, 0.055]], - [0.984, [0.434, 0.007, 0.055]], - [0.986, [0.427, 0.006, 0.054]], - [0.988, [0.427, 0.006, 0.054]], - [0.99, [0.419, 0.004, 0.053]], - [0.992, [0.419, 0.004, 0.053]], - [0.994, [0.412, 0.002, 0.052]], - [0.996, [0.412, 0.002, 0.052]], - [0.998, [0.404, 0.0, 0.051]], - [1.0, [0.404, 0.0, 0.051]], + [1, [0.404, 0, 0.051]], ], }, [ColorSchemas.YellowToRed]: { @@ -2120,518 +112,16 @@ export const vislibColorMaps: ColorMap = { defaultMessage: 'Yellow to Red', }), value: [ - [0.0, [1.0, 1.0, 0.8]], - [0.002, [1.0, 1.0, 0.8]], - [0.004, [1.0, 0.998, 0.795]], - [0.006, [1.0, 0.998, 0.795]], - [0.008, [1.0, 0.996, 0.789]], - [0.01, [1.0, 0.996, 0.789]], - [0.012, [1.0, 0.993, 0.784]], - [0.014, [1.0, 0.993, 0.784]], - [0.016, [1.0, 0.991, 0.778]], - [0.018, [1.0, 0.991, 0.778]], - [0.02, [1.0, 0.989, 0.773]], - [0.022, [1.0, 0.989, 0.773]], - [0.023, [1.0, 0.987, 0.768]], - [0.025, [1.0, 0.987, 0.768]], - [0.027, [1.0, 0.984, 0.762]], - [0.029, [1.0, 0.984, 0.762]], - [0.031, [1.0, 0.982, 0.757]], - [0.033, [1.0, 0.982, 0.757]], - [0.035, [1.0, 0.98, 0.751]], - [0.037, [1.0, 0.98, 0.751]], - [0.039, [1.0, 0.978, 0.746]], - [0.041, [1.0, 0.978, 0.746]], - [0.043, [1.0, 0.976, 0.74]], - [0.045, [1.0, 0.976, 0.74]], - [0.047, [1.0, 0.973, 0.735]], - [0.049, [1.0, 0.973, 0.735]], - [0.051, [1.0, 0.971, 0.73]], - [0.053, [1.0, 0.971, 0.73]], - [0.055, [1.0, 0.969, 0.724]], - [0.057, [1.0, 0.969, 0.724]], - [0.059, [1.0, 0.967, 0.719]], - [0.061, [1.0, 0.967, 0.719]], - [0.063, [1.0, 0.965, 0.713]], - [0.065, [1.0, 0.965, 0.713]], - [0.067, [1.0, 0.962, 0.708]], - [0.068, [1.0, 0.962, 0.708]], - [0.07, [1.0, 0.96, 0.703]], - [0.072, [1.0, 0.96, 0.703]], - [0.074, [1.0, 0.958, 0.697]], - [0.076, [1.0, 0.958, 0.697]], - [0.078, [1.0, 0.956, 0.692]], - [0.08, [1.0, 0.956, 0.692]], - [0.082, [1.0, 0.953, 0.686]], - [0.084, [1.0, 0.953, 0.686]], - [0.086, [1.0, 0.951, 0.681]], - [0.088, [1.0, 0.951, 0.681]], - [0.09, [1.0, 0.949, 0.675]], - [0.092, [1.0, 0.949, 0.675]], - [0.094, [1.0, 0.947, 0.67]], - [0.096, [1.0, 0.947, 0.67]], - [0.098, [1.0, 0.945, 0.665]], - [0.1, [1.0, 0.945, 0.665]], - [0.102, [1.0, 0.942, 0.659]], - [0.104, [1.0, 0.942, 0.659]], - [0.106, [1.0, 0.94, 0.654]], - [0.108, [1.0, 0.94, 0.654]], - [0.11, [1.0, 0.938, 0.648]], - [0.112, [1.0, 0.938, 0.648]], - [0.114, [1.0, 0.936, 0.643]], - [0.115, [1.0, 0.936, 0.643]], - [0.117, [1.0, 0.934, 0.638]], - [0.119, [1.0, 0.934, 0.638]], - [0.121, [1.0, 0.931, 0.632]], - [0.123, [1.0, 0.931, 0.632]], - [0.125, [1.0, 0.929, 0.627]], - [0.127, [1.0, 0.929, 0.627]], - [0.129, [1.0, 0.927, 0.622]], - [0.131, [1.0, 0.927, 0.622]], - [0.133, [1.0, 0.924, 0.616]], - [0.135, [1.0, 0.924, 0.616]], - [0.137, [1.0, 0.922, 0.611]], - [0.139, [1.0, 0.922, 0.611]], - [0.141, [0.999, 0.919, 0.606]], - [0.143, [0.999, 0.919, 0.606]], - [0.145, [0.999, 0.917, 0.601]], - [0.147, [0.999, 0.917, 0.601]], - [0.149, [0.999, 0.914, 0.596]], - [0.151, [0.999, 0.914, 0.596]], - [0.153, [0.999, 0.912, 0.591]], - [0.155, [0.999, 0.912, 0.591]], - [0.157, [0.999, 0.909, 0.585]], - [0.159, [0.999, 0.909, 0.585]], - [0.16, [0.999, 0.907, 0.58]], - [0.162, [0.999, 0.907, 0.58]], - [0.164, [0.999, 0.904, 0.575]], - [0.166, [0.999, 0.904, 0.575]], - [0.168, [0.999, 0.902, 0.57]], - [0.17, [0.999, 0.902, 0.57]], - [0.172, [0.999, 0.9, 0.565]], - [0.174, [0.999, 0.9, 0.565]], - [0.176, [0.998, 0.897, 0.56]], - [0.178, [0.998, 0.897, 0.56]], - [0.18, [0.998, 0.895, 0.554]], - [0.182, [0.998, 0.895, 0.554]], - [0.184, [0.998, 0.892, 0.549]], - [0.186, [0.998, 0.892, 0.549]], - [0.188, [0.998, 0.89, 0.544]], - [0.19, [0.998, 0.89, 0.544]], - [0.192, [0.998, 0.887, 0.539]], - [0.194, [0.998, 0.887, 0.539]], - [0.196, [0.998, 0.885, 0.534]], - [0.198, [0.998, 0.885, 0.534]], - [0.2, [0.998, 0.882, 0.529]], - [0.202, [0.998, 0.882, 0.529]], - [0.204, [0.998, 0.88, 0.523]], - [0.205, [0.998, 0.88, 0.523]], - [0.207, [0.997, 0.877, 0.518]], - [0.209, [0.997, 0.877, 0.518]], - [0.211, [0.997, 0.875, 0.513]], - [0.213, [0.997, 0.875, 0.513]], - [0.215, [0.997, 0.873, 0.508]], - [0.217, [0.997, 0.873, 0.508]], - [0.219, [0.997, 0.87, 0.503]], - [0.221, [0.997, 0.87, 0.503]], - [0.223, [0.997, 0.868, 0.498]], - [0.225, [0.997, 0.868, 0.498]], + [0, [1, 1, 0.8]], + [0.114, [1, 0.936, 0.643]], [0.227, [0.997, 0.865, 0.492]], - [0.229, [0.997, 0.865, 0.492]], - [0.231, [0.997, 0.863, 0.487]], - [0.233, [0.997, 0.863, 0.487]], - [0.235, [0.997, 0.86, 0.482]], - [0.237, [0.997, 0.86, 0.482]], - [0.239, [0.996, 0.858, 0.477]], - [0.241, [0.996, 0.858, 0.477]], - [0.243, [0.996, 0.855, 0.472]], - [0.245, [0.996, 0.855, 0.472]], - [0.247, [0.996, 0.853, 0.467]], - [0.249, [0.996, 0.853, 0.467]], - [0.25, [0.996, 0.85, 0.461]], - [0.252, [0.996, 0.85, 0.461]], - [0.254, [0.996, 0.845, 0.456]], - [0.256, [0.996, 0.845, 0.456]], - [0.258, [0.996, 0.84, 0.451]], - [0.26, [0.996, 0.84, 0.451]], - [0.262, [0.996, 0.835, 0.446]], - [0.264, [0.996, 0.835, 0.446]], - [0.266, [0.996, 0.831, 0.441]], - [0.268, [0.996, 0.831, 0.441]], - [0.27, [0.996, 0.826, 0.436]], - [0.272, [0.996, 0.826, 0.436]], - [0.274, [0.996, 0.821, 0.43]], - [0.276, [0.996, 0.821, 0.43]], - [0.278, [0.996, 0.816, 0.425]], - [0.28, [0.996, 0.816, 0.425]], - [0.282, [0.996, 0.811, 0.42]], - [0.284, [0.996, 0.811, 0.42]], - [0.286, [0.996, 0.807, 0.415]], - [0.288, [0.996, 0.807, 0.415]], - [0.29, [0.996, 0.802, 0.41]], - [0.292, [0.996, 0.802, 0.41]], - [0.294, [0.996, 0.797, 0.405]], - [0.295, [0.996, 0.797, 0.405]], - [0.297, [0.996, 0.792, 0.399]], - [0.299, [0.996, 0.792, 0.399]], - [0.301, [0.996, 0.787, 0.394]], - [0.303, [0.996, 0.787, 0.394]], - [0.305, [0.996, 0.783, 0.389]], - [0.307, [0.996, 0.783, 0.389]], - [0.309, [0.996, 0.778, 0.384]], - [0.311, [0.996, 0.778, 0.384]], - [0.313, [0.996, 0.773, 0.379]], - [0.315, [0.996, 0.773, 0.379]], - [0.317, [0.996, 0.768, 0.374]], - [0.319, [0.996, 0.768, 0.374]], - [0.321, [0.996, 0.763, 0.368]], - [0.323, [0.996, 0.763, 0.368]], - [0.325, [0.996, 0.759, 0.363]], - [0.327, [0.996, 0.759, 0.363]], - [0.329, [0.996, 0.754, 0.358]], - [0.331, [0.996, 0.754, 0.358]], - [0.333, [0.996, 0.749, 0.353]], - [0.335, [0.996, 0.749, 0.353]], - [0.337, [0.996, 0.744, 0.348]], - [0.339, [0.996, 0.744, 0.348]], [0.341, [0.996, 0.739, 0.343]], - [0.342, [0.996, 0.739, 0.343]], - [0.344, [0.996, 0.735, 0.337]], - [0.346, [0.996, 0.735, 0.337]], - [0.348, [0.996, 0.73, 0.332]], - [0.35, [0.996, 0.73, 0.332]], - [0.352, [0.996, 0.725, 0.327]], - [0.354, [0.996, 0.725, 0.327]], - [0.356, [0.996, 0.72, 0.322]], - [0.358, [0.996, 0.72, 0.322]], - [0.36, [0.996, 0.715, 0.317]], - [0.362, [0.996, 0.715, 0.317]], - [0.364, [0.996, 0.711, 0.312]], - [0.366, [0.996, 0.711, 0.312]], - [0.368, [0.996, 0.706, 0.306]], - [0.37, [0.996, 0.706, 0.306]], - [0.372, [0.996, 0.701, 0.301]], - [0.374, [0.996, 0.701, 0.301]], - [0.376, [0.996, 0.696, 0.297]], - [0.378, [0.996, 0.696, 0.297]], - [0.38, [0.996, 0.692, 0.295]], - [0.382, [0.996, 0.692, 0.295]], - [0.384, [0.996, 0.687, 0.293]], - [0.386, [0.996, 0.687, 0.293]], - [0.387, [0.996, 0.683, 0.291]], - [0.389, [0.996, 0.683, 0.291]], - [0.391, [0.996, 0.678, 0.289]], - [0.393, [0.996, 0.678, 0.289]], - [0.395, [0.995, 0.674, 0.287]], - [0.397, [0.995, 0.674, 0.287]], - [0.399, [0.995, 0.669, 0.285]], - [0.401, [0.995, 0.669, 0.285]], - [0.403, [0.995, 0.664, 0.284]], - [0.405, [0.995, 0.664, 0.284]], - [0.407, [0.995, 0.66, 0.282]], - [0.409, [0.995, 0.66, 0.282]], - [0.411, [0.995, 0.655, 0.28]], - [0.413, [0.995, 0.655, 0.28]], - [0.415, [0.995, 0.651, 0.278]], - [0.417, [0.995, 0.651, 0.278]], - [0.419, [0.995, 0.646, 0.276]], - [0.421, [0.995, 0.646, 0.276]], - [0.423, [0.995, 0.642, 0.274]], - [0.425, [0.995, 0.642, 0.274]], - [0.427, [0.994, 0.637, 0.272]], - [0.429, [0.994, 0.637, 0.272]], - [0.431, [0.994, 0.633, 0.27]], - [0.432, [0.994, 0.633, 0.27]], - [0.434, [0.994, 0.628, 0.268]], - [0.436, [0.994, 0.628, 0.268]], - [0.438, [0.994, 0.623, 0.266]], - [0.44, [0.994, 0.623, 0.266]], - [0.442, [0.994, 0.619, 0.264]], - [0.444, [0.994, 0.619, 0.264]], - [0.446, [0.994, 0.614, 0.262]], - [0.448, [0.994, 0.614, 0.262]], - [0.45, [0.994, 0.61, 0.26]], - [0.452, [0.994, 0.61, 0.26]], [0.454, [0.994, 0.605, 0.258]], - [0.456, [0.994, 0.605, 0.258]], - [0.458, [0.993, 0.601, 0.256]], - [0.46, [0.993, 0.601, 0.256]], - [0.462, [0.993, 0.596, 0.254]], - [0.464, [0.993, 0.596, 0.254]], - [0.466, [0.993, 0.592, 0.252]], - [0.468, [0.993, 0.592, 0.252]], - [0.47, [0.993, 0.587, 0.25]], - [0.472, [0.993, 0.587, 0.25]], - [0.474, [0.993, 0.583, 0.248]], - [0.476, [0.993, 0.583, 0.248]], - [0.477, [0.993, 0.578, 0.246]], - [0.479, [0.993, 0.578, 0.246]], - [0.481, [0.993, 0.573, 0.244]], - [0.483, [0.993, 0.573, 0.244]], - [0.485, [0.993, 0.569, 0.242]], - [0.487, [0.993, 0.569, 0.242]], - [0.489, [0.992, 0.564, 0.24]], - [0.491, [0.992, 0.564, 0.24]], - [0.493, [0.992, 0.56, 0.238]], - [0.495, [0.992, 0.56, 0.238]], - [0.497, [0.992, 0.555, 0.236]], - [0.499, [0.992, 0.555, 0.236]], - [0.501, [0.992, 0.549, 0.234]], - [0.503, [0.992, 0.549, 0.234]], - [0.505, [0.992, 0.541, 0.232]], - [0.507, [0.992, 0.541, 0.232]], - [0.509, [0.992, 0.534, 0.23]], - [0.511, [0.992, 0.534, 0.23]], - [0.513, [0.992, 0.526, 0.228]], - [0.515, [0.992, 0.526, 0.228]], - [0.517, [0.992, 0.518, 0.225]], - [0.519, [0.992, 0.518, 0.225]], - [0.521, [0.991, 0.51, 0.223]], - [0.523, [0.991, 0.51, 0.223]], - [0.524, [0.991, 0.503, 0.221]], - [0.526, [0.991, 0.503, 0.221]], - [0.528, [0.991, 0.495, 0.219]], - [0.53, [0.991, 0.495, 0.219]], - [0.532, [0.991, 0.487, 0.216]], - [0.534, [0.991, 0.487, 0.216]], - [0.536, [0.991, 0.479, 0.214]], - [0.538, [0.991, 0.479, 0.214]], - [0.54, [0.991, 0.472, 0.212]], - [0.542, [0.991, 0.472, 0.212]], - [0.544, [0.991, 0.464, 0.21]], - [0.546, [0.991, 0.464, 0.21]], - [0.548, [0.991, 0.456, 0.208]], - [0.55, [0.991, 0.456, 0.208]], - [0.552, [0.99, 0.448, 0.205]], - [0.554, [0.99, 0.448, 0.205]], - [0.556, [0.99, 0.441, 0.203]], - [0.558, [0.99, 0.441, 0.203]], - [0.56, [0.99, 0.433, 0.201]], - [0.562, [0.99, 0.433, 0.201]], - [0.564, [0.99, 0.425, 0.199]], - [0.566, [0.99, 0.425, 0.199]], [0.568, [0.99, 0.417, 0.197]], - [0.569, [0.99, 0.417, 0.197]], - [0.571, [0.99, 0.41, 0.194]], - [0.573, [0.99, 0.41, 0.194]], - [0.575, [0.99, 0.402, 0.192]], - [0.577, [0.99, 0.402, 0.192]], - [0.579, [0.99, 0.394, 0.19]], - [0.581, [0.99, 0.394, 0.19]], - [0.583, [0.99, 0.386, 0.188]], - [0.585, [0.99, 0.386, 0.188]], - [0.587, [0.989, 0.379, 0.185]], - [0.589, [0.989, 0.379, 0.185]], - [0.591, [0.989, 0.371, 0.183]], - [0.593, [0.989, 0.371, 0.183]], - [0.595, [0.989, 0.363, 0.181]], - [0.597, [0.989, 0.363, 0.181]], - [0.599, [0.989, 0.355, 0.179]], - [0.601, [0.989, 0.355, 0.179]], - [0.603, [0.989, 0.348, 0.177]], - [0.605, [0.989, 0.348, 0.177]], - [0.607, [0.989, 0.34, 0.174]], - [0.609, [0.989, 0.34, 0.174]], - [0.611, [0.989, 0.332, 0.172]], - [0.613, [0.989, 0.332, 0.172]], - [0.614, [0.989, 0.324, 0.17]], - [0.616, [0.989, 0.324, 0.17]], - [0.618, [0.988, 0.317, 0.168]], - [0.62, [0.988, 0.317, 0.168]], - [0.622, [0.988, 0.309, 0.166]], - [0.624, [0.988, 0.309, 0.166]], - [0.626, [0.986, 0.302, 0.164]], - [0.628, [0.986, 0.302, 0.164]], - [0.63, [0.983, 0.295, 0.162]], - [0.632, [0.983, 0.295, 0.162]], - [0.634, [0.98, 0.289, 0.16]], - [0.636, [0.98, 0.289, 0.16]], - [0.638, [0.977, 0.283, 0.158]], - [0.64, [0.977, 0.283, 0.158]], - [0.642, [0.974, 0.276, 0.157]], - [0.644, [0.974, 0.276, 0.157]], - [0.646, [0.971, 0.27, 0.155]], - [0.648, [0.971, 0.27, 0.155]], - [0.65, [0.968, 0.263, 0.153]], - [0.652, [0.968, 0.263, 0.153]], - [0.654, [0.965, 0.257, 0.152]], - [0.656, [0.965, 0.257, 0.152]], - [0.658, [0.962, 0.251, 0.15]], - [0.659, [0.962, 0.251, 0.15]], - [0.661, [0.959, 0.244, 0.148]], - [0.663, [0.959, 0.244, 0.148]], - [0.665, [0.956, 0.238, 0.146]], - [0.667, [0.956, 0.238, 0.146]], - [0.669, [0.952, 0.232, 0.145]], - [0.671, [0.952, 0.232, 0.145]], - [0.673, [0.949, 0.225, 0.143]], - [0.675, [0.949, 0.225, 0.143]], - [0.677, [0.946, 0.219, 0.141]], - [0.679, [0.946, 0.219, 0.141]], [0.681, [0.943, 0.212, 0.14]], - [0.683, [0.943, 0.212, 0.14]], - [0.685, [0.94, 0.206, 0.138]], - [0.687, [0.94, 0.206, 0.138]], - [0.689, [0.937, 0.2, 0.136]], - [0.691, [0.937, 0.2, 0.136]], - [0.693, [0.934, 0.193, 0.134]], - [0.695, [0.934, 0.193, 0.134]], - [0.697, [0.931, 0.187, 0.133]], - [0.699, [0.931, 0.187, 0.133]], - [0.701, [0.928, 0.18, 0.131]], - [0.703, [0.928, 0.18, 0.131]], - [0.705, [0.925, 0.174, 0.129]], - [0.706, [0.925, 0.174, 0.129]], - [0.708, [0.922, 0.168, 0.127]], - [0.71, [0.922, 0.168, 0.127]], - [0.712, [0.919, 0.161, 0.126]], - [0.714, [0.919, 0.161, 0.126]], - [0.716, [0.916, 0.155, 0.124]], - [0.718, [0.916, 0.155, 0.124]], - [0.72, [0.912, 0.148, 0.122]], - [0.722, [0.912, 0.148, 0.122]], - [0.724, [0.909, 0.142, 0.121]], - [0.726, [0.909, 0.142, 0.121]], - [0.728, [0.906, 0.136, 0.119]], - [0.73, [0.906, 0.136, 0.119]], - [0.732, [0.903, 0.129, 0.117]], - [0.734, [0.903, 0.129, 0.117]], - [0.736, [0.9, 0.123, 0.115]], - [0.738, [0.9, 0.123, 0.115]], - [0.74, [0.897, 0.116, 0.114]], - [0.742, [0.897, 0.116, 0.114]], - [0.744, [0.894, 0.11, 0.112]], - [0.746, [0.894, 0.11, 0.112]], - [0.748, [0.891, 0.104, 0.11]], - [0.75, [0.891, 0.104, 0.11]], - [0.751, [0.887, 0.1, 0.111]], - [0.753, [0.887, 0.1, 0.111]], - [0.755, [0.882, 0.096, 0.112]], - [0.757, [0.882, 0.096, 0.112]], - [0.759, [0.877, 0.093, 0.113]], - [0.761, [0.877, 0.093, 0.113]], - [0.763, [0.873, 0.09, 0.114]], - [0.765, [0.873, 0.09, 0.114]], - [0.767, [0.868, 0.087, 0.116]], - [0.769, [0.868, 0.087, 0.116]], - [0.771, [0.863, 0.084, 0.117]], - [0.773, [0.863, 0.084, 0.117]], - [0.775, [0.859, 0.08, 0.118]], - [0.777, [0.859, 0.08, 0.118]], - [0.779, [0.854, 0.077, 0.119]], - [0.781, [0.854, 0.077, 0.119]], - [0.783, [0.849, 0.074, 0.121]], - [0.785, [0.849, 0.074, 0.121]], - [0.787, [0.845, 0.071, 0.122]], - [0.789, [0.845, 0.071, 0.122]], - [0.791, [0.84, 0.068, 0.123]], - [0.793, [0.84, 0.068, 0.123]], [0.795, [0.835, 0.064, 0.124]], - [0.796, [0.835, 0.064, 0.124]], - [0.798, [0.831, 0.061, 0.125]], - [0.8, [0.831, 0.061, 0.125]], - [0.802, [0.826, 0.058, 0.127]], - [0.804, [0.826, 0.058, 0.127]], - [0.806, [0.821, 0.055, 0.128]], - [0.808, [0.821, 0.055, 0.128]], - [0.81, [0.817, 0.052, 0.129]], - [0.812, [0.817, 0.052, 0.129]], - [0.814, [0.812, 0.048, 0.13]], - [0.816, [0.812, 0.048, 0.13]], - [0.818, [0.807, 0.045, 0.132]], - [0.82, [0.807, 0.045, 0.132]], - [0.822, [0.803, 0.042, 0.133]], - [0.824, [0.803, 0.042, 0.133]], - [0.826, [0.798, 0.039, 0.134]], - [0.828, [0.798, 0.039, 0.134]], - [0.83, [0.793, 0.036, 0.135]], - [0.832, [0.793, 0.036, 0.135]], - [0.834, [0.789, 0.032, 0.137]], - [0.836, [0.789, 0.032, 0.137]], - [0.838, [0.784, 0.029, 0.138]], - [0.84, [0.784, 0.029, 0.138]], - [0.841, [0.779, 0.026, 0.139]], - [0.843, [0.779, 0.026, 0.139]], - [0.845, [0.774, 0.023, 0.14]], - [0.847, [0.774, 0.023, 0.14]], - [0.849, [0.77, 0.02, 0.141]], - [0.851, [0.77, 0.02, 0.141]], - [0.853, [0.765, 0.016, 0.143]], - [0.855, [0.765, 0.016, 0.143]], - [0.857, [0.76, 0.013, 0.144]], - [0.859, [0.76, 0.013, 0.144]], - [0.861, [0.756, 0.01, 0.145]], - [0.863, [0.756, 0.01, 0.145]], - [0.865, [0.751, 0.007, 0.146]], - [0.867, [0.751, 0.007, 0.146]], - [0.869, [0.746, 0.004, 0.148]], - [0.871, [0.746, 0.004, 0.148]], - [0.873, [0.742, 0.0, 0.149]], - [0.875, [0.742, 0.0, 0.149]], - [0.877, [0.735, 0.0, 0.149]], - [0.879, [0.735, 0.0, 0.149]], - [0.881, [0.727, 0.0, 0.149]], - [0.883, [0.727, 0.0, 0.149]], - [0.885, [0.72, 0.0, 0.149]], - [0.886, [0.72, 0.0, 0.149]], - [0.888, [0.712, 0.0, 0.149]], - [0.89, [0.712, 0.0, 0.149]], - [0.892, [0.705, 0.0, 0.149]], - [0.894, [0.705, 0.0, 0.149]], - [0.896, [0.697, 0.0, 0.149]], - [0.898, [0.697, 0.0, 0.149]], - [0.9, [0.69, 0.0, 0.149]], - [0.902, [0.69, 0.0, 0.149]], - [0.904, [0.682, 0.0, 0.149]], - [0.906, [0.682, 0.0, 0.149]], - [0.908, [0.675, 0.0, 0.149]], - [0.91, [0.675, 0.0, 0.149]], - [0.912, [0.667, 0.0, 0.149]], - [0.914, [0.667, 0.0, 0.149]], - [0.916, [0.66, 0.0, 0.149]], - [0.918, [0.66, 0.0, 0.149]], - [0.92, [0.652, 0.0, 0.149]], - [0.922, [0.652, 0.0, 0.149]], - [0.924, [0.645, 0.0, 0.149]], - [0.926, [0.645, 0.0, 0.149]], - [0.928, [0.637, 0.0, 0.149]], - [0.93, [0.637, 0.0, 0.149]], - [0.932, [0.63, 0.0, 0.149]], - [0.933, [0.63, 0.0, 0.149]], - [0.935, [0.622, 0.0, 0.149]], - [0.937, [0.622, 0.0, 0.149]], - [0.939, [0.615, 0.0, 0.149]], - [0.941, [0.615, 0.0, 0.149]], - [0.943, [0.607, 0.0, 0.149]], - [0.945, [0.607, 0.0, 0.149]], - [0.947, [0.6, 0.0, 0.149]], - [0.949, [0.6, 0.0, 0.149]], - [0.951, [0.592, 0.0, 0.149]], - [0.953, [0.592, 0.0, 0.149]], - [0.955, [0.585, 0.0, 0.149]], - [0.957, [0.585, 0.0, 0.149]], - [0.959, [0.577, 0.0, 0.149]], - [0.961, [0.577, 0.0, 0.149]], - [0.963, [0.57, 0.0, 0.149]], - [0.965, [0.57, 0.0, 0.149]], - [0.967, [0.562, 0.0, 0.149]], - [0.969, [0.562, 0.0, 0.149]], - [0.971, [0.554, 0.0, 0.149]], - [0.973, [0.554, 0.0, 0.149]], - [0.975, [0.547, 0.0, 0.149]], - [0.977, [0.547, 0.0, 0.149]], - [0.978, [0.539, 0.0, 0.149]], - [0.98, [0.539, 0.0, 0.149]], - [0.982, [0.532, 0.0, 0.149]], - [0.984, [0.532, 0.0, 0.149]], - [0.986, [0.524, 0.0, 0.149]], - [0.988, [0.524, 0.0, 0.149]], - [0.99, [0.517, 0.0, 0.149]], - [0.992, [0.517, 0.0, 0.149]], - [0.994, [0.509, 0.0, 0.149]], - [0.996, [0.509, 0.0, 0.149]], - [0.998, [0.502, 0.0, 0.149]], - [1.0, [0.502, 0.0, 0.149]], + [0.908, [0.675, 0, 0.149]], + [1, [0.502, 0, 0.149]], ], }, @@ -2642,515 +132,39 @@ export const vislibColorMaps: ColorMap = { }), value: [ [0, [0, 0.408, 0.216]], - [0.002, [0, 0.408, 0.216]], - [0.004, [0.004, 0.415, 0.22]], - [0.006, [0.004, 0.415, 0.22]], - [0.008, [0.008, 0.423, 0.223]], - [0.01, [0.008, 0.423, 0.223]], - [0.012, [0.012, 0.43, 0.227]], - [0.014, [0.012, 0.43, 0.227]], - [0.016, [0.016, 0.437, 0.231]], - [0.018, [0.016, 0.437, 0.231]], - [0.02, [0.02, 0.445, 0.235]], - [0.022, [0.02, 0.445, 0.235]], - [0.023, [0.024, 0.452, 0.239]], - [0.025, [0.024, 0.452, 0.239]], - [0.027, [0.028, 0.46, 0.243]], [0.029, [0.028, 0.46, 0.243]], - [0.031, [0.032, 0.467, 0.246]], - [0.033, [0.032, 0.467, 0.246]], - [0.035, [0.036, 0.474, 0.25]], - [0.037, [0.036, 0.474, 0.25]], - [0.039, [0.04, 0.482, 0.254]], - [0.041, [0.04, 0.482, 0.254]], - [0.043, [0.044, 0.489, 0.258]], - [0.045, [0.044, 0.489, 0.258]], - [0.047, [0.048, 0.496, 0.262]], - [0.049, [0.048, 0.496, 0.262]], - [0.051, [0.052, 0.504, 0.266]], - [0.053, [0.052, 0.504, 0.266]], - [0.055, [0.056, 0.511, 0.27]], - [0.057, [0.056, 0.511, 0.27]], [0.059, [0.06, 0.519, 0.273]], - [0.061, [0.06, 0.519, 0.273]], - [0.063, [0.064, 0.526, 0.277]], - [0.065, [0.064, 0.526, 0.277]], - [0.067, [0.068, 0.533, 0.281]], - [0.068, [0.068, 0.533, 0.281]], - [0.07, [0.072, 0.541, 0.285]], - [0.072, [0.072, 0.541, 0.285]], - [0.074, [0.076, 0.548, 0.289]], - [0.076, [0.076, 0.548, 0.289]], - [0.078, [0.08, 0.555, 0.293]], - [0.08, [0.08, 0.555, 0.293]], - [0.082, [0.084, 0.563, 0.296]], - [0.084, [0.084, 0.563, 0.296]], - [0.086, [0.088, 0.57, 0.3]], [0.088, [0.088, 0.57, 0.3]], - [0.09, [0.092, 0.578, 0.304]], - [0.092, [0.092, 0.578, 0.304]], - [0.094, [0.096, 0.585, 0.308]], - [0.096, [0.096, 0.585, 0.308]], - [0.098, [0.1, 0.592, 0.312]], - [0.1, [0.1, 0.592, 0.312]], - [0.102, [0.108, 0.599, 0.315]], - [0.104, [0.108, 0.599, 0.315]], - [0.106, [0.119, 0.605, 0.318]], - [0.108, [0.119, 0.605, 0.318]], - [0.11, [0.131, 0.61, 0.321]], - [0.112, [0.131, 0.61, 0.321]], - [0.114, [0.143, 0.616, 0.324]], - [0.115, [0.143, 0.616, 0.324]], [0.117, [0.155, 0.622, 0.327]], - [0.119, [0.155, 0.622, 0.327]], - [0.121, [0.166, 0.627, 0.33]], - [0.123, [0.166, 0.627, 0.33]], - [0.125, [0.178, 0.633, 0.333]], - [0.127, [0.178, 0.633, 0.333]], - [0.129, [0.19, 0.639, 0.336]], - [0.131, [0.19, 0.639, 0.336]], - [0.133, [0.201, 0.644, 0.339]], - [0.135, [0.201, 0.644, 0.339]], - [0.137, [0.213, 0.65, 0.341]], - [0.139, [0.213, 0.65, 0.341]], - [0.141, [0.225, 0.656, 0.344]], - [0.143, [0.225, 0.656, 0.344]], - [0.145, [0.236, 0.662, 0.347]], [0.147, [0.236, 0.662, 0.347]], - [0.149, [0.248, 0.667, 0.35]], - [0.151, [0.248, 0.667, 0.35]], - [0.153, [0.26, 0.673, 0.353]], - [0.155, [0.26, 0.673, 0.353]], - [0.157, [0.271, 0.679, 0.356]], - [0.159, [0.271, 0.679, 0.356]], - [0.16, [0.283, 0.684, 0.359]], - [0.162, [0.283, 0.684, 0.359]], - [0.164, [0.295, 0.69, 0.362]], - [0.166, [0.295, 0.69, 0.362]], - [0.168, [0.306, 0.696, 0.365]], - [0.17, [0.306, 0.696, 0.365]], - [0.172, [0.318, 0.701, 0.368]], - [0.174, [0.318, 0.701, 0.368]], [0.176, [0.33, 0.707, 0.371]], - [0.178, [0.33, 0.707, 0.371]], - [0.18, [0.342, 0.713, 0.374]], - [0.182, [0.342, 0.713, 0.374]], - [0.184, [0.353, 0.718, 0.377]], - [0.186, [0.353, 0.718, 0.377]], - [0.188, [0.365, 0.724, 0.379]], - [0.19, [0.365, 0.724, 0.379]], - [0.192, [0.377, 0.73, 0.382]], - [0.194, [0.377, 0.73, 0.382]], - [0.196, [0.388, 0.735, 0.385]], - [0.198, [0.388, 0.735, 0.385]], - [0.2, [0.4, 0.741, 0.388]], - [0.202, [0.4, 0.741, 0.388]], - [0.204, [0.41, 0.745, 0.389]], [0.205, [0.41, 0.745, 0.389]], - [0.207, [0.42, 0.75, 0.39]], - [0.209, [0.42, 0.75, 0.39]], - [0.211, [0.43, 0.754, 0.391]], - [0.213, [0.43, 0.754, 0.391]], - [0.215, [0.439, 0.758, 0.393]], - [0.217, [0.439, 0.758, 0.393]], - [0.219, [0.449, 0.763, 0.394]], - [0.221, [0.449, 0.763, 0.394]], - [0.223, [0.459, 0.767, 0.395]], - [0.225, [0.459, 0.767, 0.395]], - [0.227, [0.469, 0.771, 0.396]], - [0.229, [0.469, 0.771, 0.396]], - [0.231, [0.479, 0.776, 0.397]], - [0.233, [0.479, 0.776, 0.397]], [0.235, [0.489, 0.78, 0.398]], - [0.237, [0.489, 0.78, 0.398]], - [0.239, [0.498, 0.784, 0.399]], - [0.241, [0.498, 0.784, 0.399]], - [0.243, [0.508, 0.789, 0.4]], - [0.245, [0.508, 0.789, 0.4]], - [0.247, [0.518, 0.793, 0.401]], - [0.249, [0.518, 0.793, 0.401]], - [0.25, [0.528, 0.797, 0.402]], - [0.252, [0.528, 0.797, 0.402]], - [0.254, [0.538, 0.801, 0.403]], - [0.256, [0.538, 0.801, 0.403]], - [0.258, [0.548, 0.806, 0.404]], - [0.26, [0.548, 0.806, 0.404]], - [0.262, [0.557, 0.81, 0.405]], [0.264, [0.557, 0.81, 0.405]], - [0.266, [0.567, 0.814, 0.407]], - [0.268, [0.567, 0.814, 0.407]], - [0.27, [0.577, 0.819, 0.408]], - [0.272, [0.577, 0.819, 0.408]], - [0.274, [0.587, 0.823, 0.409]], - [0.276, [0.587, 0.823, 0.409]], - [0.278, [0.597, 0.827, 0.41]], - [0.28, [0.597, 0.827, 0.41]], - [0.282, [0.607, 0.832, 0.411]], - [0.284, [0.607, 0.832, 0.411]], - [0.286, [0.617, 0.836, 0.412]], - [0.288, [0.617, 0.836, 0.412]], - [0.29, [0.626, 0.84, 0.413]], - [0.292, [0.626, 0.84, 0.413]], [0.294, [0.636, 0.845, 0.414]], - [0.295, [0.636, 0.845, 0.414]], - [0.297, [0.646, 0.849, 0.415]], - [0.299, [0.646, 0.849, 0.415]], - [0.301, [0.655, 0.853, 0.418]], - [0.303, [0.655, 0.853, 0.418]], - [0.305, [0.663, 0.856, 0.423]], - [0.307, [0.663, 0.856, 0.423]], - [0.309, [0.671, 0.859, 0.428]], - [0.311, [0.671, 0.859, 0.428]], - [0.313, [0.678, 0.863, 0.433]], - [0.315, [0.678, 0.863, 0.433]], - [0.317, [0.686, 0.866, 0.439]], - [0.319, [0.686, 0.866, 0.439]], - [0.321, [0.694, 0.87, 0.444]], [0.323, [0.694, 0.87, 0.444]], - [0.325, [0.702, 0.873, 0.449]], - [0.327, [0.702, 0.873, 0.449]], - [0.329, [0.71, 0.876, 0.454]], - [0.331, [0.71, 0.876, 0.454]], - [0.333, [0.718, 0.88, 0.459]], - [0.335, [0.718, 0.88, 0.459]], - [0.337, [0.725, 0.883, 0.464]], - [0.339, [0.725, 0.883, 0.464]], - [0.341, [0.733, 0.887, 0.469]], - [0.342, [0.733, 0.887, 0.469]], - [0.344, [0.741, 0.89, 0.474]], - [0.346, [0.741, 0.89, 0.474]], - [0.348, [0.749, 0.893, 0.479]], - [0.35, [0.749, 0.893, 0.479]], [0.352, [0.757, 0.897, 0.484]], - [0.354, [0.757, 0.897, 0.484]], - [0.356, [0.765, 0.9, 0.489]], - [0.358, [0.765, 0.9, 0.489]], - [0.36, [0.773, 0.903, 0.494]], - [0.362, [0.773, 0.903, 0.494]], - [0.364, [0.78, 0.907, 0.499]], - [0.366, [0.78, 0.907, 0.499]], - [0.368, [0.788, 0.91, 0.504]], - [0.37, [0.788, 0.91, 0.504]], - [0.372, [0.796, 0.914, 0.51]], - [0.374, [0.796, 0.914, 0.51]], - [0.376, [0.804, 0.917, 0.515]], - [0.378, [0.804, 0.917, 0.515]], - [0.38, [0.812, 0.92, 0.52]], [0.382, [0.812, 0.92, 0.52]], - [0.384, [0.82, 0.924, 0.525]], - [0.386, [0.82, 0.924, 0.525]], - [0.387, [0.827, 0.927, 0.53]], - [0.389, [0.827, 0.927, 0.53]], - [0.391, [0.835, 0.93, 0.535]], - [0.393, [0.835, 0.93, 0.535]], - [0.395, [0.843, 0.934, 0.54]], - [0.397, [0.843, 0.934, 0.54]], - [0.399, [0.851, 0.937, 0.545]], - [0.401, [0.851, 0.937, 0.545]], - [0.403, [0.857, 0.94, 0.553]], - [0.405, [0.857, 0.94, 0.553]], - [0.407, [0.863, 0.942, 0.561]], - [0.409, [0.863, 0.942, 0.561]], [0.411, [0.869, 0.945, 0.569]], - [0.413, [0.869, 0.945, 0.569]], - [0.415, [0.874, 0.947, 0.577]], - [0.417, [0.874, 0.947, 0.577]], - [0.419, [0.88, 0.95, 0.585]], - [0.421, [0.88, 0.95, 0.585]], - [0.423, [0.886, 0.952, 0.593]], - [0.425, [0.886, 0.952, 0.593]], - [0.427, [0.892, 0.954, 0.601]], - [0.429, [0.892, 0.954, 0.601]], - [0.431, [0.898, 0.957, 0.609]], - [0.432, [0.898, 0.957, 0.609]], - [0.434, [0.904, 0.959, 0.617]], - [0.436, [0.904, 0.959, 0.617]], - [0.438, [0.909, 0.962, 0.625]], [0.44, [0.909, 0.962, 0.625]], - [0.442, [0.915, 0.964, 0.633]], - [0.444, [0.915, 0.964, 0.633]], - [0.446, [0.921, 0.967, 0.641]], - [0.448, [0.921, 0.967, 0.641]], - [0.45, [0.927, 0.969, 0.649]], - [0.452, [0.927, 0.969, 0.649]], - [0.454, [0.933, 0.972, 0.657]], - [0.456, [0.933, 0.972, 0.657]], - [0.458, [0.939, 0.974, 0.665]], - [0.46, [0.939, 0.974, 0.665]], - [0.462, [0.944, 0.977, 0.673]], - [0.464, [0.944, 0.977, 0.673]], - [0.466, [0.95, 0.979, 0.681]], - [0.468, [0.95, 0.979, 0.681]], [0.47, [0.956, 0.982, 0.689]], - [0.472, [0.956, 0.982, 0.689]], - [0.474, [0.962, 0.984, 0.697]], - [0.476, [0.962, 0.984, 0.697]], - [0.477, [0.968, 0.986, 0.705]], - [0.479, [0.968, 0.986, 0.705]], - [0.481, [0.974, 0.989, 0.713]], - [0.483, [0.974, 0.989, 0.713]], - [0.485, [0.98, 0.991, 0.721]], - [0.487, [0.98, 0.991, 0.721]], - [0.489, [0.985, 0.994, 0.729]], - [0.491, [0.985, 0.994, 0.729]], - [0.493, [0.991, 0.996, 0.737]], - [0.495, [0.991, 0.996, 0.737]], - [0.497, [0.997, 0.999, 0.745]], [0.499, [0.997, 0.999, 0.745]], - [0.501, [1, 0.998, 0.745]], - [0.503, [1, 0.998, 0.745]], - [0.505, [1, 0.993, 0.737]], - [0.507, [1, 0.993, 0.737]], - [0.509, [1, 0.988, 0.729]], - [0.511, [1, 0.988, 0.729]], - [0.513, [0.999, 0.983, 0.721]], - [0.515, [0.999, 0.983, 0.721]], - [0.517, [0.999, 0.979, 0.713]], - [0.519, [0.999, 0.979, 0.713]], - [0.521, [0.999, 0.974, 0.705]], - [0.523, [0.999, 0.974, 0.705]], - [0.524, [0.999, 0.969, 0.697]], - [0.526, [0.999, 0.969, 0.697]], [0.528, [0.999, 0.964, 0.689]], - [0.53, [0.999, 0.964, 0.689]], - [0.532, [0.999, 0.959, 0.681]], - [0.534, [0.999, 0.959, 0.681]], - [0.536, [0.999, 0.955, 0.673]], - [0.538, [0.999, 0.955, 0.673]], - [0.54, [0.998, 0.95, 0.665]], - [0.542, [0.998, 0.95, 0.665]], - [0.544, [0.998, 0.945, 0.657]], - [0.546, [0.998, 0.945, 0.657]], - [0.548, [0.998, 0.94, 0.649]], - [0.55, [0.998, 0.94, 0.649]], - [0.552, [0.998, 0.936, 0.641]], - [0.554, [0.998, 0.936, 0.641]], - [0.556, [0.998, 0.931, 0.633]], [0.558, [0.998, 0.931, 0.633]], - [0.56, [0.998, 0.926, 0.625]], - [0.562, [0.998, 0.926, 0.625]], - [0.564, [0.997, 0.921, 0.617]], - [0.566, [0.997, 0.921, 0.617]], - [0.568, [0.997, 0.917, 0.609]], - [0.569, [0.997, 0.917, 0.609]], - [0.571, [0.997, 0.912, 0.601]], - [0.573, [0.997, 0.912, 0.601]], - [0.575, [0.997, 0.907, 0.593]], - [0.577, [0.997, 0.907, 0.593]], - [0.579, [0.997, 0.902, 0.585]], - [0.581, [0.997, 0.902, 0.585]], - [0.583, [0.997, 0.898, 0.577]], - [0.585, [0.997, 0.898, 0.577]], [0.587, [0.997, 0.893, 0.569]], - [0.589, [0.997, 0.893, 0.569]], - [0.591, [0.996, 0.888, 0.561]], - [0.593, [0.996, 0.888, 0.561]], - [0.595, [0.996, 0.883, 0.553]], - [0.597, [0.996, 0.883, 0.553]], - [0.599, [0.996, 0.878, 0.545]], - [0.601, [0.996, 0.878, 0.545]], - [0.603, [0.996, 0.871, 0.539]], - [0.605, [0.996, 0.871, 0.539]], - [0.607, [0.996, 0.863, 0.532]], - [0.609, [0.996, 0.863, 0.532]], - [0.611, [0.996, 0.855, 0.526]], - [0.613, [0.996, 0.855, 0.526]], - [0.614, [0.995, 0.848, 0.519]], [0.616, [0.995, 0.848, 0.519]], - [0.618, [0.995, 0.84, 0.513]], - [0.62, [0.995, 0.84, 0.513]], - [0.622, [0.995, 0.832, 0.506]], - [0.624, [0.995, 0.832, 0.506]], - [0.626, [0.995, 0.825, 0.5]], - [0.628, [0.995, 0.825, 0.5]], - [0.63, [0.995, 0.817, 0.493]], - [0.632, [0.995, 0.817, 0.493]], - [0.634, [0.995, 0.809, 0.487]], - [0.636, [0.995, 0.809, 0.487]], - [0.638, [0.995, 0.802, 0.481]], - [0.64, [0.995, 0.802, 0.481]], - [0.642, [0.994, 0.794, 0.474]], - [0.644, [0.994, 0.794, 0.474]], [0.646, [0.994, 0.786, 0.468]], - [0.648, [0.994, 0.786, 0.468]], - [0.65, [0.994, 0.778, 0.461]], - [0.652, [0.994, 0.778, 0.461]], - [0.654, [0.994, 0.771, 0.455]], - [0.656, [0.994, 0.771, 0.455]], - [0.658, [0.994, 0.763, 0.448]], - [0.659, [0.994, 0.763, 0.448]], - [0.661, [0.994, 0.755, 0.442]], - [0.663, [0.994, 0.755, 0.442]], - [0.665, [0.993, 0.748, 0.435]], - [0.667, [0.993, 0.748, 0.435]], - [0.669, [0.993, 0.74, 0.429]], - [0.671, [0.993, 0.74, 0.429]], - [0.673, [0.993, 0.732, 0.422]], [0.675, [0.993, 0.732, 0.422]], - [0.677, [0.993, 0.725, 0.416]], - [0.679, [0.993, 0.725, 0.416]], - [0.681, [0.993, 0.717, 0.409]], - [0.683, [0.993, 0.717, 0.409]], - [0.685, [0.993, 0.709, 0.403]], - [0.687, [0.993, 0.709, 0.403]], - [0.689, [0.993, 0.702, 0.397]], - [0.691, [0.993, 0.702, 0.397]], - [0.693, [0.992, 0.694, 0.39]], - [0.695, [0.992, 0.694, 0.39]], - [0.697, [0.992, 0.686, 0.384]], - [0.699, [0.992, 0.686, 0.384]], - [0.701, [0.991, 0.677, 0.378]], - [0.703, [0.991, 0.677, 0.378]], [0.705, [0.99, 0.667, 0.373]], - [0.706, [0.99, 0.667, 0.373]], - [0.708, [0.989, 0.657, 0.369]], - [0.71, [0.989, 0.657, 0.369]], - [0.712, [0.987, 0.647, 0.364]], - [0.714, [0.987, 0.647, 0.364]], - [0.716, [0.986, 0.637, 0.36]], - [0.718, [0.986, 0.637, 0.36]], - [0.72, [0.985, 0.627, 0.355]], - [0.722, [0.985, 0.627, 0.355]], - [0.724, [0.983, 0.617, 0.35]], - [0.726, [0.983, 0.617, 0.35]], - [0.728, [0.982, 0.607, 0.346]], - [0.73, [0.982, 0.607, 0.346]], - [0.732, [0.98, 0.597, 0.341]], [0.734, [0.98, 0.597, 0.341]], - [0.736, [0.979, 0.587, 0.337]], - [0.738, [0.979, 0.587, 0.337]], - [0.74, [0.978, 0.577, 0.332]], - [0.742, [0.978, 0.577, 0.332]], - [0.744, [0.976, 0.567, 0.327]], - [0.746, [0.976, 0.567, 0.327]], - [0.748, [0.975, 0.557, 0.323]], - [0.75, [0.975, 0.557, 0.323]], - [0.751, [0.973, 0.547, 0.318]], - [0.753, [0.973, 0.547, 0.318]], - [0.755, [0.972, 0.537, 0.313]], - [0.757, [0.972, 0.537, 0.313]], - [0.759, [0.971, 0.527, 0.309]], - [0.761, [0.971, 0.527, 0.309]], [0.763, [0.969, 0.517, 0.304]], - [0.765, [0.969, 0.517, 0.304]], - [0.767, [0.968, 0.507, 0.3]], - [0.769, [0.968, 0.507, 0.3]], - [0.771, [0.967, 0.497, 0.295]], - [0.773, [0.967, 0.497, 0.295]], - [0.775, [0.965, 0.487, 0.29]], - [0.777, [0.965, 0.487, 0.29]], - [0.779, [0.964, 0.477, 0.286]], - [0.781, [0.964, 0.477, 0.286]], - [0.783, [0.962, 0.467, 0.281]], - [0.785, [0.962, 0.467, 0.281]], - [0.787, [0.961, 0.457, 0.277]], - [0.789, [0.961, 0.457, 0.277]], - [0.791, [0.96, 0.447, 0.272]], [0.793, [0.96, 0.447, 0.272]], - [0.795, [0.958, 0.437, 0.267]], - [0.796, [0.958, 0.437, 0.267]], - [0.798, [0.957, 0.427, 0.263]], - [0.8, [0.957, 0.427, 0.263]], - [0.802, [0.952, 0.418, 0.258]], - [0.804, [0.952, 0.418, 0.258]], - [0.806, [0.948, 0.409, 0.254]], - [0.808, [0.948, 0.409, 0.254]], - [0.81, [0.943, 0.399, 0.25]], - [0.812, [0.943, 0.399, 0.25]], - [0.814, [0.939, 0.39, 0.246]], - [0.816, [0.939, 0.39, 0.246]], - [0.818, [0.935, 0.381, 0.241]], - [0.82, [0.935, 0.381, 0.241]], [0.822, [0.93, 0.371, 0.237]], - [0.824, [0.93, 0.371, 0.237]], - [0.826, [0.926, 0.362, 0.233]], - [0.828, [0.926, 0.362, 0.233]], - [0.83, [0.921, 0.352, 0.228]], - [0.832, [0.921, 0.352, 0.228]], - [0.834, [0.917, 0.343, 0.224]], - [0.836, [0.917, 0.343, 0.224]], - [0.838, [0.912, 0.334, 0.22]], - [0.84, [0.912, 0.334, 0.22]], - [0.841, [0.908, 0.324, 0.215]], - [0.843, [0.908, 0.324, 0.215]], - [0.845, [0.903, 0.315, 0.211]], - [0.847, [0.903, 0.315, 0.211]], - [0.849, [0.899, 0.305, 0.207]], [0.851, [0.899, 0.305, 0.207]], - [0.853, [0.894, 0.296, 0.202]], - [0.855, [0.894, 0.296, 0.202]], - [0.857, [0.89, 0.287, 0.198]], - [0.859, [0.89, 0.287, 0.198]], - [0.861, [0.886, 0.277, 0.194]], - [0.863, [0.886, 0.277, 0.194]], - [0.865, [0.881, 0.268, 0.19]], - [0.867, [0.881, 0.268, 0.19]], - [0.869, [0.877, 0.259, 0.185]], - [0.871, [0.877, 0.259, 0.185]], - [0.873, [0.872, 0.249, 0.181]], - [0.875, [0.872, 0.249, 0.181]], - [0.877, [0.868, 0.24, 0.177]], - [0.879, [0.868, 0.24, 0.177]], [0.881, [0.863, 0.23, 0.172]], - [0.883, [0.863, 0.23, 0.172]], - [0.885, [0.859, 0.221, 0.168]], - [0.886, [0.859, 0.221, 0.168]], - [0.888, [0.854, 0.212, 0.164]], - [0.89, [0.854, 0.212, 0.164]], - [0.892, [0.85, 0.202, 0.159]], - [0.894, [0.85, 0.202, 0.159]], - [0.896, [0.845, 0.193, 0.155]], - [0.898, [0.845, 0.193, 0.155]], - [0.9, [0.839, 0.185, 0.153]], - [0.902, [0.839, 0.185, 0.153]], - [0.904, [0.832, 0.177, 0.153]], - [0.906, [0.832, 0.177, 0.153]], - [0.908, [0.824, 0.17, 0.153]], [0.91, [0.824, 0.17, 0.153]], - [0.912, [0.816, 0.162, 0.152]], - [0.914, [0.816, 0.162, 0.152]], - [0.916, [0.809, 0.155, 0.152]], - [0.918, [0.809, 0.155, 0.152]], - [0.92, [0.801, 0.148, 0.152]], - [0.922, [0.801, 0.148, 0.152]], - [0.924, [0.793, 0.14, 0.152]], - [0.926, [0.793, 0.14, 0.152]], - [0.928, [0.785, 0.133, 0.152]], - [0.93, [0.785, 0.133, 0.152]], - [0.932, [0.778, 0.125, 0.152]], - [0.933, [0.778, 0.125, 0.152]], - [0.935, [0.77, 0.118, 0.151]], - [0.937, [0.77, 0.118, 0.151]], [0.939, [0.762, 0.111, 0.151]], - [0.941, [0.762, 0.111, 0.151]], - [0.943, [0.755, 0.103, 0.151]], - [0.945, [0.755, 0.103, 0.151]], - [0.947, [0.747, 0.096, 0.151]], - [0.949, [0.747, 0.096, 0.151]], - [0.951, [0.739, 0.089, 0.151]], - [0.953, [0.739, 0.089, 0.151]], - [0.955, [0.732, 0.081, 0.151]], - [0.957, [0.732, 0.081, 0.151]], - [0.959, [0.724, 0.074, 0.151]], - [0.961, [0.724, 0.074, 0.151]], - [0.963, [0.716, 0.066, 0.15]], - [0.965, [0.716, 0.066, 0.15]], - [0.967, [0.709, 0.059, 0.15]], [0.969, [0.709, 0.059, 0.15]], - [0.971, [0.701, 0.052, 0.15]], - [0.973, [0.701, 0.052, 0.15]], - [0.975, [0.693, 0.044, 0.15]], - [0.977, [0.693, 0.044, 0.15]], - [0.978, [0.686, 0.037, 0.15]], - [0.98, [0.686, 0.037, 0.15]], - [0.982, [0.678, 0.03, 0.15]], - [0.984, [0.678, 0.03, 0.15]], - [0.986, [0.67, 0.022, 0.149]], - [0.988, [0.67, 0.022, 0.149]], - [0.99, [0.662, 0.015, 0.149]], - [0.992, [0.662, 0.015, 0.149]], - [0.994, [0.655, 0.007, 0.149]], - [0.996, [0.655, 0.007, 0.149]], [0.998, [0.647, 0, 0.149]], [1, [0.647, 0, 0.149]], ], diff --git a/src/plugins/charts/server/plugin.ts b/src/plugins/charts/server/plugin.ts index 39a93962832f3a..63b703e6b75384 100644 --- a/src/plugins/charts/server/plugin.ts +++ b/src/plugins/charts/server/plugin.ts @@ -31,7 +31,7 @@ export class ChartsServerPlugin implements Plugin { type: 'json', description: i18n.translate('charts.advancedSettings.visualization.colorMappingText', { defaultMessage: - 'Maps values to specific colors in Visualize charts and TSVB. This setting does not apply to Lens.', + 'Maps values to specific colors in charts using the Compatibility palette.', }), deprecation: { message: i18n.translate( diff --git a/src/plugins/console/public/application/components/console_menu.tsx b/src/plugins/console/public/application/components/console_menu.tsx index 40e3ce9c44e26d..6c5eb8646c58d1 100644 --- a/src/plugins/console/public/application/components/console_menu.tsx +++ b/src/plugins/console/public/application/components/console_menu.tsx @@ -16,7 +16,7 @@ import { i18n } from '@kbn/i18n'; interface Props { getCurl: () => Promise; getDocumentation: () => Promise; - autoIndent: (ev?: React.MouseEvent) => void; + autoIndent: (ev: React.MouseEvent) => void; addNotification?: (opts: { title: string }) => void; } @@ -84,8 +84,7 @@ export class ConsoleMenu extends Component { window.open(documentation, '_blank'); }; - // Using `any` here per this issue: https://github.com/elastic/eui/issues/2265 - autoIndent: any = (event: React.MouseEvent) => { + autoIndent = (event: React.MouseEvent) => { this.closePopover(); this.props.autoIndent(event); }; diff --git a/src/plugins/console/public/application/components/settings_modal.tsx b/src/plugins/console/public/application/components/settings_modal.tsx index 161b67500b47c7..033bce42177bef 100644 --- a/src/plugins/console/public/application/components/settings_modal.tsx +++ b/src/plugins/console/public/application/components/settings_modal.tsx @@ -32,7 +32,7 @@ export type AutocompleteOptions = 'fields' | 'indices' | 'templates'; interface Props { onSaveSettings: (newSettings: DevToolsSettings) => void; onClose: () => void; - refreshAutocompleteSettings: (selectedSettings: any) => void; + refreshAutocompleteSettings: (selectedSettings: DevToolsSettings['autocomplete']) => void; settings: DevToolsSettings; } @@ -233,7 +233,7 @@ export function DevToolsSettingsModal(props: Props) { return rest; })} idToSelectedMap={checkboxIdToSelectedMap} - onChange={(e: any) => { + onChange={(e: unknown) => { onAutocompleteChange(e as AutocompleteOptions); }} /> diff --git a/src/plugins/console/public/application/containers/console_history/console_history.tsx b/src/plugins/console/public/application/containers/console_history/console_history.tsx index 4d5c08705e0d5f..7fbef6de80eef8 100644 --- a/src/plugins/console/public/application/containers/console_history/console_history.tsx +++ b/src/plugins/console/public/application/containers/console_history/console_history.tsx @@ -53,7 +53,7 @@ export function ConsoleHistory({ close }: Props) { const selectedReq = useRef(null); const describeReq = useMemo(() => { - const _describeReq = (req: any) => { + const _describeReq = (req: { endpoint: string; time: string }) => { const endpoint = req.endpoint; const date = moment(req.time); diff --git a/src/plugins/console/public/application/containers/console_history/history_viewer.tsx b/src/plugins/console/public/application/containers/console_history/history_viewer.tsx index 00a7cf8afa2c08..605f9a254f228d 100644 --- a/src/plugins/console/public/application/containers/console_history/history_viewer.tsx +++ b/src/plugins/console/public/application/containers/console_history/history_viewer.tsx @@ -20,7 +20,7 @@ import { applyCurrentSettings } from '../editor/legacy/console_editor/apply_edit interface Props { settings: DevToolsSettings; - req: any | null; + req: { method: string; endpoint: string; data: string; time: string } | null; } export function HistoryViewer({ settings, req }: Props) { diff --git a/src/plugins/console/public/application/containers/editor/legacy/console_editor/apply_editor_settings.ts b/src/plugins/console/public/application/containers/editor/legacy/console_editor/apply_editor_settings.ts index 678ea1c387096e..f84999b2947426 100644 --- a/src/plugins/console/public/application/containers/editor/legacy/console_editor/apply_editor_settings.ts +++ b/src/plugins/console/public/application/containers/editor/legacy/console_editor/apply_editor_settings.ts @@ -14,7 +14,7 @@ export function applyCurrentSettings( editor: CoreEditor | CustomAceEditor, settings: DevToolsSettings ) { - if ((editor as any).setStyles) { + if ((editor as { setStyles?: Function }).setStyles) { (editor as CoreEditor).setStyles({ wrapLines: settings.wrapMode, fontSize: settings.fontSize + 'px', diff --git a/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.test.tsx b/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.test.tsx index c4da04dfbf5a62..1732dd9572b905 100644 --- a/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.test.tsx +++ b/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.test.tsx @@ -27,7 +27,7 @@ import { // Mocked functions import { sendRequestToES } from '../../../../hooks/use_send_current_request_to_es/send_request_to_es'; import { getEndpointFromPosition } from '../../../../../lib/autocomplete/get_endpoint_from_position'; - +import type { DevToolsSettings } from '../../../../../services'; import * as consoleMenuActions from '../console_menu_actions'; import { Editor } from './editor'; @@ -40,7 +40,7 @@ describe('Legacy (Ace) Console Editor Component Smoke Test', () => { - + diff --git a/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.tsx b/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.tsx index 8b965480d077bc..541ad8b0563a4f 100644 --- a/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.tsx +++ b/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.tsx @@ -229,7 +229,7 @@ function EditorUI({ initialTextValue }: EditorProps) { getDocumentation={() => { return getDocumentation(editorInstanceRef.current!, docLinkVersion); }} - autoIndent={(event: any) => { + autoIndent={(event) => { autoIndent(editorInstanceRef.current!, event); }} addNotification={({ title }) => notifications.toasts.add({ title })} diff --git a/src/plugins/console/public/application/containers/editor/legacy/console_menu_actions.ts b/src/plugins/console/public/application/containers/editor/legacy/console_menu_actions.ts index 7aa3e96464800c..f1bacd62289fb1 100644 --- a/src/plugins/console/public/application/containers/editor/legacy/console_menu_actions.ts +++ b/src/plugins/console/public/application/containers/editor/legacy/console_menu_actions.ts @@ -9,7 +9,7 @@ import { getEndpointFromPosition } from '../../../../lib/autocomplete/get_endpoint_from_position'; import { SenseEditor } from '../../../models/sense_editor'; -export async function autoIndent(editor: SenseEditor, event: Event) { +export async function autoIndent(editor: SenseEditor, event: React.MouseEvent) { event.preventDefault(); await editor.autoIndent(); editor.getCoreEditor().getContainer().focus(); diff --git a/src/plugins/console/public/application/containers/settings.tsx b/src/plugins/console/public/application/containers/settings.tsx index 7028a479635f4a..1282a0b3899026 100644 --- a/src/plugins/console/public/application/containers/settings.tsx +++ b/src/plugins/console/public/application/containers/settings.tsx @@ -15,14 +15,20 @@ import { retrieveAutoCompleteInfo } from '../../lib/mappings/mappings'; import { useServicesContext, useEditorActionContext } from '../contexts'; import { DevToolsSettings, Settings as SettingsService } from '../../services'; -const getAutocompleteDiff = (newSettings: DevToolsSettings, prevSettings: DevToolsSettings) => { +const getAutocompleteDiff = ( + newSettings: DevToolsSettings, + prevSettings: DevToolsSettings +): AutocompleteOptions[] => { return Object.keys(newSettings.autocomplete).filter((key) => { // @ts-ignore return prevSettings.autocomplete[key] !== newSettings.autocomplete[key]; - }); + }) as AutocompleteOptions[]; }; -const refreshAutocompleteSettings = (settings: SettingsService, selectedSettings: any) => { +const refreshAutocompleteSettings = ( + settings: SettingsService, + selectedSettings: DevToolsSettings['autocomplete'] +) => { retrieveAutoCompleteInfo(settings, selectedSettings); }; @@ -44,12 +50,12 @@ const fetchAutocompleteSettingsIfNeeded = ( if (isSettingsChanged) { // If the user has changed one of the autocomplete settings, then we'll fetch just the // ones which have changed. - const changedSettings: any = autocompleteDiff.reduce( - (changedSettingsAccum: any, setting: string): any => { - changedSettingsAccum[setting] = newSettings.autocomplete[setting as AutocompleteOptions]; + const changedSettings: DevToolsSettings['autocomplete'] = autocompleteDiff.reduce( + (changedSettingsAccum, setting) => { + changedSettingsAccum[setting] = newSettings.autocomplete[setting]; return changedSettingsAccum; }, - {} + {} as DevToolsSettings['autocomplete'] ); retrieveAutoCompleteInfo(settings, changedSettings); } else if (isPollingChanged && newSettings.polling) { @@ -89,7 +95,7 @@ export function Settings({ onClose }: Props) { + refreshAutocompleteSettings={(selectedSettings) => refreshAutocompleteSettings(settings, selectedSettings) } settings={settings.toJSON()} diff --git a/src/plugins/console/public/application/contexts/editor_context/editor_context.tsx b/src/plugins/console/public/application/contexts/editor_context/editor_context.tsx index 32e5216a85d7ed..d4f809b5fbfb32 100644 --- a/src/plugins/console/public/application/contexts/editor_context/editor_context.tsx +++ b/src/plugins/console/public/application/contexts/editor_context/editor_context.tsx @@ -11,11 +11,11 @@ import * as editor from '../../stores/editor'; import { DevToolsSettings } from '../../../services'; import { createUseContext } from '../create_use_context'; -const EditorReadContext = createContext(null as any); -const EditorActionContext = createContext>(null as any); +const EditorReadContext = createContext(editor.initialValue); +const EditorActionContext = createContext>(() => {}); export interface EditorContextArgs { - children: any; + children: JSX.Element; settings: DevToolsSettings; } @@ -25,7 +25,7 @@ export function EditorContextProvider({ children, settings }: EditorContextArgs) settings, })); return ( - + {children} ); diff --git a/src/plugins/console/public/application/contexts/request_context.tsx b/src/plugins/console/public/application/contexts/request_context.tsx index 38ac5c7163add4..96ba1f69212b4b 100644 --- a/src/plugins/console/public/application/contexts/request_context.tsx +++ b/src/plugins/console/public/application/contexts/request_context.tsx @@ -10,8 +10,8 @@ import React, { createContext, useReducer, Dispatch } from 'react'; import { createUseContext } from './create_use_context'; import * as store from '../stores/request'; -const RequestReadContext = createContext(null as any); -const RequestActionContext = createContext>(null as any); +const RequestReadContext = createContext(store.initialValue); +const RequestActionContext = createContext>(() => {}); export function RequestContextProvider({ children }: { children: React.ReactNode }) { const [state, dispatch] = useReducer(store.reducer, store.initialValue); diff --git a/src/plugins/console/public/application/contexts/services_context.mock.ts b/src/plugins/console/public/application/contexts/services_context.mock.ts index 6c67aa37727b2f..c4ac8ca25378bf 100644 --- a/src/plugins/console/public/application/contexts/services_context.mock.ts +++ b/src/plugins/console/public/application/contexts/services_context.mock.ts @@ -9,6 +9,7 @@ import { notificationServiceMock } from '../../../../../core/public/mocks'; import { httpServiceMock } from '../../../../../core/public/mocks'; +import type { ObjectStorageClient } from '../../../common/types'; import { HistoryMock } from '../../services/history.mock'; import { SettingsMock } from '../../services/settings.mock'; import { StorageMock } from '../../services/storage.mock'; @@ -18,7 +19,7 @@ import { ContextValue } from './services_context'; export const serviceContextMock = { create: (): ContextValue => { - const storage = new StorageMock({} as any, 'test'); + const storage = new StorageMock(({} as unknown) as Storage, 'test'); const http = httpServiceMock.createSetupContract(); const api = createApi({ http }); const esHostService = createEsHostService({ api }); @@ -31,7 +32,7 @@ export const serviceContextMock = { settings: new SettingsMock(storage), history: new HistoryMock(storage), notifications: notificationServiceMock.createSetupContract(), - objectStorageClient: {} as any, + objectStorageClient: ({} as unknown) as ObjectStorageClient, }, docLinkVersion: 'NA', }; diff --git a/src/plugins/console/public/application/contexts/services_context.tsx b/src/plugins/console/public/application/contexts/services_context.tsx index 58587bf3030e2c..53c021d4d09825 100644 --- a/src/plugins/console/public/application/contexts/services_context.tsx +++ b/src/plugins/console/public/application/contexts/services_context.tsx @@ -30,10 +30,10 @@ export interface ContextValue { interface ContextProps { value: ContextValue; - children: any; + children: JSX.Element; } -const ServicesContext = createContext(null as any); +const ServicesContext = createContext(null); export function ServicesContextProvider({ children, value }: ContextProps) { useEffect(() => { @@ -46,8 +46,8 @@ export function ServicesContextProvider({ children, value }: ContextProps) { export const useServicesContext = () => { const context = useContext(ServicesContext); - if (context === undefined) { + if (context == null) { throw new Error('useServicesContext must be used inside the ServicesContextProvider.'); } - return context; + return context!; }; diff --git a/src/plugins/console/public/application/hooks/use_restore_request_from_history/restore_request_from_history.ts b/src/plugins/console/public/application/hooks/use_restore_request_from_history/restore_request_from_history.ts index f8537f9d0b3c4b..85c9cf6b9f014f 100644 --- a/src/plugins/console/public/application/hooks/use_restore_request_from_history/restore_request_from_history.ts +++ b/src/plugins/console/public/application/hooks/use_restore_request_from_history/restore_request_from_history.ts @@ -7,12 +7,10 @@ */ import RowParser from '../../../lib/row_parser'; +import { ESRequest } from '../../../types'; import { SenseEditor } from '../../models/sense_editor'; -/** - * This function is considered legacy and should not be changed or updated before we have editor - * interfaces in place (it's using a customized version of Ace directly). - */ -export function restoreRequestFromHistory(editor: SenseEditor, req: any) { + +export function restoreRequestFromHistory(editor: SenseEditor, req: ESRequest) { const coreEditor = editor.getCoreEditor(); let pos = coreEditor.getCurrentPosition(); let prefix = ''; diff --git a/src/plugins/console/public/application/hooks/use_restore_request_from_history/use_restore_request_from_history.ts b/src/plugins/console/public/application/hooks/use_restore_request_from_history/use_restore_request_from_history.ts index 310d6c67b90bc1..7c140e2b189754 100644 --- a/src/plugins/console/public/application/hooks/use_restore_request_from_history/use_restore_request_from_history.ts +++ b/src/plugins/console/public/application/hooks/use_restore_request_from_history/use_restore_request_from_history.ts @@ -8,10 +8,11 @@ import { useCallback } from 'react'; import { instance as registry } from '../../contexts/editor_context/editor_registry'; +import { ESRequest } from '../../../types'; import { restoreRequestFromHistory } from './restore_request_from_history'; export const useRestoreRequestFromHistory = () => { - return useCallback((req: any) => { + return useCallback((req: ESRequest) => { const editor = registry.getInputEditor(); restoreRequestFromHistory(editor, req); }, []); diff --git a/src/plugins/console/public/application/hooks/use_send_current_request_to_es/send_request_to_es.ts b/src/plugins/console/public/application/hooks/use_send_current_request_to_es/send_request_to_es.ts index aeaa2f76816e4d..a86cfd8890a5b7 100644 --- a/src/plugins/console/public/application/hooks/use_send_current_request_to_es/send_request_to_es.ts +++ b/src/plugins/console/public/application/hooks/use_send_current_request_to_es/send_request_to_es.ts @@ -8,19 +8,14 @@ import { extractWarningMessages } from '../../../lib/utils'; import { XJson } from '../../../../../es_ui_shared/public'; -const { collapseLiteralStrings } = XJson; // @ts-ignore import * as es from '../../../lib/es/es'; import { BaseResponseType } from '../../../types'; -export interface EsRequestArgs { - requests: any; -} +const { collapseLiteralStrings } = XJson; -export interface ESRequestObject { - path: string; - data: any; - method: string; +export interface EsRequestArgs { + requests: Array<{ url: string; method: string; data: string[] }>; } export interface ESResponseObject { @@ -32,7 +27,7 @@ export interface ESResponseObject { } export interface ESRequestResult { - request: ESRequestObject; + request: { data: string; method: string; path: string }; response: ESResponseObject; } @@ -61,7 +56,7 @@ export function sendRequestToES(args: EsRequestArgs): Promise resolve(results); return; } - const req = requests.shift(); + const req = requests.shift()!; const esPath = req.url; const esMethod = req.method; let esData = collapseLiteralStrings(req.data.join('\n')); @@ -71,7 +66,7 @@ export function sendRequestToES(args: EsRequestArgs): Promise const startTime = Date.now(); es.send(esMethod, esPath, esData).always( - (dataOrjqXHR: any, textStatus: string, jqXhrORerrorThrown: any) => { + (dataOrjqXHR, textStatus: string, jqXhrORerrorThrown) => { if (reqId !== CURRENT_REQ_ID) { return; } diff --git a/src/plugins/console/public/application/hooks/use_send_current_request_to_es/track.ts b/src/plugins/console/public/application/hooks/use_send_current_request_to_es/track.ts index c9b8cdec66a96c..f5deefd6271878 100644 --- a/src/plugins/console/public/application/hooks/use_send_current_request_to_es/track.ts +++ b/src/plugins/console/public/application/hooks/use_send_current_request_to_es/track.ts @@ -10,7 +10,11 @@ import { SenseEditor } from '../../models/sense_editor'; import { getEndpointFromPosition } from '../../../lib/autocomplete/get_endpoint_from_position'; import { MetricsTracker } from '../../../types'; -export const track = (requests: any[], editor: SenseEditor, trackUiMetric: MetricsTracker) => { +export const track = ( + requests: Array<{ method: string }>, + editor: SenseEditor, + trackUiMetric: MetricsTracker +) => { const coreEditor = editor.getCoreEditor(); // `getEndpointFromPosition` gets values from the server-side generated JSON files which // are a combination of JS, automatically generated JSON and manual overrides. That means diff --git a/src/plugins/console/public/application/hooks/use_send_current_request_to_es/use_send_current_request_to_es.test.tsx b/src/plugins/console/public/application/hooks/use_send_current_request_to_es/use_send_current_request_to_es.test.tsx index e1fc323cd2d9dc..63b57883169564 100644 --- a/src/plugins/console/public/application/hooks/use_send_current_request_to_es/use_send_current_request_to_es.test.tsx +++ b/src/plugins/console/public/application/hooks/use_send_current_request_to_es/use_send_current_request_to_es.test.tsx @@ -26,8 +26,8 @@ import { useSendCurrentRequestToES } from './use_send_current_request_to_es'; describe('useSendCurrentRequestToES', () => { let mockContextValue: ContextValue; - let dispatch: (...args: any[]) => void; - const contexts = ({ children }: { children?: any }) => ( + let dispatch: (...args: unknown[]) => void; + const contexts = ({ children }: { children: JSX.Element }) => ( {children} ); diff --git a/src/plugins/console/public/application/hooks/use_set_input_editor.ts b/src/plugins/console/public/application/hooks/use_set_input_editor.ts index 2c6dc101bee0e6..c01dbbb0d27986 100644 --- a/src/plugins/console/public/application/hooks/use_set_input_editor.ts +++ b/src/plugins/console/public/application/hooks/use_set_input_editor.ts @@ -9,12 +9,13 @@ import { useCallback } from 'react'; import { useEditorActionContext } from '../contexts/editor_context'; import { instance as registry } from '../contexts/editor_context/editor_registry'; +import { SenseEditor } from '../models'; export const useSetInputEditor = () => { const dispatch = useEditorActionContext(); return useCallback( - (editor: any) => { + (editor: SenseEditor) => { dispatch({ type: 'setInputEditor', payload: editor }); registry.setInputEditor(editor); }, diff --git a/src/plugins/console/public/application/index.tsx b/src/plugins/console/public/application/index.tsx index 1237348af215ce..0b41095f8cc19d 100644 --- a/src/plugins/console/public/application/index.tsx +++ b/src/plugins/console/public/application/index.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; -import { HttpSetup, NotificationsSetup } from 'src/core/public'; +import { HttpSetup, NotificationsSetup, I18nStart } from 'src/core/public'; import { ServicesContextProvider, EditorContextProvider, RequestContextProvider } from './contexts'; import { Main } from './containers'; import { createStorage, createHistory, createSettings } from '../services'; @@ -20,7 +20,7 @@ import { createApi, createEsHostService } from './lib'; export interface BootDependencies { http: HttpSetup; docLinkVersion: string; - I18nContext: any; + I18nContext: I18nStart['Context']; notifications: NotificationsSetup; usageCollection?: UsageCollectionSetup; element: HTMLElement; diff --git a/src/plugins/console/public/application/models/legacy_core_editor/create_readonly.ts b/src/plugins/console/public/application/models/legacy_core_editor/create_readonly.ts index 43da86773d294a..dc63f0dcd480c6 100644 --- a/src/plugins/console/public/application/models/legacy_core_editor/create_readonly.ts +++ b/src/plugins/console/public/application/models/legacy_core_editor/create_readonly.ts @@ -13,7 +13,7 @@ import * as OutputMode from './mode/output'; import smartResize from './smart_resize'; export interface CustomAceEditor extends ace.Editor { - update: (text: string, mode?: any, cb?: () => void) => void; + update: (text: string, mode?: unknown, cb?: () => void) => void; append: (text: string, foldPrevious?: boolean, cb?: () => void) => void; } @@ -28,9 +28,9 @@ export function createReadOnlyAceEditor(element: HTMLElement): CustomAceEditor { output.$blockScrolling = Infinity; output.resize = smartResize(output); - output.update = (val: string, mode?: any, cb?: () => void) => { + output.update = (val: string, mode?: unknown, cb?: () => void) => { if (typeof mode === 'function') { - cb = mode; + cb = mode as () => void; mode = void 0; } @@ -65,7 +65,7 @@ export function createReadOnlyAceEditor(element: HTMLElement): CustomAceEditor { (function setupSession(session) { session.setMode('ace/mode/text'); - (session as any).setFoldStyle('markbeginend'); + ((session as unknown) as { setFoldStyle: (v: string) => void }).setFoldStyle('markbeginend'); session.setTabSize(2); session.setUseWrapMode(true); })(output.getSession()); diff --git a/src/plugins/console/public/application/models/legacy_core_editor/legacy_core_editor.test.mocks.ts b/src/plugins/console/public/application/models/legacy_core_editor/legacy_core_editor.test.mocks.ts index c39d4549de0b68..0ee15f7a559ae2 100644 --- a/src/plugins/console/public/application/models/legacy_core_editor/legacy_core_editor.test.mocks.ts +++ b/src/plugins/console/public/application/models/legacy_core_editor/legacy_core_editor.test.mocks.ts @@ -13,7 +13,7 @@ jest.mock('./mode/worker', () => { // @ts-ignore window.Worker = function () { this.postMessage = () => {}; - (this as any).terminate = () => {}; + ((this as unknown) as { terminate: () => void }).terminate = () => {}; }; // @ts-ignore diff --git a/src/plugins/console/public/application/models/legacy_core_editor/legacy_core_editor.ts b/src/plugins/console/public/application/models/legacy_core_editor/legacy_core_editor.ts index eab5ac16d17db0..fa118532aa52d0 100644 --- a/src/plugins/console/public/application/models/legacy_core_editor/legacy_core_editor.ts +++ b/src/plugins/console/public/application/models/legacy_core_editor/legacy_core_editor.ts @@ -31,8 +31,8 @@ const rangeToAceRange = ({ start, end }: Range) => new _AceRange(start.lineNumber - 1, start.column - 1, end.lineNumber - 1, end.column - 1); export class LegacyCoreEditor implements CoreEditor { - private _aceOnPaste: any; - $actions: any; + private _aceOnPaste: Function; + $actions: JQuery; resize: () => void; constructor(private readonly editor: IAceEditor, actions: HTMLElement) { @@ -41,7 +41,9 @@ export class LegacyCoreEditor implements CoreEditor { const session = this.editor.getSession(); session.setMode(new InputMode.Mode()); - (session as any).setFoldStyle('markbeginend'); + ((session as unknown) as { setFoldStyle: (style: string) => void }).setFoldStyle( + 'markbeginend' + ); session.setTabSize(2); session.setUseWrapMode(true); @@ -72,7 +74,7 @@ export class LegacyCoreEditor implements CoreEditor { // torn down, e.g. by closing the History tab, and we don't need to do anything further. if (session.bgTokenizer) { // Wait until the bgTokenizer is done running before executing the callback. - if ((session.bgTokenizer as any).running) { + if (((session.bgTokenizer as unknown) as { running: boolean }).running) { setTimeout(check, checkInterval); } else { resolve(); @@ -197,7 +199,7 @@ export class LegacyCoreEditor implements CoreEditor { .addMarker(rangeToAceRange(range), 'ace_snippet-marker', 'fullLine', false); } - removeMarker(ref: any) { + removeMarker(ref: number) { this.editor.getSession().removeMarker(ref); } @@ -222,8 +224,10 @@ export class LegacyCoreEditor implements CoreEditor { } isCompleterActive() { - // Secrets of the arcane here. - return Boolean((this.editor as any).completer && (this.editor as any).completer.activated); + return Boolean( + ((this.editor as unknown) as { completer: { activated: unknown } }).completer && + ((this.editor as unknown) as { completer: { activated: unknown } }).completer.activated + ); } private forceRetokenize() { @@ -250,7 +254,7 @@ export class LegacyCoreEditor implements CoreEditor { this._aceOnPaste.call(this.editor, text); } - private setActionsBar = (value?: any, topOrBottom: 'top' | 'bottom' = 'top') => { + private setActionsBar = (value: number | null, topOrBottom: 'top' | 'bottom' = 'top') => { if (value === null) { this.$actions.css('visibility', 'hidden'); } else { @@ -271,7 +275,7 @@ export class LegacyCoreEditor implements CoreEditor { }; private hideActionsBar = () => { - this.setActionsBar(); + this.setActionsBar(null); }; execCommand(cmd: string) { @@ -295,7 +299,7 @@ export class LegacyCoreEditor implements CoreEditor { }); } - legacyUpdateUI(range: any) { + legacyUpdateUI(range: Range) { if (!this.$actions) { return; } @@ -360,14 +364,19 @@ export class LegacyCoreEditor implements CoreEditor { ace.define( 'ace/autocomplete/text_completer', ['require', 'exports', 'module'], - function (require: any, exports: any) { - exports.getCompletions = function ( - innerEditor: any, - session: any, - pos: any, - prefix: any, - callback: any - ) { + function ( + require: unknown, + exports: { + getCompletions: ( + innerEditor: unknown, + session: unknown, + pos: unknown, + prefix: unknown, + callback: (e: null | Error, values: string[]) => void + ) => void; + } + ) { + exports.getCompletions = function (innerEditor, session, pos, prefix, callback) { callback(null, []); }; } @@ -387,7 +396,7 @@ export class LegacyCoreEditor implements CoreEditor { DO_NOT_USE_2: IAceEditSession, pos: { row: number; column: number }, prefix: string, - callback: (...args: any[]) => void + callback: (...args: unknown[]) => void ) => { const position: Position = { lineNumber: pos.row + 1, diff --git a/src/plugins/console/public/application/models/legacy_core_editor/smart_resize.ts b/src/plugins/console/public/application/models/legacy_core_editor/smart_resize.ts index fdbaedce091873..83d7cd15e60eb6 100644 --- a/src/plugins/console/public/application/models/legacy_core_editor/smart_resize.ts +++ b/src/plugins/console/public/application/models/legacy_core_editor/smart_resize.ts @@ -7,9 +7,10 @@ */ import { get, throttle } from 'lodash'; +import type { Editor } from 'brace'; // eslint-disable-next-line import/no-default-export -export default function (editor: any) { +export default function (editor: Editor) { const resize = editor.resize; const throttledResize = throttle(() => { diff --git a/src/plugins/console/public/application/models/sense_editor/curl.ts b/src/plugins/console/public/application/models/sense_editor/curl.ts index 299ccd0a1f6a60..74cbebf051d03c 100644 --- a/src/plugins/console/public/application/models/sense_editor/curl.ts +++ b/src/plugins/console/public/application/models/sense_editor/curl.ts @@ -25,7 +25,7 @@ export function detectCURL(text: string) { export function parseCURL(text: string) { let state = 'NONE'; const out = []; - let body: any[] = []; + let body: string[] = []; let line = ''; const lines = text.trim().split('\n'); let matches; @@ -62,7 +62,7 @@ export function parseCURL(text: string) { } function unescapeLastBodyEl() { - const str = body.pop().replace(/\\([\\"'])/g, '$1'); + const str = body.pop()!.replace(/\\([\\"'])/g, '$1'); body.push(str); } diff --git a/src/plugins/console/public/application/models/sense_editor/sense_editor.ts b/src/plugins/console/public/application/models/sense_editor/sense_editor.ts index d6dd74f0fefe3e..0f65d3f1e33e27 100644 --- a/src/plugins/console/public/application/models/sense_editor/sense_editor.ts +++ b/src/plugins/console/public/application/models/sense_editor/sense_editor.ts @@ -7,8 +7,10 @@ */ import _ from 'lodash'; -import RowParser from '../../../lib/row_parser'; + import { XJson } from '../../../../../es_ui_shared/public'; + +import RowParser from '../../../lib/row_parser'; import * as utils from '../../../lib/utils'; // @ts-ignore @@ -16,22 +18,20 @@ import * as es from '../../../lib/es/es'; import { CoreEditor, Position, Range } from '../../../types'; import { createTokenIterator } from '../../factories'; - -import Autocomplete from '../../../lib/autocomplete/autocomplete'; +import createAutocompleter from '../../../lib/autocomplete/autocomplete'; const { collapseLiteralStrings } = XJson; export class SenseEditor { - currentReqRange: (Range & { markerRef: any }) | null; - parser: any; + currentReqRange: (Range & { markerRef: unknown }) | null; + parser: RowParser; - // @ts-ignore - private readonly autocomplete: any; + private readonly autocomplete: ReturnType; constructor(private readonly coreEditor: CoreEditor) { this.currentReqRange = null; this.parser = new RowParser(this.coreEditor); - this.autocomplete = new (Autocomplete as any)({ + this.autocomplete = createAutocompleter({ coreEditor, parser: this.parser, }); @@ -114,7 +114,10 @@ export class SenseEditor { return this.coreEditor.setValue(data, reTokenizeAll); }; - replaceRequestRange = (newRequest: any, requestRange: Range) => { + replaceRequestRange = ( + newRequest: { method: string; url: string; data: string | string[] }, + requestRange: Range + ) => { const text = utils.textFromRequest(newRequest); if (requestRange) { this.coreEditor.replaceRange(requestRange, text); @@ -207,12 +210,12 @@ export class SenseEditor { const request: { method: string; data: string[]; - url: string | null; + url: string; range: Range; } = { method: '', data: [], - url: null, + url: '', range, }; @@ -284,7 +287,7 @@ export class SenseEditor { return []; } - const requests: any = []; + const requests: unknown[] = []; let rangeStartCursor = expandedRange.start.lineNumber; const endLineNumber = expandedRange.end.lineNumber; diff --git a/src/plugins/console/public/application/stores/editor.ts b/src/plugins/console/public/application/stores/editor.ts index 1de4712d9640f3..3fdb0c3fd3422a 100644 --- a/src/plugins/console/public/application/stores/editor.ts +++ b/src/plugins/console/public/application/stores/editor.ts @@ -9,8 +9,9 @@ import { Reducer } from 'react'; import { produce } from 'immer'; import { identity } from 'fp-ts/lib/function'; -import { DevToolsSettings } from '../../services'; +import { DevToolsSettings, DEFAULT_SETTINGS } from '../../services'; import { TextObject } from '../../../common/text_object'; +import { SenseEditor } from '../models'; export interface Store { ready: boolean; @@ -21,15 +22,15 @@ export interface Store { export const initialValue: Store = produce( { ready: false, - settings: null as any, + settings: DEFAULT_SETTINGS, currentTextObject: null, }, identity ); export type Action = - | { type: 'setInputEditor'; payload: any } - | { type: 'setCurrentTextObject'; payload: any } + | { type: 'setInputEditor'; payload: SenseEditor } + | { type: 'setCurrentTextObject'; payload: TextObject } | { type: 'updateSettings'; payload: DevToolsSettings }; export const reducer: Reducer = (state, action) => diff --git a/src/plugins/console/public/lib/ace_token_provider/token_provider.ts b/src/plugins/console/public/lib/ace_token_provider/token_provider.ts index ac518d43ddf256..692528fb8bced8 100644 --- a/src/plugins/console/public/lib/ace_token_provider/token_provider.ts +++ b/src/plugins/console/public/lib/ace_token_provider/token_provider.ts @@ -63,7 +63,7 @@ export class AceTokensProvider implements TokensProvider { return null; } - const tokens: TokenInfo[] = this.session.getTokens(lineNumber - 1) as any; + const tokens = (this.session.getTokens(lineNumber - 1) as unknown) as TokenInfo[]; if (!tokens || !tokens.length) { // We are inside of the document but have no tokens for this line. Return an empty // array to represent this empty line. @@ -74,7 +74,7 @@ export class AceTokensProvider implements TokensProvider { } getTokenAt(pos: Position): Token | null { - const tokens: TokenInfo[] = this.session.getTokens(pos.lineNumber - 1) as any; + const tokens = (this.session.getTokens(pos.lineNumber - 1) as unknown) as TokenInfo[]; if (tokens) { return extractTokenFromAceTokenRow(pos.lineNumber, pos.column, tokens); } diff --git a/src/plugins/console/public/lib/autocomplete/autocomplete.ts b/src/plugins/console/public/lib/autocomplete/autocomplete.ts index e46b5cda3c3a99..d89a9f3d2e5e2b 100644 --- a/src/plugins/console/public/lib/autocomplete/autocomplete.ts +++ b/src/plugins/console/public/lib/autocomplete/autocomplete.ts @@ -18,19 +18,21 @@ import { // @ts-ignore } from '../kb/kb'; +import { createTokenIterator } from '../../application/factories'; +import { Position, Token, Range, CoreEditor } from '../../types'; +import type RowParser from '../row_parser'; + import * as utils from '../utils'; // @ts-ignore import { populateContext } from './engine'; +import { AutoCompleteContext, ResultTerm } from './types'; // @ts-ignore import { URL_PATH_END_MARKER } from './components/index'; -import { createTokenIterator } from '../../application/factories'; -import { Position, Token, Range, CoreEditor } from '../../types'; +let lastEvaluatedToken: Token | null = null; -let lastEvaluatedToken: any = null; - -function isUrlParamsToken(token: any) { +function isUrlParamsToken(token: { type: string } | null) { switch ((token || {}).type) { case 'url.param': case 'url.equal': @@ -54,7 +56,7 @@ function isUrlParamsToken(token: any) { export function getCurrentMethodAndTokenPaths( editor: CoreEditor, pos: Position, - parser: any, + parser: RowParser, forceEndOfUrl?: boolean /* Flag for indicating whether we want to avoid early escape optimization. */ ) { const tokenIter = createTokenIterator({ @@ -62,8 +64,8 @@ export function getCurrentMethodAndTokenPaths( position: pos, }); const startPos = pos; - let bodyTokenPath: any = []; - const ret: any = {}; + let bodyTokenPath: string[] | null = []; + const ret: AutoCompleteContext = {}; const STATES = { looking_for_key: 0, // looking for a key but without jumping over anything but white space and colon. @@ -210,7 +212,12 @@ export function getCurrentMethodAndTokenPaths( ret.urlParamsTokenPath = null; ret.requestStartRow = tokenIter.getCurrentPosition().lineNumber; - let curUrlPart: any; + let curUrlPart: + | null + | string + | Array> + | undefined + | Record; while (t && isUrlParamsToken(t)) { switch (t.type) { @@ -240,7 +247,7 @@ export function getCurrentMethodAndTokenPaths( if (!ret.urlParamsTokenPath) { ret.urlParamsTokenPath = []; } - ret.urlParamsTokenPath.unshift(curUrlPart || {}); + ret.urlParamsTokenPath.unshift((curUrlPart as Record) || {}); curUrlPart = null; break; } @@ -268,7 +275,7 @@ export function getCurrentMethodAndTokenPaths( break; case 'url.slash': if (curUrlPart) { - ret.urlTokenPath.unshift(curUrlPart); + ret.urlTokenPath.unshift(curUrlPart as string); curUrlPart = null; } break; @@ -277,7 +284,7 @@ export function getCurrentMethodAndTokenPaths( } if (curUrlPart) { - ret.urlTokenPath.unshift(curUrlPart); + ret.urlTokenPath.unshift(curUrlPart as string); } if (!ret.bodyTokenPath && !ret.urlParamsTokenPath) { @@ -297,9 +304,15 @@ export function getCurrentMethodAndTokenPaths( } // eslint-disable-next-line -export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEditor; parser: any }) { +export default function ({ + coreEditor: editor, + parser, +}: { + coreEditor: CoreEditor; + parser: RowParser; +}) { function isUrlPathToken(token: Token | null) { - switch ((token || ({} as any)).type) { + switch ((token || ({} as Token)).type) { case 'url.slash': case 'url.comma': case 'url.part': @@ -309,8 +322,12 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito } } - function addMetaToTermsList(list: any, meta: any, template?: string) { - return _.map(list, function (t: any) { + function addMetaToTermsList( + list: unknown[], + meta: unknown, + template?: string + ): Array<{ meta: unknown; template: unknown; name?: string }> { + return _.map(list, function (t) { if (typeof t !== 'object') { t = { name: t }; } @@ -318,8 +335,13 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito }); } - function applyTerm(term: any) { - const context = term.context; + function applyTerm(term: { + value?: string; + context?: AutoCompleteContext; + template?: { __raw: boolean; value: string }; + insertValue?: string; + }) { + const context = term.context!; // make sure we get up to date replacement info. addReplacementInfoToContext(context, editor.getCurrentPosition(), term.insertValue); @@ -346,7 +368,7 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito } else { indentedTemplateLines = utils.jsonToString(term.template, true).split('\n'); } - let currentIndentation = editor.getLineValue(context.rangeToReplace.start.lineNumber); + let currentIndentation = editor.getLineValue(context.rangeToReplace!.start.lineNumber); currentIndentation = currentIndentation.match(/^\s*/)![0]; for ( let i = 1; @@ -374,8 +396,8 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito // disable listening to the changes we are making. editor.off('changeSelection', editorChangeListener); - if (context.rangeToReplace.start.column !== context.rangeToReplace.end.column) { - editor.replace(context.rangeToReplace, valueToInsert); + if (context.rangeToReplace!.start.column !== context.rangeToReplace!.end.column) { + editor.replace(context.rangeToReplace!, valueToInsert); } else { editor.insert(valueToInsert); } @@ -384,12 +406,12 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito // go back to see whether we have one of ( : { & [ do not require a comma. All the rest do. let newPos = { - lineNumber: context.rangeToReplace.start.lineNumber, + lineNumber: context.rangeToReplace!.start.lineNumber, column: - context.rangeToReplace.start.column + + context.rangeToReplace!.start.column + termAsString.length + - context.prefixToAdd.length + - (templateInserted ? 0 : context.suffixToAdd.length), + context.prefixToAdd!.length + + (templateInserted ? 0 : context.suffixToAdd!.length), }; const tokenIter = createTokenIterator({ @@ -406,7 +428,7 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito break; case 'punctuation.colon': nonEmptyToken = parser.nextNonEmptyToken(tokenIter); - if ((nonEmptyToken || ({} as any)).type === 'paren.lparen') { + if ((nonEmptyToken || ({} as Token)).type === 'paren.lparen') { nonEmptyToken = parser.nextNonEmptyToken(tokenIter); newPos = tokenIter.getCurrentPosition(); if (nonEmptyToken && nonEmptyToken.value.indexOf('"') === 0) { @@ -429,7 +451,7 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito function getAutoCompleteContext(ctxEditor: CoreEditor, pos: Position) { // deduces all the parameters need to position and insert the auto complete - const context: any = { + const context: AutoCompleteContext = { autoCompleteSet: null, // instructions for what can be here endpoint: null, urlPath: null, @@ -501,7 +523,7 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito case 'whitespace': t = parser.prevNonEmptyToken(tokenIter); - switch ((t || ({} as any)).type) { + switch ((t || ({} as Token)).type) { case 'method': // we moved one back return 'path'; @@ -552,7 +574,11 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito return null; } - function addReplacementInfoToContext(context: any, pos: Position, replacingTerm?: any) { + function addReplacementInfoToContext( + context: AutoCompleteContext, + pos: Position, + replacingTerm?: unknown + ) { // extract the initial value, rangeToReplace & textBoxPosition // Scenarios for current token: @@ -605,7 +631,7 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito default: if (replacingTerm && context.updatedForToken.value === replacingTerm) { context.rangeToReplace = { - start: { lineNumber: pos.lineNumber, column: anchorToken.column }, + start: { lineNumber: pos.lineNumber, column: anchorToken.position.column }, end: { lineNumber: pos.lineNumber, column: @@ -645,7 +671,7 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito } } - function addBodyPrefixSuffixToContext(context: any) { + function addBodyPrefixSuffixToContext(context: AutoCompleteContext) { // Figure out what happens next to the token to see whether it needs trailing commas etc. // Templates will be used if not destroying existing structure. @@ -680,9 +706,9 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito } context.addTemplate = true; // extend range to replace to include all up to token - context.rangeToReplace.end.lineNumber = tokenIter.getCurrentTokenLineNumber(); - context.rangeToReplace.end.column = - tokenIter.getCurrentTokenColumn() + nonEmptyToken.value.length; + context.rangeToReplace!.end.lineNumber = tokenIter.getCurrentTokenLineNumber() as number; + context.rangeToReplace!.end.column = + (tokenIter.getCurrentTokenColumn() as number) + nonEmptyToken.value.length; // move one more time to check if we need a trailing comma nonEmptyToken = parser.nextNonEmptyToken(tokenIter); @@ -711,11 +737,11 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito insertingRelativeToToken = 0; } else { const pos = editor.getCurrentPosition(); - if (pos.column === context.updatedForToken.position.column) { + if (pos.column === context.updatedForToken!.position.column) { insertingRelativeToToken = -1; } else if ( pos.column < - context.updatedForToken.position.column + context.updatedForToken.value.length + context.updatedForToken!.position.column + context.updatedForToken!.value.length ) { insertingRelativeToToken = 0; } else { @@ -743,12 +769,12 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito return context; } - function addUrlParamsPrefixSuffixToContext(context: any) { + function addUrlParamsPrefixSuffixToContext(context: AutoCompleteContext) { context.prefixToAdd = ''; context.suffixToAdd = ''; } - function addMethodPrefixSuffixToContext(context: any) { + function addMethodPrefixSuffixToContext(context: AutoCompleteContext) { context.prefixToAdd = ''; context.suffixToAdd = ''; const tokenIter = createTokenIterator({ editor, position: editor.getCurrentPosition() }); @@ -761,12 +787,12 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito } } - function addPathPrefixSuffixToContext(context: any) { + function addPathPrefixSuffixToContext(context: AutoCompleteContext) { context.prefixToAdd = ''; context.suffixToAdd = ''; } - function addMethodAutoCompleteSetToContext(context: any) { + function addMethodAutoCompleteSetToContext(context: AutoCompleteContext) { context.autoCompleteSet = ['GET', 'PUT', 'POST', 'DELETE', 'HEAD'].map((m, i) => ({ name: m, score: -i, @@ -774,7 +800,7 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito })); } - function addPathAutoCompleteSetToContext(context: any, pos: Position) { + function addPathAutoCompleteSetToContext(context: AutoCompleteContext, pos: Position) { const ret = getCurrentMethodAndTokenPaths(editor, pos, parser); context.method = ret.method; context.token = ret.token; @@ -783,10 +809,10 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito const components = getTopLevelUrlCompleteComponents(context.method); populateContext(ret.urlTokenPath, context, editor, true, components); - context.autoCompleteSet = addMetaToTermsList(context.autoCompleteSet, 'endpoint'); + context.autoCompleteSet = addMetaToTermsList(context.autoCompleteSet!, 'endpoint'); } - function addUrlParamsAutoCompleteSetToContext(context: any, pos: Position) { + function addUrlParamsAutoCompleteSetToContext(context: AutoCompleteContext, pos: Position) { const ret = getCurrentMethodAndTokenPaths(editor, pos, parser); context.method = ret.method; context.otherTokenValues = ret.otherTokenValues; @@ -813,7 +839,7 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito // zero length tokenPath is true return context; } - let tokenPath: any[] = []; + let tokenPath: string[] = []; const currentParam = ret.urlParamsTokenPath.pop(); if (currentParam) { tokenPath = Object.keys(currentParam); // single key object @@ -830,7 +856,7 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito return context; } - function addBodyAutoCompleteSetToContext(context: any, pos: Position) { + function addBodyAutoCompleteSetToContext(context: AutoCompleteContext, pos: Position) { const ret = getCurrentMethodAndTokenPaths(editor, pos, parser); context.method = ret.method; context.otherTokenValues = ret.otherTokenValues; @@ -859,7 +885,7 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito // needed for scope linking + global term resolving context.endpointComponentResolver = getEndpointBodyCompleteComponents; context.globalComponentResolver = getGlobalAutocompleteComponents; - let components; + let components: unknown; if (context.endpoint) { components = context.endpoint.bodyAutocompleteRootComponents; } else { @@ -935,15 +961,19 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito } } - function getCompletions(position: Position, prefix: string, callback: (...args: any[]) => void) { + function getCompletions( + position: Position, + prefix: string, + callback: (e: Error | null, result: ResultTerm[] | null) => void + ) { try { const context = getAutoCompleteContext(editor, position); if (!context) { callback(null, []); } else { const terms = _.map( - context.autoCompleteSet.filter((term: any) => Boolean(term) && term.name != null), - function (term: any) { + context.autoCompleteSet!.filter((term) => Boolean(term) && term.name != null), + function (term) { if (typeof term !== 'object') { term = { name: term, @@ -951,7 +981,13 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito } else { term = _.clone(term); } - const defaults: any = { + const defaults: { + value?: string; + meta: string; + score: number; + context: AutoCompleteContext; + completer?: { insertMatch: (v: unknown) => void }; + } = { value: term.name, meta: 'API', score: 0, @@ -969,7 +1005,10 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito } ); - terms.sort(function (t1: any, t2: any) { + terms.sort(function ( + t1: { score: number; name?: string }, + t2: { score: number; name?: string } + ) { /* score sorts from high to low */ if (t1.score > t2.score) { return -1; @@ -978,7 +1017,7 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito return 1; } /* names sort from low to high */ - if (t1.name < t2.name) { + if (t1.name! < t2.name!) { return -1; } if (t1.name === t2.name) { @@ -989,7 +1028,7 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito callback( null, - _.map(terms, function (t: any, i: any) { + _.map(terms, function (t, i) { t.insertValue = t.insertValue || t.value; t.value = '' + t.value; // normalize to strings t.score = -i; @@ -1010,8 +1049,13 @@ export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEdito getCompletions, // TODO: This needs to be cleaned up _test: { - getCompletions: (_editor: any, _editSession: any, pos: any, prefix: any, callback: any) => - getCompletions(pos, prefix, callback), + getCompletions: ( + _editor: unknown, + _editSession: unknown, + pos: Position, + prefix: string, + callback: (e: Error | null, result: ResultTerm[] | null) => void + ) => getCompletions(pos, prefix, callback), addReplacementInfoToContext, addChangeListener: () => editor.on('changeSelection', editorChangeListener), removeChangeListener: () => editor.off('changeSelection', editorChangeListener), diff --git a/src/plugins/console/public/lib/autocomplete/components/full_request_component.ts b/src/plugins/console/public/lib/autocomplete/components/full_request_component.ts index 935e3622bde042..64aefa7b4a1217 100644 --- a/src/plugins/console/public/lib/autocomplete/components/full_request_component.ts +++ b/src/plugins/console/public/lib/autocomplete/components/full_request_component.ts @@ -11,7 +11,7 @@ import { ConstantComponent } from './constant_component'; export class FullRequestComponent extends ConstantComponent { private readonly name: string; - constructor(name: string, parent: any, private readonly template: string) { + constructor(name: string, parent: unknown, private readonly template: string) { super(name, parent); this.name = name; } diff --git a/src/plugins/console/public/lib/autocomplete/get_endpoint_from_position.ts b/src/plugins/console/public/lib/autocomplete/get_endpoint_from_position.ts index 849123bc68a71e..fe24492df0e7b0 100644 --- a/src/plugins/console/public/lib/autocomplete/get_endpoint_from_position.ts +++ b/src/plugins/console/public/lib/autocomplete/get_endpoint_from_position.ts @@ -8,13 +8,14 @@ import { CoreEditor, Position } from '../../types'; import { getCurrentMethodAndTokenPaths } from './autocomplete'; +import type RowParser from '../row_parser'; // @ts-ignore import { getTopLevelUrlCompleteComponents } from '../kb/kb'; // @ts-ignore import { populateContext } from './engine'; -export function getEndpointFromPosition(editor: CoreEditor, pos: Position, parser: any) { +export function getEndpointFromPosition(editor: CoreEditor, pos: Position, parser: RowParser) { const lineValue = editor.getLineValue(pos.lineNumber); const context = { ...getCurrentMethodAndTokenPaths( diff --git a/src/plugins/console/public/lib/autocomplete/types.ts b/src/plugins/console/public/lib/autocomplete/types.ts new file mode 100644 index 00000000000000..33c543f43be9ec --- /dev/null +++ b/src/plugins/console/public/lib/autocomplete/types.ts @@ -0,0 +1,61 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { CoreEditor, Range, Token } from '../../types'; + +export interface ResultTerm { + context?: AutoCompleteContext; + insertValue?: string; + name?: string; + value?: string; +} + +export interface AutoCompleteContext { + autoCompleteSet?: null | ResultTerm[]; + endpoint?: null | { + paramsAutocomplete: { + getTopLevelComponents: (method?: string | null) => unknown; + }; + bodyAutocompleteRootComponents: unknown; + id?: string; + documentation?: string; + }; + urlPath?: null | unknown; + urlParamsTokenPath?: Array> | null; + method?: string | null; + token?: Token; + activeScheme?: unknown; + replacingToken?: boolean; + rangeToReplace?: Range; + autoCompleteType?: null | string; + editor?: CoreEditor; + + /** + * The tokenized user input that prompted the current autocomplete at the cursor. This can be out of sync with + * the input that is currently being displayed in the editor. + */ + createdWithToken?: Token | null; + + /** + * The tokenized user input that is currently being displayed at the cursor in the editor when the user accepted + * the autocomplete suggestion. + */ + updatedForToken?: Token | null; + + addTemplate?: unknown; + prefixToAdd?: string; + suffixToAdd?: string; + textBoxPosition?: { lineNumber: number; column: number }; + urlTokenPath?: string[]; + otherTokenValues?: string; + requestStartRow?: number | null; + bodyTokenPath?: string[] | null; + endpointComponentResolver?: unknown; + globalComponentResolver?: unknown; + documentation?: string; +} diff --git a/src/plugins/console/public/lib/es/es.ts b/src/plugins/console/public/lib/es/es.ts index 03ee218fa2e1d0..dffc2c9682cf2f 100644 --- a/src/plugins/console/public/lib/es/es.ts +++ b/src/plugins/console/public/lib/es/es.ts @@ -19,7 +19,7 @@ export function getVersion() { return esVersion; } -export function getContentType(body: any) { +export function getContentType(body: unknown) { if (!body) return; return 'application/json'; } @@ -27,7 +27,7 @@ export function getContentType(body: any) { export function send( method: string, path: string, - data: any, + data: string | object, { asSystemRequest }: SendOptions = {} ) { const wrappedDfd = $.Deferred(); @@ -47,10 +47,10 @@ export function send( }; $.ajax(options).then( - (responseData: any, textStatus: string, jqXHR: any) => { + (responseData, textStatus: string, jqXHR: unknown) => { wrappedDfd.resolveWith({}, [responseData, textStatus, jqXHR]); }, - ((jqXHR: any, textStatus: string, errorThrown: Error) => { + ((jqXHR: { status: number; responseText: string }, textStatus: string, errorThrown: Error) => { if (jqXHR.status === 0) { jqXHR.responseText = "\n\nFailed to connect to Console's backend.\nPlease check the Kibana server is up and running"; diff --git a/src/plugins/console/public/lib/row_parser.ts b/src/plugins/console/public/lib/row_parser.ts index 5f8fb08ca1d6f8..e18bf6ac6446b8 100644 --- a/src/plugins/console/public/lib/row_parser.ts +++ b/src/plugins/console/public/lib/row_parser.ts @@ -75,7 +75,7 @@ export default class RowParser { return MODE.REQUEST_START; } - rowPredicate(lineNumber: number | undefined, editor: CoreEditor, value: any) { + rowPredicate(lineNumber: number | undefined, editor: CoreEditor, value: number) { const mode = this.getRowParseMode(lineNumber); // eslint-disable-next-line no-bitwise return (mode & value) > 0; diff --git a/src/plugins/console/public/lib/token_iterator/token_iterator.test.ts b/src/plugins/console/public/lib/token_iterator/token_iterator.test.ts index bc28e1d9e1a034..6b2f556f82a0e2 100644 --- a/src/plugins/console/public/lib/token_iterator/token_iterator.test.ts +++ b/src/plugins/console/public/lib/token_iterator/token_iterator.test.ts @@ -15,7 +15,7 @@ const mockTokensProviderFactory = (tokenMtx: Token[][]): TokensProvider => { return tokenMtx[lineNumber - 1] || null; }, getTokenAt(pos: Position): Token | null { - return null as any; + return null; }, }; }; diff --git a/src/plugins/console/public/lib/utils/index.ts b/src/plugins/console/public/lib/utils/index.ts index 71b305807e61d4..8b8974f4e2f0d5 100644 --- a/src/plugins/console/public/lib/utils/index.ts +++ b/src/plugins/console/public/lib/utils/index.ts @@ -11,7 +11,7 @@ import { XJson } from '../../../../es_ui_shared/public'; const { collapseLiteralStrings, expandLiteralStrings } = XJson; -export function textFromRequest(request: any) { +export function textFromRequest(request: { method: string; url: string; data: string | string[] }) { let data = request.data; if (typeof data !== 'string') { data = data.join('\n'); @@ -19,7 +19,7 @@ export function textFromRequest(request: any) { return request.method + ' ' + request.url + '\n' + data; } -export function jsonToString(data: any, indent: boolean) { +export function jsonToString(data: object, indent: boolean) { return JSON.stringify(data, null, indent ? 2 : 0); } diff --git a/src/plugins/console/public/services/history.ts b/src/plugins/console/public/services/history.ts index 1dd18f8672a4b3..ee1e97ceb386e2 100644 --- a/src/plugins/console/public/services/history.ts +++ b/src/plugins/console/public/services/history.ts @@ -35,12 +35,12 @@ export class History { // be triggered from different places in the app. The alternative would be to store // this in state so that we hook into the React model, but it would require loading history // every time the application starts even if a user is not going to view history. - change(listener: (reqs: any[]) => void) { + change(listener: (reqs: unknown[]) => void) { const subscription = this.changeEmitter.subscribe(listener); return () => subscription.unsubscribe(); } - addToHistory(endpoint: string, method: string, data: any) { + addToHistory(endpoint: string, method: string, data?: string) { const keys = this.getHistoryKeys(); keys.splice(0, MAX_NUMBER_OF_HISTORY_ITEMS); // only maintain most recent X; keys.forEach((key) => { @@ -59,7 +59,7 @@ export class History { this.changeEmitter.next(this.getHistory()); } - updateCurrentState(content: any) { + updateCurrentState(content: string) { const timestamp = new Date().getTime(); this.storage.set('editor_state', { time: timestamp, diff --git a/src/plugins/console/public/services/index.ts b/src/plugins/console/public/services/index.ts index b6bcafc974b935..2b1e64525d0f9f 100644 --- a/src/plugins/console/public/services/index.ts +++ b/src/plugins/console/public/services/index.ts @@ -8,4 +8,4 @@ export { createHistory, History } from './history'; export { createStorage, Storage, StorageKeys } from './storage'; -export { createSettings, Settings, DevToolsSettings } from './settings'; +export { createSettings, Settings, DevToolsSettings, DEFAULT_SETTINGS } from './settings'; diff --git a/src/plugins/console/public/services/settings.ts b/src/plugins/console/public/services/settings.ts index 8f142e876293ef..647ac1e0ad09fb 100644 --- a/src/plugins/console/public/services/settings.ts +++ b/src/plugins/console/public/services/settings.ts @@ -8,6 +8,14 @@ import { Storage } from './index'; +export const DEFAULT_SETTINGS = Object.freeze({ + fontSize: 14, + polling: true, + tripleQuotes: true, + wrapMode: true, + autocomplete: Object.freeze({ fields: true, indices: true, templates: true }), +}); + export interface DevToolsSettings { fontSize: number; wrapMode: boolean; @@ -24,50 +32,46 @@ export class Settings { constructor(private readonly storage: Storage) {} getFontSize() { - return this.storage.get('font_size', 14); + return this.storage.get('font_size', DEFAULT_SETTINGS.fontSize); } - setFontSize(size: any) { + setFontSize(size: number) { this.storage.set('font_size', size); return true; } getWrapMode() { - return this.storage.get('wrap_mode', true); + return this.storage.get('wrap_mode', DEFAULT_SETTINGS.wrapMode); } - setWrapMode(mode: any) { + setWrapMode(mode: boolean) { this.storage.set('wrap_mode', mode); return true; } - setTripleQuotes(tripleQuotes: any) { + setTripleQuotes(tripleQuotes: boolean) { this.storage.set('triple_quotes', tripleQuotes); return true; } getTripleQuotes() { - return this.storage.get('triple_quotes', true); + return this.storage.get('triple_quotes', DEFAULT_SETTINGS.tripleQuotes); } getAutocomplete() { - return this.storage.get('autocomplete_settings', { - fields: true, - indices: true, - templates: true, - }); + return this.storage.get('autocomplete_settings', DEFAULT_SETTINGS.autocomplete); } - setAutocomplete(settings: any) { + setAutocomplete(settings: object) { this.storage.set('autocomplete_settings', settings); return true; } getPolling() { - return this.storage.get('console_polling', true); + return this.storage.get('console_polling', DEFAULT_SETTINGS.polling); } - setPolling(polling: any) { + setPolling(polling: boolean) { this.storage.set('console_polling', polling); return true; } diff --git a/src/plugins/console/public/services/storage.ts b/src/plugins/console/public/services/storage.ts index d933024625e778..221020e496feca 100644 --- a/src/plugins/console/public/services/storage.ts +++ b/src/plugins/console/public/services/storage.ts @@ -17,11 +17,11 @@ export enum StorageKeys { export class Storage { constructor(private readonly engine: IStorageEngine, private readonly prefix: string) {} - encode(val: any) { + encode(val: unknown) { return JSON.stringify(val); } - decode(val: any) { + decode(val: string | null) { if (typeof val === 'string') { return JSON.parse(val); } @@ -37,7 +37,7 @@ export class Storage { } } - set(key: string, val: any) { + set(key: string, val: unknown) { this.engine.setItem(this.encodeKey(key), this.encode(val)); return val; } diff --git a/src/plugins/console/public/types/common.ts b/src/plugins/console/public/types/common.ts index 77b3d7c4477fc2..53d896ad01d2f6 100644 --- a/src/plugins/console/public/types/common.ts +++ b/src/plugins/console/public/types/common.ts @@ -11,6 +11,12 @@ export interface MetricsTracker { load: (eventName: string) => void; } +export interface ESRequest { + method: string; + endpoint: string; + data?: string; +} + export type BaseResponseType = | 'application/json' | 'text/csv' diff --git a/src/plugins/console/public/types/core_editor.ts b/src/plugins/console/public/types/core_editor.ts index f5e81f413d5c51..cc344d6bcc8815 100644 --- a/src/plugins/console/public/types/core_editor.ts +++ b/src/plugins/console/public/types/core_editor.ts @@ -21,7 +21,7 @@ export type EditorEvent = export type AutoCompleterFunction = ( pos: Position, prefix: string, - callback: (...args: any[]) => void + callback: (...args: unknown[]) => void ) => void; export interface Position { @@ -235,7 +235,7 @@ export interface CoreEditor { * have this backdoor to update UI in response to request range changes, for example, as the user * moves the cursor around */ - legacyUpdateUI(opts: any): void; + legacyUpdateUI(opts: unknown): void; /** * A method to for the editor to resize, useful when, for instance, window size changes. @@ -250,7 +250,11 @@ export interface CoreEditor { /** * Register a keyboard shortcut and provide a function to be called. */ - registerKeyboardShortcut(opts: { keys: any; fn: () => void; name: string }): void; + registerKeyboardShortcut(opts: { + keys: string | { win?: string; mac?: string }; + fn: () => void; + name: string; + }): void; /** * Register a completions function that will be called when the editor diff --git a/src/plugins/console/server/lib/elasticsearch_proxy_config.ts b/src/plugins/console/server/lib/elasticsearch_proxy_config.ts index 757142c87a1192..bad6942d0c9af4 100644 --- a/src/plugins/console/server/lib/elasticsearch_proxy_config.ts +++ b/src/plugins/console/server/lib/elasticsearch_proxy_config.ts @@ -14,7 +14,7 @@ import url from 'url'; import { ESConfigForProxy } from '../types'; const createAgent = (legacyConfig: ESConfigForProxy) => { - const target = url.parse(_.head(legacyConfig.hosts) as any); + const target = url.parse(_.head(legacyConfig.hosts)!); if (!/^https/.test(target.protocol || '')) return new http.Agent(); const agentOptions: https.AgentOptions = {}; @@ -28,7 +28,7 @@ const createAgent = (legacyConfig: ESConfigForProxy) => { agentOptions.rejectUnauthorized = true; // by default, NodeJS is checking the server identify - agentOptions.checkServerIdentity = _.noop as any; + agentOptions.checkServerIdentity = (_.noop as unknown) as https.AgentOptions['checkServerIdentity']; break; case 'full': agentOptions.rejectUnauthorized = true; diff --git a/src/plugins/console/server/lib/proxy_config.ts b/src/plugins/console/server/lib/proxy_config.ts index 556f6affca91df..8e2633545799bb 100644 --- a/src/plugins/console/server/lib/proxy_config.ts +++ b/src/plugins/console/server/lib/proxy_config.ts @@ -12,6 +12,17 @@ import { Agent as HttpsAgent, AgentOptions } from 'https'; import { WildcardMatcher } from './wildcard_matcher'; +interface Config { + match: { + protocol: string; + host: string; + port: string; + path: string; + }; + ssl?: { verify?: boolean; ca?: string; cert?: string; key?: string }; + timeout: number; +} + export class ProxyConfig { // @ts-ignore private id: string; @@ -26,9 +37,9 @@ export class ProxyConfig { private readonly sslAgent?: HttpsAgent; - private verifySsl: any; + private verifySsl: undefined | boolean; - constructor(config: { match: any; timeout: number }) { + constructor(config: Config) { config = { ...config, }; @@ -61,8 +72,8 @@ export class ProxyConfig { this.sslAgent = this._makeSslAgent(config); } - _makeSslAgent(config: any) { - const ssl = config.ssl || {}; + _makeSslAgent(config: Config) { + const ssl: Config['ssl'] = config.ssl || {}; this.verifySsl = ssl.verify; const sslAgentOpts: AgentOptions = { diff --git a/src/plugins/console/server/lib/proxy_config_collection.ts b/src/plugins/console/server/lib/proxy_config_collection.ts index 83900838332b5d..f6c0b7c659de08 100644 --- a/src/plugins/console/server/lib/proxy_config_collection.ts +++ b/src/plugins/console/server/lib/proxy_config_collection.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import type { Agent } from 'http'; import { defaultsDeep } from 'lodash'; import { parse as parseUrl } from 'url'; @@ -14,7 +15,12 @@ import { ProxyConfig } from './proxy_config'; export class ProxyConfigCollection { private configs: ProxyConfig[]; - constructor(configs: Array<{ match: any; timeout: number }> = []) { + constructor( + configs: Array<{ + match: { protocol: string; host: string; port: string; path: string }; + timeout: number; + }> = [] + ) { this.configs = configs.map((settings) => new ProxyConfig(settings)); } @@ -22,7 +28,7 @@ export class ProxyConfigCollection { return Boolean(this.configs.length); } - configForUri(uri: string): object { + configForUri(uri: string): { agent: Agent; timeout: number } { const parsedUri = parseUrl(uri); const settings = this.configs.map((config) => config.getForParsedUri(parsedUri as any)); return defaultsDeep({}, ...settings); diff --git a/src/plugins/console/server/lib/proxy_request.test.ts b/src/plugins/console/server/lib/proxy_request.test.ts index 3fb915f0540b46..25257aa4c55798 100644 --- a/src/plugins/console/server/lib/proxy_request.test.ts +++ b/src/plugins/console/server/lib/proxy_request.test.ts @@ -55,7 +55,7 @@ describe(`Console's send request`, () => { fakeRequest = { abort: sinon.stub(), on() {}, - once(event: string, fn: any) { + once(event: string, fn: (v: string) => void) { if (event === 'response') { return fn('done'); } diff --git a/src/plugins/console/server/lib/proxy_request.ts b/src/plugins/console/server/lib/proxy_request.ts index d5914ab32bab7b..46b4aa642a70eb 100644 --- a/src/plugins/console/server/lib/proxy_request.ts +++ b/src/plugins/console/server/lib/proxy_request.ts @@ -46,9 +46,9 @@ export const proxyRequest = ({ const client = uri.protocol === 'https:' ? https : http; let resolved = false; - let resolve: any; - let reject: any; - const reqPromise = new Promise((res, rej) => { + let resolve: (res: http.IncomingMessage) => void; + let reject: (res: unknown) => void; + const reqPromise = new Promise((res, rej) => { resolve = res; reject = rej; }); diff --git a/src/plugins/console/server/routes/api/console/proxy/body.test.ts b/src/plugins/console/server/routes/api/console/proxy/body.test.ts index 64e2918764d00d..80a2e075957dec 100644 --- a/src/plugins/console/server/routes/api/console/proxy/body.test.ts +++ b/src/plugins/console/server/routes/api/console/proxy/body.test.ts @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import { IKibanaResponse } from 'src/core/server'; import { getProxyRouteHandlerDeps } from './mocks'; import { Readable } from 'stream'; @@ -16,10 +16,14 @@ import * as requestModule from '../../../../lib/proxy_request'; import { createResponseStub } from './stubs'; describe('Console Proxy Route', () => { - let request: any; + let request: ( + method: string, + path: string, + response?: string + ) => Promise | IKibanaResponse; beforeEach(() => { - request = (method: string, path: string, response: string) => { + request = (method, path, response) => { (requestModule.proxyRequest as jest.Mock).mockResolvedValue(createResponseStub(response)); const handler = createHandler(getProxyRouteHandlerDeps({})); diff --git a/src/plugins/console/server/routes/api/console/proxy/create_handler.ts b/src/plugins/console/server/routes/api/console/proxy/create_handler.ts index 290a2cdec7b764..6a514483d14f28 100644 --- a/src/plugins/console/server/routes/api/console/proxy/create_handler.ts +++ b/src/plugins/console/server/routes/api/console/proxy/create_handler.ts @@ -41,7 +41,7 @@ function toURL(base: string, path: string) { } function filterHeaders(originalHeaders: object, headersToKeep: string[]): object { - const normalizeHeader = function (header: any) { + const normalizeHeader = function (header: string) { if (!header) { return ''; } @@ -68,7 +68,7 @@ function getRequestConfig( return { ...proxyConfigCollection.configForUri(uri), headers: newHeaders, - } as any; + }; } return { @@ -81,7 +81,7 @@ function getProxyHeaders(req: KibanaRequest) { const headers = Object.create(null); // Scope this proto-unsafe functionality to where it is being used. - function extendCommaList(obj: Record, property: string, value: any) { + function extendCommaList(obj: Record, property: string, value: string) { obj[property] = (obj[property] ? obj[property] + ',' : '') + value; } @@ -142,7 +142,7 @@ export const createHandler = ({ }; esIncomingMessage = await proxyRequest({ - method: method.toLowerCase() as any, + method: method.toLowerCase() as 'get' | 'post' | 'put' | 'delete' | 'patch' | 'head', headers: requestHeaders, uri, timeout, diff --git a/src/plugins/console/server/routes/api/console/proxy/query_string.test.ts b/src/plugins/console/server/routes/api/console/proxy/query_string.test.ts index 19b50702368722..be4f1dbab942f4 100644 --- a/src/plugins/console/server/routes/api/console/proxy/query_string.test.ts +++ b/src/plugins/console/server/routes/api/console/proxy/query_string.test.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import type { IKibanaResponse } from 'src/core/server'; import { kibanaResponseFactory } from '../../../../../../../core/server'; import { getProxyRouteHandlerDeps } from './mocks'; import { createResponseStub } from './stubs'; @@ -14,7 +15,7 @@ import * as requestModule from '../../../../lib/proxy_request'; import { createHandler } from './create_handler'; describe('Console Proxy Route', () => { - let request: any; + let request: (method: string, path: string) => Promise | IKibanaResponse; beforeEach(() => { (requestModule.proxyRequest as jest.Mock).mockResolvedValue(createResponseStub('foo')); diff --git a/src/plugins/console/server/routes/api/console/proxy/stubs.ts b/src/plugins/console/server/routes/api/console/proxy/stubs.ts index 4aa23f99ea30e1..3474d0c9b33b84 100644 --- a/src/plugins/console/server/routes/api/console/proxy/stubs.ts +++ b/src/plugins/console/server/routes/api/console/proxy/stubs.ts @@ -9,8 +9,12 @@ import { IncomingMessage } from 'http'; import { Readable } from 'stream'; -export function createResponseStub(response: any) { - const resp: any = new Readable({ +export function createResponseStub(response?: string) { + const resp: Readable & { + statusCode?: number; + statusMessage?: string; + headers?: Record; + } = new Readable({ read() { if (response) { this.push(response); diff --git a/src/plugins/console/server/services/spec_definitions_service.ts b/src/plugins/console/server/services/spec_definitions_service.ts index 8b0f4c04ae0bdb..e0af9422666afb 100644 --- a/src/plugins/console/server/services/spec_definitions_service.ts +++ b/src/plugins/console/server/services/spec_definitions_service.ts @@ -15,6 +15,15 @@ import { jsSpecLoaders } from '../lib'; const PATH_TO_OSS_JSON_SPEC = resolve(__dirname, '../lib/spec_definitions/json'); +interface EndpointDescription { + methods?: string[]; + patterns?: string | string[]; + url_params?: Record; + data_autocomplete_rules?: Record; + url_components?: Record; + priority?: number; +} + export class SpecDefinitionsService { private readonly name = 'es'; @@ -24,16 +33,23 @@ export class SpecDefinitionsService { private hasLoadedSpec = false; - public addGlobalAutocompleteRules(parentNode: string, rules: any) { + public addGlobalAutocompleteRules(parentNode: string, rules: unknown) { this.globalRules[parentNode] = rules; } - public addEndpointDescription(endpoint: string, description: any = {}) { - let copiedDescription: any = {}; + public addEndpointDescription(endpoint: string, description: EndpointDescription = {}) { + let copiedDescription: { patterns?: string; url_params?: Record } = {}; if (this.endpoints[endpoint]) { copiedDescription = { ...this.endpoints[endpoint] }; } - let urlParamsDef: any; + let urlParamsDef: + | { + ignore_unavailable?: string; + allow_no_indices?: string; + expand_wildcards?: string[]; + } + | undefined; + _.each(description.patterns || [], function (p) { if (p.indexOf('{indices}') >= 0) { urlParamsDef = urlParamsDef || {}; @@ -70,7 +86,7 @@ export class SpecDefinitionsService { this.extensionSpecFilePaths.push(path); } - public addProcessorDefinition(processor: any) { + public addProcessorDefinition(processor: unknown) { if (!this.hasLoadedSpec) { throw new Error( 'Cannot add a processor definition because spec definitions have not loaded!' @@ -104,11 +120,13 @@ export class SpecDefinitionsService { return generatedFiles.reduce((acc, file) => { const overrideFile = overrideFiles.find((f) => basename(f) === basename(file)); - const loadedSpec = JSON.parse(readFileSync(file, 'utf8')); + const loadedSpec: Record = JSON.parse( + readFileSync(file, 'utf8') + ); if (overrideFile) { merge(loadedSpec, JSON.parse(readFileSync(overrideFile, 'utf8'))); } - const spec: any = {}; + const spec: Record = {}; Object.entries(loadedSpec).forEach(([key, value]) => { if (acc[key]) { // add time to remove key collision @@ -119,7 +137,7 @@ export class SpecDefinitionsService { }); return { ...acc, ...spec }; - }, {} as any); + }, {} as Record); } private loadJsonSpec() { diff --git a/src/plugins/data/common/es_query/filters/build_filters.ts b/src/plugins/data/common/es_query/filters/build_filters.ts index 42a4d66359346e..ba1bd0a6154939 100644 --- a/src/plugins/data/common/es_query/filters/build_filters.ts +++ b/src/plugins/data/common/es_query/filters/build_filters.ts @@ -26,13 +26,15 @@ export function buildFilter( disabled: boolean, params: any, alias: string | null, - store: FilterStateStore + store?: FilterStateStore ): Filter { const filter = buildBaseFilter(indexPattern, field, type, params); filter.meta.alias = alias; filter.meta.negate = negate; filter.meta.disabled = disabled; - filter.$state = { store }; + if (store) { + filter.$state = { store }; + } return filter; } diff --git a/src/plugins/data/common/es_query/kuery/ast/_generated_/kuery.js b/src/plugins/data/common/es_query/kuery/ast/_generated_/kuery.js index 4d1cede837f137..7ee744ad5f4c82 100644 --- a/src/plugins/data/common/es_query/kuery/ast/_generated_/kuery.js +++ b/src/plugins/data/common/es_query/kuery/ast/_generated_/kuery.js @@ -246,24 +246,32 @@ module.exports = (function() { peg$c65 = function(keyword) { return keyword; }, peg$c66 = /^[\\():<>"*{}]/, peg$c67 = { type: "class", value: "[\\\\():<>\"*{}]", description: "[\\\\():<>\"*{}]" }, - peg$c68 = "<=", - peg$c69 = { type: "literal", value: "<=", description: "\"<=\"" }, - peg$c70 = function() { return 'lte'; }, - peg$c71 = ">=", - peg$c72 = { type: "literal", value: ">=", description: "\">=\"" }, - peg$c73 = function() { return 'gte'; }, - peg$c74 = "<", - peg$c75 = { type: "literal", value: "<", description: "\"<\"" }, - peg$c76 = function() { return 'lt'; }, - peg$c77 = ">", - peg$c78 = { type: "literal", value: ">", description: "\">\"" }, - peg$c79 = function() { return 'gt'; }, - peg$c80 = { type: "other", description: "whitespace" }, - peg$c81 = /^[ \t\r\n]/, - peg$c82 = { type: "class", value: "[\\ \\t\\r\\n]", description: "[\\ \\t\\r\\n]" }, - peg$c83 = "@kuery-cursor@", - peg$c84 = { type: "literal", value: "@kuery-cursor@", description: "\"@kuery-cursor@\"" }, - peg$c85 = function() { return cursorSymbol; }, + peg$c68 = function(sequence) { return sequence; }, + peg$c69 = "u", + peg$c70 = { type: "literal", value: "u", description: "\"u\"" }, + peg$c71 = function(digits) { + return String.fromCharCode(parseInt(digits, 16)); + }, + peg$c72 = /^[0-9a-f]/i, + peg$c73 = { type: "class", value: "[0-9a-f]i", description: "[0-9a-f]i" }, + peg$c74 = "<=", + peg$c75 = { type: "literal", value: "<=", description: "\"<=\"" }, + peg$c76 = function() { return 'lte'; }, + peg$c77 = ">=", + peg$c78 = { type: "literal", value: ">=", description: "\">=\"" }, + peg$c79 = function() { return 'gte'; }, + peg$c80 = "<", + peg$c81 = { type: "literal", value: "<", description: "\"<\"" }, + peg$c82 = function() { return 'lt'; }, + peg$c83 = ">", + peg$c84 = { type: "literal", value: ">", description: "\">\"" }, + peg$c85 = function() { return 'gt'; }, + peg$c86 = { type: "other", description: "whitespace" }, + peg$c87 = /^[ \t\r\n\xA0]/, + peg$c88 = { type: "class", value: "[\\ \\t\\r\\n\\u00A0]", description: "[\\ \\t\\r\\n\\u00A0]" }, + peg$c89 = "@kuery-cursor@", + peg$c90 = { type: "literal", value: "@kuery-cursor@", description: "\"@kuery-cursor@\"" }, + peg$c91 = function() { return cursorSymbol; }, peg$currPos = 0, peg$savedPos = 0, @@ -455,7 +463,7 @@ module.exports = (function() { function peg$parsestart() { var s0, s1, s2, s3; - var key = peg$currPos * 34 + 0, + var key = peg$currPos * 37 + 0, cached = peg$resultsCache[key]; if (cached) { @@ -503,7 +511,7 @@ module.exports = (function() { function peg$parseOrQuery() { var s0, s1, s2, s3, s4, s5; - var key = peg$currPos * 34 + 1, + var key = peg$currPos * 37 + 1, cached = peg$resultsCache[key]; if (cached) { @@ -579,7 +587,7 @@ module.exports = (function() { function peg$parseAndQuery() { var s0, s1, s2, s3, s4, s5; - var key = peg$currPos * 34 + 2, + var key = peg$currPos * 37 + 2, cached = peg$resultsCache[key]; if (cached) { @@ -655,7 +663,7 @@ module.exports = (function() { function peg$parseNotQuery() { var s0, s1, s2; - var key = peg$currPos * 34 + 3, + var key = peg$currPos * 37 + 3, cached = peg$resultsCache[key]; if (cached) { @@ -692,7 +700,7 @@ module.exports = (function() { function peg$parseSubQuery() { var s0, s1, s2, s3, s4, s5; - var key = peg$currPos * 34 + 4, + var key = peg$currPos * 37 + 4, cached = peg$resultsCache[key]; if (cached) { @@ -764,7 +772,7 @@ module.exports = (function() { function peg$parseNestedQuery() { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; - var key = peg$currPos * 34 + 5, + var key = peg$currPos * 37 + 5, cached = peg$resultsCache[key]; if (cached) { @@ -876,7 +884,7 @@ module.exports = (function() { function peg$parseExpression() { var s0; - var key = peg$currPos * 34 + 6, + var key = peg$currPos * 37 + 6, cached = peg$resultsCache[key]; if (cached) { @@ -901,7 +909,7 @@ module.exports = (function() { function peg$parseField() { var s0, s1; - var key = peg$currPos * 34 + 7, + var key = peg$currPos * 37 + 7, cached = peg$resultsCache[key]; if (cached) { @@ -926,7 +934,7 @@ module.exports = (function() { function peg$parseFieldRangeExpression() { var s0, s1, s2, s3, s4, s5; - var key = peg$currPos * 34 + 8, + var key = peg$currPos * 37 + 8, cached = peg$resultsCache[key]; if (cached) { @@ -988,7 +996,7 @@ module.exports = (function() { function peg$parseFieldValueExpression() { var s0, s1, s2, s3, s4, s5; - var key = peg$currPos * 34 + 9, + var key = peg$currPos * 37 + 9, cached = peg$resultsCache[key]; if (cached) { @@ -1056,7 +1064,7 @@ module.exports = (function() { function peg$parseValueExpression() { var s0, s1; - var key = peg$currPos * 34 + 10, + var key = peg$currPos * 37 + 10, cached = peg$resultsCache[key]; if (cached) { @@ -1081,7 +1089,7 @@ module.exports = (function() { function peg$parseListOfValues() { var s0, s1, s2, s3, s4, s5; - var key = peg$currPos * 34 + 11, + var key = peg$currPos * 37 + 11, cached = peg$resultsCache[key]; if (cached) { @@ -1153,7 +1161,7 @@ module.exports = (function() { function peg$parseOrListOfValues() { var s0, s1, s2, s3, s4, s5; - var key = peg$currPos * 34 + 12, + var key = peg$currPos * 37 + 12, cached = peg$resultsCache[key]; if (cached) { @@ -1229,7 +1237,7 @@ module.exports = (function() { function peg$parseAndListOfValues() { var s0, s1, s2, s3, s4, s5; - var key = peg$currPos * 34 + 13, + var key = peg$currPos * 37 + 13, cached = peg$resultsCache[key]; if (cached) { @@ -1305,7 +1313,7 @@ module.exports = (function() { function peg$parseNotListOfValues() { var s0, s1, s2; - var key = peg$currPos * 34 + 14, + var key = peg$currPos * 37 + 14, cached = peg$resultsCache[key]; if (cached) { @@ -1342,7 +1350,7 @@ module.exports = (function() { function peg$parseValue() { var s0, s1; - var key = peg$currPos * 34 + 15, + var key = peg$currPos * 37 + 15, cached = peg$resultsCache[key]; if (cached) { @@ -1382,7 +1390,7 @@ module.exports = (function() { function peg$parseOr() { var s0, s1, s2, s3, s4; - var key = peg$currPos * 34 + 16, + var key = peg$currPos * 37 + 16, cached = peg$resultsCache[key]; if (cached) { @@ -1451,7 +1459,7 @@ module.exports = (function() { function peg$parseAnd() { var s0, s1, s2, s3, s4; - var key = peg$currPos * 34 + 17, + var key = peg$currPos * 37 + 17, cached = peg$resultsCache[key]; if (cached) { @@ -1520,7 +1528,7 @@ module.exports = (function() { function peg$parseNot() { var s0, s1, s2, s3; - var key = peg$currPos * 34 + 18, + var key = peg$currPos * 37 + 18, cached = peg$resultsCache[key]; if (cached) { @@ -1574,7 +1582,7 @@ module.exports = (function() { function peg$parseLiteral() { var s0, s1; - var key = peg$currPos * 34 + 19, + var key = peg$currPos * 37 + 19, cached = peg$resultsCache[key]; if (cached) { @@ -1602,7 +1610,7 @@ module.exports = (function() { function peg$parseQuotedString() { var s0, s1, s2, s3, s4, s5, s6; - var key = peg$currPos * 34 + 20, + var key = peg$currPos * 37 + 20, cached = peg$resultsCache[key]; if (cached) { @@ -1729,7 +1737,7 @@ module.exports = (function() { function peg$parseQuotedCharacter() { var s0, s1, s2; - var key = peg$currPos * 34 + 21, + var key = peg$currPos * 37 + 21, cached = peg$resultsCache[key]; if (cached) { @@ -1740,53 +1748,23 @@ module.exports = (function() { s0 = peg$parseEscapedWhitespace(); if (s0 === peg$FAILED) { - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 92) { - s1 = peg$c44; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c45); } - } - if (s1 !== peg$FAILED) { - if (peg$c46.test(input.charAt(peg$currPos))) { - s2 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c47); } - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c48(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } + s0 = peg$parseEscapedUnicodeSequence(); if (s0 === peg$FAILED) { s0 = peg$currPos; - s1 = peg$currPos; - peg$silentFails++; - s2 = peg$parseCursor(); - peg$silentFails--; - if (s2 === peg$FAILED) { - s1 = void 0; + if (input.charCodeAt(peg$currPos) === 92) { + s1 = peg$c44; + peg$currPos++; } else { - peg$currPos = s1; s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c45); } } if (s1 !== peg$FAILED) { - if (peg$c49.test(input.charAt(peg$currPos))) { + if (peg$c46.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c50); } + if (peg$silentFails === 0) { peg$fail(peg$c47); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; @@ -1800,6 +1778,39 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseCursor(); + peg$silentFails--; + if (s2 === peg$FAILED) { + s1 = void 0; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + if (s1 !== peg$FAILED) { + if (peg$c49.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c48(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } } } @@ -1811,7 +1822,7 @@ module.exports = (function() { function peg$parseUnquotedLiteral() { var s0, s1, s2, s3, s4, s5; - var key = peg$currPos * 34 + 22, + var key = peg$currPos * 37 + 22, cached = peg$resultsCache[key]; if (cached) { @@ -1891,7 +1902,7 @@ module.exports = (function() { function peg$parseUnquotedCharacter() { var s0, s1, s2, s3, s4; - var key = peg$currPos * 34 + 23, + var key = peg$currPos * 37 + 23, cached = peg$resultsCache[key]; if (cached) { @@ -1904,55 +1915,61 @@ module.exports = (function() { if (s0 === peg$FAILED) { s0 = peg$parseEscapedSpecialCharacter(); if (s0 === peg$FAILED) { - s0 = peg$parseEscapedKeyword(); + s0 = peg$parseEscapedUnicodeSequence(); if (s0 === peg$FAILED) { - s0 = peg$parseWildcard(); + s0 = peg$parseEscapedKeyword(); if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = peg$currPos; - peg$silentFails++; - s2 = peg$parseSpecialCharacter(); - peg$silentFails--; - if (s2 === peg$FAILED) { - s1 = void 0; - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - s2 = peg$currPos; + s0 = peg$parseWildcard(); + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$currPos; peg$silentFails++; - s3 = peg$parseKeyword(); + s2 = peg$parseSpecialCharacter(); peg$silentFails--; - if (s3 === peg$FAILED) { - s2 = void 0; + if (s2 === peg$FAILED) { + s1 = void 0; } else { - peg$currPos = s2; - s2 = peg$FAILED; + peg$currPos = s1; + s1 = peg$FAILED; } - if (s2 !== peg$FAILED) { - s3 = peg$currPos; + if (s1 !== peg$FAILED) { + s2 = peg$currPos; peg$silentFails++; - s4 = peg$parseCursor(); + s3 = peg$parseKeyword(); peg$silentFails--; - if (s4 === peg$FAILED) { - s3 = void 0; + if (s3 === peg$FAILED) { + s2 = void 0; } else { - peg$currPos = s3; - s3 = peg$FAILED; + peg$currPos = s2; + s2 = peg$FAILED; } - if (s3 !== peg$FAILED) { - if (input.length > peg$currPos) { - s4 = input.charAt(peg$currPos); - peg$currPos++; + if (s2 !== peg$FAILED) { + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseCursor(); + peg$silentFails--; + if (s4 === peg$FAILED) { + s3 = void 0; } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c52); } + peg$currPos = s3; + s3 = peg$FAILED; } - if (s4 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c48(s4); - s0 = s1; + if (s3 !== peg$FAILED) { + if (input.length > peg$currPos) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + if (s4 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c48(s4); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1965,9 +1982,6 @@ module.exports = (function() { peg$currPos = s0; s0 = peg$FAILED; } - } else { - peg$currPos = s0; - s0 = peg$FAILED; } } } @@ -1982,7 +1996,7 @@ module.exports = (function() { function peg$parseWildcard() { var s0, s1; - var key = peg$currPos * 34 + 24, + var key = peg$currPos * 37 + 24, cached = peg$resultsCache[key]; if (cached) { @@ -2013,7 +2027,7 @@ module.exports = (function() { function peg$parseOptionalSpace() { var s0, s1, s2, s3, s4, s5; - var key = peg$currPos * 34 + 25, + var key = peg$currPos * 37 + 25, cached = peg$resultsCache[key]; if (cached) { @@ -2083,7 +2097,7 @@ module.exports = (function() { function peg$parseEscapedWhitespace() { var s0, s1; - var key = peg$currPos * 34 + 26, + var key = peg$currPos * 37 + 26, cached = peg$resultsCache[key]; if (cached) { @@ -2144,7 +2158,7 @@ module.exports = (function() { function peg$parseEscapedSpecialCharacter() { var s0, s1, s2; - var key = peg$currPos * 34 + 27, + var key = peg$currPos * 37 + 27, cached = peg$resultsCache[key]; if (cached) { @@ -2184,7 +2198,7 @@ module.exports = (function() { function peg$parseEscapedKeyword() { var s0, s1, s2; - var key = peg$currPos * 34 + 28, + var key = peg$currPos * 37 + 28, cached = peg$resultsCache[key]; if (cached) { @@ -2248,7 +2262,7 @@ module.exports = (function() { function peg$parseKeyword() { var s0; - var key = peg$currPos * 34 + 29, + var key = peg$currPos * 37 + 29, cached = peg$resultsCache[key]; if (cached) { @@ -2273,7 +2287,7 @@ module.exports = (function() { function peg$parseSpecialCharacter() { var s0; - var key = peg$currPos * 34 + 30, + var key = peg$currPos * 37 + 30, cached = peg$resultsCache[key]; if (cached) { @@ -2295,10 +2309,147 @@ module.exports = (function() { return s0; } + function peg$parseEscapedUnicodeSequence() { + var s0, s1, s2; + + var key = peg$currPos * 37 + 31, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s1 = peg$c44; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parseUnicodeSequence(); + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c68(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parseUnicodeSequence() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + var key = peg$currPos * 37 + 32, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 117) { + s1 = peg$c69; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + s3 = peg$currPos; + s4 = peg$parseHexDigit(); + if (s4 !== peg$FAILED) { + s5 = peg$parseHexDigit(); + if (s5 !== peg$FAILED) { + s6 = peg$parseHexDigit(); + if (s6 !== peg$FAILED) { + s7 = peg$parseHexDigit(); + if (s7 !== peg$FAILED) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + s2 = input.substring(s2, peg$currPos); + } else { + s2 = s3; + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c71(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + + function peg$parseHexDigit() { + var s0; + + var key = peg$currPos * 37 + 33, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + + return cached.result; + } + + if (peg$c72.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + + peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; + + return s0; + } + function peg$parseRangeOperator() { var s0, s1; - var key = peg$currPos * 34 + 31, + var key = peg$currPos * 37 + 34, cached = peg$resultsCache[key]; if (cached) { @@ -2308,58 +2459,58 @@ module.exports = (function() { } s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c68) { - s1 = peg$c68; + if (input.substr(peg$currPos, 2) === peg$c74) { + s1 = peg$c74; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c69); } + if (peg$silentFails === 0) { peg$fail(peg$c75); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c70(); + s1 = peg$c76(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c71) { - s1 = peg$c71; + if (input.substr(peg$currPos, 2) === peg$c77) { + s1 = peg$c77; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c72); } + if (peg$silentFails === 0) { peg$fail(peg$c78); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c73(); + s1 = peg$c79(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 60) { - s1 = peg$c74; + s1 = peg$c80; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c75); } + if (peg$silentFails === 0) { peg$fail(peg$c81); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c76(); + s1 = peg$c82(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 62) { - s1 = peg$c77; + s1 = peg$c83; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c78); } + if (peg$silentFails === 0) { peg$fail(peg$c84); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c79(); + s1 = peg$c85(); } s0 = s1; } @@ -2374,7 +2525,7 @@ module.exports = (function() { function peg$parseSpace() { var s0, s1; - var key = peg$currPos * 34 + 32, + var key = peg$currPos * 37 + 35, cached = peg$resultsCache[key]; if (cached) { @@ -2384,17 +2535,17 @@ module.exports = (function() { } peg$silentFails++; - if (peg$c81.test(input.charAt(peg$currPos))) { + if (peg$c87.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c82); } + if (peg$silentFails === 0) { peg$fail(peg$c88); } } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c80); } + if (peg$silentFails === 0) { peg$fail(peg$c86); } } peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; @@ -2405,7 +2556,7 @@ module.exports = (function() { function peg$parseCursor() { var s0, s1, s2; - var key = peg$currPos * 34 + 33, + var key = peg$currPos * 37 + 36, cached = peg$resultsCache[key]; if (cached) { @@ -2423,16 +2574,16 @@ module.exports = (function() { s1 = peg$FAILED; } if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 14) === peg$c83) { - s2 = peg$c83; + if (input.substr(peg$currPos, 14) === peg$c89) { + s2 = peg$c89; peg$currPos += 14; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c84); } + if (peg$silentFails === 0) { peg$fail(peg$c90); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c85(); + s1 = peg$c91(); s0 = s1; } else { peg$currPos = s0; diff --git a/src/plugins/data/common/es_query/kuery/ast/ast.test.ts b/src/plugins/data/common/es_query/kuery/ast/ast.test.ts index 7d6e4c14f15020..f8d7dc02d38fce 100644 --- a/src/plugins/data/common/es_query/kuery/ast/ast.test.ts +++ b/src/plugins/data/common/es_query/kuery/ast/ast.test.ts @@ -55,6 +55,15 @@ describe('kuery AST API', () => { expect(actual).toEqual(expected); }); + test('nbsp should be recognised as whitespace', () => { + const expected = nodeTypes.function.buildNode('and', [ + nodeTypes.function.buildNode('is', null, 'foo'), + nodeTypes.function.buildNode('is', null, 'bar'), + ]); + const actual = fromKueryExpression('foo and\u00A0bar'); + expect(actual).toEqual(expected); + }); + test('should support "or" as a binary operator', () => { const expected = nodeTypes.function.buildNode('or', [ nodeTypes.function.buildNode('is', null, 'foo'), @@ -315,6 +324,12 @@ describe('kuery AST API', () => { expect(actual).toEqual(expected); }); + test('should allow escaping of unicode sequences with a backslash', () => { + const expected = nodeTypes.literal.buildNode('\\u00A0'); + const actual = fromLiteralExpression('\\\\u00A0'); + expect(actual).toEqual(expected); + }); + test('should support double quoted strings that do not need escapes except for quotes', () => { const expected = nodeTypes.literal.buildNode('\\():<>"*'); const actual = fromLiteralExpression('"\\():<>\\"*"'); @@ -327,6 +342,12 @@ describe('kuery AST API', () => { expect(actual).toEqual(expected); }); + test('should support escaped unicode sequences inside quoted strings', () => { + const expected = nodeTypes.literal.buildNode('\\u00A0'); + const actual = fromLiteralExpression('"\\\\u00A0"'); + expect(actual).toEqual(expected); + }); + test('should detect wildcards and build wildcard AST nodes', () => { const expected = nodeTypes.wildcard.buildNode('foo*bar'); const actual = fromLiteralExpression('foo*bar'); diff --git a/src/plugins/data/common/es_query/kuery/ast/kuery.peg b/src/plugins/data/common/es_query/kuery/ast/kuery.peg index 2e195ec7a618fd..dbea96eaac5b28 100644 --- a/src/plugins/data/common/es_query/kuery/ast/kuery.peg +++ b/src/plugins/data/common/es_query/kuery/ast/kuery.peg @@ -226,6 +226,7 @@ QuotedString QuotedCharacter = EscapedWhitespace + / EscapedUnicodeSequence / '\\' char:[\\"] { return char; } / !Cursor char:[^"] { return char; } @@ -253,6 +254,7 @@ UnquotedLiteral UnquotedCharacter = EscapedWhitespace / EscapedSpecialCharacter + / EscapedUnicodeSequence / EscapedKeyword / Wildcard / !SpecialCharacter !Keyword !Cursor char:. { return char; } @@ -291,6 +293,17 @@ Keyword SpecialCharacter = [\\():<>"*{}] +EscapedUnicodeSequence + = '\\' sequence:UnicodeSequence { return sequence; } + +UnicodeSequence + = "u" digits:$(HexDigit HexDigit HexDigit HexDigit) { + return String.fromCharCode(parseInt(digits, 16)); + } + +HexDigit + = [0-9a-f]i + RangeOperator = '<=' { return 'lte'; } / '>=' { return 'gte'; } @@ -298,7 +311,7 @@ RangeOperator / '>' { return 'gt'; } Space "whitespace" - = [\ \t\r\n] + = [\ \t\r\n\u00A0] Cursor = &{ return parseCursor; } '@kuery-cursor@' { return cursorSymbol; } diff --git a/src/plugins/data/common/search/aggs/agg_config.ts b/src/plugins/data/common/search/aggs/agg_config.ts index f62fedc13b32a0..0e9cf6aeb1f2f7 100644 --- a/src/plugins/data/common/search/aggs/agg_config.ts +++ b/src/plugins/data/common/search/aggs/agg_config.ts @@ -232,7 +232,9 @@ export class AggConfig { const output = this.write(aggConfigs) as any; const configDsl = {} as any; - configDsl[this.type.dslName || this.type.name] = output.params; + if (!this.type.hasNoDslParams) { + configDsl[this.type.dslName || this.type.name] = output.params; + } // if the config requires subAggs, write them to the dsl as well if (this.subAggs.length) { diff --git a/src/plugins/data/common/search/aggs/agg_configs.ts b/src/plugins/data/common/search/aggs/agg_configs.ts index c9986b7e93bed2..03c702aa72fb51 100644 --- a/src/plugins/data/common/search/aggs/agg_configs.ts +++ b/src/plugins/data/common/search/aggs/agg_configs.ts @@ -21,7 +21,14 @@ import { TimeRange } from '../../../common'; function removeParentAggs(obj: any) { for (const prop in obj) { if (prop === 'parentAggs') delete obj[prop]; - else if (typeof obj[prop] === 'object') removeParentAggs(obj[prop]); + else if (typeof obj[prop] === 'object') { + const hasParentAggsKey = 'parentAggs' in obj[prop]; + removeParentAggs(obj[prop]); + // delete object if parentAggs was the last key + if (hasParentAggsKey && Object.keys(obj[prop]).length === 0) { + delete obj[prop]; + } + } } } @@ -193,10 +200,12 @@ export class AggConfigs { // advance the cursor and nest under the previous agg, or // put it on the same level if the previous agg doesn't accept // sub aggs - dslLvlCursor = prevDsl.aggs || dslLvlCursor; + dslLvlCursor = prevDsl?.aggs || dslLvlCursor; } - const dsl = (dslLvlCursor[config.id] = config.toDsl(this)); + const dsl = config.type.hasNoDslParams + ? config.toDsl(this) + : (dslLvlCursor[config.id] = config.toDsl(this)); let subAggs: any; parseParentAggs(dslLvlCursor, dsl); @@ -206,6 +215,11 @@ export class AggConfigs { subAggs = dsl.aggs || (dsl.aggs = {}); } + if (subAggs) { + _.each(subAggs, (agg) => { + parseParentAggs(subAggs, agg); + }); + } if (subAggs && nestedMetrics) { nestedMetrics.forEach((agg: any) => { subAggs[agg.config.id] = agg.dsl; diff --git a/src/plugins/data/common/search/aggs/agg_type.ts b/src/plugins/data/common/search/aggs/agg_type.ts index 4583be17478e36..33fdc45a605b71 100644 --- a/src/plugins/data/common/search/aggs/agg_type.ts +++ b/src/plugins/data/common/search/aggs/agg_type.ts @@ -32,6 +32,7 @@ export interface AggTypeConfig< makeLabel?: ((aggConfig: TAggConfig) => string) | (() => string); ordered?: any; hasNoDsl?: boolean; + hasNoDslParams?: boolean; params?: Array>; valueType?: DatatableColumnType; getRequestAggs?: ((aggConfig: TAggConfig) => TAggConfig[]) | (() => TAggConfig[] | void); @@ -129,6 +130,12 @@ export class AggType< * @type {Boolean} */ hasNoDsl: boolean; + /** + * Flag that prevents params from this aggregation from being included in the dsl. Sibling and parent aggs are still written. + * + * @type {Boolean} + */ + hasNoDslParams: boolean; /** * The method to create a filter representation of the bucket * @param {object} aggConfig The instance of the aggConfig @@ -232,6 +239,7 @@ export class AggType< this.makeLabel = config.makeLabel || constant(this.name); this.ordered = config.ordered; this.hasNoDsl = !!config.hasNoDsl; + this.hasNoDslParams = !!config.hasNoDslParams; if (config.createFilter) { this.createFilter = config.createFilter; diff --git a/src/plugins/data/common/search/aggs/agg_types.ts b/src/plugins/data/common/search/aggs/agg_types.ts index a7af68a5ad8b45..d02f8e1fc5af4e 100644 --- a/src/plugins/data/common/search/aggs/agg_types.ts +++ b/src/plugins/data/common/search/aggs/agg_types.ts @@ -44,6 +44,7 @@ export const getAggTypes = () => ({ { name: METRIC_TYPES.SUM_BUCKET, fn: metrics.getBucketSumMetricAgg }, { name: METRIC_TYPES.MIN_BUCKET, fn: metrics.getBucketMinMetricAgg }, { name: METRIC_TYPES.MAX_BUCKET, fn: metrics.getBucketMaxMetricAgg }, + { name: METRIC_TYPES.FILTERED_METRIC, fn: metrics.getFilteredMetricAgg }, { name: METRIC_TYPES.GEO_BOUNDS, fn: metrics.getGeoBoundsMetricAgg }, { name: METRIC_TYPES.GEO_CENTROID, fn: metrics.getGeoCentroidMetricAgg }, ], @@ -80,6 +81,7 @@ export const getAggTypesFunctions = () => [ metrics.aggBucketMax, metrics.aggBucketMin, metrics.aggBucketSum, + metrics.aggFilteredMetric, metrics.aggCardinality, metrics.aggCount, metrics.aggCumulativeSum, diff --git a/src/plugins/data/common/search/aggs/aggs_service.test.ts b/src/plugins/data/common/search/aggs/aggs_service.test.ts index 92e6168b169c6c..bba67640890adf 100644 --- a/src/plugins/data/common/search/aggs/aggs_service.test.ts +++ b/src/plugins/data/common/search/aggs/aggs_service.test.ts @@ -97,6 +97,7 @@ describe('Aggs service', () => { "sum_bucket", "min_bucket", "max_bucket", + "filtered_metric", "geo_bounds", "geo_centroid", ] @@ -142,6 +143,7 @@ describe('Aggs service', () => { "sum_bucket", "min_bucket", "max_bucket", + "filtered_metric", "geo_bounds", "geo_centroid", ] diff --git a/src/plugins/data/common/search/aggs/buckets/filter.ts b/src/plugins/data/common/search/aggs/buckets/filter.ts index 14a8f84c2cb9f4..900848bb9517f7 100644 --- a/src/plugins/data/common/search/aggs/buckets/filter.ts +++ b/src/plugins/data/common/search/aggs/buckets/filter.ts @@ -6,12 +6,15 @@ * Side Public License, v 1. */ +import { cloneDeep } from 'lodash'; import { i18n } from '@kbn/i18n'; import { BucketAggType } from './bucket_agg_type'; import { BUCKET_TYPES } from './bucket_agg_types'; import { GeoBoundingBox } from './lib/geo_point'; import { aggFilterFnName } from './filter_fn'; import { BaseAggParams } from '../types'; +import { Query } from '../../../types'; +import { buildEsQuery, getEsQueryConfig } from '../../../es_query'; const filterTitle = i18n.translate('data.search.aggs.buckets.filterTitle', { defaultMessage: 'Filter', @@ -21,7 +24,7 @@ export interface AggParamsFilter extends BaseAggParams { geo_bounding_box?: GeoBoundingBox; } -export const getFilterBucketAgg = () => +export const getFilterBucketAgg = ({ getConfig }: { getConfig: (key: string) => any }) => new BucketAggType({ name: BUCKET_TYPES.FILTER, expressionName: aggFilterFnName, @@ -31,5 +34,27 @@ export const getFilterBucketAgg = () => { name: 'geo_bounding_box', }, + { + name: 'filter', + write(aggConfig, output) { + const filter: Query = aggConfig.params.filter; + + const input = cloneDeep(filter); + + if (!input) { + return; + } + + const esQueryConfigs = getEsQueryConfig({ get: getConfig }); + const query = buildEsQuery(aggConfig.getIndexPattern(), [input], [], esQueryConfigs); + + if (!query) { + console.log('malformed filter agg params, missing "query" on input'); // eslint-disable-line no-console + return; + } + + output.params = query; + }, + }, ], }); diff --git a/src/plugins/data/common/search/aggs/buckets/filter_fn.test.ts b/src/plugins/data/common/search/aggs/buckets/filter_fn.test.ts index 0b9f2915e9aa4b..8b4642bf595cd1 100644 --- a/src/plugins/data/common/search/aggs/buckets/filter_fn.test.ts +++ b/src/plugins/data/common/search/aggs/buckets/filter_fn.test.ts @@ -23,6 +23,7 @@ describe('agg_expression_functions', () => { "id": undefined, "params": Object { "customLabel": undefined, + "filter": undefined, "geo_bounding_box": undefined, "json": undefined, }, @@ -46,6 +47,7 @@ describe('agg_expression_functions', () => { "id": undefined, "params": Object { "customLabel": undefined, + "filter": undefined, "geo_bounding_box": Object { "wkt": "BBOX (-74.1, -71.12, 40.73, 40.01)", }, @@ -57,6 +59,25 @@ describe('agg_expression_functions', () => { `); }); + test('correctly parses filter string argument', () => { + const actual = fn({ + filter: '{ "language": "kuery", "query": "a: b" }', + }); + + expect(actual.value.params.filter).toEqual({ language: 'kuery', query: 'a: b' }); + }); + + test('errors out if geo_bounding_box is used together with filter', () => { + expect(() => + fn({ + filter: '{ "language": "kuery", "query": "a: b" }', + geo_bounding_box: JSON.stringify({ + wkt: 'BBOX (-74.1, -71.12, 40.73, 40.01)', + }), + }) + ).toThrow(); + }); + test('correctly parses json string argument', () => { const actual = fn({ json: '{ "foo": true }', diff --git a/src/plugins/data/common/search/aggs/buckets/filter_fn.ts b/src/plugins/data/common/search/aggs/buckets/filter_fn.ts index 468b0630465493..4c68251f5e42e9 100644 --- a/src/plugins/data/common/search/aggs/buckets/filter_fn.ts +++ b/src/plugins/data/common/search/aggs/buckets/filter_fn.ts @@ -17,7 +17,7 @@ export const aggFilterFnName = 'aggFilter'; type Input = any; type AggArgs = AggExpressionFunctionArgs; -type Arguments = Assign; +type Arguments = Assign; type Output = AggExpressionType; type FunctionDefinition = ExpressionFunctionDefinition< @@ -59,6 +59,13 @@ export const aggFilter = (): FunctionDefinition => ({ defaultMessage: 'Filter results based on a point location within a bounding box', }), }, + filter: { + types: ['string'], + help: i18n.translate('data.search.aggs.buckets.filter.filter.help', { + defaultMessage: + 'Filter results based on a kql or lucene query. Do not use together with geo_bounding_box', + }), + }, json: { types: ['string'], help: i18n.translate('data.search.aggs.buckets.filter.json.help', { @@ -75,6 +82,13 @@ export const aggFilter = (): FunctionDefinition => ({ fn: (input, args) => { const { id, enabled, schema, ...rest } = args; + const geoBoundingBox = getParsedValue(args, 'geo_bounding_box'); + const filter = getParsedValue(args, 'filter'); + + if (geoBoundingBox && filter) { + throw new Error("filter and geo_bounding_box can't be used together"); + } + return { type: 'agg_type', value: { @@ -84,7 +98,8 @@ export const aggFilter = (): FunctionDefinition => ({ type: BUCKET_TYPES.FILTER, params: { ...rest, - geo_bounding_box: getParsedValue(args, 'geo_bounding_box'), + geo_bounding_box: geoBoundingBox, + filter, }, }, }; diff --git a/src/plugins/data/common/search/aggs/metrics/filtered_metric.test.ts b/src/plugins/data/common/search/aggs/metrics/filtered_metric.test.ts new file mode 100644 index 00000000000000..b27e4dd1494be5 --- /dev/null +++ b/src/plugins/data/common/search/aggs/metrics/filtered_metric.test.ts @@ -0,0 +1,72 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { AggConfigs, IAggConfigs } from '../agg_configs'; +import { mockAggTypesRegistry } from '../test_helpers'; +import { METRIC_TYPES } from './metric_agg_types'; + +describe('filtered metric agg type', () => { + let aggConfigs: IAggConfigs; + + beforeEach(() => { + const typesRegistry = mockAggTypesRegistry(); + const field = { + name: 'bytes', + }; + const indexPattern = { + id: '1234', + title: 'logstash-*', + fields: { + getByName: () => field, + filter: () => [field], + }, + } as any; + + aggConfigs = new AggConfigs( + indexPattern, + [ + { + id: METRIC_TYPES.FILTERED_METRIC, + type: METRIC_TYPES.FILTERED_METRIC, + schema: 'metric', + params: { + customBucket: { + type: 'filter', + params: { + filter: { language: 'kuery', query: 'a: b' }, + }, + }, + customMetric: { + type: 'cardinality', + params: { + field: 'bytes', + }, + }, + }, + }, + ], + { + typesRegistry, + } + ); + }); + + it('converts the response', () => { + const agg = aggConfigs.getResponseAggs()[0]; + + expect( + agg.getValue({ + 'filtered_metric-bucket': { + 'filtered_metric-metric': { + value: 10, + }, + }, + }) + ).toEqual(10); + }); +}); diff --git a/src/plugins/data/common/search/aggs/metrics/filtered_metric.ts b/src/plugins/data/common/search/aggs/metrics/filtered_metric.ts new file mode 100644 index 00000000000000..aa2417bbf84156 --- /dev/null +++ b/src/plugins/data/common/search/aggs/metrics/filtered_metric.ts @@ -0,0 +1,56 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { i18n } from '@kbn/i18n'; +import { MetricAggType } from './metric_agg_type'; +import { makeNestedLabel } from './lib/make_nested_label'; +import { siblingPipelineAggHelper } from './lib/sibling_pipeline_agg_helper'; +import { METRIC_TYPES } from './metric_agg_types'; +import { AggConfigSerialized, BaseAggParams } from '../types'; +import { aggFilteredMetricFnName } from './filtered_metric_fn'; + +export interface AggParamsFilteredMetric extends BaseAggParams { + customMetric?: AggConfigSerialized; + customBucket?: AggConfigSerialized; +} + +const filteredMetricLabel = i18n.translate('data.search.aggs.metrics.filteredMetricLabel', { + defaultMessage: 'filtered', +}); + +const filteredMetricTitle = i18n.translate('data.search.aggs.metrics.filteredMetricTitle', { + defaultMessage: 'Filtered metric', +}); + +export const getFilteredMetricAgg = () => { + const { subtype, params, getSerializedFormat } = siblingPipelineAggHelper; + + return new MetricAggType({ + name: METRIC_TYPES.FILTERED_METRIC, + expressionName: aggFilteredMetricFnName, + title: filteredMetricTitle, + makeLabel: (agg) => makeNestedLabel(agg, filteredMetricLabel), + subtype, + params: [...params(['filter'])], + hasNoDslParams: true, + getSerializedFormat, + getValue(agg, bucket) { + const customMetric = agg.getParam('customMetric'); + const customBucket = agg.getParam('customBucket'); + return customMetric.getValue(bucket[customBucket.id]); + }, + getValueBucketPath(agg) { + const customBucket = agg.getParam('customBucket'); + const customMetric = agg.getParam('customMetric'); + if (customMetric.type.name === 'count') { + return customBucket.getValueBucketPath(); + } + return `${customBucket.getValueBucketPath()}>${customMetric.getValueBucketPath()}`; + }, + }); +}; diff --git a/src/plugins/data/common/search/aggs/metrics/filtered_metric_fn.test.ts b/src/plugins/data/common/search/aggs/metrics/filtered_metric_fn.test.ts new file mode 100644 index 00000000000000..22e97fe18b604c --- /dev/null +++ b/src/plugins/data/common/search/aggs/metrics/filtered_metric_fn.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 + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { functionWrapper } from '../test_helpers'; +import { aggFilteredMetric } from './filtered_metric_fn'; + +describe('agg_expression_functions', () => { + describe('aggFilteredMetric', () => { + const fn = functionWrapper(aggFilteredMetric()); + + test('handles customMetric and customBucket as a subexpression', () => { + const actual = fn({ + customMetric: fn({}), + customBucket: fn({}), + }); + + expect(actual.value.params).toMatchInlineSnapshot(` + Object { + "customBucket": Object { + "enabled": true, + "id": undefined, + "params": Object { + "customBucket": undefined, + "customLabel": undefined, + "customMetric": undefined, + }, + "schema": undefined, + "type": "filtered_metric", + }, + "customLabel": undefined, + "customMetric": Object { + "enabled": true, + "id": undefined, + "params": Object { + "customBucket": undefined, + "customLabel": undefined, + "customMetric": undefined, + }, + "schema": undefined, + "type": "filtered_metric", + }, + } + `); + }); + }); +}); diff --git a/src/plugins/data/common/search/aggs/metrics/filtered_metric_fn.ts b/src/plugins/data/common/search/aggs/metrics/filtered_metric_fn.ts new file mode 100644 index 00000000000000..6a7ff5fa5fd40e --- /dev/null +++ b/src/plugins/data/common/search/aggs/metrics/filtered_metric_fn.ts @@ -0,0 +1,94 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { i18n } from '@kbn/i18n'; +import { Assign } from '@kbn/utility-types'; +import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common'; +import { AggExpressionType, AggExpressionFunctionArgs, METRIC_TYPES } from '../'; + +export const aggFilteredMetricFnName = 'aggFilteredMetric'; + +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Arguments = Assign< + AggArgs, + { customBucket?: AggExpressionType; customMetric?: AggExpressionType } +>; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition< + typeof aggFilteredMetricFnName, + Input, + Arguments, + Output +>; + +export const aggFilteredMetric = (): FunctionDefinition => ({ + name: aggFilteredMetricFnName, + help: i18n.translate('data.search.aggs.function.metrics.filtered_metric.help', { + defaultMessage: 'Generates a serialized agg config for a filtered metric agg', + }), + type: 'agg_type', + args: { + id: { + types: ['string'], + help: i18n.translate('data.search.aggs.metrics.filtered_metric.id.help', { + defaultMessage: 'ID for this aggregation', + }), + }, + enabled: { + types: ['boolean'], + default: true, + help: i18n.translate('data.search.aggs.metrics.filtered_metric.enabled.help', { + defaultMessage: 'Specifies whether this aggregation should be enabled', + }), + }, + schema: { + types: ['string'], + help: i18n.translate('data.search.aggs.metrics.filtered_metric.schema.help', { + defaultMessage: 'Schema to use for this aggregation', + }), + }, + customBucket: { + types: ['agg_type'], + help: i18n.translate('data.search.aggs.metrics.filtered_metric.customBucket.help', { + defaultMessage: + 'Agg config to use for building sibling pipeline aggregations. Has to be a filter aggregation', + }), + }, + customMetric: { + types: ['agg_type'], + help: i18n.translate('data.search.aggs.metrics.filtered_metric.customMetric.help', { + defaultMessage: 'Agg config to use for building sibling pipeline aggregations', + }), + }, + customLabel: { + types: ['string'], + help: i18n.translate('data.search.aggs.metrics.filtered_metric.customLabel.help', { + defaultMessage: 'Represents a custom label for this aggregation', + }), + }, + }, + fn: (input, args) => { + const { id, enabled, schema, ...rest } = args; + + return { + type: 'agg_type', + value: { + id, + enabled, + schema, + type: METRIC_TYPES.FILTERED_METRIC, + params: { + ...rest, + customBucket: args.customBucket?.value, + customMetric: args.customMetric?.value, + }, + }, + }; + }, +}); diff --git a/src/plugins/data/common/search/aggs/metrics/index.ts b/src/plugins/data/common/search/aggs/metrics/index.ts index 4ab3b021ef93a5..7038673d5d7c4e 100644 --- a/src/plugins/data/common/search/aggs/metrics/index.ts +++ b/src/plugins/data/common/search/aggs/metrics/index.ts @@ -16,6 +16,8 @@ export * from './bucket_min_fn'; export * from './bucket_min'; export * from './bucket_sum_fn'; export * from './bucket_sum'; +export * from './filtered_metric_fn'; +export * from './filtered_metric'; export * from './cardinality_fn'; export * from './cardinality'; export * from './count'; diff --git a/src/plugins/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.ts b/src/plugins/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.ts index b72a6ca9f73baa..d51038d8a15e88 100644 --- a/src/plugins/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.ts +++ b/src/plugins/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.ts @@ -21,6 +21,7 @@ const metricAggFilter = [ '!std_dev', '!geo_bounds', '!geo_centroid', + '!filtered_metric', ]; export const parentPipelineType = i18n.translate( diff --git a/src/plugins/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_helper.ts b/src/plugins/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_helper.ts index d91ceae414f35c..c0d1be4f47f9bc 100644 --- a/src/plugins/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_helper.ts +++ b/src/plugins/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_helper.ts @@ -27,6 +27,7 @@ const metricAggFilter: string[] = [ '!cumulative_sum', '!geo_bounds', '!geo_centroid', + '!filtered_metric', ]; const bucketAggFilter: string[] = []; @@ -39,12 +40,12 @@ export const siblingPipelineType = i18n.translate( export const siblingPipelineAggHelper = { subtype: siblingPipelineType, - params() { + params(bucketFilter = bucketAggFilter) { return [ { name: 'customBucket', type: 'agg', - allowedAggs: bucketAggFilter, + allowedAggs: bucketFilter, default: null, makeAgg(agg: IMetricAggConfig, state = { type: 'date_histogram' }) { const orderAgg = agg.aggConfigs.createAggConfig(state, { addToAggConfigs: false }); @@ -69,7 +70,8 @@ export const siblingPipelineAggHelper = { modifyAggConfigOnSearchRequestStart: forwardModifyAggConfigOnSearchRequestStart( 'customMetric' ), - write: siblingPipelineAggWriter, + write: (agg: IMetricAggConfig, output: Record) => + siblingPipelineAggWriter(agg, output), }, ] as Array>; }, diff --git a/src/plugins/data/common/search/aggs/metrics/metric_agg_types.ts b/src/plugins/data/common/search/aggs/metrics/metric_agg_types.ts index b49004be2db014..3b6c9d8a0d55dd 100644 --- a/src/plugins/data/common/search/aggs/metrics/metric_agg_types.ts +++ b/src/plugins/data/common/search/aggs/metrics/metric_agg_types.ts @@ -8,6 +8,7 @@ export enum METRIC_TYPES { AVG = 'avg', + FILTERED_METRIC = 'filtered_metric', CARDINALITY = 'cardinality', AVG_BUCKET = 'avg_bucket', MAX_BUCKET = 'max_bucket', diff --git a/src/plugins/data/common/search/aggs/types.ts b/src/plugins/data/common/search/aggs/types.ts index 48ded7fa7a7fcf..e57410962fc08a 100644 --- a/src/plugins/data/common/search/aggs/types.ts +++ b/src/plugins/data/common/search/aggs/types.ts @@ -41,6 +41,7 @@ import { AggParamsBucketMax, AggParamsBucketMin, AggParamsBucketSum, + AggParamsFilteredMetric, AggParamsCardinality, AggParamsCumulativeSum, AggParamsDateHistogram, @@ -84,6 +85,7 @@ import { getCalculateAutoTimeExpression, METRIC_TYPES, AggConfig, + aggFilteredMetric, } from './'; export { IAggConfig, AggConfigSerialized } from './agg_config'; @@ -188,6 +190,7 @@ export interface AggParamsMapping { [METRIC_TYPES.MAX_BUCKET]: AggParamsBucketMax; [METRIC_TYPES.MIN_BUCKET]: AggParamsBucketMin; [METRIC_TYPES.SUM_BUCKET]: AggParamsBucketSum; + [METRIC_TYPES.FILTERED_METRIC]: AggParamsFilteredMetric; [METRIC_TYPES.CUMULATIVE_SUM]: AggParamsCumulativeSum; [METRIC_TYPES.DERIVATIVE]: AggParamsDerivative; [METRIC_TYPES.MOVING_FN]: AggParamsMovingAvg; @@ -217,6 +220,7 @@ export interface AggFunctionsMapping { aggBucketMax: ReturnType; aggBucketMin: ReturnType; aggBucketSum: ReturnType; + aggFilteredMetric: ReturnType; aggCardinality: ReturnType; aggCount: ReturnType; aggCumulativeSum: ReturnType; diff --git a/src/plugins/data/common/search/expressions/exists_filter.test.ts b/src/plugins/data/common/search/expressions/exists_filter.test.ts new file mode 100644 index 00000000000000..e3b53b22813983 --- /dev/null +++ b/src/plugins/data/common/search/expressions/exists_filter.test.ts @@ -0,0 +1,33 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { createMockContext } from '../../../../expressions/common'; +import { functionWrapper } from './utils'; +import { existsFilterFunction } from './exists_filter'; + +describe('interpreter/functions#existsFilter', () => { + const fn = functionWrapper(existsFilterFunction); + + it('returns an object with the correct structure', () => { + const actual = fn(null, { field: { spec: { name: 'test' } } }, createMockContext()); + expect(actual).toMatchInlineSnapshot(` + Object { + "exists": Object { + "field": "test", + }, + "meta": Object { + "alias": null, + "disabled": false, + "index": undefined, + "negate": false, + }, + "type": "kibana_filter", + } + `); + }); +}); diff --git a/src/plugins/data/common/search/expressions/exists_filter.ts b/src/plugins/data/common/search/expressions/exists_filter.ts new file mode 100644 index 00000000000000..0979328860b4c9 --- /dev/null +++ b/src/plugins/data/common/search/expressions/exists_filter.ts @@ -0,0 +1,65 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { i18n } from '@kbn/i18n'; +import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common'; +import { KibanaField, KibanaFilter } from './kibana_context_type'; +import { buildFilter, FILTERS } from '../../es_query/filters'; +import { IndexPattern } from '../../index_patterns/index_patterns'; + +interface Arguments { + field: KibanaField; + negate?: boolean; +} + +export type ExpressionFunctionExistsFilter = ExpressionFunctionDefinition< + 'existsFilter', + null, + Arguments, + KibanaFilter +>; + +export const existsFilterFunction: ExpressionFunctionExistsFilter = { + name: 'existsFilter', + type: 'kibana_filter', + inputTypes: ['null'], + help: i18n.translate('data.search.functions.existsFilter.help', { + defaultMessage: 'Create kibana exists filter', + }), + args: { + field: { + types: ['kibana_field'], + required: true, + help: i18n.translate('data.search.functions.existsFilter.field.help', { + defaultMessage: 'Specify the field you want to filter on. Use `field` function.', + }), + }, + negate: { + types: ['boolean'], + default: false, + help: i18n.translate('data.search.functions.existsFilter.negate.help', { + defaultMessage: 'Should the filter be negated.', + }), + }, + }, + + fn(input, args) { + return { + type: 'kibana_filter', + ...buildFilter( + ({} as any) as IndexPattern, + args.field.spec, + FILTERS.EXISTS, + args.negate || false, + false, + {}, + null + ), + }; + }, +}; diff --git a/src/plugins/data/common/search/expressions/field.test.ts b/src/plugins/data/common/search/expressions/field.test.ts new file mode 100644 index 00000000000000..2ad139e2bd0a7e --- /dev/null +++ b/src/plugins/data/common/search/expressions/field.test.ts @@ -0,0 +1,42 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { ExecutionContext } from 'src/plugins/expressions/common'; +import { functionWrapper } from './utils'; +import { fieldFunction } from './field'; + +describe('interpreter/functions#field', () => { + const fn = functionWrapper(fieldFunction); + let context: ExecutionContext; + + beforeEach(() => { + context = { + getSearchContext: () => ({}), + getSearchSessionId: () => undefined, + types: {}, + variables: {}, + abortSignal: {} as any, + inspectorAdapters: {} as any, + }; + }); + + it('returns an object with the correct structure', () => { + const actual = fn(null, { name: 'test', type: 'number' }, context); + expect(actual).toMatchInlineSnapshot(` + Object { + "spec": Object { + "name": "test", + "script": undefined, + "scripted": false, + "type": "number", + }, + "type": "kibana_field", + } + `); + }); +}); diff --git a/src/plugins/data/common/search/expressions/field.ts b/src/plugins/data/common/search/expressions/field.ts new file mode 100644 index 00000000000000..8c13069f50ad5b --- /dev/null +++ b/src/plugins/data/common/search/expressions/field.ts @@ -0,0 +1,67 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { i18n } from '@kbn/i18n'; +import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common'; +import { KibanaField } from './kibana_context_type'; + +interface Arguments { + name: string; + type: string; + script?: string; +} + +export type ExpressionFunctionField = ExpressionFunctionDefinition< + 'field', + null, + Arguments, + KibanaField +>; + +export const fieldFunction: ExpressionFunctionField = { + name: 'field', + type: 'kibana_field', + inputTypes: ['null'], + help: i18n.translate('data.search.functions.field.help', { + defaultMessage: 'Create a Kibana field.', + }), + args: { + name: { + types: ['string'], + required: true, + help: i18n.translate('data.search.functions.field.name.help', { + defaultMessage: 'Name of the field', + }), + }, + type: { + types: ['string'], + required: true, + help: i18n.translate('data.search.functions.field.type.help', { + defaultMessage: 'Type of the field', + }), + }, + script: { + types: ['string'], + help: i18n.translate('data.search.functions.field.script.help', { + defaultMessage: 'A field script, in case the field is scripted.', + }), + }, + }, + + fn(input, args) { + return { + type: 'kibana_field', + spec: { + name: args.name, + type: args.type, + scripted: args.script ? true : false, + script: args.script, + }, + } as KibanaField; + }, +}; diff --git a/src/plugins/data/common/search/expressions/filters_to_ast.test.ts b/src/plugins/data/common/search/expressions/filters_to_ast.test.ts new file mode 100644 index 00000000000000..108b48f9ea77ea --- /dev/null +++ b/src/plugins/data/common/search/expressions/filters_to_ast.test.ts @@ -0,0 +1,47 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { filtersToAst } from './filters_to_ast'; + +describe('interpreter/functions#filtersToAst', () => { + const normalFilter = { + meta: { negate: false, alias: '', disabled: false }, + query: { test: 'something' }, + }; + const negatedFilter = { + meta: { negate: true, alias: '', disabled: false }, + query: { test: 'something' }, + }; + + it('converts a list of filters to an expression AST node', () => { + const actual = filtersToAst([normalFilter, negatedFilter]); + expect(actual).toHaveLength(2); + expect(actual[0].functions[0]).toHaveProperty('name', 'kibanaFilter'); + expect(actual[0].functions[0].arguments).toMatchInlineSnapshot(` + Object { + "negate": Array [ + false, + ], + "query": Array [ + "{\\"query\\":{\\"test\\":\\"something\\"}}", + ], + } + `); + expect(actual[1].functions[0]).toHaveProperty('name', 'kibanaFilter'); + expect(actual[1].functions[0].arguments).toMatchInlineSnapshot(` + Object { + "negate": Array [ + true, + ], + "query": Array [ + "{\\"query\\":{\\"test\\":\\"something\\"}}", + ], + } + `); + }); +}); diff --git a/src/plugins/data/common/search/expressions/filters_to_ast.ts b/src/plugins/data/common/search/expressions/filters_to_ast.ts new file mode 100644 index 00000000000000..a4dd959caecf6f --- /dev/null +++ b/src/plugins/data/common/search/expressions/filters_to_ast.ts @@ -0,0 +1,23 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { buildExpression, buildExpressionFunction } from '../../../../expressions/common'; +import { Filter } from '../../es_query/filters'; +import { ExpressionFunctionKibanaFilter } from './kibana_filter'; + +export const filtersToAst = (filters: Filter[] | Filter) => { + return (Array.isArray(filters) ? filters : [filters]).map((filter) => { + const { meta, $state, ...restOfFilter } = filter; + return buildExpression([ + buildExpressionFunction('kibanaFilter', { + query: JSON.stringify(restOfFilter), + negate: filter.meta.negate, + }), + ]); + }); +}; diff --git a/src/plugins/data/common/search/expressions/index.ts b/src/plugins/data/common/search/expressions/index.ts index b38dce247261c5..b80cbad778a118 100644 --- a/src/plugins/data/common/search/expressions/index.ts +++ b/src/plugins/data/common/search/expressions/index.ts @@ -15,4 +15,11 @@ export * from './timerange_to_ast'; export * from './kibana_context_type'; export * from './esaggs'; export * from './utils'; +export * from './range'; +export * from './field'; +export * from './phrase_filter'; +export * from './exists_filter'; +export * from './range_filter'; +export * from './kibana_filter'; +export * from './filters_to_ast'; export * from './timerange'; diff --git a/src/plugins/data/common/search/expressions/kibana_context.ts b/src/plugins/data/common/search/expressions/kibana_context.ts index 5c2e2f418e69c9..98d7a2c45b4fc1 100644 --- a/src/plugins/data/common/search/expressions/kibana_context.ts +++ b/src/plugins/data/common/search/expressions/kibana_context.ts @@ -10,14 +10,15 @@ import { uniqBy } from 'lodash'; import { i18n } from '@kbn/i18n'; import { ExpressionFunctionDefinition, ExecutionContext } from 'src/plugins/expressions/common'; import { Adapters } from 'src/plugins/inspector/common'; +import { unboxExpressionValue } from '../../../../expressions/common'; import { Query, uniqFilters } from '../../query'; -import { ExecutionContextSearch, KibanaContext } from './kibana_context_type'; +import { ExecutionContextSearch, KibanaContext, KibanaFilter } from './kibana_context_type'; import { KibanaQueryOutput } from './kibana_context_type'; import { KibanaTimerangeOutput } from './timerange'; interface Arguments { q?: KibanaQueryOutput | null; - filters?: string | null; + filters?: KibanaFilter[] | null; timeRange?: KibanaTimerangeOutput | null; savedSearchId?: string | null; } @@ -56,8 +57,8 @@ export const kibanaContextFunction: ExpressionFunctionKibanaContext = { }), }, filters: { - types: ['string', 'null'], - default: '"[]"', + types: ['kibana_filter', 'null'], + multi: true, help: i18n.translate('data.search.functions.kibana_context.filters.help', { defaultMessage: 'Specify Kibana generic filters', }), @@ -81,7 +82,7 @@ export const kibanaContextFunction: ExpressionFunctionKibanaContext = { async fn(input, args, { getSavedObject }) { const timeRange = args.timeRange || input?.timeRange; let queries = mergeQueries(input?.query, args?.q || []); - let filters = [...(input?.filters || []), ...getParsedValue(args?.filters, [])]; + let filters = [...(input?.filters || []), ...(args?.filters?.map(unboxExpressionValue) || [])]; if (args.savedSearchId) { if (typeof getSavedObject !== 'function') { diff --git a/src/plugins/data/common/search/expressions/kibana_context_type.ts b/src/plugins/data/common/search/expressions/kibana_context_type.ts index 090f09f7004ca6..0a7c365bb29142 100644 --- a/src/plugins/data/common/search/expressions/kibana_context_type.ts +++ b/src/plugins/data/common/search/expressions/kibana_context_type.ts @@ -9,6 +9,7 @@ import { ExpressionValueBoxed } from 'src/plugins/expressions/common'; import { Filter } from '../../es_query'; import { Query, TimeRange } from '../../query'; +import { IndexPatternField } from '../../index_patterns/fields'; // eslint-disable-next-line @typescript-eslint/consistent-type-definitions export type ExecutionContextSearch = { @@ -23,6 +24,8 @@ export type ExpressionValueSearchContext = ExpressionValueBoxed< >; export type KibanaQueryOutput = ExpressionValueBoxed<'kibana_query', Query>; +export type KibanaFilter = ExpressionValueBoxed<'kibana_filter', Filter>; +export type KibanaField = ExpressionValueBoxed<'kibana_field', IndexPatternField>; // TODO: These two are exported for legacy reasons - remove them eventually. export type KIBANA_CONTEXT_NAME = 'kibana_context'; diff --git a/src/plugins/data/common/search/expressions/kibana_filter.test.ts b/src/plugins/data/common/search/expressions/kibana_filter.test.ts new file mode 100644 index 00000000000000..ac8ae55492cc06 --- /dev/null +++ b/src/plugins/data/common/search/expressions/kibana_filter.test.ts @@ -0,0 +1,30 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { createMockContext } from '../../../../expressions/common'; +import { functionWrapper } from './utils'; +import { kibanaFilterFunction } from './kibana_filter'; + +describe('interpreter/functions#kibanaFilter', () => { + const fn = functionWrapper(kibanaFilterFunction); + + it('returns an object with the correct structure', () => { + const actual = fn(null, { query: '{ "name": "test" }' }, createMockContext()); + expect(actual).toMatchInlineSnapshot(` + Object { + "meta": Object { + "alias": "", + "disabled": false, + "negate": false, + }, + "name": "test", + "type": "kibana_filter", + } + `); + }); +}); diff --git a/src/plugins/data/common/search/expressions/kibana_filter.ts b/src/plugins/data/common/search/expressions/kibana_filter.ts new file mode 100644 index 00000000000000..6d6f70fa8d1d6b --- /dev/null +++ b/src/plugins/data/common/search/expressions/kibana_filter.ts @@ -0,0 +1,61 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { i18n } from '@kbn/i18n'; +import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common'; +import { KibanaFilter } from './kibana_context_type'; + +interface Arguments { + query: string; + negate?: boolean; +} + +export type ExpressionFunctionKibanaFilter = ExpressionFunctionDefinition< + 'kibanaFilter', + null, + Arguments, + KibanaFilter +>; + +export const kibanaFilterFunction: ExpressionFunctionKibanaFilter = { + name: 'kibanaFilter', + type: 'kibana_filter', + inputTypes: ['null'], + help: i18n.translate('data.search.functions.kibanaFilter.help', { + defaultMessage: 'Create kibana filter', + }), + args: { + query: { + types: ['string'], + aliases: ['q', '_'], + required: true, + help: i18n.translate('data.search.functions.kibanaFilter.field.help', { + defaultMessage: 'Specify free form esdsl query', + }), + }, + negate: { + types: ['boolean'], + default: false, + help: i18n.translate('data.search.functions.kibanaFilter.negate.help', { + defaultMessage: 'Should the filter be negated', + }), + }, + }, + + fn(input, args) { + return { + type: 'kibana_filter', + meta: { + negate: args.negate || false, + alias: '', + disabled: false, + }, + ...JSON.parse(args.query), + }; + }, +}; diff --git a/src/plugins/data/common/search/expressions/phrase_filter.test.ts b/src/plugins/data/common/search/expressions/phrase_filter.test.ts new file mode 100644 index 00000000000000..39bd907513a0df --- /dev/null +++ b/src/plugins/data/common/search/expressions/phrase_filter.test.ts @@ -0,0 +1,58 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { createMockContext } from '../../../../expressions/common'; +import { functionWrapper } from './utils'; +import { phraseFilterFunction } from './phrase_filter'; + +describe('interpreter/functions#phraseFilter', () => { + const fn = functionWrapper(phraseFilterFunction); + + it('returns an object with the correct structure', () => { + const actual = fn( + null, + { field: { spec: { name: 'test' } }, phrase: ['test', 'something'] }, + createMockContext() + ); + expect(actual).toMatchInlineSnapshot(` + Object { + "meta": Object { + "alias": null, + "disabled": false, + "index": undefined, + "key": "test", + "negate": false, + "params": Array [ + "test", + "something", + ], + "type": "phrases", + "value": "test, something", + }, + "query": Object { + "bool": Object { + "minimum_should_match": 1, + "should": Array [ + Object { + "match_phrase": Object { + "test": "test", + }, + }, + Object { + "match_phrase": Object { + "test": "something", + }, + }, + ], + }, + }, + "type": "kibana_filter", + } + `); + }); +}); diff --git a/src/plugins/data/common/search/expressions/phrase_filter.ts b/src/plugins/data/common/search/expressions/phrase_filter.ts new file mode 100644 index 00000000000000..0b19e8a1e416d8 --- /dev/null +++ b/src/plugins/data/common/search/expressions/phrase_filter.ts @@ -0,0 +1,89 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { i18n } from '@kbn/i18n'; +import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common'; +import { KibanaField, KibanaFilter } from './kibana_context_type'; +import { buildFilter, FILTERS } from '../../es_query/filters'; +import { IndexPattern } from '../../index_patterns/index_patterns'; + +interface Arguments { + field: KibanaField; + phrase: string[]; + negate?: boolean; +} + +export type ExpressionFunctionPhraseFilter = ExpressionFunctionDefinition< + 'rangeFilter', + null, + Arguments, + KibanaFilter +>; + +export const phraseFilterFunction: ExpressionFunctionPhraseFilter = { + name: 'rangeFilter', + type: 'kibana_filter', + inputTypes: ['null'], + help: i18n.translate('data.search.functions.phraseFilter.help', { + defaultMessage: 'Create kibana phrase or phrases filter', + }), + args: { + field: { + types: ['kibana_field'], + required: true, + help: i18n.translate('data.search.functions.phraseFilter.field.help', { + defaultMessage: 'Specify the field you want to filter on. Use `field` function.', + }), + }, + phrase: { + types: ['string'], + multi: true, + required: true, + help: i18n.translate('data.search.functions.phraseFilter.phrase.help', { + defaultMessage: 'Specify the phrases', + }), + }, + negate: { + types: ['boolean'], + default: false, + help: i18n.translate('data.search.functions.phraseFilter.negate.help', { + defaultMessage: 'Should the filter be negated', + }), + }, + }, + + fn(input, args) { + if (args.phrase.length === 1) { + return { + type: 'kibana_filter', + ...buildFilter( + ({} as any) as IndexPattern, + args.field.spec, + FILTERS.PHRASE, + args.negate || false, + false, + args.phrase[0], + null + ), + }; + } + + return { + type: 'kibana_filter', + ...buildFilter( + ({} as any) as IndexPattern, + args.field.spec, + FILTERS.PHRASES, + args.negate || false, + false, + args.phrase, + null + ), + }; + }, +}; diff --git a/src/plugins/data/common/search/expressions/range.test.ts b/src/plugins/data/common/search/expressions/range.test.ts new file mode 100644 index 00000000000000..fbb4781c33a04d --- /dev/null +++ b/src/plugins/data/common/search/expressions/range.test.ts @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { ExecutionContext } from 'src/plugins/expressions/common'; +import { functionWrapper } from './utils'; +import { rangeFunction } from './range'; + +describe('interpreter/functions#range', () => { + const fn = functionWrapper(rangeFunction); + let context: ExecutionContext; + + beforeEach(() => { + context = { + getSearchContext: () => ({}), + getSearchSessionId: () => undefined, + types: {}, + variables: {}, + abortSignal: {} as any, + inspectorAdapters: {} as any, + }; + }); + + it('returns an object with the correct structure', () => { + const actual = fn(null, { lt: 20, gt: 10 }, context); + expect(actual).toMatchInlineSnapshot(` + Object { + "gt": 10, + "gte": undefined, + "lt": 20, + "lte": undefined, + "type": "kibana_range", + } + `); + }); +}); diff --git a/src/plugins/data/common/search/expressions/range.ts b/src/plugins/data/common/search/expressions/range.ts new file mode 100644 index 00000000000000..c7649a6e0669c1 --- /dev/null +++ b/src/plugins/data/common/search/expressions/range.ts @@ -0,0 +1,76 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { i18n } from '@kbn/i18n'; +import { ExpressionFunctionDefinition, ExpressionValueBoxed } from 'src/plugins/expressions/common'; + +interface Arguments { + gt?: number | string; + lt?: number | string; + gte?: number | string; + lte?: number | string; +} + +export type KibanaRange = ExpressionValueBoxed<'kibana_range', Arguments>; + +export type ExpressionFunctionRange = ExpressionFunctionDefinition< + 'range', + null, + Arguments, + KibanaRange +>; + +export const rangeFunction: ExpressionFunctionRange = { + name: 'range', + type: 'kibana_range', + inputTypes: ['null'], + help: i18n.translate('data.search.functions.range.help', { + defaultMessage: 'Create kibana range filter', + }), + args: { + gt: { + types: ['string', 'number'], + help: i18n.translate('data.search.functions.range.gt.help', { + defaultMessage: 'Greater than', + }), + }, + lt: { + types: ['string', 'number'], + help: i18n.translate('data.search.functions.range.lt.help', { + defaultMessage: 'Less than', + }), + }, + gte: { + types: ['string', 'number'], + help: i18n.translate('data.search.functions.range.gte.help', { + defaultMessage: 'Greater or equal than', + }), + }, + lte: { + types: ['string', 'number'], + help: i18n.translate('data.search.functions.range.lte.help', { + defaultMessage: 'Less or equal than', + }), + }, + }, + + fn(input, args) { + if (args.lt === undefined && args.lte === undefined) { + throw new Error('lt or lte must be provided'); + } + + if (args.gt === undefined && args.gte === undefined) { + throw new Error('gt or gte must be provided'); + } + + return { + type: 'kibana_range', + ...args, + }; + }, +}; diff --git a/src/plugins/data/common/search/expressions/range_filter.test.ts b/src/plugins/data/common/search/expressions/range_filter.test.ts new file mode 100644 index 00000000000000..92670f8a044ba6 --- /dev/null +++ b/src/plugins/data/common/search/expressions/range_filter.test.ts @@ -0,0 +1,41 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { createMockContext } from '../../../../expressions/common'; +import { functionWrapper } from './utils'; +import { rangeFilterFunction } from './range_filter'; + +describe('interpreter/functions#rangeFilter', () => { + const fn = functionWrapper(rangeFilterFunction); + + it('returns an object with the correct structure', () => { + const actual = fn( + null, + { field: { spec: { name: 'test' } }, range: { gt: 10, lt: 20 } }, + createMockContext() + ); + expect(actual).toMatchInlineSnapshot(` + Object { + "meta": Object { + "alias": null, + "disabled": false, + "index": undefined, + "negate": false, + "params": Object {}, + }, + "range": Object { + "test": Object { + "gte": 10, + "lt": 20, + }, + }, + "type": "kibana_filter", + } + `); + }); +}); diff --git a/src/plugins/data/common/search/expressions/range_filter.ts b/src/plugins/data/common/search/expressions/range_filter.ts new file mode 100644 index 00000000000000..ed71f5362fe858 --- /dev/null +++ b/src/plugins/data/common/search/expressions/range_filter.ts @@ -0,0 +1,74 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { i18n } from '@kbn/i18n'; +import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common'; +import { KibanaField, KibanaFilter } from './kibana_context_type'; +import { buildFilter, FILTERS } from '../../es_query/filters'; +import { IndexPattern } from '../../index_patterns/index_patterns'; +import { KibanaRange } from './range'; + +interface Arguments { + field: KibanaField; + range: KibanaRange; + negate?: boolean; +} + +export type ExpressionFunctionRangeFilter = ExpressionFunctionDefinition< + 'rangeFilter', + null, + Arguments, + KibanaFilter +>; + +export const rangeFilterFunction: ExpressionFunctionRangeFilter = { + name: 'rangeFilter', + type: 'kibana_filter', + inputTypes: ['null'], + help: i18n.translate('data.search.functions.rangeFilter.help', { + defaultMessage: 'Create kibana range filter', + }), + args: { + field: { + types: ['kibana_field'], + required: true, + help: i18n.translate('data.search.functions.rangeFilter.field.help', { + defaultMessage: 'Specify the field you want to filter on. Use `field` function.', + }), + }, + range: { + types: ['kibana_range'], + required: true, + help: i18n.translate('data.search.functions.rangeFilter.range.help', { + defaultMessage: 'Specify the range, use `range` function.', + }), + }, + negate: { + types: ['boolean'], + default: false, + help: i18n.translate('data.search.functions.rangeFilter.negate.help', { + defaultMessage: 'Should the filter be negated', + }), + }, + }, + + fn(input, args) { + return { + type: 'kibana_filter', + ...buildFilter( + ({} as any) as IndexPattern, + args.field.spec, + FILTERS.RANGE, + args.negate || false, + false, + { from: args.range.gt || args.range.gte, to: args.range.lt || args.range.lte }, + null + ), + }; + }, +}; diff --git a/src/plugins/data/public/public.api.md b/src/plugins/data/public/public.api.md index a61b8f400d2859..5dc5a8ab2ce93c 100644 --- a/src/plugins/data/public/public.api.md +++ b/src/plugins/data/public/public.api.md @@ -329,6 +329,10 @@ export interface AggFunctionsMapping { // // (undocumented) aggFilter: ReturnType; + // Warning: (ae-forgotten-export) The symbol "aggFilteredMetric" needs to be exported by the entry point index.d.ts + // + // (undocumented) + aggFilteredMetric: ReturnType; // Warning: (ae-forgotten-export) The symbol "aggFilters" needs to be exported by the entry point index.d.ts // // (undocumented) @@ -711,7 +715,7 @@ export const ES_SEARCH_STRATEGY = "es"; // Warning: (ae-missing-release-tag) "EsaggsExpressionFunctionDefinition" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export type EsaggsExpressionFunctionDefinition = ExpressionFunctionDefinition<'esaggs', Input_34, Arguments_20, Output_34>; +export type EsaggsExpressionFunctionDefinition = ExpressionFunctionDefinition<'esaggs', Input_35, Arguments_21, Output_35>; // Warning: (ae-forgotten-export) The symbol "name" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "Input" needs to be exported by the entry point index.d.ts @@ -720,7 +724,7 @@ export type EsaggsExpressionFunctionDefinition = ExpressionFunctionDefinition<'e // Warning: (ae-missing-release-tag) "EsdslExpressionFunctionDefinition" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export type EsdslExpressionFunctionDefinition = ExpressionFunctionDefinition_2; +export type EsdslExpressionFunctionDefinition = ExpressionFunctionDefinition_2; // Warning: (ae-missing-release-tag) "esFilters" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -861,7 +865,7 @@ export type ExpressionFunctionKibana = ExpressionFunctionDefinition<'kibana', Ex // Warning: (ae-missing-release-tag) "ExpressionFunctionKibanaContext" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export type ExpressionFunctionKibanaContext = ExpressionFunctionDefinition<'kibana_context', KibanaContext | null, Arguments_21, Promise, ExecutionContext>; +export type ExpressionFunctionKibanaContext = ExpressionFunctionDefinition<'kibana_context', KibanaContext | null, Arguments_22, Promise, ExecutionContext>; // Warning: (ae-missing-release-tag) "ExpressionValueSearchContext" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -1830,6 +1834,8 @@ export enum METRIC_TYPES { // (undocumented) DERIVATIVE = "derivative", // (undocumented) + FILTERED_METRIC = "filtered_metric", + // (undocumented) GEO_BOUNDS = "geo_bounds", // (undocumented) GEO_CENTROID = "geo_centroid", @@ -2649,7 +2655,7 @@ export const UI_SETTINGS: { // src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts:65:5 - (ae-forgotten-export) The symbol "FormatFieldFn" needs to be exported by the entry point index.d.ts // src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts:138:7 - (ae-forgotten-export) The symbol "FieldAttrSet" needs to be exported by the entry point index.d.ts // src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts:169:7 - (ae-forgotten-export) The symbol "RuntimeField" needs to be exported by the entry point index.d.ts -// src/plugins/data/common/search/aggs/types.ts:139:51 - (ae-forgotten-export) The symbol "AggTypesRegistryStart" needs to be exported by the entry point index.d.ts +// src/plugins/data/common/search/aggs/types.ts:141:51 - (ae-forgotten-export) The symbol "AggTypesRegistryStart" needs to be exported by the entry point index.d.ts // src/plugins/data/public/field_formats/field_formats_service.ts:56:3 - (ae-forgotten-export) The symbol "FormatFactory" needs to be exported by the entry point index.d.ts // src/plugins/data/public/index.ts:56:23 - (ae-forgotten-export) The symbol "FILTERS" needs to be exported by the entry point index.d.ts // src/plugins/data/public/index.ts:56:23 - (ae-forgotten-export) The symbol "getDisplayValueFromFilter" needs to be exported by the entry point index.d.ts diff --git a/src/plugins/data/public/search/aggs/aggs_service.test.ts b/src/plugins/data/public/search/aggs/aggs_service.test.ts index 63c27eeaf0b11b..7e9170b98f1321 100644 --- a/src/plugins/data/public/search/aggs/aggs_service.test.ts +++ b/src/plugins/data/public/search/aggs/aggs_service.test.ts @@ -54,7 +54,7 @@ describe('AggsService - public', () => { service.setup(setupDeps); const start = service.start(startDeps); expect(start.types.getAll().buckets.length).toBe(11); - expect(start.types.getAll().metrics.length).toBe(21); + expect(start.types.getAll().metrics.length).toBe(22); }); test('registers custom agg types', () => { @@ -71,7 +71,7 @@ describe('AggsService - public', () => { const start = service.start(startDeps); expect(start.types.getAll().buckets.length).toBe(12); expect(start.types.getAll().buckets.some(({ name }) => name === 'foo')).toBe(true); - expect(start.types.getAll().metrics.length).toBe(22); + expect(start.types.getAll().metrics.length).toBe(23); expect(start.types.getAll().metrics.some(({ name }) => name === 'bar')).toBe(true); }); }); diff --git a/src/plugins/data/public/search/search_service.ts b/src/plugins/data/public/search/search_service.ts index 8eb73ba62244f3..94fa5b7230f69f 100644 --- a/src/plugins/data/public/search/search_service.ts +++ b/src/plugins/data/public/search/search_service.ts @@ -28,6 +28,12 @@ import { kibanaTimerangeFunction, luceneFunction, kqlFunction, + fieldFunction, + rangeFunction, + existsFilterFunction, + rangeFilterFunction, + kibanaFilterFunction, + phraseFilterFunction, } from '../../common/search'; import { getCallMsearch } from './legacy'; import { AggsService, AggsStartDependencies } from './aggs'; @@ -108,6 +114,12 @@ export class SearchService implements Plugin { expressions.registerFunction(luceneFunction); expressions.registerFunction(kqlFunction); expressions.registerFunction(kibanaTimerangeFunction); + expressions.registerFunction(fieldFunction); + expressions.registerFunction(rangeFunction); + expressions.registerFunction(kibanaFilterFunction); + expressions.registerFunction(existsFilterFunction); + expressions.registerFunction(rangeFilterFunction); + expressions.registerFunction(phraseFilterFunction); expressions.registerType(kibanaContext); expressions.registerFunction(esdsl); diff --git a/src/plugins/data/public/ui/query_string_input/query_string_input.test.tsx b/src/plugins/data/public/ui/query_string_input/query_string_input.test.tsx index 45d7c0a2be6655..c9530ad3f51951 100644 --- a/src/plugins/data/public/ui/query_string_input/query_string_input.test.tsx +++ b/src/plugins/data/public/ui/query_string_input/query_string_input.test.tsx @@ -366,4 +366,26 @@ describe('QueryStringInput', () => { ); expect(mockFetchIndexPatterns.mock.calls[0][1]).toStrictEqual(patternStrings); }); + + it('Should convert non-breaking spaces into regular spaces', () => { + const mockCallback = jest.fn(); + + const component = mount( + wrapQueryStringInputInContext({ + query: kqlQuery, + onChange: mockCallback, + indexPatterns: [stubIndexPatternWithFields], + disableAutoFocus: true, + }) + ); + + const instance = component.find('QueryStringInputUI').instance() as QueryStringInputUI; + const input = instance.inputRef; + const inputWrapper = component.find(EuiTextArea).find('textarea'); + input!.value = 'foo\u00A0bar'; + inputWrapper.simulate('change'); + + expect(mockCallback).toHaveBeenCalledTimes(1); + expect(mockCallback).toHaveBeenCalledWith({ query: 'foo bar', language: 'kuery' }); + }); }); diff --git a/src/plugins/data/public/ui/query_string_input/query_string_input.tsx b/src/plugins/data/public/ui/query_string_input/query_string_input.tsx index 5e34c401c76154..71ff09e81c567b 100644 --- a/src/plugins/data/public/ui/query_string_input/query_string_input.tsx +++ b/src/plugins/data/public/ui/query_string_input/query_string_input.tsx @@ -264,7 +264,8 @@ export default class QueryStringInputUI extends Component { }; private onInputChange = (event: React.ChangeEvent) => { - this.onQueryStringChange(event.target.value); + const value = this.formatTextAreaValue(event.target.value); + this.onQueryStringChange(value); if (event.target.value === '') { this.handleRemoveHeight(); } else { @@ -274,7 +275,8 @@ export default class QueryStringInputUI extends Component { private onClickInput = (event: React.MouseEvent) => { if (event.target instanceof HTMLTextAreaElement) { - this.onQueryStringChange(event.target.value); + const value = this.formatTextAreaValue(event.target.value); + this.onQueryStringChange(value); } }; @@ -282,7 +284,8 @@ export default class QueryStringInputUI extends Component { if ([KEY_CODES.LEFT, KEY_CODES.RIGHT, KEY_CODES.HOME, KEY_CODES.END].includes(event.keyCode)) { this.setState({ isSuggestionsVisible: true }); if (event.target instanceof HTMLTextAreaElement) { - this.onQueryStringChange(event.target.value); + const value = this.formatTextAreaValue(event.target.value); + this.onQueryStringChange(value); } } }; @@ -698,7 +701,7 @@ export default class QueryStringInputUI extends Component { defaultMessage: 'Search', }) } - value={this.getQueryString()} + value={this.forwardNewValueIfNeeded(this.getQueryString())} onKeyDown={this.onKeyDown} onKeyUp={this.onKeyUp} onChange={this.onInputChange} @@ -734,7 +737,7 @@ export default class QueryStringInputUI extends Component { data-test-subj={this.props.dataTestSubj || 'queryInput'} isInvalid={this.props.isInvalid} > - {this.getQueryString()} + {this.forwardNewValueIfNeeded(this.getQueryString())} {this.props.iconType ? (
@@ -788,4 +791,34 @@ export default class QueryStringInputUI extends Component {
); } + + /** + * Used to apply any string formatting to textarea value before converting it to {@link Query} and emitting it to the parent. + * This is a bit lower level then {@link fromUser} and needed to address any cross-browser inconsistencies where + * {@link forwardNewValueIfNeeded} should be kept in mind + */ + private formatTextAreaValue(newValue: string): string { + // Safari has a bug that it sometimes uses a non-breaking space instead of a regular space + // this breaks the search query: https://github.com/elastic/kibana/issues/87176 + return newValue.replace(/\u00A0/g, ' '); + } + + /** + * When passing a "value" prop into a textarea, + * check first if value has changed because of {@link formatTextAreaValue}, + * if this is just a formatting change, then skip this update by re-using current textarea value. + * This is needed to avoid re-rendering to preserve focus and selection + * @private + */ + private forwardNewValueIfNeeded(newQueryString: string) { + const oldQueryString = this.inputRef?.value ?? ''; + + const formattedNewQueryString = this.formatTextAreaValue(newQueryString); + // if old & new values are equal with formatting applied, then return an old query without formatting applied + if (formattedNewQueryString === this.formatTextAreaValue(oldQueryString)) { + return oldQueryString; + } else { + return formattedNewQueryString; + } + } } diff --git a/src/plugins/data/server/autocomplete/routes.ts b/src/plugins/data/server/autocomplete/routes.ts index fc6bb0b69c1021..c453094ff68749 100644 --- a/src/plugins/data/server/autocomplete/routes.ts +++ b/src/plugins/data/server/autocomplete/routes.ts @@ -9,10 +9,9 @@ import { Observable } from 'rxjs'; import { CoreSetup, SharedGlobalConfig } from 'kibana/server'; import { registerValueSuggestionsRoute } from './value_suggestions_route'; -import { DataRequestHandlerContext } from '../types'; export function registerRoutes({ http }: CoreSetup, config$: Observable): void { - const router = http.createRouter(); + const router = http.createRouter(); registerValueSuggestionsRoute(router, config$); } diff --git a/src/plugins/data/server/autocomplete/value_suggestions_route.ts b/src/plugins/data/server/autocomplete/value_suggestions_route.ts index 8e6d3afa18ed5f..489a23eb83897c 100644 --- a/src/plugins/data/server/autocomplete/value_suggestions_route.ts +++ b/src/plugins/data/server/autocomplete/value_suggestions_route.ts @@ -12,12 +12,12 @@ import { IRouter, SharedGlobalConfig } from 'kibana/server'; import { Observable } from 'rxjs'; import { first } from 'rxjs/operators'; -import { IFieldType, Filter, ES_SEARCH_STRATEGY, IEsSearchRequest } from '../index'; +import { IFieldType, Filter } from '../index'; +import { findIndexPatternById, getFieldByName } from '../index_patterns'; import { getRequestAbortedSignal } from '../lib'; -import { DataRequestHandlerContext } from '../types'; export function registerValueSuggestionsRoute( - router: IRouter, + router: IRouter, config$: Observable ) { router.post( @@ -44,40 +44,24 @@ export function registerValueSuggestionsRoute( const config = await config$.pipe(first()).toPromise(); const { field: fieldName, query, filters } = request.body; const { index } = request.params; + const { client } = context.core.elasticsearch.legacy; const signal = getRequestAbortedSignal(request.events.aborted$); - if (!context.indexPatterns) { - return response.badRequest(); - } - const autocompleteSearchOptions = { timeout: `${config.kibana.autocompleteTimeout.asMilliseconds()}ms`, terminate_after: config.kibana.autocompleteTerminateAfter.asMilliseconds(), }; - const indexPatterns = await context.indexPatterns.find(index, 1); - if (!indexPatterns || indexPatterns.length === 0) { - return response.notFound(); - } - const field = indexPatterns[0].getFieldByName(fieldName); + const indexPattern = await findIndexPatternById(context.core.savedObjects.client, index); + + const field = indexPattern && getFieldByName(fieldName, indexPattern); const body = await getBody(autocompleteSearchOptions, field || fieldName, query, filters); - const searchRequest: IEsSearchRequest = { - params: { - index, - body, - }, - }; - const { rawResponse } = await context.search - .search(searchRequest, { - strategy: ES_SEARCH_STRATEGY, - abortSignal: signal, - }) - .toPromise(); + const result = await client.callAsCurrentUser('search', { index, body }, { signal }); const buckets: any[] = - get(rawResponse, 'aggregations.suggestions.buckets') || - get(rawResponse, 'aggregations.nestedSuggestions.suggestions.buckets'); + get(result, 'aggregations.suggestions.buckets') || + get(result, 'aggregations.nestedSuggestions.suggestions.buckets'); return response.ok({ body: map(buckets || [], 'key') }); } diff --git a/src/plugins/data/server/index.ts b/src/plugins/data/server/index.ts index c153c0efa88921..cbf09ef57d96ae 100644 --- a/src/plugins/data/server/index.ts +++ b/src/plugins/data/server/index.ts @@ -236,10 +236,10 @@ export { SearchUsage, SearchSessionService, ISearchSessionService, + SearchRequestHandlerContext, + DataRequestHandlerContext, } from './search'; -export { DataRequestHandlerContext } from './types'; - // Search namespace export const search = { aggs: { diff --git a/src/plugins/data/server/index_patterns/index.ts b/src/plugins/data/server/index_patterns/index.ts index 85610cd85a3cef..7226d6f015cf88 100644 --- a/src/plugins/data/server/index_patterns/index.ts +++ b/src/plugins/data/server/index_patterns/index.ts @@ -6,8 +6,6 @@ * Side Public License, v 1. */ -import { IndexPatternsService } from '../../common/index_patterns'; - export * from './utils'; export { IndexPatternsFetcher, @@ -17,5 +15,3 @@ export { getCapabilitiesForRollupIndices, } from './fetcher'; export { IndexPatternsServiceProvider, IndexPatternsServiceStart } from './index_patterns_service'; - -export type IndexPatternsHandlerContext = IndexPatternsService; diff --git a/src/plugins/data/server/index_patterns/index_patterns_service.ts b/src/plugins/data/server/index_patterns/index_patterns_service.ts index b489c29bc3b707..5d703021b94da9 100644 --- a/src/plugins/data/server/index_patterns/index_patterns_service.ts +++ b/src/plugins/data/server/index_patterns/index_patterns_service.ts @@ -25,7 +25,6 @@ import { getIndexPatternLoad } from './expressions'; import { UiSettingsServerToCommon } from './ui_settings_wrapper'; import { IndexPatternsApiServer } from './index_patterns_api_client'; import { SavedObjectsClientServerToCommon } from './saved_objects_client_wrapper'; -import { DataRequestHandlerContext } from '../types'; export interface IndexPatternsServiceStart { indexPatternsServiceFactory: ( @@ -36,7 +35,6 @@ export interface IndexPatternsServiceStart { export interface IndexPatternsServiceSetupDeps { expressions: ExpressionsServerSetup; - logger: Logger; } export interface IndexPatternsServiceStartDeps { @@ -47,27 +45,11 @@ export interface IndexPatternsServiceStartDeps { export class IndexPatternsServiceProvider implements Plugin { public setup( core: CoreSetup, - { logger, expressions }: IndexPatternsServiceSetupDeps + { expressions }: IndexPatternsServiceSetupDeps ) { core.savedObjects.registerType(indexPatternSavedObjectType); core.capabilities.registerProvider(capabilitiesProvider); - core.http.registerRouteHandlerContext( - 'indexPatterns', - async (context, request) => { - const [coreStart, , dataStart] = await core.getStartServices(); - try { - return await dataStart.indexPatterns.indexPatternsServiceFactory( - coreStart.savedObjects.getScopedClient(request), - coreStart.elasticsearch.client.asScoped(request).asCurrentUser - ); - } catch (e) { - logger.error(e); - return undefined; - } - } - ); - registerRoutes(core.http, core.getStartServices); expressions.registerFunction(getIndexPatternLoad({ getStartServices: core.getStartServices })); diff --git a/src/plugins/data/server/mocks.ts b/src/plugins/data/server/mocks.ts index c82db7a141403f..786dd30dbabd0b 100644 --- a/src/plugins/data/server/mocks.ts +++ b/src/plugins/data/server/mocks.ts @@ -13,7 +13,7 @@ import { } from './search/mocks'; import { createFieldFormatsSetupMock, createFieldFormatsStartMock } from './field_formats/mocks'; import { createIndexPatternsStartMock } from './index_patterns/mocks'; -import { DataRequestHandlerContext } from './types'; +import { DataRequestHandlerContext } from './search'; function createSetupContract() { return { diff --git a/src/plugins/data/server/plugin.ts b/src/plugins/data/server/plugin.ts index 3408c39cbb8e2d..a7a7663d6981c4 100644 --- a/src/plugins/data/server/plugin.ts +++ b/src/plugins/data/server/plugin.ts @@ -82,10 +82,7 @@ export class DataServerPlugin this.queryService.setup(core); this.autocompleteService.setup(core); this.kqlTelemetryService.setup(core, { usageCollection }); - this.indexPatterns.setup(core, { - expressions, - logger: this.logger.get('indexPatterns'), - }); + this.indexPatterns.setup(core, { expressions }); core.uiSettings.register(getUiSettings()); diff --git a/src/plugins/data/server/search/routes/msearch.ts b/src/plugins/data/server/search/routes/msearch.ts index b5f06c4b343e78..b578805d8c2dfd 100644 --- a/src/plugins/data/server/search/routes/msearch.ts +++ b/src/plugins/data/server/search/routes/msearch.ts @@ -12,7 +12,7 @@ import { SearchRouteDependencies } from '../search_service'; import { getCallMsearch } from './call_msearch'; import { reportServerError } from '../../../../kibana_utils/server'; -import type { DataPluginRouter } from '../../types'; +import type { DataPluginRouter } from '../types'; /** * The msearch route takes in an array of searches, each consisting of header * and body json, and reformts them into a single request for the _msearch API. diff --git a/src/plugins/data/server/search/routes/search.ts b/src/plugins/data/server/search/routes/search.ts index 6690e2b81f3e4a..1680a9c4a72371 100644 --- a/src/plugins/data/server/search/routes/search.ts +++ b/src/plugins/data/server/search/routes/search.ts @@ -10,7 +10,7 @@ import { first } from 'rxjs/operators'; import { schema } from '@kbn/config-schema'; import { getRequestAbortedSignal } from '../../lib'; import { reportServerError } from '../../../../kibana_utils/server'; -import type { DataPluginRouter } from '../../types'; +import type { DataPluginRouter } from '../types'; export function registerSearchRoute(router: DataPluginRouter): void { router.post( diff --git a/src/plugins/data/server/search/search_service.ts b/src/plugins/data/server/search/search_service.ts index ab9fc84d511879..4dcab4eda34d1d 100644 --- a/src/plugins/data/server/search/search_service.ts +++ b/src/plugins/data/server/search/search_service.ts @@ -29,6 +29,7 @@ import type { ISearchStrategy, SearchEnhancements, SearchStrategyDependencies, + DataRequestHandlerContext, } from './types'; import { AggsService } from './aggs'; @@ -43,6 +44,8 @@ import { registerUsageCollector } from './collectors/register'; import { usageProvider } from './collectors/usage'; import { searchTelemetry } from '../saved_objects'; import { + existsFilterFunction, + fieldFunction, IEsSearchRequest, IEsSearchResponse, IKibanaSearchRequest, @@ -52,11 +55,15 @@ import { kibanaContext, kibanaContextFunction, kibanaTimerangeFunction, + kibanaFilterFunction, kqlFunction, luceneFunction, + rangeFilterFunction, + rangeFunction, SearchSourceDependencies, searchSourceRequiredUiSettings, SearchSourceService, + phraseFilterFunction, } from '../../common/search'; import { getEsaggs } from './expressions'; import { @@ -68,7 +75,6 @@ import { ConfigSchema } from '../../config'; import { ISearchSessionService, SearchSessionService } from './session'; import { KbnServerError } from '../../../kibana_utils/server'; import { registerBsearchRoute } from './routes/bsearch'; -import { DataRequestHandlerContext } from '../types'; type StrategyMap = Record>; @@ -149,6 +155,12 @@ export class SearchService implements Plugin { expressions.registerFunction(kqlFunction); expressions.registerFunction(kibanaTimerangeFunction); expressions.registerFunction(kibanaContextFunction); + expressions.registerFunction(fieldFunction); + expressions.registerFunction(rangeFunction); + expressions.registerFunction(kibanaFilterFunction); + expressions.registerFunction(existsFilterFunction); + expressions.registerFunction(rangeFilterFunction); + expressions.registerFunction(phraseFilterFunction); expressions.registerType(kibanaContext); const aggs = this.aggsService.setup({ registerFunction: expressions.registerFunction }); diff --git a/src/plugins/data/server/search/types.ts b/src/plugins/data/server/search/types.ts index d7aadcc348c87d..e8548257c01679 100644 --- a/src/plugins/data/server/search/types.ts +++ b/src/plugins/data/server/search/types.ts @@ -8,10 +8,12 @@ import { Observable } from 'rxjs'; import type { + IRouter, IScopedClusterClient, IUiSettingsClient, SavedObjectsClientContract, KibanaRequest, + RequestHandlerContext, } from 'src/core/server'; import { ISearchOptions, @@ -114,3 +116,12 @@ export interface ISearchStart< } export type SearchRequestHandlerContext = IScopedSearchClient; + +/** + * @internal + */ +export interface DataRequestHandlerContext extends RequestHandlerContext { + search: SearchRequestHandlerContext; +} + +export type DataPluginRouter = IRouter; diff --git a/src/plugins/data/server/server.api.md b/src/plugins/data/server/server.api.md index 9ddd4d9b823a1a..e04fcdfa08f363 100644 --- a/src/plugins/data/server/server.api.md +++ b/src/plugins/data/server/server.api.md @@ -134,6 +134,10 @@ export interface AggFunctionsMapping { // // (undocumented) aggFilter: ReturnType; + // Warning: (ae-forgotten-export) The symbol "aggFilteredMetric" needs to be exported by the entry point index.d.ts + // + // (undocumented) + aggFilteredMetric: ReturnType; // Warning: (ae-forgotten-export) The symbol "aggFilters" needs to be exported by the entry point index.d.ts // // (undocumented) @@ -312,12 +316,6 @@ export const config: PluginConfigDescriptor; // @internal (undocumented) export interface DataRequestHandlerContext extends RequestHandlerContext { - // Warning: (ae-forgotten-export) The symbol "IndexPatternsHandlerContext" needs to be exported by the entry point index.d.ts - // - // (undocumented) - indexPatterns?: IndexPatternsHandlerContext; - // Warning: (ae-forgotten-export) The symbol "SearchRequestHandlerContext" needs to be exported by the entry point index.d.ts - // // (undocumented) search: SearchRequestHandlerContext; } @@ -405,7 +403,7 @@ export const ES_SEARCH_STRATEGY = "es"; // Warning: (ae-missing-release-tag) "EsaggsExpressionFunctionDefinition" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export type EsaggsExpressionFunctionDefinition = ExpressionFunctionDefinition<'esaggs', Input_34, Arguments_20, Output_34>; +export type EsaggsExpressionFunctionDefinition = ExpressionFunctionDefinition<'esaggs', Input_35, Arguments_21, Output_35>; // Warning: (ae-missing-release-tag) "esFilters" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -485,7 +483,7 @@ export type ExpressionFunctionKibana = ExpressionFunctionDefinition<'kibana', Ex // Warning: (ae-missing-release-tag) "ExpressionFunctionKibanaContext" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export type ExpressionFunctionKibanaContext = ExpressionFunctionDefinition<'kibana_context', KibanaContext | null, Arguments_21, Promise, ExecutionContext>; +export type ExpressionFunctionKibanaContext = ExpressionFunctionDefinition<'kibana_context', KibanaContext | null, Arguments_22, Promise, ExecutionContext>; // Warning: (ae-missing-release-tag) "ExpressionValueSearchContext" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -960,7 +958,7 @@ export class IndexPatternsServiceProvider implements Plugin_3, { logger, expressions }: IndexPatternsServiceSetupDeps): void; + setup(core: CoreSetup_2, { expressions }: IndexPatternsServiceSetupDeps): void; // Warning: (ae-forgotten-export) The symbol "IndexPatternsServiceStartDeps" needs to be exported by the entry point index.d.ts // // (undocumented) @@ -1141,6 +1139,8 @@ export enum METRIC_TYPES { // (undocumented) DERIVATIVE = "derivative", // (undocumented) + FILTERED_METRIC = "filtered_metric", + // (undocumented) GEO_BOUNDS = "geo_bounds", // (undocumented) GEO_CENTROID = "geo_centroid", @@ -1325,6 +1325,11 @@ export const search: { tabifyGetColumns: typeof tabifyGetColumns; }; +// Warning: (ae-missing-release-tag) "SearchRequestHandlerContext" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type SearchRequestHandlerContext = IScopedSearchClient; + // @internal export class SearchSessionService implements ISearchSessionService { constructor(); @@ -1516,7 +1521,7 @@ export function usageProvider(core: CoreSetup_2): SearchUsage; // src/plugins/data/server/index.ts:270:1 - (ae-forgotten-export) The symbol "toAbsoluteDates" needs to be exported by the entry point index.d.ts // src/plugins/data/server/index.ts:271:1 - (ae-forgotten-export) The symbol "calcAutoIntervalLessThan" needs to be exported by the entry point index.d.ts // src/plugins/data/server/plugin.ts:79:74 - (ae-forgotten-export) The symbol "DataEnhancements" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/search/types.ts:112:5 - (ae-forgotten-export) The symbol "ISearchStartSearchSource" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/search/types.ts:114:5 - (ae-forgotten-export) The symbol "ISearchStartSearchSource" needs to be exported by the entry point index.d.ts // (No @packageDocumentation comment for this package) diff --git a/src/plugins/data/server/types.ts b/src/plugins/data/server/types.ts deleted file mode 100644 index ea0fa49058d374..00000000000000 --- a/src/plugins/data/server/types.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import type { IRouter, RequestHandlerContext } from 'src/core/server'; - -import { SearchRequestHandlerContext } from './search'; -import { IndexPatternsHandlerContext } from './index_patterns'; - -/** - * @internal - */ -export interface DataRequestHandlerContext extends RequestHandlerContext { - search: SearchRequestHandlerContext; - indexPatterns?: IndexPatternsHandlerContext; -} - -export type DataPluginRouter = IRouter; diff --git a/src/plugins/discover/public/application/components/create_discover_grid_directive.tsx b/src/plugins/discover/public/application/components/create_discover_grid_directive.tsx index 0d17fcbba9c238..d55e46574e1a7a 100644 --- a/src/plugins/discover/public/application/components/create_discover_grid_directive.tsx +++ b/src/plugins/discover/public/application/components/create_discover_grid_directive.tsx @@ -5,7 +5,6 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - import React, { useState } from 'react'; import { I18nProvider } from '@kbn/i18n/react'; import { DiscoverGrid, DiscoverGridProps } from './discover_grid/discover_grid'; @@ -38,6 +37,7 @@ export function createDiscoverGridDirective(reactDirective: any) { return reactDirective(DiscoverGridEmbeddable, [ ['columns', { watchDepth: 'collection' }], ['indexPattern', { watchDepth: 'reference' }], + ['isLoading', { watchDepth: 'reference' }], ['onAddColumn', { watchDepth: 'reference', wrapApply: false }], ['onFilter', { watchDepth: 'reference', wrapApply: false }], ['onRemoveColumn', { watchDepth: 'reference', wrapApply: false }], diff --git a/src/plugins/discover/public/application/components/discover.test.tsx b/src/plugins/discover/public/application/components/discover.test.tsx index 00554196e11fd2..d804d608704219 100644 --- a/src/plugins/discover/public/application/components/discover.test.tsx +++ b/src/plugins/discover/public/application/components/discover.test.tsx @@ -62,6 +62,7 @@ function getProps(indexPattern: IndexPattern): DiscoverProps { fetch: jest.fn(), fetchCounter: 0, fetchError: undefined, + fetchStatus: 'loading', fieldCounts: calcFieldCounts({}, esHits, indexPattern), hits: esHits.length, indexPattern, diff --git a/src/plugins/discover/public/application/components/discover.tsx b/src/plugins/discover/public/application/components/discover.tsx index 1c4a5be2f2b244..056581e30b4d6f 100644 --- a/src/plugins/discover/public/application/components/discover.tsx +++ b/src/plugins/discover/public/application/components/discover.tsx @@ -53,6 +53,7 @@ export function Discover({ fetchCounter, fetchError, fieldCounts, + fetchStatus, histogramData, hits, indexPattern, @@ -393,6 +394,7 @@ export function Discover({ columns={columns} expandedDoc={expandedDoc} indexPattern={indexPattern} + isLoading={fetchStatus === 'loading'} rows={rows} sort={(state.sort as SortPairArr[]) || []} sampleSize={opts.sampleSize} diff --git a/src/plugins/discover/public/application/components/discover_grid/discover_grid.scss b/src/plugins/discover/public/application/components/discover_grid/discover_grid.scss index 4754c1700f28de..5bb6c01da5ad63 100644 --- a/src/plugins/discover/public/application/components/discover_grid/discover_grid.scss +++ b/src/plugins/discover/public/application/components/discover_grid/discover_grid.scss @@ -40,6 +40,10 @@ white-space: nowrap; } +.dscTable__flyoutDocumentNavigation { + justify-content: flex-end; +} + // We only truncate if the cell is not a control column. .euiDataGridHeader { .euiDataGridHeaderCell__content { @@ -78,3 +82,10 @@ .dscDiscoverGrid__descriptionListDescription { word-break: normal !important; } + +@include euiBreakpoint('xs', 's', 'm') { + // EUI issue to hide 'of' text https://github.com/elastic/eui/issues/4654 + .dscTable__flyoutDocumentNavigation .euiPagination__compressedText { + display: none; + } +} diff --git a/src/plugins/discover/public/application/components/discover_grid/discover_grid.tsx b/src/plugins/discover/public/application/components/discover_grid/discover_grid.tsx index 380b4dc5e8e9a0..1888ae8562a37f 100644 --- a/src/plugins/discover/public/application/components/discover_grid/discover_grid.tsx +++ b/src/plugins/discover/public/application/components/discover_grid/discover_grid.tsx @@ -60,6 +60,10 @@ export interface DiscoverGridProps { * The used index pattern */ indexPattern: IndexPattern; + /** + * Determines if data is currently loaded + */ + isLoading: boolean; /** * Function used to add a column in the document flyout */ @@ -135,6 +139,7 @@ export const DiscoverGrid = ({ ariaLabelledBy, columns, indexPattern, + isLoading, expandedDoc, onAddColumn, onFilter, @@ -258,7 +263,13 @@ export const DiscoverGrid = ({ isDarkMode: services.uiSettings.get('theme:darkMode'), }} > - <> + setExpandedDoc(undefined)} + setExpandedDoc={setExpandedDoc} services={services} /> )} - + ); }; diff --git a/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.test.tsx b/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.test.tsx index b63aca85b1ec9b..54620dff1f63f0 100644 --- a/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.test.tsx +++ b/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.test.tsx @@ -21,51 +21,41 @@ import { indexPatternWithTimefieldMock } from '../../../__mocks__/index_pattern_ describe('Discover flyout', function () { setDocViewsRegistry(new DocViewsRegistry()); - it('should be rendered correctly using an index pattern without timefield', async () => { + const getProps = () => { const onClose = jest.fn(); - const component = mountWithIntl( - path, - } as unknown) as DiscoverServices - } - /> - ); + const services = ({ + filterManager: createFilterManagerMock(), + addBasePath: (path: string) => `/base${path}`, + } as unknown) as DiscoverServices; + + return { + columns: ['date'], + indexPattern: indexPatternMock, + hit: esHits[0], + hits: esHits, + onAddColumn: jest.fn(), + onClose, + onFilter: jest.fn(), + onRemoveColumn: jest.fn(), + services, + setExpandedDoc: jest.fn(), + }; + }; + + it('should be rendered correctly using an index pattern without timefield', async () => { + const props = getProps(); + const component = mountWithIntl(); const url = findTestSubject(component, 'docTableRowAction').prop('href'); - expect(url).toMatchInlineSnapshot(`"#/doc/the-index-pattern-id/i?id=1"`); + expect(url).toMatchInlineSnapshot(`"/base#/doc/the-index-pattern-id/i?id=1"`); findTestSubject(component, 'euiFlyoutCloseButton').simulate('click'); - expect(onClose).toHaveBeenCalled(); + expect(props.onClose).toHaveBeenCalled(); }); it('should be rendered correctly using an index pattern with timefield', async () => { - const onClose = jest.fn(); - const component = mountWithIntl( - `/base${path}`, - } as unknown) as DiscoverServices - } - /> - ); + const props = getProps(); + props.indexPattern = indexPatternWithTimefieldMock; + const component = mountWithIntl(); const actions = findTestSubject(component, 'docTableRowAction'); expect(actions.length).toBe(2); @@ -76,6 +66,81 @@ describe('Discover flyout', function () { `"/base/app/discover#/context/index-pattern-with-timefield-id/1?_g=(filters:!())&_a=(columns:!(date),filters:!())"` ); findTestSubject(component, 'euiFlyoutCloseButton').simulate('click'); - expect(onClose).toHaveBeenCalled(); + expect(props.onClose).toHaveBeenCalled(); + }); + + it('displays document navigation when there is more than 1 doc available', async () => { + const props = getProps(); + const component = mountWithIntl(); + const docNav = findTestSubject(component, 'dscDocNavigation'); + expect(docNav.length).toBeTruthy(); + }); + + it('displays no document navigation when there are 0 docs available', async () => { + const props = getProps(); + props.hits = []; + const component = mountWithIntl(); + const docNav = findTestSubject(component, 'dscDocNavigation'); + expect(docNav.length).toBeFalsy(); + }); + + it('displays no document navigation when the expanded doc is not part of the given docs', async () => { + // scenario: you've expanded a doc, and in the next request differed docs where fetched + const props = getProps(); + props.hits = [ + { + _index: 'new', + _id: '1', + _score: 1, + _type: '_doc', + _source: { date: '2020-20-01T12:12:12.123', message: 'test1', bytes: 20 }, + }, + { + _index: 'new', + _id: '2', + _score: 1, + _type: '_doc', + _source: { date: '2020-20-01T12:12:12.124', name: 'test2', extension: 'jpg' }, + }, + ]; + const component = mountWithIntl(); + const docNav = findTestSubject(component, 'dscDocNavigation'); + expect(docNav.length).toBeFalsy(); + }); + + it('allows you to navigate to the next doc, if expanded doc is the first', async () => { + // scenario: you've expanded a doc, and in the next request different docs where fetched + const props = getProps(); + const component = mountWithIntl(); + findTestSubject(component, 'pagination-button-next').simulate('click'); + // we selected 1, so we'd expect 2 + expect(props.setExpandedDoc.mock.calls[0][0]._id).toBe('2'); + }); + + it('doesnt allow you to navigate to the previous doc, if expanded doc is the first', async () => { + // scenario: you've expanded a doc, and in the next request differed docs where fetched + const props = getProps(); + const component = mountWithIntl(); + findTestSubject(component, 'pagination-button-previous').simulate('click'); + expect(props.setExpandedDoc).toHaveBeenCalledTimes(0); + }); + + it('doesnt allow you to navigate to the next doc, if expanded doc is the last', async () => { + // scenario: you've expanded a doc, and in the next request differed docs where fetched + const props = getProps(); + props.hit = props.hits[props.hits.length - 1]; + const component = mountWithIntl(); + findTestSubject(component, 'pagination-button-next').simulate('click'); + expect(props.setExpandedDoc).toHaveBeenCalledTimes(0); + }); + + it('allows you to navigate to the previous doc, if expanded doc is the last', async () => { + // scenario: you've expanded a doc, and in the next request differed docs where fetched + const props = getProps(); + props.hit = props.hits[props.hits.length - 1]; + const component = mountWithIntl(); + findTestSubject(component, 'pagination-button-previous').simulate('click'); + expect(props.setExpandedDoc).toHaveBeenCalledTimes(1); + expect(props.setExpandedDoc.mock.calls[0][0]._id).toBe('4'); }); }); diff --git a/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx b/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx index 5994892ca2d40a..87b9c6243abd84 100644 --- a/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx +++ b/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import React from 'react'; +import React, { useMemo, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiFlexGroup, @@ -19,6 +19,8 @@ import { EuiText, EuiSpacer, EuiPortal, + EuiPagination, + EuiHideFor, } from '@elastic/eui'; import { DocViewer } from '../doc_viewer/doc_viewer'; import { IndexPattern } from '../../../kibana_services'; @@ -29,19 +31,34 @@ import { getContextUrl } from '../../helpers/get_context_url'; interface Props { columns: string[]; hit: ElasticSearchHit; + hits?: ElasticSearchHit[]; indexPattern: IndexPattern; onAddColumn: (column: string) => void; onClose: () => void; onFilter: DocViewFilterFn; onRemoveColumn: (column: string) => void; services: DiscoverServices; + setExpandedDoc: (doc: ElasticSearchHit) => void; } +type ElasticSearchHitWithRouting = ElasticSearchHit & { _routing?: string }; + +function getDocFingerprintId(doc: ElasticSearchHitWithRouting) { + const routing = doc._routing || ''; + return [doc._index, doc._id, routing].join('||'); +} + +function getIndexByDocId(hits: ElasticSearchHit[], id: string) { + return hits.findIndex((h) => { + return getDocFingerprintId(h) === id; + }); +} /** * Flyout displaying an expanded Elasticsearch document */ export function DiscoverGridFlyout({ hit, + hits, indexPattern, columns, onFilter, @@ -49,7 +66,27 @@ export function DiscoverGridFlyout({ onRemoveColumn, onAddColumn, services, + setExpandedDoc, }: Props) { + const pageCount = useMemo(() => (hits ? hits.length : 0), [hits]); + const activePage = useMemo(() => { + const id = getDocFingerprintId(hit); + if (!hits || pageCount <= 1) { + return -1; + } + + return getIndexByDocId(hits, id); + }, [hits, hit, pageCount]); + + const setPage = useCallback( + (pageIdx: number) => { + if (hits && hits[pageIdx]) { + setExpandedDoc(hits[pageIdx]); + } + }, + [hits, setExpandedDoc] + ); + return ( @@ -67,20 +104,23 @@ export function DiscoverGridFlyout({ - - - - - {i18n.translate('discover.grid.tableRow.viewText', { - defaultMessage: 'View:', - })} - - - + + + + + + {i18n.translate('discover.grid.tableRow.viewText', { + defaultMessage: 'View:', + })} + + + + )} + {activePage !== -1 && ( + + + + )} diff --git a/src/plugins/discover/public/application/components/doc_viewer/doc_viewer.scss b/src/plugins/discover/public/application/components/doc_viewer/doc_viewer.scss index 95a50b54b53648..f5a4180207c331 100644 --- a/src/plugins/discover/public/application/components/doc_viewer/doc_viewer.scss +++ b/src/plugins/discover/public/application/components/doc_viewer/doc_viewer.scss @@ -1,5 +1,5 @@ .kbnDocViewerTable { - @include euiBreakpoint('xs', 's') { + @include euiBreakpoint('xs', 's','m') { table-layout: fixed; } } @@ -52,7 +52,7 @@ white-space: nowrap; } .kbnDocViewer__buttons { - width: 96px; + width: 108px; // Show all icons if one is focused, &:focus-within { @@ -64,7 +64,7 @@ .kbnDocViewer__field { width: $euiSize * 10; - @include euiBreakpoint('xs', 's') { + @include euiBreakpoint('xs', 's', 'm') { width: $euiSize * 6; } } diff --git a/src/plugins/discover/public/application/components/table/table_row.tsx b/src/plugins/discover/public/application/components/table/table_row.tsx index 731dbeed85cc86..5c6ae49770bc70 100644 --- a/src/plugins/discover/public/application/components/table/table_row.tsx +++ b/src/plugins/discover/public/application/components/table/table_row.tsx @@ -54,6 +54,26 @@ export function DocViewTableRow({ const key = field ? field : fieldMapping?.displayName; return ( + {typeof onFilter === 'function' && ( + + onFilter(fieldMapping, valueRaw, '+')} + /> + onFilter(fieldMapping, valueRaw, '-')} + /> + {typeof onToggleColumn === 'function' && ( + + )} + onFilter('_exists_', field, '+')} + scripted={fieldMapping && fieldMapping.scripted} + /> + + )} {field ? ( - {typeof onFilter === 'function' && ( - - onFilter(fieldMapping, valueRaw, '+')} - /> - onFilter(fieldMapping, valueRaw, '-')} - /> - {typeof onToggleColumn === 'function' && ( - - )} - onFilter('_exists_', field, '+')} - scripted={fieldMapping && fieldMapping.scripted} - /> - - )} ); } diff --git a/src/plugins/discover/public/application/components/types.ts b/src/plugins/discover/public/application/components/types.ts index e488f596cece85..db1cd894224540 100644 --- a/src/plugins/discover/public/application/components/types.ts +++ b/src/plugins/discover/public/application/components/types.ts @@ -42,6 +42,10 @@ export interface DiscoverProps { * Statistics by fields calculated using the fetched documents */ fieldCounts: Record; + /** + * Current state of data fetching + */ + fetchStatus: string; /** * Histogram aggregation data */ diff --git a/src/plugins/discover/public/application/embeddable/search_embeddable.ts b/src/plugins/discover/public/application/embeddable/search_embeddable.ts index 1bf4cdc947be93..829d23fa071fb4 100644 --- a/src/plugins/discover/public/application/embeddable/search_embeddable.ts +++ b/src/plugins/discover/public/application/embeddable/search_embeddable.ts @@ -168,7 +168,7 @@ export class SearchEmbeddable throw new Error('Search scope not defined'); } this.searchInstance = this.$compile( - this.services.uiSettings.get('doc_table:legacy', true) ? searchTemplate : searchTemplateGrid + this.services.uiSettings.get('doc_table:legacy') ? searchTemplate : searchTemplateGrid )(this.searchScope); const rootNode = angular.element(domNode); rootNode.append(this.searchInstance); @@ -226,6 +226,8 @@ export class SearchEmbeddable this.updateInput({ sort }); }; + searchScope.isLoading = true; + const useNewFieldsApi = !getServices().uiSettings.get(SEARCH_FIELDS_FROM_SOURCE, false); searchScope.useNewFieldsApi = useNewFieldsApi; @@ -336,6 +338,9 @@ export class SearchEmbeddable searchSource.getSearchRequestBody().then((body: Record) => { inspectorRequest.json(body); }); + this.searchScope.$apply(() => { + this.searchScope!.isLoading = true; + }); this.updateOutput({ loading: true, error: undefined }); try { @@ -353,9 +358,13 @@ export class SearchEmbeddable this.searchScope.$apply(() => { this.searchScope!.hits = resp.hits.hits; this.searchScope!.totalHitCount = resp.hits.total; + this.searchScope!.isLoading = false; }); } catch (error) { this.updateOutput({ loading: false, error }); + this.searchScope.$apply(() => { + this.searchScope!.isLoading = false; + }); } }; diff --git a/src/plugins/discover/public/application/embeddable/search_template_datagrid.html b/src/plugins/discover/public/application/embeddable/search_template_datagrid.html index 6524783897f8f3..8ad7938350d9c5 100644 --- a/src/plugins/discover/public/application/embeddable/search_template_datagrid.html +++ b/src/plugins/discover/public/application/embeddable/search_template_datagrid.html @@ -1,16 +1,16 @@ { + it('should remove type property from a boxed value', () => { + const expressionValue = { type: 'something', value: 'something' }; + + expect(unboxExpressionValue(expressionValue)).toEqual({ value: 'something' }); + }); +}); diff --git a/src/plugins/telemetry_collection_manager/server/util.ts b/src/plugins/expressions/common/expression_types/unbox_expression_value.ts similarity index 65% rename from src/plugins/telemetry_collection_manager/server/util.ts rename to src/plugins/expressions/common/expression_types/unbox_expression_value.ts index 226d788e09e48a..bb41efdf15609f 100644 --- a/src/plugins/telemetry_collection_manager/server/util.ts +++ b/src/plugins/expressions/common/expression_types/unbox_expression_value.ts @@ -6,6 +6,11 @@ * Side Public License, v 1. */ -export const isClusterOptedIn = (clusterUsage: any): boolean => { - return clusterUsage?.stack_stats?.kibana?.plugins?.telemetry?.opt_in_status === true; -}; +import { ExpressionValueBoxed } from './types'; + +export function unboxExpressionValue({ + type, + ...value +}: ExpressionValueBoxed): T { + return value as T; +} diff --git a/src/plugins/expressions/common/util/index.ts b/src/plugins/expressions/common/util/index.ts index 5f83d962d5aea8..470dfc3c2d436b 100644 --- a/src/plugins/expressions/common/util/index.ts +++ b/src/plugins/expressions/common/util/index.ts @@ -10,3 +10,4 @@ export * from './create_error'; export * from './get_by_alias'; export * from './tables_adapter'; export * from './expressions_inspector_adapter'; +export * from './test_utils'; diff --git a/src/plugins/expressions/common/util/test_utils.ts b/src/plugins/expressions/common/util/test_utils.ts new file mode 100644 index 00000000000000..59bd0a4235d9b3 --- /dev/null +++ b/src/plugins/expressions/common/util/test_utils.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { ExecutionContext } from '../execution'; + +export const createMockContext = () => { + return { + getSearchContext: () => ({}), + getSearchSessionId: () => undefined, + types: {}, + variables: {}, + abortSignal: {} as any, + inspectorAdapters: {} as any, + } as ExecutionContext; +}; diff --git a/src/plugins/telemetry_collection_manager/server/encryption/encrypt.test.ts b/src/plugins/telemetry_collection_manager/server/encryption/encrypt.test.ts index c1a1a32e3c7f07..be990f4b89e04e 100644 --- a/src/plugins/telemetry_collection_manager/server/encryption/encrypt.test.ts +++ b/src/plugins/telemetry_collection_manager/server/encryption/encrypt.test.ts @@ -22,6 +22,11 @@ describe('getKID', () => { const kid = getKID(useProdKey); expect(kid).toBe('kibana1'); }); + + it(`should fallback to development`, async () => { + const kid = getKID(); + expect(kid).toBe('kibana_dev1'); + }); }); describe('encryptTelemetry', () => { @@ -46,4 +51,10 @@ describe('encryptTelemetry', () => { await encryptTelemetry(payload, { useProdKey: false }); expect(mockEncrypt).toBeCalledWith('kibana_dev1', payload); }); + + it('should fallback to { useProdKey: false }', async () => { + const payload = { some: 'value' }; + await encryptTelemetry(payload); + expect(mockEncrypt).toBeCalledWith('kibana_dev1', payload); + }); }); diff --git a/src/plugins/telemetry_collection_manager/server/plugin.test.ts b/src/plugins/telemetry_collection_manager/server/plugin.test.ts index ac3904ca58b0ff..d05799f82c3544 100644 --- a/src/plugins/telemetry_collection_manager/server/plugin.test.ts +++ b/src/plugins/telemetry_collection_manager/server/plugin.test.ts @@ -9,7 +9,7 @@ import { coreMock, httpServerMock } from '../../../core/server/mocks'; import { usageCollectionPluginMock } from '../../usage_collection/server/mocks'; import { TelemetryCollectionManagerPlugin } from './plugin'; -import { CollectionStrategyConfig, StatsGetterConfig } from './types'; +import type { BasicStatsPayload, CollectionStrategyConfig, StatsGetterConfig } from './types'; import { TelemetrySavedObjectsClient } from './telemetry_saved_objects_client'; function createCollectionStrategy(priority: number): jest.Mocked { @@ -87,6 +87,15 @@ describe('Telemetry Collection Manager', () => { }); describe(`after start`, () => { + const basicStats: BasicStatsPayload = { + cluster_uuid: 'clusterUuid', + cluster_name: 'clusterName', + timestamp: new Date().toISOString(), + cluster_stats: {}, + stack_stats: {}, + version: 'version', + }; + beforeAll(() => { telemetryCollectionManager.start(coreMock.createStart()); }); @@ -97,19 +106,59 @@ describe('Telemetry Collection Manager', () => { describe('unencrypted: false', () => { const config: StatsGetterConfig = { unencrypted: false }; - test('getStats returns empty because clusterDetails returns empty, and the soClient is an instance of the TelemetrySavedObjectsClient', async () => { - collectionStrategy.clusterDetailsGetter.mockResolvedValue([]); - await expect(setupApi.getStats(config)).resolves.toStrictEqual([]); - expect(collectionStrategy.clusterDetailsGetter.mock.calls[0][0].soClient).toBeInstanceOf( - TelemetrySavedObjectsClient - ); + describe('getStats', () => { + test('returns empty because clusterDetails returns empty, and the soClient is an instance of the TelemetrySavedObjectsClient', async () => { + collectionStrategy.clusterDetailsGetter.mockResolvedValue([]); + await expect(setupApi.getStats(config)).resolves.toStrictEqual([]); + expect( + collectionStrategy.clusterDetailsGetter.mock.calls[0][0].soClient + ).toBeInstanceOf(TelemetrySavedObjectsClient); + }); + + test('returns encrypted payload', async () => { + collectionStrategy.clusterDetailsGetter.mockResolvedValue([ + { clusterUuid: 'clusterUuid' }, + ]); + collectionStrategy.statsGetter.mockResolvedValue([basicStats]); + await expect(setupApi.getStats(config)).resolves.toStrictEqual([expect.any(String)]); + expect( + collectionStrategy.clusterDetailsGetter.mock.calls[0][0].soClient + ).toBeInstanceOf(TelemetrySavedObjectsClient); + }); }); - test('getOptInStats returns empty', async () => { - collectionStrategy.clusterDetailsGetter.mockResolvedValue([]); - await expect(setupApi.getOptInStats(true, config)).resolves.toStrictEqual([]); - expect(collectionStrategy.clusterDetailsGetter.mock.calls[0][0].soClient).toBeInstanceOf( - TelemetrySavedObjectsClient - ); + + describe('getOptInStats', () => { + test('returns empty', async () => { + collectionStrategy.clusterDetailsGetter.mockResolvedValue([]); + await expect(setupApi.getOptInStats(true, config)).resolves.toStrictEqual([]); + expect( + collectionStrategy.clusterDetailsGetter.mock.calls[0][0].soClient + ).toBeInstanceOf(TelemetrySavedObjectsClient); + }); + + test('returns encrypted results for opt-in true', async () => { + collectionStrategy.clusterDetailsGetter.mockResolvedValue([ + { clusterUuid: 'clusterUuid' }, + ]); + await expect(setupApi.getOptInStats(true, config)).resolves.toStrictEqual([ + expect.any(String), + ]); + expect( + collectionStrategy.clusterDetailsGetter.mock.calls[0][0].soClient + ).toBeInstanceOf(TelemetrySavedObjectsClient); + }); + + test('returns encrypted results for opt-in false', async () => { + collectionStrategy.clusterDetailsGetter.mockResolvedValue([ + { clusterUuid: 'clusterUuid' }, + ]); + await expect(setupApi.getOptInStats(false, config)).resolves.toStrictEqual([ + expect.any(String), + ]); + expect( + collectionStrategy.clusterDetailsGetter.mock.calls[0][0].soClient + ).toBeInstanceOf(TelemetrySavedObjectsClient); + }); }); }); describe('unencrypted: true', () => { @@ -118,19 +167,60 @@ describe('Telemetry Collection Manager', () => { request: httpServerMock.createKibanaRequest(), }; - test('getStats returns empty because clusterDetails returns empty, and the soClient is not an instance of the TelemetrySavedObjectsClient', async () => { - collectionStrategy.clusterDetailsGetter.mockResolvedValue([]); - await expect(setupApi.getStats(config)).resolves.toStrictEqual([]); - expect( - collectionStrategy.clusterDetailsGetter.mock.calls[0][0].soClient - ).not.toBeInstanceOf(TelemetrySavedObjectsClient); + describe('getStats', () => { + test('getStats returns empty because clusterDetails returns empty, and the soClient is not an instance of the TelemetrySavedObjectsClient', async () => { + collectionStrategy.clusterDetailsGetter.mockResolvedValue([]); + await expect(setupApi.getStats(config)).resolves.toStrictEqual([]); + expect( + collectionStrategy.clusterDetailsGetter.mock.calls[0][0].soClient + ).not.toBeInstanceOf(TelemetrySavedObjectsClient); + }); + test('returns encrypted payload (assumes opted-in when no explicitly opted-out)', async () => { + collectionStrategy.clusterDetailsGetter.mockResolvedValue([ + { clusterUuid: 'clusterUuid' }, + ]); + collectionStrategy.statsGetter.mockResolvedValue([basicStats]); + await expect(setupApi.getStats(config)).resolves.toStrictEqual([ + { ...basicStats, collectionSource: 'test_collection' }, + ]); + expect( + collectionStrategy.clusterDetailsGetter.mock.calls[0][0].soClient + ).not.toBeInstanceOf(TelemetrySavedObjectsClient); + }); }); - test('getOptInStats returns empty', async () => { - collectionStrategy.clusterDetailsGetter.mockResolvedValue([]); - await expect(setupApi.getOptInStats(true, config)).resolves.toStrictEqual([]); - expect( - collectionStrategy.clusterDetailsGetter.mock.calls[0][0].soClient - ).not.toBeInstanceOf(TelemetrySavedObjectsClient); + + describe('getOptInStats', () => { + test('returns empty', async () => { + collectionStrategy.clusterDetailsGetter.mockResolvedValue([]); + await expect(setupApi.getOptInStats(true, config)).resolves.toStrictEqual([]); + expect( + collectionStrategy.clusterDetailsGetter.mock.calls[0][0].soClient + ).not.toBeInstanceOf(TelemetrySavedObjectsClient); + }); + + test('returns results for opt-in true', async () => { + collectionStrategy.clusterDetailsGetter.mockResolvedValue([ + { clusterUuid: 'clusterUuid' }, + ]); + await expect(setupApi.getOptInStats(true, config)).resolves.toStrictEqual([ + { cluster_uuid: 'clusterUuid', opt_in_status: true }, + ]); + expect( + collectionStrategy.clusterDetailsGetter.mock.calls[0][0].soClient + ).not.toBeInstanceOf(TelemetrySavedObjectsClient); + }); + + test('returns results for opt-in false', async () => { + collectionStrategy.clusterDetailsGetter.mockResolvedValue([ + { clusterUuid: 'clusterUuid' }, + ]); + await expect(setupApi.getOptInStats(false, config)).resolves.toStrictEqual([ + { cluster_uuid: 'clusterUuid', opt_in_status: false }, + ]); + expect( + collectionStrategy.clusterDetailsGetter.mock.calls[0][0].soClient + ).not.toBeInstanceOf(TelemetrySavedObjectsClient); + }); }); }); }); diff --git a/src/plugins/telemetry_collection_manager/server/plugin.ts b/src/plugins/telemetry_collection_manager/server/plugin.ts index 0fec225d5c424a..692d91b963d9d0 100644 --- a/src/plugins/telemetry_collection_manager/server/plugin.ts +++ b/src/plugins/telemetry_collection_manager/server/plugin.ts @@ -30,7 +30,6 @@ import { UsageStatsPayload, StatsCollectionContext, } from './types'; -import { isClusterOptedIn } from './util'; import { encryptTelemetry } from './encryption'; import { TelemetrySavedObjectsClient } from './telemetry_saved_objects_client'; @@ -233,7 +232,7 @@ export class TelemetryCollectionManagerPlugin return usageData; } - return encryptTelemetry(usageData.filter(isClusterOptedIn), { + return await encryptTelemetry(usageData, { useProdKey: this.isDistributable, }); } diff --git a/src/plugins/usage_collection/README.mdx b/src/plugins/usage_collection/README.mdx index e6759b7dc6c7cc..04e1e0fbb50065 100644 --- a/src/plugins/usage_collection/README.mdx +++ b/src/plugins/usage_collection/README.mdx @@ -7,10 +7,13 @@ date: 2021-02-24 tags: ['kibana','dev', 'contributor', 'api docs'] --- + # Kibana Usage Collection Service The Usage Collection Service defines a set of APIs for other plugins to report the usage of their features. At the same time, it provides necessary the APIs for other services (i.e.: telemetry, monitoring, ...) to consume that usage data. +IMPORTANT: Usage collection and telemetry applies to internal Elastic Kibana developers only. + ## How to report my plugin's usage? The way to report the usage of any feature depends on whether the actions to track occur in the UI, or the usage depends on any server-side data. For that reason, the set of APIs exposed in the `public` and `server` contexts are different. diff --git a/src/plugins/vis_type_metric/public/metric_vis_type.ts b/src/plugins/vis_type_metric/public/metric_vis_type.ts index 732205fb31eabb..9e2e248c6ccd50 100644 --- a/src/plugins/vis_type_metric/public/metric_vis_type.ts +++ b/src/plugins/vis_type_metric/public/metric_vis_type.ts @@ -63,6 +63,7 @@ export const createMetricVisTypeDefinition = (): VisTypeDefinition => '!moving_avg', '!cumulative_sum', '!geo_bounds', + '!filtered_metric', ], aggSettings: { top_hits: { diff --git a/src/plugins/vis_type_table/public/legacy/table_vis_legacy_type.ts b/src/plugins/vis_type_table/public/legacy/table_vis_legacy_type.ts index 020a317e0471b1..2f30faa8e9a899 100644 --- a/src/plugins/vis_type_table/public/legacy/table_vis_legacy_type.ts +++ b/src/plugins/vis_type_table/public/legacy/table_vis_legacy_type.ts @@ -50,7 +50,7 @@ export const tableVisLegacyTypeDefinition: VisTypeDefinition = { title: i18n.translate('visTypeTable.tableVisEditorConfig.schemas.metricTitle', { defaultMessage: 'Metric', }), - aggFilter: ['!geo_centroid', '!geo_bounds'], + aggFilter: ['!geo_centroid', '!geo_bounds', '!filtered_metric'], aggSettings: { top_hits: { allowStrings: true, diff --git a/src/plugins/vis_type_table/public/table_vis_type.ts b/src/plugins/vis_type_table/public/table_vis_type.ts index 774742f02dde5b..d645af3180b080 100644 --- a/src/plugins/vis_type_table/public/table_vis_type.ts +++ b/src/plugins/vis_type_table/public/table_vis_type.ts @@ -46,7 +46,7 @@ export const tableVisTypeDefinition: VisTypeDefinition = { title: i18n.translate('visTypeTable.tableVisEditorConfig.schemas.metricTitle', { defaultMessage: 'Metric', }), - aggFilter: ['!geo_centroid', '!geo_bounds'], + aggFilter: ['!geo_centroid', '!geo_bounds', '!filtered_metric'], aggSettings: { top_hits: { allowStrings: true, diff --git a/src/plugins/vis_type_tagcloud/public/tag_cloud_type.ts b/src/plugins/vis_type_tagcloud/public/tag_cloud_type.ts index 6f2c6112064a90..4052ecbe21997f 100644 --- a/src/plugins/vis_type_tagcloud/public/tag_cloud_type.ts +++ b/src/plugins/vis_type_tagcloud/public/tag_cloud_type.ts @@ -51,6 +51,7 @@ export const tagCloudVisTypeDefinition = { '!derivative', '!geo_bounds', '!geo_centroid', + '!filtered_metric', ], defaults: [{ schema: 'metric', type: 'count' }], }, diff --git a/src/plugins/vis_type_timeseries/public/application/components/lib/new_series_fn.js b/src/plugins/vis_type_timeseries/public/application/components/lib/new_series_fn.js index 36e52fc21732f5..9064cd1afc3f4f 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/lib/new_series_fn.js +++ b/src/plugins/vis_type_timeseries/public/application/components/lib/new_series_fn.js @@ -17,6 +17,10 @@ export const newSeriesFn = (obj = {}) => { id: uuid.v1(), color: '#68BC00', split_mode: 'everything', + palette: { + type: 'palette', + name: 'default', + }, metrics: [newMetricAggFn()], separate_axis: 0, axis_position: 'right', diff --git a/src/plugins/vis_type_vislib/public/gauge.ts b/src/plugins/vis_type_vislib/public/gauge.ts index 172ce83b4f7c2c..7e3ff8226fbb65 100644 --- a/src/plugins/vis_type_vislib/public/gauge.ts +++ b/src/plugins/vis_type_vislib/public/gauge.ts @@ -119,6 +119,7 @@ export const gaugeVisTypeDefinition: VisTypeDefinition = { '!moving_avg', '!cumulative_sum', '!geo_bounds', + '!filtered_metric', ], defaults: [{ schema: 'metric', type: 'count' }], }, diff --git a/src/plugins/vis_type_vislib/public/goal.ts b/src/plugins/vis_type_vislib/public/goal.ts index aaeae4f675f3fd..468651bb4cf4c4 100644 --- a/src/plugins/vis_type_vislib/public/goal.ts +++ b/src/plugins/vis_type_vislib/public/goal.ts @@ -83,6 +83,7 @@ export const goalVisTypeDefinition: VisTypeDefinition = { '!moving_avg', '!cumulative_sum', '!geo_bounds', + '!filtered_metric', ], defaults: [{ schema: 'metric', type: 'count' }], }, diff --git a/src/plugins/vis_type_vislib/public/heatmap.ts b/src/plugins/vis_type_vislib/public/heatmap.ts index 6f6160f3756fdb..8d538399f68b2b 100644 --- a/src/plugins/vis_type_vislib/public/heatmap.ts +++ b/src/plugins/vis_type_vislib/public/heatmap.ts @@ -94,6 +94,7 @@ export const heatmapVisTypeDefinition: VisTypeDefinition = { 'cardinality', 'std_dev', 'top_hits', + '!filtered_metric', ], defaults: [{ schema: 'metric', type: 'count' }], }, diff --git a/src/plugins/vis_type_vislib/public/vislib/visualizations/gauge_chart.test.js b/src/plugins/vis_type_vislib/public/vislib/visualizations/gauge_chart.test.js index 035d6200648482..76830c66f3aa56 100644 --- a/src/plugins/vis_type_vislib/public/vislib/visualizations/gauge_chart.test.js +++ b/src/plugins/vis_type_vislib/public/vislib/visualizations/gauge_chart.test.js @@ -134,8 +134,8 @@ describe('Vislib Gauge Chart Test Suite', function () { }); expect(fills).toEqual([ 'rgb(165,0,38)', - 'rgb(255,255,190)', - 'rgb(255,255,190)', + 'rgb(254,254,189)', + 'rgb(254,254,189)', 'rgb(0,104,55)', 'rgb(0,104,55)', ]); @@ -154,8 +154,8 @@ describe('Vislib Gauge Chart Test Suite', function () { }); expect(fills).toEqual([ 'rgb(8,48,107)', - 'rgb(107,174,214)', - 'rgb(107,174,214)', + 'rgb(109,174,213)', + 'rgb(109,174,213)', 'rgb(247,251,255)', 'rgb(247,251,255)', ]); diff --git a/src/plugins/vis_type_xy/public/vis_types/area.ts b/src/plugins/vis_type_xy/public/vis_types/area.ts index a61c25bbc075a4..dfe9bc2f42b84b 100644 --- a/src/plugins/vis_type_xy/public/vis_types/area.ts +++ b/src/plugins/vis_type_xy/public/vis_types/area.ts @@ -133,7 +133,7 @@ export const getAreaVisTypeDefinition = ( title: i18n.translate('visTypeXy.area.metricsTitle', { defaultMessage: 'Y-axis', }), - aggFilter: ['!geo_centroid', '!geo_bounds'], + aggFilter: ['!geo_centroid', '!geo_bounds', '!filtered_metric'], min: 1, defaults: [{ schema: 'metric', type: 'count' }], }, diff --git a/src/plugins/vis_type_xy/public/vis_types/histogram.ts b/src/plugins/vis_type_xy/public/vis_types/histogram.ts index 2c2a83b48802d3..ba20502a3b9af9 100644 --- a/src/plugins/vis_type_xy/public/vis_types/histogram.ts +++ b/src/plugins/vis_type_xy/public/vis_types/histogram.ts @@ -137,7 +137,7 @@ export const getHistogramVisTypeDefinition = ( defaultMessage: 'Y-axis', }), min: 1, - aggFilter: ['!geo_centroid', '!geo_bounds'], + aggFilter: ['!geo_centroid', '!geo_bounds', '!filtered_metric'], defaults: [{ schema: 'metric', type: 'count' }], }, { diff --git a/src/plugins/vis_type_xy/public/vis_types/horizontal_bar.ts b/src/plugins/vis_type_xy/public/vis_types/horizontal_bar.ts index 75c4ddd75d0b3b..62da0448e56bdd 100644 --- a/src/plugins/vis_type_xy/public/vis_types/horizontal_bar.ts +++ b/src/plugins/vis_type_xy/public/vis_types/horizontal_bar.ts @@ -136,7 +136,7 @@ export const getHorizontalBarVisTypeDefinition = ( defaultMessage: 'Y-axis', }), min: 1, - aggFilter: ['!geo_centroid', '!geo_bounds'], + aggFilter: ['!geo_centroid', '!geo_bounds', '!filtered_metric'], defaults: [{ schema: 'metric', type: 'count' }], }, { diff --git a/src/plugins/vis_type_xy/public/vis_types/line.ts b/src/plugins/vis_type_xy/public/vis_types/line.ts index 87165a20592e59..5a9eb5198df353 100644 --- a/src/plugins/vis_type_xy/public/vis_types/line.ts +++ b/src/plugins/vis_type_xy/public/vis_types/line.ts @@ -132,7 +132,7 @@ export const getLineVisTypeDefinition = ( name: 'metric', title: i18n.translate('visTypeXy.line.metricTitle', { defaultMessage: 'Y-axis' }), min: 1, - aggFilter: ['!geo_centroid', '!geo_bounds'], + aggFilter: ['!geo_centroid', '!geo_bounds', '!filtered_metric'], defaults: [{ schema: 'metric', type: 'count' }], }, { diff --git a/src/plugins/visualizations/public/embeddable/to_ast.ts b/src/plugins/visualizations/public/embeddable/to_ast.ts index 7ccff9394943af..95b64fe4e6e176 100644 --- a/src/plugins/visualizations/public/embeddable/to_ast.ts +++ b/src/plugins/visualizations/public/embeddable/to_ast.ts @@ -10,7 +10,7 @@ import { ExpressionFunctionKibana, ExpressionFunctionKibanaContext } from '../.. import { buildExpression, buildExpressionFunction } from '../../../expressions/public'; import { VisToExpressionAst } from '../types'; -import { queryToAst } from '../../../data/common'; +import { queryToAst, filtersToAst } from '../../../data/common'; /** * Creates an ast expression for a visualization based on kibana context (query, filters, timerange) @@ -22,12 +22,15 @@ import { queryToAst } from '../../../data/common'; export const toExpressionAst: VisToExpressionAst = async (vis, params) => { const { savedSearchId, searchSource } = vis.data; const query = searchSource?.getField('query'); - const filters = searchSource?.getField('filter'); + let filters = searchSource?.getField('filter'); + if (typeof filters === 'function') { + filters = filters(); + } const kibana = buildExpressionFunction('kibana', {}); const kibanaContext = buildExpressionFunction('kibana_context', { q: query && queryToAst(query), - filters: filters && JSON.stringify(filters), + filters: filters && filtersToAst(filters), savedSearchId, }); diff --git a/test/api_integration/apis/telemetry/telemetry_local.ts b/test/api_integration/apis/telemetry/telemetry_local.ts index 211f2eb85e4e36..a7b4da566b1434 100644 --- a/test/api_integration/apis/telemetry/telemetry_local.ts +++ b/test/api_integration/apis/telemetry/telemetry_local.ts @@ -7,13 +7,27 @@ */ import expect from '@kbn/expect'; +import supertestAsPromised from 'supertest-as-promised'; import { basicUiCounters } from './__fixtures__/ui_counters'; -import { FtrProviderContext } from '../../ftr_provider_context'; -import { SavedObject } from '../../../../src/core/server'; +import type { FtrProviderContext } from '../../ftr_provider_context'; +import type { SavedObject } from '../../../../src/core/server'; import ossRootTelemetrySchema from '../../../../src/plugins/telemetry/schema/oss_root.json'; import ossPluginsTelemetrySchema from '../../../../src/plugins/telemetry/schema/oss_plugins.json'; import { assertTelemetryPayload, flatKeys } from './utils'; +async function retrieveTelemetry( + supertest: supertestAsPromised.SuperTest +) { + const { body } = await supertest + .post('/api/telemetry/v2/clusters/_stats') + .set('kbn-xsrf', 'xxx') + .send({ unencrypted: true }) + .expect(200); + + expect(body.length).to.be(1); + return body[0]; +} + export default function ({ getService }: FtrProviderContext) { const supertest = getService('supertest'); const es = getService('es'); @@ -35,14 +49,7 @@ export default function ({ getService }: FtrProviderContext) { let stats: Record; before('pull local stats', async () => { - const { body } = await supertest - .post('/api/telemetry/v2/clusters/_stats') - .set('kbn-xsrf', 'xxx') - .send({ unencrypted: true }) - .expect(200); - - expect(body.length).to.be(1); - stats = body[0]; + stats = await retrieveTelemetry(supertest); }); it('should pass the schema validation', () => { @@ -141,14 +148,7 @@ export default function ({ getService }: FtrProviderContext) { before('Add UI Counters saved objects', () => esArchiver.load('saved_objects/ui_counters')); after('cleanup saved objects changes', () => esArchiver.unload('saved_objects/ui_counters')); it('returns ui counters aggregated by day', async () => { - const { body } = await supertest - .post('/api/telemetry/v2/clusters/_stats') - .set('kbn-xsrf', 'xxx') - .send({ unencrypted: true }) - .expect(200); - - expect(body.length).to.be(1); - const stats = body[0]; + const stats = await retrieveTelemetry(supertest); expect(stats.stack_stats.kibana.plugins.ui_counters).to.eql(basicUiCounters); }); }); @@ -191,14 +191,7 @@ export default function ({ getService }: FtrProviderContext) { }); it('should return application_usage data', async () => { - const { body } = await supertest - .post('/api/telemetry/v2/clusters/_stats') - .set('kbn-xsrf', 'xxx') - .send({ unencrypted: true }) - .expect(200); - - expect(body.length).to.be(1); - const stats = body[0]; + const stats = await retrieveTelemetry(supertest); expect(stats.stack_stats.kibana.plugins.application_usage).to.eql({ 'test-app': { appId: 'test-app', @@ -262,14 +255,7 @@ export default function ({ getService }: FtrProviderContext) { // flaky https://github.com/elastic/kibana/issues/94513 it.skip("should only use the first 10k docs for the application_usage data (they'll be rolled up in a later process)", async () => { - const { body } = await supertest - .post('/api/telemetry/v2/clusters/_stats') - .set('kbn-xsrf', 'xxx') - .send({ unencrypted: true }) - .expect(200); - - expect(body.length).to.be(1); - const stats = body[0]; + const stats = await retrieveTelemetry(supertest); expect(stats.stack_stats.kibana.plugins.application_usage).to.eql({ 'test-app': { appId: 'test-app', diff --git a/test/functional/apps/discover/_data_grid_context.ts b/test/functional/apps/discover/_data_grid_context.ts index 896cd4ad595c95..326fba9e6c0870 100644 --- a/test/functional/apps/discover/_data_grid_context.ts +++ b/test/functional/apps/discover/_data_grid_context.ts @@ -34,7 +34,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const dashboardAddPanel = getService('dashboardAddPanel'); const browser = getService('browser'); - describe('discover data grid context tests', () => { + // FLAKY: https://github.com/elastic/kibana/issues/94545 + describe.skip('discover data grid context tests', () => { before(async () => { await esArchiver.load('discover'); await esArchiver.loadIfNeeded('logstash_functional'); diff --git a/test/functional/services/visualizations/elastic_chart.ts b/test/functional/services/visualizations/elastic_chart.ts index 010394b2752286..80483100a06dd3 100644 --- a/test/functional/services/visualizations/elastic_chart.ts +++ b/test/functional/services/visualizations/elastic_chart.ts @@ -29,7 +29,11 @@ export function ElasticChartProvider({ getService }: FtrProviderContext) { const browser = getService('browser'); class ElasticChart { - public async getCanvas() { + public async getCanvas(dataTestSubj?: string) { + if (dataTestSubj) { + const chart = await this.getChart(dataTestSubj); + return await chart.findByClassName('echCanvasRenderer'); + } return await find.byCssSelector('.echChart canvas:last-of-type'); } diff --git a/test/scripts/test/jest_unit.sh b/test/scripts/test/jest_unit.sh index fd1166b07f3228..74d3c5b0cad180 100755 --- a/test/scripts/test/jest_unit.sh +++ b/test/scripts/test/jest_unit.sh @@ -3,4 +3,4 @@ source src/dev/ci_setup/setup_env.sh checks-reporter-with-killswitch "Jest Unit Tests" \ - node scripts/jest --ci --verbose --maxWorkers=8 + node scripts/jest --ci --verbose --maxWorkers=6 diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/app_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/app_logic.ts index 5f7dc683d93b42..44416b596e6ef9 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/app_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/app_logic.ts @@ -13,7 +13,7 @@ import { ConfiguredLimits, Account, Role } from './types'; import { getRoleAbilities } from './utils/role'; -export interface AppValues { +interface AppValues { ilmEnabled: boolean; configuredLimits: ConfiguredLimits; account: Account; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials_logic.test.ts index a178228f4996bf..bf84b03e7603ee 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials_logic.test.ts @@ -1025,7 +1025,9 @@ describe('CredentialsLogic', () => { }); }); }); + }); + describe('listeners', () => { describe('fetchCredentials', () => { const meta = { page: { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_logic.test.ts index 37d3d1577767f0..2c6cadf9a8ece5 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_logic.test.ts @@ -294,7 +294,9 @@ describe('DocumentCreationLogic', () => { }); }); }); + }); + describe('listeners', () => { describe('onSubmitFile', () => { describe('with a valid file', () => { beforeAll(() => { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/document_detail_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/document_detail_logic.test.ts index d2683fac649a0d..add5e9414be133 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/document_detail_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/document_detail_logic.test.ts @@ -54,7 +54,9 @@ describe('DocumentDetailLogic', () => { }); }); }); + }); + describe('listeners', () => { describe('getDocumentDetails', () => { it('will call an API endpoint and then store the result', async () => { const fields = [{ name: 'name', value: 'python', type: 'string' }]; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.test.ts index bf2fba6344e7a4..b9ec83db99f709 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.test.ts @@ -172,7 +172,9 @@ describe('EngineLogic', () => { }); }); }); + }); + describe('listeners', () => { describe('initializeEngine', () => { it('fetches and sets engine data', async () => { mount({ engineName: 'some-engine' }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/types.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/types.ts index 0cfef4320825c0..75828fa9bfc4c7 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/types.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/types.ts @@ -9,9 +9,9 @@ import { Schema, SchemaConflicts, IIndexingStatus } from '../../../shared/types' import { ApiToken } from '../credentials/types'; export enum EngineTypes { - default, - indexed, - meta, + default = 'default', + indexed = 'indexed', + meta = 'meta', } export interface Engine { name: string; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_overview_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_overview_logic.test.ts index df8ed920e88dfa..decadba1092d39 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_overview_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_overview_logic.test.ts @@ -78,7 +78,9 @@ describe('EngineOverviewLogic', () => { }); }); }); + }); + describe('listeners', () => { describe('pollForOverviewMetrics', () => { it('fetches data and calls onPollingSuccess', async () => { mount(); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/empty_state.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/empty_state.test.tsx index 14772375c9bd49..a7371744771777 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/empty_state.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/empty_state.test.tsx @@ -6,7 +6,7 @@ */ import '../../../../__mocks__/kea.mock'; -import { mockTelemetryActions } from '../../../../__mocks__'; +import { setMockValues, mockTelemetryActions } from '../../../../__mocks__'; import React from 'react'; @@ -17,30 +17,47 @@ import { EuiEmptyPrompt } from '@elastic/eui'; import { EmptyState } from './'; describe('EmptyState', () => { - it('renders', () => { - const wrapper = shallow(); - - expect(wrapper.find(EuiEmptyPrompt)).toHaveLength(1); - }); - - describe('CTA Button', () => { + describe('when the user can manage/create engines', () => { let wrapper: ShallowWrapper; - let prompt: ShallowWrapper; - let button: ShallowWrapper; - beforeEach(() => { + beforeAll(() => { + setMockValues({ myRole: { canManageEngines: true } }); wrapper = shallow(); - prompt = wrapper.find(EuiEmptyPrompt).dive(); - button = prompt.find('[data-test-subj="EmptyStateCreateFirstEngineCta"]'); }); - it('sends telemetry on create first engine click', () => { - button.simulate('click'); - expect(mockTelemetryActions.sendAppSearchTelemetry).toHaveBeenCalled(); + it('renders a prompt to create an engine', () => { + expect(wrapper.find('[data-test-subj="AdminEmptyEnginesPrompt"]')).toHaveLength(1); + }); + + describe('create engine button', () => { + let prompt: ShallowWrapper; + let button: ShallowWrapper; + + beforeAll(() => { + prompt = wrapper.find(EuiEmptyPrompt).dive(); + button = prompt.find('[data-test-subj="EmptyStateCreateFirstEngineCta"]'); + }); + + it('sends telemetry on create first engine click', () => { + button.simulate('click'); + expect(mockTelemetryActions.sendAppSearchTelemetry).toHaveBeenCalled(); + }); + + it('sends a user to engine creation', () => { + expect(button.prop('to')).toEqual('/engine_creation'); + }); + }); + }); + + describe('when the user cannot manage/create engines', () => { + beforeAll(() => { + setMockValues({ myRole: { canManageEngines: false } }); }); - it('sends a user to engine creation', () => { - expect(button.prop('to')).toEqual('/engine_creation'); + it('renders a prompt to contact the App Search admin', () => { + const wrapper = shallow(); + + expect(wrapper.find('[data-test-subj="NonAdminEmptyEnginesPrompt"]')).toHaveLength(1); }); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/empty_state.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/empty_state.tsx index fc77e2f2511e01..df5a057e5d9c6e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/empty_state.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/empty_state.tsx @@ -7,14 +7,15 @@ import React from 'react'; -import { useActions } from 'kea'; +import { useValues, useActions } from 'kea'; import { EuiPageContent, EuiEmptyPrompt } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { i18n } from '@kbn/i18n'; import { SetAppSearchChrome as SetPageChrome } from '../../../../shared/kibana_chrome'; import { EuiButtonTo } from '../../../../shared/react_router_helpers'; import { TelemetryLogic } from '../../../../shared/telemetry'; +import { AppLogic } from '../../../app_logic'; import { ENGINE_CREATION_PATH } from '../../../routes'; import { EnginesOverviewHeader } from './header'; @@ -22,6 +23,9 @@ import { EnginesOverviewHeader } from './header'; import './empty_state.scss'; export const EmptyState: React.FC = () => { + const { + myRole: { canManageEngines }, + } = useValues(AppLogic); const { sendAppSearchTelemetry } = useActions(TelemetryLogic); return ( @@ -29,45 +33,71 @@ export const EmptyState: React.FC = () => { - - - - } - titleSize="l" - body={ -

- -

- } - actions={ - - sendAppSearchTelemetry({ - action: 'clicked', - metric: 'create_first_engine_button', - }) - } - > - - - } - /> + {canManageEngines ? ( + + {i18n.translate('xpack.enterpriseSearch.appSearch.emptyState.title', { + defaultMessage: 'Create your first engine', + })} + + } + titleSize="l" + body={ +

+ {i18n.translate('xpack.enterpriseSearch.appSearch.emptyState.description1', { + defaultMessage: + 'An App Search engine stores the documents for your search experience.', + })} +

+ } + actions={ + + sendAppSearchTelemetry({ + action: 'clicked', + metric: 'create_first_engine_button', + }) + } + > + {i18n.translate( + 'xpack.enterpriseSearch.appSearch.emptyState.createFirstEngineCta', + { defaultMessage: 'Create an engine' } + )} + + } + /> + ) : ( + + {i18n.translate('xpack.enterpriseSearch.appSearch.emptyState.nonAdmin.title', { + defaultMessage: 'No engines available', + })} + + } + body={ +

+ {i18n.translate( + 'xpack.enterpriseSearch.appSearch.emptyState.nonAdmin.description', + { + defaultMessage: + 'Contact your App Search administrator to either create or grant you access to an engine.', + } + )} +

+ } + /> + )}
); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_logic.test.ts index e4776f7a75df41..a67e5bb9ae7dc4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_logic.test.ts @@ -204,7 +204,10 @@ describe('EnginesLogic', () => { it('should call loadEngines if engine.type === default', () => { jest.spyOn(EnginesLogic.actions, 'loadEngines'); - EnginesLogic.actions.onDeleteEngineSuccess({ ...MOCK_ENGINE, type: EngineTypes.default }); + EnginesLogic.actions.onDeleteEngineSuccess({ + ...MOCK_ENGINE, + type: 'default' as EngineTypes.default, + }); expect(EnginesLogic.actions.loadEngines).toHaveBeenCalled(); }); @@ -212,7 +215,10 @@ describe('EnginesLogic', () => { it('should call loadMetaEngines if engine.type === meta', () => { jest.spyOn(EnginesLogic.actions, 'loadMetaEngines'); - EnginesLogic.actions.onDeleteEngineSuccess({ ...MOCK_ENGINE, type: EngineTypes.meta }); + EnginesLogic.actions.onDeleteEngineSuccess({ + ...MOCK_ENGINE, + type: 'meta' as EngineTypes.meta, + }); expect(EnginesLogic.actions.loadMetaEngines).toHaveBeenCalled(); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_overview.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_overview.test.tsx index 5a3f7309407600..3ca039907932ee 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_overview.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_overview.test.tsx @@ -41,6 +41,7 @@ describe('EnginesOverview', () => { }, metaEnginesLoading: false, hasPlatinumLicense: false, + myRole: { canManageEngines: false }, }; const actions = { loadEngines: jest.fn(), @@ -90,61 +91,72 @@ describe('EnginesOverview', () => { setMockValues(valuesWithEngines); }); - it('renders and calls the engines API', async () => { + it('renders and calls the engines API', () => { const wrapper = shallow(); expect(wrapper.find(EnginesTable)).toHaveLength(1); expect(actions.loadEngines).toHaveBeenCalled(); }); - it('renders a create engine button which takes users to the create engine page', () => { - const wrapper = shallow(); + describe('when the user can manage/create engines', () => { + it('renders a create engine button which takes users to the create engine page', () => { + setMockValues({ + ...valuesWithEngines, + myRole: { canManageEngines: true }, + }); + const wrapper = shallow(); - expect( - wrapper.find('[data-test-subj="appSearchEnginesEngineCreationButton"]').prop('to') - ).toEqual('/engine_creation'); + expect( + wrapper.find('[data-test-subj="appSearchEnginesEngineCreationButton"]').prop('to') + ).toEqual('/engine_creation'); + }); }); - describe('when user has a platinum license', () => { - let wrapper: ShallowWrapper; - - beforeEach(() => { + describe('when the account has a platinum license', () => { + it('renders a 2nd meta engines table & makes a 2nd meta engines call', () => { setMockValues({ ...valuesWithEngines, hasPlatinumLicense: true, }); - wrapper = shallow(); - }); + const wrapper = shallow(); - it('renders a 2nd meta engines table ', async () => { expect(wrapper.find(EnginesTable)).toHaveLength(2); - }); - - it('makes a 2nd meta engines call', () => { expect(actions.loadMetaEngines).toHaveBeenCalled(); }); - it('renders a create engine button which takes users to the create meta engine page', () => { - expect( - wrapper.find('[data-test-subj="appSearchEnginesMetaEngineCreationButton"]').prop('to') - ).toEqual('/meta_engine_creation'); - }); - - it('contains an EuiEmptyPrompt that takes users to the create meta when metaEngines is empty', () => { - setMockValues({ - ...valuesWithEngines, - hasPlatinumLicense: true, - metaEngines: [], + describe('when the user can manage/create engines', () => { + it('renders a create engine button which takes users to the create meta engine page', () => { + setMockValues({ + ...valuesWithEngines, + hasPlatinumLicense: true, + myRole: { canManageEngines: true }, + }); + const wrapper = shallow(); + + expect( + wrapper.find('[data-test-subj="appSearchEnginesMetaEngineCreationButton"]').prop('to') + ).toEqual('/meta_engine_creation'); }); - wrapper = shallow(); - const metaEnginesTable = wrapper.find(EnginesTable).last().dive(); - const emptyPrompt = metaEnginesTable.dive().find(EuiEmptyPrompt).dive(); - expect( - emptyPrompt - .find('[data-test-subj="appSearchMetaEnginesEmptyStateCreationButton"]') - .prop('to') - ).toEqual('/meta_engine_creation'); + describe('when metaEngines is empty', () => { + it('contains an EuiEmptyPrompt that takes users to the create meta engine page', () => { + setMockValues({ + ...valuesWithEngines, + hasPlatinumLicense: true, + myRole: { canManageEngines: true }, + metaEngines: [], + }); + const wrapper = shallow(); + const metaEnginesTable = wrapper.find(EnginesTable).last().dive(); + const emptyPrompt = metaEnginesTable.dive().find(EuiEmptyPrompt).dive(); + + expect( + emptyPrompt + .find('[data-test-subj="appSearchMetaEnginesEmptyStateCreationButton"]') + .prop('to') + ).toEqual('/meta_engine_creation'); + }); + }); }); }); @@ -152,7 +164,7 @@ describe('EnginesOverview', () => { const getTablePagination = (wrapper: ShallowWrapper) => wrapper.find(EnginesTable).prop('pagination'); - it('passes down page data from the API', async () => { + it('passes down page data from the API', () => { const wrapper = shallow(); const pagination = getTablePagination(wrapper); @@ -160,7 +172,7 @@ describe('EnginesOverview', () => { expect(pagination.pageIndex).toEqual(0); }); - it('re-polls the API on page change', async () => { + it('re-polls the API on page change', () => { const wrapper = shallow(); setMockValues({ @@ -178,7 +190,7 @@ describe('EnginesOverview', () => { expect(getTablePagination(wrapper).pageIndex).toEqual(50); }); - it('calls onPagination handlers', async () => { + it('calls onPagination handlers', () => { setMockValues({ ...valuesWithEngines, hasPlatinumLicense: true, diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_overview.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_overview.tsx index 8297fb490ee04a..baf275fbe6c2ce 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_overview.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_overview.tsx @@ -25,6 +25,7 @@ import { LicensingLogic } from '../../../shared/licensing'; import { EuiButtonTo } from '../../../shared/react_router_helpers'; import { convertMetaToPagination, handlePageChange } from '../../../shared/table_pagination'; import { SendAppSearchTelemetry as SendTelemetry } from '../../../shared/telemetry'; +import { AppLogic } from '../../app_logic'; import { EngineIcon, MetaEngineIcon } from '../../icons'; import { ENGINE_CREATION_PATH, META_ENGINE_CREATION_PATH } from '../../routes'; @@ -44,6 +45,9 @@ import './engines_overview.scss'; export const EnginesOverview: React.FC = () => { const { hasPlatinumLicense } = useValues(LicensingLogic); + const { + myRole: { canManageEngines }, + } = useValues(AppLogic); const { dataLoading, @@ -91,14 +95,16 @@ export const EnginesOverview: React.FC = () => { - - {CREATE_AN_ENGINE_BUTTON_LABEL} - + {canManageEngines && ( + + {CREATE_AN_ENGINE_BUTTON_LABEL} + + )} @@ -126,14 +132,16 @@ export const EnginesOverview: React.FC = () => { - - {CREATE_A_META_ENGINE_BUTTON_LABEL} - + {canManageEngines && ( + + {CREATE_A_META_ENGINE_BUTTON_LABEL} + + )} @@ -149,13 +157,15 @@ export const EnginesOverview: React.FC = () => { title={

{META_ENGINE_EMPTY_PROMPT_TITLE}

} body={

{META_ENGINE_EMPTY_PROMPT_DESCRIPTION}

} actions={ - - {CREATE_A_META_ENGINE_BUTTON_LABEL} - + canManageEngines && ( + + {CREATE_A_META_ENGINE_BUTTON_LABEL} + + ) } /> } diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_table.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_table.test.tsx index 66f9c3c3c473d8..fc37c3543af569 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_table.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_table.test.tsx @@ -51,16 +51,21 @@ describe('EnginesTable', () => { onDeleteEngine, }; + const resetMocks = () => { + jest.clearAllMocks(); + setMockValues({ + myRole: { + canManageEngines: false, + }, + }); + }; + describe('basic table', () => { let wrapper: ReactWrapper; let table: ReactWrapper; beforeAll(() => { - jest.clearAllMocks(); - setMockValues({ - // LicensingLogic - hasPlatinumLicense: false, - }); + resetMocks(); wrapper = mountWithIntl(); table = wrapper.find(EuiBasicTable); }); @@ -101,11 +106,7 @@ describe('EnginesTable', () => { describe('loading', () => { it('passes the loading prop', () => { - jest.clearAllMocks(); - setMockValues({ - // LicensingLogic - hasPlatinumLicense: false, - }); + resetMocks(); const wrapper = mountWithIntl(); expect(wrapper.find(EuiBasicTable).prop('loading')).toEqual(true); @@ -114,6 +115,7 @@ describe('EnginesTable', () => { describe('noItemsMessage', () => { it('passes the noItemsMessage prop', () => { + resetMocks(); const wrapper = mountWithIntl(); expect(wrapper.find(EuiBasicTable).prop('noItemsMessage')).toEqual('No items.'); }); @@ -121,11 +123,7 @@ describe('EnginesTable', () => { describe('language field', () => { beforeAll(() => { - jest.clearAllMocks(); - setMockValues({ - // LicensingLogic - hasPlatinumLicense: false, - }); + resetMocks(); }); it('renders language when available', () => { @@ -181,29 +179,27 @@ describe('EnginesTable', () => { }); describe('actions', () => { - it('will hide the action buttons if the user does not have a platinum license', () => { - jest.clearAllMocks(); - setMockValues({ - // LicensingLogic - hasPlatinumLicense: false, - }); + it('will hide the action buttons if the user cannot manage/delete engines', () => { + resetMocks(); const wrapper = shallow(); const tableRow = wrapper.find(EuiTableRow).first(); expect(tableRow.find(EuiIcon)).toHaveLength(0); }); - describe('when user has a platinum license', () => { + describe('when the user can manage/delete engines', () => { let wrapper: ReactWrapper; let tableRow: ReactWrapper; let actions: ReactWrapper; beforeEach(() => { - jest.clearAllMocks(); + resetMocks(); setMockValues({ - // LicensingLogic - hasPlatinumLicense: true, + myRole: { + canManageEngines: true, + }, }); + wrapper = mountWithIntl(); tableRow = wrapper.find(EuiTableRow).first(); actions = tableRow.find(EuiIcon); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_table.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_table.tsx index 3b9b6e6c6a7780..624e212c72702a 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_table.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_table.tsx @@ -19,9 +19,9 @@ import { i18n } from '@kbn/i18n'; import { FormattedNumber } from '@kbn/i18n/react'; import { KibanaLogic } from '../../../shared/kibana'; -import { LicensingLogic } from '../../../shared/licensing'; import { EuiLinkTo } from '../../../shared/react_router_helpers'; import { TelemetryLogic } from '../../../shared/telemetry'; +import { AppLogic } from '../../app_logic'; import { UNIVERSAL_LANGUAGE } from '../../constants'; import { ENGINE_PATH } from '../../routes'; import { generateEncodedPath } from '../../utils/encode_path_params'; @@ -52,7 +52,9 @@ export const EnginesTable: React.FC = ({ }) => { const { sendAppSearchTelemetry } = useActions(TelemetryLogic); const { navigateToUrl } = useValues(KibanaLogic); - const { hasPlatinumLicense } = useValues(LicensingLogic); + const { + myRole: { canManageEngines }, + } = useValues(AppLogic); const generateEncodedEnginePath = (engineName: string) => generateEncodedPath(ENGINE_PATH, { engineName }); @@ -177,6 +179,7 @@ export const EnginesTable: React.FC = ({ ), type: 'icon', icon: 'trash', + color: 'danger', onClick: (engine) => { if ( window.confirm( @@ -199,7 +202,7 @@ export const EnginesTable: React.FC = ({ ], }; - if (hasPlatinumLicense) { + if (canManageEngines) { columns.push(actionsColumn); } diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/components/log_retention_callout.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/components/log_retention_callout.test.tsx index 124edb68714531..fe022391d76b45 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/components/log_retention_callout.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/components/log_retention_callout.test.tsx @@ -63,15 +63,6 @@ describe('LogRetentionCallout', () => { expect(wrapper.find('.euiCallOutHeader__title').text()).toEqual('API Logs have been disabled.'); }); - it('does not render a settings link if the user cannot manage settings', () => { - setMockValues({ myRole: { canManageLogSettings: false }, logRetention: { api: DISABLED } }); - const wrapper = mountWithIntl(); - - expect(wrapper.find(EuiCallOut)).toHaveLength(1); - expect(wrapper.find(EuiLink)).toHaveLength(0); - expect(wrapper.find('p')).toHaveLength(0); - }); - it('does not render if log retention is enabled', () => { setMockValues({ ...values, logRetention: { api: { enabled: true } } }); const wrapper = shallow(); @@ -100,5 +91,12 @@ describe('LogRetentionCallout', () => { expect(actions.fetchLogRetention).not.toHaveBeenCalled(); }); + + it('does not fetch log retention data if the user does not have access to log settings', () => { + setMockValues({ ...values, logRetention: null, myRole: { canManageLogSettings: false } }); + shallow(); + + expect(actions.fetchLogRetention).not.toHaveBeenCalled(); + }); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/components/log_retention_callout.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/components/log_retention_callout.tsx index 235d9777931612..1fd1a9a79b2251 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/components/log_retention_callout.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/components/log_retention_callout.tsx @@ -40,7 +40,7 @@ export const LogRetentionCallout: React.FC = ({ type }) => { const hasLogRetention = logRetention !== null; useEffect(() => { - if (!hasLogRetention) fetchLogRetention(); + if (!hasLogRetention && canManageLogSettings) fetchLogRetention(); }, []); const logRetentionSettings = logRetention?.[type]; @@ -72,24 +72,22 @@ export const LogRetentionCallout: React.FC = ({ type }) => { ) } > - {canManageLogSettings && ( -

- - {i18n.translate( - 'xpack.enterpriseSearch.appSearch.logRetention.callout.description.manageSettingsLinkText', - { defaultMessage: 'visit your settings' } - )} - - ), - }} - /> -

- )} +

+ + {i18n.translate( + 'xpack.enterpriseSearch.appSearch.logRetention.callout.description.manageSettingsLinkText', + { defaultMessage: 'visit your settings' } + )} + + ), + }} + /> +

diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/components/log_retention_tooltip.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/components/log_retention_tooltip.test.tsx index 854a9f1d8d162f..6b5693e4c301e1 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/components/log_retention_tooltip.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/components/log_retention_tooltip.test.tsx @@ -19,7 +19,10 @@ import { LogRetentionOptions, LogRetentionMessage } from '../'; import { LogRetentionTooltip } from './'; describe('LogRetentionTooltip', () => { - const values = { logRetention: {} }; + const values = { + logRetention: {}, + myRole: { canManageLogSettings: true }, + }; const actions = { fetchLogRetention: jest.fn() }; beforeEach(() => { @@ -53,7 +56,7 @@ describe('LogRetentionTooltip', () => { }); it('does not render if log retention is not available', () => { - setMockValues({ logRetention: null }); + setMockValues({ ...values, logRetention: null }); const wrapper = mount(); expect(wrapper.isEmptyRender()).toBe(true); @@ -61,14 +64,21 @@ describe('LogRetentionTooltip', () => { describe('on mount', () => { it('fetches log retention data when not already loaded', () => { - setMockValues({ logRetention: null }); + setMockValues({ ...values, logRetention: null }); shallow(); expect(actions.fetchLogRetention).toHaveBeenCalled(); }); it('does not fetch log retention data if it has already been loaded', () => { - setMockValues({ logRetention: {} }); + setMockValues({ ...values, logRetention: {} }); + shallow(); + + expect(actions.fetchLogRetention).not.toHaveBeenCalled(); + }); + + it('does not fetch log retention data if the user does not have access to log settings', () => { + setMockValues({ ...values, logRetention: null, myRole: { canManageLogSettings: false } }); shallow(); expect(actions.fetchLogRetention).not.toHaveBeenCalled(); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/components/log_retention_tooltip.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/components/log_retention_tooltip.tsx index bf074ba0272f2b..ac701d4cc067b7 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/components/log_retention_tooltip.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/components/log_retention_tooltip.tsx @@ -12,7 +12,9 @@ import { useValues, useActions } from 'kea'; import { EuiIconTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { LogRetentionLogic, LogRetentionMessage, LogRetentionOptions } from '../'; +import { AppLogic } from '../../../app_logic'; + +import { LogRetentionLogic, LogRetentionMessage, LogRetentionOptions } from '../index'; interface Props { type: LogRetentionOptions; @@ -21,11 +23,14 @@ interface Props { export const LogRetentionTooltip: React.FC = ({ type, position = 'bottom' }) => { const { fetchLogRetention } = useActions(LogRetentionLogic); const { logRetention } = useValues(LogRetentionLogic); + const { + myRole: { canManageLogSettings }, + } = useValues(AppLogic); const hasLogRetention = logRetention !== null; useEffect(() => { - if (!hasLogRetention) fetchLogRetention(); + if (!hasLogRetention && canManageLogSettings) fetchLogRetention(); }, []); return hasLogRetention ? ( diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/log_retention_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/log_retention_logic.test.ts index 19bd2af50aad97..57f3f46fed92e7 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/log_retention_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/log_retention_logic.test.ts @@ -107,21 +107,6 @@ describe('LogRetentionLogic', () => { }); }); - describe('setLogRetentionUpdating', () => { - describe('isLogRetentionUpdating', () => { - it('sets isLogRetentionUpdating to true', () => { - mount(); - - LogRetentionLogic.actions.setLogRetentionUpdating(); - - expect(LogRetentionLogic.values).toEqual({ - ...DEFAULT_VALUES, - isLogRetentionUpdating: true, - }); - }); - }); - }); - describe('clearLogRetentionUpdating', () => { describe('isLogRetentionUpdating', () => { it('resets isLogRetentionUpdating to false', () => { @@ -177,7 +162,9 @@ describe('LogRetentionLogic', () => { }); }); }); + }); + describe('listeners', () => { describe('saveLogRetention', () => { beforeEach(() => { mount(); @@ -264,11 +251,61 @@ describe('LogRetentionLogic', () => { LogRetentionOptions.Analytics ); }); + + it('will call saveLogRetention if NOT already enabled', () => { + mount({ + logRetention: { + [LogRetentionOptions.Analytics]: { + enabled: false, + }, + }, + }); + jest.spyOn(LogRetentionLogic.actions, 'saveLogRetention'); + + LogRetentionLogic.actions.toggleLogRetention(LogRetentionOptions.Analytics); + + expect(LogRetentionLogic.actions.saveLogRetention).toHaveBeenCalledWith( + LogRetentionOptions.Analytics, + true + ); + }); + + it('will do nothing if logRetention option is not yet set', () => { + mount({ + logRetention: {}, + }); + jest.spyOn(LogRetentionLogic.actions, 'saveLogRetention'); + jest.spyOn(LogRetentionLogic.actions, 'setOpenedModal'); + + LogRetentionLogic.actions.toggleLogRetention(LogRetentionOptions.API); + + expect(LogRetentionLogic.actions.saveLogRetention).not.toHaveBeenCalled(); + expect(LogRetentionLogic.actions.setOpenedModal).not.toHaveBeenCalled(); + }); }); describe('fetchLogRetention', () => { + beforeAll(() => jest.useFakeTimers()); + afterAll(() => jest.useRealTimers()); + + describe('isLogRetentionUpdating', () => { + it('sets isLogRetentionUpdating to true', () => { + mount({ + isLogRetentionUpdating: false, + }); + + LogRetentionLogic.actions.fetchLogRetention(); + + expect(LogRetentionLogic.values).toEqual({ + ...DEFAULT_VALUES, + isLogRetentionUpdating: true, + }); + }); + }); + it('will call an API endpoint and update log retention', async () => { mount(); + jest.spyOn(LogRetentionLogic.actions, 'clearLogRetentionUpdating'); jest .spyOn(LogRetentionLogic.actions, 'updateLogRetention') .mockImplementationOnce(() => {}); @@ -276,14 +313,14 @@ describe('LogRetentionLogic', () => { http.get.mockReturnValue(Promise.resolve(TYPICAL_SERVER_LOG_RETENTION)); LogRetentionLogic.actions.fetchLogRetention(); - expect(LogRetentionLogic.values.isLogRetentionUpdating).toBe(true); + jest.runAllTimers(); + await nextTick(); expect(http.get).toHaveBeenCalledWith('/api/app_search/log_settings'); - await nextTick(); expect(LogRetentionLogic.actions.updateLogRetention).toHaveBeenCalledWith( TYPICAL_CLIENT_LOG_RETENTION ); - expect(LogRetentionLogic.values.isLogRetentionUpdating).toBe(false); + expect(LogRetentionLogic.actions.clearLogRetentionUpdating).toHaveBeenCalled(); }); it('handles errors', async () => { @@ -292,50 +329,12 @@ describe('LogRetentionLogic', () => { http.get.mockReturnValue(Promise.reject('An error occured')); LogRetentionLogic.actions.fetchLogRetention(); + jest.runAllTimers(); await nextTick(); expect(flashAPIErrors).toHaveBeenCalledWith('An error occured'); expect(LogRetentionLogic.actions.clearLogRetentionUpdating).toHaveBeenCalled(); }); - - it('does not run if isLogRetentionUpdating is true, preventing duplicate fetches', async () => { - mount({ isLogRetentionUpdating: true }); - - LogRetentionLogic.actions.fetchLogRetention(); - - expect(http.get).not.toHaveBeenCalled(); - }); - }); - - it('will call saveLogRetention if NOT already enabled', () => { - mount({ - logRetention: { - [LogRetentionOptions.Analytics]: { - enabled: false, - }, - }, - }); - jest.spyOn(LogRetentionLogic.actions, 'saveLogRetention'); - - LogRetentionLogic.actions.toggleLogRetention(LogRetentionOptions.Analytics); - - expect(LogRetentionLogic.actions.saveLogRetention).toHaveBeenCalledWith( - LogRetentionOptions.Analytics, - true - ); - }); - - it('will do nothing if logRetention option is not yet set', () => { - mount({ - logRetention: {}, - }); - jest.spyOn(LogRetentionLogic.actions, 'saveLogRetention'); - jest.spyOn(LogRetentionLogic.actions, 'setOpenedModal'); - - LogRetentionLogic.actions.toggleLogRetention(LogRetentionOptions.API); - - expect(LogRetentionLogic.actions.saveLogRetention).not.toHaveBeenCalled(); - expect(LogRetentionLogic.actions.setOpenedModal).not.toHaveBeenCalled(); }); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/log_retention_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/log_retention_logic.ts index ec078842dab557..aa1be3f8cdc641 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/log_retention_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/log_retention_logic.ts @@ -14,7 +14,6 @@ import { LogRetentionOptions, LogRetention, LogRetentionServer } from './types'; import { convertLogRetentionFromServerToClient } from './utils/convert_log_retention'; interface LogRetentionActions { - setLogRetentionUpdating(): void; clearLogRetentionUpdating(): void; closeModals(): void; fetchLogRetention(): void; @@ -36,7 +35,6 @@ interface LogRetentionValues { export const LogRetentionLogic = kea>({ path: ['enterprise_search', 'app_search', 'log_retention_logic'], actions: () => ({ - setLogRetentionUpdating: true, clearLogRetentionUpdating: true, closeModals: true, fetchLogRetention: true, @@ -57,7 +55,7 @@ export const LogRetentionLogic = kea false, closeModals: () => false, - setLogRetentionUpdating: () => true, + fetchLogRetention: () => true, toggleLogRetention: () => true, }, ], @@ -71,12 +69,10 @@ export const LogRetentionLogic = kea ({ - fetchLogRetention: async () => { - if (values.isLogRetentionUpdating) return; // Prevent duplicate calls to the API + fetchLogRetention: async (_, breakpoint) => { + await breakpoint(100); // Prevents duplicate calls to the API (e.g., when a tooltip & callout are on the same page) try { - actions.setLogRetentionUpdating(); - const { http } = HttpLogic.values; const response = await http.get('/api/app_search/log_settings'); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/boosts/boost_item.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/boosts/boost_item.test.tsx new file mode 100644 index 00000000000000..7ee921eef0e096 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/boosts/boost_item.test.tsx @@ -0,0 +1,59 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +import { shallow, ShallowWrapper } from 'enzyme'; + +import { EuiAccordion } from '@elastic/eui'; + +import { BoostIcon } from '../boost_icon'; +import { BoostType } from '../types'; + +import { ValueBadge } from '../value_badge'; + +import { BoostItem } from './boost_item'; +import { BoostItemContent } from './boost_item_content'; + +describe('BoostItem', () => { + const boost = { + factor: 2, + type: BoostType.Value, + newBoost: true, + value: [''], + }; + + let wrapper: ShallowWrapper; + let accordian: ShallowWrapper; + + beforeAll(() => { + wrapper = shallow(); + accordian = wrapper.find(EuiAccordion) as ShallowWrapper; + }); + + it('renders an accordion as open if it is a newly created boost', () => { + expect(accordian.prop('initialIsOpen')).toEqual(boost.newBoost); + }); + + it('renders an accordion button which shows a summary of the boost', () => { + const buttonContent = shallow( + accordian.prop('buttonContent') as React.ReactElement + ) as ShallowWrapper; + + expect(buttonContent.find(BoostIcon).prop('type')).toEqual('value'); + expect(buttonContent.find(ValueBadge).children().text()).toEqual('2'); + }); + + it('renders boost content inside of the accordion', () => { + const content = wrapper.find(BoostItemContent); + expect(content.props()).toEqual({ + boost, + index: 1, + name: 'foo', + }); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/boosts/boost_item.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/boosts/boost_item.tsx index 1dea62b2fd4785..98d83619866d18 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/boosts/boost_item.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/boosts/boost_item.tsx @@ -32,6 +32,7 @@ export const BoostItem: React.FC = ({ id, boost, index, name }) => { id={id} className="boosts__item" buttonContentClassName="boosts__itemButton" + initialIsOpen={!!boost.newBoost} buttonContent={ diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/boosts/boost_item_content/boost_item_content.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/boosts/boost_item_content/boost_item_content.test.tsx index a16620e75412d1..e21f46c6748dde 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/boosts/boost_item_content/boost_item_content.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/boosts/boost_item_content/boost_item_content.test.tsx @@ -35,6 +35,7 @@ describe('BoostItemContent', () => { const boost = { factor: 2, type: 'value' as BoostType, + value: [''], }; const wrapper = shallow(); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/boosts/boost_item_content/value_boost_form.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/boosts/boost_item_content/value_boost_form.test.tsx index 32d27ff013a0e8..6fbf90e6a2000a 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/boosts/boost_item_content/value_boost_form.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/boosts/boost_item_content/value_boost_form.test.tsx @@ -50,20 +50,6 @@ describe('ValueBoostForm', () => { expect(valueInput(wrapper, 2).prop('value')).toEqual('baz'); }); - it('renders a single empty text box if the boost has no value', () => { - const wrapper = shallow( - - ); - expect(valueInput(wrapper, 0).prop('value')).toEqual(''); - }); - it('updates the corresponding value in state whenever a user changes the value in a text input', () => { const wrapper = shallow(); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/boosts/boost_item_content/value_boost_form.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/boosts/boost_item_content/value_boost_form.tsx index cd65f2842a5f7f..48d9749029a7e7 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/boosts/boost_item_content/value_boost_form.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/boosts/boost_item_content/value_boost_form.tsx @@ -30,7 +30,7 @@ interface Props { export const ValueBoostForm: React.FC = ({ boost, index, name }) => { const { updateBoostValue, removeBoostValue, addBoostValue } = useActions(RelevanceTuningLogic); - const values = boost.value || ['']; + const values = boost.value; return ( <> diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/boosts/boosts.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/boosts/boosts.test.tsx index 9f6e194f927356..897639fe9e6bce 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/boosts/boosts.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/boosts/boosts.test.tsx @@ -108,6 +108,7 @@ describe('Boosts', () => { const boost1 = { factor: 2, type: 'value' as BoostType, + value: [''], }; const boost2 = { factor: 10, diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/constants.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/constants.ts index 181ecad9e99903..796bc9242dd98b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/constants.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/constants.ts @@ -83,6 +83,7 @@ export const BOOST_TYPE_TO_ICON_MAP = { const EMPTY_VALUE_BOOST: ValueBoost = { type: BoostType.Value, factor: 1, + value: [''], newBoost: true, function: undefined, operation: undefined, diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_form/relevance_tuning_form.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_form/relevance_tuning_form.test.tsx index 2857b227749449..68d1b7439be5c5 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_form/relevance_tuning_form.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_form/relevance_tuning_form.test.tsx @@ -34,6 +34,7 @@ describe('RelevanceTuningForm', () => { { factor: 2, type: BoostType.Value, + value: [], }, ], }, @@ -85,6 +86,7 @@ describe('RelevanceTuningForm', () => { { factor: 2, type: BoostType.Value, + value: [], }, ]); expect(relevantTuningItems.at(1).prop('boosts')).toBeUndefined(); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_form/relevance_tuning_item.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_form/relevance_tuning_item.test.tsx index 674bb91929a764..97913ed49fefd9 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_form/relevance_tuning_item.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_form/relevance_tuning_item.test.tsx @@ -25,6 +25,7 @@ describe('RelevanceTuningItem', () => { { factor: 2, type: BoostType.Value, + value: [''], }, ], field: { @@ -54,6 +55,7 @@ describe('RelevanceTuningItem', () => { { factor: 2, type: BoostType.Value, + value: [''], }, { factor: 3, diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_form/relevance_tuning_item_content/relevance_tuning_item_content.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_form/relevance_tuning_item_content/relevance_tuning_item_content.test.tsx index 18a75766cd67be..65a42216e17ff8 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_form/relevance_tuning_item_content/relevance_tuning_item_content.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_form/relevance_tuning_item_content/relevance_tuning_item_content.test.tsx @@ -24,6 +24,7 @@ describe('RelevanceTuningItemContent', () => { { factor: 2, type: BoostType.Value, + value: [''], }, ], field: { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.test.ts index f0fe98f3f0a878..ca9b0a886fdd1b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.test.ts @@ -23,6 +23,7 @@ describe('RelevanceTuningLogic', () => { { type: BoostType.Value, factor: 5, + value: [], }, ], }, @@ -224,7 +225,7 @@ describe('RelevanceTuningLogic', () => { describe('listeners', () => { const { http } = mockHttpValues; - const { flashAPIErrors, setSuccessMessage } = mockFlashMessageHelpers; + const { flashAPIErrors, setSuccessMessage, clearFlashMessages } = mockFlashMessageHelpers; let scrollToSpy: jest.SpyInstance; let confirmSpy: jest.SpyInstance; @@ -316,7 +317,7 @@ describe('RelevanceTuningLogic', () => { jest.useRealTimers(); }); - it('should make an API call and set state based on the response', async () => { + it('should make an API call, set state based on the response, and clear flash messages', async () => { const searchSettingsWithNewBoostProp = { boosts: { foo: [ @@ -324,6 +325,7 @@ describe('RelevanceTuningLogic', () => { type: BoostType.Value, factor: 5, newBoost: true, // This should be deleted before sent to the server + value: ['test'], }, ], }, @@ -341,6 +343,7 @@ describe('RelevanceTuningLogic', () => { { type: BoostType.Value, factor: 5, + value: ['test'], }, ], }, @@ -373,6 +376,7 @@ describe('RelevanceTuningLogic', () => { } ); expect(RelevanceTuningLogic.actions.setSearchResults).toHaveBeenCalledWith(searchResults); + expect(clearFlashMessages).toHaveBeenCalled(); }); it("won't send boosts or search_fields on the API call if there are none", async () => { @@ -481,6 +485,7 @@ describe('RelevanceTuningLogic', () => { type: BoostType.Value, factor: 5, newBoost: true, // This should be deleted before sent to the server + value: [''], }, ], }, @@ -492,6 +497,7 @@ describe('RelevanceTuningLogic', () => { { type: BoostType.Value, factor: 5, + value: [''], }, ], }, @@ -698,6 +704,7 @@ describe('RelevanceTuningLogic', () => { { factor: 2, type: BoostType.Value, + value: [''], }, ], }, @@ -714,6 +721,7 @@ describe('RelevanceTuningLogic', () => { { factor: 2, type: BoostType.Value, + value: [''], }, { factor: 1, @@ -771,6 +779,7 @@ describe('RelevanceTuningLogic', () => { { factor: 2, type: BoostType.Value, + value: [''], }, ], }, diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.ts index 588b100416d10c..b87fef91c7d21e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.ts @@ -8,7 +8,11 @@ import { kea, MakeLogicType } from 'kea'; import { omit, cloneDeep, isEmpty } from 'lodash'; -import { setSuccessMessage, flashAPIErrors } from '../../../shared/flash_messages'; +import { + setSuccessMessage, + flashAPIErrors, + clearFlashMessages, +} from '../../../shared/flash_messages'; import { HttpLogic } from '../../../shared/http'; import { Schema, SchemaConflicts } from '../../../shared/types'; @@ -28,6 +32,7 @@ import { parseBoostCenter, removeBoostStateProps, normalizeBoostValues, + removeEmptyValueBoosts, } from './utils'; interface RelevanceTuningProps { @@ -273,18 +278,21 @@ export const RelevanceTuningLogic = kea< actions.setResultsLoading(true); + const filteredBoosts = removeEmptyValueBoosts(boosts); + try { const response = await http.post(url, { query: { query, }, body: JSON.stringify({ - boosts: isEmpty(boosts) ? undefined : boosts, + boosts: isEmpty(filteredBoosts) ? undefined : filteredBoosts, search_fields: isEmpty(searchFields) ? undefined : searchFields, }), }); actions.setSearchResults(response.results); + clearFlashMessages(); } catch (e) { flashAPIErrors(e); } diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/types.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/types.ts index ec42df218878f9..58e589d606e4b7 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/types.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/types.ts @@ -45,7 +45,7 @@ export interface RawBoost extends Omit { } export interface ValueBoost extends Boost { - value?: string[]; + value: string[]; operation: undefined; function: undefined; } diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/utils.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/utils.test.ts index 1694015ed68615..b5df8bf0c667a4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/utils.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/utils.test.ts @@ -4,12 +4,13 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { BoostType } from './types'; +import { Boost, BoostType } from './types'; import { filterIfTerm, normalizeBoostValues, removeBoostStateProps, parseBoostCenter, + removeEmptyValueBoosts, } from './utils'; describe('filterIfTerm', () => { @@ -42,6 +43,7 @@ describe('removeBoostStateProps', () => { type: BoostType.Value, factor: 5, newBoost: true, + value: [''], }, ], }, @@ -58,6 +60,7 @@ describe('removeBoostStateProps', () => { { type: BoostType.Value, factor: 5, + value: [''], }, ], }, @@ -152,3 +155,31 @@ describe('normalizeBoostValues', () => { }); }); }); + +describe('removeEmptyValueBoosts', () => { + const boosts: Record = { + bar: [ + { factor: 9.5, type: BoostType.Proximity }, + { type: BoostType.Functional, factor: 5 }, + ], + foo: [ + { factor: 9.5, type: BoostType.Value, value: ['1'] }, + { factor: 9.5, type: BoostType.Value, value: ['1', '', ' '] }, + { factor: 9.5, type: BoostType.Value, value: [] }, + { factor: 9.5, type: BoostType.Value, value: ['', '1'] }, + ], + baz: [{ factor: 9.5, type: BoostType.Value, value: [''] }], + }; + + expect(removeEmptyValueBoosts(boosts)).toEqual({ + bar: [ + { factor: 9.5, type: BoostType.Proximity }, + { type: BoostType.Functional, factor: 5 }, + ], + foo: [ + { factor: 9.5, type: BoostType.Value, value: ['1'] }, + { factor: 9.5, type: BoostType.Value, value: ['1'] }, + { factor: 9.5, type: BoostType.Value, value: ['1'] }, + ], + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/utils.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/utils.ts index e2fd0f0bbd6569..5aaab80778e02b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/utils.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/utils.ts @@ -10,7 +10,7 @@ import { cloneDeep, omit } from 'lodash'; import { NUMBER } from '../../../shared/constants/field_types'; import { SchemaTypes } from '../../../shared/types'; -import { RawBoost, Boost, SearchSettings, BoostType } from './types'; +import { RawBoost, Boost, SearchSettings, BoostType, ValueBoost } from './types'; // If the user hasn't entered a filter, then we can skip filtering the array entirely export const filterIfTerm = (array: string[], filterTerm: string): string[] => { @@ -61,3 +61,41 @@ export const normalizeBoostValues = (boosts: Record): Record [fieldName]: boostList.map(normalizeBoostValue), }; }, {}); + +// Our model allows for empty values to be added to boosts. However, the server will not accept +// empty strings in values. To avoid that, we filter out empty values before sending them to the server. + +// I.e., the server will not accept any of the following, so we need to filter them out +// value: undefined +// value: [] +// value: [''] +// value: ['foo', ''] +export const removeEmptyValueBoosts = ( + boosts: Record +): Record => { + // before: + // { foo: { values: ['a', '', ' '] } } + // { foo: { values: [''] } } + // after: + // { foo: { values: ['a'] } } + const filterEmptyValueBoosts = (fieldBoosts: Boost[]) => { + return fieldBoosts.filter((boost: Boost) => { + if (boost.type !== BoostType.Value) return true; + + const valueBoost = boost as ValueBoost; + const filteredValues = valueBoost.value.filter((value) => value.trim() !== ''); + + if (filteredValues.length) { + boost.value = filteredValues; + return true; + } else { + return false; + } + }); + }; + + return Object.entries(boosts).reduce((acc, [fieldName, fieldBoosts]) => { + const updatedBoosts = filterEmptyValueBoosts(fieldBoosts); + return updatedBoosts.length ? { ...acc, [fieldName]: updatedBoosts } : acc; + }, {}); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/constants.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/constants.ts index 6232ba0fb4668c..1fed750a86dc4f 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/constants.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/constants.ts @@ -7,9 +7,32 @@ import { i18n } from '@kbn/i18n'; -export const ROLE_MAPPINGS_TITLE = i18n.translate( - 'xpack.enterpriseSearch.appSearch.roleMappings.title', - { defaultMessage: 'Role Mappings' } +import { AdvanceRoleType } from '../../types'; + +export const SAVE_ROLE_MAPPING = i18n.translate( + 'xpack.enterpriseSearch.appSearch.roleMapping.saveRoleMappingButtonLabel', + { defaultMessage: 'Save role mapping' } +); +export const UPDATE_ROLE_MAPPING = i18n.translate( + 'xpack.enterpriseSearch.appSearch.roleMapping.updateRoleMappingButtonLabel', + { defaultMessage: 'Update role mapping' } +); + +export const ADD_ROLE_MAPPING_TITLE = i18n.translate( + 'xpack.enterpriseSearch.appSearch.roleMapping.newRoleMappingTitle', + { defaultMessage: 'Add role mapping' } +); +export const MANAGE_ROLE_MAPPING_TITLE = i18n.translate( + 'xpack.enterpriseSearch.appSearch.roleMapping.manageRoleMappingTitle', + { defaultMessage: 'Manage role mapping' } +); + +export const EMPTY_ROLE_MAPPINGS_BODY = i18n.translate( + 'xpack.enterpriseSearch.appSearch.roleMapping.emptyRoleMappingsBody', + { + defaultMessage: + 'All users who successfully authenticate will be assigned the Owner role and have access to all engines. Add a new role to override the default.', + } ); export const DELETE_ROLE_MAPPING_MESSAGE = i18n.translate( @@ -40,3 +63,146 @@ export const ROLE_MAPPING_UPDATED_MESSAGE = i18n.translate( defaultMessage: 'Role mapping successfully updated.', } ); + +export const ROLE_MAPPINGS_ENGINE_ACCESS_HEADING = i18n.translate( + 'xpack.enterpriseSearch.appSearch.roleMappingsEngineAccessHeading', + { + defaultMessage: 'Engine access', + } +); + +export const ROLE_MAPPINGS_RESET_BUTTON = i18n.translate( + 'xpack.enterpriseSearch.appSearch.roleMappingsResetButton', + { + defaultMessage: 'Reset mappings', + } +); + +export const ROLE_MAPPINGS_RESET_CONFIRM_TITLE = i18n.translate( + 'xpack.enterpriseSearch.appSearch.roleMappingsResetConfirmTitle', + { + defaultMessage: 'Are you sure you want to reset role mappings?', + } +); + +export const ROLE_MAPPINGS_RESET_CONFIRM_BUTTON = i18n.translate( + 'xpack.enterpriseSearch.appSearch.roleMappingsResetConfirmButton', + { + defaultMessage: 'Reset role mappings', + } +); + +export const ROLE_MAPPINGS_RESET_CANCEL_BUTTON = i18n.translate( + 'xpack.enterpriseSearch.appSearch.roleMappingsResetCancelButton', + { + defaultMessage: 'Cancel', + } +); + +export const DEV_ROLE_TYPE_DESCRIPTION = i18n.translate( + 'xpack.enterpriseSearch.appSearch.DEV_ROLE_TYPE_DESCRIPTION', + { + defaultMessage: 'Devs can manage all aspects of an engine.', + } +); + +export const EDITOR_ROLE_TYPE_DESCRIPTION = i18n.translate( + 'xpack.enterpriseSearch.appSearch.editorRoleTypeDescription', + { + defaultMessage: 'Editors can manage search settings.', + } +); + +export const ANALYST_ROLE_TYPE_DESCRIPTION = i18n.translate( + 'xpack.enterpriseSearch.appSearch.analystRoleTypeDescription', + { + defaultMessage: 'Analysts can only view documents, query tester, and analytics.', + } +); + +export const OWNER_ROLE_TYPE_DESCRIPTION = i18n.translate( + 'xpack.enterpriseSearch.appSearch.ownerRoleTypeDescription', + { + defaultMessage: + 'Owners can do anything. There can be many owners on the account, but there must be at least one owner at any time.', + } +); + +export const ADMIN_ROLE_TYPE_DESCRIPTION = i18n.translate( + 'xpack.enterpriseSearch.appSearch.adminRoleTypeDescription', + { + defaultMessage: 'Admins can do anything, except manage account settings.', + } +); + +export const ADVANCED_ROLE_SELECTORS_TITLE = i18n.translate( + 'xpack.enterpriseSearch.appSearch.advancedRoleSelectorsTitle', + { + defaultMessage: 'Full or limited engine access', + } +); + +export const ROLE_TITLE = i18n.translate('xpack.enterpriseSearch.appSearch.roleTitle', { + defaultMessage: 'Role', +}); + +export const FULL_ENGINE_ACCESS_TITLE = i18n.translate( + 'xpack.enterpriseSearch.appSearch.fullEngineAccessTitle', + { + defaultMessage: 'Full engine access', + } +); + +export const FULL_ENGINE_ACCESS_DESCRIPTION = i18n.translate( + 'xpack.enterpriseSearch.appSearch.fullEngineAccessDescription', + { + defaultMessage: 'Access to all current and future engines.', + } +); + +export const LIMITED_ENGINE_ACCESS_TITLE = i18n.translate( + 'xpack.enterpriseSearch.appSearch.limitedEngineAccessTitle', + { + defaultMessage: 'Limited engine access', + } +); + +export const LIMITED_ENGINE_ACCESS_DESCRIPTION = i18n.translate( + 'xpack.enterpriseSearch.appSearch.limitedEngineAccessDescription', + { + defaultMessage: 'Limit user access to specific engines:', + } +); + +export const ENGINE_ACCESS_TITLE = i18n.translate( + 'xpack.enterpriseSearch.appSearch.engineAccessTitle', + { + defaultMessage: 'Engine access', + } +); + +export const ADVANCED_ROLE_TYPES = [ + { + type: 'dev', + description: DEV_ROLE_TYPE_DESCRIPTION, + }, + { + type: 'editor', + description: EDITOR_ROLE_TYPE_DESCRIPTION, + }, + { + type: 'analyst', + description: ANALYST_ROLE_TYPE_DESCRIPTION, + }, +] as AdvanceRoleType[]; + +export const STANDARD_ROLE_TYPES = [ + { + type: 'owner', + description: OWNER_ROLE_TYPE_DESCRIPTION, + }, + { + type: 'admin', + description: ADMIN_ROLE_TYPE_DESCRIPTION, + }, +] as AdvanceRoleType[]; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/index.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/index.ts index 91159ea9646ead..ce4b1de6e399d8 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/index.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/index.ts @@ -5,4 +5,4 @@ * 2.0. */ -export { ROLE_MAPPINGS_TITLE } from './constants'; +export { RoleMappingsRouter } from './role_mappings_router'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mapping.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mapping.test.tsx new file mode 100644 index 00000000000000..f50fc21d5ba58d --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mapping.test.tsx @@ -0,0 +1,106 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import '../../../__mocks__/shallow_useeffect.mock'; +import { DEFAULT_INITIAL_APP_DATA } from '../../../../../common/__mocks__'; +import { setMockActions, setMockValues } from '../../../__mocks__'; +import { engines } from '../../__mocks__/engines.mock'; + +import React from 'react'; + +import { shallow } from 'enzyme'; + +import { EuiCheckbox } from '@elastic/eui'; + +import { Loading } from '../../../shared/loading'; +import { + AttributeSelector, + DeleteMappingCallout, + RoleSelector, +} from '../../../shared/role_mapping'; +import { asRoleMapping } from '../../../shared/role_mapping/__mocks__/roles'; + +import { RoleMapping } from './role_mapping'; + +describe('RoleMapping', () => { + const mockRole = DEFAULT_INITIAL_APP_DATA.appSearch.role; + const actions = { + initializeRoleMappings: jest.fn(), + initializeRoleMapping: jest.fn(), + handleSaveMapping: jest.fn(), + handleEngineSelectionChange: jest.fn(), + handleAccessAllEnginesChange: jest.fn(), + handleAttributeValueChange: jest.fn(), + handleAttributeSelectorChange: jest.fn(), + handleDeleteMapping: jest.fn(), + handleRoleChange: jest.fn(), + handleAuthProviderChange: jest.fn(), + resetState: jest.fn(), + }; + + const mockValues = { + attributes: [], + elasticsearchRoles: [], + hasAdvancedRoles: true, + dataLoading: false, + roleType: 'admin', + roleMappings: [asRoleMapping], + attributeValue: '', + attributeName: 'username', + availableEngines: engines, + selectedEngines: new Set(), + accessAllEngines: false, + availableAuthProviders: [], + multipleAuthProvidersConfig: true, + selectedAuthProviders: [], + myRole: { + availableRoleTypes: mockRole.ability.availableRoleTypes, + }, + }; + + beforeEach(() => { + setMockActions(actions); + setMockValues(mockValues); + }); + + it('renders', () => { + const wrapper = shallow(); + + expect(wrapper.find(AttributeSelector)).toHaveLength(1); + expect(wrapper.find(RoleSelector)).toHaveLength(5); + }); + + it('returns Loading when loading', () => { + setMockValues({ ...mockValues, dataLoading: true }); + const wrapper = shallow(); + + expect(wrapper.find(Loading)).toHaveLength(1); + }); + + it('renders DeleteMappingCallout for existing mapping', () => { + setMockValues({ ...mockValues, roleMapping: asRoleMapping }); + const wrapper = shallow(); + + expect(wrapper.find(DeleteMappingCallout)).toHaveLength(1); + }); + + it('hides DeleteMappingCallout for new mapping', () => { + const wrapper = shallow(); + + expect(wrapper.find(DeleteMappingCallout)).toHaveLength(0); + }); + + it('handles engine checkbox click', () => { + const wrapper = shallow(); + wrapper + .find(EuiCheckbox) + .first() + .simulate('change', { target: { checked: true } }); + + expect(actions.handleEngineSelectionChange).toHaveBeenCalledWith(engines[0].name, true); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mapping.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mapping.tsx new file mode 100644 index 00000000000000..bfa3fefb2732d3 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mapping.tsx @@ -0,0 +1,246 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useEffect } from 'react'; + +import { useParams } from 'react-router-dom'; + +import { useActions, useValues } from 'kea'; + +import { + EuiButton, + EuiCheckbox, + EuiFlexGroup, + EuiFlexItem, + EuiFormRow, + EuiPageContentBody, + EuiPageHeader, + EuiPanel, + EuiRadio, + EuiSpacer, + EuiTitle, +} from '@elastic/eui'; + +import { FlashMessages } from '../../../shared/flash_messages'; +import { SetAppSearchChrome as SetPageChrome } from '../../../shared/kibana_chrome'; +import { Loading } from '../../../shared/loading'; +import { + AttributeSelector, + DeleteMappingCallout, + RoleSelector, +} from '../../../shared/role_mapping'; +import { ROLE_MAPPINGS_TITLE } from '../../../shared/role_mapping/constants'; +import { AppLogic } from '../../app_logic'; + +import { roleHasScopedEngines } from '../../utils/role/has_scoped_engines'; +import { Engine } from '../engine/types'; + +import { + SAVE_ROLE_MAPPING, + UPDATE_ROLE_MAPPING, + ADD_ROLE_MAPPING_TITLE, + MANAGE_ROLE_MAPPING_TITLE, + ADVANCED_ROLE_TYPES, + STANDARD_ROLE_TYPES, + ADVANCED_ROLE_SELECTORS_TITLE, + ROLE_TITLE, + FULL_ENGINE_ACCESS_TITLE, + FULL_ENGINE_ACCESS_DESCRIPTION, + LIMITED_ENGINE_ACCESS_TITLE, + LIMITED_ENGINE_ACCESS_DESCRIPTION, + ENGINE_ACCESS_TITLE, +} from './constants'; +import { RoleMappingsLogic } from './role_mappings_logic'; + +interface RoleMappingProps { + isNew?: boolean; +} + +export const RoleMapping: React.FC = ({ isNew }) => { + const { roleId } = useParams() as { roleId: string }; + const { myRole } = useValues(AppLogic); + + const { + handleAccessAllEnginesChange, + handleAttributeSelectorChange, + handleAttributeValueChange, + handleAuthProviderChange, + handleDeleteMapping, + handleEngineSelectionChange, + handleRoleChange, + handleSaveMapping, + initializeRoleMapping, + resetState, + } = useActions(RoleMappingsLogic); + + const { + accessAllEngines, + attributeName, + attributeValue, + attributes, + availableAuthProviders, + availableEngines, + dataLoading, + elasticsearchRoles, + hasAdvancedRoles, + multipleAuthProvidersConfig, + roleMapping, + roleType, + selectedEngines, + selectedAuthProviders, + } = useValues(RoleMappingsLogic); + + useEffect(() => { + initializeRoleMapping(roleId); + return resetState; + }, []); + + if (dataLoading) return ; + + const SAVE_ROLE_MAPPING_LABEL = isNew ? SAVE_ROLE_MAPPING : UPDATE_ROLE_MAPPING; + const TITLE = isNew ? ADD_ROLE_MAPPING_TITLE : MANAGE_ROLE_MAPPING_TITLE; + + const saveRoleMappingButton = ( + + {SAVE_ROLE_MAPPING_LABEL} + + ); + + const engineSelector = (engine: Engine) => ( + { + handleEngineSelectionChange(engine.name, e.target.checked); + }} + label={engine.name} + /> + ); + + const advancedRoleSelectors = ( + <> + + +

{ADVANCED_ROLE_SELECTORS_TITLE}

+
+ + {ADVANCED_ROLE_TYPES.map(({ type, description }) => ( + + ))} + + ); + + return ( + <> + + + + + + + + + + + +

{ROLE_TITLE}

+
+ + +

{FULL_ENGINE_ACCESS_TITLE}

+
+ + export{' '} + {STANDARD_ROLE_TYPES.map(({ type, description }) => ( + + ))} + {hasAdvancedRoles && advancedRoleSelectors} +
+
+ {hasAdvancedRoles && ( + + + +

{ENGINE_ACCESS_TITLE}

+
+ + + + +

{FULL_ENGINE_ACCESS_TITLE}

+
+

{FULL_ENGINE_ACCESS_DESCRIPTION}

+ + } + /> +
+ + <> + + +

{LIMITED_ENGINE_ACCESS_TITLE}

+
+

{LIMITED_ENGINE_ACCESS_DESCRIPTION}

+ + } + /> + {!accessAllEngines && ( +
+ {availableEngines.map((engine) => engineSelector(engine))} +
+ )} + +
+
+
+ )} +
+ + {roleMapping && } +
+ + ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings.test.tsx new file mode 100644 index 00000000000000..9275ba0cd16dbd --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings.test.tsx @@ -0,0 +1,88 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import '../../../__mocks__/shallow_useeffect.mock'; +import { setMockActions, setMockValues } from '../../../__mocks__'; + +import React, { MouseEvent } from 'react'; + +import { shallow, ShallowWrapper } from 'enzyme'; + +import { EuiEmptyPrompt, EuiConfirmModal, EuiPageHeader } from '@elastic/eui'; + +import { Loading } from '../../../shared/loading'; +import { RoleMappingsTable } from '../../../shared/role_mapping'; +import { wsRoleMapping } from '../../../shared/role_mapping/__mocks__/roles'; + +import { RoleMappings } from './role_mappings'; + +describe('RoleMappings', () => { + const initializeRoleMappings = jest.fn(); + const handleResetMappings = jest.fn(); + const mockValues = { + roleMappings: [wsRoleMapping], + dataLoading: false, + multipleAuthProvidersConfig: false, + }; + + beforeEach(() => { + setMockActions({ + initializeRoleMappings, + handleResetMappings, + }); + setMockValues(mockValues); + }); + + it('renders', () => { + const wrapper = shallow(); + + expect(wrapper.find(RoleMappingsTable)).toHaveLength(1); + }); + + it('returns Loading when loading', () => { + setMockValues({ ...mockValues, dataLoading: true }); + const wrapper = shallow(); + + expect(wrapper.find(Loading)).toHaveLength(1); + }); + + it('renders empty state', () => { + setMockValues({ ...mockValues, roleMappings: [] }); + const wrapper = shallow(); + + expect(wrapper.find(EuiEmptyPrompt)).toHaveLength(1); + }); + + describe('resetMappingsWarningModal', () => { + let wrapper: ShallowWrapper; + + beforeEach(() => { + wrapper = shallow(); + const button = wrapper.find(EuiPageHeader).prop('rightSideItems')![0] as any; + button.props.onClick(); + }); + + it('renders reset warnings modal', () => { + expect(wrapper.find(EuiConfirmModal)).toHaveLength(1); + }); + + it('hides reset warnings modal', () => { + const modal = wrapper.find(EuiConfirmModal); + modal.prop('onCancel')(); + + expect(wrapper.find(EuiConfirmModal)).toHaveLength(0); + }); + + it('resets when confirmed', () => { + const event = {} as MouseEvent; + const modal = wrapper.find(EuiConfirmModal); + modal.prop('onConfirm')!(event); + + expect(handleResetMappings).toHaveBeenCalled(); + }); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings.tsx new file mode 100644 index 00000000000000..e31f5c04bdb457 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings.tsx @@ -0,0 +1,139 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useEffect, useState } from 'react'; + +import { useActions, useValues } from 'kea'; + +import { + EuiButton, + EuiConfirmModal, + EuiEmptyPrompt, + EuiOverlayMask, + EuiPageContent, + EuiPageContentBody, + EuiPageHeader, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n/react'; + +import { FlashMessages } from '../../../shared/flash_messages'; +import { SetAppSearchChrome as SetPageChrome } from '../../../shared/kibana_chrome'; +import { Loading } from '../../../shared/loading'; +import { AddRoleMappingButton, RoleMappingsTable } from '../../../shared/role_mapping'; +import { + EMPTY_ROLE_MAPPINGS_TITLE, + ROLE_MAPPINGS_TITLE, + ROLE_MAPPINGS_DESCRIPTION, +} from '../../../shared/role_mapping/constants'; + +import { ROLE_MAPPING_NEW_PATH } from '../../routes'; + +import { + ROLE_MAPPINGS_ENGINE_ACCESS_HEADING, + EMPTY_ROLE_MAPPINGS_BODY, + ROLE_MAPPINGS_RESET_BUTTON, + ROLE_MAPPINGS_RESET_CONFIRM_TITLE, + ROLE_MAPPINGS_RESET_CONFIRM_BUTTON, + ROLE_MAPPINGS_RESET_CANCEL_BUTTON, +} from './constants'; +import { RoleMappingsLogic } from './role_mappings_logic'; +import { generateRoleMappingPath } from './utils'; + +export const RoleMappings: React.FC = () => { + const { initializeRoleMappings, handleResetMappings, resetState } = useActions(RoleMappingsLogic); + const { roleMappings, multipleAuthProvidersConfig, dataLoading } = useValues(RoleMappingsLogic); + + useEffect(() => { + initializeRoleMappings(); + return resetState; + }, []); + + const [isResetWarningVisible, setResetWarningVisibility] = useState(false); + const showWarning = () => setResetWarningVisibility(true); + const hideWarning = () => setResetWarningVisibility(false); + + if (dataLoading) return ; + + const RESET_MAPPINGS_WARNING_MODAL_BODY = ( + + {i18n.translate('xpack.enterpriseSearch.appSearch.resetMappingsWarningModalBodyBold', { + defaultMessage: 'All role mappings will be deleted', + })} + + ), + }} + /> + ); + + const addMappingButton = ; + + const roleMappingEmptyState = ( + {EMPTY_ROLE_MAPPINGS_TITLE}} + body={

{EMPTY_ROLE_MAPPINGS_BODY}

} + actions={addMappingButton} + /> + ); + + const roleMappingsTable = ( + + ); + + const resetMappings = ( + + {ROLE_MAPPINGS_RESET_BUTTON} + + ); + + const resetMappingsWarningModal = isResetWarningVisible ? ( + + handleResetMappings(hideWarning)} + title={ROLE_MAPPINGS_RESET_CONFIRM_TITLE} + cancelButtonText={ROLE_MAPPINGS_RESET_CANCEL_BUTTON} + confirmButtonText={ROLE_MAPPINGS_RESET_CONFIRM_BUTTON} + buttonColor="danger" + maxWidth={640} + > +

{RESET_MAPPINGS_WARNING_MODAL_BODY}

+
+
+ ) : null; + + return ( + <> + + + + + + {roleMappings.length === 0 ? roleMappingEmptyState : roleMappingsTable} + + + {resetMappingsWarningModal} + + ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings_logic.ts index f1b81a59779ac2..d6d56773863305 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings_logic.ts @@ -48,7 +48,7 @@ const getFirstAttributeName = (roleMapping: ASRoleMapping) => const getFirstAttributeValue = (roleMapping: ASRoleMapping) => Object.entries(roleMapping.rules)[0][1] as AttributeName; -export interface RoleMappingsActions { +interface RoleMappingsActions { handleAccessAllEnginesChange(): void; handleAuthProviderChange(value: string[]): { value: string[] }; handleAttributeSelectorChange( @@ -74,7 +74,7 @@ export interface RoleMappingsActions { setRoleMappingsData(data: RoleMappingsServerDetails): RoleMappingsServerDetails; } -export interface RoleMappingsValues { +interface RoleMappingsValues { accessAllEngines: boolean; attributeName: AttributeName; attributeValue: string; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings_router.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings_router.test.tsx new file mode 100644 index 00000000000000..e9fc40ba1dbb43 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings_router.test.tsx @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { Route, Switch } from 'react-router-dom'; + +import { shallow } from 'enzyme'; + +import { RoleMapping } from './role_mapping'; +import { RoleMappings } from './role_mappings'; +import { RoleMappingsRouter } from './role_mappings_router'; + +describe('RoleMappingsRouter', () => { + it('renders', () => { + const wrapper = shallow(); + + expect(wrapper.find(Switch)).toHaveLength(1); + expect(wrapper.find(Route)).toHaveLength(3); + expect(wrapper.find(RoleMapping)).toHaveLength(2); + expect(wrapper.find(RoleMappings)).toHaveLength(1); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings_router.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings_router.tsx new file mode 100644 index 00000000000000..7aa8b4067d9e5b --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings_router.tsx @@ -0,0 +1,29 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +import { Route, Switch } from 'react-router-dom'; + +import { ROLE_MAPPING_NEW_PATH, ROLE_MAPPING_PATH, ROLE_MAPPINGS_PATH } from '../../routes'; + +import { RoleMapping } from './role_mapping'; +import { RoleMappings } from './role_mappings'; + +export const RoleMappingsRouter: React.FC = () => ( + + + + + + + + + + + +); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/index.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/index.test.tsx index 4da71ec9a135be..62a0ccc01f29a7 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/index.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/index.test.tsx @@ -25,6 +25,7 @@ import { EngineCreation } from './components/engine_creation'; import { EnginesOverview } from './components/engines'; import { ErrorConnecting } from './components/error_connecting'; import { MetaEngineCreation } from './components/meta_engine_creation'; +import { RoleMappingsRouter } from './components/role_mappings'; import { SetupGuide } from './components/setup_guide'; import { AppSearch, AppSearchUnconfigured, AppSearchConfigured, AppSearchNav } from './'; @@ -88,6 +89,20 @@ describe('AppSearchConfigured', () => { }); describe('ability checks', () => { + describe('canViewRoleMappings', () => { + it('renders RoleMappings when canViewRoleMappings is true', () => { + setMockValues({ myRole: { canViewRoleMappings: true } }); + rerender(wrapper); + expect(wrapper.find(RoleMappingsRouter)).toHaveLength(1); + }); + + it('does not render RoleMappings when user canViewRoleMappings is false', () => { + setMockValues({ myRole: { canManageEngines: false } }); + rerender(wrapper); + expect(wrapper.find(RoleMappingsRouter)).toHaveLength(0); + }); + }); + describe('canManageEngines', () => { it('renders EngineCreation when user canManageEngines is true', () => { setMockValues({ myRole: { canManageEngines: true } }); @@ -155,8 +170,6 @@ describe('AppSearchNav', () => { setMockValues({ myRole: { canViewRoleMappings: true } }); const wrapper = shallow(); - expect(wrapper.find(SideNavLink).last().prop('to')).toEqual( - 'http://localhost:3002/as/role_mappings' - ); + expect(wrapper.find(SideNavLink).last().prop('to')).toEqual('/role_mappings'); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/index.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/index.tsx index 88db4004ea9e2a..3a46a90d20d665 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/index.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/index.tsx @@ -12,12 +12,13 @@ import { useValues } from 'kea'; import { APP_SEARCH_PLUGIN } from '../../../common/constants'; import { InitialAppData } from '../../../common/types'; -import { getAppSearchUrl } from '../shared/enterprise_search_url'; import { HttpLogic } from '../shared/http'; import { KibanaLogic } from '../shared/kibana'; import { Layout, SideNav, SideNavLink } from '../shared/layout'; import { NotFound } from '../shared/not_found'; +import { ROLE_MAPPINGS_TITLE } from '../shared/role_mapping/constants'; + import { AppLogic } from './app_logic'; import { Credentials, CREDENTIALS_TITLE } from './components/credentials'; import { EngineNav, EngineRouter } from './components/engine'; @@ -26,7 +27,7 @@ import { EnginesOverview, ENGINES_TITLE } from './components/engines'; import { ErrorConnecting } from './components/error_connecting'; import { Library } from './components/library'; import { MetaEngineCreation } from './components/meta_engine_creation'; -import { ROLE_MAPPINGS_TITLE } from './components/role_mappings'; +import { RoleMappingsRouter } from './components/role_mappings'; import { Settings, SETTINGS_TITLE } from './components/settings'; import { SetupGuide } from './components/setup_guide'; import { @@ -64,7 +65,7 @@ export const AppSearchUnconfigured: React.FC = () => ( export const AppSearchConfigured: React.FC> = (props) => { const { - myRole: { canManageEngines, canManageMetaEngines }, + myRole: { canManageEngines, canManageMetaEngines, canViewRoleMappings }, } = useValues(AppLogic(props)); const { errorConnecting, readOnlyMode } = useValues(HttpLogic); @@ -101,6 +102,11 @@ export const AppSearchConfigured: React.FC> = (props) = + {canViewRoleMappings && ( + + + + )} {canManageEngines && ( @@ -141,7 +147,7 @@ export const AppSearchNav: React.FC = ({ subNav }) => { {CREDENTIALS_TITLE} )} {canViewRoleMappings && ( - + {ROLE_MAPPINGS_TITLE} )} diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/types.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/types.ts index e763264a041de0..ca3e67129846bb 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/types.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/types.ts @@ -6,5 +6,5 @@ */ export * from '../../../common/types/app_search'; -export { Role, RoleTypes, AbilityTypes, ASRoleMapping } from './utils/role'; +export { Role, RoleTypes, AbilityTypes, ASRoleMapping, AdvanceRoleType } from './utils/role'; export { Engine } from './components/engine/types'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/utils/role/types.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/utils/role/types.ts index 0fa94b493ed31f..0c3abd6909390d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/utils/role/types.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/utils/role/types.ts @@ -53,3 +53,8 @@ export interface ASRoleMapping extends RoleMapping { content: string; }; } + +export interface AdvanceRoleType { + type: RoleTypes; + description: string; +} diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/__mocks__/content_sources.mock.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/__mocks__/content_sources.mock.ts index ce92f62d3a0177..30f0dc73eeb02e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/__mocks__/content_sources.mock.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/__mocks__/content_sources.mock.ts @@ -21,7 +21,7 @@ export const contentSources = [ name: 'source', documentCount: '123', isFederatedSource: false, - errorReason: 0, + errorReason: null, allowsReauth: true, boost: 1, }, @@ -35,7 +35,7 @@ export const contentSources = [ name: 'Jira', documentCount: '34234', isFederatedSource: false, - errorReason: 0, + errorReason: null, allowsReauth: true, boost: 0.5, }, diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/app_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/app_logic.test.ts index 8ba94e83d26cfb..82fc00923202f2 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/app_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/app_logic.test.ts @@ -48,7 +48,7 @@ describe('AppLogic', () => { expect(AppLogic.values).toEqual(DEFAULT_VALUES); }); - describe('initializeAppData()', () => { + describe('initializeAppData', () => { it('sets values based on passed props', () => { AppLogic.actions.initializeAppData(DEFAULT_INITIAL_APP_DATA); @@ -66,11 +66,20 @@ describe('AppLogic', () => { }); }); - describe('setContext()', () => { + describe('setContext', () => { it('sets context', () => { AppLogic.actions.setContext(true); expect(AppLogic.values.isOrganization).toEqual(true); }); }); + + describe('setSourceRestriction', () => { + it('sets property', () => { + mount(DEFAULT_INITIAL_APP_DATA); + AppLogic.actions.setSourceRestriction(true); + + expect(AppLogic.values.account.canCreatePersonalSources).toEqual(true); + }); + }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/source_row/source_row.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/source_row/source_row.test.tsx index b3ce0a01d5dd4b..f5c9858714cfd3 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/source_row/source_row.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/source_row/source_row.test.tsx @@ -39,7 +39,7 @@ describe('SourceRow', () => { const source = { ...contentSources[0], status: 'error', - errorReason: 1, + errorReason: 'credentials_invalid', }; const wrapper = shallow(); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/source_row/source_row.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/source_row/source_row.tsx index 38d7945ca17532..5d15196fba5a6e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/source_row/source_row.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/source_row/source_row.tsx @@ -34,7 +34,7 @@ import { import { ContentSourceDetails } from '../../../types'; import { SourceIcon } from '../source_icon'; -const CREDENTIALS_INVALID_ERROR_REASON = 1; +const CREDENTIALS_INVALID_ERROR_REASON = 'credentials_invalid'; export interface ISourceRow { showDetails?: boolean; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.test.tsx index ceb1a824461325..48bdcd6551b650 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.test.tsx @@ -16,6 +16,7 @@ import { shallow } from 'enzyme'; import { Layout } from '../shared/layout'; import { WorkplaceSearchHeaderActions } from './components/layout'; +import { SourceAdded } from './views/content_sources/components/source_added'; import { ErrorState } from './views/error_state'; import { Overview as OverviewMVP } from './views/overview_mvp'; import { SetupGuide } from './views/setup_guide'; @@ -94,4 +95,10 @@ describe('WorkplaceSearchConfigured', () => { expect(wrapper.find(Layout).first().prop('readOnlyMode')).toEqual(true); }); + + it('renders SourceAdded', () => { + const wrapper = shallow(); + + expect(wrapper.find(SourceAdded)).toHaveLength(1); + }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx index 656c93053e22bb..c269a987dc0927 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx @@ -24,12 +24,14 @@ import { GROUPS_PATH, SETUP_GUIDE_PATH, SOURCES_PATH, + SOURCE_ADDED_PATH, PERSONAL_SOURCES_PATH, ORG_SETTINGS_PATH, ROLE_MAPPINGS_PATH, SECURITY_PATH, } from './routes'; import { SourcesRouter } from './views/content_sources'; +import { SourceAdded } from './views/content_sources/components/source_added'; import { SourceSubNav } from './views/content_sources/components/source_sub_nav'; import { PrivateSourcesLayout } from './views/content_sources/private_sources_layout'; import { ErrorState } from './views/error_state'; @@ -82,6 +84,9 @@ export const WorkplaceSearchConfigured: React.FC = (props) => { + + + {errorConnecting ? : } diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.test.tsx index 68bec94270a01e..7d3e19dfe626a6 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.test.tsx @@ -13,8 +13,15 @@ import { EuiLink } from '@elastic/eui'; import { getContentSourcePath, + getGroupPath, + getGroupSourcePrioritizationPath, + getReindexJobRoute, + getRoleMappingPath, + getSourcesPath, + GROUPS_PATH, SOURCES_PATH, PERSONAL_SOURCES_PATH, + ROLE_MAPPINGS_PATH, SOURCE_DETAILS_PATH, } from './routes'; @@ -24,17 +31,66 @@ const TestComponent = ({ id, isOrg }: { id: string; isOrg?: boolean }) => { }; describe('getContentSourcePath', () => { - it('should format org route', () => { + it('should format org path', () => { const wrapper = shallow(); const path = wrapper.find(EuiLink).prop('href'); expect(path).toEqual(`${SOURCES_PATH}/123`); }); - it('should format user route', () => { + it('should format user path', () => { const wrapper = shallow(); const path = wrapper.find(EuiLink).prop('href'); expect(path).toEqual(`${PERSONAL_SOURCES_PATH}/123`); }); }); + +describe('getGroupPath', () => { + it('should format path', () => { + expect(getGroupPath('123')).toEqual(`${GROUPS_PATH}/123`); + }); +}); + +describe('getRoleMappingPath', () => { + it('should format path', () => { + expect(getRoleMappingPath('123')).toEqual(`${ROLE_MAPPINGS_PATH}/123`); + }); +}); + +describe('getGroupSourcePrioritizationPath', () => { + it('should format path', () => { + expect(getGroupSourcePrioritizationPath('123')).toEqual( + `${GROUPS_PATH}/123/source_prioritization` + ); + }); +}); + +describe('getSourcesPath', () => { + const PATH = '/foo/123'; + + it('should format org path', () => { + expect(getSourcesPath(PATH, true)).toEqual(PATH); + }); + + it('should format user path', () => { + expect(getSourcesPath(PATH, false)).toEqual(`/p${PATH}`); + }); +}); + +describe('getReindexJobRoute', () => { + const SOURCE_ID = '234'; + const REINDEX_ID = '345'; + + it('should format org path', () => { + expect(getReindexJobRoute(SOURCE_ID, REINDEX_ID, true)).toEqual( + `/sources/${SOURCE_ID}/schema_errors/${REINDEX_ID}` + ); + }); + + it('should format user path', () => { + expect(getReindexJobRoute(SOURCE_ID, REINDEX_ID, false)).toEqual( + `/p/sources/${SOURCE_ID}/schema_errors/${REINDEX_ID}` + ); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/types.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/types.ts index 79fe6dc8c92cbd..a653401aade276 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/types.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/types.ts @@ -106,7 +106,7 @@ export interface ContentSourceDetails extends ContentSource { isFederatedSource: boolean; searchable: boolean; supportedByLicense: boolean; - errorReason: number; + errorReason: string | null; allowsReauth: boolean; boost: number; } diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.test.ts index ed67eb9994bc89..d0ab40399fa597 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.test.ts @@ -275,12 +275,12 @@ describe('AddSourceLogic', () => { describe('saveSourceParams', () => { const params = { code: 'code123', - state: '"{"state": "foo"}"', - session_state: 'session123', + state: + '{"action":"create","context":"organization","service_type":"gmail","csrf_token":"token==","index_permissions":false}', }; const queryString = - 'code=code123&state=%22%7B%22state%22%3A%20%22foo%22%7D%22&session_state=session123'; + '?state=%7B%22action%22:%22create%22,%22context%22:%22organization%22,%22service_type%22:%22gmail%22,%22csrf_token%22:%22token%3D%3D%22,%22index_permissions%22:false%7D&code=code123'; const response = { serviceName: 'name', indexPermissions: false, serviceType: 'zendesk' }; @@ -303,9 +303,18 @@ describe('AddSourceLogic', () => { await nextTick(); expect(setAddedSourceSpy).toHaveBeenCalledWith(serviceName, indexPermissions, serviceType); - expect(navigateToUrl).toHaveBeenCalledWith( - getSourcesPath(SOURCES_PATH, AppLogic.values.isOrganization) - ); + expect(navigateToUrl).toHaveBeenCalledWith(getSourcesPath(SOURCES_PATH, true)); + }); + + it('redirects to private dashboard when account context', async () => { + const accountQueryString = + '?state=%7B%22action%22:%22create%22,%22context%22:%22account%22,%22service_type%22:%22gmail%22,%22csrf_token%22:%22token%3D%3D%22,%22index_permissions%22:false%7D&code=code'; + + AddSourceLogic.actions.saveSourceParams(accountQueryString); + + await nextTick(); + + expect(navigateToUrl).toHaveBeenCalledWith(getSourcesPath(SOURCES_PATH, false)); }); it('handles error', async () => { diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.ts index 4e996aff6f5b02..e1f554d87551dc 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.ts @@ -470,12 +470,13 @@ export const AddSourceLogic = kea { const { http } = HttpLogic.values; - const { isOrganization } = AppLogic.values; const { navigateToUrl } = KibanaLogic.values; const { setAddedSource } = SourcesLogic.actions; const params = (parseQueryParams(search) as unknown) as OauthParams; const query = { ...params, kibana_host: kibanaHost }; const route = '/api/workplace_search/sources/create'; + const state = JSON.parse(params.state); + const isOrganization = state.context !== 'account'; try { const response = await http.get(route, { query }); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_added.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_added.tsx index 5f1d2ed0c81c31..7c4e81d8e0755c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_added.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_added.tsx @@ -11,6 +11,8 @@ import { useLocation } from 'react-router-dom'; import { Location } from 'history'; import { useActions } from 'kea'; +import { EuiPage, EuiPageBody } from '@elastic/eui'; + import { Loading } from '../../../../shared/loading'; import { AddSourceLogic } from './add_source/add_source_logic'; @@ -28,5 +30,11 @@ export const SourceAdded: React.FC = () => { saveSourceParams(search); }, []); - return ; + return ( + + + + + + ); }; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_router.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_router.test.tsx index 2438061c677591..eac1bd7d3ea277 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_router.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_router.test.tsx @@ -34,7 +34,7 @@ describe('SourcesRouter', () => { }); it('renders sources routes', () => { - const TOTAL_ROUTES = 62; + const TOTAL_ROUTES = 61; const wrapper = shallow(); expect(wrapper.find(Switch)).toHaveLength(1); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_router.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_router.tsx index b7857cf4612a21..f4a56c8a0beaaf 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_router.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_router.tsx @@ -19,7 +19,6 @@ import { AppLogic } from '../../app_logic'; import { NAV } from '../../constants'; import { ADD_SOURCE_PATH, - SOURCE_ADDED_PATH, SOURCE_DETAILS_PATH, PERSONAL_SOURCES_PATH, SOURCES_PATH, @@ -27,7 +26,6 @@ import { } from '../../routes'; import { AddSource, AddSourceList } from './components/add_source'; -import { SourceAdded } from './components/source_added'; import { OrganizationSources } from './organization_sources'; import { PrivateSources } from './private_sources'; import { staticSourceData } from './source_data'; @@ -115,10 +113,6 @@ export const SourcesRouter: React.FC = () => { - - - - diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/role_mappings.test.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/role_mappings.test.ts index 53368035af2257..856004add0f736 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/role_mappings.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/role_mappings.test.ts @@ -128,12 +128,7 @@ describe('role mappings routes', () => { describe('validates', () => { it('correctly', () => { - const request = { - body: { - ...roleMappingBaseSchema, - id: '123', - }, - }; + const request = { body: roleMappingBaseSchema }; mockRouter.shouldValidate(request); }); diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/role_mappings.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/role_mappings.ts index 4b77c8614a52c8..3bd3b3d904280a 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/role_mappings.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/role_mappings.ts @@ -66,10 +66,7 @@ export function registerRoleMappingRoute({ { path: '/api/app_search/role_mappings/{id}', validate: { - body: schema.object({ - ...roleMappingBaseSchema, - id: schema.string(), - }), + body: schema.object(roleMappingBaseSchema), params: schema.object({ id: schema.string(), }), diff --git a/x-pack/plugins/fleet/common/constants/epm.ts b/x-pack/plugins/fleet/common/constants/epm.ts index aa17b16b3763ce..faa1127cfe1dad 100644 --- a/x-pack/plugins/fleet/common/constants/epm.ts +++ b/x-pack/plugins/fleet/common/constants/epm.ts @@ -7,7 +7,6 @@ export const PACKAGES_SAVED_OBJECT_TYPE = 'epm-packages'; export const ASSETS_SAVED_OBJECT_TYPE = 'epm-packages-assets'; -export const INDEX_PATTERN_SAVED_OBJECT_TYPE = 'index-pattern'; export const MAX_TIME_COMPLETE_INSTALL = 60000; export const FLEET_SERVER_PACKAGE = 'fleet_server'; diff --git a/x-pack/plugins/fleet/common/openapi/bundled.json b/x-pack/plugins/fleet/common/openapi/bundled.json index 55c32802c3334d..388aebed9a85b4 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.json +++ b/x-pack/plugins/fleet/common/openapi/bundled.json @@ -1633,7 +1633,21 @@ { "$ref": "#/paths/~1setup/post/parameters/0" } - ] + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + } + } + } + } + } + } } }, "/agents/{agentId}": { diff --git a/x-pack/plugins/fleet/common/openapi/bundled.yaml b/x-pack/plugins/fleet/common/openapi/bundled.yaml index 9461927bb09b86..227faffdac489f 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.yaml +++ b/x-pack/plugins/fleet/common/openapi/bundled.yaml @@ -1038,6 +1038,14 @@ paths: operationId: post-epm-delete-pkgkey parameters: - $ref: '#/paths/~1setup/post/parameters/0' + requestBody: + content: + application/json: + schema: + type: object + properties: + force: + type: boolean '/agents/{agentId}': parameters: - schema: diff --git a/x-pack/plugins/fleet/common/openapi/paths/epm@packages@{pkgkey}.yaml b/x-pack/plugins/fleet/common/openapi/paths/epm@packages@{pkgkey}.yaml index 43937aa153f504..85d8615a9eb4b9 100644 --- a/x-pack/plugins/fleet/common/openapi/paths/epm@packages@{pkgkey}.yaml +++ b/x-pack/plugins/fleet/common/openapi/paths/epm@packages@{pkgkey}.yaml @@ -89,3 +89,11 @@ delete: operationId: post-epm-delete-pkgkey parameters: - $ref: ../components/headers/kbn_xsrf.yaml + requestBody: + content: + application/json: + schema: + type: object + properties: + force: + type: boolean diff --git a/x-pack/plugins/fleet/common/types/index.ts b/x-pack/plugins/fleet/common/types/index.ts index 4223697703a8d5..5c385f938a69e3 100644 --- a/x-pack/plugins/fleet/common/types/index.ts +++ b/x-pack/plugins/fleet/common/types/index.ts @@ -14,6 +14,7 @@ export interface FleetConfigType { registryProxyUrl?: string; agents: { enabled: boolean; + fleetServerEnabled: boolean; tlsCheckDisabled: boolean; pollingRequestTimeout: number; maxConcurrentConnections: number; diff --git a/x-pack/plugins/fleet/common/types/rest_spec/agent.ts b/x-pack/plugins/fleet/common/types/rest_spec/agent.ts index 93cbb8369a3b13..b654c513e0afbc 100644 --- a/x-pack/plugins/fleet/common/types/rest_spec/agent.ts +++ b/x-pack/plugins/fleet/common/types/rest_spec/agent.ts @@ -164,12 +164,13 @@ export interface PostBulkAgentReassignRequest { }; } -export interface PostBulkAgentReassignResponse { - [key: string]: { +export type PostBulkAgentReassignResponse = Record< + Agent['id'], + { success: boolean; - error?: Error; - }; -} + error?: string; + } +>; export interface GetOneAgentEventsRequest { params: { diff --git a/x-pack/plugins/fleet/common/types/rest_spec/epm.ts b/x-pack/plugins/fleet/common/types/rest_spec/epm.ts index 3a9c9a0cfae9f8..3c7a32265d20a6 100644 --- a/x-pack/plugins/fleet/common/types/rest_spec/epm.ts +++ b/x-pack/plugins/fleet/common/types/rest_spec/epm.ts @@ -82,12 +82,15 @@ export interface IBulkInstallPackageHTTPError { error: string | Error; } +export interface InstallResult { + assets: AssetReference[]; + status: 'installed' | 'already_installed'; +} + export interface BulkInstallPackageInfo { name: string; - newVersion: string; - // this will be null if no package was present before the upgrade (aka it was an install) - oldVersion: string | null; - assets: AssetReference[]; + version: string; + result: InstallResult; } export interface BulkInstallPackagesResponse { diff --git a/x-pack/plugins/fleet/public/applications/fleet/mock/plugin_configuration.ts b/x-pack/plugins/fleet/public/applications/fleet/mock/plugin_configuration.ts index 5d53425607361d..81ef6a6703c343 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/mock/plugin_configuration.ts +++ b/x-pack/plugins/fleet/public/applications/fleet/mock/plugin_configuration.ts @@ -14,6 +14,7 @@ export const createConfigurationMock = (): FleetConfigType => { registryProxyUrl: '', agents: { enabled: true, + fleetServerEnabled: false, tlsCheckDisabled: true, pollingRequestTimeout: 1000, maxConcurrentConnections: 100, diff --git a/x-pack/plugins/fleet/server/constants/index.ts b/x-pack/plugins/fleet/server/constants/index.ts index fa6051fa7d35b7..23df18d5e377d2 100644 --- a/x-pack/plugins/fleet/server/constants/index.ts +++ b/x-pack/plugins/fleet/server/constants/index.ts @@ -43,7 +43,6 @@ export { OUTPUT_SAVED_OBJECT_TYPE, PACKAGES_SAVED_OBJECT_TYPE, ASSETS_SAVED_OBJECT_TYPE, - INDEX_PATTERN_SAVED_OBJECT_TYPE, ENROLLMENT_API_KEYS_SAVED_OBJECT_TYPE, GLOBAL_SETTINGS_SAVED_OBJECT_TYPE, // Defaults diff --git a/x-pack/plugins/fleet/server/index.ts b/x-pack/plugins/fleet/server/index.ts index 73a8b419a869d8..8bad868b813ac6 100644 --- a/x-pack/plugins/fleet/server/index.ts +++ b/x-pack/plugins/fleet/server/index.ts @@ -38,7 +38,6 @@ export const config: PluginConfigDescriptor = { deprecations: ({ renameFromRoot, unused }) => [ renameFromRoot('xpack.ingestManager', 'xpack.fleet'), renameFromRoot('xpack.fleet.fleet', 'xpack.fleet.agents'), - unused('agents.fleetServerEnabled'), ], schema: schema.object({ enabled: schema.boolean({ defaultValue: true }), @@ -46,6 +45,7 @@ export const config: PluginConfigDescriptor = { registryProxyUrl: schema.maybe(schema.uri({ scheme: ['http', 'https'] })), agents: schema.object({ enabled: schema.boolean({ defaultValue: true }), + fleetServerEnabled: schema.boolean({ defaultValue: false }), tlsCheckDisabled: schema.boolean({ defaultValue: false }), pollingRequestTimeout: schema.number({ defaultValue: AGENT_POLLING_REQUEST_TIMEOUT_MS, diff --git a/x-pack/plugins/fleet/server/mocks/index.ts b/x-pack/plugins/fleet/server/mocks/index.ts index d4b6f007feb4d1..4bc2bea1e58b69 100644 --- a/x-pack/plugins/fleet/server/mocks/index.ts +++ b/x-pack/plugins/fleet/server/mocks/index.ts @@ -10,6 +10,7 @@ import { savedObjectsServiceMock, coreMock, } from '../../../../../src/core/server/mocks'; +import { dataPluginMock } from '../../../../../src/plugins/data/server/mocks'; import { licensingMock } from '../../../../plugins/licensing/server/mocks'; import { encryptedSavedObjectsMock } from '../../../encrypted_saved_objects/server/mocks'; import { securityMock } from '../../../security/server/mocks'; @@ -23,6 +24,7 @@ export * from '../services/artifacts/mocks'; export const createAppContextStartContractMock = (): FleetAppContext => { return { elasticsearch: elasticsearchServiceMock.createStart(), + data: dataPluginMock.createStartContract(), encryptedSavedObjectsStart: encryptedSavedObjectsMock.createStart(), savedObjects: savedObjectsServiceMock.createStartContract(), security: securityMock.createStart(), diff --git a/x-pack/plugins/fleet/server/plugin.ts b/x-pack/plugins/fleet/server/plugin.ts index a62da8eb41a995..5d7b05c5eddcbd 100644 --- a/x-pack/plugins/fleet/server/plugin.ts +++ b/x-pack/plugins/fleet/server/plugin.ts @@ -23,6 +23,7 @@ import type { import type { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/server'; +import type { PluginStart as DataPluginStart } from '../../../../src/plugins/data/server'; import type { LicensingPluginSetup, ILicense } from '../../licensing/server'; import type { EncryptedSavedObjectsPluginStart, @@ -100,12 +101,14 @@ export interface FleetSetupDeps { } export interface FleetStartDeps { + data: DataPluginStart; encryptedSavedObjects: EncryptedSavedObjectsPluginStart; security?: SecurityPluginStart; } export interface FleetAppContext { elasticsearch: ElasticsearchServiceStart; + data: DataPluginStart; encryptedSavedObjectsStart?: EncryptedSavedObjectsPluginStart; encryptedSavedObjectsSetup?: EncryptedSavedObjectsPluginSetup; security?: SecurityPluginStart; @@ -206,6 +209,10 @@ export class FleetPlugin this.encryptedSavedObjectsSetup = deps.encryptedSavedObjects; this.cloud = deps.cloud; + const config = await this.config$.pipe(first()).toPromise(); + + appContextService.fleetServerEnabled = config.agents.fleetServerEnabled; + registerSavedObjects(core.savedObjects, deps.encryptedSavedObjects); registerEncryptedSavedObjects(deps.encryptedSavedObjects); @@ -245,8 +252,6 @@ export class FleetPlugin const router = core.http.createRouter(); - const config = await this.config$.pipe(first()).toPromise(); - // Register usage collection registerFleetUsageCollector(core, config, deps.usageCollection); @@ -293,6 +298,7 @@ export class FleetPlugin public async start(core: CoreStart, plugins: FleetStartDeps): Promise { await appContextService.start({ elasticsearch: core.elasticsearch, + data: plugins.data, encryptedSavedObjectsStart: plugins.encryptedSavedObjects, encryptedSavedObjectsSetup: this.encryptedSavedObjectsSetup, security: plugins.security, diff --git a/x-pack/plugins/fleet/server/routes/agent/handlers.ts b/x-pack/plugins/fleet/server/routes/agent/handlers.ts index e6188a83c49e9b..5ac264e29f079f 100644 --- a/x-pack/plugins/fleet/server/routes/agent/handlers.ts +++ b/x-pack/plugins/fleet/server/routes/agent/handlers.ts @@ -308,26 +308,26 @@ export const postBulkAgentsReassignHandler: RequestHandler< const soClient = context.core.savedObjects.client; const esClient = context.core.elasticsearch.client.asInternalUser; + const agentOptions = Array.isArray(request.body.agents) + ? { agentIds: request.body.agents } + : { kuery: request.body.agents }; try { const results = await AgentService.reassignAgents( soClient, esClient, - Array.isArray(request.body.agents) - ? { agentIds: request.body.agents } - : { kuery: request.body.agents }, + agentOptions, request.body.policy_id ); - const body: PostBulkAgentReassignResponse = results.items.reduce((acc, so) => { - return { - ...acc, - [so.id]: { - success: !so.error, - error: so.error || undefined, - }, + const body = results.items.reduce((acc, so) => { + acc[so.id] = { + success: !so.error, + error: so.error?.message, }; + return acc; }, {}); + return response.ok({ body }); } catch (error) { return defaultIngestErrorHandler({ error, response }); diff --git a/x-pack/plugins/fleet/server/routes/agent/upgrade_handler.ts b/x-pack/plugins/fleet/server/routes/agent/upgrade_handler.ts index 279018ef4212cd..b8af265883091b 100644 --- a/x-pack/plugins/fleet/server/routes/agent/upgrade_handler.ts +++ b/x-pack/plugins/fleet/server/routes/agent/upgrade_handler.ts @@ -92,21 +92,14 @@ export const postBulkAgentsUpgradeHandler: RequestHandler< } try { - if (Array.isArray(agents)) { - await AgentService.sendUpgradeAgentsActions(soClient, esClient, { - agentIds: agents, - sourceUri, - version, - force, - }); - } else { - await AgentService.sendUpgradeAgentsActions(soClient, esClient, { - kuery: agents, - sourceUri, - version, - force, - }); - } + const agentOptions = Array.isArray(agents) ? { agentIds: agents } : { kuery: agents }; + const upgradeOptions = { + ...agentOptions, + sourceUri, + version, + force, + }; + await AgentService.sendUpgradeAgentsActions(soClient, esClient, upgradeOptions); const body: PostBulkAgentUpgradeResponse = {}; return response.ok({ body }); diff --git a/x-pack/plugins/fleet/server/routes/epm/handlers.ts b/x-pack/plugins/fleet/server/routes/epm/handlers.ts index 293a3e9e28237d..f0d6e684273614 100644 --- a/x-pack/plugins/fleet/server/routes/epm/handlers.ts +++ b/x-pack/plugins/fleet/server/routes/epm/handlers.ts @@ -40,12 +40,10 @@ import { getPackages, getFile, getPackageInfo, - handleInstallPackageFailure, isBulkInstallError, installPackage, removeInstallation, getLimitedPackages, - getInstallationObject, getInstallation, } from '../../services/epm/packages'; import type { BulkInstallResponse } from '../../services/epm/packages'; @@ -228,15 +226,7 @@ export const installPackageFromRegistryHandler: RequestHandler< const savedObjectsClient = context.core.savedObjects.client; const esClient = context.core.elasticsearch.client.asCurrentUser; const { pkgkey } = request.params; - - let pkgName: string | undefined; - let pkgVersion: string | undefined; - try { - const parsedPkgKey = splitPkgKey(pkgkey); - pkgName = parsedPkgKey.pkgName; - pkgVersion = parsedPkgKey.pkgVersion; - const res = await installPackage({ installSource: 'registry', savedObjectsClient, @@ -245,24 +235,11 @@ export const installPackageFromRegistryHandler: RequestHandler< force: request.body?.force, }); const body: InstallPackageResponse = { - response: res, + response: res.assets, }; return response.ok({ body }); } catch (e) { - const defaultResult = await defaultIngestErrorHandler({ error: e, response }); - if (pkgName && pkgVersion) { - const installedPkg = await getInstallationObject({ savedObjectsClient, pkgName }); - await handleInstallPackageFailure({ - savedObjectsClient, - error: e, - pkgName, - pkgVersion, - installedPkg, - esClient, - }); - } - - return defaultResult; + return await defaultIngestErrorHandler({ error: e, response }); } }; @@ -291,7 +268,7 @@ export const bulkInstallPackagesFromRegistryHandler: RequestHandler< const bulkInstalledResponses = await bulkInstallPackages({ savedObjectsClient, esClient, - packagesToUpgrade: request.body.packages, + packagesToInstall: request.body.packages, }); const payload = bulkInstalledResponses.map(bulkInstallServiceResponseToHttpEntry); const body: BulkInstallPackagesResponse = { @@ -324,7 +301,7 @@ export const installPackageByUploadHandler: RequestHandler< contentType, }); const body: InstallPackageResponse = { - response: res, + response: res.assets, }; return response.ok({ body }); } catch (error) { @@ -333,13 +310,20 @@ export const installPackageByUploadHandler: RequestHandler< }; export const deletePackageHandler: RequestHandler< - TypeOf + TypeOf, + undefined, + TypeOf > = async (context, request, response) => { try { const { pkgkey } = request.params; const savedObjectsClient = context.core.savedObjects.client; const esClient = context.core.elasticsearch.client.asCurrentUser; - const res = await removeInstallation({ savedObjectsClient, pkgkey, esClient }); + const res = await removeInstallation({ + savedObjectsClient, + pkgkey, + esClient, + force: request.body?.force, + }); const body: DeletePackageResponse = { response: res, }; diff --git a/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v7_13_0.test.ts b/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v7_13_0.test.ts index 75e2922bd51499..6897efbe94110b 100644 --- a/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v7_13_0.test.ts +++ b/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v7_13_0.test.ts @@ -12,6 +12,8 @@ import type { PackagePolicy } from '../../../../common'; import { migrationMocks } from '../../../../../../../src/core/server/mocks'; +import { appContextService } from '../../../services'; + import { migrateEndpointPackagePolicyToV7130 } from './to_v7_13_0'; describe('7.13.0 Endpoint Package Policy migration', () => { @@ -126,6 +128,16 @@ describe('7.13.0 Endpoint Package Policy migration', () => { const migrationContext = migrationMocks.createContext(); + beforeEach(() => { + // set `fleetServerEnabled` flag to true + appContextService.fleetServerEnabled = true; + }); + + afterEach(() => { + // set `fleetServerEnabled` flag back to false + appContextService.fleetServerEnabled = false; + }); + it('should adjust the relative url for all artifact manifests', () => { expect( migrateEndpointPackagePolicyToV7130(createOldPackagePolicySO(), migrationContext) @@ -142,4 +154,15 @@ describe('7.13.0 Endpoint Package Policy migration', () => { unchangedPackagePolicySo ); }); + + it('should NOT migrate artifact relative_url if fleetServerEnabled is false', () => { + const packagePolicySo = createOldPackagePolicySO(); + const unchangedPackagePolicySo = cloneDeep(packagePolicySo); + + appContextService.fleetServerEnabled = false; + + expect(migrateEndpointPackagePolicyToV7130(packagePolicySo, migrationContext)).toEqual( + unchangedPackagePolicySo + ); + }); }); diff --git a/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v7_13_0.ts b/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v7_13_0.ts index 655ce37b4faaf2..5eb0c7a6e31416 100644 --- a/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v7_13_0.ts +++ b/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v7_13_0.ts @@ -10,6 +10,7 @@ import type { SavedObjectMigrationFn } from 'kibana/server'; import type { PackagePolicy } from '../../../../common'; import { relativeDownloadUrlFromArtifact } from '../../../services/artifacts/mappings'; import type { ArtifactElasticsearchProperties } from '../../../services'; +import { appContextService } from '../../../services'; type ArtifactManifestList = Record< string, @@ -21,16 +22,19 @@ export const migrateEndpointPackagePolicyToV7130: SavedObjectMigrationFn< PackagePolicy > = (packagePolicyDoc) => { if (packagePolicyDoc.attributes.package?.name === 'endpoint') { - // Adjust all artifact URLs so that they point at fleet-server - const artifactList: ArtifactManifestList = - packagePolicyDoc.attributes?.inputs[0]?.config?.artifact_manifest.value.artifacts; + // Feature condition check here is temporary until v7.13 ships + if (appContextService.fleetServerEnabled) { + // Adjust all artifact URLs so that they point at fleet-server + const artifactList: ArtifactManifestList = + packagePolicyDoc.attributes?.inputs[0]?.config?.artifact_manifest.value.artifacts; - if (artifactList) { - for (const [identifier, artifactManifest] of Object.entries(artifactList)) { - artifactManifest.relative_url = relativeDownloadUrlFromArtifact({ - identifier, - decodedSha256: artifactManifest.decoded_sha256, - }); + if (artifactList) { + for (const [identifier, artifactManifest] of Object.entries(artifactList)) { + artifactManifest.relative_url = relativeDownloadUrlFromArtifact({ + identifier, + decodedSha256: artifactManifest.decoded_sha256, + }); + } } } } diff --git a/x-pack/plugins/fleet/server/saved_objects/migrations/to_v7_13_0.ts b/x-pack/plugins/fleet/server/saved_objects/migrations/to_v7_13_0.ts index 1cc2394a8e5fe0..e4ba7ce56e847a 100644 --- a/x-pack/plugins/fleet/server/saved_objects/migrations/to_v7_13_0.ts +++ b/x-pack/plugins/fleet/server/saved_objects/migrations/to_v7_13_0.ts @@ -32,11 +32,15 @@ export const migratePackagePolicyToV7130: SavedObjectMigrationFn { + let updatedPackagePolicyDoc = packagePolicyDoc; + // Endpoint specific migrations - // FIXME:PT remove `-OFF` from below once ready to be released - if (packagePolicyDoc.attributes.package?.name === 'endpoint-OFF') { - return migrateEndpointPackagePolicyToV7130(packagePolicyDoc, migrationContext); + if (packagePolicyDoc.attributes.package?.name === 'endpoint') { + updatedPackagePolicyDoc = migrateEndpointPackagePolicyToV7130( + packagePolicyDoc, + migrationContext + ); } - return packagePolicyDoc; + return updatedPackagePolicyDoc; }; diff --git a/x-pack/plugins/fleet/server/services/agents/crud.ts b/x-pack/plugins/fleet/server/services/agents/crud.ts index 52a6b98bd0c418..9aa7bbc9f2b18b 100644 --- a/x-pack/plugins/fleet/server/services/agents/crud.ts +++ b/x-pack/plugins/fleet/server/services/agents/crud.ts @@ -9,7 +9,8 @@ import Boom from '@hapi/boom'; import type { SearchResponse, MGetResponse, GetResponse } from 'elasticsearch'; import type { SavedObjectsClientContract, ElasticsearchClient } from 'src/core/server'; -import type { AgentSOAttributes, Agent, ListWithKuery } from '../../types'; +import type { AgentSOAttributes, Agent, BulkActionResult, ListWithKuery } from '../../types'; +import type { ESSearchResponse } from '../../../../../../typings/elasticsearch'; import { appContextService, agentPolicyService } from '../../services'; import type { FleetServerAgent } from '../../../common'; import { isAgentUpgradeable, SO_SEARCH_LIMIT } from '../../../common'; @@ -68,22 +69,23 @@ export type GetAgentsOptions = }; export async function getAgents(esClient: ElasticsearchClient, options: GetAgentsOptions) { - let initialResults = []; - + let agents: Agent[] = []; if ('agentIds' in options) { - initialResults = await getAgentsById(esClient, options.agentIds); + agents = await getAgentsById(esClient, options.agentIds); } else if ('kuery' in options) { - initialResults = ( + agents = ( await getAllAgentsByKuery(esClient, { kuery: options.kuery, showInactive: options.showInactive ?? false, }) ).agents; } else { - throw new IngestManagerError('Cannot get agents'); + throw new IngestManagerError( + 'Either options.agentIds or options.kuery are required to get agents' + ); } - return initialResults; + return agents; } export async function getAgentsByKuery( @@ -118,7 +120,7 @@ export async function getAgentsByKuery( const kueryNode = _joinFilters(filters); const body = kueryNode ? { query: esKuery.toElasticsearchQuery(kueryNode) } : {}; - const res = await esClient.search>({ + const res = await esClient.search>({ index: AGENTS_INDEX, from: (page - 1) * perPage, size: perPage, @@ -138,7 +140,7 @@ export async function getAgentsByKuery( return { agents, - total: agents.length, + total: res.body.hits.total.value, page, perPage, }; @@ -187,7 +189,7 @@ export async function countInactiveAgents( export async function getAgentById(esClient: ElasticsearchClient, agentId: string) { const agentNotFoundError = new AgentNotFoundError(`Agent ${agentId} not found`); try { - const agentHit = await esClient.get>({ + const agentHit = await esClient.get({ index: AGENTS_INDEX, id: agentId, }); @@ -206,10 +208,17 @@ export async function getAgentById(esClient: ElasticsearchClient, agentId: strin } } -async function getAgentDocuments( +export function isAgentDocument( + maybeDocument: any +): maybeDocument is GetResponse { + return '_id' in maybeDocument && '_source' in maybeDocument; +} + +export type ESAgentDocumentResult = GetResponse; +export async function getAgentDocuments( esClient: ElasticsearchClient, agentIds: string[] -): Promise>> { +): Promise { const res = await esClient.mget>({ index: AGENTS_INDEX, body: { docs: agentIds.map((_id) => ({ _id })) }, @@ -220,14 +229,16 @@ async function getAgentDocuments( export async function getAgentsById( esClient: ElasticsearchClient, - agentIds: string[], - options: { includeMissing?: boolean } = { includeMissing: false } + agentIds: string[] ): Promise { const allDocs = await getAgentDocuments(esClient, agentIds); - const agentDocs = options.includeMissing - ? allDocs - : allDocs.filter((res) => res._id && res._source); - const agents = agentDocs.map((doc) => searchHitToAgent(doc)); + const agents = allDocs.reduce((results, doc) => { + if (isAgentDocument(doc)) { + results.push(searchHitToAgent(doc)); + } + + return results; + }, []); return agents; } @@ -275,7 +286,7 @@ export async function bulkUpdateAgents( agentId: string; data: Partial; }> -) { +): Promise<{ items: BulkActionResult[] }> { if (updateData.length === 0) { return { items: [] }; } diff --git a/x-pack/plugins/fleet/server/services/agents/helpers.ts b/x-pack/plugins/fleet/server/services/agents/helpers.ts index bcc065badcd50a..89f37a01a6b002 100644 --- a/x-pack/plugins/fleet/server/services/agents/helpers.ts +++ b/x-pack/plugins/fleet/server/services/agents/helpers.ts @@ -7,10 +7,12 @@ import type { GetResponse, SearchResponse } from 'elasticsearch'; +import type { ESSearchHit } from '../../../../../../typings/elasticsearch'; import type { Agent, AgentSOAttributes, FleetServerAgent } from '../../types'; type FleetServerAgentESResponse = | GetResponse + | ESSearchHit | SearchResponse['hits']['hits'][0]; export function searchHitToAgent(hit: FleetServerAgentESResponse): Agent { diff --git a/x-pack/plugins/fleet/server/services/agents/reassign.ts b/x-pack/plugins/fleet/server/services/agents/reassign.ts index 74e60c42b99734..5574c42ced0530 100644 --- a/x-pack/plugins/fleet/server/services/agents/reassign.ts +++ b/x-pack/plugins/fleet/server/services/agents/reassign.ts @@ -8,13 +8,20 @@ import type { SavedObjectsClientContract, ElasticsearchClient } from 'kibana/server'; import Boom from '@hapi/boom'; -import type { Agent } from '../../types'; +import type { Agent, BulkActionResult } from '../../types'; import { agentPolicyService } from '../agent_policy'; import { AgentReassignmentError } from '../../errors'; -import { getAgents, getAgentPolicyForAgent, updateAgent, bulkUpdateAgents } from './crud'; +import { + getAgentDocuments, + getAgents, + getAgentPolicyForAgent, + updateAgent, + bulkUpdateAgents, +} from './crud'; import type { GetAgentsOptions } from './index'; import { createAgentAction, bulkCreateAgentActions } from './actions'; +import { searchHitToAgent } from './helpers'; export async function reassignAgent( soClient: SavedObjectsClientContract, @@ -67,39 +74,67 @@ export async function reassignAgentIsAllowed( export async function reassignAgents( soClient: SavedObjectsClientContract, esClient: ElasticsearchClient, - options: { agents: Agent[] } | GetAgentsOptions, + options: ({ agents: Agent[] } | GetAgentsOptions) & { force?: boolean }, newAgentPolicyId: string -): Promise<{ items: Array<{ id: string; success: boolean; error?: Error }> }> { +): Promise<{ items: BulkActionResult[] }> { const agentPolicy = await agentPolicyService.get(soClient, newAgentPolicyId); if (!agentPolicy) { throw Boom.notFound(`Agent policy not found: ${newAgentPolicyId}`); } - const allResults = 'agents' in options ? options.agents : await getAgents(esClient, options); + const outgoingErrors: Record = {}; + let givenAgents: Agent[] = []; + if ('agents' in options) { + givenAgents = options.agents; + } else if ('agentIds' in options) { + const givenAgentsResults = await getAgentDocuments(esClient, options.agentIds); + for (const agentResult of givenAgentsResults) { + if (agentResult.found === false) { + outgoingErrors[agentResult._id] = new AgentReassignmentError( + `Cannot find agent ${agentResult._id}` + ); + } else { + givenAgents.push(searchHitToAgent(agentResult)); + } + } + } else if ('kuery' in options) { + givenAgents = await getAgents(esClient, options); + } + const givenOrder = + 'agentIds' in options ? options.agentIds : givenAgents.map((agent) => agent.id); + // which are allowed to unenroll - const settled = await Promise.allSettled( - allResults.map((agent) => - reassignAgentIsAllowed(soClient, esClient, agent.id, newAgentPolicyId).then((_) => agent) - ) + const agentResults = await Promise.allSettled( + givenAgents.map(async (agent, index) => { + if (agent.policy_id === newAgentPolicyId) { + throw new AgentReassignmentError(`${agent.id} is already assigned to ${newAgentPolicyId}`); + } + + const isAllowed = await reassignAgentIsAllowed( + soClient, + esClient, + agent.id, + newAgentPolicyId + ); + if (isAllowed) { + return agent; + } + throw new AgentReassignmentError(`${agent.id} may not be reassigned to ${newAgentPolicyId}`); + }) ); // Filter to agents that do not already use the new agent policy ID - const agentsToUpdate = allResults.filter((agent, index) => { - if (settled[index].status === 'fulfilled') { - if (agent.policy_id === newAgentPolicyId) { - settled[index] = { - status: 'rejected', - reason: new AgentReassignmentError( - `${agent.id} is already assigned to ${newAgentPolicyId}` - ), - }; - } else { - return true; - } + const agentsToUpdate = agentResults.reduce((agents, result, index) => { + if (result.status === 'fulfilled') { + agents.push(result.value); + } else { + const id = givenAgents[index].id; + outgoingErrors[id] = result.reason; } - }); + return agents; + }, []); - const res = await bulkUpdateAgents( + await bulkUpdateAgents( esClient, agentsToUpdate.map((agent) => ({ agentId: agent.id, @@ -110,6 +145,18 @@ export async function reassignAgents( })) ); + const orderedOut = givenOrder.map((agentId) => { + const hasError = agentId in outgoingErrors; + const result: BulkActionResult = { + id: agentId, + success: !hasError, + }; + if (hasError) { + result.error = outgoingErrors[agentId]; + } + return result; + }); + const now = new Date().toISOString(); await bulkCreateAgentActions( soClient, @@ -121,5 +168,5 @@ export async function reassignAgents( })) ); - return res; + return { items: orderedOut }; } diff --git a/x-pack/plugins/fleet/server/services/agents/upgrade.ts b/x-pack/plugins/fleet/server/services/agents/upgrade.ts index 12623be0ed0443..6c3b404a5b6f3f 100644 --- a/x-pack/plugins/fleet/server/services/agents/upgrade.ts +++ b/x-pack/plugins/fleet/server/services/agents/upgrade.ts @@ -83,32 +83,33 @@ export async function sendUpgradeAgentsActions( force?: boolean; } ) { - const kibanaVersion = appContextService.getKibanaVersion(); - // Filter out agents currently unenrolling, agents unenrolled, and agents not upgradeable - const agents = await getAgents(esClient, options); + // Full set of agents + const agentsGiven = await getAgents(esClient, options); - // upgradeable if they pass the version check + // Filter out agents currently unenrolling, unenrolled, or not upgradeable b/c of version check + const kibanaVersion = appContextService.getKibanaVersion(); const upgradeableAgents = options.force - ? agents - : agents.filter((agent) => isAgentUpgradeable(agent, kibanaVersion)); + ? agentsGiven + : agentsGiven.filter((agent) => isAgentUpgradeable(agent, kibanaVersion)); - // get any policy ids from upgradable agents - const policyIdsToGet = new Set( - upgradeableAgents.filter((agent) => agent.policy_id).map((agent) => agent.policy_id!) - ); + if (!options.force) { + // get any policy ids from upgradable agents + const policyIdsToGet = new Set( + upgradeableAgents.filter((agent) => agent.policy_id).map((agent) => agent.policy_id!) + ); - // get the agent policies for those ids - const agentPolicies = await agentPolicyService.getByIDs(soClient, Array.from(policyIdsToGet), { - fields: ['is_managed'], - }); + // get the agent policies for those ids + const agentPolicies = await agentPolicyService.getByIDs(soClient, Array.from(policyIdsToGet), { + fields: ['is_managed'], + }); - // throw if any of those agent policies are managed - for (const policy of agentPolicies) { - if (policy.is_managed) { - throw new IngestManagerError(`Cannot upgrade agent in managed policy ${policy.id}`); + // throw if any of those agent policies are managed + for (const policy of agentPolicies) { + if (policy.is_managed) { + throw new IngestManagerError(`Cannot upgrade agent in managed policy ${policy.id}`); + } } } - // Create upgrade action for each agent const now = new Date().toISOString(); const data = { diff --git a/x-pack/plugins/fleet/server/services/app_context.ts b/x-pack/plugins/fleet/server/services/app_context.ts index 21b519565e758d..c49e536435027d 100644 --- a/x-pack/plugins/fleet/server/services/app_context.ts +++ b/x-pack/plugins/fleet/server/services/app_context.ts @@ -17,6 +17,7 @@ import type { Logger, } from 'src/core/server'; +import type { PluginStart as DataPluginStart } from '../../../../../src/plugins/data/server'; import type { EncryptedSavedObjectsClient, EncryptedSavedObjectsPluginSetup, @@ -29,6 +30,7 @@ import type { CloudSetup } from '../../../cloud/server'; class AppContextService { private encryptedSavedObjects: EncryptedSavedObjectsClient | undefined; private encryptedSavedObjectsSetup: EncryptedSavedObjectsPluginSetup | undefined; + private data: DataPluginStart | undefined; private esClient: ElasticsearchClient | undefined; private security: SecurityPluginStart | undefined; private config$?: Observable; @@ -42,7 +44,13 @@ class AppContextService { private httpSetup?: HttpServiceSetup; private externalCallbacks: ExternalCallbacksStorage = new Map(); + /** + * Temporary flag until v7.13 ships + */ + public fleetServerEnabled: boolean = false; + public async start(appContext: FleetAppContext) { + this.data = appContext.data; this.esClient = appContext.elasticsearch.client.asInternalUser; this.encryptedSavedObjects = appContext.encryptedSavedObjectsStart?.getClient(); this.encryptedSavedObjectsSetup = appContext.encryptedSavedObjectsSetup; @@ -67,6 +75,13 @@ class AppContextService { this.externalCallbacks.clear(); } + public getData() { + if (!this.data) { + throw new Error('Data start service not set.'); + } + return this.data; + } + public getEncryptedSavedObjects() { if (!this.encryptedSavedObjects) { throw new Error('Encrypted saved object start service not set.'); diff --git a/x-pack/plugins/fleet/server/services/epm/archive/cache.ts b/x-pack/plugins/fleet/server/services/epm/archive/cache.ts index 6958f76c17b701..7f479dc5d6b63b 100644 --- a/x-pack/plugins/fleet/server/services/epm/archive/cache.ts +++ b/x-pack/plugins/fleet/server/services/epm/archive/cache.ts @@ -28,13 +28,9 @@ export const getArchiveFilelist = (keyArgs: SharedKey) => archiveFilelistCache.get(sharedKey(keyArgs)); export const setArchiveFilelist = (keyArgs: SharedKey, paths: string[]) => { - appContextService - .getLogger() - .debug( - `setting file list to the cache for ${keyArgs.name}-${keyArgs.version}:\n${JSON.stringify( - paths - )}` - ); + const logger = appContextService.getLogger(); + logger.debug(`setting file list to the cache for ${keyArgs.name}-${keyArgs.version}`); + logger.trace(JSON.stringify(paths)); return archiveFilelistCache.set(sharedKey(keyArgs), paths); }; @@ -63,12 +59,10 @@ export const setPackageInfo = ({ version, packageInfo, }: SharedKey & { packageInfo: ArchivePackage | RegistryPackage }) => { + const logger = appContextService.getLogger(); const key = sharedKey({ name, version }); - appContextService - .getLogger() - .debug( - `setting package info to the cache for ${name}-${version}:\n${JSON.stringify(packageInfo)}` - ); + logger.debug(`setting package info to the cache for ${name}-${version}`); + logger.trace(JSON.stringify(packageInfo)); return packageInfoCache.set(key, packageInfo); }; diff --git a/x-pack/plugins/fleet/server/services/epm/kibana/index_pattern/__snapshots__/install.test.ts.snap b/x-pack/plugins/fleet/server/services/epm/kibana/index_pattern/__snapshots__/install.test.ts.snap index 862e82589b9bc9..da870290329a88 100644 --- a/x-pack/plugins/fleet/server/services/epm/kibana/index_pattern/__snapshots__/install.test.ts.snap +++ b/x-pack/plugins/fleet/server/services/epm/kibana/index_pattern/__snapshots__/install.test.ts.snap @@ -40,7 +40,7 @@ exports[`creating index patterns from yaml fields createIndexPattern function cr { "title": "logs-*", "timeFieldName": "@timestamp", - "fields": "[{\\"name\\":\\"coredns.id\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"coredns.allParams\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"number\\"},{\\"name\\":\\"coredns.query.length\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"number\\"},{\\"name\\":\\"coredns.query.size\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"number\\"},{\\"name\\":\\"coredns.query.class\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"coredns.query.name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"coredns.query.type\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"coredns.response.code\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"coredns.response.flags\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"coredns.response.size\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"number\\"},{\\"name\\":\\"coredns.dnssec_ok\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"boolean\\"},{\\"name\\":\\"@timestamp\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"date\\"},{\\"name\\":\\"labels\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"message\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":false,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"tags\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"agent.ephemeral_id\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"agent.id\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"agent.name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"agent.type\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"agent.version\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"as.number\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"number\\"},{\\"name\\":\\"as.organization.name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"nginx.access.remote_ip_list\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.body_sent.bytes\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.user_name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.method\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.url\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.http_version\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.response_code\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.referrer\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.agent\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.user_agent.device\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.user_agent.name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.user_agent.os\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.user_agent.os_name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.user_agent.original\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.geoip.continent_name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":false,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"nginx.access.geoip.country_iso_code\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.geoip.location\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.geoip.region_name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.geoip.city_name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.geoip.region_iso_code\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"source.geo.continent_name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":false,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"country\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"country.keyword\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"country.text\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":false,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"}]", + "fields": "[{\\"name\\":\\"coredns.id\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"coredns.allParams\\",\\"type\\":\\"number\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"coredns.query.length\\",\\"type\\":\\"number\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"coredns.query.size\\",\\"type\\":\\"number\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"coredns.query.class\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"coredns.query.name\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"coredns.query.type\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"coredns.response.code\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"coredns.response.flags\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"coredns.response.size\\",\\"type\\":\\"number\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"coredns.dnssec_ok\\",\\"type\\":\\"boolean\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"@timestamp\\",\\"type\\":\\"date\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"labels\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"message\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":false,\\"readFromDocValues\\":true},{\\"name\\":\\"tags\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"agent.ephemeral_id\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"agent.id\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"agent.name\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"agent.type\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"agent.version\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"as.number\\",\\"type\\":\\"number\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"as.organization.name\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.remote_ip_list\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.body_sent.bytes\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.user_name\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.method\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.url\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.http_version\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.response_code\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.referrer\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.agent\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.user_agent.device\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.user_agent.name\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.user_agent.os\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.user_agent.os_name\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.user_agent.original\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.geoip.continent_name\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":false,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.geoip.country_iso_code\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.geoip.location\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.geoip.region_name\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.geoip.city_name\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.geoip.region_iso_code\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"source.geo.continent_name\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":false,\\"readFromDocValues\\":true},{\\"name\\":\\"country\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"country.keyword\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"country.text\\",\\"type\\":\\"string\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"searchable\\":true,\\"aggregatable\\":false,\\"readFromDocValues\\":true}]", "fieldFormatMap": "{\\"coredns.allParams\\":{\\"id\\":\\"bytes\\",\\"params\\":{\\"pattern\\":\\"patternValQueryWeight\\",\\"inputFormat\\":\\"inputFormatVal,\\",\\"outputFormat\\":\\"outputFormalVal,\\",\\"outputPrecision\\":\\"3,\\",\\"labelTemplate\\":\\"labelTemplateVal,\\",\\"urlTemplate\\":\\"urlTemplateVal,\\"}},\\"coredns.query.length\\":{\\"params\\":{\\"pattern\\":\\"patternValQueryLength\\"}},\\"coredns.query.size\\":{\\"id\\":\\"bytes\\",\\"params\\":{\\"pattern\\":\\"patternValQuerySize\\"}},\\"coredns.response.size\\":{\\"id\\":\\"bytes\\"}}", "allowNoIndex": true } @@ -51,535 +51,463 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "indexPatternFields": [ { "name": "coredns.id", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, - "readFromDocValues": true, - "type": "string" + "readFromDocValues": true }, { "name": "coredns.allParams", + "type": "number", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, - "readFromDocValues": true, - "type": "number" + "readFromDocValues": true }, { "name": "coredns.query.length", + "type": "number", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, - "readFromDocValues": true, - "type": "number" + "readFromDocValues": true }, { "name": "coredns.query.size", + "type": "number", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, - "readFromDocValues": true, - "type": "number" + "readFromDocValues": true }, { "name": "coredns.query.class", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, - "readFromDocValues": true, - "type": "string" + "readFromDocValues": true }, { "name": "coredns.query.name", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, - "readFromDocValues": true, - "type": "string" + "readFromDocValues": true }, { "name": "coredns.query.type", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, - "readFromDocValues": true, - "type": "string" + "readFromDocValues": true }, { "name": "coredns.response.code", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, - "readFromDocValues": true, - "type": "string" + "readFromDocValues": true }, { "name": "coredns.response.flags", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, - "readFromDocValues": true, - "type": "string" + "readFromDocValues": true }, { "name": "coredns.response.size", + "type": "number", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, - "readFromDocValues": true, - "type": "number" + "readFromDocValues": true }, { "name": "coredns.dnssec_ok", + "type": "boolean", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, - "readFromDocValues": true, - "type": "boolean" + "readFromDocValues": true }, { "name": "@timestamp", + "type": "date", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, - "readFromDocValues": true, - "type": "date" + "readFromDocValues": true }, { "name": "labels", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, "readFromDocValues": true }, { "name": "message", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": false, - "doc_values": true, - "readFromDocValues": true, - "type": "string" + "readFromDocValues": true }, { "name": "tags", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, - "readFromDocValues": true, - "type": "string" + "readFromDocValues": true }, { "name": "agent.ephemeral_id", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, - "readFromDocValues": true, - "type": "string" + "readFromDocValues": true }, { "name": "agent.id", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, - "readFromDocValues": true, - "type": "string" + "readFromDocValues": true }, { "name": "agent.name", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, - "readFromDocValues": true, - "type": "string" + "readFromDocValues": true }, { "name": "agent.type", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, - "readFromDocValues": true, - "type": "string" + "readFromDocValues": true }, { "name": "agent.version", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, - "readFromDocValues": true, - "type": "string" + "readFromDocValues": true }, { "name": "as.number", + "type": "number", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, - "readFromDocValues": true, - "type": "number" + "readFromDocValues": true }, { "name": "as.organization.name", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, - "readFromDocValues": true, - "type": "string" + "readFromDocValues": true }, { "name": "nginx.access.remote_ip_list", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, "readFromDocValues": true }, { "name": "nginx.access.body_sent.bytes", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, "readFromDocValues": true }, { "name": "nginx.access.user_name", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, "readFromDocValues": true }, { "name": "nginx.access.method", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, "readFromDocValues": true }, { "name": "nginx.access.url", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, "readFromDocValues": true }, { "name": "nginx.access.http_version", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, "readFromDocValues": true }, { "name": "nginx.access.response_code", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, "readFromDocValues": true }, { "name": "nginx.access.referrer", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, "readFromDocValues": true }, { "name": "nginx.access.agent", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, "readFromDocValues": true }, { "name": "nginx.access.user_agent.device", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, "readFromDocValues": true }, { "name": "nginx.access.user_agent.name", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, "readFromDocValues": true }, { "name": "nginx.access.user_agent.os", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, "readFromDocValues": true }, { "name": "nginx.access.user_agent.os_name", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, "readFromDocValues": true }, { "name": "nginx.access.user_agent.original", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, "readFromDocValues": true }, { "name": "nginx.access.geoip.continent_name", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": false, - "doc_values": true, - "readFromDocValues": true, - "type": "string" + "readFromDocValues": true }, { "name": "nginx.access.geoip.country_iso_code", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, "readFromDocValues": true }, { "name": "nginx.access.geoip.location", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, "readFromDocValues": true }, { "name": "nginx.access.geoip.region_name", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, "readFromDocValues": true }, { "name": "nginx.access.geoip.city_name", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, "readFromDocValues": true }, { "name": "nginx.access.geoip.region_iso_code", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, "readFromDocValues": true }, { "name": "source.geo.continent_name", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": false, - "doc_values": true, - "readFromDocValues": true, - "type": "string" + "readFromDocValues": true }, { "name": "country", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, - "readFromDocValues": true, - "type": "string" + "readFromDocValues": true }, { "name": "country.keyword", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true, - "readFromDocValues": true, - "type": "string" + "readFromDocValues": true }, { "name": "country.text", + "type": "string", "count": 0, "scripted": false, "indexed": true, - "analyzed": false, "searchable": true, "aggregatable": false, - "doc_values": true, - "readFromDocValues": true, - "type": "string" + "readFromDocValues": true } ], "fieldFormatMap": { diff --git a/x-pack/plugins/fleet/server/services/epm/kibana/index_pattern/install.test.ts b/x-pack/plugins/fleet/server/services/epm/kibana/index_pattern/install.test.ts index a0eaed04d649e8..dfdaa66a7b43e7 100644 --- a/x-pack/plugins/fleet/server/services/epm/kibana/index_pattern/install.test.ts +++ b/x-pack/plugins/fleet/server/services/epm/kibana/index_pattern/install.test.ts @@ -11,6 +11,8 @@ import { readFileSync } from 'fs'; import glob from 'glob'; import { safeLoad } from 'js-yaml'; +import type { FieldSpec } from 'src/plugins/data/common'; + import type { Fields, Field } from '../../fields/field'; import { @@ -22,7 +24,6 @@ import { createIndexPatternFields, createIndexPattern, } from './install'; -import type { IndexPatternField } from './install'; import { dupeFields } from './tests/test_data'; // Add our own serialiser to just do JSON.stringify @@ -93,7 +94,6 @@ describe('creating index patterns from yaml fields', () => { const mergedField = deduped.find((field) => field.name === '1'); expect(mergedField?.searchable).toBe(true); expect(mergedField?.aggregatable).toBe(true); - expect(mergedField?.analyzed).toBe(true); expect(mergedField?.count).toBe(0); }); }); @@ -156,7 +156,7 @@ describe('creating index patterns from yaml fields', () => { { fields: [{ name: 'testField', type: 'short' }], expect: 'number' }, { fields: [{ name: 'testField', type: 'byte' }], expect: 'number' }, { fields: [{ name: 'testField', type: 'keyword' }], expect: 'string' }, - { fields: [{ name: 'testField', type: 'invalidType' }], expect: undefined }, + { fields: [{ name: 'testField', type: 'invalidType' }], expect: 'string' }, { fields: [{ name: 'testField', type: 'text' }], expect: 'string' }, { fields: [{ name: 'testField', type: 'date' }], expect: 'date' }, { fields: [{ name: 'testField', type: 'geo_point' }], expect: 'geo_point' }, @@ -171,7 +171,7 @@ describe('creating index patterns from yaml fields', () => { test('transformField changes values based on other values', () => { interface TestWithAttr extends Test { - attr: keyof IndexPatternField; + attr: keyof FieldSpec; } const tests: TestWithAttr[] = [ @@ -211,43 +211,6 @@ describe('creating index patterns from yaml fields', () => { attr: 'aggregatable', }, - // analyzed - { fields: [{ name }], expect: false, attr: 'analyzed' }, - { fields: [{ name, analyzed: true }], expect: true, attr: 'analyzed' }, - { fields: [{ name, analyzed: false }], expect: false, attr: 'analyzed' }, - { fields: [{ name, type: 'binary' }], expect: false, attr: 'analyzed' }, - { fields: [{ name, analyzed: true, type: 'binary' }], expect: false, attr: 'analyzed' }, - { - fields: [{ name, analyzed: true, type: 'object', enabled: false }], - expect: false, - attr: 'analyzed', - }, - - // doc_values always set to true except for meta fields - { fields: [{ name }], expect: true, attr: 'doc_values' }, - { fields: [{ name, doc_values: true }], expect: true, attr: 'doc_values' }, - { fields: [{ name, doc_values: false }], expect: false, attr: 'doc_values' }, - { fields: [{ name, script: 'doc[]' }], expect: false, attr: 'doc_values' }, - { fields: [{ name, doc_values: true, script: 'doc[]' }], expect: false, attr: 'doc_values' }, - { fields: [{ name, type: 'binary' }], expect: false, attr: 'doc_values' }, - { fields: [{ name, doc_values: true, type: 'binary' }], expect: true, attr: 'doc_values' }, - { - fields: [{ name, doc_values: true, type: 'object', enabled: false }], - expect: false, - attr: 'doc_values', - }, - - // enabled - only applies to objects (and only if set) - { fields: [{ name, type: 'binary', enabled: false }], expect: undefined, attr: 'enabled' }, - { fields: [{ name, type: 'binary', enabled: true }], expect: undefined, attr: 'enabled' }, - { fields: [{ name, type: 'object', enabled: true }], expect: true, attr: 'enabled' }, - { fields: [{ name, type: 'object', enabled: false }], expect: false, attr: 'enabled' }, - { - fields: [{ name, type: 'object', enabled: false }], - expect: false, - attr: 'doc_values', - }, - // indexed { fields: [{ name, type: 'binary' }], expect: false, attr: 'indexed' }, { diff --git a/x-pack/plugins/fleet/server/services/epm/kibana/index_pattern/install.ts b/x-pack/plugins/fleet/server/services/epm/kibana/index_pattern/install.ts index 3ec9d2c65a6da2..61d6f6ed8818a4 100644 --- a/x-pack/plugins/fleet/server/services/epm/kibana/index_pattern/install.ts +++ b/x-pack/plugins/fleet/server/services/epm/kibana/index_pattern/install.ts @@ -5,9 +5,9 @@ * 2.0. */ -import type { SavedObjectsClientContract } from 'src/core/server'; +import type { SavedObjectsClientContract, ElasticsearchClient } from 'src/core/server'; +import type { FieldSpec } from 'src/plugins/data/common'; -import { INDEX_PATTERN_SAVED_OBJECT_TYPE } from '../../../../constants'; import { loadFieldsFromYaml } from '../../fields/field'; import type { Fields, Field } from '../../fields/field'; import { dataTypes, installationStatuses } from '../../../../../common/constants'; @@ -17,6 +17,7 @@ import type { InstallSource, ValueOf, } from '../../../../../common/types'; +import { appContextService } from '../../../../services'; import type { RegistryPackage, DataType } from '../../../../types'; import { getInstallation, getPackageFromSource, getPackageSavedObjects } from '../../packages/get'; @@ -59,29 +60,29 @@ const typeMap: TypeMap = { constant_keyword: 'string', }; -export interface IndexPatternField { - name: string; - type?: string; - count: number; - scripted: boolean; - indexed: boolean; - analyzed: boolean; - searchable: boolean; - aggregatable: boolean; - doc_values: boolean; - enabled?: boolean; - script?: string; - lang?: string; - readFromDocValues: boolean; -} +const INDEX_PATTERN_SAVED_OBJECT_TYPE = 'index-pattern'; export const indexPatternTypes = Object.values(dataTypes); -export async function installIndexPatterns( - savedObjectsClient: SavedObjectsClientContract, - pkgName?: string, - pkgVersion?: string, - installSource?: InstallSource -) { +export async function installIndexPatterns({ + savedObjectsClient, + pkgName, + pkgVersion, + installSource, +}: { + savedObjectsClient: SavedObjectsClientContract; + esClient: ElasticsearchClient; + pkgName?: string; + pkgVersion?: string; + installSource?: InstallSource; +}) { + const logger = appContextService.getLogger(); + + logger.debug( + `kicking off installation of index patterns for ${ + pkgName && pkgVersion ? `${pkgName}-${pkgVersion}` : 'no specific package' + }` + ); + // get all user installed packages const installedPackagesRes = await getPackageSavedObjects(savedObjectsClient); const installedPackagesSavedObjects = installedPackagesRes.saved_objects.filter( @@ -115,6 +116,7 @@ export async function installIndexPatterns( }); } } + // get each package's registry info const packagesToFetchPromise = packagesToFetch.map((pkg) => getPackageFromSource({ @@ -125,27 +127,33 @@ export async function installIndexPatterns( }) ); const packages = await Promise.all(packagesToFetchPromise); + // for each index pattern type, create an index pattern - indexPatternTypes.forEach(async (indexPatternType) => { - // if this is an update because a package is being uninstalled (no pkgkey argument passed) and no other packages are installed, remove the index pattern - if (!pkgName && installedPackagesSavedObjects.length === 0) { - try { - await savedObjectsClient.delete(INDEX_PATTERN_SAVED_OBJECT_TYPE, `${indexPatternType}-*`); - } catch (err) { - // index pattern was probably deleted by the user already + return Promise.all( + indexPatternTypes.map(async (indexPatternType) => { + // if this is an update because a package is being uninstalled (no pkgkey argument passed) and no other packages are installed, remove the index pattern + if (!pkgName && installedPackagesSavedObjects.length === 0) { + try { + logger.debug(`deleting index pattern ${indexPatternType}-*`); + await savedObjectsClient.delete(INDEX_PATTERN_SAVED_OBJECT_TYPE, `${indexPatternType}-*`); + } catch (err) { + // index pattern was probably deleted by the user already + } + return; } - return; - } - const packagesWithInfo = packages.map((pkg) => pkg.packageInfo); - // get all data stream fields from all installed packages - const fields = await getAllDataStreamFieldsByType(packagesWithInfo, indexPatternType); - const kibanaIndexPattern = createIndexPattern(indexPatternType, fields); - // create or overwrite the index pattern - await savedObjectsClient.create(INDEX_PATTERN_SAVED_OBJECT_TYPE, kibanaIndexPattern, { - id: `${indexPatternType}-*`, - overwrite: true, - }); - }); + const packagesWithInfo = packages.map((pkg) => pkg.packageInfo); + // get all data stream fields from all installed packages + const fields = await getAllDataStreamFieldsByType(packagesWithInfo, indexPatternType); + const kibanaIndexPattern = createIndexPattern(indexPatternType, fields); + + // create or overwrite the index pattern + await savedObjectsClient.create(INDEX_PATTERN_SAVED_OBJECT_TYPE, kibanaIndexPattern, { + id: `${indexPatternType}-*`, + overwrite: true, + }); + logger.debug(`created index pattern ${kibanaIndexPattern.title}`); + }) + ); } // loops through all given packages and returns an array @@ -189,7 +197,7 @@ export const createIndexPattern = (indexPatternType: string, fields: Fields) => // and also returns the fieldFormatMap export const createIndexPatternFields = ( fields: Fields -): { indexPatternFields: IndexPatternField[]; fieldFormatMap: FieldFormatMap } => { +): { indexPatternFields: FieldSpec[]; fieldFormatMap: FieldFormatMap } => { const flattenedFields = flattenFields(fields); const fieldFormatMap = createFieldFormatMap(flattenedFields); const transformedFields = flattenedFields.map(transformField); @@ -198,8 +206,8 @@ export const createIndexPatternFields = ( }; // merges fields that are duplicates with the existing taking precedence -export const dedupeFields = (fields: IndexPatternField[]) => { - const uniqueObj = fields.reduce<{ [name: string]: IndexPatternField }>((acc, field) => { +export const dedupeFields = (fields: FieldSpec[]) => { + const uniqueObj = fields.reduce<{ [name: string]: FieldSpec }>((acc, field) => { // if field doesn't exist yet if (!acc[field.name]) { acc[field.name] = field; @@ -251,34 +259,20 @@ const getField = (fields: Fields, pathNames: string[]): Field | undefined => { return undefined; }; -export const transformField = (field: Field, i: number, fields: Fields): IndexPatternField => { - const newField: IndexPatternField = { +export const transformField = (field: Field, i: number, fields: Fields): FieldSpec => { + const newField: FieldSpec = { name: field.name, + type: field.type && typeMap[field.type] ? typeMap[field.type] : 'string', count: field.count ?? 0, scripted: false, indexed: field.index ?? true, - analyzed: field.analyzed ?? false, searchable: field.searchable ?? true, aggregatable: field.aggregatable ?? true, - doc_values: field.doc_values ?? true, readFromDocValues: field.doc_values ?? true, }; - // if type exists, check if it exists in the map - if (field.type) { - // if no type match type is not set (undefined) - if (typeMap[field.type]) { - newField.type = typeMap[field.type]; - } - // if type isn't set, default to string - } else { - newField.type = 'string'; - } - if (newField.type === 'binary') { newField.aggregatable = false; - newField.analyzed = false; - newField.doc_values = field.doc_values ?? false; newField.readFromDocValues = field.doc_values ?? false; newField.indexed = false; newField.searchable = false; @@ -286,11 +280,8 @@ export const transformField = (field: Field, i: number, fields: Fields): IndexPa if (field.type === 'object' && field.hasOwnProperty('enabled')) { const enabled = field.enabled ?? true; - newField.enabled = enabled; if (!enabled) { newField.aggregatable = false; - newField.analyzed = false; - newField.doc_values = false; newField.readFromDocValues = false; newField.indexed = false; newField.searchable = false; @@ -305,7 +296,6 @@ export const transformField = (field: Field, i: number, fields: Fields): IndexPa newField.scripted = true; newField.script = field.script; newField.lang = 'painless'; - newField.doc_values = false; newField.readFromDocValues = false; } diff --git a/x-pack/plugins/fleet/server/services/epm/kibana/index_pattern/tests/test_data.ts b/x-pack/plugins/fleet/server/services/epm/kibana/index_pattern/tests/test_data.ts index 49a32de7037763..d9bcf366510813 100644 --- a/x-pack/plugins/fleet/server/services/epm/kibana/index_pattern/tests/test_data.ts +++ b/x-pack/plugins/fleet/server/services/epm/kibana/index_pattern/tests/test_data.ts @@ -5,9 +5,9 @@ * 2.0. */ -import type { IndexPatternField } from '../install'; +import type { FieldSpec } from 'src/plugins/data/common'; -export const dupeFields: IndexPatternField[] = [ +export const dupeFields: FieldSpec[] = [ { name: '1', type: 'integer', @@ -15,10 +15,8 @@ export const dupeFields: IndexPatternField[] = [ aggregatable: true, count: 0, indexed: true, - doc_values: true, readFromDocValues: true, scripted: false, - analyzed: true, }, { name: '2', @@ -27,10 +25,8 @@ export const dupeFields: IndexPatternField[] = [ aggregatable: true, count: 0, indexed: true, - doc_values: true, readFromDocValues: true, scripted: false, - analyzed: true, }, { name: '3', @@ -39,10 +35,8 @@ export const dupeFields: IndexPatternField[] = [ aggregatable: true, count: 0, indexed: true, - doc_values: true, readFromDocValues: true, scripted: false, - analyzed: true, }, { name: '1', @@ -51,10 +45,8 @@ export const dupeFields: IndexPatternField[] = [ aggregatable: false, count: 2, indexed: true, - doc_values: true, readFromDocValues: true, scripted: false, - analyzed: true, }, { name: '1.1', @@ -63,10 +55,8 @@ export const dupeFields: IndexPatternField[] = [ aggregatable: false, count: 0, indexed: true, - doc_values: true, readFromDocValues: true, scripted: false, - analyzed: true, }, { name: '4', @@ -75,10 +65,8 @@ export const dupeFields: IndexPatternField[] = [ aggregatable: false, count: 0, indexed: true, - doc_values: true, readFromDocValues: true, scripted: false, - analyzed: true, }, { name: '2', @@ -87,10 +75,8 @@ export const dupeFields: IndexPatternField[] = [ aggregatable: false, count: 0, indexed: true, - doc_values: true, readFromDocValues: true, scripted: false, - analyzed: true, }, { name: '1', @@ -99,9 +85,7 @@ export const dupeFields: IndexPatternField[] = [ aggregatable: false, count: 1, indexed: true, - doc_values: true, readFromDocValues: true, scripted: false, - analyzed: false, }, ]; diff --git a/x-pack/plugins/fleet/server/services/epm/packages/_install_package.ts b/x-pack/plugins/fleet/server/services/epm/packages/_install_package.ts index ca9d4906096363..65d71ac5fdc179 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/_install_package.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/_install_package.ts @@ -12,7 +12,6 @@ import type { InstallablePackage, InstallSource, PackageAssetReference } from '. import { PACKAGES_SAVED_OBJECT_TYPE } from '../../../constants'; import { ElasticsearchAssetType } from '../../../types'; import type { AssetReference, Installation, InstallType } from '../../../types'; -import { installIndexPatterns } from '../kibana/index_pattern/install'; import { installTemplates } from '../elasticsearch/template/install'; import { installPipelines, deletePreviousPipelines } from '../elasticsearch/ingest_pipeline/'; import { installILMPolicy } from '../elasticsearch/ilm/install'; @@ -81,11 +80,11 @@ export async function _installPackage({ }); } - // kick off `installIndexPatterns` & `installKibanaAssets` as early as possible because they're the longest running operations + // kick off `installKibanaAssets` as early as possible because they're the longest running operations // we don't `await` here because we don't want to delay starting the many other `install*` functions // however, without an `await` or a `.catch` we haven't defined how to handle a promise rejection // we define it many lines and potentially seconds of wall clock time later in - // `await Promise.all([installKibanaAssetsPromise, installIndexPatternPromise]);` + // `await installKibanaAssetsPromise` // if we encounter an error before we there, we'll have an "unhandled rejection" which causes its own problems // the program will log something like this _and exit/crash_ // Unhandled Promise rejection detected: @@ -96,13 +95,6 @@ export async function _installPackage({ // add a `.catch` to prevent the "unhandled rejection" case // in that `.catch`, set something that indicates a failure // check for that failure later and act accordingly (throw, ignore, return) - let installIndexPatternError; - const installIndexPatternPromise = installIndexPatterns( - savedObjectsClient, - pkgName, - pkgVersion, - installSource - ).catch((reason) => (installIndexPatternError = reason)); const kibanaAssets = await getKibanaAssets(paths); if (installedPkg) await deleteKibanaSavedObjectsAssets( @@ -184,9 +176,8 @@ export async function _installPackage({ })); // make sure the assets are installed (or didn't error) - if (installIndexPatternError) throw installIndexPatternError; if (installKibanaAssetsError) throw installKibanaAssetsError; - await Promise.all([installKibanaAssetsPromise, installIndexPatternPromise]); + await installKibanaAssetsPromise; const packageAssetResults = await saveArchiveEntries({ savedObjectsClient, diff --git a/x-pack/plugins/fleet/server/services/epm/packages/bulk_install_packages.ts b/x-pack/plugins/fleet/server/services/epm/packages/bulk_install_packages.ts index b726c60fc1e5ea..7323263d4a70f5 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/bulk_install_packages.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/bulk_install_packages.ts @@ -7,58 +7,72 @@ import type { ElasticsearchClient, SavedObjectsClientContract } from 'src/core/server'; +import { appContextService } from '../../app_context'; import * as Registry from '../registry'; +import { installIndexPatterns } from '../kibana/index_pattern/install'; -import { getInstallationObject } from './index'; -import { upgradePackage } from './install'; +import { installPackage } from './install'; import type { BulkInstallResponse, IBulkInstallPackageError } from './install'; interface BulkInstallPackagesParams { savedObjectsClient: SavedObjectsClientContract; - packagesToUpgrade: string[]; + packagesToInstall: string[]; esClient: ElasticsearchClient; } export async function bulkInstallPackages({ savedObjectsClient, - packagesToUpgrade, + packagesToInstall, esClient, }: BulkInstallPackagesParams): Promise { - const installedAndLatestPromises = packagesToUpgrade.map((pkgToUpgrade) => - Promise.all([ - getInstallationObject({ savedObjectsClient, pkgName: pkgToUpgrade }), - Registry.fetchFindLatestPackage(pkgToUpgrade), - ]) + const logger = appContextService.getLogger(); + const installSource = 'registry'; + const latestPackagesResults = await Promise.allSettled( + packagesToInstall.map((packageName) => Registry.fetchFindLatestPackage(packageName)) ); - const installedAndLatestResults = await Promise.allSettled(installedAndLatestPromises); - const installResponsePromises = installedAndLatestResults.map(async (result, index) => { - const pkgToUpgrade = packagesToUpgrade[index]; - if (result.status === 'fulfilled') { - const [installedPkg, latestPkg] = result.value; - return upgradePackage({ - savedObjectsClient, - esClient, - installedPkg, - latestPkg, - pkgToUpgrade, - }); - } else { - return { name: pkgToUpgrade, error: result.reason }; - } - }); - const installResults = await Promise.allSettled(installResponsePromises); - const installResponses = installResults.map((result, index) => { - const pkgToUpgrade = packagesToUpgrade[index]; - if (result.status === 'fulfilled') { - return result.value; - } else { - return { name: pkgToUpgrade, error: result.reason }; - } - }); - return installResponses; + logger.debug(`kicking off bulk install of ${packagesToInstall.join(', ')} from registry`); + const installResults = await Promise.allSettled( + latestPackagesResults.map(async (result, index) => { + const packageName = packagesToInstall[index]; + if (result.status === 'fulfilled') { + const latestPackage = result.value; + return { + name: packageName, + version: latestPackage.version, + result: await installPackage({ + savedObjectsClient, + esClient, + pkgkey: Registry.pkgToPkgKey(latestPackage), + installSource, + skipPostInstall: true, + }), + }; + } + return { name: packageName, error: result.reason }; + }) + ); + + // only install index patterns if we completed install for any package-version for the + // first time, aka fresh installs or upgrades + if ( + installResults.find( + (result) => result.status === 'fulfilled' && result.value.result?.status === 'installed' + ) + ) { + await installIndexPatterns({ savedObjectsClient, esClient, installSource }); + } + + return installResults.map((result, index) => { + const packageName = packagesToInstall[index]; + return result.status === 'fulfilled' + ? result.value + : { name: packageName, error: result.reason }; + }); } -export function isBulkInstallError(test: any): test is IBulkInstallPackageError { - return 'error' in test && test.error instanceof Error; +export function isBulkInstallError( + installResponse: any +): installResponse is IBulkInstallPackageError { + return 'error' in installResponse && installResponse.error instanceof Error; } diff --git a/x-pack/plugins/fleet/server/services/epm/packages/ensure_installed_default_packages.test.ts b/x-pack/plugins/fleet/server/services/epm/packages/ensure_installed_default_packages.test.ts index e01af7b64c0e3b..fa2ea9e2209edf 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/ensure_installed_default_packages.test.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/ensure_installed_default_packages.test.ts @@ -77,9 +77,8 @@ describe('ensureInstalledDefaultPackages', () => { return [ { name: mockInstallation.attributes.name, - assets: [], - newVersion: '', - oldVersion: '', + result: { assets: [], status: 'installed' }, + version: '', statusCode: 200, }, ]; @@ -96,16 +95,14 @@ describe('ensureInstalledDefaultPackages', () => { return [ { name: 'success one', - assets: [], - newVersion: '', - oldVersion: '', + result: { assets: [], status: 'installed' }, + version: '', statusCode: 200, }, { name: 'success two', - assets: [], - newVersion: '', - oldVersion: '', + result: { assets: [], status: 'installed' }, + version: '', statusCode: 200, }, { @@ -114,9 +111,8 @@ describe('ensureInstalledDefaultPackages', () => { }, { name: 'success three', - assets: [], - newVersion: '', - oldVersion: '', + result: { assets: [], status: 'installed' }, + version: '', statusCode: 200, }, { @@ -138,9 +134,8 @@ describe('ensureInstalledDefaultPackages', () => { return [ { name: 'undefined package', - assets: [], - newVersion: '', - oldVersion: '', + result: { assets: [], status: 'installed' }, + version: '', statusCode: 200, }, ]; diff --git a/x-pack/plugins/fleet/server/services/epm/packages/install.ts b/x-pack/plugins/fleet/server/services/epm/packages/install.ts index 011e77fb7e89b9..1a6b41976af98a 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/install.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/install.ts @@ -5,10 +5,8 @@ * 2.0. */ -import semverGt from 'semver/functions/gt'; import semverLt from 'semver/functions/lt'; import type Boom from '@hapi/boom'; -import type { UnwrapPromise } from '@kbn/utility-types'; import type { ElasticsearchClient, SavedObject, SavedObjectsClientContract } from 'src/core/server'; import { generateESIndexPatterns } from '../elasticsearch/template/template'; @@ -28,12 +26,14 @@ import type { AssetType, EsAssetReference, InstallType, + InstallResult, } from '../../../types'; import { appContextService } from '../../app_context'; import * as Registry from '../registry'; import { setPackageInfo, parseAndVerifyArchiveEntries, unpackBufferToCache } from '../archive'; import { toAssetReference } from '../kibana/assets/install'; import type { ArchiveAsset } from '../kibana/assets/install'; +import { installIndexPatterns } from '../kibana/index_pattern/install'; import { isRequiredPackage, @@ -63,7 +63,7 @@ export async function installLatestPackage(options: { savedObjectsClient, pkgkey, esClient, - }); + }).then(({ assets }) => assets); } catch (err) { throw err; } @@ -76,7 +76,7 @@ export async function ensureInstalledDefaultPackages( const installations = []; const bulkResponse = await bulkInstallPackages({ savedObjectsClient, - packagesToUpgrade: Object.values(defaultPackages), + packagesToInstall: Object.values(defaultPackages), esClient, }); @@ -164,6 +164,7 @@ export async function handleInstallPackageFailure({ savedObjectsClient, pkgkey: prevVersion, esClient, + force: true, }); } } catch (e) { @@ -177,64 +178,6 @@ export interface IBulkInstallPackageError { } export type BulkInstallResponse = BulkInstallPackageInfo | IBulkInstallPackageError; -interface UpgradePackageParams { - savedObjectsClient: SavedObjectsClientContract; - esClient: ElasticsearchClient; - installedPkg: UnwrapPromise>; - latestPkg: UnwrapPromise>; - pkgToUpgrade: string; -} -export async function upgradePackage({ - savedObjectsClient, - esClient, - installedPkg, - latestPkg, - pkgToUpgrade, -}: UpgradePackageParams): Promise { - if (!installedPkg || semverGt(latestPkg.version, installedPkg.attributes.version)) { - const pkgkey = Registry.pkgToPkgKey({ - name: latestPkg.name, - version: latestPkg.version, - }); - - try { - const assets = await installPackage({ - installSource: 'registry', - savedObjectsClient, - pkgkey, - esClient, - }); - return { - name: pkgToUpgrade, - newVersion: latestPkg.version, - oldVersion: installedPkg?.attributes.version ?? null, - assets, - }; - } catch (installFailed) { - await handleInstallPackageFailure({ - savedObjectsClient, - error: installFailed, - pkgName: latestPkg.name, - pkgVersion: latestPkg.version, - installedPkg, - esClient, - }); - return { name: pkgToUpgrade, error: installFailed }; - } - } else { - // package was already at the latest version - return { - name: pkgToUpgrade, - newVersion: latestPkg.version, - oldVersion: latestPkg.version, - assets: [ - ...installedPkg.attributes.installed_es, - ...installedPkg.attributes.installed_kibana, - ], - }; - } -} - interface InstallRegistryPackageParams { savedObjectsClient: SavedObjectsClientContract; pkgkey: string; @@ -247,32 +190,81 @@ async function installPackageFromRegistry({ pkgkey, esClient, force = false, -}: InstallRegistryPackageParams): Promise { +}: InstallRegistryPackageParams): Promise { + const logger = appContextService.getLogger(); // TODO: change epm API to /packageName/version so we don't need to do this const { pkgName, pkgVersion } = Registry.splitPkgKey(pkgkey); + // get the currently installed package const installedPkg = await getInstallationObject({ savedObjectsClient, pkgName }); const installType = getInstallType({ pkgVersion, installedPkg }); + + // get latest package version + const latestPackage = await Registry.fetchFindLatestPackage(pkgName); + // let the user install if using the force flag or needing to reinstall or install a previous version due to failed update const installOutOfDateVersionOk = - installType === 'reinstall' || installType === 'reupdate' || installType === 'rollback'; + force || ['reinstall', 'reupdate', 'rollback'].includes(installType); + + // if the requested version is the same as installed version, check if we allow it based on + // current installed package status and force flag, if we don't allow it, + // just return the asset references from the existing installation + if ( + installedPkg?.attributes.version === pkgVersion && + installedPkg?.attributes.install_status === 'installed' + ) { + if (!force) { + logger.debug(`${pkgkey} is already installed, skipping installation`); + return { + assets: [ + ...installedPkg.attributes.installed_es, + ...installedPkg.attributes.installed_kibana, + ], + status: 'already_installed', + }; + } + } - const latestPackage = await Registry.fetchFindLatestPackage(pkgName); - if (semverLt(pkgVersion, latestPackage.version) && !force && !installOutOfDateVersionOk) { - throw new PackageOutdatedError(`${pkgkey} is out-of-date and cannot be installed or updated`); + // if the requested version is out-of-date of the latest package version, check if we allow it + // if we don't allow it, return an error + if (semverLt(pkgVersion, latestPackage.version)) { + if (!installOutOfDateVersionOk) { + throw new PackageOutdatedError(`${pkgkey} is out-of-date and cannot be installed or updated`); + } + logger.debug( + `${pkgkey} is out-of-date, installing anyway due to ${ + force ? 'force flag' : `install type ${installType}` + }` + ); } + // get package info const { paths, packageInfo } = await Registry.getRegistryPackage(pkgName, pkgVersion); - return _installPackage({ - savedObjectsClient, - esClient, - installedPkg, - paths, - packageInfo, - installType, - installSource: 'registry', - }); + // try installing the package, if there was an error, call error handler and rethrow + try { + return _installPackage({ + savedObjectsClient, + esClient, + installedPkg, + paths, + packageInfo, + installType, + installSource: 'registry', + }).then((assets) => { + return { assets, status: 'installed' }; + }); + } catch (e) { + await handleInstallPackageFailure({ + savedObjectsClient, + error: e, + pkgName, + pkgVersion, + installedPkg, + esClient, + }); + throw e; + } } interface InstallUploadedArchiveParams { @@ -282,16 +274,12 @@ interface InstallUploadedArchiveParams { contentType: string; } -export type InstallPackageParams = - | ({ installSource: Extract } & InstallRegistryPackageParams) - | ({ installSource: Extract } & InstallUploadedArchiveParams); - async function installPackageByUpload({ savedObjectsClient, esClient, archiveBuffer, contentType, -}: InstallUploadedArchiveParams): Promise { +}: InstallUploadedArchiveParams): Promise { const { packageInfo } = await parseAndVerifyArchiveEntries(archiveBuffer, contentType); const installedPkg = await getInstallationObject({ @@ -329,32 +317,68 @@ async function installPackageByUpload({ packageInfo, installType, installSource, + }).then((assets) => { + return { assets, status: 'installed' }; }); } +export type InstallPackageParams = { + skipPostInstall?: boolean; +} & ( + | ({ installSource: Extract } & InstallRegistryPackageParams) + | ({ installSource: Extract } & InstallUploadedArchiveParams) +); + export async function installPackage(args: InstallPackageParams) { if (!('installSource' in args)) { throw new Error('installSource is required'); } + const logger = appContextService.getLogger(); + const { savedObjectsClient, esClient, skipPostInstall = false, installSource } = args; if (args.installSource === 'registry') { - const { savedObjectsClient, pkgkey, esClient, force } = args; - - return installPackageFromRegistry({ + const { pkgkey, force } = args; + const { pkgName, pkgVersion } = Registry.splitPkgKey(pkgkey); + logger.debug(`kicking off install of ${pkgkey} from registry`); + const response = installPackageFromRegistry({ savedObjectsClient, pkgkey, esClient, force, + }).then(async (installResult) => { + if (skipPostInstall) { + return installResult; + } + logger.debug(`install of ${pkgkey} finished, running post-install`); + return installIndexPatterns({ + savedObjectsClient, + esClient, + pkgName, + pkgVersion, + installSource, + }).then(() => installResult); }); + return response; } else if (args.installSource === 'upload') { - const { savedObjectsClient, esClient, archiveBuffer, contentType } = args; - - return installPackageByUpload({ + const { archiveBuffer, contentType } = args; + logger.debug(`kicking off install of uploaded package`); + const response = installPackageByUpload({ savedObjectsClient, esClient, archiveBuffer, contentType, + }).then(async (installResult) => { + if (skipPostInstall) { + return installResult; + } + logger.debug(`install of uploaded package finished, running post-install`); + return installIndexPatterns({ + savedObjectsClient, + esClient, + installSource, + }).then(() => installResult); }); + return response; } // @ts-expect-error s/b impossibe b/c `never` by this point, but just in case throw new Error(`Unknown installSource: ${args.installSource}`); @@ -451,26 +475,27 @@ export async function ensurePackagesCompletedInstall( searchFields: ['install_status'], search: 'installing', }); - const installingPromises = installingPackages.saved_objects.reduce< - Array> - >((acc, pkg) => { - const startDate = pkg.attributes.install_started_at; - const nowDate = new Date().toISOString(); - const elapsedTime = Date.parse(nowDate) - Date.parse(startDate); - const pkgkey = `${pkg.attributes.name}-${pkg.attributes.install_version}`; - // reinstall package - if (elapsedTime > MAX_TIME_COMPLETE_INSTALL) { - acc.push( - installPackage({ - installSource: 'registry', - savedObjectsClient, - pkgkey, - esClient, - }) - ); - } - return acc; - }, []); + const installingPromises = installingPackages.saved_objects.reduce>>( + (acc, pkg) => { + const startDate = pkg.attributes.install_started_at; + const nowDate = new Date().toISOString(); + const elapsedTime = Date.parse(nowDate) - Date.parse(startDate); + const pkgkey = `${pkg.attributes.name}-${pkg.attributes.install_version}`; + // reinstall package + if (elapsedTime > MAX_TIME_COMPLETE_INSTALL) { + acc.push( + installPackage({ + installSource: 'registry', + savedObjectsClient, + pkgkey, + esClient, + }) + ); + } + return acc; + }, + [] + ); await Promise.all(installingPromises); return installingPackages; } diff --git a/x-pack/plugins/fleet/server/services/epm/packages/remove.ts b/x-pack/plugins/fleet/server/services/epm/packages/remove.ts index da407c1d4cfa03..de798e822b0298 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/remove.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/remove.ts @@ -32,13 +32,14 @@ export async function removeInstallation(options: { savedObjectsClient: SavedObjectsClientContract; pkgkey: string; esClient: ElasticsearchClient; + force?: boolean; }): Promise { - const { savedObjectsClient, pkgkey, esClient } = options; + const { savedObjectsClient, pkgkey, esClient, force } = options; // TODO: the epm api should change to /name/version so we don't need to do this const { pkgName, pkgVersion } = splitPkgKey(pkgkey); const installation = await getInstallation({ savedObjectsClient, pkgName }); if (!installation) throw Boom.badRequest(`${pkgName} is not installed`); - if (installation.removable === false) + if (installation.removable === false && !force) throw Boom.badRequest(`${pkgName} is installed by default and cannot be removed`); const { total } = await packagePolicyService.list(savedObjectsClient, { @@ -63,7 +64,7 @@ export async function removeInstallation(options: { // recreate or delete index patterns when a package is uninstalled // this must be done after deleting the saved object for the current package otherwise it will retrieve the package // from the registry again and reinstall the index patterns - await installIndexPatterns(savedObjectsClient); + await installIndexPatterns({ savedObjectsClient, esClient }); // remove the package archive and its contents from the cache so that a reinstall fetches // a fresh copy from the registry diff --git a/x-pack/plugins/fleet/server/types/index.tsx b/x-pack/plugins/fleet/server/types/index.tsx index 885809d7673239..2b46f7e76a7198 100644 --- a/x-pack/plugins/fleet/server/types/index.tsx +++ b/x-pack/plugins/fleet/server/types/index.tsx @@ -72,6 +72,7 @@ export { SettingsSOAttributes, InstallType, InstallSource, + InstallResult, // Agent Request types PostAgentEnrollRequest, PostAgentCheckinRequest, @@ -89,5 +90,11 @@ export type AgentPolicyUpdateHandler = ( agentPolicyId: string ) => Promise; +export interface BulkActionResult { + id: string; + success: boolean; + error?: Error; +} + export * from './models'; export * from './rest_spec'; diff --git a/x-pack/plugins/fleet/server/types/rest_spec/epm.ts b/x-pack/plugins/fleet/server/types/rest_spec/epm.ts index 2243a7d3930cd3..f7e3ed906e24b0 100644 --- a/x-pack/plugins/fleet/server/types/rest_spec/epm.ts +++ b/x-pack/plugins/fleet/server/types/rest_spec/epm.ts @@ -65,4 +65,9 @@ export const DeletePackageRequestSchema = { params: schema.object({ pkgkey: schema.string(), }), + body: schema.nullable( + schema.object({ + force: schema.boolean(), + }) + ), }; diff --git a/x-pack/plugins/global_search_bar/jest.config.js b/x-pack/plugins/global_search_bar/jest.config.js index 73cf5402a83a93..26a6934226ec43 100644 --- a/x-pack/plugins/global_search_bar/jest.config.js +++ b/x-pack/plugins/global_search_bar/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/global_search_bar'], + + // TODO: migrate to "jest-environment-jsdom" https://github.com/elastic/kibana/issues/95200 + testEnvironment: 'jest-environment-jsdom-thirteen', }; diff --git a/x-pack/plugins/infra/common/http_api/infra_ml/results/metrics_hosts_anomalies.ts b/x-pack/plugins/infra/common/http_api/infra_ml/results/metrics_hosts_anomalies.ts index 0b70b65b7069e7..7c6a0f6d2ada78 100644 --- a/x-pack/plugins/infra/common/http_api/infra_ml/results/metrics_hosts_anomalies.ts +++ b/x-pack/plugins/infra/common/http_api/infra_ml/results/metrics_hosts_anomalies.ts @@ -13,17 +13,23 @@ import { anomalyTypeRT, paginationCursorRT, sortRT, paginationRT, metricRT } fro export const INFA_ML_GET_METRICS_HOSTS_ANOMALIES_PATH = '/api/infra/infra_ml/results/metrics_hosts_anomalies'; -const metricsHostAnomalyCommonFieldsRT = rt.type({ - id: rt.string, - anomalyScore: rt.number, - typical: rt.number, - actual: rt.number, - type: anomalyTypeRT, - influencers: rt.array(rt.string), - duration: rt.number, - startTime: rt.number, - jobId: rt.string, -}); +const metricsHostAnomalyCommonFieldsRT = rt.intersection([ + rt.type({ + id: rt.string, + anomalyScore: rt.number, + typical: rt.number, + actual: rt.number, + type: anomalyTypeRT, + influencers: rt.array(rt.string), + duration: rt.number, + startTime: rt.number, + jobId: rt.string, + }), + rt.partial({ + partitionFieldName: rt.string, + partitionFieldValue: rt.string, + }), +]); const metricsHostsAnomalyRT = metricsHostAnomalyCommonFieldsRT; export type MetricsHostsAnomaly = rt.TypeOf; @@ -67,6 +73,7 @@ export const getMetricsHostsAnomaliesRequestPayloadRT = rt.type({ timeRange: timeRangeRT, }), rt.partial({ + query: rt.string, metric: metricRT, // Pagination properties pagination: paginationRT, diff --git a/x-pack/plugins/infra/common/http_api/infra_ml/results/metrics_k8s_anomalies.ts b/x-pack/plugins/infra/common/http_api/infra_ml/results/metrics_k8s_anomalies.ts index 3ee6189dcbf9ae..2ad57c74ca2acc 100644 --- a/x-pack/plugins/infra/common/http_api/infra_ml/results/metrics_k8s_anomalies.ts +++ b/x-pack/plugins/infra/common/http_api/infra_ml/results/metrics_k8s_anomalies.ts @@ -13,17 +13,23 @@ import { paginationCursorRT, anomalyTypeRT, sortRT, paginationRT, metricRT } fro export const INFA_ML_GET_METRICS_K8S_ANOMALIES_PATH = '/api/infra/infra_ml/results/metrics_k8s_anomalies'; -const metricsK8sAnomalyCommonFieldsRT = rt.type({ - id: rt.string, - anomalyScore: rt.number, - typical: rt.number, - actual: rt.number, - type: anomalyTypeRT, - influencers: rt.array(rt.string), - duration: rt.number, - startTime: rt.number, - jobId: rt.string, -}); +const metricsK8sAnomalyCommonFieldsRT = rt.intersection([ + rt.type({ + id: rt.string, + anomalyScore: rt.number, + typical: rt.number, + actual: rt.number, + type: anomalyTypeRT, + influencers: rt.array(rt.string), + duration: rt.number, + startTime: rt.number, + jobId: rt.string, + }), + rt.partial({ + partitionFieldName: rt.string, + partitionFieldValue: rt.string, + }), +]); const metricsK8sAnomalyRT = metricsK8sAnomalyCommonFieldsRT; export type MetricsK8sAnomaly = rt.TypeOf; @@ -67,13 +73,12 @@ export const getMetricsK8sAnomaliesRequestPayloadRT = rt.type({ timeRange: timeRangeRT, }), rt.partial({ + query: rt.string, metric: metricRT, // Pagination properties pagination: paginationRT, // Sort properties sort: sortRT, - // Dataset filters - datasets: rt.array(rt.string), }), ]), }); diff --git a/x-pack/plugins/infra/public/alerting/inventory/components/expression.test.tsx b/x-pack/plugins/infra/public/alerting/inventory/components/expression.test.tsx index 891e98606264e0..88d72300c2d6db 100644 --- a/x-pack/plugins/infra/public/alerting/inventory/components/expression.test.tsx +++ b/x-pack/plugins/infra/public/alerting/inventory/components/expression.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, shallowWithIntl, nextTick } from '@kbn/test/jest'; // 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'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths @@ -89,6 +89,44 @@ describe('Expression', () => { }, ]); }); + + it('should pass the elasticsearch query to the expression chart', async () => { + const FILTER_QUERY = + '{"bool":{"should":[{"match_phrase":{"host.name":"testHostName"}}],"minimum_should_match":1}}'; + + const alertParams = { + criteria: [ + { + metric: 'cpu', + timeSize: 1, + timeUnit: 'm', + threshold: [10], + comparator: Comparator.GT, + }, + ], + nodeType: undefined, + filterQueryText: 'host.name: "testHostName"', + filterQuery: FILTER_QUERY, + }; + + const wrapper = shallowWithIntl( + Reflect.set(alertParams, key, value)} + setAlertProperty={() => {}} + metadata={{}} + /> + ); + + const chart = wrapper.find('[data-test-subj="preview-chart"]'); + + expect(chart.prop('filterQuery')).toBe(FILTER_QUERY); + }); + describe('using custom metrics', () => { it('should prefill the alert using the context metadata', async () => { const currentOptions = { diff --git a/x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx b/x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx index 9ce7162933f2d6..b28c76d1cb3746 100644 --- a/x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx +++ b/x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx @@ -319,9 +319,10 @@ export const Expressions: React.FC = (props) => { > ); diff --git a/x-pack/plugins/infra/public/hooks/use_sorting.tsx b/x-pack/plugins/infra/public/hooks/use_sorting.tsx new file mode 100644 index 00000000000000..a11586766ab9ee --- /dev/null +++ b/x-pack/plugins/infra/public/hooks/use_sorting.tsx @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useState } from 'react'; +import { CriteriaWithPagination } from '@elastic/eui/src/components/basic_table/basic_table'; + +export function useSorting(defaultSorting: CriteriaWithPagination['sort']) { + const [sorting, setSorting] = useState['sort']>(defaultSorting); + + return { + sorting, + setSorting, + }; +} diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomalies_table/annomaly_summary.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomalies_table/annomaly_summary.tsx new file mode 100644 index 00000000000000..09c8beeb2a1be4 --- /dev/null +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomalies_table/annomaly_summary.tsx @@ -0,0 +1,55 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiFlexGroup, EuiFlexItem, EuiIcon } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React from 'react'; +import { MetricsHostsAnomaly } from '../../../../../../../../common/http_api/infra_ml/results'; +import { formatOneDecimalPlace } from '../../../../../../../../common/log_analysis'; + +export const AnomalySummary = ({ anomaly }: { anomaly: MetricsHostsAnomaly }) => { + const { actual, typical } = anomaly; + + const moreThanExpectedAnomalyMessage = i18n.translate( + 'xpack.infra.ml.anomalyFlyout.anomaliesTableMoreThanExpectedAnomalyMessage', + { + defaultMessage: 'more', + } + ); + + const fewerThanExpectedAnomalyMessage = i18n.translate( + 'xpack.infra.ml.anomalyFlyout.anomaliesTableFewerThanExpectedAnomalyMessage', + { + defaultMessage: 'fewer', + } + ); + + const isMore = actual > typical; + const message = isMore ? moreThanExpectedAnomalyMessage : fewerThanExpectedAnomalyMessage; + const ratio = isMore ? actual / typical : typical / actual; + const icon = isMore ? 'sortUp' : 'sortDown'; + // Edge case scenarios where actual and typical might sit at 0. + const useRatio = ratio !== Infinity; + const ratioMessage = useRatio ? `${formatOneDecimalPlace(ratio)}x` : ''; + + return ( + + + + + + {`${ratioMessage} ${message}`} + {/* {anomaly.categoryRegex && ( + <> + {': '} + + + )} */} + + + ); +}; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomalies_table/anomalies_table.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomalies_table/anomalies_table.tsx new file mode 100644 index 00000000000000..7f0424cf487584 --- /dev/null +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomalies_table/anomalies_table.tsx @@ -0,0 +1,483 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; +import React, { ChangeEvent, useCallback, useEffect, useMemo, useState } from 'react'; +import { EuiSuperDatePicker } from '@elastic/eui'; +import { + EuiFlexItem, + EuiSpacer, + EuiFieldSearch, + EuiBasicTable, + EuiFlexGroup, + EuiTableFieldDataColumnType, + EuiTableActionsColumnType, + Criteria, + EuiContextMenuItem, + EuiComboBox, + EuiButtonIcon, + EuiPopover, + EuiContextMenuPanel, + EuiIcon, + EuiText, + OnTimeChangeProps, +} from '@elastic/eui'; +import { FormattedDate, FormattedMessage } from 'react-intl'; +import { datemathToEpochMillis } from '../../../../../../../utils/datemath'; +import { SnapshotMetricType } from '../../../../../../../../common/inventory_models/types'; +import { withTheme } from '../../../../../../../../../../../src/plugins/kibana_react/common'; +import { PrefilledAnomalyAlertFlyout } from '../../../../../../../alerting/metric_anomaly/components/alert_flyout'; +import { useLinkProps } from '../../../../../../../hooks/use_link_props'; +import { useSorting } from '../../../../../../../hooks/use_sorting'; +import { useMetricsK8sAnomaliesResults } from '../../../../hooks/use_metrics_k8s_anomalies'; +import { useMetricsHostsAnomaliesResults } from '../../../../hooks/use_metrics_hosts_anomalies'; +import { + Metric, + MetricsHostsAnomaly, + Sort, +} from '../../../../../../../../common/http_api/infra_ml/results'; +import { PaginationControls } from './pagination'; +import { AnomalySummary } from './annomaly_summary'; +import { AnomalySeverityIndicator } from '../../../../../../../components/logging/log_analysis_results/anomaly_severity_indicator'; +import { useSourceContext } from '../../../../../../../containers/source'; +import { createResultsUrl } from '../flyout_home'; +import { useWaffleViewState, WaffleViewState } from '../../../../hooks/use_waffle_view_state'; +type JobType = 'k8s' | 'hosts'; +type SortField = 'anomalyScore' | 'startTime'; +interface JobOption { + id: JobType; + label: string; +} +const AnomalyActionMenu = ({ + jobId, + type, + startTime, + closeFlyout, + partitionFieldName, + partitionFieldValue, +}: { + jobId: string; + type: string; + startTime: number; + closeFlyout: () => void; + partitionFieldName?: string; + partitionFieldValue?: string; +}) => { + const [isOpen, setIsOpen] = useState(false); + const [isAlertOpen, setIsAlertOpen] = useState(false); + const close = useCallback(() => setIsOpen(false), [setIsOpen]); + const handleToggleMenu = useCallback(() => setIsOpen(!isOpen), [isOpen]); + const openAlert = useCallback(() => setIsAlertOpen(true), [setIsAlertOpen]); + const closeAlert = useCallback(() => setIsAlertOpen(false), [setIsAlertOpen]); + const { onViewChange } = useWaffleViewState(); + + const showInInventory = useCallback(() => { + const metricTypeMap: { [key in Metric]: SnapshotMetricType } = { + memory_usage: 'memory', + network_in: 'rx', + network_out: 'tx', + }; + // parse the anomaly job id for metric type + const jobIdParts = jobId.split('-'); + const jobIdMetric = jobIdParts[jobIdParts.length - 1]; + const metricType = metricTypeMap[jobIdMetric.replace(/hosts_|k8s_/, '') as Metric]; + const anomalyViewParams: WaffleViewState = { + metric: { type: metricType }, + sort: { by: 'name', direction: 'desc' }, + groupBy: [], + nodeType: type === 'metrics_k8s' ? 'pod' : 'host', + view: 'map', + customOptions: [], + customMetrics: [], + boundsOverride: { max: 1, min: 0 }, + autoBounds: true, + accountId: '', + region: '', + autoReload: false, + filterQuery: { + expression: + partitionFieldName && partitionFieldValue + ? `${partitionFieldName}: "${partitionFieldValue}"` + : ``, + kind: 'kuery', + }, + legend: { palette: 'cool', reverseColors: false, steps: 10 }, + time: startTime, + }; + onViewChange(anomalyViewParams); + closeFlyout(); + }, [jobId, onViewChange, startTime, type, partitionFieldName, partitionFieldValue, closeFlyout]); + + const anomaliesUrl = useLinkProps({ + app: 'ml', + pathname: `/explorer?_g=${createResultsUrl([jobId.toString()])}`, + }); + + const items = [ + + + , + + + , + + + , + ]; + + return ( + <> + + } + isOpen={isOpen && !isAlertOpen} + closePopover={close} + > + + + {isAlertOpen && } + + ); +}; +export const NoAnomaliesFound = withTheme(({ theme }) => ( + + +

+ +

+

+ +

+ + + + +
+)); +interface Props { + closeFlyout(): void; +} +export const AnomaliesTable = (props: Props) => { + const { closeFlyout } = props; + const [search, setSearch] = useState(''); + const [start, setStart] = useState('now-30d'); + const [end, setEnd] = useState('now'); + const [timeRange, setTimeRange] = useState<{ start: number; end: number }>({ + start: datemathToEpochMillis(start) || 0, + end: datemathToEpochMillis(end, 'up') || 0, + }); + const { sorting, setSorting } = useSorting({ + field: 'startTime', + direction: 'desc', + }); + const jobOptions = [ + { + id: `hosts` as JobType, + label: i18n.translate('xpack.infra.ml.anomalyFlyout.hostBtn', { + defaultMessage: 'Hosts', + }), + }, + { + id: `k8s` as JobType, + label: i18n.translate('xpack.infra.ml.anomalyFlyout.podsBtn', { + defaultMessage: 'Kubernetes Pods', + }), + }, + ]; + const [jobType, setJobType] = useState('hosts'); + const [selectedJobType, setSelectedJobType] = useState([ + jobOptions.find((item) => item.id === 'hosts') || jobOptions[0], + ]); + const { source } = useSourceContext(); + const anomalyThreshold = source?.configuration.anomalyThreshold; + + const onTimeChange = useCallback( + ({ isInvalid, start: startChange, end: endChange }: OnTimeChangeProps) => { + if (!isInvalid) { + setStart(startChange); + setEnd(endChange); + setTimeRange({ + start: datemathToEpochMillis(startChange)!, + end: datemathToEpochMillis(endChange, 'up')!, + }); + } + }, + [] + ); + + const anomalyParams = useMemo( + () => ({ + sourceId: 'default', + anomalyThreshold: anomalyThreshold || 0, + startTime: timeRange.start, + endTime: timeRange.end, + defaultSortOptions: { + direction: sorting?.direction || 'desc', + field: (sorting?.field || 'startTime') as SortField, + }, + defaultPaginationOptions: { pageSize: 10 }, + }), + [timeRange, sorting?.field, sorting?.direction, anomalyThreshold] + ); + + const { + metricsHostsAnomalies, + getMetricsHostsAnomalies, + page: hostPage, + changeSortOptions: hostChangeSort, + fetchNextPage: hostFetchNextPage, + fetchPreviousPage: hostFetchPrevPage, + isLoadingMetricsHostsAnomalies: hostLoading, + } = useMetricsHostsAnomaliesResults(anomalyParams); + const { + metricsK8sAnomalies, + getMetricsK8sAnomalies, + page: k8sPage, + changeSortOptions: k8sChangeSort, + fetchNextPage: k8sFetchNextPage, + fetchPreviousPage: k8sPreviousPage, + isLoadingMetricsK8sAnomalies: k8sLoading, + } = useMetricsK8sAnomaliesResults(anomalyParams); + const page = useMemo(() => (jobType === 'hosts' ? hostPage : k8sPage), [ + jobType, + hostPage, + k8sPage, + ]); + const isLoading = useMemo(() => (jobType === 'hosts' ? hostLoading : k8sLoading), [ + jobType, + hostLoading, + k8sLoading, + ]); + const fetchNextPage = useMemo( + () => (jobType === 'hosts' ? hostFetchNextPage : k8sFetchNextPage), + [jobType, hostFetchNextPage, k8sFetchNextPage] + ); + const fetchPreviousPage = useMemo( + () => (jobType === 'hosts' ? hostFetchPrevPage : k8sPreviousPage), + [jobType, hostFetchPrevPage, k8sPreviousPage] + ); + + const getAnomalies = useMemo(() => { + if (jobType === 'hosts') { + return getMetricsHostsAnomalies; + } else if (jobType === 'k8s') { + return getMetricsK8sAnomalies; + } + }, [jobType, getMetricsK8sAnomalies, getMetricsHostsAnomalies]); + + const results = useMemo(() => { + if (jobType === 'hosts') { + return metricsHostsAnomalies; + } else { + return metricsK8sAnomalies; + } + }, [jobType, metricsHostsAnomalies, metricsK8sAnomalies]); + + const onSearchChange = useCallback((e: ChangeEvent) => { + setSearch(e.target.value); + }, []); + + const changeJobType = useCallback((selectedOptions) => { + setSelectedJobType(selectedOptions); + setJobType(selectedOptions[0].id); + }, []); + + const changeSortOptions = useCallback( + (nextSortOptions: Sort) => { + if (jobType === 'hosts') { + hostChangeSort(nextSortOptions); + } else { + k8sChangeSort(nextSortOptions); + } + }, + [hostChangeSort, k8sChangeSort, jobType] + ); + + const onTableChange = (criteria: Criteria) => { + setSorting(criteria.sort); + changeSortOptions({ + field: (criteria?.sort?.field || 'startTime') as SortField, + direction: criteria?.sort?.direction || 'desc', + }); + }; + + const columns: Array< + | EuiTableFieldDataColumnType + | EuiTableActionsColumnType + > = [ + { + field: 'startTime', + name: i18n.translate('xpack.infra.ml.anomalyFlyout.columnTime', { + defaultMessage: 'Time', + }), + width: '15%', + sortable: true, + textOnly: true, + truncateText: true, + render: (startTime: number) => ( + + ), + }, + { + field: 'jobId', + name: i18n.translate('xpack.infra.ml.anomalyFlyout.columnJob', { + defaultMessage: 'Job', + }), + width: '25%', + render: (jobId: string) => jobId, + }, + { + field: 'anomalyScore', + name: i18n.translate('xpack.infra.ml.anomalyFlyout.columnSeverit', { + defaultMessage: 'Severity', + }), + width: '15%', + sortable: true, + render: (anomalyScore: number) => , + }, + { + field: 'typical', + name: i18n.translate('xpack.infra.ml.anomalyFlyout.columnSummary', { + defaultMessage: 'Summary', + }), + width: '15%', + textOnly: true, + render: (typical: number, item: MetricsHostsAnomaly) => , + }, + { + field: 'influencers', + name: i18n.translate('xpack.infra.ml.anomalyFlyout.columnInfluencerName', { + defaultMessage: 'Node name', + }), + width: '20%', + textOnly: true, + truncateText: true, + render: (influencers: string[]) => influencers.join(','), + }, + { + name: i18n.translate('xpack.infra.ml.anomalyFlyout.columnActionsName', { + defaultMessage: 'Actions', + }), + width: '10%', + actions: [ + { + render: (anomaly: MetricsHostsAnomaly) => { + return ( + + ); + }, + }, + ], + }, + ]; + + useEffect(() => { + if (getAnomalies) { + getAnomalies(undefined, search); + } + }, [getAnomalies, search]); + + return ( +
+ + + + + + + + + + + + + + + + + + + columns={columns} + items={results} + sorting={{ sort: sorting }} + onChange={onTableChange} + hasActions={true} + loading={isLoading} + noItemsMessage={ + isLoading ? ( + + ) : ( + + ) + } + /> + + +
+ ); +}; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomalies_table/pagination.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomalies_table/pagination.tsx new file mode 100644 index 00000000000000..322a29a129a123 --- /dev/null +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomalies_table/pagination.tsx @@ -0,0 +1,57 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiFlexGroup, EuiFlexItem, EuiButtonIcon } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React from 'react'; + +const previousPageLabel = i18n.translate( + 'xpack.infra.logs.analysis.anomaliesTablePreviousPageLabel', + { + defaultMessage: 'Previous page', + } +); + +const nextPageLabel = i18n.translate('xpack.infra.logs.analysis.anomaliesTableNextPageLabel', { + defaultMessage: 'Next page', +}); + +export const PaginationControls = ({ + fetchPreviousPage, + fetchNextPage, + page, + isLoading, +}: { + fetchPreviousPage?: () => void; + fetchNextPage?: () => void; + page: number; + isLoading: boolean; +}) => { + return ( + + + + + + {page} + + + + + + ); +}; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomaly_detection_flyout.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomaly_detection_flyout.tsx index ba7ea0aa8d5d0f..326689e945e1d9 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomaly_detection_flyout.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomaly_detection_flyout.tsx @@ -75,6 +75,7 @@ export const AnomalyDetectionFlyout = () => { )} {screenName === 'setup' && ( 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 bc08827b271891..f7cad1b02a8dc6 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 @@ -14,6 +14,8 @@ import { EuiCallOut } from '@elastic/eui'; import { EuiButton } from '@elastic/eui'; import { EuiButtonEmpty } from '@elastic/eui'; import moment from 'moment'; +import { EuiTabs } from '@elastic/eui'; +import { EuiTab } from '@elastic/eui'; import { SubscriptionSplashContent } from '../../../../../../components/subscription_splash_content'; import { useInfraMLCapabilitiesContext } from '../../../../../../containers/ml/infra_ml_capabilities'; import { @@ -24,15 +26,18 @@ import { useMetricHostsModuleContext } from '../../../../../../containers/ml/mod import { useMetricK8sModuleContext } from '../../../../../../containers/ml/modules/metrics_k8s/module'; import { LoadingPage } from '../../../../../../components/loading_page'; import { useLinkProps } from '../../../../../../hooks/use_link_props'; +import { AnomaliesTable } from './anomalies_table/anomalies_table'; interface Props { hasSetupCapabilities: boolean; goToSetup(type: 'hosts' | 'kubernetes'): void; + closeFlyout(): void; } +type Tab = 'jobs' | 'anomalies'; export const FlyoutHome = (props: Props) => { - const [tab] = useState<'jobs' | 'anomalies'>('jobs'); - const { goToSetup } = props; + const [tab, setTab] = useState('jobs'); + const { goToSetup, closeFlyout } = props; const { fetchJobStatus: fetchHostJobStatus, setupStatus: hostSetupStatus, @@ -69,6 +74,12 @@ export const FlyoutHome = (props: Props) => { } }, [fetchK8sJobStatus, fetchHostJobStatus, hasInfraMLReadCapabilities]); + const hasJobs = hostJobSummaries.length > 0 || k8sJobSummaries.length > 0; + const manageJobsLinkProps = useLinkProps({ + app: 'ml', + pathname: '/jobs', + }); + if (!hasInfraMLCapabilities) { return ; } else if (!hasInfraMLReadCapabilities) { @@ -97,38 +108,66 @@ export const FlyoutHome = (props: Props) => { - -
- -

- -

-
-
+ + setTab('jobs')}> + Jobs + + setTab('anomalies')}> + Anomalies + + - - {(hostJobSummaries.length > 0 || k8sJobSummaries.length > 0) && ( - <> + 0} hasK8sJobs={k8sJobSummaries.length > 0} jobIds={jobIds} /> + ) + } + > + {tab === 'jobs' && ( + <> + {hasJobs && ( + <> + + + + + + + + + + )} + +

Create ML Jobs

+

+ +

+
+ + 0} + hasK8sJobs={k8sJobSummaries.length > 0} + hasSetupCapabilities={props.hasSetupCapabilities} + createHosts={createHosts} + createK8s={createK8s} + /> )} - {tab === 'jobs' && ( - 0} - hasK8sJobs={k8sJobSummaries.length > 0} - hasSetupCapabilities={props.hasSetupCapabilities} - createHosts={createHosts} - createK8s={createK8s} - /> - )} + + {tab === 'anomalies' && }
); @@ -158,39 +197,8 @@ const JobsEnabledCallout = (props: CalloutProps) => { }); } - const manageJobsLinkProps = useLinkProps({ - app: 'ml', - pathname: '/jobs', - }); - - const anomaliesUrl = useLinkProps({ - app: 'ml', - pathname: `/explorer?_g=${createResultsUrl(props.jobIds)}`, - }); - return ( <> - - - - - - - - - - - - - - - { } + icon={} // title="Hosts" title={ { } + icon={} title={ { ); }; -function createResultsUrl(jobIds: string[], mode = 'absolute') { +export const createResultsUrl = (jobIds: string[], mode = 'absolute') => { const idString = jobIds.map((j) => `'${j}'`).join(','); let path = ''; @@ -318,4 +326,4 @@ function createResultsUrl(jobIds: string[], mode = 'absolute') { path += "))&_a=(query:(query_string:(analyze_wildcard:!t,query:'*')))"; return path; -} +}; 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 25afd05633fa53..5ef6c9429c4b34 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 @@ -174,13 +174,14 @@ export const useMetricsHostsAnomaliesResults = ({ const [getMetricsHostsAnomaliesRequest, getMetricsHostsAnomalies] = useTrackedPromise( { cancelPreviousOn: 'creation', - createPromise: async (metric: Metric) => { + createPromise: async (metric?: Metric, query?: string) => { const { timeRange: { start: queryStartTime, end: queryEndTime }, sortOptions, paginationOptions, paginationCursor, } = reducerState; + return await callGetMetricHostsAnomaliesAPI( { sourceId, @@ -188,6 +189,7 @@ export const useMetricsHostsAnomaliesResults = ({ startTime: queryStartTime, endTime: queryEndTime, metric, + query, sort: sortOptions, pagination: { ...paginationOptions, @@ -205,6 +207,7 @@ export const useMetricsHostsAnomaliesResults = ({ payload: { lastReceivedCursors: requestCursors }, }); } + // Check if we have more "next" entries. "Page" covers the "previous" scenario, // since we need to know the page we're on anyway. if (!paginationCursor || (paginationCursor && 'searchAfter' in paginationCursor)) { @@ -295,6 +298,7 @@ export const useMetricsHostsAnomaliesResults = ({ fetchPreviousPage: reducerState.page > 1 ? handleFetchPreviousPage : undefined, fetchNextPage: reducerState.hasNextPage ? handleFetchNextPage : undefined, page: reducerState.page, + timeRange: reducerState.timeRange, }; }; @@ -303,7 +307,8 @@ interface RequestArgs { anomalyThreshold: number; startTime: number; endTime: number; - metric: Metric; + metric?: Metric; + query?: string; sort: Sort; pagination: Pagination; } @@ -312,7 +317,16 @@ export const callGetMetricHostsAnomaliesAPI = async ( requestArgs: RequestArgs, fetch: HttpHandler ) => { - const { sourceId, anomalyThreshold, startTime, endTime, metric, sort, pagination } = requestArgs; + const { + sourceId, + anomalyThreshold, + startTime, + endTime, + metric, + sort, + pagination, + query, + } = requestArgs; const response = await fetch(INFA_ML_GET_METRICS_HOSTS_ANOMALIES_PATH, { method: 'POST', body: JSON.stringify( @@ -324,6 +338,7 @@ export const callGetMetricHostsAnomaliesAPI = async ( startTime, endTime, }, + query, metric, sort, pagination, 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 c135a2c5e6661d..ad26c14df32b47 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 @@ -174,13 +174,12 @@ export const useMetricsK8sAnomaliesResults = ({ const [getMetricsK8sAnomaliesRequest, getMetricsK8sAnomalies] = useTrackedPromise( { cancelPreviousOn: 'creation', - createPromise: async (metric: Metric) => { + createPromise: async (metric?: Metric, query?: string) => { const { timeRange: { start: queryStartTime, end: queryEndTime }, sortOptions, paginationOptions, paginationCursor, - filteredDatasets: queryFilteredDatasets, } = reducerState; return await callGetMetricsK8sAnomaliesAPI( { @@ -189,12 +188,12 @@ export const useMetricsK8sAnomaliesResults = ({ startTime: queryStartTime, endTime: queryEndTime, metric, + query, sort: sortOptions, pagination: { ...paginationOptions, cursor: paginationCursor, }, - datasets: queryFilteredDatasets, }, services.http.fetch ); @@ -305,10 +304,10 @@ interface RequestArgs { anomalyThreshold: number; startTime: number; endTime: number; - metric: Metric; + metric?: Metric; + query?: string; sort: Sort; pagination: Pagination; - datasets?: string[]; } export const callGetMetricsK8sAnomaliesAPI = async ( @@ -321,9 +320,9 @@ export const callGetMetricsK8sAnomaliesAPI = async ( startTime, endTime, metric, + query, sort, pagination, - datasets, } = requestArgs; const response = await fetch(INFA_ML_GET_METRICS_K8S_ANOMALIES_PATH, { method: 'POST', @@ -337,9 +336,9 @@ export const callGetMetricsK8sAnomaliesAPI = async ( endTime, }, metric, + query, sort, pagination, - datasets, }, }) ), diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_anomaly/evaluate_condition.ts b/x-pack/plugins/infra/server/lib/alerting/metric_anomaly/evaluate_condition.ts index b7ef8ec7d23125..362cf0bc5a0731 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_anomaly/evaluate_condition.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_anomaly/evaluate_condition.ts @@ -31,21 +31,21 @@ export const evaluateCondition = async ({ }: ConditionParams) => { const getAnomalies = nodeType === 'k8s' ? getMetricK8sAnomalies : getMetricsHostsAnomalies; - const result = await getAnomalies( - { + const result = await getAnomalies({ + context: { spaceId, mlSystem, mlAnomalyDetectors, }, - sourceId ?? 'default', - threshold, + sourceId: sourceId ?? 'default', + anomalyThreshold: threshold, startTime, endTime, metric, - { field: 'anomalyScore', direction: 'desc' }, - { pageSize: 100 }, - influencerFilter - ); + sort: { field: 'anomalyScore', direction: 'desc' }, + pagination: { pageSize: 100 }, + influencerFilter, + }); return result; }; diff --git a/x-pack/plugins/infra/server/lib/infra_ml/common.ts b/x-pack/plugins/infra/server/lib/infra_ml/common.ts index 686f27d714cc16..aba38ce4165c0d 100644 --- a/x-pack/plugins/infra/server/lib/infra_ml/common.ts +++ b/x-pack/plugins/infra/server/lib/infra_ml/common.ts @@ -27,6 +27,8 @@ export interface MappedAnomalyHit { duration: number; influencers: string[]; categoryId?: string; + partitionFieldName?: string; + partitionFieldValue?: string; } export interface InfluencerFilter { diff --git a/x-pack/plugins/infra/server/lib/infra_ml/metrics_hosts_anomalies.ts b/x-pack/plugins/infra/server/lib/infra_ml/metrics_hosts_anomalies.ts index f6e11f5294191b..1e307dae8e5b79 100644 --- a/x-pack/plugins/infra/server/lib/infra_ml/metrics_hosts_anomalies.ts +++ b/x-pack/plugins/infra/server/lib/infra_ml/metrics_hosts_anomalies.ts @@ -11,7 +11,7 @@ import { fetchMlJob, MappedAnomalyHit, InfluencerFilter } from './common'; import { getJobId, metricsHostsJobTypes, ANOMALY_THRESHOLD } from '../../../common/infra_ml'; import { Sort, Pagination } from '../../../common/http_api/infra_ml'; import type { MlSystem, MlAnomalyDetectors } from '../../types'; -import { InsufficientAnomalyMlJobsConfigured, isMlPrivilegesError } from './errors'; +import { isMlPrivilegesError } from './errors'; import { decodeOrThrow } from '../../../common/runtime_types'; import { metricsHostsAnomaliesResponseRT, @@ -60,17 +60,29 @@ async function getCompatibleAnomaliesJobIds( }; } -export async function getMetricsHostsAnomalies( - context: Required, - sourceId: string, - anomalyThreshold: ANOMALY_THRESHOLD, - startTime: number, - endTime: number, - metric: 'memory_usage' | 'network_in' | 'network_out' | undefined, - sort: Sort, - pagination: Pagination, - influencerFilter?: InfluencerFilter -) { +export async function getMetricsHostsAnomalies({ + context, + sourceId, + anomalyThreshold, + startTime, + endTime, + metric, + sort, + pagination, + influencerFilter, + query, +}: { + context: Required; + sourceId: string; + anomalyThreshold: ANOMALY_THRESHOLD; + startTime: number; + endTime: number; + metric: 'memory_usage' | 'network_in' | 'network_out' | undefined; + sort: Sort; + pagination: Pagination; + influencerFilter?: InfluencerFilter; + query?: string; +}) { const finalizeMetricsHostsAnomaliesSpan = startTracingSpan('get metrics hosts entry anomalies'); const { @@ -84,9 +96,11 @@ export async function getMetricsHostsAnomalies( ); if (jobIds.length === 0) { - throw new InsufficientAnomalyMlJobsConfigured( - 'Metrics Hosts ML jobs need to be configured to search anomalies' - ); + return { + data: [], + hasMoreEntries: false, + timimg: { spans: [] }, + }; } try { @@ -103,7 +117,8 @@ export async function getMetricsHostsAnomalies( endTime, sort, pagination, - influencerFilter + influencerFilter, + query ); const data = anomalies.map((anomaly) => { @@ -136,6 +151,8 @@ const parseAnomalyResult = (anomaly: MappedAnomalyHit, jobId: string) => { duration, influencers, startTime: anomalyStartTime, + partitionFieldName, + partitionFieldValue, } = anomaly; return { @@ -148,6 +165,8 @@ const parseAnomalyResult = (anomaly: MappedAnomalyHit, jobId: string) => { startTime: anomalyStartTime, type: 'metrics_hosts' as const, jobId, + partitionFieldName, + partitionFieldValue, }; }; @@ -159,7 +178,8 @@ async function fetchMetricsHostsAnomalies( endTime: number, sort: Sort, pagination: Pagination, - influencerFilter?: InfluencerFilter + influencerFilter?: InfluencerFilter, + query?: string ) { // We'll request 1 extra entry on top of our pageSize to determine if there are // more entries to be fetched. This avoids scenarios where the client side can't @@ -168,20 +188,18 @@ async function fetchMetricsHostsAnomalies( const expandedPagination = { ...pagination, pageSize: pagination.pageSize + 1 }; const finalizeFetchLogEntryAnomaliesSpan = startTracingSpan('fetch metrics hosts anomalies'); - + const hostQuery = createMetricsHostsAnomaliesQuery({ + jobIds, + anomalyThreshold, + startTime, + endTime, + sort, + pagination: expandedPagination, + influencerFilter, + jobQuery: query, + }); const results = decodeOrThrow(metricsHostsAnomaliesResponseRT)( - await mlSystem.mlAnomalySearch( - createMetricsHostsAnomaliesQuery({ - jobIds, - anomalyThreshold, - startTime, - endTime, - sort, - pagination: expandedPagination, - influencerFilter, - }), - jobIds - ) + await mlSystem.mlAnomalySearch(hostQuery, jobIds) ); const { @@ -219,6 +237,8 @@ async function fetchMetricsHostsAnomalies( bucket_span: duration, timestamp: anomalyStartTime, by_field_value: categoryId, + partition_field_value: partitionFieldValue, + partition_field_name: partitionFieldName, } = result._source; const hostInfluencers = influencers.filter((i) => i.influencer_field_name === 'host.name'); @@ -236,6 +256,8 @@ async function fetchMetricsHostsAnomalies( startTime: anomalyStartTime, duration: duration * 1000, categoryId, + partitionFieldName, + partitionFieldValue, }; }); diff --git a/x-pack/plugins/infra/server/lib/infra_ml/metrics_k8s_anomalies.ts b/x-pack/plugins/infra/server/lib/infra_ml/metrics_k8s_anomalies.ts index 34039e9107f007..00635caee96fc8 100644 --- a/x-pack/plugins/infra/server/lib/infra_ml/metrics_k8s_anomalies.ts +++ b/x-pack/plugins/infra/server/lib/infra_ml/metrics_k8s_anomalies.ts @@ -11,7 +11,7 @@ import { fetchMlJob, MappedAnomalyHit, InfluencerFilter } from './common'; import { getJobId, metricsK8SJobTypes, ANOMALY_THRESHOLD } from '../../../common/infra_ml'; import { Sort, Pagination } from '../../../common/http_api/infra_ml'; import type { MlSystem, MlAnomalyDetectors } from '../../types'; -import { InsufficientAnomalyMlJobsConfigured, isMlPrivilegesError } from './errors'; +import { isMlPrivilegesError } from './errors'; import { decodeOrThrow } from '../../../common/runtime_types'; import { metricsK8sAnomaliesResponseRT, @@ -60,17 +60,29 @@ async function getCompatibleAnomaliesJobIds( }; } -export async function getMetricK8sAnomalies( - context: Required, - sourceId: string, - anomalyThreshold: ANOMALY_THRESHOLD, - startTime: number, - endTime: number, - metric: 'memory_usage' | 'network_in' | 'network_out' | undefined, - sort: Sort, - pagination: Pagination, - influencerFilter?: InfluencerFilter -) { +export async function getMetricK8sAnomalies({ + context, + sourceId, + anomalyThreshold, + startTime, + endTime, + metric, + sort, + pagination, + influencerFilter, + query, +}: { + context: Required; + sourceId: string; + anomalyThreshold: ANOMALY_THRESHOLD; + startTime: number; + endTime: number; + metric: 'memory_usage' | 'network_in' | 'network_out' | undefined; + sort: Sort; + pagination: Pagination; + influencerFilter?: InfluencerFilter; + query?: string; +}) { const finalizeMetricsK8sAnomaliesSpan = startTracingSpan('get metrics k8s entry anomalies'); const { @@ -84,9 +96,11 @@ export async function getMetricK8sAnomalies( ); if (jobIds.length === 0) { - throw new InsufficientAnomalyMlJobsConfigured( - 'Log rate or categorisation ML jobs need to be configured to search anomalies' - ); + return { + data: [], + hasMoreEntries: false, + timimg: { spans: [] }, + }; } const { @@ -102,7 +116,8 @@ export async function getMetricK8sAnomalies( endTime, sort, pagination, - influencerFilter + influencerFilter, + query ); const data = anomalies.map((anomaly) => { @@ -132,6 +147,8 @@ const parseAnomalyResult = (anomaly: MappedAnomalyHit, jobId: string) => { duration, influencers, startTime: anomalyStartTime, + partitionFieldName, + partitionFieldValue, } = anomaly; return { @@ -144,6 +161,8 @@ const parseAnomalyResult = (anomaly: MappedAnomalyHit, jobId: string) => { influencers, type: 'metrics_k8s' as const, jobId, + partitionFieldName, + partitionFieldValue, }; }; @@ -155,7 +174,8 @@ async function fetchMetricK8sAnomalies( endTime: number, sort: Sort, pagination: Pagination, - influencerFilter?: InfluencerFilter | undefined + influencerFilter?: InfluencerFilter | undefined, + query?: string ) { // We'll request 1 extra entry on top of our pageSize to determine if there are // more entries to be fetched. This avoids scenarios where the client side can't @@ -175,6 +195,7 @@ async function fetchMetricK8sAnomalies( sort, pagination: expandedPagination, influencerFilter, + jobQuery: query, }), jobIds ) @@ -215,6 +236,8 @@ async function fetchMetricK8sAnomalies( timestamp: anomalyStartTime, by_field_value: categoryId, influencers, + partition_field_value: partitionFieldValue, + partition_field_name: partitionFieldName, } = result._source; const podInfluencers = influencers.filter( @@ -233,6 +256,8 @@ async function fetchMetricK8sAnomalies( startTime: anomalyStartTime, duration: duration * 1000, categoryId, + partitionFieldValue, + partitionFieldName, }; }); diff --git a/x-pack/plugins/infra/server/lib/infra_ml/queries/common.ts b/x-pack/plugins/infra/server/lib/infra_ml/queries/common.ts index 6f996a672a44ad..f4088c56303e23 100644 --- a/x-pack/plugins/infra/server/lib/infra_ml/queries/common.ts +++ b/x-pack/plugins/infra/server/lib/infra_ml/queries/common.ts @@ -22,6 +22,14 @@ export const createJobIdFilters = (jobId: string) => [ }, ]; +export const createJobIdsQuery = (query: string) => [ + { + wildcard: { + job_id: `*${query}*`, + }, + }, +]; + export const createJobIdsFilters = (jobIds: string[]) => [ { terms: { diff --git a/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_host_anomalies.test.ts b/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_host_anomalies.test.ts index 4c3e0ca8bc26f8..7c281963e5717c 100644 --- a/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_host_anomalies.test.ts +++ b/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_host_anomalies.test.ts @@ -49,6 +49,7 @@ describe('createMetricsHostAnomaliesQuery', () => { 'record_score', 'typical', 'actual', + 'partition_field_name', 'partition_field_value', 'timestamp', 'bucket_span', diff --git a/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_hosts_anomalies.ts b/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_hosts_anomalies.ts index 7808851508a7c3..ab50986c3b3d5b 100644 --- a/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_hosts_anomalies.ts +++ b/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_hosts_anomalies.ts @@ -15,6 +15,7 @@ import { defaultRequestParameters, createAnomalyScoreFilter, createInfluencerFilter, + createJobIdsQuery, } from './common'; import { InfluencerFilter } from '../common'; import { Sort, Pagination } from '../../../../common/http_api/infra_ml'; @@ -36,6 +37,7 @@ export const createMetricsHostsAnomaliesQuery = ({ sort, pagination, influencerFilter, + jobQuery, }: { jobIds: string[]; anomalyThreshold: ANOMALY_THRESHOLD; @@ -44,16 +46,19 @@ export const createMetricsHostsAnomaliesQuery = ({ sort: Sort; pagination: Pagination; influencerFilter?: InfluencerFilter; + jobQuery?: string; }) => { const { field } = sort; const { pageSize } = pagination; - - const filters = [ + let filters: any = [ ...createJobIdsFilters(jobIds), ...createAnomalyScoreFilter(anomalyThreshold), ...createTimeRangeFilters(startTime, endTime), ...createResultTypeFilters(['record']), ]; + if (jobQuery) { + filters = [...filters, ...createJobIdsQuery(jobQuery)]; + } const influencerQuery = influencerFilter ? { must: createInfluencerFilter(influencerFilter) } @@ -64,6 +69,7 @@ export const createMetricsHostsAnomaliesQuery = ({ 'record_score', 'typical', 'actual', + 'partition_field_name', 'partition_field_value', 'timestamp', 'bucket_span', @@ -118,6 +124,8 @@ export const metricsHostsAnomalyHitRT = rt.type({ timestamp: rt.number, }), rt.partial({ + partition_field_name: rt.string, + partition_field_value: rt.string, by_field_value: rt.string, }), ]), diff --git a/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_k8s_anomalies.test.ts b/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_k8s_anomalies.test.ts index 81dcb390dff56e..61efb896a6c891 100644 --- a/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_k8s_anomalies.test.ts +++ b/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_k8s_anomalies.test.ts @@ -49,6 +49,7 @@ describe('createMetricsK8sAnomaliesQuery', () => { 'record_score', 'typical', 'actual', + 'partition_field_name', 'partition_field_value', 'timestamp', 'bucket_span', diff --git a/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_k8s_anomalies.ts b/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_k8s_anomalies.ts index 54eea067177edf..8fb8df5eef3d75 100644 --- a/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_k8s_anomalies.ts +++ b/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_k8s_anomalies.ts @@ -15,6 +15,7 @@ import { defaultRequestParameters, createAnomalyScoreFilter, createInfluencerFilter, + createJobIdsQuery, } from './common'; import { InfluencerFilter } from '../common'; import { Sort, Pagination } from '../../../../common/http_api/infra_ml'; @@ -36,6 +37,7 @@ export const createMetricsK8sAnomaliesQuery = ({ sort, pagination, influencerFilter, + jobQuery, }: { jobIds: string[]; anomalyThreshold: ANOMALY_THRESHOLD; @@ -44,17 +46,20 @@ export const createMetricsK8sAnomaliesQuery = ({ sort: Sort; pagination: Pagination; influencerFilter?: InfluencerFilter; + jobQuery?: string; }) => { const { field } = sort; const { pageSize } = pagination; - const filters = [ + let filters: any = [ ...createJobIdsFilters(jobIds), ...createAnomalyScoreFilter(anomalyThreshold), ...createTimeRangeFilters(startTime, endTime), ...createResultTypeFilters(['record']), ]; - + if (jobQuery) { + filters = [...filters, ...createJobIdsQuery(jobQuery)]; + } const influencerQuery = influencerFilter ? { must: createInfluencerFilter(influencerFilter) } : {}; @@ -64,6 +69,7 @@ export const createMetricsK8sAnomaliesQuery = ({ 'record_score', 'typical', 'actual', + 'partition_field_name', 'partition_field_value', 'timestamp', 'bucket_span', @@ -116,6 +122,8 @@ export const metricsK8sAnomalyHitRT = rt.type({ timestamp: rt.number, }), rt.partial({ + partition_field_name: rt.string, + partition_field_value: rt.string, by_field_value: rt.string, }), ]), diff --git a/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_hosts_anomalies.ts b/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_hosts_anomalies.ts index 6e227cfc12d113..15ff6c0834a757 100644 --- a/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_hosts_anomalies.ts +++ b/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_hosts_anomalies.ts @@ -39,6 +39,7 @@ export const initGetHostsAnomaliesRoute = ({ framework }: InfraBackendLibs) => { sort: sortParam, pagination: paginationParam, metric, + query, }, } = request.body; @@ -52,16 +53,17 @@ export const initGetHostsAnomaliesRoute = ({ framework }: InfraBackendLibs) => { paginationCursors, hasMoreEntries, timing, - } = await getMetricsHostsAnomalies( - requestContext.infra, + } = await getMetricsHostsAnomalies({ + context: requestContext.infra, sourceId, anomalyThreshold, startTime, endTime, metric, + query, sort, - pagination - ); + pagination, + }); return response.ok({ body: getMetricsHostsAnomaliesSuccessReponsePayloadRT.encode({ diff --git a/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_k8s_anomalies.ts b/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_k8s_anomalies.ts index 1c2c4947a02ea3..667760d1d409e3 100644 --- a/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_k8s_anomalies.ts +++ b/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_k8s_anomalies.ts @@ -38,6 +38,7 @@ export const initGetK8sAnomaliesRoute = ({ framework }: InfraBackendLibs) => { sort: sortParam, pagination: paginationParam, metric, + query, }, } = request.body; @@ -51,16 +52,17 @@ export const initGetK8sAnomaliesRoute = ({ framework }: InfraBackendLibs) => { paginationCursors, hasMoreEntries, timing, - } = await getMetricK8sAnomalies( - requestContext.infra, + } = await getMetricK8sAnomalies({ + context: requestContext.infra, sourceId, anomalyThreshold, startTime, endTime, metric, + query, sort, - pagination - ); + pagination, + }); return response.ok({ body: getMetricsK8sAnomaliesSuccessReponsePayloadRT.encode({ diff --git a/x-pack/plugins/infra/server/routes/metrics_explorer/lib/query_total_grouping.test.ts b/x-pack/plugins/infra/server/routes/metrics_explorer/lib/query_total_grouping.test.ts new file mode 100644 index 00000000000000..cc5631ffcec9c2 --- /dev/null +++ b/x-pack/plugins/infra/server/routes/metrics_explorer/lib/query_total_grouping.test.ts @@ -0,0 +1,127 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { queryTotalGroupings } from './query_total_groupings'; + +describe('queryTotalGroupings', () => { + const ESSearchClientMock = jest.fn().mockReturnValue({}); + const defaultOptions = { + timerange: { + from: 1615972672011, + interval: '>=10s', + to: 1615976272012, + field: '@timestamp', + }, + indexPattern: 'testIndexPattern', + metrics: [], + dropLastBucket: true, + groupBy: ['testField'], + }; + + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('should return 0 when there is no groupBy', async () => { + const { groupBy, ...options } = defaultOptions; + + const response = await queryTotalGroupings(ESSearchClientMock, options); + expect(response).toBe(0); + }); + + it('should return 0 when there is groupBy is empty', async () => { + const options = { + ...defaultOptions, + groupBy: [], + }; + + const response = await queryTotalGroupings(ESSearchClientMock, options); + expect(response).toBe(0); + }); + + it('should query ES with a timerange', async () => { + await queryTotalGroupings(ESSearchClientMock, defaultOptions); + + expect(ESSearchClientMock.mock.calls[0][0].body.query.bool.filter).toContainEqual({ + range: { + '@timestamp': { + gte: 1615972672011, + lte: 1615976272012, + format: 'epoch_millis', + }, + }, + }); + }); + + it('should query ES with a exist fields', async () => { + const options = { + ...defaultOptions, + groupBy: ['testField1', 'testField2'], + }; + + await queryTotalGroupings(ESSearchClientMock, options); + + expect(ESSearchClientMock.mock.calls[0][0].body.query.bool.filter).toContainEqual({ + exists: { field: 'testField1' }, + }); + + expect(ESSearchClientMock.mock.calls[0][0].body.query.bool.filter).toContainEqual({ + exists: { field: 'testField2' }, + }); + }); + + it('should query ES with a query filter', async () => { + const options = { + ...defaultOptions, + filters: [ + { + bool: { + should: [{ match_phrase: { field1: 'value1' } }], + minimum_should_match: 1, + }, + }, + ], + }; + + await queryTotalGroupings(ESSearchClientMock, options); + + expect(ESSearchClientMock.mock.calls[0][0].body.query.bool.filter).toContainEqual({ + bool: { + should: [ + { + match_phrase: { + field1: 'value1', + }, + }, + ], + minimum_should_match: 1, + }, + }); + }); + + it('should return 0 when there are no aggregations in the response', async () => { + const clientMock = jest.fn().mockReturnValue({}); + + const response = await queryTotalGroupings(clientMock, defaultOptions); + + expect(response).toBe(0); + }); + + it('should return the value of the aggregation in the response', async () => { + const clientMock = jest.fn().mockReturnValue({ + aggregations: { + count: { + value: 10, + }, + }, + }); + + const response = await queryTotalGroupings(clientMock, defaultOptions); + + expect(response).toBe(10); + }); +}); diff --git a/x-pack/plugins/infra/server/routes/metrics_explorer/lib/query_total_groupings.ts b/x-pack/plugins/infra/server/routes/metrics_explorer/lib/query_total_groupings.ts index 92aa39d3bf8206..b871fa21c111d7 100644 --- a/x-pack/plugins/infra/server/routes/metrics_explorer/lib/query_total_groupings.ts +++ b/x-pack/plugins/infra/server/routes/metrics_explorer/lib/query_total_groupings.ts @@ -23,6 +23,23 @@ export const queryTotalGroupings = async ( return Promise.resolve(0); } + let filters: Array> = [ + { + range: { + [options.timerange.field]: { + gte: options.timerange.from, + lte: options.timerange.to, + format: 'epoch_millis', + }, + }, + }, + ...options.groupBy.map((field) => ({ exists: { field } })), + ]; + + if (options.filters) { + filters = [...filters, ...options.filters]; + } + const params = { allowNoIndices: true, ignoreUnavailable: true, @@ -31,18 +48,7 @@ export const queryTotalGroupings = async ( size: 0, query: { bool: { - filter: [ - { - range: { - [options.timerange.field]: { - gte: options.timerange.from, - lte: options.timerange.to, - format: 'epoch_millis', - }, - }, - }, - ...options.groupBy.map((field) => ({ exists: { field } })), - ], + filter: filters, }, }, aggs: { diff --git a/x-pack/plugins/infra/server/services/log_entries/log_entries_search_strategy.ts b/x-pack/plugins/infra/server/services/log_entries/log_entries_search_strategy.ts index 190464ab6d5c1f..161685aac29ad4 100644 --- a/x-pack/plugins/infra/server/services/log_entries/log_entries_search_strategy.ts +++ b/x-pack/plugins/infra/server/services/log_entries/log_entries_search_strategy.ts @@ -203,13 +203,13 @@ const getLogEntryFromHit = ( } else if ('messageColumn' in column) { return { columnId: column.messageColumn.id, - message: messageFormattingRules.format(hit.fields, hit.highlight || {}), + message: messageFormattingRules.format(hit.fields ?? {}, hit.highlight || {}), }; } else { return { columnId: column.fieldColumn.id, field: column.fieldColumn.field, - value: hit.fields[column.fieldColumn.field] ?? [], + value: hit.fields?.[column.fieldColumn.field] ?? [], highlights: hit.highlight?.[column.fieldColumn.field] ?? [], }; } @@ -233,9 +233,9 @@ const pickRequestCursor = ( const getContextFromHit = (hit: LogEntryHit): LogEntryContext => { // Get all context fields, then test for the presence and type of the ones that go together - const containerId = hit.fields['container.id']?.[0]; - const hostName = hit.fields['host.name']?.[0]; - const logFilePath = hit.fields['log.file.path']?.[0]; + const containerId = hit.fields?.['container.id']?.[0]; + const hostName = hit.fields?.['host.name']?.[0]; + const logFilePath = hit.fields?.['log.file.path']?.[0]; if (typeof containerId === 'string') { return { 'container.id': containerId }; diff --git a/x-pack/plugins/infra/server/services/log_entries/log_entry_search_strategy.ts b/x-pack/plugins/infra/server/services/log_entries/log_entry_search_strategy.ts index 2088761800cfe4..85eacba823b2bd 100644 --- a/x-pack/plugins/infra/server/services/log_entries/log_entry_search_strategy.ts +++ b/x-pack/plugins/infra/server/services/log_entries/log_entry_search_strategy.ts @@ -121,5 +121,5 @@ const createLogEntryFromHit = (hit: LogEntryHit) => ({ id: hit._id, index: hit._index, cursor: getLogEntryCursorFromHit(hit), - fields: Object.entries(hit.fields).map(([field, value]) => ({ field, value })), + fields: Object.entries(hit.fields ?? {}).map(([field, value]) => ({ field, value })), }); diff --git a/x-pack/plugins/infra/server/services/log_entries/queries/log_entries.ts b/x-pack/plugins/infra/server/services/log_entries/queries/log_entries.ts index 460703b22766f1..aa640f106d1ee9 100644 --- a/x-pack/plugins/infra/server/services/log_entries/queries/log_entries.ts +++ b/x-pack/plugins/infra/server/services/log_entries/queries/log_entries.ts @@ -120,10 +120,10 @@ const createHighlightQuery = ( export const logEntryHitRT = rt.intersection([ commonHitFieldsRT, rt.type({ - fields: rt.record(rt.string, jsonArrayRT), sort: rt.tuple([rt.number, rt.number]), }), rt.partial({ + fields: rt.record(rt.string, jsonArrayRT), highlight: rt.record(rt.string, rt.array(rt.string)), }), ]); diff --git a/x-pack/plugins/infra/server/services/log_entries/queries/log_entry.ts b/x-pack/plugins/infra/server/services/log_entries/queries/log_entry.ts index 74a12f14adcaa7..51714be775e977 100644 --- a/x-pack/plugins/infra/server/services/log_entries/queries/log_entry.ts +++ b/x-pack/plugins/infra/server/services/log_entries/queries/log_entry.ts @@ -39,9 +39,11 @@ export const createGetLogEntryQuery = ( export const logEntryHitRT = rt.intersection([ commonHitFieldsRT, rt.type({ - fields: rt.record(rt.string, jsonArrayRT), sort: rt.tuple([rt.number, rt.number]), }), + rt.partial({ + fields: rt.record(rt.string, jsonArrayRT), + }), ]); export type LogEntryHit = rt.TypeOf; diff --git a/x-pack/plugins/infra/server/types.ts b/x-pack/plugins/infra/server/types.ts index 1c51a5549cb41f..5cae0158619460 100644 --- a/x-pack/plugins/infra/server/types.ts +++ b/x-pack/plugins/infra/server/types.ts @@ -5,7 +5,8 @@ * 2.0. */ -import type { DataRequestHandlerContext } from '../../../../src/plugins/data/server'; +import type { RequestHandlerContext } from 'src/core/server'; +import type { SearchRequestHandlerContext } from '../../../../src/plugins/data/server'; import { MlPluginSetup } from '../../ml/server'; export type MlSystem = ReturnType; @@ -26,6 +27,7 @@ export type InfraRequestHandlerContext = InfraMlRequestHandlerContext & /** * @internal */ -export interface InfraPluginRequestHandlerContext extends DataRequestHandlerContext { +export interface InfraPluginRequestHandlerContext extends RequestHandlerContext { infra: InfraRequestHandlerContext; + search: SearchRequestHandlerContext; } diff --git a/x-pack/plugins/lens/jest.config.js b/x-pack/plugins/lens/jest.config.js index 615e540eaedce2..9a3f12e1ead32b 100644 --- a/x-pack/plugins/lens/jest.config.js +++ b/x-pack/plugins/lens/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/lens'], + + // TODO: migrate to "jest-environment-jsdom" https://github.com/elastic/kibana/issues/95202 + testEnvironment: 'jest-environment-jsdom-thirteen', }; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx index 68a3e9056b05d0..2cad77b0034545 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx @@ -496,6 +496,15 @@ export const InnerIndexPatternDataPanel = function InnerIndexPatternDataPanel({ }; }, []); + const refreshFieldList = useCallback(async () => { + const newlyMappedIndexPattern = await loadIndexPatterns({ + indexPatternsService: data.indexPatterns, + cache: {}, + patterns: [currentIndexPattern.id], + }); + onUpdateIndexPattern(newlyMappedIndexPattern[currentIndexPattern.id]); + }, [data, currentIndexPattern, onUpdateIndexPattern]); + const editField = useMemo( () => editPermission @@ -509,17 +518,39 @@ export const InnerIndexPatternDataPanel = function InnerIndexPatternDataPanel({ fieldName, onSave: async () => { trackUiEvent(`save_field_${uiAction}`); - const newlyMappedIndexPattern = await loadIndexPatterns({ - indexPatternsService: data.indexPatterns, - cache: {}, - patterns: [currentIndexPattern.id], - }); - onUpdateIndexPattern(newlyMappedIndexPattern[currentIndexPattern.id]); + await refreshFieldList(); + }, + }); + } + : undefined, + [data, indexPatternFieldEditor, currentIndexPattern, editPermission, refreshFieldList] + ); + + const removeField = useMemo( + () => + editPermission + ? async (fieldName: string) => { + trackUiEvent('open_field_delete_modal'); + const indexPatternInstance = await data.indexPatterns.get(currentIndexPattern.id); + closeFieldEditor.current = indexPatternFieldEditor.openDeleteModal({ + ctx: { + indexPattern: indexPatternInstance, + }, + fieldName, + onDelete: async () => { + trackUiEvent('delete_field'); + await refreshFieldList(); }, }); } : undefined, - [data, indexPatternFieldEditor, currentIndexPattern, editPermission, onUpdateIndexPattern] + [ + currentIndexPattern.id, + data.indexPatterns, + editPermission, + indexPatternFieldEditor, + refreshFieldList, + ] ); const addField = useMemo( @@ -765,6 +796,7 @@ export const InnerIndexPatternDataPanel = function InnerIndexPatternDataPanel({ dropOntoWorkspace={dropOntoWorkspace} hasSuggestionForField={hasSuggestionForField} editField={editField} + removeField={removeField} />
diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/advanced_options.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/advanced_options.tsx new file mode 100644 index 00000000000000..ea5eb14d9c20eb --- /dev/null +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/advanced_options.tsx @@ -0,0 +1,82 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiLink, EuiText, EuiPopover, EuiButtonEmpty, EuiSpacer } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React, { useState } from 'react'; + +export function AdvancedOptions(props: { + options: Array<{ + title: string; + dataTestSubj: string; + onClick: () => void; + showInPopover: boolean; + inlineElement: React.ReactElement | null; + }>; +}) { + const [popoverOpen, setPopoverOpen] = useState(false); + const popoverOptions = props.options.filter((option) => option.showInPopover); + const inlineOptions = props.options + .filter((option) => option.inlineElement) + .map((option) => React.cloneElement(option.inlineElement!, { key: option.dataTestSubj })); + + return ( + <> + {popoverOptions.length > 0 && ( + + + { + setPopoverOpen(!popoverOpen); + }} + > + {i18n.translate('xpack.lens.indexPattern.advancedSettings', { + defaultMessage: 'Add advanced options', + })} + + } + isOpen={popoverOpen} + closePopover={() => { + setPopoverOpen(false); + }} + > + {popoverOptions.map(({ dataTestSubj, onClick, title }, index) => ( + + + { + setPopoverOpen(false); + onClick(); + }} + > + {title} + + + {popoverOptions.length - 1 !== index && } + + ))} + + + )} + {inlineOptions.length > 0 && ( + <> + + {inlineOptions} + + )} + + ); +} diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx index 08842fb7558888..1fc755ec489c7d 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx @@ -32,6 +32,7 @@ import { resetIncomplete, FieldBasedIndexPatternColumn, canTransition, + DEFAULT_TIME_SCALE, } from '../operations'; import { mergeLayer } from '../state_helpers'; import { FieldSelect } from './field_select'; @@ -41,7 +42,9 @@ import { IndexPattern, IndexPatternLayer } from '../types'; import { trackUiEvent } from '../../lens_ui_telemetry'; import { FormatSelector } from './format_selector'; import { ReferenceEditor } from './reference_editor'; -import { TimeScaling } from './time_scaling'; +import { setTimeScaling, TimeScaling } from './time_scaling'; +import { defaultFilter, Filtering, setFilter } from './filtering'; +import { AdvancedOptions } from './advanced_options'; const operationPanels = getOperationDisplay(); @@ -156,6 +159,8 @@ export function DimensionEditor(props: DimensionEditorProps) { .filter((type) => fieldByOperation[type]?.size || operationWithoutField.has(type)); }, [fieldByOperation, operationWithoutField]); + const [filterByOpenInitially, setFilterByOpenInitally] = useState(false); + // Operations are compatible if they match inputs. They are always compatible in // the empty state. Field-based operations are not compatible with field-less operations. const operationsWithCompatibility = [...possibleOperations].map((operationType) => { @@ -458,11 +463,63 @@ export function DimensionEditor(props: DimensionEditorProps) { )} {!currentFieldIsInvalid && !incompleteInfo && selectedColumn && ( - { + setStateWrapper( + setTimeScaling(columnId, state.layers[layerId], DEFAULT_TIME_SCALE) + ); + }, + showInPopover: Boolean( + operationDefinitionMap[selectedColumn.operationType].timeScalingMode && + operationDefinitionMap[selectedColumn.operationType].timeScalingMode !== + 'disabled' && + Object.values(state.layers[layerId].columns).some( + (col) => col.operationType === 'date_histogram' + ) && + !selectedColumn.timeScale + ), + inlineElement: ( + + ), + }, + { + title: i18n.translate('xpack.lens.indexPattern.filterBy.label', { + defaultMessage: 'Filter by', + }), + dataTestSubj: 'indexPattern-filter-by-enable', + onClick: () => { + setFilterByOpenInitally(true); + setStateWrapper(setFilter(columnId, state.layers[layerId], defaultFilter)); + }, + showInPopover: Boolean( + operationDefinitionMap[selectedColumn.operationType].filterable && + !selectedColumn.filter + ), + inlineElement: + operationDefinitionMap[selectedColumn.operationType].filterable && + selectedColumn.filter ? ( + + ) : null, + }, + ]} /> )} diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx index a6d2361be21d4c..d586818cb3c116 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx @@ -6,7 +6,7 @@ */ import { ReactWrapper, ShallowWrapper } from 'enzyme'; -import React, { ChangeEvent, MouseEvent } from 'react'; +import React, { ChangeEvent, MouseEvent, ReactElement } from 'react'; import { act } from 'react-dom/test-utils'; import { EuiComboBox, @@ -15,6 +15,7 @@ import { EuiRange, EuiSelect, EuiButtonIcon, + EuiPopover, } from '@elastic/eui'; import { DataPublicPluginStart } from '../../../../../../src/plugins/data/public'; import { @@ -30,10 +31,14 @@ import { documentField } from '../document_field'; import { OperationMetadata } from '../../types'; import { DateHistogramIndexPatternColumn } from '../operations/definitions/date_histogram'; import { getFieldByNameFactory } from '../pure_helpers'; -import { TimeScaling } from './time_scaling'; import { DimensionEditor } from './dimension_editor'; +import { AdvancedOptions } from './advanced_options'; +import { Filtering } from './filtering'; jest.mock('../loader'); +jest.mock('../query_input', () => ({ + QueryInput: () => null, +})); jest.mock('../operations'); jest.mock('lodash', () => { const original = jest.requireActual('lodash'); @@ -1029,7 +1034,7 @@ describe('IndexPatternDimensionEditorPanel', () => { } it('should not show custom options if time scaling is not available', () => { - wrapper = mount( + wrapper = shallow( { })} /> ); - expect(wrapper.find('[data-test-subj="indexPattern-time-scaling"]')).toHaveLength(0); + expect( + wrapper + .find(DimensionEditor) + .dive() + .find(AdvancedOptions) + .dive() + .find('[data-test-subj="indexPattern-time-scaling-enable"]') + ).toHaveLength(0); }); it('should show custom options if time scaling is available', () => { - wrapper = mount(); + wrapper = shallow(); expect( wrapper - .find(TimeScaling) - .find('[data-test-subj="indexPattern-time-scaling-popover"]') - .exists() - ).toBe(true); + .find(DimensionEditor) + .dive() + .find(AdvancedOptions) + .dive() + .find('[data-test-subj="indexPattern-time-scaling-enable"]') + ).toHaveLength(1); }); it('should show current time scaling if set', () => { @@ -1066,7 +1080,7 @@ describe('IndexPatternDimensionEditorPanel', () => { wrapper .find(DimensionEditor) .dive() - .find(TimeScaling) + .find(AdvancedOptions) .dive() .find('[data-test-subj="indexPattern-time-scaling-enable"]') .prop('onClick')!({} as MouseEvent); @@ -1239,6 +1253,199 @@ describe('IndexPatternDimensionEditorPanel', () => { }); }); + describe('filtering', () => { + function getProps(colOverrides: Partial) { + return { + ...defaultProps, + state: getStateWithColumns({ + datecolumn: { + dataType: 'date', + isBucketed: true, + label: '', + customLabel: true, + operationType: 'date_histogram', + sourceField: 'ts', + params: { + interval: '1d', + }, + }, + col2: { + dataType: 'number', + isBucketed: false, + label: 'Count of records', + operationType: 'count', + sourceField: 'Records', + ...colOverrides, + } as IndexPatternColumn, + }), + columnId: 'col2', + }; + } + + it('should not show custom options if time scaling is not available', () => { + wrapper = shallow( + + ); + expect( + wrapper + .find(DimensionEditor) + .dive() + .find(AdvancedOptions) + .dive() + .find('[data-test-subj="indexPattern-filter-by-enable"]') + ).toHaveLength(0); + }); + + it('should show custom options if filtering is available', () => { + wrapper = shallow(); + expect( + wrapper + .find(DimensionEditor) + .dive() + .find(AdvancedOptions) + .dive() + .find('[data-test-subj="indexPattern-filter-by-enable"]') + ).toHaveLength(1); + }); + + it('should show current filter if set', () => { + wrapper = mount( + + ); + expect( + (wrapper.find(Filtering).find(EuiPopover).prop('children') as ReactElement).props.value + ).toEqual({ language: 'kuery', query: 'a: b' }); + }); + + it('should allow to set filter initially', () => { + const props = getProps({}); + wrapper = shallow(); + wrapper + .find(DimensionEditor) + .dive() + .find(AdvancedOptions) + .dive() + .find('[data-test-subj="indexPattern-filter-by-enable"]') + .prop('onClick')!({} as MouseEvent); + expect(props.setState).toHaveBeenCalledWith( + { + ...props.state, + layers: { + first: { + ...props.state.layers.first, + columns: { + ...props.state.layers.first.columns, + col2: expect.objectContaining({ + filter: { + language: 'kuery', + query: '', + }, + }), + }, + }, + }, + }, + { shouldRemoveDimension: false, shouldReplaceDimension: true } + ); + }); + + it('should carry over filter to other operation if possible', () => { + const props = getProps({ + filter: { language: 'kuery', query: 'a: b' }, + sourceField: 'bytes', + operationType: 'sum', + label: 'Sum of bytes per hour', + }); + wrapper = mount(); + wrapper + .find('button[data-test-subj="lns-indexPatternDimension-count incompatible"]') + .simulate('click'); + expect(props.setState).toHaveBeenCalledWith( + { + ...props.state, + layers: { + first: { + ...props.state.layers.first, + columns: { + ...props.state.layers.first.columns, + col2: expect.objectContaining({ + filter: { language: 'kuery', query: 'a: b' }, + }), + }, + }, + }, + }, + { shouldRemoveDimension: false, shouldReplaceDimension: true } + ); + }); + + it('should allow to change filter', () => { + const props = getProps({ + filter: { language: 'kuery', query: 'a: b' }, + }); + wrapper = mount(); + (wrapper.find(Filtering).find(EuiPopover).prop('children') as ReactElement).props.onChange({ + language: 'kuery', + query: 'c: d', + }); + expect(props.setState).toHaveBeenCalledWith( + { + ...props.state, + layers: { + first: { + ...props.state.layers.first, + columns: { + ...props.state.layers.first.columns, + col2: expect.objectContaining({ + filter: { language: 'kuery', query: 'c: d' }, + }), + }, + }, + }, + }, + { shouldRemoveDimension: false, shouldReplaceDimension: true } + ); + }); + + it('should allow to remove filter', () => { + const props = getProps({ + filter: { language: 'kuery', query: 'a: b' }, + }); + wrapper = mount(); + wrapper + .find('[data-test-subj="indexPattern-filter-by-remove"]') + .find(EuiButtonIcon) + .prop('onClick')!( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + {} as any + ); + expect(props.setState).toHaveBeenCalledWith( + { + ...props.state, + layers: { + first: { + ...props.state.layers.first, + columns: { + ...props.state.layers.first.columns, + col2: expect.objectContaining({ + filter: undefined, + }), + }, + }, + }, + }, + { shouldRemoveDimension: false, shouldReplaceDimension: true } + ); + }); + }); + it('should render invalid field if field reference is broken', () => { wrapper = mount( void; + isInitiallyOpen: boolean; +}) { + const [filterPopoverOpen, setFilterPopoverOpen] = useState(isInitiallyOpen); + const selectedOperation = operationDefinitionMap[selectedColumn.operationType]; + if (!selectedOperation.filterable || !selectedColumn.filter) { + return null; + } + + const isInvalid = !isQueryValid(selectedColumn.filter, indexPattern); + + return ( + + + + { + setFilterPopoverOpen(false); + }} + anchorClassName="eui-fullWidth" + panelClassName="lnsIndexPatternDimensionEditor__filtersEditor" + button={ + + + {/* Empty for spacing */} + + { + setFilterPopoverOpen(!filterPopoverOpen); + }} + color={isInvalid ? 'danger' : 'text'} + title={i18n.translate('xpack.lens.indexPattern.filterBy.clickToEdit', { + defaultMessage: 'Click to edit', + })} + > + {selectedColumn.filter.query || + i18n.translate('xpack.lens.indexPattern.filterBy.emptyFilterQuery', { + defaultMessage: '(empty)', + })} + + + + + } + > + { + updateLayer(setFilter(columnId, layer, newQuery)); + }} + isInvalid={false} + onSubmit={() => {}} + /> + + + + { + updateLayer(setFilter(columnId, layer, undefined)); + }} + iconType="cross" + /> + + + + ); +} diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/operation_support.ts b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/operation_support.ts index d462d73740aaa0..801b1b17a1831d 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/operation_support.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/operation_support.ts @@ -8,7 +8,7 @@ import _ from 'lodash'; import { DatasourceDimensionDropProps } from '../../types'; import { OperationType } from '../indexpattern'; -import { getAvailableOperationsByMetadata } from '../operations'; +import { memoizedGetAvailableOperationsByMetadata } from '../operations'; import { IndexPatternPrivateState } from '../types'; export interface OperationSupportMatrix { @@ -30,7 +30,7 @@ export const getOperationSupportMatrix = (props: Props): OperationSupportMatrix const layerId = props.layerId; const currentIndexPattern = props.state.indexPatterns[props.state.layers[layerId].indexPatternId]; - const filteredOperationsByMetadata = getAvailableOperationsByMetadata( + const filteredOperationsByMetadata = memoizedGetAvailableOperationsByMetadata( currentIndexPattern ).filter((operation) => props.filterOperations(operation.operationMetaData)); diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/time_scaling.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/time_scaling.tsx index a9362060b2dd04..bf5b64bf3d6152 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/time_scaling.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/time_scaling.tsx @@ -7,23 +7,11 @@ import { EuiToolTip } from '@elastic/eui'; import { EuiIcon } from '@elastic/eui'; -import { - EuiLink, - EuiFormRow, - EuiSelect, - EuiFlexItem, - EuiFlexGroup, - EuiButtonIcon, - EuiText, - EuiPopover, - EuiButtonEmpty, - EuiSpacer, -} from '@elastic/eui'; +import { EuiFormRow, EuiSelect, EuiFlexItem, EuiFlexGroup, EuiButtonIcon } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import React, { useState } from 'react'; +import React from 'react'; import { adjustTimeScaleLabelSuffix, - DEFAULT_TIME_SCALE, IndexPatternColumn, operationDefinitionMap, } from '../operations'; @@ -64,7 +52,6 @@ export function TimeScaling({ layer: IndexPatternLayer; updateLayer: (newLayer: IndexPatternLayer) => void; }) { - const [popoverOpen, setPopoverOpen] = useState(false); const hasDateHistogram = layer.columnOrder.some( (colId) => layer.columns[colId].operationType === 'date_histogram' ); @@ -72,56 +59,12 @@ export function TimeScaling({ if ( !selectedOperation.timeScalingMode || selectedOperation.timeScalingMode === 'disabled' || - !hasDateHistogram + !hasDateHistogram || + !selectedColumn.timeScale ) { return null; } - if (!selectedColumn.timeScale) { - return ( - - - { - setPopoverOpen(!popoverOpen); - }} - > - {i18n.translate('xpack.lens.indexPattern.timeScale.advancedSettings', { - defaultMessage: 'Add advanced options', - })} - - } - isOpen={popoverOpen} - closePopover={() => { - setPopoverOpen(false); - }} - > - - { - setPopoverOpen(false); - updateLayer(setTimeScaling(columnId, layer, DEFAULT_TIME_SCALE)); - }} - > - {i18n.translate('xpack.lens.indexPattern.timeScale.enableTimeScale', { - defaultMessage: 'Normalize by unit', - })} - - - - - ); - } - return ( void; + removeField?: (name: string) => void; hasSuggestionForField: DatasourceDataPanelProps['hasSuggestionForField']; } @@ -107,6 +108,7 @@ export const InnerFieldItem = function InnerFieldItem(props: FieldItemProps) { groupIndex, dropOntoWorkspace, editField, + removeField, } = props; const [infoIsOpen, setOpen] = useState(false); @@ -122,6 +124,17 @@ export const InnerFieldItem = function InnerFieldItem(props: FieldItemProps) { [editField, setOpen] ); + const closeAndRemove = useMemo( + () => + removeField + ? (name: string) => { + removeField(name); + setOpen(false); + } + : undefined, + [removeField, setOpen] + ); + const dropOntoWorkspaceAndClose = useCallback( (droppedField: DragDropIdentifier) => { dropOntoWorkspace(droppedField); @@ -270,6 +283,7 @@ export const InnerFieldItem = function InnerFieldItem(props: FieldItemProps) { {...state} {...props} editField={closeAndEdit} + removeField={closeAndRemove} dropOntoWorkspace={dropOntoWorkspaceAndClose} /> @@ -285,12 +299,14 @@ function FieldPanelHeader({ hasSuggestionForField, dropOntoWorkspace, editField, + removeField, }: { field: IndexPatternField; indexPatternId: string; hasSuggestionForField: DatasourceDataPanelProps['hasSuggestionForField']; dropOntoWorkspace: DatasourceDataPanelProps['dropOntoWorkspace']; editField?: (name: string) => void; + removeField?: (name: string) => void; }) { const draggableField = { indexPatternId, @@ -302,7 +318,7 @@ function FieldPanelHeader({ }; return ( - +
{field.displayName}
@@ -315,20 +331,41 @@ function FieldPanelHeader({ field={draggableField} /> {editField && ( - - editField(field.name)} - iconType="pencil" - data-test-subj="lnsFieldListPanelEdit" - aria-label={i18n.translate('xpack.lens.indexPattern.editFieldLabel', { + + - + > + editField(field.name)} + iconType="pencil" + data-test-subj="lnsFieldListPanelEdit" + aria-label={i18n.translate('xpack.lens.indexPattern.editFieldLabel', { + defaultMessage: 'Edit index pattern field', + })} + /> + +
+ )} + {removeField && field.runtime && ( + + + removeField(field.name)} + iconType="trash" + data-test-subj="lnsFieldListPanelRemove" + color="danger" + aria-label={i18n.translate('xpack.lens.indexPattern.removeFieldLabel', { + defaultMessage: 'Remove index pattern field', + })} + /> + + )}
); @@ -347,6 +384,7 @@ function FieldItemPopoverContents(props: State & FieldItemProps) { data: { fieldFormats }, dropOntoWorkspace, editField, + removeField, hasSuggestionForField, hideDetails, } = props; @@ -379,6 +417,7 @@ function FieldItemPopoverContents(props: State & FieldItemProps) { dropOntoWorkspace={dropOntoWorkspace} hasSuggestionForField={hasSuggestionForField} editField={editField} + removeField={removeField} /> ); diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/field_list.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/field_list.tsx index 01ba0726d9e4d7..ceeb1f5b1caf3a 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/field_list.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/field_list.tsx @@ -53,6 +53,7 @@ export const FieldList = React.memo(function FieldList({ dropOntoWorkspace, hasSuggestionForField, editField, + removeField, }: { exists: (field: IndexPatternField) => boolean; fieldGroups: FieldGroups; @@ -68,6 +69,7 @@ export const FieldList = React.memo(function FieldList({ dropOntoWorkspace: DatasourceDataPanelProps['dropOntoWorkspace']; hasSuggestionForField: DatasourceDataPanelProps['hasSuggestionForField']; editField?: (name: string) => void; + removeField?: (name: string) => void; }) { const [pageSize, setPageSize] = useState(PAGINATION_SIZE); const [scrollContainer, setScrollContainer] = useState(undefined); @@ -144,6 +146,7 @@ export const FieldList = React.memo(function FieldList({ exists={exists(field)} field={field} editField={editField} + removeField={removeField} hideDetails={true} key={field.name} itemIndex={index} @@ -169,6 +172,7 @@ export const FieldList = React.memo(function FieldList({ helpTooltip={fieldGroup.helpText} exists={exists} editField={editField} + removeField={removeField} hideDetails={fieldGroup.hideDetails} hasLoaded={!!hasSyncedExistingFields} fieldsCount={fieldGroup.fields.length} diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/fields_accordion.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/fields_accordion.tsx index 74ea13a81539fe..a00f25b04651bf 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/fields_accordion.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/fields_accordion.tsx @@ -55,6 +55,7 @@ export interface FieldsAccordionProps { dropOntoWorkspace: DatasourceDataPanelProps['dropOntoWorkspace']; hasSuggestionForField: DatasourceDataPanelProps['hasSuggestionForField']; editField?: (name: string) => void; + removeField?: (name: string) => void; } export const FieldsAccordion = memo(function InnerFieldsAccordion({ @@ -76,6 +77,7 @@ export const FieldsAccordion = memo(function InnerFieldsAccordion({ dropOntoWorkspace, hasSuggestionForField, editField, + removeField, }: FieldsAccordionProps) { const renderField = useCallback( (field: IndexPatternField, index) => ( @@ -90,6 +92,7 @@ export const FieldsAccordion = memo(function InnerFieldsAccordion({ dropOntoWorkspace={dropOntoWorkspace} hasSuggestionForField={hasSuggestionForField} editField={editField} + removeField={removeField} /> ), [ @@ -100,6 +103,7 @@ export const FieldsAccordion = memo(function InnerFieldsAccordion({ hasSuggestionForField, groupIndex, editField, + removeField, ] ); diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/help_popover.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/help_popover.tsx index ca126ff4e40bfc..0e4c1897743b49 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/help_popover.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/help_popover.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { ReactNode } from 'react'; +import React, { ReactNode, useEffect } from 'react'; import { EuiIcon, EuiLink, @@ -15,6 +15,7 @@ import { EuiPopoverTitle, EuiText, } from '@elastic/eui'; +import { trackUiEvent } from '../lens_ui_telemetry'; import './help_popover.scss'; export const HelpPopoverButton = ({ @@ -50,6 +51,11 @@ export const HelpPopover = ({ isOpen: EuiPopoverProps['isOpen']; title?: string; }) => { + useEffect(() => { + if (isOpen) { + trackUiEvent('open_help_popover'); + } + }, [isOpen]); return ( { ]); }); + it('should wrap filtered metrics in filtered metric aggregation', async () => { + const queryBaseState: IndexPatternBaseState = { + currentIndexPatternId: '1', + layers: { + first: { + indexPatternId: '1', + columnOrder: ['col1', 'col2', 'col3'], + columns: { + col1: { + label: 'Count of records', + dataType: 'number', + isBucketed: false, + sourceField: 'Records', + operationType: 'count', + timeScale: 'h', + filter: { + language: 'kuery', + query: 'bytes > 5', + }, + }, + col2: { + label: 'Average of bytes', + dataType: 'number', + isBucketed: false, + sourceField: 'bytes', + operationType: 'avg', + timeScale: 'h', + }, + col3: { + label: 'Date', + dataType: 'date', + isBucketed: true, + operationType: 'date_histogram', + sourceField: 'timestamp', + params: { + interval: 'auto', + }, + }, + }, + }, + }, + }; + + const state = enrichBaseState(queryBaseState); + + const ast = indexPatternDatasource.toExpression(state, 'first') as Ast; + expect(ast.chain[0].arguments.aggs[0]).toMatchInlineSnapshot(` + Object { + "chain": Array [ + Object { + "arguments": Object { + "customBucket": Array [ + Object { + "chain": Array [ + Object { + "arguments": Object { + "enabled": Array [ + true, + ], + "filter": Array [ + "{\\"language\\":\\"kuery\\",\\"query\\":\\"bytes > 5\\"}", + ], + "id": Array [ + "col1-filter", + ], + "schema": Array [ + "bucket", + ], + }, + "function": "aggFilter", + "type": "function", + }, + ], + "type": "expression", + }, + ], + "customMetric": Array [ + Object { + "chain": Array [ + Object { + "arguments": Object { + "enabled": Array [ + true, + ], + "id": Array [ + "col1-metric", + ], + "schema": Array [ + "metric", + ], + }, + "function": "aggCount", + "type": "function", + }, + ], + "type": "expression", + }, + ], + "enabled": Array [ + true, + ], + "id": Array [ + "col1", + ], + "schema": Array [ + "metric", + ], + }, + "function": "aggFilteredMetric", + "type": "function", + }, + ], + "type": "expression", + } + `); + }); + it('should add time_scale and format function if time scale is set and supported', async () => { const queryBaseState: IndexPatternBaseState = { currentIndexPatternId: '1', diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts b/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts index 7a50b1e60d13fe..7052a69ee6fb73 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts @@ -29,6 +29,7 @@ import { VisualizeFieldContext } from '../../../../../src/plugins/ui_actions/pub import { documentField } from './document_field'; import { readFromStorage, writeToStorage } from '../settings_storage'; import { getFieldByNameFactory } from './pure_helpers'; +import { memoizedGetAvailableOperationsByMetadata } from './operations'; type SetState = StateSetter; type IndexPatternsService = Pick; @@ -49,6 +50,11 @@ export async function loadIndexPatterns({ return cache; } + if (memoizedGetAvailableOperationsByMetadata.cache.clear) { + // clear operations meta data cache because index pattern reference may change + memoizedGetAvailableOperationsByMetadata.cache.clear(); + } + const allIndexPatterns = await Promise.allSettled( missingIds.map((id) => indexPatternsService.get(id)) ); diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/__mocks__/index.ts b/x-pack/plugins/lens/public/indexpattern_datasource/operations/__mocks__/index.ts index dfb86ec16da30a..6ac208913af2e8 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/__mocks__/index.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/__mocks__/index.ts @@ -19,6 +19,7 @@ jest.spyOn(actualHelpers, 'getErrorMessages'); export const { getAvailableOperationsByMetadata, + memoizedGetAvailableOperationsByMetadata, getOperations, getOperationDisplay, getOperationTypesForField, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/counter_rate.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/counter_rate.tsx index b02926fe03fc36..331aa528e6d555 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/counter_rate.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/counter_rate.tsx @@ -82,6 +82,7 @@ export const counterRateOperation: OperationDefinition< scale: 'ratio', references: referenceIds, timeScale, + filter: previousColumn?.filter, params: getFormatFromPreviousColumn(previousColumn), }; }, @@ -106,4 +107,5 @@ export const counterRateOperation: OperationDefinition< )?.join(', '); }, timeScalingMode: 'mandatory', + filterable: true, }; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/cumulative_sum.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/cumulative_sum.tsx index 2bf46e3acad1bb..1664f3639b598a 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/cumulative_sum.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/cumulative_sum.tsx @@ -77,6 +77,7 @@ export const cumulativeSumOperation: OperationDefinition< operationType: 'cumulative_sum', isBucketed: false, scale: 'ratio', + filter: previousColumn?.filter, references: referenceIds, params: getFormatFromPreviousColumn(previousColumn), }; @@ -101,4 +102,5 @@ export const cumulativeSumOperation: OperationDefinition< }) )?.join(', '); }, + filterable: true, }; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/derivative.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/derivative.tsx index 2d4b69a151115f..5fb0bc3a835283 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/derivative.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/derivative.tsx @@ -83,6 +83,7 @@ export const derivativeOperation: OperationDefinition< scale: 'ratio', references: referenceIds, timeScale: previousColumn?.timeScale, + filter: previousColumn?.filter, params: getFormatFromPreviousColumn(previousColumn), }; }, @@ -108,4 +109,5 @@ export const derivativeOperation: OperationDefinition< )?.join(', '); }, timeScalingMode: 'optional', + filterable: true, }; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/moving_average.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/moving_average.tsx index f9dfc962ce8b7d..46cc64c2bc5184 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/moving_average.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/moving_average.tsx @@ -89,6 +89,7 @@ export const movingAverageOperation: OperationDefinition< scale: 'ratio', references: referenceIds, timeScale: previousColumn?.timeScale, + filter: previousColumn?.filter, params: { window: 5, ...getFormatFromPreviousColumn(previousColumn), @@ -119,6 +120,7 @@ export const movingAverageOperation: OperationDefinition< )?.join(', '); }, timeScalingMode: 'optional', + filterable: true, }; function MovingAverageParamEditor({ @@ -174,7 +176,11 @@ const MovingAveragePopup = () => { setIsPopoverOpen(!isPopoverOpen)}> + { + setIsPopoverOpen(!isPopoverOpen); + }} + > {i18n.translate('xpack.lens.indexPattern.movingAverage.helpText', { defaultMessage: 'How it works', })} diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/cardinality.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/cardinality.tsx index 80885a58e17f5d..513bac14af7a39 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/cardinality.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/cardinality.tsx @@ -70,6 +70,7 @@ export const cardinalityOperation: OperationDefinition ofName(getSafeName(column.sourceField, indexPattern)), buildColumn({ field, previousColumn }) { return { @@ -79,6 +80,7 @@ export const cardinalityOperation: OperationDefinition setIsPopoverOpen(!isPopoverOpen)}> + { + setIsPopoverOpen(!isPopoverOpen); + }} + > {i18n.translate('xpack.lens.indexPattern.dateHistogram.autoHelpText', { defaultMessage: 'How it works', })} diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filter_popover.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filter_popover.test.tsx index 48c1b8176bea96..6d1cc3254ca7e8 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filter_popover.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filter_popover.test.tsx @@ -10,8 +10,9 @@ import { shallow, mount } from 'enzyme'; import { act } from 'react-dom/test-utils'; import { EuiPopover, EuiLink } from '@elastic/eui'; import { createMockedIndexPattern } from '../../../mocks'; -import { FilterPopover, QueryInput } from './filter_popover'; +import { FilterPopover } from './filter_popover'; import { LabelInput } from '../shared_components'; +import { QueryInput } from '../../../query_input'; jest.mock('.', () => ({ isQueryValid: () => true, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filter_popover.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filter_popover.tsx index 569e394335648d..f5428bf24348f6 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filter_popover.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filter_popover.tsx @@ -8,13 +8,12 @@ import './filter_popover.scss'; import React, { MouseEventHandler, useEffect, useState } from 'react'; -import useDebounce from 'react-use/lib/useDebounce'; import { EuiPopover, EuiSpacer } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; import { FilterValue, defaultLabel, isQueryValid } from '.'; import { IndexPattern } from '../../../types'; -import { QueryStringInput, Query } from '../../../../../../../../src/plugins/data/public'; +import { Query } from '../../../../../../../../src/plugins/data/public'; import { LabelInput } from '../shared_components'; +import { QueryInput } from '../../../query_input'; export const FilterPopover = ({ filter, @@ -94,54 +93,3 @@ export const FilterPopover = ({ ); }; - -export const QueryInput = ({ - value, - onChange, - indexPattern, - isInvalid, - onSubmit, -}: { - value: Query; - onChange: (input: Query) => void; - indexPattern: IndexPattern; - isInvalid: boolean; - onSubmit: () => void; -}) => { - const [inputValue, setInputValue] = useState(value); - - useDebounce(() => onChange(inputValue), 256, [inputValue]); - - const handleInputChange = (input: Query) => { - setInputValue(input); - }; - - return ( - { - if (inputValue.query) { - onSubmit(); - } - }} - placeholder={ - inputValue.language === 'kuery' - ? i18n.translate('xpack.lens.indexPattern.filters.queryPlaceholderKql', { - defaultMessage: '{example}', - values: { example: 'method : "GET" or status : "404"' }, - }) - : i18n.translate('xpack.lens.indexPattern.filters.queryPlaceholderLucene', { - defaultMessage: '{example}', - values: { example: 'method:GET OR status:404' }, - }) - } - languageSwitcherPopoverAnchorPosition="rightDown" - /> - ); -}; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/index.ts b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/index.ts index 433c69466dc006..cdb93048c9a58f 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/index.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/index.ts @@ -230,6 +230,7 @@ interface BaseOperationDefinitionProps { * If set to optional, time scaling won't be enabled by default and can be removed. */ timeScalingMode?: TimeScalingMode; + filterable?: boolean; getHelpMessage?: (props: HelpProps) => React.ReactNode; } diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/last_value.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/last_value.tsx index 54d884c83020d2..4f5c897fb5378b 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/last_value.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/last_value.tsx @@ -161,12 +161,14 @@ export const lastValueOperation: OperationDefinition { return buildExpressionFunction('aggTopHit', { id: columnId, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx index b24b08c0be0c35..1767b76e88202a 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx @@ -99,6 +99,7 @@ function buildMetricOperation>({ isBucketed: false, scale: 'ratio', timeScale: optionalTimeScaling ? previousColumn?.timeScale : undefined, + filter: previousColumn?.filter, params: getFormatFromPreviousColumn(previousColumn), } as T), onFieldChange: (oldColumn, field) => { @@ -118,6 +119,7 @@ function buildMetricOperation>({ }, getErrorMessage: (layer, columnId, indexPattern) => getInvalidFieldMessage(layer.columns[columnId] as FieldBasedIndexPatternColumn, indexPattern), + filterable: true, } as OperationDefinition; } diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/range_editor.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/range_editor.tsx index 269c59822fefca..4851b6ff3ec975 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/range_editor.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/range_editor.tsx @@ -33,7 +33,11 @@ const GranularityHelpPopover = () => { setIsPopoverOpen(!isPopoverOpen)}> + { + setIsPopoverOpen(!isPopoverOpen); + }} + > {i18n.translate('xpack.lens.indexPattern.ranges.granularityHelpText', { defaultMessage: 'How it works', })} diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/layer_helpers.test.ts b/x-pack/plugins/lens/public/indexpattern_datasource/operations/layer_helpers.test.ts index 4f915160a52a85..4a05e6f372d30b 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/layer_helpers.test.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/layer_helpers.test.ts @@ -967,6 +967,49 @@ describe('state_helpers', () => { ); }); + it('should remove filter from the wrapped column if it gets wrapped (case new1)', () => { + const expectedColumn = { + label: 'Count', + customLabel: true, + dataType: 'number' as const, + isBucketed: false, + sourceField: 'Records', + operationType: 'count' as const, + }; + + const testFilter = { language: 'kuery', query: '' }; + + const layer: IndexPatternLayer = { + indexPatternId: '1', + columnOrder: ['col1'], + columns: { col1: { ...expectedColumn, filter: testFilter } }, + }; + const result = replaceColumn({ + layer, + indexPattern, + columnId: 'col1', + op: 'testReference' as OperationType, + visualizationGroups: [], + }); + + expect(operationDefinitionMap.testReference.buildColumn).toHaveBeenCalledWith( + expect.objectContaining({ + referenceIds: ['id1'], + previousColumn: expect.objectContaining({ + // filter should be passed to the buildColumn function of the target operation + filter: testFilter, + }), + }) + ); + expect(result.columns).toEqual( + expect.objectContaining({ + // filter should be stripped from the original column + id1: expectedColumn, + col1: expect.any(Object), + }) + ); + }); + it('should create a new no-input operation to use as reference (case new2)', () => { // @ts-expect-error this function is not valid operationDefinitionMap.testReference.requiredReferences = [ diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/layer_helpers.ts b/x-pack/plugins/lens/public/indexpattern_datasource/operations/layer_helpers.ts index 3a67e8e464323f..7853b7da7956ee 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/layer_helpers.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/layer_helpers.ts @@ -509,7 +509,18 @@ function applyReferenceTransition({ if (!hasExactMatch && isColumnValidAsReference({ validation, column: previousColumn })) { hasExactMatch = true; - const newLayer = { ...layer, columns: { ...layer.columns, [newId]: { ...previousColumn } } }; + const newLayer = { + ...layer, + columns: { + ...layer.columns, + [newId]: { + ...previousColumn, + // drop the filter for the referenced column because the wrapping operation + // is filterable as well and will handle it one level higher. + filter: operationDefinition.filterable ? undefined : previousColumn.filter, + }, + }, + }; layer = { ...layer, columnOrder: getColumnOrder(newLayer), diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/mocks.ts b/x-pack/plugins/lens/public/indexpattern_datasource/operations/mocks.ts index d5ea34f003561f..429d881341e791 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/mocks.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/mocks.ts @@ -32,6 +32,7 @@ export const createMockedReferenceOperation = () => { references: args.referenceIds, }; }), + filterable: true, isTransferable: jest.fn(), toExpression: jest.fn().mockReturnValue([]), getPossibleOperation: jest.fn().mockReturnValue({ dataType: 'number', isBucketed: false }), diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/operations.ts b/x-pack/plugins/lens/public/indexpattern_datasource/operations/operations.ts index 63671fe35e99e1..140ebc813f6c15 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/operations.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/operations.ts @@ -5,7 +5,7 @@ * 2.0. */ -import _ from 'lodash'; +import { memoize } from 'lodash'; import { OperationMetadata } from '../../types'; import { operationDefinitionMap, @@ -187,3 +187,5 @@ export function getAvailableOperationsByMetadata(indexPattern: IndexPattern) { return Object.values(operationByMetadata); } + +export const memoizedGetAvailableOperationsByMetadata = memoize(getAvailableOperationsByMetadata); diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/query_input.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/query_input.tsx new file mode 100644 index 00000000000000..50941148342c33 --- /dev/null +++ b/x-pack/plugins/lens/public/indexpattern_datasource/query_input.tsx @@ -0,0 +1,66 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useState } from 'react'; +import useDebounce from 'react-use/lib/useDebounce'; +import { i18n } from '@kbn/i18n'; +import { IndexPattern } from './types'; +import { QueryStringInput, Query } from '../../../../../src/plugins/data/public'; + +export const QueryInput = ({ + value, + onChange, + indexPattern, + isInvalid, + onSubmit, + disableAutoFocus, +}: { + value: Query; + onChange: (input: Query) => void; + indexPattern: IndexPattern; + isInvalid: boolean; + onSubmit: () => void; + disableAutoFocus?: boolean; +}) => { + const [inputValue, setInputValue] = useState(value); + + useDebounce(() => onChange(inputValue), 256, [inputValue]); + + const handleInputChange = (input: Query) => { + setInputValue(input); + }; + + return ( + { + if (inputValue.query) { + onSubmit(); + } + }} + placeholder={ + inputValue.language === 'kuery' + ? i18n.translate('xpack.lens.indexPattern.filters.queryPlaceholderKql', { + defaultMessage: '{example}', + values: { example: 'method : "GET" or status : "404"' }, + }) + : i18n.translate('xpack.lens.indexPattern.filters.queryPlaceholderLucene', { + defaultMessage: '{example}', + values: { example: 'method:GET OR status:404' }, + }) + } + languageSwitcherPopoverAnchorPosition="rightDown" + /> + ); +}; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/to_expression.ts b/x-pack/plugins/lens/public/indexpattern_datasource/to_expression.ts index 6a0fbb30068475..d786d781199b62 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/to_expression.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/to_expression.ts @@ -7,6 +7,7 @@ import type { IUiSettingsClient } from 'kibana/public'; import { + AggFunctionsMapping, EsaggsExpressionFunctionDefinition, IndexPatternLoadExpressionFunctionDefinition, } from '../../../../../src/plugins/data/public'; @@ -29,11 +30,32 @@ function getExpressionForLayer( indexPattern: IndexPattern, uiSettings: IUiSettingsClient ): ExpressionAstExpression | null { - const { columns, columnOrder } = layer; + const { columnOrder } = layer; if (columnOrder.length === 0 || !indexPattern) { return null; } + const columns = { ...layer.columns }; + Object.keys(columns).forEach((columnId) => { + const column = columns[columnId]; + const rootDef = operationDefinitionMap[column.operationType]; + if ( + 'references' in column && + rootDef.filterable && + rootDef.input === 'fullReference' && + column.filter + ) { + // inherit filter to all referenced operations + column.references.forEach((referenceColumnId) => { + const referencedColumn = columns[referenceColumnId]; + const referenceDef = operationDefinitionMap[column.operationType]; + if (referenceDef.filterable) { + columns[referenceColumnId] = { ...referencedColumn, filter: column.filter }; + } + }); + } + }); + const columnEntries = columnOrder.map((colId) => [colId, columns[colId]] as const); if (columnEntries.length) { @@ -44,10 +66,37 @@ function getExpressionForLayer( if (def.input === 'fullReference') { expressions.push(...def.toExpression(layer, colId, indexPattern)); } else { + const wrapInFilter = Boolean(def.filterable && col.filter); + let aggAst = def.toEsAggsFn( + col, + wrapInFilter ? `${colId}-metric` : colId, + indexPattern, + layer, + uiSettings + ); + if (wrapInFilter) { + aggAst = buildExpressionFunction( + 'aggFilteredMetric', + { + id: colId, + enabled: true, + schema: 'metric', + customBucket: buildExpression([ + buildExpressionFunction('aggFilter', { + id: `${colId}-filter`, + enabled: true, + schema: 'bucket', + filter: JSON.stringify(col.filter), + }), + ]), + customMetric: buildExpression({ type: 'expression', chain: [aggAst] }), + } + ).toAst(); + } aggs.push( buildExpression({ type: 'expression', - chain: [def.toEsAggsFn(col, colId, indexPattern, layer, uiSettings)], + chain: [aggAst], }) ); } diff --git a/x-pack/plugins/lens/server/usage/schema.ts b/x-pack/plugins/lens/server/usage/schema.ts index ba892f5ca994cc..ab3945a0162a68 100644 --- a/x-pack/plugins/lens/server/usage/schema.ts +++ b/x-pack/plugins/lens/server/usage/schema.ts @@ -10,6 +10,10 @@ import { LensUsage } from './types'; const eventsSchema: MakeSchemaFrom = { app_query_change: { type: 'long' }, + open_help_popover: { + type: 'long', + _meta: { description: 'Number of times the user opened one of the in-product help popovers.' }, + }, indexpattern_field_info_click: { type: 'long' }, loaded: { type: 'long' }, app_filters_updated: { type: 'long' }, @@ -34,15 +38,130 @@ const eventsSchema: MakeSchemaFrom = { xy_change_layer_display: { type: 'long' }, xy_layer_removed: { type: 'long' }, xy_layer_added: { type: 'long' }, - indexpattern_dimension_operation_terms: { type: 'long' }, - indexpattern_dimension_operation_date_histogram: { type: 'long' }, - indexpattern_dimension_operation_avg: { type: 'long' }, - indexpattern_dimension_operation_min: { type: 'long' }, - indexpattern_dimension_operation_max: { type: 'long' }, - indexpattern_dimension_operation_sum: { type: 'long' }, - indexpattern_dimension_operation_count: { type: 'long' }, - indexpattern_dimension_operation_cardinality: { type: 'long' }, - indexpattern_dimension_operation_filters: { type: 'long' }, + open_field_editor_edit: { + type: 'long', + _meta: { + description: + 'Number of times the user opened the editor flyout to edit a field from within Lens.', + }, + }, + open_field_editor_add: { + type: 'long', + _meta: { + description: + 'Number of times the user opened the editor flyout to add a field from within Lens.', + }, + }, + save_field_edit: { + type: 'long', + _meta: { + description: 'Number of times the user edited a field from within Lens.', + }, + }, + save_field_add: { + type: 'long', + _meta: { + description: 'Number of times the user added a field from within Lens.', + }, + }, + open_field_delete_modal: { + type: 'long', + _meta: { + description: 'Number of times the user opened the field delete modal from within Lens.', + }, + }, + delete_field: { + type: 'long', + _meta: { + description: 'Number of times the user deleted a field from within Lens.', + }, + }, + indexpattern_dimension_operation_terms: { + type: 'long', + _meta: { + description: 'Number of times the top values function was selected', + }, + }, + indexpattern_dimension_operation_date_histogram: { + type: 'long', + _meta: { + description: 'Number of times the date histogram function was selected', + }, + }, + indexpattern_dimension_operation_avg: { + type: 'long', + _meta: { + description: 'Number of times the average function was selected', + }, + }, + indexpattern_dimension_operation_min: { + type: 'long', + _meta: { + description: 'Number of times the min function was selected', + }, + }, + indexpattern_dimension_operation_max: { + type: 'long', + _meta: { + description: 'Number of times the max function was selected', + }, + }, + indexpattern_dimension_operation_sum: { + type: 'long', + _meta: { + description: 'Number of times the sum function was selected', + }, + }, + indexpattern_dimension_operation_count: { + type: 'long', + _meta: { + description: 'Number of times the count function was selected', + }, + }, + indexpattern_dimension_operation_cardinality: { + type: 'long', + _meta: { + description: 'Number of times the cardinality function was selected', + }, + }, + indexpattern_dimension_operation_filters: { + type: 'long', + _meta: { + description: 'Number of times the filters function was selected', + }, + }, + indexpattern_dimension_operation_range: { + type: 'long', + _meta: { description: 'Number of times the range function was selected' }, + }, + indexpattern_dimension_operation_median: { + type: 'long', + _meta: { description: 'Number of times the median function was selected' }, + }, + indexpattern_dimension_operation_percentile: { + type: 'long', + _meta: { description: 'Number of times the percentile function was selected' }, + }, + indexpattern_dimension_operation_last_value: { + type: 'long', + _meta: { description: 'Number of times the last value function was selected' }, + }, + indexpattern_dimension_operation_cumulative_sum: { + type: 'long', + _meta: { description: 'Number of times the cumulative sum function was selected' }, + }, + indexpattern_dimension_operation_counter_rate: { + type: 'long', + _meta: { description: 'Number of times the counter rate function was selected' }, + }, + indexpattern_dimension_operation_derivative: { + type: 'long', + _meta: { description: 'Number of times the derivative function was selected' }, + }, + indexpattern_dimension_operation_moving_average: { + type: 'long', + _meta: { description: 'Number of times the moving average function was selected' }, + }, }; const suggestionEventsSchema: MakeSchemaFrom = { diff --git a/x-pack/plugins/maps/public/embeddable/map_embeddable.tsx b/x-pack/plugins/maps/public/embeddable/map_embeddable.tsx index b7e50815fd1f71..d11e1d59b28f77 100644 --- a/x-pack/plugins/maps/public/embeddable/map_embeddable.tsx +++ b/x-pack/plugins/maps/public/embeddable/map_embeddable.tsx @@ -93,6 +93,7 @@ export class MapEmbeddable implements ReferenceOrValueEmbeddable { type = MAP_SAVED_OBJECT_TYPE; + private _isActive: boolean; private _savedMap: SavedMap; private _renderTooltipContent?: RenderToolTipContent; private _subscription: Subscription; @@ -118,6 +119,7 @@ export class MapEmbeddable parent ); + this._isActive = true; this._savedMap = new SavedMap({ mapEmbeddableInput: initialInput }); this._initializeSaveMap(); this._subscription = this.getUpdated$().subscribe(() => this.onUpdate()); @@ -404,6 +406,7 @@ export class MapEmbeddable destroy() { super.destroy(); + this._isActive = false; if (this._unsubscribeFromStore) { this._unsubscribeFromStore(); } @@ -424,6 +427,9 @@ export class MapEmbeddable } _handleStoreChanges() { + if (!this._isActive) { + return; + } const center = getMapCenter(this._savedMap.getStore().getState()); const zoom = getMapZoom(this._savedMap.getStore().getState()); diff --git a/x-pack/plugins/ml/public/application/explorer/anomaly_timeline.tsx b/x-pack/plugins/ml/public/application/explorer/anomaly_timeline.tsx index 4289986bb6a594..7c63d4087ce1e0 100644 --- a/x-pack/plugins/ml/public/application/explorer/anomaly_timeline.tsx +++ b/x-pack/plugins/ml/public/application/explorer/anomaly_timeline.tsx @@ -160,7 +160,11 @@ export const AnomalyTimeline: FC = React.memo( {selectedCells ? ( - + - + {seriesToUse.length > 0 && seriesToUse.map((series) => ( { ); expect(wrapper.html()).toBe( - '
' + '
' ); }); diff --git a/x-pack/plugins/ml/public/application/explorer/swimlane_container.tsx b/x-pack/plugins/ml/public/application/explorer/swimlane_container.tsx index 8deffa15cd6bd7..c108257094b6aa 100644 --- a/x-pack/plugins/ml/public/application/explorer/swimlane_container.tsx +++ b/x-pack/plugins/ml/public/application/explorer/swimlane_container.tsx @@ -26,6 +26,8 @@ import { HeatmapSpec, TooltipSettings, HeatmapBrushEvent, + Position, + ScaleType, } from '@elastic/charts'; import moment from 'moment'; @@ -44,6 +46,15 @@ import './_explorer.scss'; import { EMPTY_FIELD_VALUE_LABEL } from '../timeseriesexplorer/components/entity_control/entity_control'; import { useUiSettings } from '../contexts/kibana'; +declare global { + interface Window { + /** + * Flag used to enable debugState on elastic charts + */ + _echDebugStateFlag?: boolean; + } +} + /** * Ignore insignificant resize, e.g. browser scrollbar appearance. */ @@ -352,7 +363,7 @@ export const SwimlaneContainer: FC = ({ direction={'column'} style={{ width: '100%', height: '100%', overflow: 'hidden' }} ref={resizeRef} - data-test-subj="mlSwimLaneContainer" + data-test-subj={dataTestSubj} > = ({ }} grow={false} > -
+
{showSwimlane && !isLoading && ( = ({ valueAccessor="value" highlightedData={highlightedData} valueFormatter={getFormattedSeverityScore} - xScaleType="time" + xScaleType={ScaleType.Time} ySortPredicate="dataIndex" config={swimLaneConfig} /> diff --git a/x-pack/plugins/ml/public/application/explorer/swimlane_pagination.tsx b/x-pack/plugins/ml/public/application/explorer/swimlane_pagination.tsx index 8b205d2b8d5a17..18297d06dd6fe9 100644 --- a/x-pack/plugins/ml/public/application/explorer/swimlane_pagination.tsx +++ b/x-pack/plugins/ml/public/application/explorer/swimlane_pagination.tsx @@ -57,6 +57,7 @@ export const SwimLanePagination: FC = ({ closePopover(); setPerPage(v); }} + data-test-subj={`${v} rows`} > = ({ iconType="arrowDown" iconSide="right" onClick={onButtonClick} + data-test-subj="mlSwimLanePageSizeControl" > - + + + } isOpen={isPopoverOpen} closePopover={closePopover} panelPaddingSize="none" > - + @@ -102,6 +106,7 @@ export const SwimLanePagination: FC = ({ pageCount={pageCount} activePage={componentFromPage} onPageClick={goToPage} + data-test-subj="mlSwimLanePagination" /> diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/advanced_job_creator.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/advanced_job_creator.ts index da5cfc53b79505..2ca95a14fb8124 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/advanced_job_creator.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/advanced_job_creator.ts @@ -181,6 +181,7 @@ export class AdvancedJobCreator extends JobCreator { index: this._indexPatternTitle, timeFieldName: this.timeFieldName, query: this.query, + runtimeMappings: this.datafeedConfig.runtime_mappings, indicesOptions: this.datafeedConfig.indices_options, }); this.setTimeRange(start.epoch, end.epoch); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/util/filter_runtime_mappings.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/util/filter_runtime_mappings.ts index 5319cd3c3aabc9..bfed2d811e2062 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/util/filter_runtime_mappings.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/util/filter_runtime_mappings.ts @@ -13,6 +13,7 @@ import type { RuntimeMappings } from '../../../../../../../common/types/fields'; import type { Datafeed, Job } from '../../../../../../../common/types/anomaly_detection_jobs'; +import { isPopulatedObject } from '../../../../../../../common/util/object_utils'; interface Response { runtime_mappings: RuntimeMappings; @@ -20,7 +21,10 @@ interface Response { } export function filterRuntimeMappings(job: Job, datafeed: Datafeed): Response { - if (datafeed.runtime_mappings === undefined) { + if ( + datafeed.runtime_mappings === undefined || + isPopulatedObject(datafeed.runtime_mappings) === false + ) { return { runtime_mappings: {}, discarded_mappings: {}, @@ -71,13 +75,18 @@ function findFieldsInJob(job: Job, datafeed: Datafeed) { findFieldsInAgg(aggs).forEach((f) => usedFields.add(f)); } + const query = datafeed.query; + if (query !== undefined) { + findFieldsInQuery(query).forEach((f) => usedFields.add(f)); + } + return [...usedFields]; } -function findFieldsInAgg(obj: Record) { +function findFieldsInAgg(obj: Record) { const fields: string[] = []; Object.entries(obj).forEach(([key, val]) => { - if (typeof val === 'object' && val !== null) { + if (isPopulatedObject(val)) { fields.push(...findFieldsInAgg(val)); } else if (typeof val === 'string' && key === 'field') { fields.push(val); @@ -86,6 +95,22 @@ function findFieldsInAgg(obj: Record) { return fields; } +function findFieldsInQuery(obj: object) { + const fields: string[] = []; + Object.entries(obj).forEach(([key, val]) => { + // return all nested keys in the object + // most will not be fields, but better to catch everything + // and not accidentally remove a used runtime field. + if (isPopulatedObject(val)) { + fields.push(key); + fields.push(...findFieldsInQuery(val)); + } else { + fields.push(key); + } + }); + return fields; +} + function createMappings(rm: RuntimeMappings, usedFieldNames: string[]) { return { runtimeMappings: usedFieldNames.reduce((acc, cur) => { diff --git a/x-pack/plugins/ml/public/application/services/ml_api_service/index.ts b/x-pack/plugins/ml/public/application/services/ml_api_service/index.ts index e6d0d93cade1f0..4acb7fca09d0d3 100644 --- a/x-pack/plugins/ml/public/application/services/ml_api_service/index.ts +++ b/x-pack/plugins/ml/public/application/services/ml_api_service/index.ts @@ -25,6 +25,7 @@ import { import { MlCapabilitiesResponse } from '../../../../common/types/capabilities'; import { Calendar, CalendarId, UpdateCalendar } from '../../../../common/types/calendars'; import { BucketSpanEstimatorData } from '../../../../common/types/job_service'; +import { RuntimeMappings } from '../../../../common/types/fields'; import { Job, JobStats, @@ -690,14 +691,16 @@ export function mlApiServicesProvider(httpService: HttpService) { index, timeFieldName, query, + runtimeMappings, indicesOptions, }: { index: string; timeFieldName?: string; query: any; + runtimeMappings?: RuntimeMappings; indicesOptions?: IndicesOptions; }) { - const body = JSON.stringify({ index, timeFieldName, query, indicesOptions }); + const body = JSON.stringify({ index, timeFieldName, query, runtimeMappings, indicesOptions }); return httpService.http({ path: `${basePath()}/fields_service/time_field_range`, diff --git a/x-pack/plugins/ml/server/models/bucket_span_estimator/polled_data_checker.js b/x-pack/plugins/ml/server/models/bucket_span_estimator/polled_data_checker.js index 8a40787f444905..5fe783e1fc1d55 100644 --- a/x-pack/plugins/ml/server/models/bucket_span_estimator/polled_data_checker.js +++ b/x-pack/plugins/ml/server/models/bucket_span_estimator/polled_data_checker.js @@ -15,11 +15,12 @@ import { get } from 'lodash'; export function polledDataCheckerFactory({ asCurrentUser }) { class PolledDataChecker { - constructor(index, timeField, duration, query, indicesOptions) { + constructor(index, timeField, duration, query, runtimeMappings, indicesOptions) { this.index = index; this.timeField = timeField; this.duration = duration; this.query = query; + this.runtimeMappings = runtimeMappings; this.indicesOptions = indicesOptions; this.isPolled = false; @@ -62,6 +63,7 @@ export function polledDataCheckerFactory({ asCurrentUser }) { }, }, }, + ...this.runtimeMappings, }; return search; diff --git a/x-pack/plugins/ml/server/models/data_visualizer/data_visualizer.ts b/x-pack/plugins/ml/server/models/data_visualizer/data_visualizer.ts index 4db8295d939975..2a820e0629b757 100644 --- a/x-pack/plugins/ml/server/models/data_visualizer/data_visualizer.ts +++ b/x-pack/plugins/ml/server/models/data_visualizer/data_visualizer.ts @@ -625,15 +625,13 @@ export class DataVisualizer { cardinalityField = aggs[`${safeFieldName}_cardinality`] = { cardinality: { script: datafeedConfig?.script_fields[field].script }, }; - } else if (datafeedConfig?.runtime_mappings?.hasOwnProperty(field)) { - cardinalityField = { - cardinality: { field }, - }; - runtimeMappings.runtime_mappings = datafeedConfig.runtime_mappings; } else { cardinalityField = { cardinality: { field }, }; + if (datafeedConfig !== undefined && isPopulatedObject(datafeedConfig?.runtime_mappings)) { + runtimeMappings.runtime_mappings = datafeedConfig.runtime_mappings; + } } aggs[`${safeFieldName}_cardinality`] = cardinalityField; }); diff --git a/x-pack/plugins/ml/server/models/fields_service/fields_service.ts b/x-pack/plugins/ml/server/models/fields_service/fields_service.ts index 1270cc6f08e23f..8e4dbaf23212fe 100644 --- a/x-pack/plugins/ml/server/models/fields_service/fields_service.ts +++ b/x-pack/plugins/ml/server/models/fields_service/fields_service.ts @@ -14,6 +14,7 @@ import { AggCardinality } from '../../../common/types/fields'; import { isValidAggregationField } from '../../../common/util/validation_utils'; import { getDatafeedAggregations } from '../../../common/util/datafeed_utils'; import { Datafeed, IndicesOptions } from '../../../common/types/anomaly_detection_jobs'; +import { RuntimeMappings } from '../../../common/types/fields'; /** * Service for carrying out queries to obtain data @@ -212,6 +213,7 @@ export function fieldsServiceProvider({ asCurrentUser }: IScopedClusterClient) { index: string[] | string, timeFieldName: string, query: any, + runtimeMappings?: RuntimeMappings, indicesOptions?: IndicesOptions ): Promise<{ success: boolean; @@ -239,6 +241,7 @@ export function fieldsServiceProvider({ asCurrentUser }: IScopedClusterClient) { }, }, }, + ...(runtimeMappings !== undefined ? { runtime_mappings: runtimeMappings } : {}), }, ...(indicesOptions ?? {}), }); diff --git a/x-pack/plugins/ml/server/models/job_service/datafeeds.ts b/x-pack/plugins/ml/server/models/job_service/datafeeds.ts index cb651a0a410afd..cf9b2027225c9c 100644 --- a/x-pack/plugins/ml/server/models/job_service/datafeeds.ts +++ b/x-pack/plugins/ml/server/models/job_service/datafeeds.ts @@ -219,6 +219,7 @@ export function datafeedsProvider(client: IScopedClusterClient, mlClient: MlClie datafeed.indices, job.data_description.time_field, query, + datafeed.runtime_mappings, datafeed.indices_options ); diff --git a/x-pack/plugins/ml/server/models/job_validation/job_validation.ts b/x-pack/plugins/ml/server/models/job_validation/job_validation.ts index 31d98753f0bd1e..2beade7f5dbc46 100644 --- a/x-pack/plugins/ml/server/models/job_validation/job_validation.ts +++ b/x-pack/plugins/ml/server/models/job_validation/job_validation.ts @@ -64,7 +64,13 @@ export async function validateJob( const fs = fieldsServiceProvider(client); const index = job.datafeed_config.indices.join(','); const timeField = job.data_description.time_field; - const timeRange = await fs.getTimeFieldRange(index, timeField, job.datafeed_config.query); + const timeRange = await fs.getTimeFieldRange( + index, + timeField, + job.datafeed_config.query, + job.datafeed_config.runtime_mappings, + job.datafeed_config.indices_options + ); duration = { start: timeRange.start.epoch, diff --git a/x-pack/plugins/ml/server/routes/apidoc.json b/x-pack/plugins/ml/server/routes/apidoc.json index 1a10046380658a..ba61a987d69ef1 100644 --- a/x-pack/plugins/ml/server/routes/apidoc.json +++ b/x-pack/plugins/ml/server/routes/apidoc.json @@ -1,6 +1,6 @@ { "name": "ml_kibana_api", - "version": "7.11.0", + "version": "7.13.0", "description": "This is the documentation of the REST API provided by the Machine Learning Kibana plugin. Each API is experimental and can include breaking changes in any version.", "title": "ML Kibana API", "order": [ @@ -159,6 +159,9 @@ "GetTrainedModel", "GetTrainedModelStats", "GetTrainedModelPipelines", - "DeleteTrainedModel" + "DeleteTrainedModel", + + "Alerting", + "PreviewAlert" ] } diff --git a/x-pack/plugins/ml/server/routes/apidoc_scripts/version_filter.ts b/x-pack/plugins/ml/server/routes/apidoc_scripts/version_filter.ts index ad00915f28d6d1..430f105fb27d41 100644 --- a/x-pack/plugins/ml/server/routes/apidoc_scripts/version_filter.ts +++ b/x-pack/plugins/ml/server/routes/apidoc_scripts/version_filter.ts @@ -7,7 +7,7 @@ import { Block } from './types'; -const API_VERSION = '7.8.0'; +const API_VERSION = '7.13.0'; /** * Post Filter parsed results. diff --git a/x-pack/plugins/ml/server/routes/fields_service.ts b/x-pack/plugins/ml/server/routes/fields_service.ts index c087b86172fa97..dc43d915e87a2e 100644 --- a/x-pack/plugins/ml/server/routes/fields_service.ts +++ b/x-pack/plugins/ml/server/routes/fields_service.ts @@ -22,8 +22,8 @@ function getCardinalityOfFields(client: IScopedClusterClient, payload: any) { function getTimeFieldRange(client: IScopedClusterClient, payload: any) { const fs = fieldsServiceProvider(client); - const { index, timeFieldName, query, indicesOptions } = payload; - return fs.getTimeFieldRange(index, timeFieldName, query, indicesOptions); + const { index, timeFieldName, query, runtimeMappings, indicesOptions } = payload; + return fs.getTimeFieldRange(index, timeFieldName, query, runtimeMappings, indicesOptions); } /** diff --git a/x-pack/plugins/ml/server/routes/job_service.ts b/x-pack/plugins/ml/server/routes/job_service.ts index b3aa9f956895a2..1f755c27db8713 100644 --- a/x-pack/plugins/ml/server/routes/job_service.ts +++ b/x-pack/plugins/ml/server/routes/job_service.ts @@ -791,7 +791,7 @@ export function jobServiceRoutes({ router, routeGuard }: RouteInitialization) { body: datafeedPreviewSchema, }, options: { - tags: ['access:ml:canGetJobs'], + tags: ['access:ml:canPreviewDatafeed'], }, }, routeGuard.fullLicenseAPIGuard(async ({ client, mlClient, request, response }) => { diff --git a/x-pack/plugins/ml/server/routes/schemas/fields_service_schema.ts b/x-pack/plugins/ml/server/routes/schemas/fields_service_schema.ts index db827b26fe73a3..76a307e710dc83 100644 --- a/x-pack/plugins/ml/server/routes/schemas/fields_service_schema.ts +++ b/x-pack/plugins/ml/server/routes/schemas/fields_service_schema.ts @@ -31,5 +31,6 @@ export const getTimeFieldRangeSchema = schema.object({ /** Query to match documents in the index(es). */ query: schema.maybe(schema.any()), /** Additional search options. */ + runtimeMappings: schema.maybe(schema.any()), indicesOptions: indicesOptionsSchema, }); diff --git a/x-pack/plugins/observability/public/pages/home/index.test.tsx b/x-pack/plugins/observability/public/pages/home/index.test.tsx index 755757ea9dc879..a2c784cb4b2de9 100644 --- a/x-pack/plugins/observability/public/pages/home/index.test.tsx +++ b/x-pack/plugins/observability/public/pages/home/index.test.tsx @@ -14,7 +14,7 @@ import { HomePage } from './'; const mockHistoryPush = jest.fn(); jest.mock('react-router-dom', () => ({ useHistory: () => ({ - push: mockHistoryPush, + replace: mockHistoryPush, }), })); diff --git a/x-pack/plugins/observability/public/pages/home/index.tsx b/x-pack/plugins/observability/public/pages/home/index.tsx index e5d22fac918ad3..9e7fe99e3f7802 100644 --- a/x-pack/plugins/observability/public/pages/home/index.tsx +++ b/x-pack/plugins/observability/public/pages/home/index.tsx @@ -16,9 +16,9 @@ export function HomePage() { useEffect(() => { if (hasAnyData === true) { - history.push({ pathname: '/overview' }); + history.replace({ pathname: '/overview' }); } else if (hasAnyData === false && isAllRequestsComplete === true) { - history.push({ pathname: '/landing' }); + history.replace({ pathname: '/landing' }); } }, [hasAnyData, isAllRequestsComplete, history]); diff --git a/x-pack/plugins/security/server/authentication/authenticator.test.ts b/x-pack/plugins/security/server/authentication/authenticator.test.ts index e0b9144f6a66f8..be53caffc066de 100644 --- a/x-pack/plugins/security/server/authentication/authenticator.test.ts +++ b/x-pack/plugins/security/server/authentication/authenticator.test.ts @@ -585,8 +585,8 @@ describe('Authenticator', () => { expect(mockOptions.session.create).not.toHaveBeenCalled(); expect(mockOptions.session.update).not.toHaveBeenCalled(); expect(mockOptions.session.extend).not.toHaveBeenCalled(); - expect(mockOptions.session.clear).toHaveBeenCalledTimes(1); - expect(mockOptions.session.clear).toHaveBeenCalledWith(request); + expect(mockOptions.session.invalidate).toHaveBeenCalledTimes(1); + expect(mockOptions.session.invalidate).toHaveBeenCalledWith(request, { match: 'current' }); }); it('clears session if provider asked to do so in `succeeded` result.', async () => { @@ -605,8 +605,8 @@ describe('Authenticator', () => { expect(mockOptions.session.create).not.toHaveBeenCalled(); expect(mockOptions.session.update).not.toHaveBeenCalled(); expect(mockOptions.session.extend).not.toHaveBeenCalled(); - expect(mockOptions.session.clear).toHaveBeenCalledTimes(1); - expect(mockOptions.session.clear).toHaveBeenCalledWith(request); + expect(mockOptions.session.invalidate).toHaveBeenCalledTimes(1); + expect(mockOptions.session.invalidate).toHaveBeenCalledWith(request, { match: 'current' }); }); it('clears session if provider asked to do so in `redirected` result.', async () => { @@ -624,8 +624,8 @@ describe('Authenticator', () => { expect(mockOptions.session.create).not.toHaveBeenCalled(); expect(mockOptions.session.update).not.toHaveBeenCalled(); expect(mockOptions.session.extend).not.toHaveBeenCalled(); - expect(mockOptions.session.clear).toHaveBeenCalledTimes(1); - expect(mockOptions.session.clear).toHaveBeenCalledWith(request); + expect(mockOptions.session.invalidate).toHaveBeenCalledTimes(1); + expect(mockOptions.session.invalidate).toHaveBeenCalledWith(request, { match: 'current' }); }); describe('with Access Agreement', () => { @@ -1191,7 +1191,7 @@ describe('Authenticator', () => { expect(mockOptions.session.create).not.toHaveBeenCalled(); expect(mockOptions.session.update).not.toHaveBeenCalled(); expect(mockOptions.session.extend).not.toHaveBeenCalled(); - expect(mockOptions.session.clear).not.toHaveBeenCalled(); + expect(mockOptions.session.invalidate).not.toHaveBeenCalled(); }); it('extends session for non-system API calls.', async () => { @@ -1213,7 +1213,7 @@ describe('Authenticator', () => { expect(mockOptions.session.extend).toHaveBeenCalledWith(request, mockSessVal); expect(mockOptions.session.create).not.toHaveBeenCalled(); expect(mockOptions.session.update).not.toHaveBeenCalled(); - expect(mockOptions.session.clear).not.toHaveBeenCalled(); + expect(mockOptions.session.invalidate).not.toHaveBeenCalled(); }); it('does not touch session for system API calls if authentication fails with non-401 reason.', async () => { @@ -1234,7 +1234,7 @@ describe('Authenticator', () => { expect(mockOptions.session.create).not.toHaveBeenCalled(); expect(mockOptions.session.update).not.toHaveBeenCalled(); expect(mockOptions.session.extend).not.toHaveBeenCalled(); - expect(mockOptions.session.clear).not.toHaveBeenCalled(); + expect(mockOptions.session.invalidate).not.toHaveBeenCalled(); }); it('does not touch session for non-system API calls if authentication fails with non-401 reason.', async () => { @@ -1255,7 +1255,7 @@ describe('Authenticator', () => { expect(mockOptions.session.create).not.toHaveBeenCalled(); expect(mockOptions.session.update).not.toHaveBeenCalled(); expect(mockOptions.session.extend).not.toHaveBeenCalled(); - expect(mockOptions.session.clear).not.toHaveBeenCalled(); + expect(mockOptions.session.invalidate).not.toHaveBeenCalled(); }); it('replaces existing session with the one returned by authentication provider for system API requests', async () => { @@ -1281,7 +1281,7 @@ describe('Authenticator', () => { }); expect(mockOptions.session.create).not.toHaveBeenCalled(); expect(mockOptions.session.extend).not.toHaveBeenCalled(); - expect(mockOptions.session.clear).not.toHaveBeenCalled(); + expect(mockOptions.session.invalidate).not.toHaveBeenCalled(); }); it('replaces existing session with the one returned by authentication provider for non-system API requests', async () => { @@ -1307,7 +1307,7 @@ describe('Authenticator', () => { }); expect(mockOptions.session.create).not.toHaveBeenCalled(); expect(mockOptions.session.extend).not.toHaveBeenCalled(); - expect(mockOptions.session.clear).not.toHaveBeenCalled(); + expect(mockOptions.session.invalidate).not.toHaveBeenCalled(); }); it('clears session if provider failed to authenticate system API request with 401 with active session.', async () => { @@ -1324,8 +1324,8 @@ describe('Authenticator', () => { AuthenticationResult.failed(Boom.unauthorized()) ); - expect(mockOptions.session.clear).toHaveBeenCalledTimes(1); - expect(mockOptions.session.clear).toHaveBeenCalledWith(request); + expect(mockOptions.session.invalidate).toHaveBeenCalledTimes(1); + expect(mockOptions.session.invalidate).toHaveBeenCalledWith(request, { match: 'current' }); expect(mockOptions.session.create).not.toHaveBeenCalled(); expect(mockOptions.session.update).not.toHaveBeenCalled(); expect(mockOptions.session.extend).not.toHaveBeenCalled(); @@ -1345,8 +1345,8 @@ describe('Authenticator', () => { AuthenticationResult.failed(Boom.unauthorized()) ); - expect(mockOptions.session.clear).toHaveBeenCalledTimes(1); - expect(mockOptions.session.clear).toHaveBeenCalledWith(request); + expect(mockOptions.session.invalidate).toHaveBeenCalledTimes(1); + expect(mockOptions.session.invalidate).toHaveBeenCalledWith(request, { match: 'current' }); expect(mockOptions.session.create).not.toHaveBeenCalled(); expect(mockOptions.session.update).not.toHaveBeenCalled(); expect(mockOptions.session.extend).not.toHaveBeenCalled(); @@ -1364,8 +1364,8 @@ describe('Authenticator', () => { AuthenticationResult.redirectTo('some-url', { state: null }) ); - expect(mockOptions.session.clear).toHaveBeenCalledTimes(1); - expect(mockOptions.session.clear).toHaveBeenCalledWith(request); + expect(mockOptions.session.invalidate).toHaveBeenCalledTimes(1); + expect(mockOptions.session.invalidate).toHaveBeenCalledWith(request, { match: 'current' }); expect(mockOptions.session.create).not.toHaveBeenCalled(); expect(mockOptions.session.update).not.toHaveBeenCalled(); expect(mockOptions.session.extend).not.toHaveBeenCalled(); @@ -1382,7 +1382,7 @@ describe('Authenticator', () => { AuthenticationResult.notHandled() ); - expect(mockOptions.session.clear).not.toHaveBeenCalled(); + expect(mockOptions.session.invalidate).not.toHaveBeenCalled(); expect(mockOptions.session.create).not.toHaveBeenCalled(); expect(mockOptions.session.update).not.toHaveBeenCalled(); expect(mockOptions.session.extend).not.toHaveBeenCalled(); @@ -1399,7 +1399,7 @@ describe('Authenticator', () => { AuthenticationResult.notHandled() ); - expect(mockOptions.session.clear).not.toHaveBeenCalled(); + expect(mockOptions.session.invalidate).not.toHaveBeenCalled(); expect(mockOptions.session.create).not.toHaveBeenCalled(); expect(mockOptions.session.update).not.toHaveBeenCalled(); expect(mockOptions.session.extend).not.toHaveBeenCalled(); @@ -1789,7 +1789,7 @@ describe('Authenticator', () => { DeauthenticationResult.notHandled() ); - expect(mockOptions.session.clear).not.toHaveBeenCalled(); + expect(mockOptions.session.invalidate).not.toHaveBeenCalled(); }); it('clears session and returns whatever authentication provider returns.', async () => { @@ -1804,7 +1804,7 @@ describe('Authenticator', () => { ); expect(mockBasicAuthenticationProvider.logout).toHaveBeenCalledTimes(1); - expect(mockOptions.session.clear).toHaveBeenCalled(); + expect(mockOptions.session.invalidate).toHaveBeenCalled(); }); it('if session does not exist but provider name is valid, returns whatever authentication provider returns.', async () => { @@ -1823,7 +1823,7 @@ describe('Authenticator', () => { expect(mockBasicAuthenticationProvider.logout).toHaveBeenCalledTimes(1); expect(mockBasicAuthenticationProvider.logout).toHaveBeenCalledWith(request, null); - expect(mockOptions.session.clear).toHaveBeenCalled(); + expect(mockOptions.session.invalidate).toHaveBeenCalled(); }); it('if session does not exist and provider name is not available, returns whatever authentication provider returns.', async () => { @@ -1840,7 +1840,7 @@ describe('Authenticator', () => { expect(mockBasicAuthenticationProvider.logout).toHaveBeenCalledTimes(1); expect(mockBasicAuthenticationProvider.logout).toHaveBeenCalledWith(request); - expect(mockOptions.session.clear).not.toHaveBeenCalled(); + expect(mockOptions.session.invalidate).not.toHaveBeenCalled(); }); it('returns `notHandled` if session does not exist and provider name is invalid', async () => { @@ -1852,7 +1852,7 @@ describe('Authenticator', () => { ); expect(mockBasicAuthenticationProvider.logout).not.toHaveBeenCalled(); - expect(mockOptions.session.clear).toHaveBeenCalled(); + expect(mockOptions.session.invalidate).toHaveBeenCalled(); }); }); diff --git a/x-pack/plugins/security/server/authentication/authenticator.ts b/x-pack/plugins/security/server/authentication/authenticator.ts index ff6f3ff0c2ae73..f86ff54963da9a 100644 --- a/x-pack/plugins/security/server/authentication/authenticator.ts +++ b/x-pack/plugins/security/server/authentication/authenticator.ts @@ -396,7 +396,7 @@ export class Authenticator { sessionValue?.provider.name ?? request.url.searchParams.get(LOGOUT_PROVIDER_QUERY_STRING_PARAMETER); if (suggestedProviderName) { - await this.session.clear(request); + await this.invalidateSessionValue(request); // Provider name may be passed in a query param and sourced from the browser's local storage; // hence, we can't assume that this provider exists, so we have to check it. @@ -522,7 +522,7 @@ export class Authenticator { this.logger.warn( `Attempted to retrieve session for the "${existingSessionValue.provider.type}/${existingSessionValue.provider.name}" provider, but it is not configured.` ); - await this.session.clear(request); + await this.invalidateSessionValue(request); return null; } @@ -556,7 +556,7 @@ export class Authenticator { // attempt didn't fail. if (authenticationResult.shouldClearState()) { this.logger.debug('Authentication provider requested to invalidate existing session.'); - await this.session.clear(request); + await this.invalidateSessionValue(request); return null; } @@ -570,7 +570,7 @@ export class Authenticator { if (authenticationResult.failed()) { if (ownsSession && getErrorStatusCode(authenticationResult.error) === 401) { this.logger.debug('Authentication attempt failed, existing session will be invalidated.'); - await this.session.clear(request); + await this.invalidateSessionValue(request); } return null; } @@ -608,17 +608,17 @@ export class Authenticator { this.logger.debug( 'Authentication provider has changed, existing session will be invalidated.' ); - await this.session.clear(request); + await this.invalidateSessionValue(request); existingSessionValue = null; } else if (sessionHasBeenAuthenticated) { this.logger.debug( 'Session is authenticated, existing unauthenticated session will be invalidated.' ); - await this.session.clear(request); + await this.invalidateSessionValue(request); existingSessionValue = null; } else if (usernameHasChanged) { this.logger.debug('Username has changed, existing session will be invalidated.'); - await this.session.clear(request); + await this.invalidateSessionValue(request); existingSessionValue = null; } @@ -651,6 +651,14 @@ export class Authenticator { }; } + /** + * Invalidates session value associated with the specified request. + * @param request Request instance. + */ + private async invalidateSessionValue(request: KibanaRequest) { + await this.session.invalidate(request, { match: 'current' }); + } + /** * Checks whether request should be redirected to the Login Selector UI. * @param request Request instance. diff --git a/x-pack/plugins/security/server/routes/session_management/index.ts b/x-pack/plugins/security/server/routes/session_management/index.ts index 1348179386ce08..16cda7b7b409df 100644 --- a/x-pack/plugins/security/server/routes/session_management/index.ts +++ b/x-pack/plugins/security/server/routes/session_management/index.ts @@ -8,8 +8,10 @@ import type { RouteDefinitionParams } from '../'; import { defineSessionExtendRoutes } from './extend'; import { defineSessionInfoRoutes } from './info'; +import { defineInvalidateSessionsRoutes } from './invalidate'; export function defineSessionManagementRoutes(params: RouteDefinitionParams) { defineSessionInfoRoutes(params); defineSessionExtendRoutes(params); + defineInvalidateSessionsRoutes(params); } diff --git a/x-pack/plugins/security/server/routes/session_management/invalidate.test.ts b/x-pack/plugins/security/server/routes/session_management/invalidate.test.ts new file mode 100644 index 00000000000000..215a66a3364e51 --- /dev/null +++ b/x-pack/plugins/security/server/routes/session_management/invalidate.test.ts @@ -0,0 +1,155 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { ObjectType } from '@kbn/config-schema'; +import type { PublicMethodsOf } from '@kbn/utility-types'; + +import type { RequestHandler, RouteConfig } from '../../../../../../src/core/server'; +import { kibanaResponseFactory } from '../../../../../../src/core/server'; +import { httpServerMock } from '../../../../../../src/core/server/mocks'; +import type { Session } from '../../session_management'; +import { sessionMock } from '../../session_management/session.mock'; +import type { SecurityRequestHandlerContext, SecurityRouter } from '../../types'; +import { routeDefinitionParamsMock } from '../index.mock'; +import { defineInvalidateSessionsRoutes } from './invalidate'; + +describe('Invalidate sessions routes', () => { + let router: jest.Mocked; + let session: jest.Mocked>; + beforeEach(() => { + const routeParamsMock = routeDefinitionParamsMock.create(); + router = routeParamsMock.router; + + session = sessionMock.create(); + routeParamsMock.getSession.mockReturnValue(session); + + defineInvalidateSessionsRoutes(routeParamsMock); + }); + + describe('invalidate sessions', () => { + let routeHandler: RequestHandler; + let routeConfig: RouteConfig; + beforeEach(() => { + const [extendRouteConfig, extendRouteHandler] = router.post.mock.calls.find( + ([{ path }]) => path === '/api/security/session/_invalidate' + )!; + + routeConfig = extendRouteConfig; + routeHandler = extendRouteHandler; + }); + + it('correctly defines route.', () => { + expect(routeConfig.options).toEqual({ tags: ['access:sessionManagement'] }); + + const bodySchema = (routeConfig.validate as any).body as ObjectType; + expect(() => bodySchema.validate({})).toThrowErrorMatchingInlineSnapshot( + `"[match]: expected at least one defined value but got [undefined]"` + ); + expect(() => bodySchema.validate({ match: 'current' })).toThrowErrorMatchingInlineSnapshot(` + "[match]: types that failed validation: + - [match.0]: expected value to equal [all] + - [match.1]: expected value to equal [query]" + `); + expect(() => + bodySchema.validate({ match: 'all', query: { provider: { type: 'basic' } } }) + ).toThrowErrorMatchingInlineSnapshot(`"[query]: a value wasn't expected to be present"`); + expect(() => bodySchema.validate({ match: 'query' })).toThrowErrorMatchingInlineSnapshot( + `"[query.provider.type]: expected value of type [string] but got [undefined]"` + ); + expect(() => + bodySchema.validate({ match: 'query', query: { username: 'user' } }) + ).toThrowErrorMatchingInlineSnapshot( + `"[query.provider.type]: expected value of type [string] but got [undefined]"` + ); + expect(() => + bodySchema.validate({ + match: 'query', + query: { provider: { name: 'basic1' }, username: 'user' }, + }) + ).toThrowErrorMatchingInlineSnapshot( + `"[query.provider.type]: expected value of type [string] but got [undefined]"` + ); + + expect(bodySchema.validate({ match: 'all' })).toEqual({ match: 'all' }); + expect( + bodySchema.validate({ match: 'query', query: { provider: { type: 'basic' } } }) + ).toEqual({ + match: 'query', + query: { provider: { type: 'basic' } }, + }); + expect( + bodySchema.validate({ + match: 'query', + query: { provider: { type: 'basic', name: 'basic1' } }, + }) + ).toEqual({ match: 'query', query: { provider: { type: 'basic', name: 'basic1' } } }); + expect( + bodySchema.validate({ + match: 'query', + query: { provider: { type: 'basic' }, username: 'user' }, + }) + ).toEqual({ match: 'query', query: { provider: { type: 'basic' }, username: 'user' } }); + expect( + bodySchema.validate({ + match: 'query', + query: { provider: { type: 'basic', name: 'basic1' }, username: 'user' }, + }) + ).toEqual({ + match: 'query', + query: { provider: { type: 'basic', name: 'basic1' }, username: 'user' }, + }); + }); + + it('properly constructs `query` match filter.', async () => { + session.invalidate.mockResolvedValue(30); + + const mockRequest = httpServerMock.createKibanaRequest({ + body: { + match: 'query', + query: { provider: { type: 'basic', name: 'basic1' }, username: 'user' }, + }, + }); + await expect( + routeHandler( + ({} as unknown) as SecurityRequestHandlerContext, + mockRequest, + kibanaResponseFactory + ) + ).resolves.toEqual({ + status: 200, + options: { body: { total: 30 } }, + payload: { total: 30 }, + }); + + expect(session.invalidate).toHaveBeenCalledTimes(1); + expect(session.invalidate).toHaveBeenCalledWith(mockRequest, { + match: 'query', + query: { provider: { type: 'basic', name: 'basic1' }, username: 'user' }, + }); + }); + + it('properly constructs `all` match filter.', async () => { + session.invalidate.mockResolvedValue(30); + + const mockRequest = httpServerMock.createKibanaRequest({ body: { match: 'all' } }); + await expect( + routeHandler( + ({} as unknown) as SecurityRequestHandlerContext, + mockRequest, + kibanaResponseFactory + ) + ).resolves.toEqual({ + status: 200, + options: { body: { total: 30 } }, + payload: { total: 30 }, + }); + + expect(session.invalidate).toHaveBeenCalledTimes(1); + expect(session.invalidate).toHaveBeenCalledWith(mockRequest, { match: 'all' }); + }); + }); +}); diff --git a/x-pack/plugins/security/server/routes/session_management/invalidate.ts b/x-pack/plugins/security/server/routes/session_management/invalidate.ts new file mode 100644 index 00000000000000..3416be3dd29657 --- /dev/null +++ b/x-pack/plugins/security/server/routes/session_management/invalidate.ts @@ -0,0 +1,49 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { schema } from '@kbn/config-schema'; + +import type { RouteDefinitionParams } from '..'; + +/** + * Defines routes required for session invalidation. + */ +export function defineInvalidateSessionsRoutes({ router, getSession }: RouteDefinitionParams) { + router.post( + { + path: '/api/security/session/_invalidate', + validate: { + body: schema.object({ + match: schema.oneOf([schema.literal('all'), schema.literal('query')]), + query: schema.conditional( + schema.siblingRef('match'), + schema.literal('query'), + schema.object({ + provider: schema.object({ + type: schema.string(), + name: schema.maybe(schema.string()), + }), + username: schema.maybe(schema.string()), + }), + schema.never() + ), + }), + }, + options: { tags: ['access:sessionManagement'] }, + }, + async (_context, request, response) => { + return response.ok({ + body: { + total: await getSession().invalidate(request, { + match: request.body.match, + query: request.body.query, + }), + }, + }); + } + ); +} diff --git a/x-pack/plugins/security/server/session_management/session.mock.ts b/x-pack/plugins/security/server/session_management/session.mock.ts index dfe1293f57e927..65ae43e5fa705b 100644 --- a/x-pack/plugins/security/server/session_management/session.mock.ts +++ b/x-pack/plugins/security/server/session_management/session.mock.ts @@ -18,7 +18,7 @@ export const sessionMock = { create: jest.fn(), update: jest.fn(), extend: jest.fn(), - clear: jest.fn(), + invalidate: jest.fn(), }), createValue: (sessionValue: Partial = {}): SessionValue => ({ diff --git a/x-pack/plugins/security/server/session_management/session.test.ts b/x-pack/plugins/security/server/session_management/session.test.ts index bd94c9483d5612..dfe6ba343ca3c0 100644 --- a/x-pack/plugins/security/server/session_management/session.test.ts +++ b/x-pack/plugins/security/server/session_management/session.test.ts @@ -103,7 +103,7 @@ describe('Session', () => { await expect(session.get(httpServerMock.createKibanaRequest())).resolves.toBeNull(); expect(mockSessionCookie.clear).toHaveBeenCalledTimes(1); - expect(mockSessionIndex.clear).toHaveBeenCalledTimes(1); + expect(mockSessionIndex.invalidate).toHaveBeenCalledTimes(1); }); it('clears session value if session is expired because of lifespan', async () => { @@ -122,7 +122,7 @@ describe('Session', () => { await expect(session.get(httpServerMock.createKibanaRequest())).resolves.toBeNull(); expect(mockSessionCookie.clear).toHaveBeenCalledTimes(1); - expect(mockSessionIndex.clear).toHaveBeenCalledTimes(1); + expect(mockSessionIndex.invalidate).toHaveBeenCalledTimes(1); }); it('clears session value if session cookie does not have corresponding session index value', async () => { @@ -151,7 +151,7 @@ describe('Session', () => { await expect(session.get(httpServerMock.createKibanaRequest())).resolves.toBeNull(); expect(mockSessionCookie.clear).toHaveBeenCalledTimes(1); - expect(mockSessionIndex.clear).toHaveBeenCalledTimes(1); + expect(mockSessionIndex.invalidate).toHaveBeenCalledTimes(1); }); it('clears session value if session index value content cannot be decrypted because of wrong AAD', async () => { @@ -170,7 +170,7 @@ describe('Session', () => { await expect(session.get(httpServerMock.createKibanaRequest())).resolves.toBeNull(); expect(mockSessionCookie.clear).toHaveBeenCalledTimes(1); - expect(mockSessionIndex.clear).toHaveBeenCalledTimes(1); + expect(mockSessionIndex.invalidate).toHaveBeenCalledTimes(1); }); it('returns session value with decrypted content', async () => { @@ -199,7 +199,7 @@ describe('Session', () => { username: 'some-user', }); expect(mockSessionCookie.clear).not.toHaveBeenCalled(); - expect(mockSessionIndex.clear).not.toHaveBeenCalled(); + expect(mockSessionIndex.invalidate).not.toHaveBeenCalled(); }); }); @@ -279,7 +279,7 @@ describe('Session', () => { const mockRequest = httpServerMock.createKibanaRequest(); await expect(session.update(mockRequest, sessionMock.createValue())).resolves.toBeNull(); - expect(mockSessionIndex.clear).not.toHaveBeenCalled(); + expect(mockSessionIndex.invalidate).not.toHaveBeenCalled(); expect(mockSessionCookie.clear).toHaveBeenCalledTimes(1); expect(mockSessionCookie.clear).toHaveBeenCalledWith(mockRequest); }); @@ -432,7 +432,7 @@ describe('Session', () => { }) ); - expect(mockSessionIndex.clear).not.toHaveBeenCalled(); + expect(mockSessionIndex.invalidate).not.toHaveBeenCalled(); expect(mockSessionCookie.clear).not.toHaveBeenCalled(); } @@ -485,7 +485,7 @@ describe('Session', () => { ); expect(mockSessionIndex.update).not.toHaveBeenCalled(); expect(mockSessionCookie.set).not.toHaveBeenCalled(); - expect(mockSessionIndex.clear).not.toHaveBeenCalled(); + expect(mockSessionIndex.invalidate).not.toHaveBeenCalled(); expect(mockSessionCookie.clear).not.toHaveBeenCalled(); }); @@ -563,7 +563,7 @@ describe('Session', () => { mockRequest, expect.objectContaining({ idleTimeoutExpiration: expectedNewExpiration }) ); - expect(mockSessionIndex.clear).not.toHaveBeenCalled(); + expect(mockSessionIndex.invalidate).not.toHaveBeenCalled(); expect(mockSessionCookie.clear).not.toHaveBeenCalled(); }); @@ -582,7 +582,7 @@ describe('Session', () => { ) ).resolves.toBeNull(); - expect(mockSessionIndex.clear).not.toHaveBeenCalled(); + expect(mockSessionIndex.invalidate).not.toHaveBeenCalled(); expect(mockSessionCookie.clear).toHaveBeenCalledTimes(1); expect(mockSessionCookie.clear).toHaveBeenCalledWith(mockRequest); }); @@ -625,7 +625,7 @@ describe('Session', () => { mockRequest, expect.objectContaining({ idleTimeoutExpiration: expectedNewExpiration }) ); - expect(mockSessionIndex.clear).not.toHaveBeenCalled(); + expect(mockSessionIndex.invalidate).not.toHaveBeenCalled(); expect(mockSessionCookie.clear).not.toHaveBeenCalled(); }); @@ -653,7 +653,7 @@ describe('Session', () => { mockRequest, expect.objectContaining({ idleTimeoutExpiration: expectedNewExpiration }) ); - expect(mockSessionIndex.clear).not.toHaveBeenCalled(); + expect(mockSessionIndex.invalidate).not.toHaveBeenCalled(); expect(mockSessionCookie.clear).not.toHaveBeenCalled(); }); @@ -696,7 +696,7 @@ describe('Session', () => { mockRequest, expect.objectContaining({ idleTimeoutExpiration: expectedNewExpiration }) ); - expect(mockSessionIndex.clear).not.toHaveBeenCalled(); + expect(mockSessionIndex.invalidate).not.toHaveBeenCalled(); expect(mockSessionCookie.clear).not.toHaveBeenCalled(); }); }); @@ -764,7 +764,7 @@ describe('Session', () => { ); } - expect(mockSessionIndex.clear).not.toHaveBeenCalled(); + expect(mockSessionIndex.invalidate).not.toHaveBeenCalled(); expect(mockSessionCookie.clear).not.toHaveBeenCalled(); } @@ -786,27 +786,98 @@ describe('Session', () => { }); }); - describe('#clear', () => { - it('does not clear anything if session does not exist', async () => { + describe('#invalidate', () => { + beforeEach(() => { + mockSessionCookie.get.mockResolvedValue(sessionCookieMock.createValue()); + mockSessionIndex.invalidate.mockResolvedValue(10); + }); + + it('[match=current] does not clear anything if session does not exist', async () => { mockSessionCookie.get.mockResolvedValue(null); - await session.clear(httpServerMock.createKibanaRequest()); + await session.invalidate(httpServerMock.createKibanaRequest(), { match: 'current' }); - expect(mockSessionIndex.clear).not.toHaveBeenCalled(); + expect(mockSessionIndex.invalidate).not.toHaveBeenCalled(); expect(mockSessionCookie.clear).not.toHaveBeenCalled(); }); - it('clears both session cookie and session index', async () => { + it('[match=current] clears both session cookie and session index', async () => { mockSessionCookie.get.mockResolvedValue(sessionCookieMock.createValue()); const mockRequest = httpServerMock.createKibanaRequest(); - await session.clear(mockRequest); + await session.invalidate(mockRequest, { match: 'current' }); - expect(mockSessionIndex.clear).toHaveBeenCalledTimes(1); - expect(mockSessionIndex.clear).toHaveBeenCalledWith('some-long-sid'); + expect(mockSessionIndex.invalidate).toHaveBeenCalledTimes(1); + expect(mockSessionIndex.invalidate).toHaveBeenCalledWith({ + match: 'sid', + sid: 'some-long-sid', + }); expect(mockSessionCookie.clear).toHaveBeenCalledTimes(1); expect(mockSessionCookie.clear).toHaveBeenCalledWith(mockRequest); }); + + it('[match=all] clears all sessions even if current initiator request does not have a session', async () => { + mockSessionCookie.get.mockResolvedValue(null); + + await expect( + session.invalidate(httpServerMock.createKibanaRequest(), { match: 'all' }) + ).resolves.toBe(10); + + expect(mockSessionCookie.clear).not.toHaveBeenCalled(); + expect(mockSessionIndex.invalidate).toHaveBeenCalledTimes(1); + expect(mockSessionIndex.invalidate).toHaveBeenCalledWith({ match: 'all' }); + }); + + it('[match=query] properly forwards filter with the provider type to the session index', async () => { + await expect( + session.invalidate(httpServerMock.createKibanaRequest(), { + match: 'query', + query: { provider: { type: 'basic' } }, + }) + ).resolves.toBe(10); + + expect(mockSessionCookie.clear).not.toHaveBeenCalled(); + expect(mockSessionIndex.invalidate).toHaveBeenCalledTimes(1); + expect(mockSessionIndex.invalidate).toHaveBeenCalledWith({ + match: 'query', + query: { provider: { type: 'basic' } }, + }); + }); + + it('[match=query] properly forwards filter with the provider type and provider name to the session index', async () => { + await expect( + session.invalidate(httpServerMock.createKibanaRequest(), { + match: 'query', + query: { provider: { type: 'basic', name: 'basic1' } }, + }) + ).resolves.toBe(10); + + expect(mockSessionCookie.clear).not.toHaveBeenCalled(); + expect(mockSessionIndex.invalidate).toHaveBeenCalledTimes(1); + expect(mockSessionIndex.invalidate).toHaveBeenCalledWith({ + match: 'query', + query: { provider: { type: 'basic', name: 'basic1' } }, + }); + }); + + it('[match=query] properly forwards filter with the provider type, provider name, and username hash to the session index', async () => { + await expect( + session.invalidate(httpServerMock.createKibanaRequest(), { + match: 'query', + query: { provider: { type: 'basic', name: 'basic1' }, username: 'elastic' }, + }) + ).resolves.toBe(10); + + expect(mockSessionCookie.clear).not.toHaveBeenCalled(); + expect(mockSessionIndex.invalidate).toHaveBeenCalledTimes(1); + expect(mockSessionIndex.invalidate).toHaveBeenCalledWith({ + match: 'query', + query: { + provider: { type: 'basic', name: 'basic1' }, + usernameHash: 'eb28536c8ead72bf81a0a9226e38fc9bad81f5e07c2081bb801b2a5c8842924e', + }, + }); + }); }); }); diff --git a/x-pack/plugins/security/server/session_management/session.ts b/x-pack/plugins/security/server/session_management/session.ts index 7fada4d1730cd0..8d2b56b4d2b7a4 100644 --- a/x-pack/plugins/security/server/session_management/session.ts +++ b/x-pack/plugins/security/server/session_management/session.ts @@ -79,6 +79,18 @@ export interface SessionValueContentToEncrypt { state: unknown; } +/** + * Filter provided for the `Session.invalidate` method that determines which session values should + * be invalidated. It can have three possible types: + * - `all` means that all existing active and inactive sessions should be invalidated. + * - `current` means that session associated with the current request should be invalidated. + * - `query` means that only sessions that match specified query should be invalidated. + */ +export type InvalidateSessionsFilter = + | { match: 'all' } + | { match: 'current' } + | { match: 'query'; query: { provider: { type: string; name?: string }; username?: string } }; + /** * The SIDs and AAD must be unpredictable to prevent guessing attacks, where an attacker is able to * guess or predict the ID of a valid session through statistical analysis techniques. That's why we @@ -133,7 +145,7 @@ export class Session { (sessionCookieValue.lifespanExpiration && sessionCookieValue.lifespanExpiration < now) ) { sessionLogger.debug('Session has expired and will be invalidated.'); - await this.clear(request); + await this.invalidate(request, { match: 'current' }); return null; } @@ -155,7 +167,7 @@ export class Session { sessionLogger.warn( `Unable to decrypt session content, session will be invalidated: ${err.message}` ); - await this.clear(request); + await this.invalidate(request, { match: 'current' }); return null; } @@ -194,7 +206,7 @@ export class Session { ...publicSessionValue, ...sessionExpirationInfo, sid, - usernameHash: username && createHash('sha3-256').update(username).digest('hex'), + usernameHash: username && Session.getUsernameHash(username), content: await this.crypto.encrypt(JSON.stringify({ username, state }), aad), }); @@ -230,7 +242,7 @@ export class Session { ...sessionValue.metadata.index, ...publicSessionInfo, ...sessionExpirationInfo, - usernameHash: username && createHash('sha3-256').update(username).digest('hex'), + usernameHash: username && Session.getUsernameHash(username), content: await this.crypto.encrypt( JSON.stringify({ username, state }), sessionCookieValue.aad @@ -358,24 +370,53 @@ export class Session { } /** - * Clears session value for the specified request. - * @param request Request instance to clear session value for. + * Invalidates sessions that match the specified filter. + * @param request Request instance initiated invalidation. + * @param filter Filter that narrows down the list of the sessions that should be invalidated. */ - async clear(request: KibanaRequest) { + async invalidate(request: KibanaRequest, filter: InvalidateSessionsFilter) { + // We don't require request to have the associated session, but nevertheless we still want to + // log the SID if session is available. const sessionCookieValue = await this.options.sessionCookie.get(request); - if (!sessionCookieValue) { - return; - } - - const sessionLogger = this.getLoggerForSID(sessionCookieValue.sid); - sessionLogger.debug('Invalidating session.'); + const sessionLogger = this.getLoggerForSID(sessionCookieValue?.sid); + + // We clear session cookie only when the current session should be invalidated since it's the + // only case when this action is explicitly and unequivocally requested. This behavior doesn't + // introduce any risk since even if the current session has been affected the session cookie + // will be automatically invalidated as soon as client attempts to re-use it due to missing + // underlying session index value. + let invalidateIndexValueFilter; + if (filter.match === 'current') { + if (!sessionCookieValue) { + return; + } - await Promise.all([ - this.options.sessionCookie.clear(request), - this.options.sessionIndex.clear(sessionCookieValue.sid), - ]); + sessionLogger.debug('Invalidating current session.'); + await this.options.sessionCookie.clear(request); + invalidateIndexValueFilter = { match: 'sid' as 'sid', sid: sessionCookieValue.sid }; + } else if (filter.match === 'all') { + sessionLogger.debug('Invalidating all sessions.'); + invalidateIndexValueFilter = filter; + } else { + sessionLogger.debug( + `Invalidating sessions that match query: ${JSON.stringify( + filter.query.username ? { ...filter.query, username: '[REDACTED]' } : filter.query + )}.` + ); + invalidateIndexValueFilter = filter.query.username + ? { + ...filter, + query: { + provider: filter.query.provider, + usernameHash: Session.getUsernameHash(filter.query.username), + }, + } + : filter; + } - sessionLogger.debug('Successfully invalidated session.'); + const invalidatedCount = await this.options.sessionIndex.invalidate(invalidateIndexValueFilter); + sessionLogger.debug(`Successfully invalidated ${invalidatedCount} session(s).`); + return invalidatedCount; } private calculateExpiry( @@ -414,9 +455,19 @@ export class Session { /** * Creates logger scoped to a specified session ID. - * @param sid Session ID to create logger for. + * @param [sid] Session ID to create logger for. + */ + private getLoggerForSID(sid?: string) { + return this.options.logger.get(sid?.slice(-10) ?? 'no_session'); + } + + /** + * Generates a sha3-256 hash for the specified `username`. The hash is intended to be stored in + * the session index to allow querying user specific sessions and don't expose the original + * `username` at the same time. + * @param username Username string to generate hash for. */ - private getLoggerForSID(sid: string) { - return this.options.logger.get(sid?.slice(-10)); + private static getUsernameHash(username: string) { + return createHash('sha3-256').update(username).digest('hex'); } } diff --git a/x-pack/plugins/security/server/session_management/session_index.mock.ts b/x-pack/plugins/security/server/session_management/session_index.mock.ts index 56049a3ae92055..9498b60d916a29 100644 --- a/x-pack/plugins/security/server/session_management/session_index.mock.ts +++ b/x-pack/plugins/security/server/session_management/session_index.mock.ts @@ -14,7 +14,7 @@ export const sessionIndexMock = { get: jest.fn(), create: jest.fn(), update: jest.fn(), - clear: jest.fn(), + invalidate: jest.fn(), initialize: jest.fn(), cleanUp: jest.fn(), }), diff --git a/x-pack/plugins/security/server/session_management/session_index.test.ts b/x-pack/plugins/security/server/session_management/session_index.test.ts index 2b3ec0adeb51ea..b5b4f644389020 100644 --- a/x-pack/plugins/security/server/session_management/session_index.test.ts +++ b/x-pack/plugins/security/server/session_management/session_index.test.ts @@ -162,7 +162,7 @@ describe('Session index', () => { }); }); - describe('cleanUp', () => { + describe('#cleanUp', () => { const now = 123456; beforeEach(() => { mockElasticsearchClient.deleteByQuery.mockResolvedValue( @@ -797,18 +797,26 @@ describe('Session index', () => { }); }); - describe('#clear', () => { - it('throws if call to Elasticsearch fails', async () => { + describe('#invalidate', () => { + beforeEach(() => { + mockElasticsearchClient.deleteByQuery.mockResolvedValue( + securityMock.createApiResponse({ body: { deleted: 10 } }) + ); + }); + + it('[match=sid] throws if call to Elasticsearch fails', async () => { const failureReason = new errors.ResponseError( securityMock.createApiResponse(securityMock.createApiResponse({ body: { type: 'Uh oh.' } })) ); mockElasticsearchClient.delete.mockRejectedValue(failureReason); - await expect(sessionIndex.clear('some-long-sid')).rejects.toBe(failureReason); + await expect(sessionIndex.invalidate({ match: 'sid', sid: 'some-long-sid' })).rejects.toBe( + failureReason + ); }); - it('properly removes session value from the index', async () => { - await sessionIndex.clear('some-long-sid'); + it('[match=sid] properly removes session value from the index', async () => { + await sessionIndex.invalidate({ match: 'sid', sid: 'some-long-sid' }); expect(mockElasticsearchClient.delete).toHaveBeenCalledTimes(1); expect(mockElasticsearchClient.delete).toHaveBeenCalledWith( @@ -816,5 +824,125 @@ describe('Session index', () => { { ignore: [404] } ); }); + + it('[match=all] throws if call to Elasticsearch fails', async () => { + const failureReason = new errors.ResponseError( + securityMock.createApiResponse(securityMock.createApiResponse({ body: { type: 'Uh oh.' } })) + ); + mockElasticsearchClient.deleteByQuery.mockRejectedValue(failureReason); + + await expect(sessionIndex.invalidate({ match: 'all' })).rejects.toBe(failureReason); + }); + + it('[match=all] properly constructs query', async () => { + await expect(sessionIndex.invalidate({ match: 'all' })).resolves.toBe(10); + + expect(mockElasticsearchClient.deleteByQuery).toHaveBeenCalledTimes(1); + expect(mockElasticsearchClient.deleteByQuery).toHaveBeenCalledWith({ + index: indexName, + refresh: true, + body: { query: { match_all: {} } }, + }); + }); + + it('[match=query] throws if call to Elasticsearch fails', async () => { + const failureReason = new errors.ResponseError( + securityMock.createApiResponse(securityMock.createApiResponse({ body: { type: 'Uh oh.' } })) + ); + mockElasticsearchClient.deleteByQuery.mockRejectedValue(failureReason); + + await expect( + sessionIndex.invalidate({ match: 'query', query: { provider: { type: 'basic' } } }) + ).rejects.toBe(failureReason); + }); + + it('[match=query] when only provider type is specified', async () => { + await expect( + sessionIndex.invalidate({ match: 'query', query: { provider: { type: 'basic' } } }) + ).resolves.toBe(10); + + expect(mockElasticsearchClient.deleteByQuery).toHaveBeenCalledTimes(1); + expect(mockElasticsearchClient.deleteByQuery).toHaveBeenCalledWith({ + index: indexName, + refresh: true, + body: { query: { bool: { must: [{ term: { 'provider.type': 'basic' } }] } } }, + }); + }); + + it('[match=query] when both provider type and provider name are specified', async () => { + await expect( + sessionIndex.invalidate({ + match: 'query', + query: { provider: { type: 'basic', name: 'basic1' } }, + }) + ).resolves.toBe(10); + + expect(mockElasticsearchClient.deleteByQuery).toHaveBeenCalledTimes(1); + expect(mockElasticsearchClient.deleteByQuery).toHaveBeenCalledWith({ + index: indexName, + refresh: true, + body: { + query: { + bool: { + must: [ + { term: { 'provider.type': 'basic' } }, + { term: { 'provider.name': 'basic1' } }, + ], + }, + }, + }, + }); + }); + + it('[match=query] when both provider type and username hash are specified', async () => { + await expect( + sessionIndex.invalidate({ + match: 'query', + query: { provider: { type: 'basic' }, usernameHash: 'some-hash' }, + }) + ).resolves.toBe(10); + + expect(mockElasticsearchClient.deleteByQuery).toHaveBeenCalledTimes(1); + expect(mockElasticsearchClient.deleteByQuery).toHaveBeenCalledWith({ + index: indexName, + refresh: true, + body: { + query: { + bool: { + must: [ + { term: { 'provider.type': 'basic' } }, + { term: { usernameHash: 'some-hash' } }, + ], + }, + }, + }, + }); + }); + + it('[match=query] when provider type, provider name, and username hash are specified', async () => { + await expect( + sessionIndex.invalidate({ + match: 'query', + query: { provider: { type: 'basic', name: 'basic1' }, usernameHash: 'some-hash' }, + }) + ).resolves.toBe(10); + + expect(mockElasticsearchClient.deleteByQuery).toHaveBeenCalledTimes(1); + expect(mockElasticsearchClient.deleteByQuery).toHaveBeenCalledWith({ + index: indexName, + refresh: true, + body: { + query: { + bool: { + must: [ + { term: { 'provider.type': 'basic' } }, + { term: { 'provider.name': 'basic1' } }, + { term: { usernameHash: 'some-hash' } }, + ], + }, + }, + }, + }); + }); }); }); diff --git a/x-pack/plugins/security/server/session_management/session_index.ts b/x-pack/plugins/security/server/session_management/session_index.ts index 828c8fa11acdd4..1b5c820ec47106 100644 --- a/x-pack/plugins/security/server/session_management/session_index.ts +++ b/x-pack/plugins/security/server/session_management/session_index.ts @@ -17,6 +17,18 @@ export interface SessionIndexOptions { readonly logger: Logger; } +/** + * Filter provided for the `SessionIndex.invalidate` method that determines which session index + * values should be invalidated (removed from the index). It can have three possible types: + * - `all` means that all existing active and inactive sessions should be invalidated. + * - `sid` means that only session with the specified SID should be invalidated. + * - `query` means that only sessions that match specified query should be invalidated. + */ +export type InvalidateSessionsFilter = + | { match: 'all' } + | { match: 'sid'; sid: string } + | { match: 'query'; query: { provider: { type: string; name?: string }; usernameHash?: string } }; + /** * Version of the current session index template. */ @@ -237,19 +249,57 @@ export class SessionIndex { } /** - * Clears session value with the specified ID. - * @param sid Session ID to clear. + * Clears session value(s) determined by the specified filter. + * @param filter Filter that narrows down the list of the session values that should be cleared. */ - async clear(sid: string) { + async invalidate(filter: InvalidateSessionsFilter) { + if (filter.match === 'sid') { + try { + // We don't specify primary term and sequence number as delete should always take precedence + // over any updates that could happen in the meantime. + const { statusCode } = await this.options.elasticsearchClient.delete( + { id: filter.sid, index: this.indexName, refresh: 'wait_for' }, + { ignore: [404] } + ); + + // 404 means the session with such SID wasn't found and hence nothing was removed. + return statusCode !== 404 ? 1 : 0; + } catch (err) { + this.options.logger.error(`Failed to clear session value: ${err.message}`); + throw err; + } + } + + // If filter is specified we should clear only session values that are matched by the filter. + // Otherwise all session values should be cleared. + let deleteQuery; + if (filter.match === 'query') { + deleteQuery = { + bool: { + must: [ + { term: { 'provider.type': filter.query.provider.type } }, + ...(filter.query.provider.name + ? [{ term: { 'provider.name': filter.query.provider.name } }] + : []), + ...(filter.query.usernameHash + ? [{ term: { usernameHash: filter.query.usernameHash } }] + : []), + ], + }, + }; + } else { + deleteQuery = { match_all: {} }; + } + try { - // We don't specify primary term and sequence number as delete should always take precedence - // over any updates that could happen in the meantime. - await this.options.elasticsearchClient.delete( - { id: sid, index: this.indexName, refresh: 'wait_for' }, - { ignore: [404] } - ); + const { body: response } = await this.options.elasticsearchClient.deleteByQuery({ + index: this.indexName, + refresh: true, + body: { query: deleteQuery }, + }); + return response.deleted as number; } catch (err) { - this.options.logger.error(`Failed to clear session value: ${err.message}`); + this.options.logger.error(`Failed to clear session value(s): ${err.message}`); throw err; } } diff --git a/x-pack/plugins/security_solution/jest.config.js b/x-pack/plugins/security_solution/jest.config.js index 700eaebf6c2023..b4dcedfcceeeeb 100644 --- a/x-pack/plugins/security_solution/jest.config.js +++ b/x-pack/plugins/security_solution/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/security_solution'], + + // TODO: migrate to "jest-environment-jsdom" https://github.com/elastic/kibana/issues/95201 + testEnvironment: 'jest-environment-jsdom-thirteen', }; diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper_hover_content.tsx b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper_hover_content.tsx index 4295d64b439f2d..880f0b4e18acab 100644 --- a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper_hover_content.tsx +++ b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper_hover_content.tsx @@ -134,7 +134,7 @@ const DraggableWrapperHoverContentComponent: React.FC = ({ ) ? SourcererScopeName.detections : SourcererScopeName.default; - const { browserFields, indexPattern, selectedPatterns } = useSourcererScope(activeScope); + const { browserFields, indexPattern } = useSourcererScope(activeScope); const handleStartDragToTimeline = useCallback(() => { startDragToTimeline(); if (closePopOver != null) { @@ -365,7 +365,6 @@ const DraggableWrapperHoverContentComponent: React.FC = ({ browserFields={browserFields} field={field} indexPattern={indexPattern} - indexNames={selectedPatterns} onFilterAdded={onFilterAdded} timelineId={timelineId ?? undefined} toggleTopN={toggleTopN} diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/top_n/index.test.tsx index 7ed35f0ff08f15..0b5e07488ff2ad 100644 --- a/x-pack/plugins/security_solution/public/common/components/top_n/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/top_n/index.test.tsx @@ -168,7 +168,6 @@ const store = createStore( let testProps = { browserFields: mockBrowserFields, field, - indexNames: [], indexPattern: mockIndexPattern, timelineId: TimelineId.hostsPageExternalAlerts, toggleTopN: jest.fn(), diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/index.tsx b/x-pack/plugins/security_solution/public/common/components/top_n/index.tsx index c01a13a7aac42a..a325285ad9c1fd 100644 --- a/x-pack/plugins/security_solution/public/common/components/top_n/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/top_n/index.tsx @@ -25,7 +25,7 @@ import { combineQueries } from '../../../timelines/components/timeline/helpers'; import { getOptions } from './helpers'; import { TopN } from './top_n'; -import { TimelineId } from '../../../../common/types/timeline'; +import { TimelineId, TimelineTabs } from '../../../../common/types/timeline'; const EMPTY_FILTERS: Filter[] = []; const EMPTY_QUERY: Query = { query: '', language: 'kuery' }; @@ -47,11 +47,16 @@ const makeMapStateToProps = () => { return { activeTimelineEventType: activeTimeline.eventType, - activeTimelineFilters, + activeTimelineFilters: + activeTimeline.activeTab === TimelineTabs.query ? activeTimelineFilters : EMPTY_FILTERS, activeTimelineFrom: activeTimelineInput.timerange.from, - activeTimelineKqlQueryExpression: getKqlQueryTimeline(state, TimelineId.active), + activeTimelineKqlQueryExpression: + activeTimeline.activeTab === TimelineTabs.query + ? getKqlQueryTimeline(state, TimelineId.active) + : null, activeTimelineTo: activeTimelineInput.timerange.to, - dataProviders: activeTimeline.dataProviders, + dataProviders: + activeTimeline.activeTab === TimelineTabs.query ? activeTimeline.dataProviders : [], globalQuery: getGlobalQuerySelector(state), globalFilters: getGlobalFiltersQuerySelector(state), kqlMode: activeTimeline.kqlMode, @@ -72,7 +77,6 @@ interface OwnProps { browserFields: BrowserFields; field: string; indexPattern: IIndexPattern; - indexNames: string[]; timelineId?: string; toggleTopN: () => void; onFilterAdded?: () => void; @@ -91,7 +95,6 @@ const StatefulTopNComponent: React.FC = ({ dataProviders, field, indexPattern, - indexNames, globalFilters = EMPTY_FILTERS, globalQuery = EMPTY_QUERY, kqlMode, @@ -154,7 +157,6 @@ const StatefulTopNComponent: React.FC = ({ filters={timelineId === TimelineId.active ? EMPTY_FILTERS : globalFilters} from={timelineId === TimelineId.active ? activeTimelineFrom : from} indexPattern={indexPattern} - indexNames={indexNames} options={options} query={timelineId === TimelineId.active ? EMPTY_QUERY : globalQuery} setAbsoluteRangeDatePickerTarget={timelineId === TimelineId.active ? 'timeline' : 'global'} diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/selectors.tsx b/x-pack/plugins/security_solution/public/common/components/top_n/selectors.tsx new file mode 100644 index 00000000000000..f13a85da6baed4 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/top_n/selectors.tsx @@ -0,0 +1,38 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { State } from '../../store'; +import { sourcererSelectors } from '../../store/selectors'; + +export interface IndicesSelector { + all: string[]; + raw: string[]; +} + +export const getIndicesSelector = () => { + const getkibanaIndexPatternsSelector = sourcererSelectors.kibanaIndexPatternsSelector(); + const getConfigIndexPatternsSelector = sourcererSelectors.configIndexPatternsSelector(); + const getSignalIndexNameSelector = sourcererSelectors.signalIndexNameSelector(); + + const mapStateToProps = (state: State): IndicesSelector => { + const rawIndices = new Set(getConfigIndexPatternsSelector(state)); + const kibanaIndexPatterns = getkibanaIndexPatternsSelector(state); + const alertIndexName = getSignalIndexNameSelector(state); + kibanaIndexPatterns.forEach(({ title }) => { + if (title !== alertIndexName) { + rawIndices.add(title); + } + }); + + return { + all: alertIndexName != null ? [...rawIndices, alertIndexName] : [...rawIndices], + raw: [...rawIndices], + }; + }; + + return mapStateToProps; +}; diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/top_n.test.tsx b/x-pack/plugins/security_solution/public/common/components/top_n/top_n.test.tsx index b1ccecdebb6c0c..cee4254fd7358b 100644 --- a/x-pack/plugins/security_solution/public/common/components/top_n/top_n.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/top_n/top_n.test.tsx @@ -101,7 +101,6 @@ describe('TopN', () => { field, filters: [], from: '2020-04-14T00:31:47.695Z', - indexNames: [], indexPattern: mockIndexPattern, options: defaultOptions, query, diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx b/x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx index 76607fb9c0aca6..cc9be327cc4985 100644 --- a/x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx +++ b/x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx @@ -6,7 +6,9 @@ */ import { EuiButtonIcon, EuiSuperSelect } from '@elastic/eui'; +import deepEqual from 'fast-deep-equal'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; +import { useSelector } from 'react-redux'; import styled from 'styled-components'; import { GlobalTimeArgs } from '../../containers/use_global_time'; @@ -18,6 +20,8 @@ import { TimelineEventsType } from '../../../../common/types/timeline'; import { TopNOption } from './helpers'; import * as i18n from './translations'; +import { getIndicesSelector, IndicesSelector } from './selectors'; +import { State } from '../../store'; const TopNContainer = styled.div` width: 600px; @@ -49,7 +53,6 @@ export interface Props extends Pick = ({ field, from, indexPattern, - indexNames, options, query, setAbsoluteRangeDatePickerTarget, @@ -80,6 +82,11 @@ const TopNComponent: React.FC = ({ const onViewSelected = useCallback((value: string) => setView(value as TimelineEventsType), [ setView, ]); + const indicesSelector = useMemo(getIndicesSelector, []); + const { all: allIndices, raw: rawIndices } = useSelector( + (state) => indicesSelector(state), + deepEqual + ); useEffect(() => { setView(defaultView); @@ -116,7 +123,7 @@ const TopNComponent: React.FC = ({ from={from} headerChildren={headerChildren} indexPattern={indexPattern} - indexNames={indexNames} + indexNames={view === 'raw' ? rawIndices : allIndices} onlyField={field} query={query} setAbsoluteRangeDatePickerTarget={setAbsoluteRangeDatePickerTarget} @@ -127,6 +134,7 @@ const TopNComponent: React.FC = ({ /> ) : ( { const originalModule = jest.requireActual('react-router-dom'); @@ -104,4 +105,125 @@ describe('AlertsHistogramPanel', () => { }); }); }); + + describe('CombinedQueries', () => { + jest.mock('./helpers'); + const mockGetAlertsHistogramQuery = jest.spyOn(helpers, 'getAlertsHistogramQuery'); + beforeEach(() => { + mockGetAlertsHistogramQuery.mockReset(); + }); + + it('combinedQueries props is valid, alerts query include combinedQueries', async () => { + const props = { + ...defaultProps, + query: { query: 'host.name: "', language: 'kql' }, + combinedQueries: + '{"bool":{"must":[],"filter":[{"match_all":{}},{"exists":{"field":"process.name"}}],"should":[],"must_not":[]}}', + }; + mount( + + + + ); + await waitFor(() => { + expect(mockGetAlertsHistogramQuery.mock.calls[0]).toEqual([ + 'signal.rule.name', + '2020-07-07T08:20:18.966Z', + '2020-07-08T08:20:18.966Z', + [ + { + bool: { + filter: [{ match_all: {} }, { exists: { field: 'process.name' } }], + must: [], + must_not: [], + should: [], + }, + }, + ], + ]); + }); + }); + }); + + describe('parseCombinedQueries', () => { + it('return empty object when variables is undefined', async () => { + expect(parseCombinedQueries(undefined)).toEqual({}); + }); + + it('return empty object when variables is empty string', async () => { + expect(parseCombinedQueries('')).toEqual({}); + }); + + it('return empty object when variables is NOT a valid stringify json object', async () => { + expect(parseCombinedQueries('hello world')).toEqual({}); + }); + + it('return a valid json object when variables is a valid json stringify', async () => { + expect( + parseCombinedQueries( + '{"bool":{"must":[],"filter":[{"match_all":{}},{"exists":{"field":"process.name"}}],"should":[],"must_not":[]}}' + ) + ).toMatchInlineSnapshot(` + Object { + "bool": Object { + "filter": Array [ + Object { + "match_all": Object {}, + }, + Object { + "exists": Object { + "field": "process.name", + }, + }, + ], + "must": Array [], + "must_not": Array [], + "should": Array [], + }, + } + `); + }); + }); + + describe('buildCombinedQueries', () => { + it('return empty array when variables is undefined', async () => { + expect(buildCombinedQueries(undefined)).toEqual([]); + }); + + it('return empty array when variables is empty string', async () => { + expect(buildCombinedQueries('')).toEqual([]); + }); + + it('return array with empty object when variables is NOT a valid stringify json object', async () => { + expect(buildCombinedQueries('hello world')).toEqual([{}]); + }); + + it('return a valid json object when variables is a valid json stringify', async () => { + expect( + buildCombinedQueries( + '{"bool":{"must":[],"filter":[{"match_all":{}},{"exists":{"field":"process.name"}}],"should":[],"must_not":[]}}' + ) + ).toMatchInlineSnapshot(` + Array [ + Object { + "bool": Object { + "filter": Array [ + Object { + "match_all": Object {}, + }, + Object { + "exists": Object { + "field": "process.name", + }, + }, + ], + "must": Array [], + "must_not": Array [], + "should": Array [], + }, + }, + ] + `); + }); + }); }); diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_histogram_panel/index.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_histogram_panel/index.tsx index da75ffd5969bd4..e51fdc0094a69b 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_histogram_panel/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_histogram_panel/index.tsx @@ -58,6 +58,7 @@ const ViewAlertsFlexItem = styled(EuiFlexItem)` interface AlertsHistogramPanelProps extends Pick { chartHeight?: number; + combinedQueries?: string; defaultStackByOption?: AlertsHistogramOption; filters?: Filter[]; headerChildren?: React.ReactNode; @@ -86,9 +87,26 @@ const DEFAULT_STACK_BY = 'signal.rule.name'; const getDefaultStackByOption = (): AlertsHistogramOption => alertsHistogramOptions.find(({ text }) => text === DEFAULT_STACK_BY) ?? alertsHistogramOptions[0]; +export const parseCombinedQueries = (query?: string) => { + try { + return query != null && !isEmpty(query) ? JSON.parse(query) : {}; + } catch { + return {}; + } +}; + +export const buildCombinedQueries = (query?: string) => { + try { + return isEmpty(query) ? [] : [parseCombinedQueries(query)]; + } catch { + return []; + } +}; + export const AlertsHistogramPanel = memo( ({ chartHeight, + combinedQueries, defaultStackByOption = getDefaultStackByOption(), deleteQuery, filters, @@ -124,7 +142,12 @@ export const AlertsHistogramPanel = memo( request, refetch, } = useQueryAlerts<{}, AlertsAggregation>( - getAlertsHistogramQuery(selectedStackByOption.value, from, to, []), + getAlertsHistogramQuery( + selectedStackByOption.value, + from, + to, + buildCombinedQueries(combinedQueries) + ), signalIndexName ); const kibana = useKibana(); @@ -223,15 +246,20 @@ export const AlertsHistogramPanel = memo( useEffect(() => { try { - const converted = esQuery.buildEsQuery( - undefined, - query != null ? [query] : [], - filters?.filter((f) => f.meta.disabled === false) ?? [], - { - ...esQuery.getEsQueryConfig(kibana.services.uiSettings), - dateFormatTZ: undefined, - } - ); + let converted = null; + if (combinedQueries != null) { + converted = parseCombinedQueries(combinedQueries); + } else { + converted = esQuery.buildEsQuery( + undefined, + query != null ? [query] : [], + filters?.filter((f) => f.meta.disabled === false) ?? [], + { + ...esQuery.getEsQueryConfig(kibana.services.uiSettings), + dateFormatTZ: undefined, + } + ); + } setAlertsQuery( getAlertsHistogramQuery( @@ -245,7 +273,7 @@ export const AlertsHistogramPanel = memo( setAlertsQuery(getAlertsHistogramQuery(selectedStackByOption.value, from, to, [])); } // eslint-disable-next-line react-hooks/exhaustive-deps - }, [selectedStackByOption.value, from, to, query, filters]); + }, [selectedStackByOption.value, from, to, query, filters, combinedQueries]); const linkButton = useMemo(() => { if (showLinkToAlerts) { diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/types.ts b/x-pack/plugins/security_solution/public/management/pages/policy/types.ts index f7e054729c7b91..b2b95e2765bd86 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/types.ts +++ b/x-pack/plugins/security_solution/public/management/pages/policy/types.ts @@ -120,6 +120,12 @@ export type RansomwareProtectionOSes = KeysByValueCriteria< { ransomware: ProtectionFields } >; +export type PolicyProtection = + | keyof Pick + | keyof Pick; + +export type MacPolicyProtection = keyof Pick; + export interface GetPolicyListResponse extends GetPackagePoliciesResponse { items: PolicyData[]; } diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/protection_radio.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/protection_radio.tsx new file mode 100644 index 00000000000000..8394b557207afb --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/protection_radio.tsx @@ -0,0 +1,91 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useCallback, useMemo } from 'react'; +import { useDispatch } from 'react-redux'; +import { cloneDeep } from 'lodash'; +import { htmlIdGenerator, EuiRadio } from '@elastic/eui'; +import { + ImmutableArray, + ProtectionModes, + UIPolicyConfig, +} from '../../../../../../../common/endpoint/types'; +import { MacPolicyProtection, PolicyProtection } from '../../../types'; +import { usePolicyDetailsSelector } from '../../policy_hooks'; +import { policyConfig } from '../../../store/policy_details/selectors'; +import { AppAction } from '../../../../../../common/store/actions'; +import { useLicense } from '../../../../../../common/hooks/use_license'; + +export const ProtectionRadio = React.memo( + ({ + protection, + protectionMode, + osList, + label, + }: { + protection: PolicyProtection; + protectionMode: ProtectionModes; + osList: ImmutableArray>; + label: string; + }) => { + const policyDetailsConfig = usePolicyDetailsSelector(policyConfig); + const dispatch = useDispatch<(action: AppAction) => void>(); + const radioButtonId = useMemo(() => htmlIdGenerator()(), []); + const selected = policyDetailsConfig && policyDetailsConfig.windows[protection].mode; + const isPlatinumPlus = useLicense().isPlatinumPlus(); + + const handleRadioChange = useCallback(() => { + if (policyDetailsConfig) { + const newPayload = cloneDeep(policyDetailsConfig); + for (const os of osList) { + if (os === 'windows') { + newPayload[os][protection].mode = protectionMode; + } else if (os === 'mac') { + newPayload[os][protection as MacPolicyProtection].mode = protectionMode; + } + if (isPlatinumPlus) { + if (os === 'windows') { + if (protectionMode === ProtectionModes.prevent) { + newPayload[os].popup[protection].enabled = true; + } else { + newPayload[os].popup[protection].enabled = false; + } + } else if (os === 'mac') { + if (protectionMode === ProtectionModes.prevent) { + newPayload[os].popup[protection as MacPolicyProtection].enabled = true; + } else { + newPayload[os].popup[protection as MacPolicyProtection].enabled = false; + } + } + } + } + dispatch({ + type: 'userChangedPolicyConfig', + payload: { policyConfig: newPayload }, + }); + } + }, [dispatch, protectionMode, policyDetailsConfig, isPlatinumPlus, osList, protection]); + + /** + * Passing an arbitrary id because EuiRadio + * requires an id if label is passed + */ + + return ( + + ); + } +); + +ProtectionRadio.displayName = 'ProtectionRadio'; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/protection_switch.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/protection_switch.tsx new file mode 100644 index 00000000000000..cbe118e8dfa368 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/protection_switch.tsx @@ -0,0 +1,100 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useCallback } from 'react'; +import { useDispatch } from 'react-redux'; +import { i18n } from '@kbn/i18n'; +import { EuiSwitch } from '@elastic/eui'; +import { cloneDeep } from 'lodash'; +import { useLicense } from '../../../../../../common/hooks/use_license'; +import { policyConfig } from '../../../store/policy_details/selectors'; +import { usePolicyDetailsSelector } from '../../policy_hooks'; +import { AppAction } from '../../../../../../common/store/actions'; +import { + ImmutableArray, + ProtectionModes, + UIPolicyConfig, +} from '../../../../../../../common/endpoint/types'; +import { PolicyProtection, MacPolicyProtection } from '../../../types'; + +export const ProtectionSwitch = React.memo( + ({ + protection, + osList, + }: { + protection: PolicyProtection; + osList: ImmutableArray>; + }) => { + const policyDetailsConfig = usePolicyDetailsSelector(policyConfig); + const isPlatinumPlus = useLicense().isPlatinumPlus(); + const dispatch = useDispatch<(action: AppAction) => void>(); + const selected = policyDetailsConfig && policyDetailsConfig.windows[protection].mode; + + const handleSwitchChange = useCallback( + (event) => { + if (policyDetailsConfig) { + const newPayload = cloneDeep(policyDetailsConfig); + if (event.target.checked === false) { + for (const os of osList) { + if (os === 'windows') { + newPayload[os][protection].mode = ProtectionModes.off; + } else if (os === 'mac') { + newPayload[os][protection as MacPolicyProtection].mode = ProtectionModes.off; + } + if (isPlatinumPlus) { + if (os === 'windows') { + newPayload[os].popup[protection].enabled = event.target.checked; + } else if (os === 'mac') { + newPayload[os].popup[protection as MacPolicyProtection].enabled = + event.target.checked; + } + } + } + } else { + for (const os of osList) { + if (os === 'windows') { + newPayload[os][protection].mode = ProtectionModes.prevent; + } else if (os === 'mac') { + newPayload[os][protection as MacPolicyProtection].mode = ProtectionModes.prevent; + } + if (isPlatinumPlus) { + if (os === 'windows') { + newPayload[os].popup[protection].enabled = event.target.checked; + } else if (os === 'mac') { + newPayload[os].popup[protection as MacPolicyProtection].enabled = + event.target.checked; + } + } + } + } + dispatch({ + type: 'userChangedPolicyConfig', + payload: { policyConfig: newPayload }, + }); + } + }, + [dispatch, policyDetailsConfig, isPlatinumPlus, protection, osList] + ); + + return ( + + ); + } +); + +ProtectionSwitch.displayName = 'ProtectionSwitch'; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/radio_buttons.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/radio_buttons.tsx new file mode 100644 index 00000000000000..793c24a0c4d0cb --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/radio_buttons.tsx @@ -0,0 +1,96 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useMemo } from 'react'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n/react'; +import styled from 'styled-components'; +import { EuiSpacer, EuiFlexItem, EuiFlexGroup } from '@elastic/eui'; +import { + Immutable, + ImmutableArray, + ProtectionModes, + UIPolicyConfig, +} from '../../../../../../../common/endpoint/types'; +import { PolicyProtection } from '../../../types'; +import { ConfigFormHeading } from '../../components/config_form'; +import { ProtectionRadio } from './protection_radio'; + +export const RadioFlexGroup = styled(EuiFlexGroup)` + .no-right-margin-radio { + margin-right: 0; + } + .no-horizontal-margin-radio { + margin: ${(props) => props.theme.eui.ruleMargins.marginSmall} 0; + } +`; + +export const RadioButtons = React.memo( + ({ + protection, + osList, + }: { + protection: PolicyProtection; + osList: ImmutableArray>; + }) => { + const radios: Immutable< + Array<{ + id: ProtectionModes; + label: string; + }> + > = useMemo(() => { + return [ + { + id: ProtectionModes.detect, + label: i18n.translate('xpack.securitySolution.endpoint.policy.details.detect', { + defaultMessage: 'Detect', + }), + }, + { + id: ProtectionModes.prevent, + label: i18n.translate('xpack.securitySolution.endpoint.policy.details.prevent', { + defaultMessage: 'Prevent', + }), + }, + ]; + }, []); + + return ( + <> + + + + + + + + + + + + + + ); + } +); + +RadioButtons.displayName = 'RadioButtons'; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/supported_version.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/supported_version.tsx similarity index 91% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/supported_version.tsx rename to x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/supported_version.tsx index 5985a5fe03ec35..b8418004206b9c 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/supported_version.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/supported_version.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; import { EuiText } from '@elastic/eui'; -import { popupVersionsMap } from './popup_options_to_versions'; +import { popupVersionsMap } from '../protections/popup_options_to_versions'; export const SupportedVersionNotice = ({ optionName }: { optionName: string }) => { const version = popupVersionsMap.get(optionName); diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/user_notification.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/user_notification.tsx new file mode 100644 index 00000000000000..def9e78e994b05 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/user_notification.tsx @@ -0,0 +1,170 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useCallback } from 'react'; +import { useDispatch } from 'react-redux'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { cloneDeep } from 'lodash'; +import { + EuiSpacer, + EuiFlexItem, + EuiFlexGroup, + EuiCheckbox, + EuiIconTip, + EuiText, + EuiTextArea, +} from '@elastic/eui'; +import { + ImmutableArray, + ProtectionModes, + UIPolicyConfig, +} from '../../../../../../../common/endpoint/types'; +import { PolicyProtection, MacPolicyProtection } from '../../../types'; +import { ConfigFormHeading } from '../../components/config_form'; +import { usePolicyDetailsSelector } from '../../policy_hooks'; +import { policyConfig } from '../../../store/policy_details/selectors'; +import { AppAction } from '../../../../../../common/store/actions'; +import { SupportedVersionNotice } from './supported_version'; + +export const UserNotification = React.memo( + ({ + protection, + osList, + }: { + protection: PolicyProtection; + osList: ImmutableArray>; + }) => { + const policyDetailsConfig = usePolicyDetailsSelector(policyConfig); + const dispatch = useDispatch<(action: AppAction) => void>(); + const selected = policyDetailsConfig && policyDetailsConfig.windows[protection].mode; + const userNotificationSelected = + policyDetailsConfig && policyDetailsConfig.windows.popup[protection].enabled; + const userNotificationMessage = + policyDetailsConfig && policyDetailsConfig.windows.popup[protection].message; + + const handleUserNotificationCheckbox = useCallback( + (event) => { + if (policyDetailsConfig) { + const newPayload = cloneDeep(policyDetailsConfig); + for (const os of osList) { + if (os === 'windows') { + newPayload[os].popup[protection].enabled = event.target.checked; + } else if (os === 'mac') { + newPayload[os].popup[protection as MacPolicyProtection].enabled = + event.target.checked; + } + } + dispatch({ + type: 'userChangedPolicyConfig', + payload: { policyConfig: newPayload }, + }); + } + }, + [policyDetailsConfig, dispatch, protection, osList] + ); + + const handleCustomUserNotification = useCallback( + (event) => { + if (policyDetailsConfig) { + const newPayload = cloneDeep(policyDetailsConfig); + for (const os of osList) { + if (os === 'windows') { + newPayload[os].popup[protection].message = event.target.value; + } else if (os === 'mac') { + newPayload[os].popup[protection as MacPolicyProtection].message = event.target.value; + } + } + dispatch({ + type: 'userChangedPolicyConfig', + payload: { policyConfig: newPayload }, + }); + } + }, + [policyDetailsConfig, dispatch, protection, osList] + ); + + return ( + <> + + + + + + + + {userNotificationSelected && ( + <> + + + + +

+ +

+
+
+ + + + + + + } + /> + +
+ + + + )} + + ); + } +); + +UserNotification.displayName = 'UserNotification'; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx index a5be095abfc598..03cd587ca7e5c5 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx @@ -5,333 +5,29 @@ * 2.0. */ -import React, { useCallback, useMemo } from 'react'; -import { useDispatch } from 'react-redux'; +import React from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; -import { - EuiCallOut, - EuiCheckbox, - EuiRadio, - EuiSpacer, - EuiSwitch, - EuiText, - EuiTextArea, - htmlIdGenerator, - EuiFlexGroup, - EuiFlexItem, - EuiIconTip, -} from '@elastic/eui'; -import { cloneDeep } from 'lodash'; -import styled from 'styled-components'; +import { EuiCallOut, EuiSpacer } from '@elastic/eui'; import { APP_ID } from '../../../../../../../common/constants'; import { SecurityPageName } from '../../../../../../app/types'; -import { - Immutable, - OperatingSystem, - ProtectionModes, -} from '../../../../../../../common/endpoint/types'; +import { Immutable, OperatingSystem } from '../../../../../../../common/endpoint/types'; import { MalwareProtectionOSes, OS } from '../../../types'; -import { ConfigForm, ConfigFormHeading } from '../../components/config_form'; -import { policyConfig } from '../../../store/policy_details/selectors'; -import { usePolicyDetailsSelector } from '../../policy_hooks'; +import { ConfigForm } from '../../components/config_form'; import { LinkToApp } from '../../../../../../common/components/endpoint/link_to_app'; import { useLicense } from '../../../../../../common/hooks/use_license'; -import { AppAction } from '../../../../../../common/store/actions'; -import { SupportedVersionNotice } from './supported_version'; - -export const RadioFlexGroup = styled(EuiFlexGroup)` - .no-right-margin-radio { - margin-right: 0; - } - .no-horizontal-margin-radio { - margin: ${(props) => props.theme.eui.ruleMargins.marginSmall} 0; - } -`; - -const OSes: Immutable = [OS.windows, OS.mac]; -const protection = 'malware'; - -const ProtectionRadio = React.memo( - ({ protectionMode, label }: { protectionMode: ProtectionModes; label: string }) => { - const policyDetailsConfig = usePolicyDetailsSelector(policyConfig); - const dispatch = useDispatch<(action: AppAction) => void>(); - const radioButtonId = useMemo(() => htmlIdGenerator()(), []); - // currently just taking windows.malware, but both windows.malware and mac.malware should be the same value - const selected = policyDetailsConfig && policyDetailsConfig.windows.malware.mode; - const isPlatinumPlus = useLicense().isPlatinumPlus(); - - const handleRadioChange = useCallback(() => { - if (policyDetailsConfig) { - const newPayload = cloneDeep(policyDetailsConfig); - for (const os of OSes) { - newPayload[os][protection].mode = protectionMode; - if (isPlatinumPlus) { - if (protectionMode === ProtectionModes.prevent) { - newPayload[os].popup[protection].enabled = true; - } else { - newPayload[os].popup[protection].enabled = false; - } - } - } - dispatch({ - type: 'userChangedPolicyConfig', - payload: { policyConfig: newPayload }, - }); - } - }, [dispatch, protectionMode, policyDetailsConfig, isPlatinumPlus]); - - /** - * Passing an arbitrary id because EuiRadio - * requires an id if label is passed - */ - - return ( - - ); - } -); - -ProtectionRadio.displayName = 'ProtectionRadio'; +import { RadioButtons } from '../components/radio_buttons'; +import { UserNotification } from '../components/user_notification'; +import { ProtectionSwitch } from '../components/protection_switch'; /** The Malware Protections form for policy details * which will configure for all relevant OSes. */ export const MalwareProtections = React.memo(() => { - const policyDetailsConfig = usePolicyDetailsSelector(policyConfig); - const dispatch = useDispatch<(action: AppAction) => void>(); - // currently just taking windows.malware, but both windows.malware and mac.malware should be the same value - const selected = policyDetailsConfig && policyDetailsConfig.windows.malware.mode; - const userNotificationSelected = - policyDetailsConfig && policyDetailsConfig.windows.popup.malware.enabled; - const userNotificationMessage = - policyDetailsConfig && policyDetailsConfig.windows.popup.malware.message; + const OSes: Immutable = [OS.windows, OS.mac]; + const protection = 'malware'; const isPlatinumPlus = useLicense().isPlatinumPlus(); - const radios: Immutable< - Array<{ - id: ProtectionModes; - label: string; - protection: 'malware'; - }> - > = useMemo(() => { - return [ - { - id: ProtectionModes.detect, - label: i18n.translate('xpack.securitySolution.endpoint.policy.details.detect', { - defaultMessage: 'Detect', - }), - protection: 'malware', - }, - { - id: ProtectionModes.prevent, - label: i18n.translate('xpack.securitySolution.endpoint.policy.details.prevent', { - defaultMessage: 'Prevent', - }), - protection: 'malware', - }, - ]; - }, []); - - const handleSwitchChange = useCallback( - (event) => { - if (policyDetailsConfig) { - const newPayload = cloneDeep(policyDetailsConfig); - if (event.target.checked === false) { - for (const os of OSes) { - newPayload[os][protection].mode = ProtectionModes.off; - if (isPlatinumPlus) { - newPayload[os].popup[protection].enabled = event.target.checked; - } - } - } else { - for (const os of OSes) { - newPayload[os][protection].mode = ProtectionModes.prevent; - if (isPlatinumPlus) { - newPayload[os].popup[protection].enabled = event.target.checked; - } - } - } - dispatch({ - type: 'userChangedPolicyConfig', - payload: { policyConfig: newPayload }, - }); - } - }, - [dispatch, policyDetailsConfig, isPlatinumPlus] - ); - - const handleUserNotificationCheckbox = useCallback( - (event) => { - if (policyDetailsConfig) { - const newPayload = cloneDeep(policyDetailsConfig); - for (const os of OSes) { - newPayload[os].popup[protection].enabled = event.target.checked; - } - dispatch({ - type: 'userChangedPolicyConfig', - payload: { policyConfig: newPayload }, - }); - } - }, - [policyDetailsConfig, dispatch] - ); - - const handleCustomUserNotification = useCallback( - (event) => { - if (policyDetailsConfig) { - const newPayload = cloneDeep(policyDetailsConfig); - for (const os of OSes) { - newPayload[os].popup[protection].message = event.target.value; - } - dispatch({ - type: 'userChangedPolicyConfig', - payload: { policyConfig: newPayload }, - }); - } - }, - [policyDetailsConfig, dispatch] - ); - - const radioButtons = useMemo(() => { - return ( - <> - - - - - - - - - - - - - {isPlatinumPlus && ( - <> - - - - - - - - - )} - {isPlatinumPlus && userNotificationSelected && ( - <> - - - - -

- -

-
-
- - - - - - - } - /> - -
- - - - )} - - ); - }, [ - radios, - selected, - isPlatinumPlus, - handleUserNotificationCheckbox, - userNotificationSelected, - userNotificationMessage, - handleCustomUserNotification, - ]); - - const protectionSwitch = useMemo(() => { - return ( - - ); - }, [handleSwitchChange, selected]); - return ( { })} supportedOss={[OperatingSystem.WINDOWS, OperatingSystem.MAC]} dataTestSubj="malwareProtectionsForm" - rightCorner={protectionSwitch} + rightCorner={} > - {radioButtons} + + {isPlatinumPlus && } = [OS.windows]; -const protection = 'ransomware'; - -const ProtectionRadio = React.memo( - ({ protectionMode, label }: { protectionMode: ProtectionModes; label: string }) => { - const policyDetailsConfig = usePolicyDetailsSelector(policyConfig); - const dispatch = useDispatch<(action: AppAction) => void>(); - const radioButtonId = useMemo(() => htmlIdGenerator()(), []); - const selected = policyDetailsConfig && policyDetailsConfig.windows.ransomware.mode; - - const handleRadioChange: EuiRadioProps['onChange'] = useCallback(() => { - if (policyDetailsConfig) { - const newPayload = cloneDeep(policyDetailsConfig); - for (const os of OSes) { - newPayload[os][protection].mode = protectionMode; - if (protectionMode === ProtectionModes.prevent) { - newPayload[os].popup[protection].enabled = true; - } else { - newPayload[os].popup[protection].enabled = false; - } - } - dispatch({ - type: 'userChangedPolicyConfig', - payload: { policyConfig: newPayload }, - }); - } - }, [dispatch, protectionMode, policyDetailsConfig]); - - /** - * Passing an arbitrary id because EuiRadio - * requires an id if label is passed - */ - - return ( - - ); - } -); - -ProtectionRadio.displayName = 'ProtectionRadio'; +import { RadioButtons } from '../components/radio_buttons'; +import { UserNotification } from '../components/user_notification'; +import { ProtectionSwitch } from '../components/protection_switch'; /** The Ransomware Protections form for policy details * which will configure for all relevant OSes. */ export const Ransomware = React.memo(() => { - const policyDetailsConfig = usePolicyDetailsSelector(policyConfig); - const dispatch = useDispatch<(action: AppAction) => void>(); - const selected = policyDetailsConfig && policyDetailsConfig.windows.ransomware.mode; - const userNotificationSelected = - policyDetailsConfig && policyDetailsConfig.windows.popup.ransomware.enabled; - const userNotificationMessage = - policyDetailsConfig && policyDetailsConfig.windows.popup.ransomware.message; - - const radios: Immutable< - Array<{ - id: ProtectionModes; - label: string; - protection: 'ransomware'; - }> - > = useMemo(() => { - return [ - { - id: ProtectionModes.detect, - label: i18n.translate('xpack.securitySolution.endpoint.policy.details.detect', { - defaultMessage: 'Detect', - }), - protection: 'ransomware', - }, - { - id: ProtectionModes.prevent, - label: i18n.translate('xpack.securitySolution.endpoint.policy.details.prevent', { - defaultMessage: 'Prevent', - }), - protection: 'ransomware', - }, - ]; - }, []); - - const handleSwitchChange: EuiSwitchProps['onChange'] = useCallback( - (event) => { - if (policyDetailsConfig) { - const newPayload = cloneDeep(policyDetailsConfig); - if (event.target.checked === false) { - for (const os of OSes) { - newPayload[os][protection].mode = ProtectionModes.off; - newPayload[os].popup[protection].enabled = event.target.checked; - } - } else { - for (const os of OSes) { - newPayload[os][protection].mode = ProtectionModes.prevent; - newPayload[os].popup[protection].enabled = event.target.checked; - } - } - dispatch({ - type: 'userChangedPolicyConfig', - payload: { policyConfig: newPayload }, - }); - } - }, - [dispatch, policyDetailsConfig] - ); - - const handleUserNotificationCheckbox: EuiCheckboxProps['onChange'] = useCallback( - (event) => { - if (policyDetailsConfig) { - const newPayload = cloneDeep(policyDetailsConfig); - for (const os of OSes) { - newPayload[os].popup[protection].enabled = event.target.checked; - } - dispatch({ - type: 'userChangedPolicyConfig', - payload: { policyConfig: newPayload }, - }); - } - }, - [policyDetailsConfig, dispatch] - ); - - const handleCustomUserNotification = useCallback( - (event) => { - if (policyDetailsConfig) { - const newPayload = cloneDeep(policyDetailsConfig); - for (const os of OSes) { - newPayload[os].popup[protection].message = event.target.value; - } - dispatch({ - type: 'userChangedPolicyConfig', - payload: { policyConfig: newPayload }, - }); - } - }, - [policyDetailsConfig, dispatch] - ); - - const radioButtons = useMemo(() => { - return ( - <> - - - - - - - - - - - - - - - - - - - - {userNotificationSelected && ( - <> - - - - -

- -

-
-
- - - - - - - } - /> - -
- - - - )} - - ); - }, [ - radios, - selected, - handleUserNotificationCheckbox, - userNotificationSelected, - userNotificationMessage, - handleCustomUserNotification, - ]); - - const protectionSwitch = useMemo(() => { - return ( - - ); - }, [handleSwitchChange, selected]); + const OSes: Immutable = [OS.windows]; + const protection = 'ransomware'; return ( { })} supportedOss={[OperatingSystem.WINDOWS]} dataTestSubj="ransomwareProtectionsForm" - rightCorner={protectionSwitch} + rightCorner={} > - {radioButtons} + + { + combinedQueries?: string; filters?: Filter[]; headerChildren?: React.ReactNode; /** Override all defaults, and only display this field */ @@ -29,6 +30,7 @@ interface Props extends Pick = ({ + combinedQueries, deleteQuery, filters, from, @@ -61,6 +63,7 @@ const SignalsByCategoryComponent: React.FC = ({ return ( = ({ return ( <> - + {timelineFullScreen && setTimelineFullScreen != null && ( diff --git a/x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.ts b/x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.ts index 60a2acc5319df3..c0cf71fab05584 100644 --- a/x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.ts +++ b/x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.ts @@ -179,50 +179,262 @@ export function getSpacesUsageCollector( type: 'spaces', isReady: () => true, schema: { - usesFeatureControls: { type: 'boolean' }, + usesFeatureControls: { + type: 'boolean', + _meta: { + description: + 'Indicates if at least one feature is disabled in at least one space. This is a signal that space-level feature controls are in use. This does not account for role-based (security) feature controls.', + }, + }, disabledFeatures: { // "feature": number; - DYNAMIC_KEY: { type: 'long' }, + DYNAMIC_KEY: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, // Known registered features - stackAlerts: { type: 'long' }, - actions: { type: 'long' }, - enterpriseSearch: { type: 'long' }, - fleet: { type: 'long' }, - savedObjectsTagging: { type: 'long' }, - indexPatterns: { type: 'long' }, - discover: { type: 'long' }, - canvas: { type: 'long' }, - maps: { type: 'long' }, - siem: { type: 'long' }, - monitoring: { type: 'long' }, - graph: { type: 'long' }, - uptime: { type: 'long' }, - savedObjectsManagement: { type: 'long' }, - timelion: { type: 'long' }, - dev_tools: { type: 'long' }, - advancedSettings: { type: 'long' }, - infrastructure: { type: 'long' }, - visualize: { type: 'long' }, - logs: { type: 'long' }, - dashboard: { type: 'long' }, - ml: { type: 'long' }, - apm: { type: 'long' }, - }, - available: { type: 'boolean' }, - enabled: { type: 'boolean' }, - count: { type: 'long' }, - 'apiCalls.copySavedObjects.total': { type: 'long' }, - 'apiCalls.copySavedObjects.kibanaRequest.yes': { type: 'long' }, - 'apiCalls.copySavedObjects.kibanaRequest.no': { type: 'long' }, - 'apiCalls.copySavedObjects.createNewCopiesEnabled.yes': { type: 'long' }, - 'apiCalls.copySavedObjects.createNewCopiesEnabled.no': { type: 'long' }, - 'apiCalls.copySavedObjects.overwriteEnabled.yes': { type: 'long' }, - 'apiCalls.copySavedObjects.overwriteEnabled.no': { type: 'long' }, - 'apiCalls.resolveCopySavedObjectsErrors.total': { type: 'long' }, - 'apiCalls.resolveCopySavedObjectsErrors.kibanaRequest.yes': { type: 'long' }, - 'apiCalls.resolveCopySavedObjectsErrors.kibanaRequest.no': { type: 'long' }, - 'apiCalls.resolveCopySavedObjectsErrors.createNewCopiesEnabled.yes': { type: 'long' }, - 'apiCalls.resolveCopySavedObjectsErrors.createNewCopiesEnabled.no': { type: 'long' }, + stackAlerts: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, + actions: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, + enterpriseSearch: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, + fleet: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, + savedObjectsTagging: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, + indexPatterns: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, + discover: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, + canvas: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, + maps: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, + siem: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, + monitoring: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, + graph: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, + uptime: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, + savedObjectsManagement: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, + timelion: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, + dev_tools: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, + advancedSettings: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, + infrastructure: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, + visualize: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, + logs: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, + dashboard: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, + ml: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, + apm: { + type: 'long', + _meta: { + description: 'The number of spaces which have this feature disabled.', + }, + }, + }, + available: { + type: 'boolean', + _meta: { + description: 'Indicates if the spaces feature is available in this installation.', + }, + }, + enabled: { + type: 'boolean', + _meta: { + description: 'Indicates if the spaces feature is enabled in this installation.', + }, + }, + count: { + type: 'long', + _meta: { + description: 'The number of spaces in this installation.', + }, + }, + 'apiCalls.copySavedObjects.total': { + type: 'long', + _meta: { + description: 'The number of times the "Copy Saved Objects" API has been called.', + }, + }, + 'apiCalls.copySavedObjects.kibanaRequest.yes': { + type: 'long', + _meta: { + description: + 'The number of times the "Copy Saved Objects" API has been called via the Kibana client.', + }, + }, + 'apiCalls.copySavedObjects.kibanaRequest.no': { + type: 'long', + _meta: { + description: + 'The number of times the "Copy Saved Objects" API has been called via an API consumer (e.g. curl).', + }, + }, + 'apiCalls.copySavedObjects.createNewCopiesEnabled.yes': { + type: 'long', + _meta: { + description: + 'The number of times the "Copy Saved Objects" API has been called with "createNewCopies" set to true.', + }, + }, + 'apiCalls.copySavedObjects.createNewCopiesEnabled.no': { + type: 'long', + _meta: { + description: + 'The number of times the "Copy Saved Objects" API has been called with "createNewCopies" set to false.', + }, + }, + 'apiCalls.copySavedObjects.overwriteEnabled.yes': { + type: 'long', + _meta: { + description: + 'The number of times the "Copy Saved Objects" API has been called with "overwrite" set to true.', + }, + }, + 'apiCalls.copySavedObjects.overwriteEnabled.no': { + type: 'long', + _meta: { + description: + 'The number of times the "Copy Saved Objects" API has been called with "overwrite" set to false.', + }, + }, + 'apiCalls.resolveCopySavedObjectsErrors.total': { + type: 'long', + _meta: { + description: + 'The number of times the "Resolve Copy Saved Objects Errors" API has been called.', + }, + }, + 'apiCalls.resolveCopySavedObjectsErrors.kibanaRequest.yes': { + type: 'long', + _meta: { + description: + 'The number of times the "Resolve Copy Saved Objects Errors" API has been called via the Kibana client.', + }, + }, + 'apiCalls.resolveCopySavedObjectsErrors.kibanaRequest.no': { + type: 'long', + _meta: { + description: + 'The number of times the "Resolve Copy Saved Objects Errors" API has been called via an API consumer (e.g. curl).', + }, + }, + 'apiCalls.resolveCopySavedObjectsErrors.createNewCopiesEnabled.yes': { + type: 'long', + _meta: { + description: + 'The number of times the "Resolve Copy Saved Objects Errors" API has been called with "createNewCopies" set to true.', + }, + }, + 'apiCalls.resolveCopySavedObjectsErrors.createNewCopiesEnabled.no': { + type: 'long', + _meta: { + description: + 'The number of times the "Resolve Copy Saved Objects Errors" API has been called with "createNewCopies" set to false.', + }, + }, }, fetch: async ({ esClient }: CollectorFetchContext) => { const { licensing, kibanaIndexConfig$, features, usageStatsServicePromise } = deps; diff --git a/x-pack/plugins/stack_alerts/server/feature.ts b/x-pack/plugins/stack_alerts/server/feature.ts index d421832a4cd970..9f91398cc7d24b 100644 --- a/x-pack/plugins/stack_alerts/server/feature.ts +++ b/x-pack/plugins/stack_alerts/server/feature.ts @@ -8,6 +8,7 @@ import { i18n } from '@kbn/i18n'; import { ID as IndexThreshold } from './alert_types/index_threshold/alert_type'; import { GEO_CONTAINMENT_ID as GeoContainment } from './alert_types/geo_containment/alert_type'; +import { ES_QUERY_ID as ElasticsearchQuery } from './alert_types/es_query/alert_type'; import { STACK_ALERTS_FEATURE_ID } from '../common'; import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/server'; @@ -21,7 +22,7 @@ export const BUILT_IN_ALERTS_FEATURE = { management: { insightsAndAlerting: ['triggersActions'], }, - alerting: [IndexThreshold, GeoContainment], + alerting: [IndexThreshold, GeoContainment, ElasticsearchQuery], privileges: { all: { app: [], @@ -30,7 +31,7 @@ export const BUILT_IN_ALERTS_FEATURE = { insightsAndAlerting: ['triggersActions'], }, alerting: { - all: [IndexThreshold, GeoContainment], + all: [IndexThreshold, GeoContainment, ElasticsearchQuery], read: [], }, savedObject: { @@ -48,7 +49,7 @@ export const BUILT_IN_ALERTS_FEATURE = { }, alerting: { all: [], - read: [IndexThreshold, GeoContainment], + read: [IndexThreshold, GeoContainment, ElasticsearchQuery], }, savedObject: { all: [], diff --git a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json index bb9356014e7a34..36488fceb2a1d4 100644 --- a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json +++ b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @@ -1876,6 +1876,12 @@ "app_query_change": { "type": "long" }, + "open_help_popover": { + "type": "long", + "_meta": { + "description": "Number of times the user opened one of the in-product help popovers." + } + }, "indexpattern_field_info_click": { "type": "long" }, @@ -1949,31 +1955,126 @@ "type": "long" }, "indexpattern_dimension_operation_terms": { - "type": "long" + "type": "long", + "_meta": { + "description": "Number of times the top values function was selected" + } }, "indexpattern_dimension_operation_date_histogram": { - "type": "long" + "type": "long", + "_meta": { + "description": "Number of times the date histogram function was selected" + } }, "indexpattern_dimension_operation_avg": { - "type": "long" + "type": "long", + "_meta": { + "description": "Number of times the average function was selected" + } }, "indexpattern_dimension_operation_min": { - "type": "long" + "type": "long", + "_meta": { + "description": "Number of times the min function was selected" + } }, "indexpattern_dimension_operation_max": { - "type": "long" + "type": "long", + "_meta": { + "description": "Number of times the max function was selected" + } }, "indexpattern_dimension_operation_sum": { - "type": "long" + "type": "long", + "_meta": { + "description": "Number of times the sum function was selected" + } }, "indexpattern_dimension_operation_count": { - "type": "long" + "type": "long", + "_meta": { + "description": "Number of times the count function was selected" + } }, "indexpattern_dimension_operation_cardinality": { - "type": "long" + "type": "long", + "_meta": { + "description": "Number of times the cardinality function was selected" + } }, "indexpattern_dimension_operation_filters": { - "type": "long" + "type": "long", + "_meta": { + "description": "Number of times the filters function was selected" + } + }, + "indexpattern_dimension_operation_range": { + "type": "long", + "_meta": { "description": "Number of times the range function was selected" } + }, + "indexpattern_dimension_operation_median": { + "type": "long", + "_meta": { "description": "Number of times the median function was selected" } + }, + "indexpattern_dimension_operation_percentile": { + "type": "long", + "_meta": { "description": "Number of times the percentile function was selected" } + }, + "indexpattern_dimension_operation_last_value": { + "type": "long", + "_meta": { "description": "Number of times the last value function was selected" } + }, + "indexpattern_dimension_operation_cumulative_sum": { + "type": "long", + "_meta": { "description": "Number of times the cumulative sum function was selected" } + }, + "indexpattern_dimension_operation_counter_rate": { + "type": "long", + "_meta": { "description": "Number of times the counter rate function was selected" } + }, + "indexpattern_dimension_operation_derivative": { + "type": "long", + "_meta": { "description": "Number of times the derivative function was selected" } + }, + "indexpattern_dimension_operation_moving_average": { + "type": "long", + "_meta": { "description": "Number of times the moving average function was selected" } + }, + "open_field_editor_edit": { + "type": "long", + "_meta": { + "description": "Number of times the user opened the editor flyout to edit a field from within Lens." + } + }, + "open_field_editor_add": { + "type": "long", + "_meta": { + "description": "Number of times the user opened the editor flyout to add a field from within Lens." + } + }, + "save_field_edit": { + "type": "long", + "_meta": { + "description": "Number of times the user edited a field from within Lens." + } + }, + "save_field_add": { + "type": "long", + "_meta": { + "description": "Number of times the user added a field from within Lens." + } + }, + "open_field_delete_modal": { + "type": "long", + "_meta": { + "description": "Number of times the user opened the field delete modal from within Lens." + } + }, + "delete_field": { + "type": "long", + "_meta": { + "description": "Number of times the user deleted a field from within Lens." + } } } }, @@ -1982,6 +2083,12 @@ "app_query_change": { "type": "long" }, + "open_help_popover": { + "type": "long", + "_meta": { + "description": "Number of times the user opened one of the in-product help popovers." + } + }, "indexpattern_field_info_click": { "type": "long" }, @@ -2055,31 +2162,126 @@ "type": "long" }, "indexpattern_dimension_operation_terms": { - "type": "long" + "type": "long", + "_meta": { + "description": "Number of times the top values function was selected" + } }, "indexpattern_dimension_operation_date_histogram": { - "type": "long" + "type": "long", + "_meta": { + "description": "Number of times the date histogram function was selected" + } }, "indexpattern_dimension_operation_avg": { - "type": "long" + "type": "long", + "_meta": { + "description": "Number of times the average function was selected" + } }, "indexpattern_dimension_operation_min": { - "type": "long" + "type": "long", + "_meta": { + "description": "Number of times the min function was selected" + } }, "indexpattern_dimension_operation_max": { - "type": "long" + "type": "long", + "_meta": { + "description": "Number of times the max function was selected" + } }, "indexpattern_dimension_operation_sum": { - "type": "long" + "type": "long", + "_meta": { + "description": "Number of times the sum function was selected" + } }, "indexpattern_dimension_operation_count": { - "type": "long" + "type": "long", + "_meta": { + "description": "Number of times the count function was selected" + } }, "indexpattern_dimension_operation_cardinality": { - "type": "long" + "type": "long", + "_meta": { + "description": "Number of times the cardinality function was selected" + } }, "indexpattern_dimension_operation_filters": { - "type": "long" + "type": "long", + "_meta": { + "description": "Number of times the filters function was selected" + } + }, + "indexpattern_dimension_operation_range": { + "type": "long", + "_meta": { "description": "Number of times the range function was selected" } + }, + "indexpattern_dimension_operation_median": { + "type": "long", + "_meta": { "description": "Number of times the median function was selected" } + }, + "indexpattern_dimension_operation_percentile": { + "type": "long", + "_meta": { "description": "Number of times the percentile function was selected" } + }, + "indexpattern_dimension_operation_last_value": { + "type": "long", + "_meta": { "description": "Number of times the last value function was selected" } + }, + "indexpattern_dimension_operation_cumulative_sum": { + "type": "long", + "_meta": { "description": "Number of times the cumulative sum function was selected" } + }, + "indexpattern_dimension_operation_counter_rate": { + "type": "long", + "_meta": { "description": "Number of times the counter rate function was selected" } + }, + "indexpattern_dimension_operation_derivative": { + "type": "long", + "_meta": { "description": "Number of times the derivative function was selected" } + }, + "indexpattern_dimension_operation_moving_average": { + "type": "long", + "_meta": { "description": "Number of times the moving average function was selected" } + }, + "open_field_editor_edit": { + "type": "long", + "_meta": { + "description": "Number of times the user opened the editor flyout to edit a field from within Lens." + } + }, + "open_field_editor_add": { + "type": "long", + "_meta": { + "description": "Number of times the user opened the editor flyout to add a field from within Lens." + } + }, + "save_field_edit": { + "type": "long", + "_meta": { + "description": "Number of times the user edited a field from within Lens." + } + }, + "save_field_add": { + "type": "long", + "_meta": { + "description": "Number of times the user added a field from within Lens." + } + }, + "open_field_delete_modal": { + "type": "long", + "_meta": { + "description": "Number of times the user opened the field delete modal from within Lens." + } + }, + "delete_field": { + "type": "long", + "_meta": { + "description": "Number of times the user deleted a field from within Lens." + } } } }, @@ -3648,128 +3850,248 @@ "spaces": { "properties": { "usesFeatureControls": { - "type": "boolean" + "type": "boolean", + "_meta": { + "description": "Indicates if at least one feature is disabled in at least one space. This is a signal that space-level feature controls are in use. This does not account for role-based (security) feature controls." + } }, "disabledFeatures": { "properties": { "DYNAMIC_KEY": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } }, "stackAlerts": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } }, "actions": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } }, "enterpriseSearch": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } }, "fleet": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } }, "savedObjectsTagging": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } }, "indexPatterns": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } }, "discover": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } }, "canvas": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } }, "maps": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } }, "siem": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } }, "monitoring": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } }, "graph": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } }, "uptime": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } }, "savedObjectsManagement": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } }, "timelion": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } }, "dev_tools": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } }, "advancedSettings": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } }, "infrastructure": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } }, "visualize": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } }, "logs": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } }, "dashboard": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } }, "ml": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } }, "apm": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces which have this feature disabled." + } } } }, "available": { - "type": "boolean" + "type": "boolean", + "_meta": { + "description": "Indicates if the spaces feature is available in this installation." + } }, "enabled": { - "type": "boolean" + "type": "boolean", + "_meta": { + "description": "Indicates if the spaces feature is enabled in this installation." + } }, "count": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of spaces in this installation." + } }, "apiCalls.copySavedObjects.total": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of times the \"Copy Saved Objects\" API has been called." + } }, "apiCalls.copySavedObjects.kibanaRequest.yes": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of times the \"Copy Saved Objects\" API has been called via the Kibana client." + } }, "apiCalls.copySavedObjects.kibanaRequest.no": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of times the \"Copy Saved Objects\" API has been called via an API consumer (e.g. curl)." + } }, "apiCalls.copySavedObjects.createNewCopiesEnabled.yes": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of times the \"Copy Saved Objects\" API has been called with \"createNewCopies\" set to true." + } }, "apiCalls.copySavedObjects.createNewCopiesEnabled.no": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of times the \"Copy Saved Objects\" API has been called with \"createNewCopies\" set to false." + } }, "apiCalls.copySavedObjects.overwriteEnabled.yes": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of times the \"Copy Saved Objects\" API has been called with \"overwrite\" set to true." + } }, "apiCalls.copySavedObjects.overwriteEnabled.no": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of times the \"Copy Saved Objects\" API has been called with \"overwrite\" set to false." + } }, "apiCalls.resolveCopySavedObjectsErrors.total": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of times the \"Resolve Copy Saved Objects Errors\" API has been called." + } }, "apiCalls.resolveCopySavedObjectsErrors.kibanaRequest.yes": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of times the \"Resolve Copy Saved Objects Errors\" API has been called via the Kibana client." + } }, "apiCalls.resolveCopySavedObjectsErrors.kibanaRequest.no": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of times the \"Resolve Copy Saved Objects Errors\" API has been called via an API consumer (e.g. curl)." + } }, "apiCalls.resolveCopySavedObjectsErrors.createNewCopiesEnabled.yes": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of times the \"Resolve Copy Saved Objects Errors\" API has been called with \"createNewCopies\" set to true." + } }, "apiCalls.resolveCopySavedObjectsErrors.createNewCopiesEnabled.no": { - "type": "long" + "type": "long", + "_meta": { + "description": "The number of times the \"Resolve Copy Saved Objects Errors\" API has been called with \"createNewCopies\" set to false." + } } } }, diff --git a/x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_stats_with_xpack.ts b/x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_stats_with_xpack.ts index 32e59e01b123d5..30bcd19007c0d5 100644 --- a/x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_stats_with_xpack.ts +++ b/x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_stats_with_xpack.ts @@ -9,6 +9,7 @@ import { StatsGetter } from 'src/plugins/telemetry_collection_manager/server'; import { TelemetryLocalStats, getLocalStats } from '../../../../../src/plugins/telemetry/server'; import { getXPackUsage } from './get_xpack'; import { ESLicense, getLicenseFromLocalOrMaster } from './get_license'; +import { isClusterOptedIn } from './is_cluster_opted_in'; export type TelemetryAggregatedStats = TelemetryLocalStats & { stack_stats: { xpack?: object }; @@ -48,6 +49,10 @@ export const getStatsWithXpack: StatsGetter = async fu if (monitoringTelemetry) { delete stats.stack_stats.kibana!.plugins.monitoringTelemetry; } - return [...acc, stats, ...(monitoringTelemetry || [])]; + + // From the monitoring-sourced telemetry, we need to filter out the clusters that are opted-out. + const onlyOptedInMonitoringClusters = (monitoringTelemetry || []).filter(isClusterOptedIn); + + return [...acc, stats, ...onlyOptedInMonitoringClusters]; }, [] as TelemetryAggregatedStats[]); }; diff --git a/src/plugins/telemetry_collection_manager/server/util.test.ts b/x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/is_cluster_opted_in.test.ts similarity index 69% rename from src/plugins/telemetry_collection_manager/server/util.test.ts rename to x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/is_cluster_opted_in.test.ts index 12e67c466d4d55..5fa7584879f077 100644 --- a/src/plugins/telemetry_collection_manager/server/util.test.ts +++ b/x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/is_cluster_opted_in.test.ts @@ -1,12 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ -import { isClusterOptedIn } from './util'; +import { isClusterOptedIn } from './is_cluster_opted_in'; const createMockClusterUsage = (plugins: any) => { return { @@ -32,9 +31,9 @@ describe('isClusterOptedIn', () => { const result = isClusterOptedIn(mockClusterUsage); expect(result).toBe(false); }); - it('returns false if cluster stats is malformed', () => { - expect(isClusterOptedIn(createMockClusterUsage({}))).toBe(false); - expect(isClusterOptedIn({})).toBe(false); - expect(isClusterOptedIn(undefined)).toBe(false); + it('returns true if kibana.plugins.telemetry does not exist', () => { + expect(isClusterOptedIn(createMockClusterUsage({}))).toBe(true); + expect(isClusterOptedIn({})).toBe(true); + expect(isClusterOptedIn(undefined)).toBe(true); }); }); diff --git a/x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/is_cluster_opted_in.ts b/x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/is_cluster_opted_in.ts new file mode 100644 index 00000000000000..4bc35a238152b5 --- /dev/null +++ b/x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/is_cluster_opted_in.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const isClusterOptedIn = (clusterUsage: any): boolean => { + return ( + clusterUsage?.stack_stats?.kibana?.plugins?.telemetry?.opt_in_status === true || + // If stack_stats.kibana.plugins.telemetry does not exist, assume opted-in for BWC + !clusterUsage?.stack_stats?.kibana?.plugins?.telemetry + ); +}; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/advanced_runtime_mappings_editor/advanced_runtime_mappings_editor.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/advanced_runtime_mappings_editor/advanced_runtime_mappings_editor.tsx index bd37410518176b..1e8397a4d9cc34 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/advanced_runtime_mappings_editor/advanced_runtime_mappings_editor.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/advanced_runtime_mappings_editor/advanced_runtime_mappings_editor.tsx @@ -44,8 +44,11 @@ export const AdvancedRuntimeMappingsEditor: FC = (props) = } = props.pivotConfig; const applyChanges = () => { - const nextConfig = JSON.parse(advancedRuntimeMappingsConfig); + const nextConfig = + advancedRuntimeMappingsConfig === '' ? {} : JSON.parse(advancedRuntimeMappingsConfig); const previousConfig = runtimeMappings; applyRuntimeMappingsEditorChanges(); diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_advanced_runtime_mappings_editor.ts b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_advanced_runtime_mappings_editor.ts index 9bb5f91ae03c79..948c520def1952 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_advanced_runtime_mappings_editor.ts +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_advanced_runtime_mappings_editor.ts @@ -52,7 +52,8 @@ export const useAdvancedRuntimeMappingsEditor = (defaults: StepDefineExposedStat } = useXJsonMode(stringifiedRuntimeMappings ?? ''); const applyRuntimeMappingsEditorChanges = () => { - const parsedRuntimeMappings = JSON.parse(advancedRuntimeMappingsConfig); + const parsedRuntimeMappings = + advancedRuntimeMappingsConfig === '' ? {} : JSON.parse(advancedRuntimeMappingsConfig); const prettySourceConfig = JSON.stringify(parsedRuntimeMappings, null, 2); setRuntimeMappingsUpdated(true); setRuntimeMappings(parsedRuntimeMappings); diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index ad3cf86081e156..9b7a25ff62661d 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -7609,7 +7609,6 @@ "xpack.enterpriseSearch.appSearch.result.documentDetailLink": "ドキュメントの詳細を表示", "xpack.enterpriseSearch.appSearch.result.hideAdditionalFields": "追加フィールドを非表示", "xpack.enterpriseSearch.appSearch.result.title": "ドキュメント{id}", - "xpack.enterpriseSearch.appSearch.roleMappings.title": "ロールマッピング", "xpack.enterpriseSearch.appSearch.settings.logRetention.analytics.label": "分析ログ", "xpack.enterpriseSearch.appSearch.settings.logRetention.api.label": "API ログ", "xpack.enterpriseSearch.appSearch.settings.logRetention.description": "API ログと分析のデフォルト書き込み設定を管理します。", @@ -11019,9 +11018,7 @@ "xpack.infra.metricsHeaderAddDataButtonLabel": "データの追加", "xpack.infra.missingEmebeddableFactoryCallout": "{embeddableType}埋め込み可能な項目がありません。これは、埋め込み可能プラグインが有効でない場合に、発生することがあります。", "xpack.infra.ml.anomalyDetectionButton": "異常検知", - "xpack.infra.ml.anomalyFlyout.anomaliesTabLabel": "異常を表示", "xpack.infra.ml.anomalyFlyout.create.createButton": "有効にする", - "xpack.infra.ml.anomalyFlyout.create.description": "異常検知は機械学習によって実現されています。次のリソースタイプでは、機械学習ジョブを使用できます。このようなジョブを有効にすると、インフラストラクチャメトリックで異常の検出を開始します。", "xpack.infra.ml.anomalyFlyout.create.hostDescription": "ホストのメモリー使用状況とネットワークトラフィックの異常を検出します。", "xpack.infra.ml.anomalyFlyout.create.hostSuccessTitle": "ホスト", "xpack.infra.ml.anomalyFlyout.create.hostTitle": "ホスト", @@ -12098,7 +12095,6 @@ "xpack.lens.indexPattern.terms.otherLabel": "その他", "xpack.lens.indexPattern.terms.size": "値の数", "xpack.lens.indexPattern.termsOf": "{name} のトップの値", - "xpack.lens.indexPattern.timeScale.advancedSettings": "高度なオプションを追加", "xpack.lens.indexPattern.timeScale.enableTimeScale": "単位で正規化", "xpack.lens.indexPattern.timeScale.label": "単位で正規化", "xpack.lens.indexPattern.timeScale.tooltip": "基本の日付間隔に関係なく、常に指定された時間単位のレートとして表示されるように値を正規化します。", @@ -19612,12 +19608,10 @@ "xpack.securitySolution.endpoint.policy.details.eventCollectionsEnabled": "{selected} / {total} 件のイベント収集が有効です", "xpack.securitySolution.endpoint.policy.details.lockedCard": "ランサムウェア保護をオンにするには、ライセンスをプラチナに更新するか、30日間の無料トライアルを開始するか、AWS、GCP、またはAzureで{cloudDeploymentLink}にサインアップしてください。", "xpack.securitySolution.endpoint.policy.details.malware": "マルウェア", - "xpack.securitySolution.endpoint.policy.details.malwareProtectionsEnabled": "マルウェア保護{mode, select, true {有効} false {無効}}", "xpack.securitySolution.endpoint.policy.details.platinum": "プラチナ", "xpack.securitySolution.endpoint.policy.details.prevent": "防御", "xpack.securitySolution.endpoint.policy.details.protections": "保護", "xpack.securitySolution.endpoint.policy.details.ransomware": "ランサムウェア", - "xpack.securitySolution.endpoint.policy.details.ransomwareProtectionsEnabled": "ランサムウェア保護{mode, select, true {有効} false {無効}}", "xpack.securitySolution.endpoint.policy.details.save": "保存", "xpack.securitySolution.endpoint.policy.details.settings": "設定", "xpack.securitySolution.endpoint.policy.details.updateConfirm.cancelButtonTitle": "キャンセル", @@ -19629,15 +19623,11 @@ "xpack.securitySolution.endpoint.policy.details.updateSuccessMessage": "統合{name}が更新されました。", "xpack.securitySolution.endpoint.policy.details.updateSuccessTitle": "成功!", "xpack.securitySolution.endpoint.policy.details.upgradeToPlatinum": "Elastic Platinum へのアップグレード", - "xpack.securitySolution.endpoint.policyDetail.malware.notifyUser": "ユーザーに通知", - "xpack.securitySolution.endpoint.policyDetail.ransomware.notifyUser": "ユーザーに通知", "xpack.securitySolution.endpoint.policyDetailOS": "オペレーティングシステム", "xpack.securitySolution.endpoint.policyDetails.agentsSummary.errorTitle": "エラー", "xpack.securitySolution.endpoint.policyDetails.agentsSummary.offlineTitle": "オフライン", "xpack.securitySolution.endpoint.policyDetails.agentsSummary.onlineTitle": "オンライン", "xpack.securitySolution.endpoint.policyDetails.agentsSummary.totalTitle": "エンドポイント", - "xpack.securitySolution.endpoint.policyDetails.malware.userNotification.placeholder": "カスタム通知メッセージを入力", - "xpack.securitySolution.endpoint.policyDetails.ransomware.userNotification.placeholder": "カスタム通知メッセージを入力", "xpack.securitySolution.endpoint.policyDetails.supportedVersion": "エージェントバージョン {version}", "xpack.securitySolution.endpoint.policyDetailsConfig.customizeUserNotification": "通知メッセージをカスタマイズ", "xpack.securitySolution.endpoint.policyDetailsConfig.eventingEvents": "イベント", @@ -19647,11 +19637,7 @@ "xpack.securitySolution.endpoint.policyDetailsConfig.mac.events.file": "ファイル", "xpack.securitySolution.endpoint.policyDetailsConfig.mac.events.network": "ネットワーク", "xpack.securitySolution.endpoint.policyDetailsConfig.mac.events.process": "プロセス", - "xpack.securitySolution.endpoint.policyDetailsConfig.malware.notifyUserTooltip.a": "ユーザー通知オプションを選択すると、マルウェアが防御または検出されたときに、ホストユーザーに通知を表示します。", - "xpack.securitySolution.endpoint.policyDetailsConfig.malware.notifyUserTooltip.b": " ユーザー通知は、以下のテキストボックスでカスタマイズできます。括弧内のタグを使用すると、該当するアクション (防御または検出など) とファイル名を動的に入力できます。", "xpack.securitySolution.endpoint.policyDetailsConfig.protectionLevel": "保護レベル", - "xpack.securitySolution.endpoint.policyDetailsConfig.ransomware.notifyUserTooltip.a": "ユーザー通知オプションを選択すると、ランサムウェアが防御または検出されたときに、ホストユーザーに通知を表示します。", - "xpack.securitySolution.endpoint.policyDetailsConfig.ransomware.notifyUserTooltip.b": " ユーザー通知は、以下のテキストボックスでカスタマイズできます。括弧内のタグを使用すると、該当するアクション (防御または検出など) とファイル名を動的に入力できます。", "xpack.securitySolution.endpoint.policyDetailsConfig.userNotification": "ユーザー通知", "xpack.securitySolution.endpoint.policyDetailsConfig.windows.events.dllDriverLoad": "DLL とドライバーの読み込み", "xpack.securitySolution.endpoint.policyDetailsConfig.windows.events.dns": "DNS", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index babbccfab4ddec..7bb27ee6626b8d 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -7676,7 +7676,6 @@ "xpack.enterpriseSearch.appSearch.result.hideAdditionalFields": "隐藏其他字段", "xpack.enterpriseSearch.appSearch.result.showAdditionalFields": "显示其他 {numberOfAdditionalFields, number} 个{numberOfAdditionalFields, plural, other {字段}}", "xpack.enterpriseSearch.appSearch.result.title": "文档 {id}", - "xpack.enterpriseSearch.appSearch.roleMappings.title": "角色映射", "xpack.enterpriseSearch.appSearch.settings.logRetention.analytics.label": "分析日志", "xpack.enterpriseSearch.appSearch.settings.logRetention.api.label": "API 日志", "xpack.enterpriseSearch.appSearch.settings.logRetention.description": "管理 API 日志和分析的默认写入设置。", @@ -11169,9 +11168,7 @@ "xpack.infra.metricsHeaderAddDataButtonLabel": "添加数据", "xpack.infra.missingEmebeddableFactoryCallout": "{embeddableType} 可嵌入对象不可用。如果可嵌入插件未启用,便可能会发生此问题。", "xpack.infra.ml.anomalyDetectionButton": "异常检测", - "xpack.infra.ml.anomalyFlyout.anomaliesTabLabel": "查看异常", "xpack.infra.ml.anomalyFlyout.create.createButton": "启用", - "xpack.infra.ml.anomalyFlyout.create.description": "异常检测由 Machine Learning 提供支持。Machine Learning 作业适用于以下资源类型。启用这些作业以开始检测基础架构指标中的异常。", "xpack.infra.ml.anomalyFlyout.create.hostDescription": "检测主机上的内存使用情况和网络流量异常。", "xpack.infra.ml.anomalyFlyout.create.hostSuccessTitle": "主机", "xpack.infra.ml.anomalyFlyout.create.hostTitle": "主机", @@ -12256,7 +12253,6 @@ "xpack.lens.indexPattern.terms.otherLabel": "其他", "xpack.lens.indexPattern.terms.size": "值数目", "xpack.lens.indexPattern.termsOf": "{name} 排名最前值", - "xpack.lens.indexPattern.timeScale.advancedSettings": "添加高级选项", "xpack.lens.indexPattern.timeScale.enableTimeScale": "按单位标准化", "xpack.lens.indexPattern.timeScale.label": "按单位标准化", "xpack.lens.indexPattern.timeScale.tooltip": "将值标准化为始终显示为每指定时间单位速率,无论基础日期时间间隔是多少。", @@ -19903,12 +19899,10 @@ "xpack.securitySolution.endpoint.policy.details.eventCollectionsEnabled": "{selected} / {total} 个事件收集已启用", "xpack.securitySolution.endpoint.policy.details.lockedCard": "要打开勒索软件防护,必须将您的许可证升级到白金级、开始 30 天免费试用或在 AWS、GCP 或 Azure 中实施{cloudDeploymentLink}。", "xpack.securitySolution.endpoint.policy.details.malware": "恶意软件", - "xpack.securitySolution.endpoint.policy.details.malwareProtectionsEnabled": "恶意软件防护{mode, select, true {已启用} false {已禁用}}", "xpack.securitySolution.endpoint.policy.details.platinum": "白金级", "xpack.securitySolution.endpoint.policy.details.prevent": "防御", "xpack.securitySolution.endpoint.policy.details.protections": "防护", "xpack.securitySolution.endpoint.policy.details.ransomware": "勒索软件", - "xpack.securitySolution.endpoint.policy.details.ransomwareProtectionsEnabled": "勒索软件防护{mode, select, true {已启用} false {已禁用}}", "xpack.securitySolution.endpoint.policy.details.save": "保存", "xpack.securitySolution.endpoint.policy.details.settings": "设置", "xpack.securitySolution.endpoint.policy.details.updateConfirm.cancelButtonTitle": "取消", @@ -19921,15 +19915,11 @@ "xpack.securitySolution.endpoint.policy.details.updateSuccessMessage": "集成 {name} 已更新。", "xpack.securitySolution.endpoint.policy.details.updateSuccessTitle": "成功!", "xpack.securitySolution.endpoint.policy.details.upgradeToPlatinum": "升级到 Elastic 白金级", - "xpack.securitySolution.endpoint.policyDetail.malware.notifyUser": "通知用户", - "xpack.securitySolution.endpoint.policyDetail.ransomware.notifyUser": "通知用户", "xpack.securitySolution.endpoint.policyDetailOS": "操作系统", "xpack.securitySolution.endpoint.policyDetails.agentsSummary.errorTitle": "错误", "xpack.securitySolution.endpoint.policyDetails.agentsSummary.offlineTitle": "脱机", "xpack.securitySolution.endpoint.policyDetails.agentsSummary.onlineTitle": "联机", "xpack.securitySolution.endpoint.policyDetails.agentsSummary.totalTitle": "终端", - "xpack.securitySolution.endpoint.policyDetails.malware.userNotification.placeholder": "输入您的定制通知消息", - "xpack.securitySolution.endpoint.policyDetails.ransomware.userNotification.placeholder": "输入您的定制通知消息", "xpack.securitySolution.endpoint.policyDetails.supportedVersion": "代理版本 {version}", "xpack.securitySolution.endpoint.policyDetailsConfig.customizeUserNotification": "定制通知消息", "xpack.securitySolution.endpoint.policyDetailsConfig.eventingEvents": "事件", @@ -19939,11 +19929,7 @@ "xpack.securitySolution.endpoint.policyDetailsConfig.mac.events.file": "文件", "xpack.securitySolution.endpoint.policyDetailsConfig.mac.events.network": "网络", "xpack.securitySolution.endpoint.policyDetailsConfig.mac.events.process": "进程", - "xpack.securitySolution.endpoint.policyDetailsConfig.malware.notifyUserTooltip.a": "选择用户通知选项后,在阻止或检测到恶意软件时将向主机用户显示通知。", - "xpack.securitySolution.endpoint.policyDetailsConfig.malware.notifyUserTooltip.b": " 可在下方文本框中定制用户通知。括号中的标签可用于动态填充适用操作 (如已阻止或已检测) 和文件名。", "xpack.securitySolution.endpoint.policyDetailsConfig.protectionLevel": "防护级别", - "xpack.securitySolution.endpoint.policyDetailsConfig.ransomware.notifyUserTooltip.a": "选择用户通知选项后,在阻止或检测到勒索软件时将向主机用户显示通知。", - "xpack.securitySolution.endpoint.policyDetailsConfig.ransomware.notifyUserTooltip.b": " 可在下方文本框中定制用户通知。括号中的标签可用于动态填充适用操作 (如已阻止或已检测) 和文件名。", "xpack.securitySolution.endpoint.policyDetailsConfig.userNotification": "用户通知", "xpack.securitySolution.endpoint.policyDetailsConfig.windows.events.dllDriverLoad": "DLL 和驱动程序加载", "xpack.securitySolution.endpoint.policyDetailsConfig.windows.events.dns": "DNS", diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/_index.scss b/x-pack/plugins/upgrade_assistant/public/application/components/_index.scss index bb01107f334f65..8f900ca8dc055b 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/_index.scss +++ b/x-pack/plugins/upgrade_assistant/public/application/components/_index.scss @@ -1,2 +1,2 @@ -@import 'tabs/checkup/index'; -@import 'tabs/overview/index'; +@import 'es_deprecations/index'; +@import 'overview/index'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/__fixtures__/checkup_api_response.json b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/__fixtures__/checkup_api_response.json similarity index 100% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/__fixtures__/checkup_api_response.json rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/__fixtures__/checkup_api_response.json diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/__snapshots__/filter_bar.test.tsx.snap b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/__snapshots__/filter_bar.test.tsx.snap similarity index 100% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/__snapshots__/filter_bar.test.tsx.snap rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/__snapshots__/filter_bar.test.tsx.snap diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/__snapshots__/group_by_bar.test.tsx.snap b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/__snapshots__/group_by_bar.test.tsx.snap similarity index 100% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/__snapshots__/group_by_bar.test.tsx.snap rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/__snapshots__/group_by_bar.test.tsx.snap diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/_index.scss b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/_index.scss similarity index 100% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/_index.scss rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/_index.scss diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/constants.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/constants.tsx similarity index 70% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/constants.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/constants.tsx index a3e9ae783e8123..feff6010efe38b 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/constants.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/constants.tsx @@ -7,16 +7,18 @@ import { IconColor } from '@elastic/eui'; import { invert } from 'lodash'; -import { DeprecationInfo } from '../../../../../common/types'; +import { DeprecationInfo } from '../../../../common/types'; export const LEVEL_MAP: { [level: string]: number } = { warning: 0, critical: 1, }; -export const REVERSE_LEVEL_MAP: { [idx: number]: DeprecationInfo['level'] } = invert( - LEVEL_MAP -) as any; +interface ReverseLevelMap { + [idx: number]: DeprecationInfo['level']; +} + +export const REVERSE_LEVEL_MAP: ReverseLevelMap = invert(LEVEL_MAP) as ReverseLevelMap; export const COLOR_MAP: { [level: string]: IconColor } = { warning: 'default', diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/controls.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/controls.tsx similarity index 95% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/controls.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/controls.tsx index 578e9344659c27..7212c2db4c6b49 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/controls.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/controls.tsx @@ -9,13 +9,12 @@ import React, { FunctionComponent, useState } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiButton, EuiFieldSearch, EuiFlexGroup, EuiFlexItem, EuiCallOut } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; -import { DeprecationInfo } from '../../../../../common/types'; -import { GroupByOption, LevelFilterOption } from '../../types'; +import { DeprecationInfo } from '../../../../common/types'; +import { validateRegExpString } from '../../lib/utils'; +import { GroupByOption, LevelFilterOption } from '../types'; import { FilterBar } from './filter_bar'; import { GroupByBar } from './group_by_bar'; -import { validateRegExpString } from '../../../utils'; - interface CheckupControlsProps { allDeprecations?: DeprecationInfo[]; isLoading: boolean; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/checkup_tab.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_tab.tsx similarity index 97% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/checkup_tab.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_tab.tsx index 3c4c747529915d..a5ae341f1e4248 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/checkup_tab.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_tab.tsx @@ -19,9 +19,9 @@ import { } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; -import { LoadingErrorBanner } from '../../error_banner'; -import { useAppContext } from '../../../app_context'; -import { GroupByOption, LevelFilterOption, UpgradeAssistantTabProps } from '../../types'; +import { LoadingErrorBanner } from '../error_banner'; +import { useAppContext } from '../../app_context'; +import { GroupByOption, LevelFilterOption, UpgradeAssistantTabProps } from '../types'; import { CheckupControls } from './controls'; import { GroupedDeprecations } from './deprecations/grouped'; @@ -34,7 +34,7 @@ export interface CheckupTabProps extends UpgradeAssistantTabProps { * Displays a list of deprecations that filterable and groupable. Can be used for cluster, * nodes, or indices checkups. */ -export const CheckupTab: FunctionComponent = ({ +export const DeprecationTab: FunctionComponent = ({ alertBanner, checkupLabel, deprecations, diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/_cell.scss b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/_cell.scss similarity index 100% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/_cell.scss rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/_cell.scss diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/_deprecations.scss b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/_deprecations.scss similarity index 100% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/_deprecations.scss rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/_deprecations.scss diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/_index.scss b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/_index.scss similarity index 100% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/_index.scss rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/_index.scss diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/cell.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/cell.tsx similarity index 95% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/cell.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/cell.tsx index 890f7e63c9904a..5f960bd09d2865 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/cell.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/cell.tsx @@ -17,9 +17,9 @@ import { EuiTitle, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; +import { EnrichedDeprecationInfo } from '../../../../../common/types'; +import { AppContext } from '../../../app_context'; import { ReindexButton } from './reindex'; -import { AppContext } from '../../../../app_context'; -import { EnrichedDeprecationInfo } from '../../../../../../common/types'; import { FixIndexSettingsButton } from './index_settings'; interface DeprecationCellProps { diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/count_summary.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/count_summary.tsx similarity index 95% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/count_summary.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/count_summary.tsx index 872e508494ed7a..db176ba43d8edb 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/count_summary.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/count_summary.tsx @@ -10,7 +10,7 @@ import React, { Fragment, FunctionComponent } from 'react'; import { EuiText } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; -import { EnrichedDeprecationInfo } from '../../../../../../common/types'; +import { EnrichedDeprecationInfo } from '../../../../../common/types'; export const DeprecationCountSummary: FunctionComponent<{ deprecations: EnrichedDeprecationInfo[]; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/grouped.test.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/grouped.test.tsx similarity index 98% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/grouped.test.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/grouped.test.tsx index 0885286961b115..00059fe0456ce0 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/grouped.test.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/grouped.test.tsx @@ -10,8 +10,8 @@ import React from 'react'; import { mountWithIntl, shallowWithIntl } from '@kbn/test/jest'; import { EuiBadge, EuiPagination } from '@elastic/eui'; -import { DeprecationInfo, EnrichedDeprecationInfo } from '../../../../../../common/types'; -import { GroupByOption, LevelFilterOption } from '../../../types'; +import { DeprecationInfo, EnrichedDeprecationInfo } from '../../../../../common/types'; +import { GroupByOption, LevelFilterOption } from '../../types'; import { DeprecationAccordion, filterDeps, GroupedDeprecations } from './grouped'; describe('filterDeps', () => { diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/grouped.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/grouped.tsx similarity index 98% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/grouped.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/grouped.tsx index 3c18d6fe8a6090..9879b977f1cfde 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/grouped.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/grouped.tsx @@ -19,8 +19,8 @@ import { } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; -import { DeprecationInfo, EnrichedDeprecationInfo } from '../../../../../../common/types'; -import { GroupByOption, LevelFilterOption } from '../../../types'; +import { DeprecationInfo, EnrichedDeprecationInfo } from '../../../../../common/types'; +import { GroupByOption, LevelFilterOption } from '../../types'; import { DeprecationCountSummary } from './count_summary'; import { DeprecationHealth } from './health'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/health.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/health.tsx similarity index 97% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/health.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/health.tsx index d7e62684c45705..c489824b1059dd 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/health.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/health.tsx @@ -11,7 +11,7 @@ import React, { FunctionComponent } from 'react'; import { EuiBadge, EuiToolTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { DeprecationInfo } from '../../../../../../common/types'; +import { DeprecationInfo } from '../../../../../common/types'; import { COLOR_MAP, LEVEL_MAP, REVERSE_LEVEL_MAP } from '../constants'; const LocalizedLevels: { [level: string]: string } = { diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/index.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/index.tsx similarity index 100% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/index.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/index.tsx diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/index_settings/button.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/index_settings/button.tsx similarity index 100% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/index_settings/button.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/index_settings/button.tsx diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/index_settings/index.ts b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/index_settings/index.ts similarity index 100% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/index_settings/index.ts rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/index_settings/index.ts diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/index_settings/remove_settings_provider.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/index_settings/remove_settings_provider.tsx similarity index 98% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/index_settings/remove_settings_provider.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/index_settings/remove_settings_provider.tsx index e344d300be06c4..1fd0c79dbbef37 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/index_settings/remove_settings_provider.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/index_settings/remove_settings_provider.tsx @@ -8,7 +8,7 @@ import React, { useState, useRef } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiCode, EuiConfirmModal } from '@elastic/eui'; -import { useAppContext } from '../../../../../app_context'; +import { useAppContext } from '../../../../app_context'; interface Props { children: ( diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/index_table.test.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/index_table.test.tsx similarity index 100% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/index_table.test.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/index_table.test.tsx diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/index_table.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/index_table.tsx similarity index 97% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/index_table.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/index_table.tsx index da2f5f04effc4d..216884d547eebb 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/index_table.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/index_table.tsx @@ -10,9 +10,9 @@ import React from 'react'; import { EuiBasicTable } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { EnrichedDeprecationInfo } from '../../../../../common/types'; +import { AppContext } from '../../../app_context'; import { ReindexButton } from './reindex'; -import { AppContext } from '../../../../app_context'; -import { EnrichedDeprecationInfo } from '../../../../../../common/types'; import { FixIndexSettingsButton } from './index_settings'; const PAGE_SIZES = [10, 25, 50, 100, 250, 500, 1000]; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/list.test.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/list.test.tsx similarity index 96% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/list.test.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/list.test.tsx index 1d646442ebee04..c1b6357d504eb7 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/list.test.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/list.test.tsx @@ -8,8 +8,8 @@ import { shallow } from 'enzyme'; import React from 'react'; -import { EnrichedDeprecationInfo } from '../../../../../../common/types'; -import { GroupByOption } from '../../../types'; +import { EnrichedDeprecationInfo } from '../../../../../common/types'; +import { GroupByOption } from '../../types'; import { DeprecationList } from './list'; describe('DeprecationList', () => { diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/list.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/list.tsx similarity index 98% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/list.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/list.tsx index eb9012b3bddd13..65b878fe36a869 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/list.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/list.tsx @@ -7,8 +7,8 @@ import React, { FunctionComponent } from 'react'; -import { DeprecationInfo, EnrichedDeprecationInfo } from '../../../../../../common/types'; -import { GroupByOption } from '../../../types'; +import { DeprecationInfo, EnrichedDeprecationInfo } from '../../../../../common/types'; +import { GroupByOption } from '../../types'; import { COLOR_MAP, LEVEL_MAP } from '../constants'; import { DeprecationCell } from './cell'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/_button.scss b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/_button.scss similarity index 100% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/_button.scss rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/_button.scss diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/_index.scss b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/_index.scss similarity index 100% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/_index.scss rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/_index.scss diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/button.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/button.tsx similarity index 97% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/button.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/button.tsx index 98c22308d9373c..34c1328459cdb7 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/button.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/button.tsx @@ -13,13 +13,13 @@ import { Subscription } from 'rxjs'; import { EuiButton, EuiLoadingSpinner, EuiText, EuiToolTip } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { DocLinksStart, HttpSetup } from 'src/core/public'; -import { API_BASE_PATH } from '../../../../../../../common/constants'; +import { API_BASE_PATH } from '../../../../../../common/constants'; import { EnrichedDeprecationInfo, ReindexStatus, UIReindexOption, -} from '../../../../../../../common/types'; -import { LoadingState } from '../../../../types'; +} from '../../../../../../common/types'; +import { LoadingState } from '../../../types'; import { ReindexFlyout } from './flyout'; import { ReindexPollingService, ReindexState } from './polling_service'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/__snapshots__/checklist_step.test.tsx.snap b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/__snapshots__/checklist_step.test.tsx.snap similarity index 100% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/__snapshots__/checklist_step.test.tsx.snap rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/__snapshots__/checklist_step.test.tsx.snap diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/__snapshots__/warning_step.test.tsx.snap b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/__snapshots__/warning_step.test.tsx.snap similarity index 100% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/__snapshots__/warning_step.test.tsx.snap rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/__snapshots__/warning_step.test.tsx.snap diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/_index.scss b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/_index.scss similarity index 100% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/_index.scss rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/_index.scss diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/_step_progress.scss b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/_step_progress.scss similarity index 100% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/_step_progress.scss rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/_step_progress.scss diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/checklist_step.test.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/checklist_step.test.tsx similarity index 94% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/checklist_step.test.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/checklist_step.test.tsx index 5bea0d855e45e4..f8d72addc2d188 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/checklist_step.test.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/checklist_step.test.tsx @@ -9,8 +9,8 @@ import { shallow } from 'enzyme'; import { cloneDeep } from 'lodash'; import React from 'react'; -import { ReindexStatus } from '../../../../../../../../common/types'; -import { LoadingState } from '../../../../../types'; +import { ReindexStatus } from '../../../../../../../common/types'; +import { LoadingState } from '../../../../types'; import { ReindexState } from '../polling_service'; import { ChecklistFlyoutStep } from './checklist_step'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/checklist_step.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/checklist_step.tsx similarity index 97% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/checklist_step.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/checklist_step.tsx index fc4bdcc130e25d..e852171a696b4b 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/checklist_step.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/checklist_step.tsx @@ -20,8 +20,8 @@ import { } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; -import { ReindexStatus } from '../../../../../../../../common/types'; -import { LoadingState } from '../../../../../types'; +import { ReindexStatus } from '../../../../../../../common/types'; +import { LoadingState } from '../../../../types'; import { ReindexState } from '../polling_service'; import { ReindexProgress } from './progress'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/container.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/container.tsx similarity index 99% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/container.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/container.tsx index 2f776f3937b502..3e7b931452566e 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/container.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/container.tsx @@ -19,7 +19,7 @@ import { EuiTitle, } from '@elastic/eui'; -import { EnrichedDeprecationInfo, ReindexStatus } from '../../../../../../../../common/types'; +import { EnrichedDeprecationInfo, ReindexStatus } from '../../../../../../../common/types'; import { ReindexState } from '../polling_service'; import { ChecklistFlyoutStep } from './checklist_step'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/index.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/index.tsx similarity index 100% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/index.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/index.tsx diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/progress.test.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/progress.test.tsx similarity index 99% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/progress.test.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/progress.test.tsx index 690775efb9d12e..24a00af7a9fee3 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/progress.test.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/progress.test.tsx @@ -8,7 +8,7 @@ import { shallow } from 'enzyme'; import React from 'react'; -import { IndexGroup, ReindexStatus, ReindexStep } from '../../../../../../../../common/types'; +import { IndexGroup, ReindexStatus, ReindexStep } from '../../../../../../../common/types'; import { ReindexState } from '../polling_service'; import { ReindexProgress } from './progress'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/progress.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/progress.tsx similarity index 99% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/progress.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/progress.tsx index 5d10111f3ae5e6..088266f3a48406 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/progress.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/progress.tsx @@ -17,8 +17,8 @@ import { } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; -import { IndexGroup, ReindexStatus, ReindexStep } from '../../../../../../../../common/types'; -import { LoadingState } from '../../../../../types'; +import { IndexGroup, ReindexStatus, ReindexStep } from '../../../../../../../common/types'; +import { LoadingState } from '../../../../types'; import { ReindexState } from '../polling_service'; import { StepProgress, StepProgressStep } from './step_progress'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/step_progress.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/step_progress.tsx similarity index 100% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/step_progress.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/step_progress.tsx diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/warning_step.test.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/warning_step.test.tsx similarity index 88% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/warning_step.test.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/warning_step.test.tsx index ca9c53354bf755..ff11b9f1a8450c 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/warning_step.test.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/warning_step.test.tsx @@ -9,14 +9,14 @@ import { I18nProvider } from '@kbn/i18n/react'; import { mount, shallow } from 'enzyme'; import React from 'react'; -import { ReindexWarning } from '../../../../../../../../common/types'; -import { mockKibanaSemverVersion } from '../../../../../../../../common/constants'; +import { ReindexWarning } from '../../../../../../../common/types'; +import { mockKibanaSemverVersion } from '../../../../../../../common/constants'; import { idForWarning, WarningsFlyoutStep } from './warnings_step'; -jest.mock('../../../../../../app_context', () => { +jest.mock('../../../../../app_context', () => { const { docLinksServiceMock } = jest.requireActual( - '../../../../../../../../../../../src/core/public/doc_links/doc_links_service.mock' + '../../../../../../../../../../src/core/public/doc_links/doc_links_service.mock' ); return { diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/warning_step_checkbox.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/warning_step_checkbox.tsx similarity index 99% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/warning_step_checkbox.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/warning_step_checkbox.tsx index de41108886c002..a5e3260167218a 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/warning_step_checkbox.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/warning_step_checkbox.tsx @@ -19,7 +19,7 @@ import { } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { DocLinksStart } from 'kibana/public'; -import { ReindexWarning, ReindexWarningTypes } from '../../../../../../../../common/types'; +import { ReindexWarning, ReindexWarningTypes } from '../../../../../../../common/types'; export const hasReindexWarning = ( warnings: ReindexWarning[], diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/warnings_step.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/warnings_step.tsx similarity index 97% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/warnings_step.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/warnings_step.tsx index 241884e95c1eba..4415811f6bf38c 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/warnings_step.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/flyout/warnings_step.tsx @@ -19,8 +19,8 @@ import { } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; -import { ReindexWarning, ReindexWarningTypes } from '../../../../../../../../common/types'; -import { useAppContext } from '../../../../../../app_context'; +import { ReindexWarning, ReindexWarningTypes } from '../../../../../../../common/types'; +import { useAppContext } from '../../../../../app_context'; import { CustomTypeNameWarningCheckbox, DeprecatedSettingWarningCheckbox, diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/index.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/index.tsx similarity index 100% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/index.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/index.tsx diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/polling_service.test.ts b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/polling_service.test.ts similarity index 97% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/polling_service.test.ts rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/polling_service.test.ts index e7f56fc1bdf791..13818e864783e6 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/polling_service.test.ts +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/polling_service.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ReindexStatus, ReindexStep } from '../../../../../../../common/types'; +import { ReindexStatus, ReindexStep } from '../../../../../../common/types'; import { ReindexPollingService } from './polling_service'; import { httpServiceMock } from 'src/core/public/mocks'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/polling_service.ts b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/polling_service.ts similarity index 96% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/polling_service.ts rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/polling_service.ts index d6a4a8e7b5a561..239bd56bd2fa53 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/polling_service.ts +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecations/reindex/polling_service.ts @@ -8,15 +8,15 @@ import { BehaviorSubject } from 'rxjs'; import { HttpSetup } from 'src/core/public'; -import { API_BASE_PATH } from '../../../../../../../common/constants'; +import { API_BASE_PATH } from '../../../../../../common/constants'; import { IndexGroup, ReindexOperation, ReindexStatus, ReindexStep, ReindexWarning, -} from '../../../../../../../common/types'; -import { LoadingState } from '../../../../types'; +} from '../../../../../../common/types'; +import { LoadingState } from '../../../types'; const POLL_INTERVAL = 1000; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/filter_bar.test.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/filter_bar.test.tsx similarity index 90% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/filter_bar.test.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/filter_bar.test.tsx index 81e04ac7804220..feac88cf4a5251 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/filter_bar.test.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/filter_bar.test.tsx @@ -7,9 +7,9 @@ import { mount, shallow } from 'enzyme'; import React from 'react'; -import { DeprecationInfo } from '../../../../../common/types'; +import { DeprecationInfo } from '../../../../common/types'; -import { LevelFilterOption } from '../../types'; +import { LevelFilterOption } from '../types'; import { FilterBar } from './filter_bar'; const defaultProps = { diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/filter_bar.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/filter_bar.tsx similarity index 94% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/filter_bar.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/filter_bar.tsx index ffb81832b505dc..7ef3ae2fc93325 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/filter_bar.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/filter_bar.tsx @@ -11,8 +11,8 @@ import React from 'react'; import { EuiFilterButton, EuiFilterGroup, EuiFlexItem } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { DeprecationInfo } from '../../../../../common/types'; -import { LevelFilterOption } from '../../types'; +import { DeprecationInfo } from '../../../../common/types'; +import { LevelFilterOption } from '../types'; const LocalizedOptions: { [option: string]: string } = { all: i18n.translate('xpack.upgradeAssistant.checkupTab.controls.filterBar.allButtonLabel', { diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/group_by_bar.test.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/group_by_bar.test.tsx similarity index 95% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/group_by_bar.test.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/group_by_bar.test.tsx index 825dd9b337e49d..53f76d6d0f9812 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/group_by_bar.test.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/group_by_bar.test.tsx @@ -8,7 +8,7 @@ import { mount, shallow } from 'enzyme'; import React from 'react'; -import { GroupByOption } from '../../types'; +import { GroupByOption } from '../types'; import { GroupByBar } from './group_by_bar'; const defaultProps = { diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/group_by_bar.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/group_by_bar.tsx similarity index 97% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/group_by_bar.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/group_by_bar.tsx index fc3971d4082b91..a80fe664ced2e0 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/group_by_bar.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/group_by_bar.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { EuiFilterButton, EuiFilterGroup, EuiFlexItem } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { GroupByOption } from '../../types'; +import { GroupByOption } from '../types'; const LocalizedOptions: { [option: string]: string } = { message: i18n.translate('xpack.upgradeAssistant.checkupTab.controls.groupByBar.byIssueLabel', { diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/index.ts b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/index.ts new file mode 100644 index 00000000000000..8b7435b94b2c1a --- /dev/null +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/index.ts @@ -0,0 +1,8 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { DeprecationTab } from './deprecation_tab'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/overview/_index.scss b/x-pack/plugins/upgrade_assistant/public/application/components/overview/_index.scss similarity index 100% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/overview/_index.scss rename to x-pack/plugins/upgrade_assistant/public/application/components/overview/_index.scss diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/overview/_steps.scss b/x-pack/plugins/upgrade_assistant/public/application/components/overview/_steps.scss similarity index 100% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/overview/_steps.scss rename to x-pack/plugins/upgrade_assistant/public/application/components/overview/_steps.scss diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/overview/deprecation_logging_toggle.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/overview/deprecation_logging_toggle.tsx similarity index 96% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/overview/deprecation_logging_toggle.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/overview/deprecation_logging_toggle.tsx index b026b17c65f18e..5ed46c25ecf17c 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/overview/deprecation_logging_toggle.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/overview/deprecation_logging_toggle.tsx @@ -10,8 +10,8 @@ import React, { useEffect, useState } from 'react'; import { EuiLoadingSpinner, EuiSwitch } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { useAppContext } from '../../../app_context'; -import { ResponseError } from '../../../lib/api'; +import { useAppContext } from '../../app_context'; +import { ResponseError } from '../../lib/api'; export const DeprecationLoggingToggle: React.FunctionComponent = () => { const { api } = useAppContext(); diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/index.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/overview/index.ts similarity index 85% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/index.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/overview/index.ts index 8c04da8b7843a2..c43c1415f6f7c2 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/index.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/overview/index.ts @@ -5,4 +5,4 @@ * 2.0. */ -export { CheckupTab } from './checkup_tab'; +export { OverviewTab } from './overview'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/overview/index.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/overview/overview.tsx similarity index 91% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/overview/index.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/overview/overview.tsx index 8cd3bbebd78613..01677e7394a872 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/overview/index.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/overview/overview.tsx @@ -18,9 +18,9 @@ import { } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; -import { useAppContext } from '../../../app_context'; -import { LoadingErrorBanner } from '../../error_banner'; -import { UpgradeAssistantTabProps } from '../../types'; +import { useAppContext } from '../../app_context'; +import { LoadingErrorBanner } from '../error_banner'; +import { UpgradeAssistantTabProps } from '../types'; import { Steps } from './steps'; export const OverviewTab: FunctionComponent = (props) => { diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/overview/steps.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/overview/steps.tsx similarity index 99% rename from x-pack/plugins/upgrade_assistant/public/application/components/tabs/overview/steps.tsx rename to x-pack/plugins/upgrade_assistant/public/application/components/overview/steps.tsx index afd04fb02e6dda..095960ae93562d 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/overview/steps.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/overview/steps.tsx @@ -20,9 +20,9 @@ import { import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; -import { UpgradeAssistantTabProps } from '../../types'; +import { useAppContext } from '../../app_context'; +import { UpgradeAssistantTabProps } from '../types'; import { DeprecationLoggingToggle } from './deprecation_logging_toggle'; -import { useAppContext } from '../../../app_context'; // Leaving these here even if unused so they are picked up for i18n static analysis // Keep this until last minor release (when next major is also released). diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/tabs.tsx index 9875b4c5a1a330..231d9705bd0d91 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/tabs.tsx @@ -19,8 +19,8 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { LatestMinorBanner } from './latest_minor_banner'; -import { CheckupTab } from './tabs/checkup'; -import { OverviewTab } from './tabs/overview'; +import { DeprecationTab } from './es_deprecations'; +import { OverviewTab } from './overview'; import { TelemetryState, UpgradeAssistantTabProps } from './types'; import { useAppContext } from '../app_context'; @@ -58,7 +58,7 @@ export const UpgradeAssistantTabs: React.FunctionComponent = () => { defaultMessage: 'Cluster', }), content: ( - { defaultMessage: 'Indices', }), content: ( - { + const esArchiver = getService('esArchiver'); + const supertest = getService('supertestWithoutAuth'); + const ml = getService('ml'); + + const jobId = `fq_datafeed_preview_${Date.now()}`; + + const job = { + job_id: `${jobId}_1`, + description: '', + groups: ['automated', 'farequote'], + analysis_config: { + bucket_span: '30m', + detectors: [{ function: 'distinct_count', field_name: 'airline' }], + influencers: [], + }, + data_description: { time_field: '@timestamp' }, + analysis_limits: { model_memory_limit: '11MB' }, + }; + + function isUpperCase(str: string) { + return /^[A-Z]+$/.test(str); + } + + function isLowerCase(str: string) { + return !/[A-Z]+/.test(str); + } + + describe('Datafeed preview', function () { + before(async () => { + await esArchiver.loadIfNeeded('ml/farequote'); + await ml.testResources.setKibanaTimeZoneToUTC(); + }); + + after(async () => { + await ml.api.cleanMlIndices(); + }); + + it(`should return a normal datafeed preview`, async () => { + const datafeed = { + datafeed_id: '', + job_id: '', + indices: ['ft_farequote'], + query: { + bool: { + must: [ + { + match_all: {}, + }, + ], + }, + }, + runtime_mappings: {}, + }; + + const { body } = await supertest + .post('/api/ml/jobs/datafeed_preview') + .auth(USER.ML_POWERUSER, ml.securityCommon.getPasswordForUser(USER.ML_POWERUSER)) + .set(COMMON_REQUEST_HEADERS) + .send({ job, datafeed }) + .expect(200); + + expect(body.hits.total.value).to.eql(3207, 'Response body total hits should be 3207'); + expect(Array.isArray(body.hits?.hits[0]?.fields?.airline)).to.eql( + true, + 'Response body airlines should be an array' + ); + + const airlines: string[] = body.hits.hits.map((a: any) => a.fields.airline[0]); + expect(airlines.length).to.not.eql(0, 'airlines length should not be 0'); + expect(airlines.every((a) => isUpperCase(a))).to.eql( + true, + 'Response body airlines should all be upper case' + ); + }); + + it(`should return a datafeed preview using custom query`, async () => { + const datafeed = { + datafeed_id: '', + job_id: '', + indices: ['ft_farequote'], + query: { + bool: { + should: [ + { + match: { + airline: 'AAL', + }, + }, + ], + }, + }, + runtime_mappings: {}, + }; + + const { body } = await supertest + .post('/api/ml/jobs/datafeed_preview') + .auth(USER.ML_POWERUSER, ml.securityCommon.getPasswordForUser(USER.ML_POWERUSER)) + .set(COMMON_REQUEST_HEADERS) + .send({ job, datafeed }) + .expect(200); + + expect(body.hits.total.value).to.eql(300, 'Response body total hits should be 300'); + expect(Array.isArray(body.hits?.hits[0]?.fields?.airline)).to.eql( + true, + 'Response body airlines should be an array' + ); + + const airlines: string[] = body.hits.hits.map((a: any) => a.fields.airline[0]); + expect(airlines.length).to.not.eql(0, 'airlines length should not be 0'); + expect(airlines.every((a) => a === 'AAL')).to.eql( + true, + 'Response body airlines should all be AAL' + ); + }); + + it(`should return a datafeed preview using runtime mappings`, async () => { + const datafeed = { + datafeed_id: '', + job_id: '', + indices: ['ft_farequote'], + query: { + bool: { + must: [ + { + match_all: {}, + }, + ], + }, + }, + runtime_mappings: { + lowercase_airline: { + type: 'keyword', + script: { + source: 'emit(params._source.airline.toLowerCase())', + }, + }, + }, + }; + + const { body } = await supertest + .post('/api/ml/jobs/datafeed_preview') + .auth(USER.ML_POWERUSER, ml.securityCommon.getPasswordForUser(USER.ML_POWERUSER)) + .set(COMMON_REQUEST_HEADERS) + .send({ job, datafeed }) + .expect(200); + + expect(body.hits.total.value).to.eql(3207, 'Response body total hits should be 3207'); + expect(Array.isArray(body.hits?.hits[0]?.fields?.lowercase_airline)).to.eql( + true, + 'Response body airlines should be an array' + ); + + const airlines: string[] = body.hits.hits.map((a: any) => a.fields.lowercase_airline[0]); + expect(airlines.length).to.not.eql(0, 'airlines length should not be 0'); + expect(isLowerCase(airlines[0])).to.eql( + true, + 'Response body airlines should all be lower case' + ); + }); + + it(`should return a datafeed preview using custom query and runtime mappings which override the field name`, async () => { + const datafeed = { + datafeed_id: '', + job_id: '', + indices: ['ft_farequote'], + query: { + bool: { + should: [ + { + match: { + airline: 'aal', + }, + }, + ], + }, + }, + runtime_mappings: { + // override the airline field name + airline: { + type: 'keyword', + script: { + source: 'emit(params._source.airline.toLowerCase())', + }, + }, + }, + }; + + const { body } = await supertest + .post('/api/ml/jobs/datafeed_preview') + .auth(USER.ML_POWERUSER, ml.securityCommon.getPasswordForUser(USER.ML_POWERUSER)) + .set(COMMON_REQUEST_HEADERS) + .send({ job, datafeed }) + .expect(200); + + expect(body.hits.total.value).to.eql(300, 'Response body total hits should be 300'); + expect(Array.isArray(body.hits?.hits[0]?.fields?.airline)).to.eql( + true, + 'Response body airlines should be an array' + ); + + const airlines: string[] = body.hits.hits.map((a: any) => a.fields.airline[0]); + expect(airlines.length).to.not.eql(0, 'airlines length should not be 0'); + expect(isLowerCase(airlines[0])).to.eql( + true, + 'Response body airlines should all be lower case' + ); + }); + + it(`should return not a datafeed preview for ML viewer user`, async () => { + const datafeed = { + datafeed_id: '', + job_id: '', + indices: ['ft_farequote'], + query: { + bool: { + must: [ + { + match_all: {}, + }, + ], + }, + }, + runtime_mappings: {}, + }; + + await supertest + .post('/api/ml/jobs/datafeed_preview') + .auth(USER.ML_VIEWER, ml.securityCommon.getPasswordForUser(USER.ML_VIEWER)) + .set(COMMON_REQUEST_HEADERS) + .send({ job, datafeed }) + .expect(403); + }); + + it(`should return not a datafeed preview for unauthorized user`, async () => { + const datafeed = { + datafeed_id: '', + job_id: '', + indices: ['ft_farequote'], + query: { + bool: { + must: [ + { + match_all: {}, + }, + ], + }, + }, + runtime_mappings: {}, + }; + + await supertest + .post('/api/ml/jobs/datafeed_preview') + .auth(USER.ML_UNAUTHORIZED, ml.securityCommon.getPasswordForUser(USER.ML_UNAUTHORIZED)) + .set(COMMON_REQUEST_HEADERS) + .send({ job, datafeed }) + .expect(403); + }); + }); +}; diff --git a/x-pack/test/api_integration/apis/ml/jobs/index.ts b/x-pack/test/api_integration/apis/ml/jobs/index.ts index bea6d5972e7a6c..4c52f2ef862c3e 100644 --- a/x-pack/test/api_integration/apis/ml/jobs/index.ts +++ b/x-pack/test/api_integration/apis/ml/jobs/index.ts @@ -17,5 +17,6 @@ export default function ({ loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./jobs_exist_spaces')); loadTestFile(require.resolve('./close_jobs_spaces')); loadTestFile(require.resolve('./delete_jobs_spaces')); + loadTestFile(require.resolve('./datafeed_preview')); }); } diff --git a/x-pack/test/api_integration/apis/security_solution/uncommon_processes.ts b/x-pack/test/api_integration/apis/security_solution/uncommon_processes.ts index ecff7da6147be8..fff8b98c8fd1fc 100644 --- a/x-pack/test/api_integration/apis/security_solution/uncommon_processes.ts +++ b/x-pack/test/api_integration/apis/security_solution/uncommon_processes.ts @@ -27,7 +27,8 @@ export default function ({ getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const supertest = getService('supertest'); - describe('uncommon_processes', () => { + // FLAKY: https://github.com/elastic/kibana/issues/94535 + describe.skip('uncommon_processes', () => { before(() => esArchiver.load('auditbeat/uncommon_processes')); after(() => esArchiver.unload('auditbeat/uncommon_processes')); diff --git a/x-pack/test/api_integration/apis/spaces/get_active_space.ts b/x-pack/test/api_integration/apis/spaces/get_active_space.ts index 0d0a8bbeeceb78..e1edfdf5a70920 100644 --- a/x-pack/test/api_integration/apis/spaces/get_active_space.ts +++ b/x-pack/test/api_integration/apis/spaces/get_active_space.ts @@ -5,6 +5,7 @@ * 2.0. */ +import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getService }: FtrProviderContext) { @@ -26,27 +27,32 @@ export default function ({ getService }: FtrProviderContext) { }); it('returns the default space', async () => { - await supertest.get('/internal/spaces/_active_space').set('kbn-xsrf', 'xxx').expect(200, { - id: 'default', - name: 'Default', - description: 'This is your default space!', - color: '#00bfb3', - disabledFeatures: [], - _reserved: true, - }); + await supertest + .get('/internal/spaces/_active_space') + .set('kbn-xsrf', 'xxx') + .expect(200) + .then((response) => { + const { id, name, _reserved } = response.body; + expect({ id, name, _reserved }).to.eql({ + id: 'default', + name: 'Default', + _reserved: true, + }); + }); }); it('returns the default space when explicitly referenced', async () => { await supertest .get('/s/default/internal/spaces/_active_space') .set('kbn-xsrf', 'xxx') - .expect(200, { - id: 'default', - name: 'Default', - description: 'This is your default space!', - color: '#00bfb3', - disabledFeatures: [], - _reserved: true, + .expect(200) + .then((response) => { + const { id, name, _reserved } = response.body; + expect({ id, name, _reserved }).to.eql({ + id: 'default', + name: 'Default', + _reserved: true, + }); }); }); diff --git a/x-pack/test/apm_api_integration/tests/feature_controls.ts b/x-pack/test/apm_api_integration/tests/feature_controls.ts index e82b14d6cb7e62..edeffe1e5c296a 100644 --- a/x-pack/test/apm_api_integration/tests/feature_controls.ts +++ b/x-pack/test/apm_api_integration/tests/feature_controls.ts @@ -14,7 +14,7 @@ export default function featureControlsTests({ getService }: FtrProviderContext) const supertestWithoutAuth = getService('supertestWithoutAuth'); const security = getService('security'); const spaces = getService('spaces'); - const es = getService('legacyEs'); + const es = getService('es'); const log = getService('log'); const start = encodeURIComponent(new Date(Date.now() - 10000).toISOString()); diff --git a/x-pack/test/fleet_api_integration/apis/agents/reassign.ts b/x-pack/test/fleet_api_integration/apis/agents/reassign.ts index 77da9ecce3294c..627cb299f0909d 100644 --- a/x-pack/test/fleet_api_integration/apis/agents/reassign.ts +++ b/x-pack/test/fleet_api_integration/apis/agents/reassign.ts @@ -101,15 +101,32 @@ export default function (providerContext: FtrProviderContext) { expect(agent3data.body.item.policy_id).to.eql('policy2'); }); - it('should allow to reassign multiple agents by id -- some invalid', async () => { - await supertest + it('should allow to reassign multiple agents by id -- mix valid & invalid', async () => { + const { body } = await supertest .post(`/api/fleet/agents/bulk_reassign`) .set('kbn-xsrf', 'xxx') .send({ agents: ['agent2', 'INVALID_ID', 'agent3', 'MISSING_ID', 'etc'], policy_id: 'policy2', - }) - .expect(200); + }); + + expect(body).to.eql({ + agent2: { success: true }, + INVALID_ID: { + success: false, + error: 'Cannot find agent INVALID_ID', + }, + agent3: { success: true }, + MISSING_ID: { + success: false, + error: 'Cannot find agent MISSING_ID', + }, + etc: { + success: false, + error: 'Cannot find agent etc', + }, + }); + const [agent2data, agent3data] = await Promise.all([ supertest.get(`/api/fleet/agents/agent2`), supertest.get(`/api/fleet/agents/agent3`), @@ -118,6 +135,45 @@ export default function (providerContext: FtrProviderContext) { expect(agent3data.body.item.policy_id).to.eql('policy2'); }); + it('should allow to reassign multiple agents by id -- mixed invalid, managed, etc', async () => { + // agent1 is enrolled in policy1. set policy1 to managed + await supertest + .put(`/api/fleet/agent_policies/policy1`) + .set('kbn-xsrf', 'xxx') + .send({ name: 'Test policy', namespace: 'default', is_managed: true }) + .expect(200); + + const { body } = await supertest + .post(`/api/fleet/agents/bulk_reassign`) + .set('kbn-xsrf', 'xxx') + .send({ + agents: ['agent2', 'INVALID_ID', 'agent3'], + policy_id: 'policy2', + }); + + expect(body).to.eql({ + agent2: { + success: false, + error: 'Cannot reassign an agent from managed agent policy policy1', + }, + INVALID_ID: { + success: false, + error: 'Cannot find agent INVALID_ID', + }, + agent3: { + success: false, + error: 'Cannot reassign an agent from managed agent policy policy1', + }, + }); + + const [agent2data, agent3data] = await Promise.all([ + supertest.get(`/api/fleet/agents/agent2`), + supertest.get(`/api/fleet/agents/agent3`), + ]); + expect(agent2data.body.item.policy_id).to.eql('policy1'); + expect(agent3data.body.item.policy_id).to.eql('policy1'); + }); + it('should allow to reassign multiple agents by kuery', async () => { await supertest .post(`/api/fleet/agents/bulk_reassign`) diff --git a/x-pack/test/fleet_api_integration/apis/agents/status.ts b/x-pack/test/fleet_api_integration/apis/agents/status.ts new file mode 100644 index 00000000000000..3245b9a459fb18 --- /dev/null +++ b/x-pack/test/fleet_api_integration/apis/agents/status.ts @@ -0,0 +1,86 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import expect from '@kbn/expect'; + +import { FtrProviderContext } from '../../../api_integration/ftr_provider_context'; +import { AGENTS_INDEX } from '../../../../plugins/fleet/common'; + +export default function ({ getService }: FtrProviderContext) { + const es = getService('es'); + const esArchiver = getService('esArchiver'); + const supertest = getService('supertest'); + + describe('fleet_agents_status', () => { + before(async () => { + await esArchiver.loadIfNeeded('fleet/agents'); + // 2 agents online + await es.update({ + id: 'agent1', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + last_checkin: new Date().toISOString(), + }, + }, + }); + await es.update({ + id: 'agent2', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + last_checkin: new Date().toISOString(), + }, + }, + }); + // 1 agents offline + await es.update({ + id: 'agent3', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + last_checkin: new Date(Date.now() - 1000 * 60 * 60 * 60 * 10).toISOString(), + }, + }, + }); + // 1 agent upgrading + await es.update({ + id: 'agent4', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + last_checkin: new Date().toISOString(), + upgrade_started_at: new Date().toISOString(), + }, + }, + }); + }); + after(async () => { + await esArchiver.unload('fleet/agents'); + }); + + it('should return the status of agents', async () => { + const { body: apiResponse } = await supertest.get(`/api/fleet/agent-status`).expect(200); + + expect(apiResponse).to.eql({ + results: { + events: 0, + total: 4, + online: 2, + error: 0, + offline: 1, + updating: 1, + other: 1, + }, + }); + }); + }); +} diff --git a/x-pack/test/fleet_api_integration/apis/agents/upgrade.ts b/x-pack/test/fleet_api_integration/apis/agents/upgrade.ts index 9f2280ed9613ef..9a747fb11a6a62 100644 --- a/x-pack/test/fleet_api_integration/apis/agents/upgrade.ts +++ b/x-pack/test/fleet_api_integration/apis/agents/upgrade.ts @@ -23,7 +23,7 @@ export default function (providerContext: FtrProviderContext) { const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); - describe('fleet upgrade agent', () => { + describe('fleet upgrade', () => { skipIfNoDockerRegistry(providerContext); before(async () => { await esArchiver.loadIfNeeded('fleet/agents'); @@ -36,478 +36,511 @@ export default function (providerContext: FtrProviderContext) { await esArchiver.unload('fleet/agents'); }); - it('should respond 200 to upgrade agent and update the agent SO', async () => { - const kibanaVersion = await kibanaServer.version.get(); - await es.update({ - id: 'agent1', - refresh: 'wait_for', - index: AGENTS_INDEX, - body: { - doc: { - local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + describe('one agent', () => { + it('should respond 200 to upgrade agent and update the agent SO', async () => { + const kibanaVersion = await kibanaServer.version.get(); + await es.update({ + id: 'agent1', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + }, }, - }, - }); - await supertest - .post(`/api/fleet/agents/agent1/upgrade`) - .set('kbn-xsrf', 'xxx') - .send({ - version: kibanaVersion, - source_uri: 'http://path/to/download', - }) - .expect(200); + }); + await supertest + .post(`/api/fleet/agents/agent1/upgrade`) + .set('kbn-xsrf', 'xxx') + .send({ + version: kibanaVersion, + source_uri: 'http://path/to/download', + }) + .expect(200); - const res = await supertest.get(`/api/fleet/agents/agent1`).set('kbn-xsrf', 'xxx'); - expect(typeof res.body.item.upgrade_started_at).to.be('string'); - }); - it('should respond 400 if upgrading agent with version the same as snapshot version', async () => { - const kibanaVersion = await kibanaServer.version.get(); - const kibanaVersionSnapshot = makeSnapshotVersion(kibanaVersion); - await es.update({ - id: 'agent1', - refresh: 'wait_for', - index: AGENTS_INDEX, - body: { - doc: { - local_metadata: { elastic: { agent: { upgradeable: true, version: kibanaVersion } } }, + const res = await supertest.get(`/api/fleet/agents/agent1`).set('kbn-xsrf', 'xxx'); + expect(typeof res.body.item.upgrade_started_at).to.be('string'); + }); + it('should respond 400 if upgrading agent with version the same as snapshot version', async () => { + const kibanaVersion = await kibanaServer.version.get(); + const kibanaVersionSnapshot = makeSnapshotVersion(kibanaVersion); + await es.update({ + id: 'agent1', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + local_metadata: { elastic: { agent: { upgradeable: true, version: kibanaVersion } } }, + }, }, - }, + }); + await supertest + .post(`/api/fleet/agents/agent1/upgrade`) + .set('kbn-xsrf', 'xxx') + .send({ + version: kibanaVersionSnapshot, + }) + .expect(400); }); - await supertest - .post(`/api/fleet/agents/agent1/upgrade`) - .set('kbn-xsrf', 'xxx') - .send({ - version: kibanaVersionSnapshot, - }) - .expect(400); - }); - it('should respond 200 if upgrading agent with version the same as snapshot version and force flag is passed', async () => { - const kibanaVersion = await kibanaServer.version.get(); - const kibanaVersionSnapshot = makeSnapshotVersion(kibanaVersion); - await es.update({ - id: 'agent1', - refresh: 'wait_for', - index: AGENTS_INDEX, - body: { - doc: { - local_metadata: { elastic: { agent: { upgradeable: true, version: kibanaVersion } } }, + it('should respond 200 if upgrading agent with version the same as snapshot version and force flag is passed', async () => { + const kibanaVersion = await kibanaServer.version.get(); + const kibanaVersionSnapshot = makeSnapshotVersion(kibanaVersion); + await es.update({ + id: 'agent1', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + local_metadata: { elastic: { agent: { upgradeable: true, version: kibanaVersion } } }, + }, }, - }, + }); + await supertest + .post(`/api/fleet/agents/agent1/upgrade`) + .set('kbn-xsrf', 'xxx') + .send({ + version: kibanaVersionSnapshot, + force: true, + }) + .expect(200); }); - await supertest - .post(`/api/fleet/agents/agent1/upgrade`) - .set('kbn-xsrf', 'xxx') - .send({ - version: kibanaVersionSnapshot, - force: true, - }) - .expect(200); - }); - it('should respond 200 if upgrading agent with version less than kibana snapshot version', async () => { - const kibanaVersion = await kibanaServer.version.get(); - const kibanaVersionSnapshot = makeSnapshotVersion(kibanaVersion); + it('should respond 200 if upgrading agent with version less than kibana snapshot version', async () => { + const kibanaVersion = await kibanaServer.version.get(); + const kibanaVersionSnapshot = makeSnapshotVersion(kibanaVersion); - await es.update({ - id: 'agent1', - refresh: 'wait_for', - index: AGENTS_INDEX, - body: { - doc: { - local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + await es.update({ + id: 'agent1', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + }, }, - }, + }); + await supertest + .post(`/api/fleet/agents/agent1/upgrade`) + .set('kbn-xsrf', 'xxx') + .send({ + version: kibanaVersionSnapshot, + }) + .expect(200); }); - await supertest - .post(`/api/fleet/agents/agent1/upgrade`) - .set('kbn-xsrf', 'xxx') - .send({ - version: kibanaVersionSnapshot, - }) - .expect(200); - }); - it('should respond 200 to upgrade agent and update the agent SO without source_uri', async () => { - const kibanaVersion = await kibanaServer.version.get(); - await es.update({ - id: 'agent1', - refresh: 'wait_for', - index: AGENTS_INDEX, - body: { - doc: { - local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + it('should respond 200 to upgrade agent and update the agent SO without source_uri', async () => { + const kibanaVersion = await kibanaServer.version.get(); + await es.update({ + id: 'agent1', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + }, }, - }, + }); + await supertest + .post(`/api/fleet/agents/agent1/upgrade`) + .set('kbn-xsrf', 'xxx') + .send({ + version: kibanaVersion, + }) + .expect(200); + const res = await supertest.get(`/api/fleet/agents/agent1`).set('kbn-xsrf', 'xxx'); + expect(typeof res.body.item.upgrade_started_at).to.be('string'); }); - await supertest - .post(`/api/fleet/agents/agent1/upgrade`) - .set('kbn-xsrf', 'xxx') - .send({ - version: kibanaVersion, - }) - .expect(200); - const res = await supertest.get(`/api/fleet/agents/agent1`).set('kbn-xsrf', 'xxx'); - expect(typeof res.body.item.upgrade_started_at).to.be('string'); - }); - it('should respond 400 if trying to upgrade to a version that does not match installed kibana version', async () => { - const kibanaVersion = await kibanaServer.version.get(); - const higherVersion = semver.inc(kibanaVersion, 'patch'); - await supertest - .post(`/api/fleet/agents/agent1/upgrade`) - .set('kbn-xsrf', 'xxx') - .send({ - version: higherVersion, - source_uri: 'http://path/to/download', - }) - .expect(400); - }); - it('should respond 400 if trying to upgrade an agent that is unenrolling', async () => { - const kibanaVersion = await kibanaServer.version.get(); - await supertest.post(`/api/fleet/agents/agent1/unenroll`).set('kbn-xsrf', 'xxx').send({ - force: true, + it('should respond 400 if trying to upgrade to a version that does not match installed kibana version', async () => { + const kibanaVersion = await kibanaServer.version.get(); + const higherVersion = semver.inc(kibanaVersion, 'patch'); + await supertest + .post(`/api/fleet/agents/agent1/upgrade`) + .set('kbn-xsrf', 'xxx') + .send({ + version: higherVersion, + source_uri: 'http://path/to/download', + }) + .expect(400); }); - await supertest - .post(`/api/fleet/agents/agent1/upgrade`) - .set('kbn-xsrf', 'xxx') - .send({ - version: kibanaVersion, - }) - .expect(400); - }); - it('should respond 400 if trying to upgrade an agent that is unenrolled', async () => { - const kibanaVersion = await kibanaServer.version.get(); - await es.update({ - id: 'agent1', - refresh: 'wait_for', - index: AGENTS_INDEX, - body: { - doc: { - unenrolled_at: new Date().toISOString(), + it('should respond 400 if trying to upgrade an agent that is unenrolling', async () => { + const kibanaVersion = await kibanaServer.version.get(); + await supertest.post(`/api/fleet/agents/agent1/unenroll`).set('kbn-xsrf', 'xxx').send({ + force: true, + }); + await supertest + .post(`/api/fleet/agents/agent1/upgrade`) + .set('kbn-xsrf', 'xxx') + .send({ + version: kibanaVersion, + }) + .expect(400); + }); + it('should respond 400 if trying to upgrade an agent that is unenrolled', async () => { + const kibanaVersion = await kibanaServer.version.get(); + await es.update({ + id: 'agent1', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + unenrolled_at: new Date().toISOString(), + }, }, - }, + }); + await supertest + .post(`/api/fleet/agents/agent1/upgrade`) + .set('kbn-xsrf', 'xxx') + .send({ + version: kibanaVersion, + }) + .expect(400); }); - await supertest - .post(`/api/fleet/agents/agent1/upgrade`) - .set('kbn-xsrf', 'xxx') - .send({ - version: kibanaVersion, - }) - .expect(400); - }); - it('should respond 400 if trying to upgrade an agent that is not upgradeable', async () => { - const kibanaVersion = await kibanaServer.version.get(); - const res = await supertest - .post(`/api/fleet/agents/agent1/upgrade`) - .set('kbn-xsrf', 'xxx') - .send({ - version: kibanaVersion, - }) - .expect(400); - expect(res.body.message).to.equal('agent agent1 is not upgradeable'); - }); + it('should respond 400 if trying to upgrade an agent that is not upgradeable', async () => { + const kibanaVersion = await kibanaServer.version.get(); + const res = await supertest + .post(`/api/fleet/agents/agent1/upgrade`) + .set('kbn-xsrf', 'xxx') + .send({ + version: kibanaVersion, + }) + .expect(400); + expect(res.body.message).to.equal('agent agent1 is not upgradeable'); + }); - it('should respond 200 to bulk upgrade upgradeable agents and update the agent SOs', async () => { - const kibanaVersion = await kibanaServer.version.get(); - await es.update({ - id: 'agent1', - refresh: 'wait_for', - index: AGENTS_INDEX, - body: { - doc: { - local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + it('enrolled in a managed policy should respond 400 to upgrade and not update the agent SOs', async () => { + // update enrolled policy to managed + await supertest.put(`/api/fleet/agent_policies/policy1`).set('kbn-xsrf', 'xxxx').send({ + name: 'Test policy', + namespace: 'default', + is_managed: true, + }); + + const kibanaVersion = await kibanaServer.version.get(); + await es.update({ + id: 'agent1', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + }, }, - }, + }); + // attempt to upgrade agent in managed policy + const { body } = await supertest + .post(`/api/fleet/agents/agent1/upgrade`) + .set('kbn-xsrf', 'xxx') + .send({ version: kibanaVersion }) + .expect(400); + expect(body.message).to.contain('Cannot upgrade agent agent1 in managed policy policy1'); + + const agent1data = await supertest.get(`/api/fleet/agents/agent1`); + expect(typeof agent1data.body.item.upgrade_started_at).to.be('undefined'); }); - await es.update({ - id: 'agent2', - refresh: 'wait_for', - index: AGENTS_INDEX, - body: { - doc: { - local_metadata: { - elastic: { - agent: { upgradeable: true, version: semver.inc(kibanaVersion, 'patch') }, + }); + + describe('multiple agents', () => { + it('should respond 200 to bulk upgrade upgradeable agents and update the agent SOs', async () => { + const kibanaVersion = await kibanaServer.version.get(); + await es.update({ + id: 'agent1', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + }, + }, + }); + await es.update({ + id: 'agent2', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + local_metadata: { + elastic: { + agent: { upgradeable: true, version: semver.inc(kibanaVersion, 'patch') }, + }, }, }, }, - }, - }); - await supertest - .post(`/api/fleet/agents/bulk_upgrade`) - .set('kbn-xsrf', 'xxx') - .send({ - version: kibanaVersion, - agents: ['agent1', 'agent2'], - }) - .expect(200); + }); + await supertest + .post(`/api/fleet/agents/bulk_upgrade`) + .set('kbn-xsrf', 'xxx') + .send({ + version: kibanaVersion, + agents: ['agent1', 'agent2'], + }) + .expect(200); - const [agent1data, agent2data] = await Promise.all([ - supertest.get(`/api/fleet/agents/agent1`).set('kbn-xsrf', 'xxx'), - supertest.get(`/api/fleet/agents/agent2`).set('kbn-xsrf', 'xxx'), - ]); - expect(typeof agent1data.body.item.upgrade_started_at).to.be('string'); - expect(typeof agent2data.body.item.upgrade_started_at).to.be('undefined'); - }); + const [agent1data, agent2data] = await Promise.all([ + supertest.get(`/api/fleet/agents/agent1`).set('kbn-xsrf', 'xxx'), + supertest.get(`/api/fleet/agents/agent2`).set('kbn-xsrf', 'xxx'), + ]); + expect(typeof agent1data.body.item.upgrade_started_at).to.be('string'); + expect(typeof agent2data.body.item.upgrade_started_at).to.be('undefined'); + }); - it('should allow to upgrade multiple upgradeable agents by kuery', async () => { - const kibanaVersion = await kibanaServer.version.get(); - await es.update({ - id: 'agent1', - refresh: 'wait_for', - index: AGENTS_INDEX, - body: { - doc: { - local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + it('should allow to upgrade multiple upgradeable agents by kuery', async () => { + const kibanaVersion = await kibanaServer.version.get(); + await es.update({ + id: 'agent1', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + }, }, - }, - }); - await es.update({ - id: 'agent2', - refresh: 'wait_for', - index: AGENTS_INDEX, - body: { - doc: { - local_metadata: { - elastic: { - agent: { upgradeable: true, version: semver.inc(kibanaVersion, 'patch') }, + }); + await es.update({ + id: 'agent2', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + local_metadata: { + elastic: { + agent: { upgradeable: true, version: semver.inc(kibanaVersion, 'patch') }, + }, }, }, }, - }, + }); + await supertest + .post(`/api/fleet/agents/bulk_upgrade`) + .set('kbn-xsrf', 'xxx') + .send({ + agents: 'active:true', + version: kibanaVersion, + }) + .expect(200); + const [agent1data, agent2data] = await Promise.all([ + supertest.get(`/api/fleet/agents/agent1`).set('kbn-xsrf', 'xxx'), + supertest.get(`/api/fleet/agents/agent2`).set('kbn-xsrf', 'xxx'), + ]); + expect(typeof agent1data.body.item.upgrade_started_at).to.be('string'); + expect(typeof agent2data.body.item.upgrade_started_at).to.be('undefined'); }); - await supertest - .post(`/api/fleet/agents/bulk_upgrade`) - .set('kbn-xsrf', 'xxx') - .send({ - agents: 'active:true', - version: kibanaVersion, - }) - .expect(200); - const [agent1data, agent2data] = await Promise.all([ - supertest.get(`/api/fleet/agents/agent1`).set('kbn-xsrf', 'xxx'), - supertest.get(`/api/fleet/agents/agent2`).set('kbn-xsrf', 'xxx'), - ]); - expect(typeof agent1data.body.item.upgrade_started_at).to.be('string'); - expect(typeof agent2data.body.item.upgrade_started_at).to.be('undefined'); - }); - it('should not upgrade an unenrolling agent during bulk_upgrade', async () => { - const kibanaVersion = await kibanaServer.version.get(); - await supertest.post(`/api/fleet/agents/agent1/unenroll`).set('kbn-xsrf', 'xxx').send({ - force: true, - }); - await es.update({ - id: 'agent1', - refresh: 'wait_for', - index: AGENTS_INDEX, - body: { - doc: { - local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + it('should not upgrade an unenrolling agent during bulk_upgrade', async () => { + const kibanaVersion = await kibanaServer.version.get(); + await supertest.post(`/api/fleet/agents/agent1/unenroll`).set('kbn-xsrf', 'xxx').send({ + force: true, + }); + await es.update({ + id: 'agent1', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + }, }, - }, - }); - await es.update({ - id: 'agent2', - refresh: 'wait_for', - index: AGENTS_INDEX, - body: { - doc: { - local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + }); + await es.update({ + id: 'agent2', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + }, }, - }, + }); + await supertest + .post(`/api/fleet/agents/bulk_upgrade`) + .set('kbn-xsrf', 'xxx') + .send({ + agents: ['agent1', 'agent2'], + version: kibanaVersion, + }); + const [agent1data, agent2data] = await Promise.all([ + supertest.get(`/api/fleet/agents/agent1`).set('kbn-xsrf', 'xxx'), + supertest.get(`/api/fleet/agents/agent2`).set('kbn-xsrf', 'xxx'), + ]); + expect(typeof agent1data.body.item.upgrade_started_at).to.be('undefined'); + expect(typeof agent2data.body.item.upgrade_started_at).to.be('string'); }); - await supertest - .post(`/api/fleet/agents/bulk_upgrade`) - .set('kbn-xsrf', 'xxx') - .send({ - agents: ['agent1', 'agent2'], - version: kibanaVersion, - }); - const [agent1data, agent2data] = await Promise.all([ - supertest.get(`/api/fleet/agents/agent1`).set('kbn-xsrf', 'xxx'), - supertest.get(`/api/fleet/agents/agent2`).set('kbn-xsrf', 'xxx'), - ]); - expect(typeof agent1data.body.item.upgrade_started_at).to.be('undefined'); - expect(typeof agent2data.body.item.upgrade_started_at).to.be('string'); - }); - it('should not upgrade an unenrolled agent during bulk_upgrade', async () => { - const kibanaVersion = await kibanaServer.version.get(); - await es.update({ - id: 'agent1', - refresh: 'wait_for', - index: AGENTS_INDEX, - body: { - doc: { - unenrolled_at: new Date().toISOString(), - local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + it('should not upgrade an unenrolled agent during bulk_upgrade', async () => { + const kibanaVersion = await kibanaServer.version.get(); + await es.update({ + id: 'agent1', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + unenrolled_at: new Date().toISOString(), + local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + }, }, - }, - }); - await es.update({ - id: 'agent2', - refresh: 'wait_for', - index: AGENTS_INDEX, - body: { - doc: { - local_metadata: { - elastic: { agent: { upgradeable: true, version: '0.0.0' } }, + }); + await es.update({ + id: 'agent2', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + local_metadata: { + elastic: { agent: { upgradeable: true, version: '0.0.0' } }, + }, }, }, - }, + }); + await supertest + .post(`/api/fleet/agents/bulk_upgrade`) + .set('kbn-xsrf', 'xxx') + .send({ + agents: ['agent1', 'agent2'], + version: kibanaVersion, + }); + const [agent1data, agent2data] = await Promise.all([ + supertest.get(`/api/fleet/agents/agent1`).set('kbn-xsrf', 'xxx'), + supertest.get(`/api/fleet/agents/agent2`).set('kbn-xsrf', 'xxx'), + ]); + expect(typeof agent1data.body.item.upgrade_started_at).to.be('undefined'); + expect(typeof agent2data.body.item.upgrade_started_at).to.be('string'); }); - await supertest - .post(`/api/fleet/agents/bulk_upgrade`) - .set('kbn-xsrf', 'xxx') - .send({ - agents: ['agent1', 'agent2'], - version: kibanaVersion, - }); - const [agent1data, agent2data] = await Promise.all([ - supertest.get(`/api/fleet/agents/agent1`).set('kbn-xsrf', 'xxx'), - supertest.get(`/api/fleet/agents/agent2`).set('kbn-xsrf', 'xxx'), - ]); - expect(typeof agent1data.body.item.upgrade_started_at).to.be('undefined'); - expect(typeof agent2data.body.item.upgrade_started_at).to.be('string'); - }); - it('should not upgrade an non upgradeable agent during bulk_upgrade', async () => { - const kibanaVersion = await kibanaServer.version.get(); - await es.update({ - id: 'agent1', - refresh: 'wait_for', - index: AGENTS_INDEX, - body: { - doc: { - local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + it('should not upgrade an non upgradeable agent during bulk_upgrade', async () => { + const kibanaVersion = await kibanaServer.version.get(); + await es.update({ + id: 'agent1', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + }, }, - }, - }); - await es.update({ - id: 'agent2', - refresh: 'wait_for', - index: AGENTS_INDEX, - body: { - doc: { - local_metadata: { - elastic: { - agent: { upgradeable: true, version: semver.inc(kibanaVersion, 'patch') }, + }); + await es.update({ + id: 'agent2', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + local_metadata: { + elastic: { + agent: { upgradeable: true, version: semver.inc(kibanaVersion, 'patch') }, + }, }, }, }, - }, - }); - await es.update({ - id: 'agent3', - refresh: 'wait_for', - index: AGENTS_INDEX, - body: { - doc: { - local_metadata: { elastic: { agent: { upgradeable: false, version: '0.0.0' } } }, + }); + await es.update({ + id: 'agent3', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + local_metadata: { elastic: { agent: { upgradeable: false, version: '0.0.0' } } }, + }, }, - }, + }); + await supertest + .post(`/api/fleet/agents/bulk_upgrade`) + .set('kbn-xsrf', 'xxx') + .send({ + agents: ['agent1', 'agent2', 'agent3'], + version: kibanaVersion, + }); + const [agent1data, agent2data, agent3data] = await Promise.all([ + supertest.get(`/api/fleet/agents/agent1`).set('kbn-xsrf', 'xxx'), + supertest.get(`/api/fleet/agents/agent2`).set('kbn-xsrf', 'xxx'), + supertest.get(`/api/fleet/agents/agent3`).set('kbn-xsrf', 'xxx'), + ]); + expect(typeof agent1data.body.item.upgrade_started_at).to.be('string'); + expect(typeof agent2data.body.item.upgrade_started_at).to.be('undefined'); + expect(typeof agent3data.body.item.upgrade_started_at).to.be('undefined'); }); - await supertest - .post(`/api/fleet/agents/bulk_upgrade`) - .set('kbn-xsrf', 'xxx') - .send({ - agents: ['agent1', 'agent2', 'agent3'], - version: kibanaVersion, - }); - const [agent1data, agent2data, agent3data] = await Promise.all([ - supertest.get(`/api/fleet/agents/agent1`).set('kbn-xsrf', 'xxx'), - supertest.get(`/api/fleet/agents/agent2`).set('kbn-xsrf', 'xxx'), - supertest.get(`/api/fleet/agents/agent3`).set('kbn-xsrf', 'xxx'), - ]); - expect(typeof agent1data.body.item.upgrade_started_at).to.be('string'); - expect(typeof agent2data.body.item.upgrade_started_at).to.be('undefined'); - expect(typeof agent3data.body.item.upgrade_started_at).to.be('undefined'); - }); - it('should upgrade a non upgradeable agent during bulk_upgrade with force flag', async () => { - const kibanaVersion = await kibanaServer.version.get(); - await es.update({ - id: 'agent1', - refresh: 'wait_for', - index: AGENTS_INDEX, - body: { - doc: { - local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + it('should upgrade a non upgradeable agent during bulk_upgrade with force flag', async () => { + const kibanaVersion = await kibanaServer.version.get(); + await es.update({ + id: 'agent1', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + }, }, - }, - }); - await es.update({ - id: 'agent2', - refresh: 'wait_for', - index: AGENTS_INDEX, - body: { - doc: { - local_metadata: { - elastic: { - agent: { upgradeable: true, version: semver.inc(kibanaVersion, 'patch') }, + }); + await es.update({ + id: 'agent2', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + local_metadata: { + elastic: { + agent: { upgradeable: true, version: semver.inc(kibanaVersion, 'patch') }, + }, }, }, }, - }, - }); - await es.update({ - id: 'agent3', - refresh: 'wait_for', - index: AGENTS_INDEX, - body: { - doc: { - local_metadata: { elastic: { agent: { upgradeable: false, version: '0.0.0' } } }, - }, - }, - }); - await supertest - .post(`/api/fleet/agents/bulk_upgrade`) - .set('kbn-xsrf', 'xxx') - .send({ - agents: ['agent1', 'agent2', 'agent3'], - version: kibanaVersion, - force: true, }); - const [agent1data, agent2data, agent3data] = await Promise.all([ - supertest.get(`/api/fleet/agents/agent1`).set('kbn-xsrf', 'xxx'), - supertest.get(`/api/fleet/agents/agent2`).set('kbn-xsrf', 'xxx'), - supertest.get(`/api/fleet/agents/agent3`).set('kbn-xsrf', 'xxx'), - ]); - expect(typeof agent1data.body.item.upgrade_started_at).to.be('string'); - expect(typeof agent2data.body.item.upgrade_started_at).to.be('string'); - expect(typeof agent3data.body.item.upgrade_started_at).to.be('string'); - }); - it('should respond 400 if trying to bulk upgrade to a version that does not match installed kibana version', async () => { - await es.update({ - id: 'agent1', - refresh: 'wait_for', - index: AGENTS_INDEX, - body: { - doc: { - local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + await es.update({ + id: 'agent3', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + local_metadata: { elastic: { agent: { upgradeable: false, version: '0.0.0' } } }, + }, }, - }, + }); + await supertest + .post(`/api/fleet/agents/bulk_upgrade`) + .set('kbn-xsrf', 'xxx') + .send({ + agents: ['agent1', 'agent2', 'agent3'], + version: kibanaVersion, + force: true, + }); + const [agent1data, agent2data, agent3data] = await Promise.all([ + supertest.get(`/api/fleet/agents/agent1`).set('kbn-xsrf', 'xxx'), + supertest.get(`/api/fleet/agents/agent2`).set('kbn-xsrf', 'xxx'), + supertest.get(`/api/fleet/agents/agent3`).set('kbn-xsrf', 'xxx'), + ]); + expect(typeof agent1data.body.item.upgrade_started_at).to.be('string'); + expect(typeof agent2data.body.item.upgrade_started_at).to.be('string'); + expect(typeof agent3data.body.item.upgrade_started_at).to.be('string'); }); - await es.update({ - id: 'agent2', - refresh: 'wait_for', - index: AGENTS_INDEX, - body: { - doc: { - local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + it('should respond 400 if trying to bulk upgrade to a version that does not match installed kibana version', async () => { + await es.update({ + id: 'agent1', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + }, + }, + }); + await es.update({ + id: 'agent2', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + local_metadata: { elastic: { agent: { upgradeable: true, version: '0.0.0' } } }, + }, }, - }, + }); + await supertest + .post(`/api/fleet/agents/bulk_upgrade`) + .set('kbn-xsrf', 'xxx') + .send({ + agents: ['agent1', 'agent2'], + version: '1.0.0', + force: true, + }) + .expect(400); }); - await supertest - .post(`/api/fleet/agents/bulk_upgrade`) - .set('kbn-xsrf', 'xxx') - .send({ - agents: ['agent1', 'agent2'], - version: '1.0.0', - force: true, - }) - .expect(400); - }); - describe('fleet upgrade agent(s) in a managed policy', function () { - it('should respond 400 to bulk upgrade and not update the agent SOs', async () => { + it('enrolled in a managed policy bulk upgrade should respond with 400 and not update the agent SOs', async () => { // update enrolled policy to managed await supertest.put(`/api/fleet/agent_policies/policy1`).set('kbn-xsrf', 'xxxx').send({ name: 'Test policy', @@ -560,7 +593,7 @@ export default function (providerContext: FtrProviderContext) { expect(typeof agent2data.body.item.upgrade_started_at).to.be('undefined'); }); - it('should respond 400 to upgrade and not update the agent SOs', async () => { + it('enrolled in a managed policy bulk upgrade with force flag should respond with 200 and update the agent SOs', async () => { // update enrolled policy to managed await supertest.put(`/api/fleet/agent_policies/policy1`).set('kbn-xsrf', 'xxxx').send({ name: 'Test policy', @@ -579,16 +612,37 @@ export default function (providerContext: FtrProviderContext) { }, }, }); + await es.update({ + id: 'agent2', + refresh: 'wait_for', + index: AGENTS_INDEX, + body: { + doc: { + local_metadata: { + elastic: { + agent: { upgradeable: true, version: semver.inc(kibanaVersion, 'patch') }, + }, + }, + }, + }, + }); // attempt to upgrade agent in managed policy const { body } = await supertest - .post(`/api/fleet/agents/agent1/upgrade`) + .post(`/api/fleet/agents/bulk_upgrade`) .set('kbn-xsrf', 'xxx') - .send({ version: kibanaVersion }) - .expect(400); - expect(body.message).to.contain('Cannot upgrade agent agent1 in managed policy policy1'); + .send({ + version: kibanaVersion, + agents: ['agent1', 'agent2'], + force: true, + }); + expect(body).to.eql({}); - const agent1data = await supertest.get(`/api/fleet/agents/agent1`); - expect(typeof agent1data.body.item.upgrade_started_at).to.be('undefined'); + const [agent1data, agent2data] = await Promise.all([ + supertest.get(`/api/fleet/agents/agent1`), + supertest.get(`/api/fleet/agents/agent2`), + ]); + expect(typeof agent1data.body.item.upgrade_started_at).to.be('string'); + expect(typeof agent2data.body.item.upgrade_started_at).to.be('string'); }); }); }); diff --git a/x-pack/test/fleet_api_integration/apis/epm/bulk_upgrade.ts b/x-pack/test/fleet_api_integration/apis/epm/bulk_upgrade.ts index 546493a4c6f390..80d0f67f9e7fb1 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/bulk_upgrade.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/bulk_upgrade.ts @@ -51,8 +51,7 @@ export default function (providerContext: FtrProviderContext) { expect(body.response.length).equal(1); expect(body.response[0].name).equal('multiple_versions'); const entry = body.response[0] as BulkInstallPackageInfo; - expect(entry.oldVersion).equal('0.1.0'); - expect(entry.newVersion).equal('0.3.0'); + expect(entry.version).equal('0.3.0'); }); it('should return an error for packages that do not exist', async function () { const { body }: { body: BulkInstallPackagesResponse } = await supertest @@ -63,8 +62,7 @@ export default function (providerContext: FtrProviderContext) { expect(body.response.length).equal(2); expect(body.response[0].name).equal('multiple_versions'); const entry = body.response[0] as BulkInstallPackageInfo; - expect(entry.oldVersion).equal('0.1.0'); - expect(entry.newVersion).equal('0.3.0'); + expect(entry.version).equal('0.3.0'); const err = body.response[1] as IBulkInstallPackageHTTPError; expect(err.statusCode).equal(404); @@ -79,12 +77,10 @@ export default function (providerContext: FtrProviderContext) { expect(body.response.length).equal(2); expect(body.response[0].name).equal('multiple_versions'); let entry = body.response[0] as BulkInstallPackageInfo; - expect(entry.oldVersion).equal('0.1.0'); - expect(entry.newVersion).equal('0.3.0'); + expect(entry.version).equal('0.3.0'); entry = body.response[1] as BulkInstallPackageInfo; - expect(entry.oldVersion).equal(null); - expect(entry.newVersion).equal('0.1.0'); + expect(entry.version).equal('0.1.0'); expect(entry.name).equal('overrides'); }); }); @@ -103,8 +99,7 @@ export default function (providerContext: FtrProviderContext) { expect(body.response.length).equal(1); expect(body.response[0].name).equal('multiple_versions'); const entry = body.response[0] as BulkInstallPackageInfo; - expect(entry.oldVersion).equal(null); - expect(entry.newVersion).equal('0.3.0'); + expect(entry.version).equal('0.3.0'); }); }); }); diff --git a/x-pack/test/fleet_api_integration/apis/epm/delete.ts b/x-pack/test/fleet_api_integration/apis/epm/delete.ts new file mode 100644 index 00000000000000..ecf9eb625bd7e0 --- /dev/null +++ b/x-pack/test/fleet_api_integration/apis/epm/delete.ts @@ -0,0 +1,54 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { FtrProviderContext } from '../../../api_integration/ftr_provider_context'; +import { skipIfNoDockerRegistry } from '../../helpers'; + +export default function (providerContext: FtrProviderContext) { + const { getService } = providerContext; + const supertest = getService('supertest'); + const requiredPackage = 'system-0.11.0'; + + const installPackage = async (pkgkey: string) => { + await supertest + .post(`/api/fleet/epm/packages/${pkgkey}`) + .set('kbn-xsrf', 'xxxx') + .send({ force: true }); + }; + + const deletePackage = async (pkgkey: string) => { + await supertest + .delete(`/api/fleet/epm/packages/${pkgkey}`) + .set('kbn-xsrf', 'xxxx') + .send({ force: true }); + }; + + describe('delete and force delete scenarios', async () => { + skipIfNoDockerRegistry(providerContext); + before(async () => { + await installPackage(requiredPackage); + }); + after(async () => { + await deletePackage(requiredPackage); + }); + + it('should return 400 if trying to uninstall a required package', async function () { + await supertest + .delete(`/api/fleet/epm/packages/${requiredPackage}`) + .set('kbn-xsrf', 'xxxx') + .expect(400); + }); + + it('should return 200 if trying to force uninstall a required package', async function () { + await supertest + .delete(`/api/fleet/epm/packages/${requiredPackage}`) + .set('kbn-xsrf', 'xxxx') + .send({ force: true }) + .expect(200); + }); + }); +} diff --git a/x-pack/test/fleet_api_integration/apis/epm/index.js b/x-pack/test/fleet_api_integration/apis/epm/index.js index 0020e6bdf1bb01..009e1a2dad5f15 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/index.js +++ b/x-pack/test/fleet_api_integration/apis/epm/index.js @@ -7,6 +7,7 @@ export default function loadTests({ loadTestFile }) { describe('EPM Endpoints', () => { + loadTestFile(require.resolve('./delete')); loadTestFile(require.resolve('./list')); loadTestFile(require.resolve('./setup')); loadTestFile(require.resolve('./get')); diff --git a/x-pack/test/fleet_api_integration/apis/index.js b/x-pack/test/fleet_api_integration/apis/index.js index 948985c52bd1b9..27987e469cfe7b 100644 --- a/x-pack/test/fleet_api_integration/apis/index.js +++ b/x-pack/test/fleet_api_integration/apis/index.js @@ -8,6 +8,9 @@ export default function ({ loadTestFile }) { describe('Fleet Endpoints', function () { this.tags('ciGroup10'); + // EPM + loadTestFile(require.resolve('./epm/index')); + // Fleet setup loadTestFile(require.resolve('./fleet_setup')); @@ -25,13 +28,11 @@ export default function ({ loadTestFile }) { loadTestFile(require.resolve('./agents/actions')); loadTestFile(require.resolve('./agents/upgrade')); loadTestFile(require.resolve('./agents/reassign')); + loadTestFile(require.resolve('./agents/status')); // Enrollment API keys loadTestFile(require.resolve('./enrollment_api_keys/crud')); - // EPM - loadTestFile(require.resolve('./epm/index')); - // Package policies loadTestFile(require.resolve('./package_policy/create')); loadTestFile(require.resolve('./package_policy/update')); diff --git a/x-pack/test/functional/apps/dashboard/reporting/screenshots.ts b/x-pack/test/functional/apps/dashboard/reporting/screenshots.ts index ba7a20c8b05a6a..b16dc828e1776d 100644 --- a/x-pack/test/functional/apps/dashboard/reporting/screenshots.ts +++ b/x-pack/test/functional/apps/dashboard/reporting/screenshots.ts @@ -25,6 +25,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const config = getService('config'); const es = getService('es'); const testSubjects = getService('testSubjects'); + const kibanaServer = getService('kibanaServer'); describe('Dashboard Reporting Screenshots', () => { before('initialize tests', async () => { @@ -150,6 +151,24 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(res.status).to.equal(200); expect(res.get('content-type')).to.equal('application/pdf'); }); + + it('downloads a PDF file with saved search given EuiDataGrid enabled', async function () { + await kibanaServer.uiSettings.replace({ 'doc_table:legacy': false }); + // Generating and then comparing reports can take longer than the default 60s timeout because the comparePngs + // function is taking about 15 seconds per comparison in jenkins. + this.timeout(300000); + await PageObjects.common.navigateToApp('dashboard'); + await PageObjects.dashboard.loadSavedDashboard('Ecom Dashboard'); + await PageObjects.reporting.openPdfReportingPanel(); + await PageObjects.reporting.clickGenerateReportButton(); + + const url = await PageObjects.reporting.getReportURL(60000); + const res = await PageObjects.reporting.getResponse(url); + + expect(res.status).to.equal(200); + expect(res.get('content-type')).to.equal('application/pdf'); + await kibanaServer.uiSettings.replace({}); + }); }); }); } diff --git a/x-pack/test/functional/apps/lens/runtime_fields.ts b/x-pack/test/functional/apps/lens/runtime_fields.ts index 9b8ef3a8b69051..53fe9eab0e654b 100644 --- a/x-pack/test/functional/apps/lens/runtime_fields.ts +++ b/x-pack/test/functional/apps/lens/runtime_fields.ts @@ -62,5 +62,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ); expect(await PageObjects.lens.getDatatableCellText(0, 0)).to.eql('abc'); }); + + it('should able to remove field', async () => { + await PageObjects.lens.clickField('runtimefield2'); + await PageObjects.lens.removeField(); + await PageObjects.lens.waitForFieldMissing('runtimefield2'); + }); }); } diff --git a/x-pack/test/functional/apps/ml/anomaly_detection/anomaly_explorer.ts b/x-pack/test/functional/apps/ml/anomaly_detection/anomaly_explorer.ts index 086b6c7e7f9d7b..ff38544fa8c030 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection/anomaly_explorer.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection/anomaly_explorer.ts @@ -5,6 +5,7 @@ * 2.0. */ +import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { Job, Datafeed } from '../../../../../plugins/ml/common/types/anomaly_detection_jobs'; @@ -51,9 +52,15 @@ const testDataList = [ }, ]; +const cellSize = 15; + +const overallSwimLaneTestSubj = 'mlAnomalyExplorerSwimlaneOverall'; +const viewBySwimLaneTestSubj = 'mlAnomalyExplorerSwimlaneViewBy'; + export default function ({ getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const ml = getService('ml'); + const elasticChart = getService('elasticChart'); describe('anomaly explorer', function () { this.tags(['mlqa']); @@ -76,12 +83,16 @@ export default function ({ getService }: FtrProviderContext) { }); after(async () => { + await elasticChart.setNewChartUiDebugFlag(false); await ml.api.cleanMlIndices(); }); it('opens a job from job list link', async () => { await ml.testExecution.logTestStep('navigate to job list'); await ml.navigation.navigateToMl(); + // Set debug state has to happen at this point + // because page refresh happens after navigation to the ML app. + await elasticChart.setNewChartUiDebugFlag(true); await ml.navigation.navigateToJobManagement(); await ml.testExecution.logTestStep('open job in anomaly explorer'); @@ -126,6 +137,183 @@ export default function ({ getService }: FtrProviderContext) { await ml.anomaliesTable.assertTableNotEmpty(); }); + it('renders Overall swim lane', async () => { + await ml.testExecution.logTestStep('has correct axes labels'); + await ml.swimLane.assertAxisLabels(overallSwimLaneTestSubj, 'x', [ + '2016-02-07 00:00', + '2016-02-08 00:00', + '2016-02-09 00:00', + '2016-02-10 00:00', + '2016-02-11 00:00', + '2016-02-12 00:00', + ]); + await ml.swimLane.assertAxisLabels(overallSwimLaneTestSubj, 'y', ['Overall']); + }); + + it('renders View By swim lane', async () => { + await ml.testExecution.logTestStep('has correct axes labels'); + await ml.swimLane.assertAxisLabels(viewBySwimLaneTestSubj, 'x', [ + '2016-02-07 00:00', + '2016-02-08 00:00', + '2016-02-09 00:00', + '2016-02-10 00:00', + '2016-02-11 00:00', + '2016-02-12 00:00', + ]); + await ml.swimLane.assertAxisLabels(viewBySwimLaneTestSubj, 'y', [ + 'AAL', + 'VRD', + 'EGF', + 'SWR', + 'AMX', + 'JZA', + 'TRS', + 'ACA', + 'BAW', + 'ASA', + ]); + }); + + it('supports cell selection by click on Overall swim lane', async () => { + await ml.testExecution.logTestStep('checking page state before the cell selection'); + await ml.anomalyExplorer.assertClearSelectionButtonVisible(false); + await ml.anomaliesTable.assertTableRowsCount(25); + await ml.anomalyExplorer.assertInfluencerFieldListLength('airline', 10); + await ml.anomalyExplorer.assertAnomalyExplorerChartsCount(0); + + await ml.testExecution.logTestStep('clicks on the Overall swim lane cell'); + const sampleCell = (await ml.swimLane.getCells(overallSwimLaneTestSubj))[0]; + await ml.swimLane.selectSingleCell(overallSwimLaneTestSubj, { + x: sampleCell.x + cellSize, + y: sampleCell.y + cellSize, + }); + // TODO extend cell data with X and Y values, and cell width + await ml.swimLane.assertSelection(overallSwimLaneTestSubj, { + x: [1454846400000, 1454860800000], + y: ['Overall'], + }); + await ml.anomalyExplorer.assertClearSelectionButtonVisible(true); + + await ml.testExecution.logTestStep('updates the View By swim lane'); + await ml.swimLane.assertAxisLabels(viewBySwimLaneTestSubj, 'y', ['EGF', 'DAL']); + + await ml.testExecution.logTestStep('renders anomaly explorer charts'); + await ml.anomalyExplorer.assertAnomalyExplorerChartsCount(4); + + await ml.testExecution.logTestStep('updates top influencers list'); + await ml.anomalyExplorer.assertInfluencerFieldListLength('airline', 2); + + await ml.testExecution.logTestStep('updates anomalies table'); + await ml.anomaliesTable.assertTableRowsCount(4); + + await ml.testExecution.logTestStep('updates the URL state'); + await ml.navigation.assertCurrentURLContains( + 'selectedLanes%3A!(Overall)%2CselectedTimes%3A!(1454846400%2C1454860800)%2CselectedType%3Aoverall%2CshowTopFieldValues%3A!t%2CviewByFieldName%3Aairline%2CviewByFromPage%3A1%2CviewByPerPage%3A10' + ); + + await ml.testExecution.logTestStep('clears the selection'); + await ml.anomalyExplorer.clearSwimLaneSelection(); + await ml.navigation.assertCurrentURLNotContain( + 'selectedLanes%3A!(Overall)%2CselectedTimes%3A!(1454846400%2C1454860800)%2CselectedType%3Aoverall%2CshowTopFieldValues%3A!t%2CviewByFieldName%3Aairline%2CviewByFromPage%3A1%2CviewByPerPage%3A10' + ); + await ml.anomaliesTable.assertTableRowsCount(25); + await ml.anomalyExplorer.assertInfluencerFieldListLength('airline', 10); + await ml.anomalyExplorer.assertAnomalyExplorerChartsCount(0); + }); + + it('allows to change the swim lane pagination', async () => { + await ml.testExecution.logTestStep('checks default pagination'); + await ml.swimLane.assertPageSize(viewBySwimLaneTestSubj, 10); + await ml.swimLane.assertActivePage(viewBySwimLaneTestSubj, 1); + + await ml.testExecution.logTestStep('updates pagination'); + await ml.swimLane.setPageSize(viewBySwimLaneTestSubj, 5); + + const axisLabels = await ml.swimLane.getAxisLabels(viewBySwimLaneTestSubj, 'y'); + expect(axisLabels.length).to.eql(5); + + await ml.swimLane.selectPage(viewBySwimLaneTestSubj, 3); + + await ml.testExecution.logTestStep('resets pagination'); + await ml.swimLane.setPageSize(viewBySwimLaneTestSubj, 10); + await ml.swimLane.assertActivePage(viewBySwimLaneTestSubj, 1); + }); + + it('supports cell selection by click on View By swim lane', async () => { + await ml.testExecution.logTestStep('checking page state before the cell selection'); + await ml.anomalyExplorer.assertClearSelectionButtonVisible(false); + await ml.anomaliesTable.assertTableRowsCount(25); + await ml.anomalyExplorer.assertInfluencerFieldListLength('airline', 10); + await ml.anomalyExplorer.assertAnomalyExplorerChartsCount(0); + + await ml.testExecution.logTestStep('clicks on the View By swim lane cell'); + await ml.anomalyExplorer.assertSwimlaneViewByExists(); + const sampleCell = (await ml.swimLane.getCells(viewBySwimLaneTestSubj))[0]; + await ml.swimLane.selectSingleCell(viewBySwimLaneTestSubj, { + x: sampleCell.x + cellSize, + y: sampleCell.y + cellSize, + }); + + await ml.testExecution.logTestStep('check page content'); + await ml.swimLane.assertSelection(viewBySwimLaneTestSubj, { + x: [1454817600000, 1454832000000], + y: ['AAL'], + }); + + await ml.anomaliesTable.assertTableRowsCount(1); + await ml.anomalyExplorer.assertInfluencerFieldListLength('airline', 1); + await ml.anomalyExplorer.assertAnomalyExplorerChartsCount(1); + + await ml.testExecution.logTestStep('highlights the Overall swim lane'); + await ml.swimLane.assertSelection(overallSwimLaneTestSubj, { + x: [1454817600000, 1454832000000], + y: ['Overall'], + }); + + await ml.testExecution.logTestStep('clears the selection'); + await ml.anomalyExplorer.clearSwimLaneSelection(); + await ml.anomaliesTable.assertTableRowsCount(25); + await ml.anomalyExplorer.assertInfluencerFieldListLength('airline', 10); + await ml.anomalyExplorer.assertAnomalyExplorerChartsCount(0); + }); + + it('supports cell selection by brush action', async () => { + await ml.testExecution.logTestStep('checking page state before the cell selection'); + await ml.anomalyExplorer.assertClearSelectionButtonVisible(false); + await ml.anomaliesTable.assertTableRowsCount(25); + await ml.anomalyExplorer.assertInfluencerFieldListLength('airline', 10); + await ml.anomalyExplorer.assertAnomalyExplorerChartsCount(0); + + await ml.anomalyExplorer.assertSwimlaneViewByExists(); + const cells = await ml.swimLane.getCells(viewBySwimLaneTestSubj); + + const sampleCell1 = cells[0]; + // Get cell from another row + const sampleCell2 = cells.find((c) => c.y !== sampleCell1.y); + + await ml.swimLane.selectCells(viewBySwimLaneTestSubj, { + x1: sampleCell1.x + cellSize, + y1: sampleCell1.y + cellSize, + x2: sampleCell2!.x + cellSize, + y2: sampleCell2!.y + cellSize, + }); + + await ml.swimLane.assertSelection(viewBySwimLaneTestSubj, { + x: [1454817600000, 1454846400000], + y: ['AAL', 'VRD'], + }); + + await ml.anomaliesTable.assertTableRowsCount(2); + await ml.anomalyExplorer.assertInfluencerFieldListLength('airline', 2); + await ml.anomalyExplorer.assertAnomalyExplorerChartsCount(2); + + await ml.testExecution.logTestStep('clears the selection'); + await ml.anomalyExplorer.clearSwimLaneSelection(); + await ml.anomaliesTable.assertTableRowsCount(25); + await ml.anomalyExplorer.assertInfluencerFieldListLength('airline', 10); + await ml.anomalyExplorer.assertAnomalyExplorerChartsCount(0); + }); + it('adds swim lane embeddable to a dashboard', async () => { // should be the last step because it navigates away from the Anomaly Explorer page await ml.testExecution.logTestStep( diff --git a/x-pack/test/functional/apps/security/index.js b/x-pack/test/functional/apps/security/index.js index d0592f43dfa60c..188f49e3002560 100644 --- a/x-pack/test/functional/apps/security/index.js +++ b/x-pack/test/functional/apps/security/index.js @@ -15,7 +15,6 @@ export default function ({ loadTestFile }) { loadTestFile(require.resolve('./users')); loadTestFile(require.resolve('./secure_roles_perm')); loadTestFile(require.resolve('./field_level_security')); - loadTestFile(require.resolve('./rbac_phase1')); loadTestFile(require.resolve('./user_email')); loadTestFile(require.resolve('./role_mappings')); }); diff --git a/x-pack/test/functional/apps/security/rbac_phase1.js b/x-pack/test/functional/apps/security/rbac_phase1.js deleted file mode 100644 index 851a923ec77580..00000000000000 --- a/x-pack/test/functional/apps/security/rbac_phase1.js +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import expect from '@kbn/expect'; -import { keyBy } from 'lodash'; -export default function ({ getService, getPageObjects }) { - const PageObjects = getPageObjects([ - 'security', - 'settings', - 'common', - 'visualize', - 'timePicker', - 'visChart', - ]); - const log = getService('log'); - const esArchiver = getService('esArchiver'); - const browser = getService('browser'); - const kibanaServer = getService('kibanaServer'); - - describe('rbac ', function () { - before(async () => { - await browser.setWindowSize(1600, 1000); - log.debug('users'); - await esArchiver.loadIfNeeded('logstash_functional'); - log.debug('load kibana index with default index pattern'); - await esArchiver.load('security/discover'); - await kibanaServer.uiSettings.replace({ defaultIndex: 'logstash-*' }); - await PageObjects.settings.navigateTo(); - await PageObjects.security.clickElasticsearchRoles(); - await PageObjects.security.addRole('rbac_all', { - kibana: { - global: ['all'], - }, - elasticsearch: { - indices: [ - { - names: ['logstash-*'], - privileges: ['read', 'view_index_metadata'], - }, - ], - }, - }); - - await PageObjects.security.clickElasticsearchRoles(); - await PageObjects.security.addRole('rbac_read', { - kibana: { - global: ['read'], - }, - elasticsearch: { - indices: [ - { - names: ['logstash-*'], - privileges: ['read', 'view_index_metadata'], - }, - ], - }, - }); - log.debug('After Add user new: , userObj.userName'); - await PageObjects.security.createUser({ - username: 'kibanauser', - password: 'changeme', - confirm_password: 'changeme', - full_name: 'kibanafirst kibanalast', - email: 'kibanauser@myEmail.com', - save: true, - roles: ['rbac_all'], - }); - log.debug('After Add user: , userObj.userName'); - const users = keyBy(await PageObjects.security.getElasticsearchUsers(), 'username'); - log.debug('actualUsers = %j', users); - log.debug('roles: ', users.kibanauser.roles); - expect(users.kibanauser.roles).to.eql(['rbac_all']); - expect(users.kibanauser.fullname).to.eql('kibanafirst kibanalast'); - expect(users.kibanauser.reserved).to.be(false); - log.debug('After Add user new: , userObj.userName'); - await PageObjects.security.createUser({ - username: 'kibanareadonly', - password: 'changeme', - confirm_password: 'changeme', - full_name: 'kibanareadonlyFirst kibanareadonlyLast', - email: 'kibanareadonly@myEmail.com', - save: true, - roles: ['rbac_read'], - }); - log.debug('After Add user: , userObj.userName'); - const users1 = keyBy(await PageObjects.security.getElasticsearchUsers(), 'username'); - const user = users1.kibanareadonly; - log.debug('actualUsers = %j', users1); - log.debug('roles: ', user.roles); - expect(user.roles).to.eql(['rbac_read']); - expect(user.fullname).to.eql('kibanareadonlyFirst kibanareadonlyLast'); - expect(user.reserved).to.be(false); - await PageObjects.security.forceLogout(); - }); - - // this is to acertain that all role assigned to the user can perform actions like creating a Visualization - it('rbac all role can save a visualization', async function () { - const vizName1 = 'Visualization VerticalBarChart'; - - log.debug('log in as kibanauser with rbac_all role'); - await PageObjects.security.login('kibanauser', 'changeme'); - log.debug('navigateToApp visualize'); - await PageObjects.visualize.navigateToNewAggBasedVisualization(); - log.debug('clickVerticalBarChart'); - await PageObjects.visualize.clickVerticalBarChart(); - await PageObjects.visualize.clickNewSearch(); - log.debug( - 'Set absolute time range from "' + - PageObjects.timePicker.defaultStartTime + - '" to "' + - PageObjects.timePicker.defaultEndTime + - '"' - ); - await PageObjects.timePicker.setDefaultAbsoluteRange(); - await PageObjects.visChart.waitForVisualization(); - await PageObjects.visualize.saveVisualizationExpectSuccess(vizName1); - await PageObjects.security.forceLogout(); - }); - - after(async function () { - await PageObjects.security.forceLogout(); - }); - }); -} diff --git a/x-pack/test/functional/page_objects/lens_page.ts b/x-pack/test/functional/page_objects/lens_page.ts index 3858b5834d4831..3c2f7f12683316 100644 --- a/x-pack/test/functional/page_objects/lens_page.ts +++ b/x-pack/test/functional/page_objects/lens_page.ts @@ -188,6 +188,15 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont }); }, + async removeField() { + await retry.try(async () => { + await testSubjects.click('lnsFieldListPanelRemove'); + await testSubjects.missingOrFail('lnsFieldListPanelRemove'); + await testSubjects.click('confirmModalConfirmButton'); + await testSubjects.missingOrFail('confirmModalConfirmButton'); + }); + }, + async searchField(name: string) { await testSubjects.setValue('lnsIndexPatternFieldSearch', name); }, @@ -198,6 +207,12 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont }); }, + async waitForFieldMissing(field: string) { + await retry.try(async () => { + await testSubjects.missingOrFail(`lnsFieldListPanelField-${field}`); + }); + }, + /** * Copies field to chosen destination that is defined by distance of `steps` * (right arrow presses) from it diff --git a/x-pack/test/functional/services/ml/anomalies_table.ts b/x-pack/test/functional/services/ml/anomalies_table.ts index 54109e40a75262..30bb3e67bc862d 100644 --- a/x-pack/test/functional/services/ml/anomalies_table.ts +++ b/x-pack/test/functional/services/ml/anomalies_table.ts @@ -22,6 +22,14 @@ export function MachineLearningAnomaliesTableProvider({ getService }: FtrProvide return await testSubjects.findAll('mlAnomaliesTable > ~mlAnomaliesListRow'); }, + async assertTableRowsCount(expectedCount: number) { + const actualCount = (await this.getTableRows()).length; + expect(actualCount).to.eql( + expectedCount, + `Expect anomaly table rows count to be ${expectedCount}, got ${actualCount}` + ); + }, + async getRowSubjByRowIndex(rowIndex: number) { const tableRows = await this.getTableRows(); expect(tableRows.length).to.be.greaterThan( diff --git a/x-pack/test/functional/services/ml/anomaly_explorer.ts b/x-pack/test/functional/services/ml/anomaly_explorer.ts index 7fe53b1e3773ab..4b1992777b8a76 100644 --- a/x-pack/test/functional/services/ml/anomaly_explorer.ts +++ b/x-pack/test/functional/services/ml/anomaly_explorer.ts @@ -111,5 +111,30 @@ export function MachineLearningAnomalyExplorerProvider({ getService }: FtrProvid await searchBarInput.clearValueWithKeyboard(); await searchBarInput.type(filter); }, + + async assertClearSelectionButtonVisible(expectVisible: boolean) { + if (expectVisible) { + await testSubjects.existOrFail('mlAnomalyTimelineClearSelection'); + } else { + await testSubjects.missingOrFail('mlAnomalyTimelineClearSelection'); + } + }, + + async clearSwimLaneSelection() { + await this.assertClearSelectionButtonVisible(true); + await testSubjects.click('mlAnomalyTimelineClearSelection'); + await this.assertClearSelectionButtonVisible(false); + }, + + async assertAnomalyExplorerChartsCount(expectedChartsCount: number) { + const chartsContainer = await testSubjects.find('mlExplorerChartsContainer'); + const actualChartsCount = ( + await chartsContainer.findAllByClassName('ml-explorer-chart-container', 3000) + ).length; + expect(actualChartsCount).to.eql( + expectedChartsCount, + `Expect ${expectedChartsCount} charts to appear, got ${actualChartsCount}` + ); + }, }; } diff --git a/x-pack/test/functional/services/ml/index.ts b/x-pack/test/functional/services/ml/index.ts index 894ba3d6ef07d0..83c0c5e4164344 100644 --- a/x-pack/test/functional/services/ml/index.ts +++ b/x-pack/test/functional/services/ml/index.ts @@ -45,6 +45,7 @@ import { MachineLearningTestExecutionProvider } from './test_execution'; import { MachineLearningTestResourcesProvider } from './test_resources'; import { MachineLearningDataVisualizerTableProvider } from './data_visualizer_table'; import { MachineLearningAlertingProvider } from './alerting'; +import { SwimLaneProvider } from './swim_lane'; export function MachineLearningProvider(context: FtrProviderContext) { const commonAPI = MachineLearningCommonAPIProvider(context); @@ -96,6 +97,7 @@ export function MachineLearningProvider(context: FtrProviderContext) { const testExecution = MachineLearningTestExecutionProvider(context); const testResources = MachineLearningTestResourcesProvider(context); const alerting = MachineLearningAlertingProvider(context, commonUI); + const swimLane = SwimLaneProvider(context); return { anomaliesTable, @@ -134,6 +136,7 @@ export function MachineLearningProvider(context: FtrProviderContext) { settingsCalendar, settingsFilterList, singleMetricViewer, + swimLane, testExecution, testResources, }; diff --git a/x-pack/test/functional/services/ml/navigation.ts b/x-pack/test/functional/services/ml/navigation.ts index 93b8a5efecc079..075c788a863363 100644 --- a/x-pack/test/functional/services/ml/navigation.ts +++ b/x-pack/test/functional/services/ml/navigation.ts @@ -14,6 +14,7 @@ export function MachineLearningNavigationProvider({ getPageObjects, }: FtrProviderContext) { const retry = getService('retry'); + const browser = getService('browser'); const testSubjects = getService('testSubjects'); const PageObjects = getPageObjects(['common']); @@ -156,7 +157,7 @@ export function MachineLearningNavigationProvider({ }, async navigateToSingleMetricViewerViaAnomalyExplorer() { - // clicks the `Single Metric Viewere` icon on the button group to switch result views + // clicks the `Single Metric Viewer` icon on the button group to switch result views await testSubjects.click('mlAnomalyResultsViewSelectorSingleMetricViewer'); await retry.tryForTime(60 * 1000, async () => { // verify that the single metric viewer page is visible @@ -193,5 +194,25 @@ export function MachineLearningNavigationProvider({ await testSubjects.existOrFail('homeApp', { timeout: 2000 }); }); }, + + /** + * Assert the active URL. + * @param expectedUrlPart - URL component excluding host + */ + async assertCurrentURLContains(expectedUrlPart: string) { + const currentUrl = await browser.getCurrentUrl(); + expect(currentUrl).to.include.string( + expectedUrlPart, + `Expected the current URL "${currentUrl}" to include ${expectedUrlPart}` + ); + }, + + async assertCurrentURLNotContain(expectedUrlPart: string) { + const currentUrl = await browser.getCurrentUrl(); + expect(currentUrl).to.not.include.string( + expectedUrlPart, + `Expected the current URL "${currentUrl}" to not include ${expectedUrlPart}` + ); + }, }; } diff --git a/x-pack/test/functional/services/ml/swim_lane.ts b/x-pack/test/functional/services/ml/swim_lane.ts new file mode 100644 index 00000000000000..d659b24559a430 --- /dev/null +++ b/x-pack/test/functional/services/ml/swim_lane.ts @@ -0,0 +1,212 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import expect from '@kbn/expect'; +import { DebugState } from '@elastic/charts'; +import { DebugStateAxis } from '@elastic/charts/dist/state/types'; +import { FtrProviderContext } from '../../ftr_provider_context'; +import { WebElementWrapper } from '../../../../../test/functional/services/lib/web_element_wrapper'; + +type HeatmapDebugState = Required>; + +export function SwimLaneProvider({ getService }: FtrProviderContext) { + const elasticChart = getService('elasticChart'); + const browser = getService('browser'); + const testSubjects = getService('testSubjects'); + + /** + * Y axis labels width + padding + */ + const xOffset = 185; + + /** + * Get coordinates relative to the left top corner of the canvas + * and transpose them from the center point. + */ + async function getCoordinatesFromCenter( + el: WebElementWrapper, + coordinates: { x: number; y: number } + ) { + const { width, height } = await el.getSize(); + + const elCenter = { + x: Math.round(width / 2), + y: Math.round(height / 2), + }; + + /** + * Origin of the element uses the center point, hence we need ot adjust + * the click coordinated accordingly. + */ + const resultX = xOffset + Math.round(coordinates.x) - elCenter.x; + const resultY = Math.round(coordinates.y) - elCenter.y; + + return { + x: resultX, + y: resultY, + }; + } + + const getRenderTracker = async (testSubj: string) => { + const renderCount = await elasticChart.getVisualizationRenderingCount(testSubj); + + return { + async verify() { + if (testSubj === 'mlAnomalyExplorerSwimlaneViewBy') { + // We have a glitchy behaviour when clicking on the View By swim lane. + // The entire charts is re-rendered, hence it requires a different check + await testSubjects.existOrFail(testSubj); + await elasticChart.waitForRenderComplete(testSubj); + } else { + await elasticChart.waitForRenderingCount(renderCount + 1, testSubj); + } + }, + }; + }; + + return { + async getDebugState(testSubj: string): Promise { + const state = await elasticChart.getChartDebugData(testSubj); + if (!state) { + throw new Error('Swim lane debug state is not available'); + } + return state as HeatmapDebugState; + }, + + async getAxisLabels(testSubj: string, axis: 'x' | 'y'): Promise { + const state = await this.getDebugState(testSubj); + return state.axes[axis][0].labels; + }, + + async assertAxisLabels(testSubj: string, axis: 'x' | 'y', expectedValues: string[]) { + const actualValues = await this.getAxisLabels(testSubj, axis); + expect(actualValues).to.eql( + expectedValues, + `Expected swim lane ${axis} labels to be ${expectedValues}, got ${actualValues}` + ); + }, + + async getCells(testSubj: string): Promise { + const state = await this.getDebugState(testSubj); + return state.heatmap.cells; + }, + + async getHighlighted(testSubj: string): Promise { + const state = await this.getDebugState(testSubj); + return state.heatmap.selection; + }, + + async assertSelection( + testSubj: string, + expectedData: HeatmapDebugState['heatmap']['selection']['data'], + expectedArea?: HeatmapDebugState['heatmap']['selection']['area'] + ) { + const actualSelection = await this.getHighlighted(testSubj); + expect(actualSelection.data).to.eql( + expectedData, + `Expected swim lane to have ${ + expectedData + ? `selected X-axis values ${expectedData.x.join( + ',' + )} and Y-axis values ${expectedData.y.join(',')}` + : 'no data selected' + }, got ${ + actualSelection.data + ? `${actualSelection.data.x.join(',')} and ${actualSelection.data.y.join(',')}` + : 'null' + }` + ); + if (expectedArea) { + expect(actualSelection.area).to.eql(expectedArea); + } + }, + + /** + * Selects a single cell + * @param testSubj + * @param x - number of pixels from the Y-axis + * @param y - number of pixels from the top of the canvas element + */ + async selectSingleCell(testSubj: string, { x, y }: { x: number; y: number }) { + await testSubjects.existOrFail(testSubj); + await testSubjects.scrollIntoView(testSubj); + const renderTracker = await getRenderTracker(testSubj); + const el = await elasticChart.getCanvas(testSubj); + + const { x: resultX, y: resultY } = await getCoordinatesFromCenter(el, { x, y }); + + await browser + .getActions() + .move({ x: resultX, y: resultY, origin: el._webElement }) + .click() + .perform(); + + await renderTracker.verify(); + }, + + async selectCells( + testSubj: string, + coordinates: { x1: number; x2: number; y1: number; y2: number } + ) { + await testSubjects.existOrFail(testSubj); + await testSubjects.scrollIntoView(testSubj); + const renderTracker = await getRenderTracker(testSubj); + + const el = await elasticChart.getCanvas(testSubj); + + const { x: resultX1, y: resultY1 } = await getCoordinatesFromCenter(el, { + x: coordinates.x1, + y: coordinates.y1, + }); + const { x: resultX2, y: resultY2 } = await getCoordinatesFromCenter(el, { + x: coordinates.x2, + y: coordinates.y2, + }); + + await browser.dragAndDrop( + { + location: el, + offset: { x: resultX1, y: resultY1 }, + }, + { + location: el, + offset: { x: resultX2, y: resultY2 }, + } + ); + + await renderTracker.verify(); + }, + + async assertActivePage(testSubj: string, expectedPage: number) { + const pagination = await testSubjects.find(`${testSubj} > mlSwimLanePagination`); + const activePage = await pagination.findByCssSelector( + '.euiPaginationButton-isActive .euiButtonEmpty__text' + ); + const text = await activePage.getVisibleText(); + expect(text).to.eql(expectedPage); + }, + + async assertPageSize(testSubj: string, expectedPageSize: number) { + const actualPageSize = await testSubjects.find( + `${testSubj} > ${expectedPageSize.toString()}` + ); + expect(await actualPageSize.isDisplayed()).to.be(true); + }, + + async selectPage(testSubj: string, page: number) { + await testSubjects.click(`${testSubj} > pagination-button-${page - 1}`); + await this.assertActivePage(testSubj, page); + }, + + async setPageSize(testSubj: string, rowsCount: 5 | 10 | 20 | 50 | 100) { + await testSubjects.click(`${testSubj} > mlSwimLanePageSizeControl`); + await testSubjects.existOrFail('mlSwimLanePageSizePanel'); + await testSubjects.click(`mlSwimLanePageSizePanel > ${rowsCount} rows`); + await this.assertPageSize(testSubj, rowsCount); + }, + }; +} diff --git a/x-pack/test/functional/services/search_sessions.ts b/x-pack/test/functional/services/search_sessions.ts index 3ecb056c06074a..34bea998925e50 100644 --- a/x-pack/test/functional/services/search_sessions.ts +++ b/x-pack/test/functional/services/search_sessions.ts @@ -72,7 +72,9 @@ export function SearchSessionsProvider({ getService }: FtrProviderContext) { if (searchSessionName) { await testSubjects.click('searchSessionNameEdit'); - await testSubjects.setValue('searchSessionNameInput', searchSessionName); + await testSubjects.setValue('searchSessionNameInput', searchSessionName, { + clearWithKeyboard: true, + }); await testSubjects.click('searchSessionNameSave'); } diff --git a/x-pack/test/security_api_integration/session_invalidate.config.ts b/x-pack/test/security_api_integration/session_invalidate.config.ts new file mode 100644 index 00000000000000..82510062035a95 --- /dev/null +++ b/x-pack/test/security_api_integration/session_invalidate.config.ts @@ -0,0 +1,55 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { resolve } from 'path'; +import { FtrConfigProviderContext } from '@kbn/test/types/ftr'; +import { services } from './services'; + +// the default export of config files must be a config provider +// that returns an object with the projects config values +export default async function ({ readConfigFile }: FtrConfigProviderContext) { + const xPackAPITestsConfig = await readConfigFile(require.resolve('../api_integration/config.ts')); + + const kibanaPort = xPackAPITestsConfig.get('servers.kibana.port'); + const idpPath = resolve(__dirname, './fixtures/saml/idp_metadata.xml'); + + return { + testFiles: [resolve(__dirname, './tests/session_invalidate')], + services, + servers: xPackAPITestsConfig.get('servers'), + esTestCluster: { + ...xPackAPITestsConfig.get('esTestCluster'), + serverArgs: [ + ...xPackAPITestsConfig.get('esTestCluster.serverArgs'), + 'xpack.security.authc.token.enabled=true', + 'xpack.security.authc.realms.native.native1.order=0', + 'xpack.security.authc.realms.saml.saml1.order=1', + `xpack.security.authc.realms.saml.saml1.idp.metadata.path=${idpPath}`, + 'xpack.security.authc.realms.saml.saml1.idp.entity_id=http://www.elastic.co/saml1', + `xpack.security.authc.realms.saml.saml1.sp.entity_id=http://localhost:${kibanaPort}`, + `xpack.security.authc.realms.saml.saml1.sp.logout=http://localhost:${kibanaPort}/logout`, + `xpack.security.authc.realms.saml.saml1.sp.acs=http://localhost:${kibanaPort}/api/security/saml/callback`, + 'xpack.security.authc.realms.saml.saml1.attributes.principal=urn:oid:0.0.7', + ], + }, + + kbnTestServer: { + ...xPackAPITestsConfig.get('kbnTestServer'), + serverArgs: [ + ...xPackAPITestsConfig.get('kbnTestServer.serverArgs'), + `--xpack.security.authc.providers=${JSON.stringify({ + basic: { basic1: { order: 0 } }, + saml: { saml1: { order: 1, realm: 'saml1' } }, + })}`, + ], + }, + + junit: { + reportName: 'X-Pack Security API Integration Tests (Session Invalidate)', + }, + }; +} diff --git a/x-pack/test/security_api_integration/tests/session_invalidate/index.ts b/x-pack/test/security_api_integration/tests/session_invalidate/index.ts new file mode 100644 index 00000000000000..6408e4cfbd43d3 --- /dev/null +++ b/x-pack/test/security_api_integration/tests/session_invalidate/index.ts @@ -0,0 +1,16 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { FtrProviderContext } from '../../ftr_provider_context'; + +export default function ({ loadTestFile }: FtrProviderContext) { + describe('security APIs - Session Invalidate', function () { + this.tags('ciGroup6'); + + loadTestFile(require.resolve('./invalidate')); + }); +} diff --git a/x-pack/test/security_api_integration/tests/session_invalidate/invalidate.ts b/x-pack/test/security_api_integration/tests/session_invalidate/invalidate.ts new file mode 100644 index 00000000000000..60605c88ce45e7 --- /dev/null +++ b/x-pack/test/security_api_integration/tests/session_invalidate/invalidate.ts @@ -0,0 +1,350 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import request, { Cookie } from 'request'; +import expect from '@kbn/expect'; +import { adminTestUser } from '@kbn/test'; +import type { AuthenticationProvider } from '../../../../plugins/security/common/model'; +import { getSAMLRequestId, getSAMLResponse } from '../../fixtures/saml/saml_tools'; +import { FtrProviderContext } from '../../ftr_provider_context'; + +export default function ({ getService }: FtrProviderContext) { + const supertest = getService('supertestWithoutAuth'); + const es = getService('es'); + const security = getService('security'); + const esDeleteAllIndices = getService('esDeleteAllIndices'); + const config = getService('config'); + const randomness = getService('randomness'); + const kibanaServerConfig = config.get('servers.kibana'); + const notSuperuserTestUser = { username: 'test_user', password: 'changeme' }; + + async function checkSessionCookie( + sessionCookie: Cookie, + username: string, + provider: AuthenticationProvider + ) { + const apiResponse = await supertest + .get('/internal/security/me') + .set('kbn-xsrf', 'xxx') + .set('Cookie', sessionCookie.cookieString()) + .expect(200); + + expect(apiResponse.body.username).to.be(username); + expect(apiResponse.body.authentication_provider).to.eql(provider); + + return Array.isArray(apiResponse.headers['set-cookie']) + ? request.cookie(apiResponse.headers['set-cookie'][0])! + : undefined; + } + + async function loginWithSAML() { + const handshakeResponse = await supertest + .post('/internal/security/login') + .set('kbn-xsrf', 'xxx') + .send({ providerType: 'saml', providerName: 'saml1', currentURL: '' }) + .expect(200); + + const authenticationResponse = await supertest + .post('/api/security/saml/callback') + .set('kbn-xsrf', 'xxx') + .set('Cookie', request.cookie(handshakeResponse.headers['set-cookie'][0])!.cookieString()) + .send({ + SAMLResponse: await getSAMLResponse({ + destination: `http://localhost:${kibanaServerConfig.port}/api/security/saml/callback`, + sessionIndex: String(randomness.naturalNumber()), + inResponseTo: await getSAMLRequestId(handshakeResponse.body.location), + }), + }) + .expect(302); + + const cookie = request.cookie(authenticationResponse.headers['set-cookie'][0])!; + await checkSessionCookie(cookie, 'a@b.c', { type: 'saml', name: 'saml1' }); + return cookie; + } + + async function loginWithBasic(credentials: { username: string; password: string }) { + const authenticationResponse = await supertest + .post('/internal/security/login') + .set('kbn-xsrf', 'xxx') + .send({ + providerType: 'basic', + providerName: 'basic1', + currentURL: '/', + params: credentials, + }) + .expect(200); + + const cookie = request.cookie(authenticationResponse.headers['set-cookie'][0])!; + await checkSessionCookie(cookie, credentials.username, { type: 'basic', name: 'basic1' }); + return cookie; + } + + describe('Session Invalidate', () => { + beforeEach(async () => { + await es.cluster.health({ index: '.kibana_security_session*', wait_for_status: 'green' }); + await esDeleteAllIndices('.kibana_security_session*'); + await security.testUser.setRoles(['kibana_admin']); + }); + + it('should be able to invalidate all sessions at once', async function () { + const basicSessionCookie = await loginWithBasic(notSuperuserTestUser); + const samlSessionCookie = await loginWithSAML(); + + // Invalidate all sessions and make sure neither of the sessions is active now. + await supertest + .post('/api/security/session/_invalidate') + .set('kbn-xsrf', 'xxx') + .auth(adminTestUser.username, adminTestUser.password) + .send({ match: 'all' }) + .expect(200, { total: 2 }); + await supertest + .get('/internal/security/me') + .set('kbn-xsrf', 'xxx') + .set('Cookie', basicSessionCookie.cookieString()) + .expect(401); + await supertest + .get('/internal/security/me') + .set('kbn-xsrf', 'xxx') + .set('Cookie', samlSessionCookie.cookieString()) + .expect(401); + }); + + it('should do nothing if specified provider type is not configured', async function () { + const basicSessionCookie = await loginWithBasic(notSuperuserTestUser); + const samlSessionCookie = await loginWithSAML(); + + await supertest + .post('/api/security/session/_invalidate') + .set('kbn-xsrf', 'xxx') + .auth(adminTestUser.username, adminTestUser.password) + .send({ match: 'query', query: { provider: { type: 'oidc' } } }) + .expect(200, { total: 0 }); + await checkSessionCookie(basicSessionCookie, notSuperuserTestUser.username, { + type: 'basic', + name: 'basic1', + }); + await checkSessionCookie(samlSessionCookie, 'a@b.c', { type: 'saml', name: 'saml1' }); + }); + + it('should be able to invalidate session only for a specific provider type', async function () { + const basicSessionCookie = await loginWithBasic(notSuperuserTestUser); + const samlSessionCookie = await loginWithSAML(); + + // Invalidate `basic` session and make sure that only `saml` session is still active. + await supertest + .post('/api/security/session/_invalidate') + .set('kbn-xsrf', 'xxx') + .auth(adminTestUser.username, adminTestUser.password) + .send({ match: 'query', query: { provider: { type: 'basic' } } }) + .expect(200, { total: 1 }); + await supertest + .get('/internal/security/me') + .set('kbn-xsrf', 'xxx') + .set('Cookie', basicSessionCookie.cookieString()) + .expect(401); + await checkSessionCookie(samlSessionCookie, 'a@b.c', { type: 'saml', name: 'saml1' }); + + // Invalidate `saml` session and make sure neither of the sessions is active now. + await supertest + .post('/api/security/session/_invalidate') + .set('kbn-xsrf', 'xxx') + .auth(adminTestUser.username, adminTestUser.password) + .send({ match: 'query', query: { provider: { type: 'saml' } } }) + .expect(200, { total: 1 }); + await supertest + .get('/internal/security/me') + .set('kbn-xsrf', 'xxx') + .set('Cookie', samlSessionCookie.cookieString()) + .expect(401); + }); + + it('should do nothing if specified provider name is not configured', async function () { + const basicSessionCookie = await loginWithBasic(notSuperuserTestUser); + const samlSessionCookie = await loginWithSAML(); + + await supertest + .post('/api/security/session/_invalidate') + .set('kbn-xsrf', 'xxx') + .auth(adminTestUser.username, adminTestUser.password) + .send({ match: 'query', query: { provider: { type: 'basic', name: 'basic2' } } }) + .expect(200, { total: 0 }); + await supertest + .post('/api/security/session/_invalidate') + .set('kbn-xsrf', 'xxx') + .auth(adminTestUser.username, adminTestUser.password) + .send({ match: 'query', query: { provider: { type: 'saml', name: 'saml2' } } }) + .expect(200, { total: 0 }); + await checkSessionCookie(basicSessionCookie, notSuperuserTestUser.username, { + type: 'basic', + name: 'basic1', + }); + await checkSessionCookie(samlSessionCookie, 'a@b.c', { type: 'saml', name: 'saml1' }); + }); + + it('should be able to invalidate session only for a specific provider name', async function () { + const basicSessionCookie = await loginWithBasic(notSuperuserTestUser); + const samlSessionCookie = await loginWithSAML(); + + // Invalidate `saml1` session and make sure that only `basic1` session is still active. + await supertest + .post('/api/security/session/_invalidate') + .set('kbn-xsrf', 'xxx') + .auth(adminTestUser.username, adminTestUser.password) + .send({ match: 'query', query: { provider: { type: 'saml', name: 'saml1' } } }) + .expect(200, { total: 1 }); + await checkSessionCookie(basicSessionCookie, notSuperuserTestUser.username, { + type: 'basic', + name: 'basic1', + }); + await supertest + .get('/internal/security/me') + .set('kbn-xsrf', 'xxx') + .set('Cookie', samlSessionCookie.cookieString()) + .expect(401); + + // Invalidate `basic1` session and make sure neither of the sessions is active now. + await supertest + .post('/api/security/session/_invalidate') + .set('kbn-xsrf', 'xxx') + .auth(adminTestUser.username, adminTestUser.password) + .send({ match: 'query', query: { provider: { type: 'basic', name: 'basic1' } } }) + .expect(200, { total: 1 }); + await supertest + .get('/internal/security/me') + .set('kbn-xsrf', 'xxx') + .set('Cookie', basicSessionCookie.cookieString()) + .expect(401); + }); + + it('should do nothing if specified username does not have session', async function () { + const basicSessionCookie = await loginWithBasic(notSuperuserTestUser); + const samlSessionCookie = await loginWithSAML(); + + await supertest + .post('/api/security/session/_invalidate') + .set('kbn-xsrf', 'xxx') + .auth(adminTestUser.username, adminTestUser.password) + .send({ + match: 'query', + query: { + provider: { type: 'basic', name: 'basic1' }, + username: `_${notSuperuserTestUser.username}`, + }, + }) + .expect(200, { total: 0 }); + await supertest + .post('/api/security/session/_invalidate') + .set('kbn-xsrf', 'xxx') + .auth(adminTestUser.username, adminTestUser.password) + .send({ + match: 'query', + query: { provider: { type: 'saml', name: 'saml1' }, username: '_a@b.c' }, + }) + .expect(200, { total: 0 }); + await checkSessionCookie(basicSessionCookie, notSuperuserTestUser.username, { + type: 'basic', + name: 'basic1', + }); + await checkSessionCookie(samlSessionCookie, 'a@b.c', { type: 'saml', name: 'saml1' }); + }); + + it('should be able to invalidate session only for a specific user', async function () { + const basicSessionCookie = await loginWithBasic(notSuperuserTestUser); + const samlSessionCookie = await loginWithSAML(); + + // Invalidate session for `test_user` and make sure that only session of `a@b.c` is still active. + await supertest + .post('/api/security/session/_invalidate') + .set('kbn-xsrf', 'xxx') + .auth(adminTestUser.username, adminTestUser.password) + .send({ + match: 'query', + query: { + provider: { type: 'basic', name: 'basic1' }, + username: notSuperuserTestUser.username, + }, + }) + .expect(200, { total: 1 }); + await supertest + .get('/internal/security/me') + .set('kbn-xsrf', 'xxx') + .set('Cookie', basicSessionCookie.cookieString()) + .expect(401); + await checkSessionCookie(samlSessionCookie, 'a@b.c', { type: 'saml', name: 'saml1' }); + + // Invalidate session for `a@b.c` and make sure neither of the sessions is active now. + await supertest + .post('/api/security/session/_invalidate') + .set('kbn-xsrf', 'xxx') + .auth(adminTestUser.username, adminTestUser.password) + .send({ + match: 'query', + query: { provider: { type: 'saml', name: 'saml1' }, username: 'a@b.c' }, + }) + .expect(200, { total: 1 }); + await supertest + .get('/internal/security/me') + .set('kbn-xsrf', 'xxx') + .set('Cookie', samlSessionCookie.cookieString()) + .expect(401); + }); + + it('only super users should be able to invalidate sessions', async function () { + const basicSessionCookie = await loginWithBasic(notSuperuserTestUser); + const samlSessionCookie = await loginWithSAML(); + + // User without a superuser role shouldn't be able to invalidate sessions. + await supertest + .post('/api/security/session/_invalidate') + .set('kbn-xsrf', 'xxx') + .auth(notSuperuserTestUser.username, notSuperuserTestUser.password) + .send({ match: 'all' }) + .expect(403); + await supertest + .post('/api/security/session/_invalidate') + .set('kbn-xsrf', 'xxx') + .auth(notSuperuserTestUser.username, notSuperuserTestUser.password) + .send({ match: 'query', query: { provider: { type: 'basic' } } }) + .expect(403); + await supertest + .post('/api/security/session/_invalidate') + .set('kbn-xsrf', 'xxx') + .auth(notSuperuserTestUser.username, notSuperuserTestUser.password) + .send({ + match: 'query', + query: { provider: { type: 'basic' }, username: notSuperuserTestUser.username }, + }) + .expect(403); + + await checkSessionCookie(basicSessionCookie, notSuperuserTestUser.username, { + type: 'basic', + name: 'basic1', + }); + await checkSessionCookie(samlSessionCookie, 'a@b.c', { type: 'saml', name: 'saml1' }); + + // With superuser role, it should be possible now. + await security.testUser.setRoles(['superuser']); + + await supertest + .post('/api/security/session/_invalidate') + .set('kbn-xsrf', 'xxx') + .auth(notSuperuserTestUser.username, notSuperuserTestUser.password) + .send({ match: 'all' }) + .expect(200, { total: 2 }); + await supertest + .get('/internal/security/me') + .set('kbn-xsrf', 'xxx') + .set('Cookie', basicSessionCookie.cookieString()) + .expect(401); + await supertest + .get('/internal/security/me') + .set('kbn-xsrf', 'xxx') + .set('Cookie', samlSessionCookie.cookieString()) + .expect(401); + }); + }); +}