diff --git a/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts b/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts index 7f01f9fcb297c..61dc9881f5bcc 100644 --- a/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts +++ b/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts @@ -184,7 +184,7 @@ export class CsvGenerator { data: dataTableCell, }: { column: string; - data: any; + data: unknown; }): string => { let cell: string[] | string | object; // check truthiness to guard against _score, _type, etc diff --git a/x-pack/plugins/reporting/server/usage/__snapshots__/reporting_usage_collector.test.ts.snap b/x-pack/plugins/reporting/server/usage/__snapshots__/reporting_usage_collector.test.ts.snap index 4fab4ca72abab..12debe5c85d5e 100644 --- a/x-pack/plugins/reporting/server/usage/__snapshots__/reporting_usage_collector.test.ts.snap +++ b/x-pack/plugins/reporting/server/usage/__snapshots__/reporting_usage_collector.test.ts.snap @@ -6,23 +6,73 @@ Object { "isReady": [Function], "schema": Object { "PNG": Object { + "app": Object { + "canvas workpad": Object { + "type": "long", + }, + "dashboard": Object { + "type": "long", + }, + "search": Object { + "type": "long", + }, + "visualization": Object { + "type": "long", + }, + }, "available": Object { "type": "boolean", }, "deprecated": Object { "type": "long", }, + "layout": Object { + "canvas": Object { + "type": "long", + }, + "preserve_layout": Object { + "type": "long", + }, + "print": Object { + "type": "long", + }, + }, "total": Object { "type": "long", }, }, "PNGV2": Object { + "app": Object { + "canvas workpad": Object { + "type": "long", + }, + "dashboard": Object { + "type": "long", + }, + "search": Object { + "type": "long", + }, + "visualization": Object { + "type": "long", + }, + }, "available": Object { "type": "boolean", }, "deprecated": Object { "type": "long", }, + "layout": Object { + "canvas": Object { + "type": "long", + }, + "preserve_layout": Object { + "type": "long", + }, + "print": Object { + "type": "long", + }, + }, "total": Object { "type": "long", }, @@ -37,23 +87,109 @@ Object { "type": "keyword", }, "csv": Object { + "app": Object { + "canvas workpad": Object { + "type": "long", + }, + "dashboard": Object { + "type": "long", + }, + "search": Object { + "type": "long", + }, + "visualization": Object { + "type": "long", + }, + }, "available": Object { "type": "boolean", }, "deprecated": Object { "type": "long", }, + "layout": Object { + "canvas": Object { + "type": "long", + }, + "preserve_layout": Object { + "type": "long", + }, + "print": Object { + "type": "long", + }, + }, "total": Object { "type": "long", }, }, "csv_searchsource": Object { + "app": Object { + "canvas workpad": Object { + "type": "long", + }, + "dashboard": Object { + "type": "long", + }, + "search": Object { + "type": "long", + }, + "visualization": Object { + "type": "long", + }, + }, "available": Object { "type": "boolean", }, "deprecated": Object { "type": "long", }, + "layout": Object { + "canvas": Object { + "type": "long", + }, + "preserve_layout": Object { + "type": "long", + }, + "print": Object { + "type": "long", + }, + }, + "total": Object { + "type": "long", + }, + }, + "csv_searchsource_immediate": Object { + "app": Object { + "canvas workpad": Object { + "type": "long", + }, + "dashboard": Object { + "type": "long", + }, + "search": Object { + "type": "long", + }, + "visualization": Object { + "type": "long", + }, + }, + "available": Object { + "type": "boolean", + }, + "deprecated": Object { + "type": "long", + }, + "layout": Object { + "canvas": Object { + "type": "long", + }, + "preserve_layout": Object { + "type": "long", + }, + "print": Object { + "type": "long", + }, + }, "total": Object { "type": "long", }, @@ -63,23 +199,73 @@ Object { }, "last7Days": Object { "PNG": Object { + "app": Object { + "canvas workpad": Object { + "type": "long", + }, + "dashboard": Object { + "type": "long", + }, + "search": Object { + "type": "long", + }, + "visualization": Object { + "type": "long", + }, + }, "available": Object { "type": "boolean", }, "deprecated": Object { "type": "long", }, + "layout": Object { + "canvas": Object { + "type": "long", + }, + "preserve_layout": Object { + "type": "long", + }, + "print": Object { + "type": "long", + }, + }, "total": Object { "type": "long", }, }, "PNGV2": Object { + "app": Object { + "canvas workpad": Object { + "type": "long", + }, + "dashboard": Object { + "type": "long", + }, + "search": Object { + "type": "long", + }, + "visualization": Object { + "type": "long", + }, + }, "available": Object { "type": "boolean", }, "deprecated": Object { "type": "long", }, + "layout": Object { + "canvas": Object { + "type": "long", + }, + "preserve_layout": Object { + "type": "long", + }, + "print": Object { + "type": "long", + }, + }, "total": Object { "type": "long", }, @@ -88,23 +274,109 @@ Object { "type": "long", }, "csv": Object { + "app": Object { + "canvas workpad": Object { + "type": "long", + }, + "dashboard": Object { + "type": "long", + }, + "search": Object { + "type": "long", + }, + "visualization": Object { + "type": "long", + }, + }, "available": Object { "type": "boolean", }, "deprecated": Object { "type": "long", }, + "layout": Object { + "canvas": Object { + "type": "long", + }, + "preserve_layout": Object { + "type": "long", + }, + "print": Object { + "type": "long", + }, + }, "total": Object { "type": "long", }, }, "csv_searchsource": Object { + "app": Object { + "canvas workpad": Object { + "type": "long", + }, + "dashboard": Object { + "type": "long", + }, + "search": Object { + "type": "long", + }, + "visualization": Object { + "type": "long", + }, + }, + "available": Object { + "type": "boolean", + }, + "deprecated": Object { + "type": "long", + }, + "layout": Object { + "canvas": Object { + "type": "long", + }, + "preserve_layout": Object { + "type": "long", + }, + "print": Object { + "type": "long", + }, + }, + "total": Object { + "type": "long", + }, + }, + "csv_searchsource_immediate": Object { + "app": Object { + "canvas workpad": Object { + "type": "long", + }, + "dashboard": Object { + "type": "long", + }, + "search": Object { + "type": "long", + }, + "visualization": Object { + "type": "long", + }, + }, "available": Object { "type": "boolean", }, "deprecated": Object { "type": "long", }, + "layout": Object { + "canvas": Object { + "type": "long", + }, + "preserve_layout": Object { + "type": "long", + }, + "print": Object { + "type": "long", + }, + }, "total": Object { "type": "long", }, @@ -117,6 +389,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -128,6 +403,9 @@ Object { "type": "long", }, "layout": Object { + "canvas": Object { + "type": "long", + }, "preserve_layout": Object { "type": "long", }, @@ -147,6 +425,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -158,6 +439,9 @@ Object { "type": "long", }, "layout": Object { + "canvas": Object { + "type": "long", + }, "preserve_layout": Object { "type": "long", }, @@ -195,6 +479,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -206,6 +493,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -217,6 +507,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -228,6 +521,23 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, + "visualization": Object { + "type": "long", + }, + }, + "csv_searchsource_immediate": Object { + "canvas workpad": Object { + "type": "long", + }, + "dashboard": Object { + "type": "long", + }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -239,6 +549,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -250,6 +563,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -263,6 +579,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -274,6 +593,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -285,6 +607,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -296,6 +621,23 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, + "visualization": Object { + "type": "long", + }, + }, + "csv_searchsource_immediate": Object { + "canvas workpad": Object { + "type": "long", + }, + "dashboard": Object { + "type": "long", + }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -307,6 +649,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -318,6 +663,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -331,6 +679,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -342,6 +693,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -353,6 +707,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -364,6 +721,23 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, + "visualization": Object { + "type": "long", + }, + }, + "csv_searchsource_immediate": Object { + "canvas workpad": Object { + "type": "long", + }, + "dashboard": Object { + "type": "long", + }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -375,6 +749,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -386,6 +763,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -399,6 +779,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -410,6 +793,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -421,6 +807,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -432,6 +821,23 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, + "visualization": Object { + "type": "long", + }, + }, + "csv_searchsource_immediate": Object { + "canvas workpad": Object { + "type": "long", + }, + "dashboard": Object { + "type": "long", + }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -443,6 +849,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -454,6 +863,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -467,6 +879,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -478,6 +893,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -489,6 +907,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -500,6 +921,23 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, + "visualization": Object { + "type": "long", + }, + }, + "csv_searchsource_immediate": Object { + "canvas workpad": Object { + "type": "long", + }, + "dashboard": Object { + "type": "long", + }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -511,6 +949,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -522,6 +963,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -537,6 +981,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -548,6 +995,9 @@ Object { "type": "long", }, "layout": Object { + "canvas": Object { + "type": "long", + }, "preserve_layout": Object { "type": "long", }, @@ -567,6 +1017,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -578,6 +1031,9 @@ Object { "type": "long", }, "layout": Object { + "canvas": Object { + "type": "long", + }, "preserve_layout": Object { "type": "long", }, @@ -615,6 +1071,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -626,6 +1085,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -637,6 +1099,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -648,6 +1113,23 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, + "visualization": Object { + "type": "long", + }, + }, + "csv_searchsource_immediate": Object { + "canvas workpad": Object { + "type": "long", + }, + "dashboard": Object { + "type": "long", + }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -659,6 +1141,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -670,6 +1155,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -683,6 +1171,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -694,6 +1185,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -705,6 +1199,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -716,6 +1213,23 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, + "visualization": Object { + "type": "long", + }, + }, + "csv_searchsource_immediate": Object { + "canvas workpad": Object { + "type": "long", + }, + "dashboard": Object { + "type": "long", + }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -727,6 +1241,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -738,6 +1255,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -751,6 +1271,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -762,6 +1285,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -773,6 +1299,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -784,6 +1313,23 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, + "visualization": Object { + "type": "long", + }, + }, + "csv_searchsource_immediate": Object { + "canvas workpad": Object { + "type": "long", + }, + "dashboard": Object { + "type": "long", + }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -795,6 +1341,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -806,6 +1355,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -819,6 +1371,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -830,6 +1385,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -841,6 +1399,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -852,6 +1413,23 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, + "visualization": Object { + "type": "long", + }, + }, + "csv_searchsource_immediate": Object { + "canvas workpad": Object { + "type": "long", + }, + "dashboard": Object { + "type": "long", + }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -863,6 +1441,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -874,6 +1455,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -887,6 +1471,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -898,6 +1485,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -909,6 +1499,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -920,6 +1513,23 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, + "visualization": Object { + "type": "long", + }, + }, + "csv_searchsource_immediate": Object { + "canvas workpad": Object { + "type": "long", + }, + "dashboard": Object { + "type": "long", + }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -931,6 +1541,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -942,6 +1555,9 @@ Object { "dashboard": Object { "type": "long", }, + "search": Object { + "type": "long", + }, "visualization": Object { "type": "long", }, @@ -956,49 +1572,198 @@ Object { exports[`data modeling usage data with meta.isDeprecated jobTypes 1`] = ` Object { "PNG": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, + "PNGV2": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 0, }, "_all": 9, "available": true, "browser_type": undefined, "csv": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 4, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 4, }, "csv_searchsource": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 5, }, + "csv_searchsource_immediate": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, "enabled": true, "last7Days": Object { "PNG": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, + "PNGV2": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 0, }, "_all": 9, "csv": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 4, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 4, }, "csv_searchsource": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 5, }, + "csv_searchsource_immediate": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, "printable_pdf": Object { "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, + "printable_pdf_v2": Object { + "app": Object { + "canvas workpad": 0, "dashboard": 0, + "search": 0, "visualization": 0, }, "available": true, "deprecated": 0, "layout": Object { + "canvas": 0, "preserve_layout": 0, "print": 0, }, @@ -1021,12 +1786,31 @@ Object { }, "printable_pdf": Object { "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, + "printable_pdf_v2": Object { + "app": Object { + "canvas workpad": 0, "dashboard": 0, + "search": 0, "visualization": 0, }, "available": true, "deprecated": 0, "layout": Object { + "canvas": 0, "preserve_layout": 0, "print": 0, }, @@ -1052,49 +1836,198 @@ Object { exports[`data modeling with empty data 1`] = ` Object { "PNG": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, + "PNGV2": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 0, }, "_all": 0, "available": true, "browser_type": undefined, "csv": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 0, }, "csv_searchsource": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, + "csv_searchsource_immediate": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 0, }, "enabled": true, "last7Days": Object { "PNG": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, + "PNGV2": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 0, }, "_all": 0, "csv": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 0, }, "csv_searchsource": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, + "csv_searchsource_immediate": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 0, }, "printable_pdf": Object { "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, + "printable_pdf_v2": Object { + "app": Object { + "canvas workpad": 0, "dashboard": 0, + "search": 0, "visualization": 0, }, "available": true, "deprecated": 0, "layout": Object { + "canvas": 0, "preserve_layout": 0, "print": 0, }, @@ -1108,12 +2041,31 @@ Object { }, "printable_pdf": Object { "app": Object { + "canvas workpad": 0, "dashboard": 0, + "search": 0, "visualization": 0, }, "available": true, "deprecated": 0, "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, + "printable_pdf_v2": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, "preserve_layout": 0, "print": 0, }, @@ -1130,49 +2082,198 @@ Object { exports[`data modeling with normal looking usage data 1`] = ` Object { "PNG": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 3, }, + "PNGV2": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, "_all": 12, "available": true, "browser_type": undefined, "csv": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 0, }, "csv_searchsource": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, + "csv_searchsource_immediate": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 0, }, "enabled": true, "last7Days": Object { "PNG": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 1, }, + "PNGV2": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, "_all": 1, "csv": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 0, }, "csv_searchsource": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, + "csv_searchsource_immediate": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 0, }, "printable_pdf": Object { "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, + "printable_pdf_v2": Object { + "app": Object { + "canvas workpad": 0, "dashboard": 0, + "search": 0, "visualization": 0, }, "available": true, "deprecated": 0, "layout": Object { + "canvas": 0, "preserve_layout": 0, "print": 0, }, @@ -1195,16 +2296,34 @@ Object { "app": Object { "canvas workpad": 6, "dashboard": 0, + "search": 0, "visualization": 3, }, "available": true, "deprecated": 0, "layout": Object { + "canvas": 0, "preserve_layout": 9, "print": 0, }, "total": 9, }, + "printable_pdf_v2": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, "status": Object { "completed": 10, "completed_with_warnings": 1, @@ -1237,55 +2356,203 @@ Object { exports[`data modeling with sparse data 1`] = ` Object { "PNG": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 1, }, + "PNGV2": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, "_all": 4, "available": true, "browser_type": undefined, "csv": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 1, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 1, }, "csv_searchsource": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, + "csv_searchsource_immediate": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 0, }, "enabled": true, "last7Days": Object { "PNG": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 1, }, + "PNGV2": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, "_all": 4, "csv": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 1, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 1, }, "csv_searchsource": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, + "csv_searchsource_immediate": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 0, }, "printable_pdf": Object { "app": Object { "canvas workpad": 1, "dashboard": 1, + "search": 0, "visualization": 0, }, "available": true, "deprecated": 0, "layout": Object { + "canvas": 0, "preserve_layout": 2, "print": 0, }, "total": 2, }, + "printable_pdf_v2": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, "status": Object { "completed": 4, "failed": 0, @@ -1307,16 +2574,34 @@ Object { "app": Object { "canvas workpad": 1, "dashboard": 1, + "search": 0, "visualization": 0, }, "available": true, "deprecated": 0, "layout": Object { + "canvas": 0, "preserve_layout": 2, "print": 0, }, "total": 2, }, + "printable_pdf_v2": Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, + "available": true, + "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, + "total": 0, + }, "status": Object { "completed": 4, "failed": 0, diff --git a/x-pack/plugins/reporting/server/usage/decorate_range_stats.ts b/x-pack/plugins/reporting/server/usage/decorate_range_stats.ts deleted file mode 100644 index 99d4b7d934579..0000000000000 --- a/x-pack/plugins/reporting/server/usage/decorate_range_stats.ts +++ /dev/null @@ -1,97 +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 { uniq } from 'lodash'; -import { - CSV_JOB_TYPE, - CSV_JOB_TYPE_DEPRECATED, - DEPRECATED_JOB_TYPES, - PDF_JOB_TYPE, - PNG_JOB_TYPE, -} from '../../common/constants'; -import { AvailableTotal, ExportType, FeatureAvailabilityMap, RangeStats } from './types'; - -const jobTypeIsDeprecated = (jobType: string) => DEPRECATED_JOB_TYPES.includes(jobType); - -function getForFeature( - range: Partial, - typeKey: ExportType, - featureAvailability: FeatureAvailabilityMap, - additional?: any -): AvailableTotal & typeof additional { - const isAvailable = (feature: ExportType) => !!featureAvailability[feature]; - const jobType = range[typeKey] || { total: 0, ...additional, deprecated: 0 }; - - // merge the additional stats for the jobType - type AdditionalType = { [K in keyof typeof additional]: K }; - const filledAdditional: AdditionalType = {}; - if (additional) { - Object.keys(additional).forEach((k) => { - filledAdditional[k] = { ...additional[k], ...jobType[k] }; - }); - } - - // if the type itself is deprecated, all jobs are deprecated, otherwise only some of them might be - const deprecated = jobTypeIsDeprecated(typeKey) ? jobType.total : jobType.deprecated || 0; - - return { - available: isAvailable(typeKey), - total: jobType.total, - deprecated, - ...filledAdditional, - }; -} - -/* - * Decorates range stats (stats for last day, last 7 days, etc) with feature - * availability booleans, and zero-filling for unused features - * - * This function builds the result object for all export types found in the - * Reporting data, even if the type is unknown to this Kibana instance. - */ -export const decorateRangeStats = ( - rangeStats: Partial = {}, - featureAvailability: FeatureAvailabilityMap -): RangeStats => { - const { - _all: rangeAll, - status: rangeStatus, - statuses: rangeStatusByApp, - [PDF_JOB_TYPE]: rangeStatsPdf, - ...rangeStatsBasic - } = rangeStats; - - // combine the known types with any unknown type found in reporting data - const keysBasic = uniq([ - CSV_JOB_TYPE, - CSV_JOB_TYPE_DEPRECATED, - PNG_JOB_TYPE, - ...Object.keys(rangeStatsBasic), - ]) as ExportType[]; - const rangeBasic = keysBasic.reduce((accum, currentKey) => { - return { - ...accum, - [currentKey]: getForFeature(rangeStatsBasic, currentKey, featureAvailability), - }; - }, {}) as Partial; - const rangePdf = { - [PDF_JOB_TYPE]: getForFeature(rangeStats, PDF_JOB_TYPE, featureAvailability, { - app: { dashboard: 0, visualization: 0 }, - layout: { preserve_layout: 0, print: 0 }, - }), - }; - - const resultStats = { - _all: rangeAll || 0, - status: { completed: 0, failed: 0, ...rangeStatus }, - statuses: rangeStatusByApp, - ...rangePdf, - ...rangeBasic, - } as RangeStats; - - return resultStats; -}; diff --git a/x-pack/plugins/reporting/server/usage/decorate_range_stats.test.ts b/x-pack/plugins/reporting/server/usage/get_export_stats.test.ts similarity index 64% rename from x-pack/plugins/reporting/server/usage/decorate_range_stats.test.ts rename to x-pack/plugins/reporting/server/usage/get_export_stats.test.ts index ca1677c2379fc..782f2e910038e 100644 --- a/x-pack/plugins/reporting/server/usage/decorate_range_stats.test.ts +++ b/x-pack/plugins/reporting/server/usage/get_export_stats.test.ts @@ -5,7 +5,9 @@ * 2.0. */ -import { decorateRangeStats } from './decorate_range_stats'; +import { getExportTypesRegistry } from '../lib'; +import { getExportStats } from './get_export_stats'; +import { getExportTypesHandler } from './get_export_type_handler'; import { FeatureAvailabilityMap } from './types'; let featureMap: FeatureAvailabilityMap; @@ -14,8 +16,10 @@ beforeEach(() => { featureMap = { PNG: true, csv: true, csv_searchsource: true, printable_pdf: true }; }); +const exportTypesHandler = getExportTypesHandler(getExportTypesRegistry()); + test('Model of job status and status-by-pdf-app', () => { - const result = decorateRangeStats( + const result = getExportStats( { status: { completed: 0, processing: 1, pending: 2, failed: 3 }, statuses: { @@ -24,7 +28,8 @@ test('Model of job status and status-by-pdf-app', () => { failed: { printable_pdf: { visualization: 2, dashboard: 2, 'canvas workpad': 1 } }, }, }, - featureMap + featureMap, + exportTypesHandler ); expect(result.status).toMatchInlineSnapshot(` @@ -60,7 +65,7 @@ test('Model of job status and status-by-pdf-app', () => { }); test('Model of jobTypes', () => { - const result = decorateRangeStats( + const result = getExportStats( { PNG: { available: true, total: 3 }, printable_pdf: { @@ -71,27 +76,61 @@ test('Model of jobTypes', () => { }, csv_searchsource: { available: true, total: 3 }, }, - featureMap + featureMap, + exportTypesHandler ); expect(result.PNG).toMatchInlineSnapshot(` Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 3, } `); expect(result.csv).toMatchInlineSnapshot(` Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 0, } `); expect(result.csv_searchsource).toMatchInlineSnapshot(` Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 0, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 3, } `); @@ -100,11 +139,13 @@ test('Model of jobTypes', () => { "app": Object { "canvas workpad": 3, "dashboard": 0, + "search": 0, "visualization": 0, }, "available": true, "deprecated": 0, "layout": Object { + "canvas": 0, "preserve_layout": 3, "print": 0, }, @@ -114,28 +155,52 @@ test('Model of jobTypes', () => { }); test('PNG counts, provided count of deprecated jobs explicitly', () => { - const result = decorateRangeStats( + const result = getExportStats( { PNG: { available: true, total: 15, deprecated: 5 } }, - featureMap + featureMap, + exportTypesHandler ); expect(result.PNG).toMatchInlineSnapshot(` Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 5, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 15, } `); }); test('CSV counts, provides all jobs implicitly deprecated due to jobtype', () => { - const result = decorateRangeStats( + const result = getExportStats( { csv: { available: true, total: 15, deprecated: 0 } }, - featureMap + featureMap, + exportTypesHandler ); expect(result.csv).toMatchInlineSnapshot(` Object { + "app": Object { + "canvas workpad": 0, + "dashboard": 0, + "search": 0, + "visualization": 0, + }, "available": true, "deprecated": 15, + "layout": Object { + "canvas": 0, + "preserve_layout": 0, + "print": 0, + }, "total": 15, } `); diff --git a/x-pack/plugins/reporting/server/usage/get_export_stats.ts b/x-pack/plugins/reporting/server/usage/get_export_stats.ts new file mode 100644 index 0000000000000..ffdb6cdc290d7 --- /dev/null +++ b/x-pack/plugins/reporting/server/usage/get_export_stats.ts @@ -0,0 +1,90 @@ +/* + * 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 { DEPRECATED_JOB_TYPES } from '../../common/constants'; +import { ExportTypesHandler } from './get_export_type_handler'; +import { AvailableTotal, FeatureAvailabilityMap, RangeStats } from './types'; + +const jobTypeIsDeprecated = (jobType: string) => DEPRECATED_JOB_TYPES.includes(jobType); +const defaultTotalsForFeature: Omit = { + total: 0, + deprecated: 0, + app: { 'canvas workpad': 0, search: 0, visualization: 0, dashboard: 0 }, + layout: { canvas: 0, print: 0, preserve_layout: 0 }, +}; + +const isAvailable = (featureAvailability: FeatureAvailabilityMap, feature: string) => + !!featureAvailability[feature]; + +function getAvailableTotalForFeature( + jobType: AvailableTotal, + typeKey: string, + featureAvailability: FeatureAvailabilityMap +): AvailableTotal { + // if the type itself is deprecated, all jobs are deprecated, otherwise only some of them might be + const deprecated = jobTypeIsDeprecated(typeKey) ? jobType.total : jobType.deprecated || 0; + + // merge the additional stats for the jobType + const availableTotal = { + available: isAvailable(featureAvailability, typeKey), + total: jobType.total, + deprecated, + app: { ...defaultTotalsForFeature.app, ...jobType.app }, + layout: { ...defaultTotalsForFeature.layout, ...jobType.layout }, + }; + + return availableTotal as AvailableTotal; +} + +/* + * Decorates range stats (stats for last day, last 7 days, etc) with feature + * availability booleans, and zero-filling for unused features + * + * This function builds the result object for all export types found in the + * Reporting data, even if the type is unknown to this Kibana instance. + */ +export const getExportStats = ( + rangeStatsInput: Partial = {}, + featureAvailability: FeatureAvailabilityMap, + exportTypesHandler: ExportTypesHandler +) => { + const { + _all: rangeAll, + status: rangeStatus, + statuses: rangeStatusByApp, + ...rangeStats + } = rangeStatsInput; + + // combine the known types with any unknown type found in reporting data + const statsForExportType = exportTypesHandler.getJobTypes().reduce((accum, exportType) => { + const availableTotal = rangeStats[exportType as keyof typeof rangeStats]; + + if (!availableTotal) { + return { + ...accum, + [exportType]: { + available: isAvailable(featureAvailability, exportType), + ...defaultTotalsForFeature, + }, + }; + } + + return { + ...accum, + [exportType]: getAvailableTotalForFeature(availableTotal, exportType, featureAvailability), + }; + }, {}); + + const resultStats = { + ...statsForExportType, + _all: rangeAll || 0, + status: { completed: 0, failed: 0, ...rangeStatus }, + statuses: rangeStatusByApp, + } as RangeStats; + + return resultStats; +}; diff --git a/x-pack/plugins/reporting/server/usage/get_export_type_handler.ts b/x-pack/plugins/reporting/server/usage/get_export_type_handler.ts index b741f9dcfbe6b..d44790ccdeede 100644 --- a/x-pack/plugins/reporting/server/usage/get_export_type_handler.ts +++ b/x-pack/plugins/reporting/server/usage/get_export_type_handler.ts @@ -15,6 +15,13 @@ import { FeaturesAvailability } from './'; */ export function getExportTypesHandler(exportTypesRegistry: ExportTypesRegistry) { return { + /* + * Allow usage collection to loop through each registered job type + */ + getJobTypes() { + return exportTypesRegistry.getAll().map(({ jobType }) => jobType); + }, + /* * Based on the X-Pack license and which export types are available, * returns an object where the keys are the export types and the values are @@ -46,3 +53,5 @@ export function getExportTypesHandler(exportTypesRegistry: ExportTypesRegistry) }, }; } + +export type ExportTypesHandler = ReturnType; diff --git a/x-pack/plugins/reporting/server/usage/get_reporting_usage.ts b/x-pack/plugins/reporting/server/usage/get_reporting_usage.ts index e5801b30caff6..8a1b2532cbcaa 100644 --- a/x-pack/plugins/reporting/server/usage/get_reporting_usage.ts +++ b/x-pack/plugins/reporting/server/usage/get_reporting_usage.ts @@ -10,7 +10,7 @@ import { get } from 'lodash'; import type { ReportingConfig } from '../'; import type { ExportTypesRegistry } from '../lib/export_types_registry'; import type { GetLicense } from './'; -import { decorateRangeStats } from './decorate_range_stats'; +import { getExportStats } from './get_export_stats'; import { getExportTypesHandler } from './get_export_type_handler'; import type { AggregationResultBuckets, @@ -108,11 +108,16 @@ type RangeStatSets = Partial & { type ESResponse = Partial; async function handleResponse(response: ESResponse): Promise> { - const buckets = get(response, 'aggregations.ranges.buckets'); + const buckets = get(response, 'aggregations.ranges.buckets') as Record< + 'all' | 'last7Days', + AggregationResultBuckets + >; + if (!buckets) { return {}; } - const { last7Days, all } = buckets as any; + + const { all, last7Days } = buckets; const last7DaysUsage = last7Days ? getAggStats(last7Days) : {}; const allUsage = all ? getAggStats(all) : {}; @@ -196,8 +201,8 @@ export async function getReportingUsage( available: true, browser_type: browserType, enabled: true, - last7Days: decorateRangeStats(last7Days, availability), - ...decorateRangeStats(all, availability), + last7Days: getExportStats(last7Days, availability, exportTypesHandler), + ...getExportStats(all, availability, exportTypesHandler), }; } ); diff --git a/x-pack/plugins/reporting/server/usage/reporting_usage_collector.test.ts b/x-pack/plugins/reporting/server/usage/reporting_usage_collector.test.ts index 31ce6581d7de6..92e85d3532c15 100644 --- a/x-pack/plugins/reporting/server/usage/reporting_usage_collector.test.ts +++ b/x-pack/plugins/reporting/server/usage/reporting_usage_collector.test.ts @@ -18,7 +18,7 @@ import { getReportingUsageCollector, registerReportingUsageCollector, } from './reporting_usage_collector'; -import { ReportingUsageType, SearchResponse } from './types'; +import { SearchResponse } from './types'; const exportTypesRegistry = getExportTypesRegistry(); @@ -478,161 +478,6 @@ describe('data modeling', () => { const usageStats = await collector.fetch(collectorFetchContext); expect(usageStats).toMatchSnapshot(); }); - - test('Cast various example data to the TypeScript definition', () => { - const check = (obj: ReportingUsageType) => { - return typeof obj; - }; - - // just check that the example objects can be cast to ReportingUsageType - check({ - PNG: { available: true, total: 7 }, - PNGV2: { available: true, total: 7 }, - _all: 21, - available: true, - browser_type: 'chromium', - csv: { available: true, total: 4 }, - csv_searchsource: { available: true, total: 4 }, - enabled: true, - last7Days: { - PNG: { available: true, total: 0 }, - PNGV2: { available: true, total: 0 }, - _all: 0, - csv: { available: true, total: 0 }, - csv_searchsource: { available: true, total: 0 }, - printable_pdf: { - app: { dashboard: 0, visualization: 0 }, - available: true, - layout: { preserve_layout: 0, print: 0 }, - total: 0, - }, - printable_pdf_v2: { - app: { dashboard: 0, visualization: 0 }, - available: true, - layout: { preserve_layout: 0, print: 0 }, - total: 0, - }, - status: { completed: 0, failed: 0 }, - statuses: {}, - }, - printable_pdf: { - app: { 'canvas workpad': 3, dashboard: 3, visualization: 4 }, - available: true, - layout: { preserve_layout: 7, print: 3 }, - total: 10, - }, - printable_pdf_v2: { - app: { 'canvas workpad': 3, dashboard: 3, visualization: 4 }, - available: true, - layout: { preserve_layout: 7, print: 3 }, - total: 10, - }, - status: { completed: 21, failed: 0 }, - statuses: { - completed: { - PNG: { dashboard: 3, visualization: 4 }, - PNGV2: { dashboard: 3, visualization: 4 }, - csv: {}, - printable_pdf: { 'canvas workpad': 3, dashboard: 3, visualization: 4 }, - printable_pdf_v2: { 'canvas workpad': 3, dashboard: 3, visualization: 4 }, - }, - }, - }); - check({ - PNG: { available: true, total: 3 }, - PNGV2: { available: true, total: 3 }, - _all: 4, - available: true, - browser_type: 'chromium', - csv: { available: true, total: 0 }, - csv_searchsource: { available: true, total: 0 }, - enabled: true, - last7Days: { - PNG: { available: true, total: 3 }, - PNGV2: { available: true, total: 3 }, - _all: 4, - csv: { available: true, total: 0 }, - csv_searchsource: { available: true, total: 0 }, - printable_pdf: { - app: { 'canvas workpad': 1, dashboard: 0, visualization: 0 }, - available: true, - layout: { preserve_layout: 1, print: 0 }, - total: 1, - }, - printable_pdf_v2: { - app: { 'canvas workpad': 1, dashboard: 0, visualization: 0 }, - available: true, - layout: { preserve_layout: 1, print: 0 }, - total: 1, - }, - status: { completed: 4, failed: 0 }, - statuses: { - completed: { PNG: { visualization: 3 }, printable_pdf: { 'canvas workpad': 1 } }, - }, - }, - printable_pdf: { - app: { 'canvas workpad': 1, dashboard: 0, visualization: 0 }, - available: true, - layout: { preserve_layout: 1, print: 0 }, - total: 1, - }, - printable_pdf_v2: { - app: { 'canvas workpad': 1, dashboard: 0, visualization: 0 }, - available: true, - layout: { preserve_layout: 1, print: 0 }, - total: 1, - }, - status: { completed: 4, failed: 0 }, - statuses: { - completed: { PNG: { visualization: 3 }, printable_pdf: { 'canvas workpad': 1 } }, - }, - }); - check({ - available: true, - browser_type: 'chromium', - enabled: true, - last7Days: { - _all: 0, - status: { completed: 0, failed: 0 }, - statuses: {}, - printable_pdf: { - available: true, - total: 0, - app: { dashboard: 0, visualization: 0 }, - layout: { preserve_layout: 0, print: 0 }, - }, - printable_pdf_v2: { - available: true, - total: 0, - app: { dashboard: 0, visualization: 0 }, - layout: { preserve_layout: 0, print: 0 }, - }, - csv: { available: true, total: 0 }, - csv_searchsource: { available: true, total: 0 }, - PNG: { available: true, total: 0 }, - PNGV2: { available: true, total: 0 }, - }, - _all: 0, - status: { completed: 0, failed: 0 }, - statuses: {}, - printable_pdf: { - available: true, - total: 0, - app: { dashboard: 0, visualization: 0 }, - layout: { preserve_layout: 0, print: 0 }, - }, - printable_pdf_v2: { - available: true, - total: 0, - app: { dashboard: 0, visualization: 0 }, - layout: { preserve_layout: 0, print: 0 }, - }, - csv: { available: true, total: 0 }, - csv_searchsource: { available: true, total: 0 }, - PNG: { available: true, total: 0 }, - PNGV2: { available: true, total: 0 }, - }); - }); }); describe('Ready for collection observable', () => { diff --git a/x-pack/plugins/reporting/server/usage/schema.ts b/x-pack/plugins/reporting/server/usage/schema.ts index 54545dd23509b..02bf65e7c5e4d 100644 --- a/x-pack/plugins/reporting/server/usage/schema.ts +++ b/x-pack/plugins/reporting/server/usage/schema.ts @@ -11,19 +11,28 @@ import { AvailableTotal, ByAppCounts, JobTypes, + LayoutCounts, RangeStats, ReportingUsageType, } from './types'; const appCountsSchema: MakeSchemaFrom = { + search: { type: 'long' }, 'canvas workpad': { type: 'long' }, dashboard: { type: 'long' }, visualization: { type: 'long' }, }; +const layoutCountsSchema: MakeSchemaFrom = { + canvas: { type: 'long' }, + print: { type: 'long' }, + preserve_layout: { type: 'long' }, +}; + const byAppCountsSchema: MakeSchemaFrom = { csv: appCountsSchema, csv_searchsource: appCountsSchema, + csv_searchsource_immediate: appCountsSchema, PNG: appCountsSchema, PNGV2: appCountsSchema, printable_pdf: appCountsSchema, @@ -34,29 +43,18 @@ const availableTotalSchema: MakeSchemaFrom = { available: { type: 'boolean' }, total: { type: 'long' }, deprecated: { type: 'long' }, + app: appCountsSchema, + layout: layoutCountsSchema, }; const jobTypesSchema: MakeSchemaFrom = { csv: availableTotalSchema, csv_searchsource: availableTotalSchema, + csv_searchsource_immediate: availableTotalSchema, PNG: availableTotalSchema, PNGV2: availableTotalSchema, - printable_pdf: { - ...availableTotalSchema, - app: appCountsSchema, - layout: { - print: { type: 'long' }, - preserve_layout: { type: 'long' }, - }, - }, - printable_pdf_v2: { - ...availableTotalSchema, - app: appCountsSchema, - layout: { - print: { type: 'long' }, - preserve_layout: { type: 'long' }, - }, - }, + printable_pdf: availableTotalSchema, + printable_pdf_v2: availableTotalSchema, }; const rangeStatsSchema: MakeSchemaFrom = { diff --git a/x-pack/plugins/reporting/server/usage/types.ts b/x-pack/plugins/reporting/server/usage/types.ts index 389dc27c46c66..7bd79de090b37 100644 --- a/x-pack/plugins/reporting/server/usage/types.ts +++ b/x-pack/plugins/reporting/server/usage/types.ts @@ -61,37 +61,40 @@ export interface AvailableTotal { available: boolean; total: number; deprecated?: number; + app?: { + search?: number; + dashboard?: number; + visualization?: number; + 'canvas workpad'?: number; + }; + layout?: { + print?: number; + preserve_layout?: number; + canvas?: number; + }; } +// FIXME: find a way to get this from exportTypesHandler or common/constants type BaseJobTypes = | 'csv' | 'csv_searchsource' + | 'csv_searchsource_immediate' | 'PNG' | 'PNGV2' | 'printable_pdf' | 'printable_pdf_v2'; export interface LayoutCounts { + canvas: number; print: number; preserve_layout: number; } -type AppNames = 'canvas workpad' | 'dashboard' | 'visualization'; export type AppCounts = { - [A in AppNames]?: number; + [A in 'canvas workpad' | 'dashboard' | 'visualization' | 'search']?: number; }; -export type JobTypes = { [K in BaseJobTypes]: AvailableTotal } & { - printable_pdf: AvailableTotal & { - app: AppCounts; - layout: LayoutCounts; - }; -} & { - printable_pdf_v2: AvailableTotal & { - app: AppCounts; - layout: LayoutCounts; - }; -}; +export type JobTypes = { [K in BaseJobTypes]: AvailableTotal }; export type ByAppCounts = { [J in BaseJobTypes]?: AppCounts }; @@ -117,8 +120,7 @@ export type ReportingUsageType = RangeStats & { last7Days: RangeStats; }; -export type ExportType = 'csv' | 'csv_searchsource' | 'printable_pdf' | 'PNG'; -export type FeatureAvailabilityMap = { [F in ExportType]: boolean }; +export type FeatureAvailabilityMap = Record; export interface ReportingUsageSearchResponse { aggregations: { 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 5910de62271e9..642189f716539 100644 --- a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json +++ b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @@ -4050,6 +4050,35 @@ }, "deprecated": { "type": "long" + }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "layout": { + "properties": { + "canvas": { + "type": "long" + }, + "print": { + "type": "long" + }, + "preserve_layout": { + "type": "long" + } + } } } }, @@ -4063,6 +4092,77 @@ }, "deprecated": { "type": "long" + }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "layout": { + "properties": { + "canvas": { + "type": "long" + }, + "print": { + "type": "long" + }, + "preserve_layout": { + "type": "long" + } + } + } + } + }, + "csv_searchsource_immediate": { + "properties": { + "available": { + "type": "boolean" + }, + "total": { + "type": "long" + }, + "deprecated": { + "type": "long" + }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "layout": { + "properties": { + "canvas": { + "type": "long" + }, + "print": { + "type": "long" + }, + "preserve_layout": { + "type": "long" + } + } } } }, @@ -4076,6 +4176,35 @@ }, "deprecated": { "type": "long" + }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "layout": { + "properties": { + "canvas": { + "type": "long" + }, + "print": { + "type": "long" + }, + "preserve_layout": { + "type": "long" + } + } } } }, @@ -4089,6 +4218,35 @@ }, "deprecated": { "type": "long" + }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "layout": { + "properties": { + "canvas": { + "type": "long" + }, + "print": { + "type": "long" + }, + "preserve_layout": { + "type": "long" + } + } } } }, @@ -4105,6 +4263,9 @@ }, "app": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4118,6 +4279,9 @@ }, "layout": { "properties": { + "canvas": { + "type": "long" + }, "print": { "type": "long" }, @@ -4141,6 +4305,9 @@ }, "app": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4154,6 +4321,9 @@ }, "layout": { "properties": { + "canvas": { + "type": "long" + }, "print": { "type": "long" }, @@ -4192,6 +4362,9 @@ "properties": { "csv": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4205,6 +4378,25 @@ }, "csv_searchsource": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "csv_searchsource_immediate": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4218,6 +4410,9 @@ }, "PNG": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4231,6 +4426,9 @@ }, "PNGV2": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4244,6 +4442,9 @@ }, "printable_pdf": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4257,6 +4458,9 @@ }, "printable_pdf_v2": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4274,6 +4478,9 @@ "properties": { "csv": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4287,6 +4494,25 @@ }, "csv_searchsource": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "csv_searchsource_immediate": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4300,6 +4526,9 @@ }, "PNG": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4313,6 +4542,9 @@ }, "PNGV2": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4326,6 +4558,9 @@ }, "printable_pdf": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4339,6 +4574,9 @@ }, "printable_pdf_v2": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4356,6 +4594,9 @@ "properties": { "csv": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4369,6 +4610,25 @@ }, "csv_searchsource": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "csv_searchsource_immediate": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4382,6 +4642,9 @@ }, "PNG": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4395,6 +4658,9 @@ }, "PNGV2": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4408,6 +4674,9 @@ }, "printable_pdf": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4421,6 +4690,9 @@ }, "printable_pdf_v2": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4438,6 +4710,9 @@ "properties": { "csv": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4451,6 +4726,25 @@ }, "csv_searchsource": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "csv_searchsource_immediate": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4464,6 +4758,9 @@ }, "PNG": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4477,6 +4774,9 @@ }, "PNGV2": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4490,6 +4790,9 @@ }, "printable_pdf": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4503,6 +4806,9 @@ }, "printable_pdf_v2": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4520,6 +4826,9 @@ "properties": { "csv": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4533,6 +4842,25 @@ }, "csv_searchsource": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "csv_searchsource_immediate": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4546,6 +4874,9 @@ }, "PNG": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4559,6 +4890,83 @@ }, "PNGV2": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "printable_pdf": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "printable_pdf_v2": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + } + } + } + } + }, + "available": { + "type": "boolean" + }, + "browser_type": { + "type": "keyword" + }, + "enabled": { + "type": "boolean" + }, + "last7Days": { + "properties": { + "csv": { + "properties": { + "available": { + "type": "boolean" + }, + "total": { + "type": "long" + }, + "deprecated": { + "type": "long" + }, + "app": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4570,8 +4978,37 @@ } } }, - "printable_pdf": { + "layout": { + "properties": { + "canvas": { + "type": "long" + }, + "print": { + "type": "long" + }, + "preserve_layout": { + "type": "long" + } + } + } + } + }, + "csv_searchsource": { + "properties": { + "available": { + "type": "boolean" + }, + "total": { + "type": "long" + }, + "deprecated": { + "type": "long" + }, + "app": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4583,35 +5020,22 @@ } } }, - "printable_pdf_v2": { + "layout": { "properties": { - "canvas workpad": { + "canvas": { "type": "long" }, - "dashboard": { + "print": { "type": "long" }, - "visualization": { + "preserve_layout": { "type": "long" } } } } - } - } - }, - "available": { - "type": "boolean" - }, - "browser_type": { - "type": "keyword" - }, - "enabled": { - "type": "boolean" - }, - "last7Days": { - "properties": { - "csv": { + }, + "csv_searchsource_immediate": { "properties": { "available": { "type": "boolean" @@ -4621,19 +5045,35 @@ }, "deprecated": { "type": "long" - } - } - }, - "csv_searchsource": { - "properties": { - "available": { - "type": "boolean" }, - "total": { - "type": "long" + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } }, - "deprecated": { - "type": "long" + "layout": { + "properties": { + "canvas": { + "type": "long" + }, + "print": { + "type": "long" + }, + "preserve_layout": { + "type": "long" + } + } } } }, @@ -4647,6 +5087,35 @@ }, "deprecated": { "type": "long" + }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "layout": { + "properties": { + "canvas": { + "type": "long" + }, + "print": { + "type": "long" + }, + "preserve_layout": { + "type": "long" + } + } } } }, @@ -4660,6 +5129,35 @@ }, "deprecated": { "type": "long" + }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "layout": { + "properties": { + "canvas": { + "type": "long" + }, + "print": { + "type": "long" + }, + "preserve_layout": { + "type": "long" + } + } } } }, @@ -4676,6 +5174,9 @@ }, "app": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4689,6 +5190,9 @@ }, "layout": { "properties": { + "canvas": { + "type": "long" + }, "print": { "type": "long" }, @@ -4712,6 +5216,9 @@ }, "app": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4725,6 +5232,9 @@ }, "layout": { "properties": { + "canvas": { + "type": "long" + }, "print": { "type": "long" }, @@ -4763,6 +5273,9 @@ "properties": { "csv": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4776,6 +5289,25 @@ }, "csv_searchsource": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "csv_searchsource_immediate": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4789,6 +5321,9 @@ }, "PNG": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4802,6 +5337,9 @@ }, "PNGV2": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4815,6 +5353,9 @@ }, "printable_pdf": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4828,6 +5369,9 @@ }, "printable_pdf_v2": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4845,6 +5389,9 @@ "properties": { "csv": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4858,6 +5405,25 @@ }, "csv_searchsource": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "csv_searchsource_immediate": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4871,6 +5437,9 @@ }, "PNG": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4884,6 +5453,9 @@ }, "PNGV2": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4897,6 +5469,9 @@ }, "printable_pdf": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4910,6 +5485,9 @@ }, "printable_pdf_v2": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4927,6 +5505,9 @@ "properties": { "csv": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4940,6 +5521,25 @@ }, "csv_searchsource": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "csv_searchsource_immediate": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4953,6 +5553,9 @@ }, "PNG": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4966,6 +5569,9 @@ }, "PNGV2": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4979,6 +5585,9 @@ }, "printable_pdf": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4992,6 +5601,9 @@ }, "printable_pdf_v2": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -5009,6 +5621,9 @@ "properties": { "csv": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -5022,6 +5637,25 @@ }, "csv_searchsource": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "csv_searchsource_immediate": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -5035,6 +5669,9 @@ }, "PNG": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -5048,6 +5685,9 @@ }, "PNGV2": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -5061,6 +5701,9 @@ }, "printable_pdf": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -5074,6 +5717,9 @@ }, "printable_pdf_v2": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -5091,6 +5737,9 @@ "properties": { "csv": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -5104,6 +5753,25 @@ }, "csv_searchsource": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "csv_searchsource_immediate": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -5117,6 +5785,9 @@ }, "PNG": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -5130,6 +5801,9 @@ }, "PNGV2": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -5143,6 +5817,9 @@ }, "printable_pdf": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -5156,6 +5833,9 @@ }, "printable_pdf_v2": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" },